[svn-commits] bbryant: trunk r127434 - /trunk/channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jul 2 12:27:37 CDT 2008


Author: bbryant
Date: Wed Jul  2 12:27:36 2008
New Revision: 127434

URL: http://svn.digium.com/view/asterisk?view=rev&rev=127434
Log:
Fix to sip_parse_host so that it passes the correct information to sip_registry.

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=127434&r1=127433&r2=127434
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Jul  2 12:27:36 2008
@@ -6379,7 +6379,7 @@
 	if (hostname)
 		*hostname++ = '\0';
 	if (ast_strlen_zero(username) || ast_strlen_zero(hostname)) {
-		ast_log(LOG_WARNING, "Format for registration is user[:secret[:authuser]]@host[:port][/contact][~expiry] at line %d\n", lineno);
+		ast_log(LOG_WARNING, "Format for registration is [transport://]user[:secret[:authuser]]@host[:port][/contact][~expiry] at line %d\n", lineno);
 		return -1;
 	}
 	/* split user[:secret[:authuser]] */
@@ -19693,7 +19693,12 @@
 		*transport = SIP_TRANSPORT_UDP;
 	}
 
-	if ((port = strchr(*hostname, ':'))) {
+	if ((line = strrchr(*hostname, '@')))
+		line++;
+	else
+		line = *hostname;
+
+	if ((port = strrchr(line, ':'))) {
 		*port++ = '\0';
 
 		if (!sscanf(port, "%u", portnum)) {




More information about the svn-commits mailing list