[Asterisk-cvs] asterisk/channels chan_sip.c,1.501,1.502

markster at lists.digium.com markster at lists.digium.com
Tue Sep 14 19:03:06 CDT 2004


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

Modified Files:
	chan_sip.c 
Log Message:
Consider both tags as possible matches (bug #2422)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.501
retrieving revision 1.502
diff -u -d -r1.501 -r1.502
--- chan_sip.c	13 Sep 2004 12:32:04 -0000	1.501
+++ chan_sip.c	14 Sep 2004 23:04:39 -0000	1.502
@@ -2392,10 +2392,11 @@
 	struct sip_pvt *p;
 	char *callid;
 	char tmp[256] = "";
+	char tmp2[256] = "";
 	char iabuf[INET_ADDRSTRLEN];
 	char *cmd;
 	char *tag = "", *c;
-	int themisfrom;
+	char *tag2 = ""
 	callid = get_header(req, "Call-ID");
 
 	if (pedanticsipchecking) {
@@ -2412,15 +2413,7 @@
 		c = strchr(tmp, ' ');
 		if (c)
 			*c = '\0';
-		if (!strcasecmp(cmd, "SIP/2.0")) {
-			themisfrom = 0;
-		} else {
-			themisfrom = 1;
-		}
-		if (themisfrom)
-			strncpy(tmp, get_header(req, "From"), sizeof(tmp) - 1);
-		else
-			strncpy(tmp, get_header(req, "To"), sizeof(tmp) - 1);
+		strncpy(tmp, get_header(req, "From"), sizeof(tmp) - 1);
 		tag = strstr(tmp, "tag=");
 		if (tag) {
 			tag += 4;
@@ -2428,6 +2421,14 @@
 			if (c)
 				*c = '\0';
 		}
+		strncpy(tmp2, get_header(req, "To"), sizeof(tmp2) - 1);
+		tag2 = strstr(tmp2, "tag=");
+		if (tag2) {
+			tag2 += 4;
+			c = strchr(tag2, ';');
+			if (c)
+				*c = '\0';
+		}
 			
 	}
 		
@@ -2439,7 +2440,7 @@
 	p = iflist;
 	while(p) {
 		if (!strcmp(p->callid, callid) && 
-			(!pedanticsipchecking || !tag || ast_strlen_zero(p->theirtag) || !strcmp(p->theirtag, tag))) {
+			(!pedanticsipchecking || !tag || !tag2 || ast_strlen_zero(p->theirtag) || !strcmp(p->theirtag, tag) || !strcmp(p->theirtag, tag2))) {
 			/* Found the call */
 			ast_mutex_lock(&p->lock);
 			ast_mutex_unlock(&iflock);




More information about the svn-commits mailing list