aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-29 15:26:52 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-29 15:26:52 +0000
commit30081baa732bacdd2aa3286a79ea00be42a74709 (patch)
tree7748c1db66f98b530e056642655fd52c275c56d0 /channels
parent4c77aae2a6a70acf89c17ebb4f7a63b387f75d2e (diff)
Fix SIP's parsing so that if a port is specified
in a string to Dial(), it is not ignored. (closes issue #13355) Reported by: acunningham Patches: 13355v2.patch uploaded by putnopvut (license 60) Tested by: acunningham git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@140417 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index e873a162f..a99428774 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2903,14 +2903,18 @@ static int create_addr(struct sip_pvt *dialog, const char *opeer)
dialog->sa.sin_family = AF_INET;
dialog->timer_t1 = 500; /* Default SIP retransmission timer T1 (RFC 3261) */
p = find_peer(peer, NULL, 1, 0);
+
+ portno = port ? atoi(port) : STANDARD_SIP_PORT;
if (p) {
int res = create_addr_from_peer(dialog, p);
+ if (portno) {
+ dialog->sa.sin_port = dialog->recv.sin_port = htons(portno);
+ }
ASTOBJ_UNREF(p, sip_destroy_peer);
return res;
}
hostn = peer;
- portno = port ? atoi(port) : STANDARD_SIP_PORT;
if (srvlookup) {
char service[MAXHOSTNAMELEN];
int tportno;