[svn-commits] mmichelson: branch 1.4 r140417 - /branches/1.4/channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Aug 29 10:26:53 CDT 2008


Author: mmichelson
Date: Fri Aug 29 10:26:52 2008
New Revision: 140417

URL: http://svn.digium.com/view/asterisk?view=rev&rev=140417
Log:
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


Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=140417&r1=140416&r2=140417
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Fri Aug 29 10:26:52 2008
@@ -2903,14 +2903,18 @@
 	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;




More information about the svn-commits mailing list