From: Joshua Colp Date: Wed, 10 Dec 2008 15:22:26 +0000 (+0000) Subject: When transmitting a register set the socket port to the local one for the transport... X-Git-Tag: 1.6.2.0-beta1~675 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8c152f7f0576ed97518a934351aa70de9b4aed8;p=thirdparty%2Fasterisk.git When transmitting a register set the socket port to the local one for the transport being used, not the port for the remote server. (closes issue #13633) Reported by: performer git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@162619 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 93912fc0b0..12d5944ba3 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -10545,7 +10545,9 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char * /* Set transport and port so the correct contact is built */ p->socket.type = r->transport; - p->socket.port = htons(r->portno); + if (r->transport == SIP_TRANSPORT_TLS || r->transport == SIP_TRANSPORT_TCP) { + p->socket.port = sip_tcp_desc.local_address.sin_port; + } /* check which address we should use in our contact header