[asterisk-commits] oej: branch 1.4 r58848 - in /branches/1.4: ./ channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Mar 13 04:49:36 MST 2007


Author: oej
Date: Tue Mar 13 06:49:35 2007
New Revision: 58848

URL: http://svn.digium.com/view/asterisk?view=rev&rev=58848
Log:
Merged revisions 58847 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r58847 | oej | 2007-03-13 12:45:52 +0100 (Tue, 13 Mar 2007) | 2 lines

Issue #9229 - No port in request URI on register to non default SIP ports (neelakantan)

........

Modified:
    branches/1.4/   (props changed)
    branches/1.4/channels/chan_sip.c

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

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=58848&r1=58847&r2=58848
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Tue Mar 13 06:49:35 2007
@@ -7309,7 +7309,17 @@
 	
 	/* Fromdomain is what we are registering to, regardless of actual
 	   host name from SRV */
-	snprintf(addr, sizeof(addr), "sip:%s", S_OR(p->fromdomain, r->hostname));
+	if (!ast_strlen_zero(p->fromdomain)) {
+		if (r->portno && r->portno != STANDARD_SIP_PORT)
+			snprintf(addr, sizeof(addr), "sip:%s:%d", p->fromdomain, r->portno);
+		else
+			snprintf(addr, sizeof(addr), "sip:%s", p->fromdomain);
+	} else {
+		if (r->portno && r->portno != STANDARD_SIP_PORT)
+			snprintf(addr, sizeof(addr), "sip:%s:%d", r->hostname, r->portno);
+		else
+			snprintf(addr, sizeof(addr), "sip:%s", r->hostname);
+	}
 	ast_string_field_set(p, uri, addr);
 
 	p->branch ^= ast_random();



More information about the asterisk-commits mailing list