[svn-commits] dvossel: branch 1.4 r202671 - /branches/1.4/channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jun 23 11:28:50 CDT 2009


Author: dvossel
Date: Tue Jun 23 11:28:46 2009
New Revision: 202671

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=202671
Log:
MWI NOTIFY contains a wrong URI if Asterisk listens to non-standard port and transport

(closes issue #14659)
Reported by: klaus3000
Patches:
      patch_chan_sip_fixMWIuri_1.4.txt uploaded by klaus3000 (license 65)
      mwi_port-transport_trunk.diff uploaded by dvossel (license 671)
Tested by: dvossel, klaus3000

Review: https://reviewboard.asterisk.org/r/288/


Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=202671&r1=202670&r2=202671
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Tue Jun 23 11:28:46 2009
@@ -7636,8 +7636,16 @@
 	add_header(&req, "Content-Type", default_notifymime);
 
 	ast_build_string(&t, &maxbytes, "Messages-Waiting: %s\r\n", newmsgs ? "yes" : "no");
-	ast_build_string(&t, &maxbytes, "Message-Account: sip:%s@%s\r\n",
+	/* if we listen to non-standard SIP port we have to specify the SIP port
+       in the URI, except domains are used - in this case the SRV records should be
+       used to redirect the client to the non-standard SIP port */
+	if ((ourport != STANDARD_SIP_PORT) && ast_strlen_zero(p->fromdomain)) {
+		ast_build_string(&t, &maxbytes, "Message-Account: sip:%s@%s:%d\r\n",
+		S_OR(vmexten, default_vmexten), ast_inet_ntoa(p->ourip), ourport);
+	} else {
+		ast_build_string(&t, &maxbytes, "Message-Account: sip:%s@%s\r\n",
 		S_OR(vmexten, default_vmexten), S_OR(p->fromdomain, ast_inet_ntoa(p->ourip)));
+	}
 	/* Cisco has a bug in the SIP stack where it can't accept the
 		(0/0) notification. This can temporarily be disabled in
 		sip.conf with the "buggymwi" option */




More information about the svn-commits mailing list