[asterisk-commits] file: trunk r103018 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 8 09:31:01 CST 2008


Author: file
Date: Fri Feb  8 09:31:00 2008
New Revision: 103018

URL: http://svn.digium.com/view/asterisk?view=rev&rev=103018
Log:
Fix a network byte order issue and ensure when creating an outgoing dialog that the socket always contains information such as type and port.
(closes issue #11916)
Reported by: mnnojd

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=103018&r1=103017&r2=103018
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri Feb  8 09:31:00 2008
@@ -3942,6 +3942,10 @@
 		int res = create_addr_from_peer(dialog, peer);
 		unref_peer(peer);
 		return res;
+	} else {
+		/* Setup default parameters for this dialog's socket. Currently we only support regular UDP SIP as the default */
+		dialog->socket.type = SIP_TRANSPORT_UDP;
+		dialog->socket.port = bindaddr.sin_port;
 	}
 
 	ast_string_field_set(dialog, tohost, peername);
@@ -17904,9 +17908,9 @@
 static int sip_standard_port(struct sip_socket s) 
 {
 	if (s.type & SIP_TRANSPORT_TLS)
-		return s.port == STANDARD_TLS_PORT;
+		return s.port == htons(STANDARD_TLS_PORT);
 	else
-		return s.port == STANDARD_SIP_PORT;
+		return s.port == htons(STANDARD_SIP_PORT);
 }
 
 /*! \todo document this function. */




More information about the asterisk-commits mailing list