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

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Oct 17 10:47:10 MST 2006


Author: oej
Date: Tue Oct 17 12:47:09 2006
New Revision: 45331

URL: http://svn.digium.com/view/asterisk?rev=45331&view=rev
Log:
- Remove unneeded code that won't be reached now that we kill responses
  to unkonwn dialogs earlier in the process. 
- move debug message.

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=45331&r1=45330&r2=45331&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Oct 17 12:47:09 2006
@@ -4259,8 +4259,11 @@
 	ast_mutex_unlock(&iflock);
 
 	/* Responses can not create a pvt structure so drop it */
-	if (req->method == SIP_RESPONSE)
+	if (req->method == SIP_RESPONSE) {
+		if (option_debug > 1)
+			ast_log(LOG_DEBUG, "That's odd...  Got a response on a call we dont know about. Callid %s\n", callid ? callid : "<unknown>");
 		return NULL;
+	}
 
 	/* Allocate new call */
 	if ((p = sip_alloc(callid, sin, 1, intended_method)))
@@ -14103,13 +14106,11 @@
 
 	/* Find out SIP method for incoming request */
 	if (req->method == SIP_RESPONSE) {	/* Response to our request */
+		/* When we get here, we know this is a SIP dialog where we've sent
+		   a request and have a response, or at least get a response
+		   within an existing dialog */
 		/* Response to our request -- Do some sanity checks */	
-		if (!p->initreq.headers) {
-			if (option_debug)
-				ast_log(LOG_DEBUG, "That's odd...  Got a response on a call we dont know about. Cseq %d Cmd %s\n", seqno, cmd);
-			ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
-			return 0;
-		} else if (p->ocseq && (p->ocseq < seqno)) {
+		if (p->ocseq && (p->ocseq < seqno)) {
 			if (option_debug)
 				ast_log(LOG_DEBUG, "Ignoring out of order response %d (expecting %d)\n", seqno, p->ocseq);
 			return -1;



More information about the asterisk-commits mailing list