[asterisk-commits] oej: trunk r64570 - in /trunk: ./ channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed May 16 03:02:07 MST 2007


Author: oej
Date: Wed May 16 05:02:06 2007
New Revision: 64570

URL: http://svn.digium.com/view/asterisk?view=rev&rev=64570
Log:
Merged revisions 64543 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r64543 | oej | 2007-05-16 11:12:34 +0200 (Wed, 16 May 2007) | 10 lines

Merged revisions 64535 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r64535 | oej | 2007-05-16 11:08:22 +0200 (Wed, 16 May 2007) | 2 lines

Support SIP uri's starting with SIP: and sip: (reported by Tony Mountfield on the mailing list. Thanks!)

........

................

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c

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

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=64570&r1=64569&r2=64570
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed May 16 05:02:06 2007
@@ -2488,7 +2488,7 @@
 		*port = "";
 	if (scheme) {
 		int l = strlen(scheme);
-		if (!strncmp(uri, scheme, l))
+		if (!strncasecmp(uri, scheme, l))
 			uri += l;
 		else {
 			ast_log(LOG_NOTICE, "Missing scheme '%s' in '%s'\n", scheme, uri);
@@ -5984,9 +5984,9 @@
 		++h;
 	else {
 		h = uri;
-		if (strncmp(h, "sip:", 4) == 0)
+		if (strncasecmp(h, "sip:", 4) == 0)
 			h += 4;
-		else if (strncmp(h, "sips:", 5) == 0)
+		else if (strncasecmp(h, "sips:", 5) == 0)
 			h += 5;
 	}
 	hn = strcspn(h, ":;>") + 1;
@@ -7546,7 +7546,7 @@
 
 	ast_copy_string(from, get_header(&p->initreq, "From"), sizeof(from));
 	c = get_in_brackets(from);
-	if (strncmp(c, "sip:", 4)) {
+	if (strncasecmp(c, "sip:", 4)) {
 		ast_log(LOG_WARNING, "Huh?  Not a SIP header (%s)?\n", c);
 		return -1;
 	}
@@ -7555,7 +7555,7 @@
 
 	ast_copy_string(to, get_header(&p->initreq, "To"), sizeof(to));
 	c = get_in_brackets(to);
-	if (strncmp(c, "sip:", 4)) {
+	if (strncasecmp(c, "sip:", 4)) {
 		ast_log(LOG_WARNING, "Huh?  Not a SIP header (%s)?\n", c);
 		return -1;
 	}
@@ -8065,7 +8065,7 @@
 	ast_copy_string(from, of, sizeof(from));
 	of = get_in_brackets(from);
 	ast_string_field_set(p, from, of);
-	if (strncmp(of, "sip:", 4))
+	if (strncasecmp(of, "sip:", 4))
 		ast_log(LOG_NOTICE, "From address missing 'sip:', using it anyway\n");
 	else
 		of += 4;
@@ -8910,7 +8910,7 @@
 	c = get_in_brackets(tmp);
 	c = remove_uri_parameters(c);
 
-	if (!strncmp(c, "sip:", 4)) {
+	if (!strncasecmp(c, "sip:", 4)) {
 		name = c + 4;
 	} else {
 		name = c;
@@ -9099,7 +9099,7 @@
 		return 0;
 
 	exten = get_in_brackets(tmp);
-	if (strncmp(exten, "sip:", 4)) {
+	if (strncasecmp(exten, "sip:", 4)) {
 		ast_log(LOG_WARNING, "Huh?  Not an RDNIS SIP header (%s)?\n", exten);
 		return -1;
 	}
@@ -9163,7 +9163,7 @@
 
 	uri = get_in_brackets(tmp);
 
-	if (strncmp(uri, "sip:", 4)) {
+	if (strncasecmp(uri, "sip:", 4)) {
 		ast_log(LOG_WARNING, "Huh?  Not a SIP header (%s)?\n", uri);
 		return -1;
 	}
@@ -9180,7 +9180,7 @@
 	}
 	
 	if (!ast_strlen_zero(from)) {
-		if (strncmp(from, "sip:", 4)) {
+		if (strncasecmp(from, "sip:", 4)) {
 			ast_log(LOG_WARNING, "Huh?  Not a SIP header (%s)?\n", from);
 			return -1;
 		}
@@ -9482,7 +9482,7 @@
 	if (pedanticsipchecking)
 		ast_uri_decode(c);
 	
-	if (strncmp(c, "sip:", 4)) {
+	if (strncasecmp(c, "sip:", 4)) {
 		ast_log(LOG_WARNING, "Huh?  Not a SIP header in Also: transfer (%s)?\n", c);
 		return -1;
 	}
@@ -9951,7 +9951,7 @@
 	of = get_in_brackets(from);
 	if (ast_strlen_zero(p->exten)) {
 		char *t = uri2;
-		if (!strncmp(t, "sip:", 4))
+		if (!strncasecmp(t, "sip:", 4))
 			t+= 4;
 		ast_string_field_set(p, exten, t);
 		t = strchr(p->exten, '@');
@@ -18128,7 +18128,7 @@
 			ast_log(LOG_ERROR, "Cannot retrieve the 'To' header from the original SIP request!\n");
 			return 0;
 		}
-		if ((localtmp = strstr(tmp, "sip:")) && (localtmp = strchr(localtmp, '@'))) {
+		if ((localtmp = strcasestr(tmp, "sip:")) && (localtmp = strchr(localtmp, '@'))) {
 			char lhost[80], lport[80];
 
 			memset(lhost, 0, sizeof(lhost));



More information about the asterisk-commits mailing list