[svn-commits] trunk r32111 - /trunk/channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sun Jun 4 12:18:24 MST 2006


Author: oej
Date: Sun Jun  4 14:18:24 2006
New Revision: 32111

URL: http://svn.digium.com/view/asterisk?rev=32111&view=rev
Log:
Respond to some of Luigis questions...

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=32111&r1=32110&r2=32111&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Sun Jun  4 14:18:24 2006
@@ -11219,7 +11219,8 @@
 			ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
 		return -1;
 	} else {
-		/* XXX reduce nesting depth */
+		/* Save nesting depth for now, since there might be other events we will
+			support in the future */
 
 		/* Handle REFER notifications */
 
@@ -11319,13 +11320,6 @@
 		transmit_response(p, "200 OK", req);
 		return res;
 	};
-
-	/* XXX hey, we never reach this code! */
-	/* THis could be voicemail notification */
-	transmit_response(p, "200 OK", req);
-	if (!p->lastinvite) 
-		ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
-	return res;
 }
 
 /*! \brief Handle incoming OPTIONS request */
@@ -11603,15 +11597,6 @@
 		/* Skip leading whitespace */
 		replace_id = ast_skip_blanks(replace_id);
 
-		/* XXX there are several bugs in the code below,
-		 * because 'ptr' can be NULL so all the dereferences in strcasestr()
-		 * would cause panics.
-		 * I think we should do something like the code below, which also has
-		 * the advantage of not depending on the order of headers.
-		 * Please test if it works, and in case remove the block in #else / #endif
-		 */
-#if 1	/* proposed replacement */
-
 		start = replace_id;
 		while ( (ptr = strsep(&start, ";")) ) {
 			ptr = ast_skip_blanks(ptr); /* XXX maybe unnecessary ? */
@@ -11622,34 +11607,6 @@
 				fromtag = strsep(&fromtag, "&"); /* trim what ? */
 			}
 		}
-#else	/* original code, buggy */
-		if ((ptr = strchr(replace_id, ';'))) {
-			*ptr = '\0';
-			ptr++;
-		}
-		start = ptr;
-
-		to = strcasestr(ptr, "to-tag=");
-		if (to) {
-			ptr = to + 7;
-			totag = ptr;
-			if ((to = strchr(ptr, ';')))
-				*to = '\0';
-			/* XXX this code is also wrong as to can be NULL */
-			to++;
-			ptr = to;
-		}
-
-		to = strcasestr(ptr, "from-tag=");
-		if (to) {
-			ptr = to + 9;
-			fromtag = ptr;
-			if ((to = strchr(ptr, '&')))
-				*to = '\0';
-			if ((to = strchr(ptr, ';')))
-				*to = '\0';
-		}
-#endif
 
 		if (sipdebug && option_debug > 3) 
 			ast_log(LOG_DEBUG,"Invite/replaces: Will use Replace-Call-ID : %s Fromtag: %s Totag: %s\n", replace_id, fromtag ? fromtag : "<no from tag>", totag ? totag : "<no to tag>");



More information about the svn-commits mailing list