[asterisk-commits] qwell: trunk r137812 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 14 10:32:16 CDT 2008


Author: qwell
Date: Thu Aug 14 10:32:16 2008
New Revision: 137812

URL: http://svn.digium.com/view/asterisk?view=rev&rev=137812
Log:
Make sure we set the socket port, so we don't try to use <ip address>:0.

(closes issue #13255)
Reported by: falves11
Patches:
      13255-socketport.diff uploaded by qwell (license 4)
Tested by: falves11

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=137812&r1=137811&r2=137812
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu Aug 14 10:32:16 2008
@@ -4343,7 +4343,7 @@
 		memcpy(&dialog->sa.sin_addr, &sin->sin_addr, sizeof(dialog->sa.sin_addr));
 		if (!sin->sin_port) {
 			if (ast_strlen_zero(port) || sscanf(port, "%u", &portno) != 1) {
-				portno = dialog->socket.type & SIP_TRANSPORT_TLS ?
+				portno = (dialog->socket.type & SIP_TRANSPORT_TLS) ?
 					STANDARD_TLS_PORT : STANDARD_SIP_PORT;
 			}
 		} else {
@@ -4380,6 +4380,8 @@
 
 	if (!dialog->socket.type)
 		dialog->socket.type = SIP_TRANSPORT_UDP;
+	if (!dialog->socket.port)
+		dialog->socket.port = bindaddr.sin_port;
 	dialog->sa.sin_port = htons(portno);
 	dialog->recv = dialog->sa;
 	return 0;




More information about the asterisk-commits mailing list