aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-10 15:22:26 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-10 15:22:26 +0000
commit4a90fc41fd7859f847c93cb01514fcc9ab5f2de9 (patch)
tree9f65574525ea7e0182855245d3bdd9bcb0da0683 /channels
parent65dd912dc1cd795b5f8f98a72eb581911ac38a3f (diff)
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: http://svn.digium.com/svn/asterisk/trunk@162619 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 93912fc0b..12d5944ba 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