[svn-commits] oej: branch 1.4 r64565 - /branches/1.4/channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed May 16 02:57:23 MST 2007


Author: oej
Date: Wed May 16 04:57:22 2007
New Revision: 64565

URL: http://svn.digium.com/view/asterisk?view=rev&rev=64565
Log:
Issue #9439 - properly handle username parameters in SIP uri.

Modified:
    branches/1.4/channels/chan_sip.c

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=64565&r1=64564&r2=64565
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Wed May 16 04:57:22 2007
@@ -7745,7 +7745,6 @@
 	/* Work on a copy */
 	contact = ast_strdupa(pvt->fullcontact);
 
-	/* XXX this code is repeated all over */
 	/* Make sure it's a SIP URL */
 	if (strncasecmp(contact, "sip:", 4)) {
 		ast_log(LOG_NOTICE, "'%s' is not a valid SIP contact (missing sip:) trying to use anyway\n", contact);
@@ -7754,7 +7753,6 @@
 
 	/* Ditch arguments */
 	/* XXX this code is replicated also shortly below */
-	contact = strsep(&contact, ";");	/* trim ; and beyond */
 
 	/* Grab host */
 	host = strchr(contact, '@');
@@ -7770,6 +7768,9 @@
 		port = atoi(pt);
 	} else
 		port = STANDARD_SIP_PORT;
+
+	contact = strsep(&contact, ";");	/* trim ; and beyond in username part */
+	host = strsep(&host, ";");		/* trim ; and beyond in host/domain part */
 
 	/* XXX This could block for a long time XXX */
 	/* We should only do this if it's a name, not an IP */



More information about the svn-commits mailing list