[asterisk-commits] twilson: trunk r169044 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 16 18:03:40 CST 2009


Author: twilson
Date: Fri Jan 16 18:03:39 2009
New Revision: 169044

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=169044
Log:
Fix port :0 added to SIP INVITE URI when outboundproxy used

(closes issue #14233)
Reported by: chris-mac
Patches: 
      asterisk-bug14233.diff.txt uploaded by jamesgolovich (license 176)
Tested by: jamesgolovich, chris-mac, otherwiseguy

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=169044&r1=169043&r2=169044
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri Jan 16 18:03:39 2009
@@ -4806,12 +4806,11 @@
 	/* Get the outbound proxy information */
 	ref_proxy(dialog, obproxy_get(dialog, NULL));
 
-	/* If we have an outbound proxy, don't bother with DNS resolution at all */
-	if (dialog->outboundproxy)
-		return 0;
-
-	/* This address should be updated using dnsmgr */
-	if (sin) {
+	if (dialog->outboundproxy) {
+		/* If we have an outbound proxy, don't bother with DNS resolution at all, but set the port */
+		portno = port ? atoi(port) : (dialog->socket.type & SIP_TRANSPORT_TLS) ? STANDARD_TLS_PORT : STANDARD_SIP_PORT;
+	} else if (sin) {
+		/* This address should be updated using dnsmgr */
 		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) {




More information about the asterisk-commits mailing list