[asterisk-commits] dvossel: trunk r213716 - /trunk/channels/chan_sip.c

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


Author: dvossel
Date: Fri Aug 21 17:22:11 2009
New Revision: 213716

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=213716
Log:
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:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=213716&r1=213715&r2=213716
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri Aug 21 17:22:11 2009
@@ -11751,12 +11751,11 @@
 		snprintf(to, sizeof(to), "<sip:%s@%s>", r->username, r->regdomain);
 	}
 
-	/* Domain is what we are registering to, regardless of actual
-	   host name from SRV */
+	/* Host is what we are registered to, reguardless of domain in username field */
 	if (ntohs(p->sa.sin_port) != STANDARD_SIP_PORT)
-		snprintf(addr, sizeof(addr), "sip:%s:%d", r->regdomain, ntohs(p->sa.sin_port));
+		snprintf(addr, sizeof(addr), "sip:%s:%d", r->hostname, ntohs(p->sa.sin_port));
 	else
-		snprintf(addr, sizeof(addr), "sip:%s", r->regdomain);
+		snprintf(addr, sizeof(addr), "sip:%s", r->hostname);
 
 	ast_string_field_set(p, uri, addr);
 




More information about the asterisk-commits mailing list