[asterisk-bugs] [JIRA] (ASTERISK-26309) [patch] res_pjsip: Allow IPv4/IPv6 (Dual Stack) installations.

Alexander Traud (JIRA) noreply at issues.asterisk.org
Sat Aug 20 09:03:57 CDT 2016


     [ https://issues.asterisk.org/jira/browse/ASTERISK-26309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Traud updated ASTERISK-26309:
---------------------------------------

    Comment: was deleted

(was: Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].)

> [patch] res_pjsip: Allow IPv4/IPv6 (Dual Stack) installations.
> --------------------------------------------------------------
>
>                 Key: ASTERISK-26309
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-26309
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_pjsip_sdp_rtp
>    Affects Versions: 13.10.0
>            Reporter: Alexander Traud
>         Attachments: 0003-r5403-pjsip_IPV6_V6ONLY.patch, chan_pjsip_Dual_Stack_RTP.patch, chan_pjsip_Migration_Script.patch
>
>
> When you enable IPv6, you do not want to create an IPv6-only server but stay compatible with legacy IPv4 based networks. For this, your server listens to IPv4 and IPv6 on the same interface. This is called Dual Stack and works for the channel driver chan_sip already. However for those, who [migrate to res_pjsip|https://wiki.asterisk.org/wiki/display/AST/Migrating+from+chan_sip+to+res_pjsip], you have to
> A) set 1 in the file /proc/sys/net/ipv6/bindv6only
> B) wait for the next PJSIP release 2.6.0, or
> C) checkout [change-set 5403|https://trac.pjsip.org/repos/changeset/5403], for example in Ubuntu 16.04 LTS:
> {noformat}sudo service asterisk stop
> sudo apt install libsrtp0-dev libspeexdsp-dev libgsm1-dev libsamplerate-dev libasound-dev
> wget github.com/pjsip/pjproject/archive/master.tar.gz
> tar zxf master.tar.gz
> cd ./pjproject*
> CFLAGS='-DNDEBUG -DPJ_HAS_IPV6=1' ./configure --prefix=/usr --enable-shared --with-external-srtp --with-external-speex --with-external-gsm --enable-libsamplerate --enable-epoll
> make dep all
> sudo make install
> sudo service asterisk start{noformat}
> With chan_sip, you enabled Dual Stack either by removing every {{bindaddr}} or by using {{::}} instead of {{0.0.0.0}} in {{/etc/asterisk/sip.conf}}. To get Dual Stack in res_pjsip, you have to create _two_ transports in {{/etc/asterisk/pjsip.conf}}, one with {{0.0.0.0}} and one with {{\[::\]}}
> {noformat}[transport-udp6]
> type=transport
> protocol=udp
> bind=[::]
> [transport-udp]
> type=transport
> protocol=udp
> bind=0.0.0.0{noformat}
> However even then, you had to choose the IP version for each ‘endpoint’ in your {{/etc/asterisk/pjsip.conf}} via {{rtp_ipv6=yes}}. Consequently, you had to choose the IP version regardless how that VoIP/SIP client connected, regardless the capabilities on the client changed (firmware update, changed setting, or usage of a different mobile app). This is not feasible for an Asterisk installation in which the clients may connect via unknown networks or the Asterisk administrator is not in charge of the VoIP/SIP clients. Workarounds were to
> A) go back to chan_sip,
> B) provide a separate IPv6-only registrar/proxy address to end users, or
> C) go for an IPv4-only installation.
> The attached patch resolves this issue by removing the need for {{rtp_ipv6}} (or {{t38_udptl_ipv6}}) in {{/etc/asterisk/pjsip.conf}}. With that patch, res_pjsip re-uses the IP version of an already registered client. That way, res_pjsip turns Dual Stack capable and even calls between the same endpoint but different IP versions work. The second patch updates the migration script sip_to_pjsip.py to create two transports. The third patch, adds change-set 5403 to the [bundled PJProject|https://wiki.asterisk.org/wiki/display/AST/Building+and+Installing+pjproject#BuildingandInstallingpjproject-bundled], so you do not have to wait for PJProject 2.6.0.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list