[asterisk-commits] dvossel: branch 1.6.1 r213724 - in /branches/1.6.1: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 21 17:24:54 CDT 2009


Author: dvossel
Date: Fri Aug 21 17:24:48 2009
New Revision: 213724

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=213724
Log:
Merged revisions 213716 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r213716 | dvossel | 2009-08-21 17:22:11 -0500 (Fri, 21 Aug 2009) | 10 lines
  
  Register request line contains wrong address when user domain and register host differ
  
  (closes issue #15539)
  Reported by: Nick_Lewis
  Patches:
        chan_sip.c-registraraddr.patch uploaded by Nick (license 657)
        register_domain_fix_1.6.2 uploaded by dvossel (license 671)
  Tested by: Nick_Lewis, dvossel
........

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

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.1/channels/chan_sip.c?view=diff&rev=213724&r1=213723&r2=213724
==============================================================================
--- branches/1.6.1/channels/chan_sip.c (original)
+++ branches/1.6.1/channels/chan_sip.c Fri Aug 21 17:24:48 2009
@@ -10378,20 +10378,13 @@
 		else
 			snprintf(to, sizeof(to), "<sip:%s@%s>", r->username, p->tohost);
 	}
-	
-	/* Fromdomain is what we are registering to, regardless of actual
-	   host name from SRV */
-	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);
-	}
+
+	/* Host is what we are registered to, regardless if a domain exists in the username */
+	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