[Asterisk-cvs] asterisk/channels chan_sip.c,1.192,1.193

markster at lists.digium.com markster at lists.digium.com
Fri Oct 10 13:32:48 CDT 2003


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv6892/channels

Modified Files:
	chan_sip.c 
Log Message:
Strip "sip:" from callerid


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.192
retrieving revision 1.193
diff -u -d -r1.192 -r1.193
--- chan_sip.c	10 Oct 2003 02:05:17 -0000	1.192
+++ chan_sip.c	10 Oct 2003 18:58:52 -0000	1.193
@@ -3556,14 +3556,19 @@
 	strncpy(tmpf, get_header(req, "From"), sizeof(tmpf) - 1);
 	fr = ditch_braces(tmpf);
 	
-	if (fr && !strlen(fr))
-		fr = NULL;
-	
 	if (strncmp(c, "sip:", 4)) {
 		ast_log(LOG_WARNING, "Huh?  Not a SIP header (%s)?\n", c);
 		return -1;
 	}
 	c += 4;
+	if (strlen(fr)) {
+		if (strncmp(fr, "sip:", 4)) {
+			ast_log(LOG_WARNING, "Huh?  Not a SIP header (%s)?\n", fr);
+			return -1;
+		}
+		fr += 4;
+	} else
+		fr = NULL;
 	if ((a = strchr(c, '@')) || (a = strchr(c, ';'))) {
 		*a = '\0';
 	}




More information about the svn-commits mailing list