]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_sip: Resolve externhost not to IPv6; instead go for IPv4. 68/3968/1
authorAlexander Traud <pabstraud@compuserve.com>
Fri, 23 Sep 2016 14:54:28 +0000 (16:54 +0200)
committerAlexander Traud <pabstraud@compuserve.com>
Fri, 23 Sep 2016 14:59:14 +0000 (09:59 -0500)
commit0502675e5c7ab77b7359776b77166d28760978af
tree3f4a0e0c2a8fb97e0a597db4acc4b8d70d15789b
parent7cce1a781754820ce889426287765df39c60d083
chan_sip: Resolve externhost not to IPv6; instead go for IPv4.

For the channel driver chan_sip, you specify externhost=example.com in sip.conf
when your Asterisk is behind a NAT and your IP address is assigned dynamically.
Or stated differently: You do not have a static IP address to use "externaddr"
directly. This NAT support is quite handy but just about IPv4. Previously,
Asterisk resolved "externhost" to any IP version. When the first DNS answer
resolved to an IPv6, Asterisk sent an IPv6 in SIP/SDP for origin (o=) and
connection (c=). This happened in outgoing SIP-REGISTER and while answering
SIP-INVITE. If the remote peer is IPv4-only, it might not handle o=/c= with an
IPv6. This change makes sure, no IPv6 is resolved anymore for "externhost".

ASTERISK-18232 #close
Reported by: Jacek Kowalski
Tested by: Alexander Traud
patches:
 changes.patch submitted by Alessandro Crespi

Change-Id: If68eedbeff65bd1c1d8a9ed921c02ba464b32dac
channels/chan_sip.c