[asterisk-commits] dvossel: trunk r289023 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 27 17:04:16 CDT 2010


Author: dvossel
Date: Mon Sep 27 17:03:54 2010
New Revision: 289023

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=289023
Log:
For an INVITE transaction, treat all 2XX responses the same as a 200.

ABE-2305

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=289023&r1=289022&r2=289023
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Sep 27 17:03:54 2010
@@ -18830,6 +18830,11 @@
 	if (resp > 100 && resp < 200 && resp!=101 && resp != 180 && resp != 181 && resp != 182 && resp != 183)
 		resp = 183;
 
+	/* For INVITE, treat all 2XX responses as we would a 200 response */
+	if ((resp >= 200) && (resp < 300)) {
+		resp = 200;
+	}
+
  	/* Any response between 100 and 199 is PROCEEDING */
  	if (resp >= 100 && resp < 200 && p->invitestate == INV_CALLING)
  		p->invitestate = INV_PROCEEDING;
@@ -19902,7 +19907,11 @@
 			break;
 			/* Fallthrough */
 		default:
-			if ((resp >= 300) && (resp < 700)) {
+			if ((resp >= 200) && (resp < 300)) { /* on any 2XX response do the following */
+				if (sipmethod == SIP_INVITE) {
+					handle_response_invite(p, resp, rest, req, seqno);
+				}
+			} else if ((resp >= 300) && (resp < 700)) {
 				/* Fatal response */
 				if ((resp != 487))
 					ast_verb(3, "Got SIP response %d \"%s\" back from %s\n", resp, rest, ast_sockaddr_stringify(&p->sa));
@@ -20071,8 +20080,11 @@
 					if (!req->ignore && sip_cancel_destroy(p))
 						ast_log(LOG_WARNING, "Unable to cancel SIP destruction.  Expect bad things.\n");
 				}
-			}
-			if ((resp >= 300) && (resp < 700)) {
+			} else if ((resp >= 200) && (resp < 300)) { /* on any unrecognized 2XX response do the following */
+				if (sipmethod == SIP_INVITE) {
+					handle_response_invite(p, resp, rest, req, seqno);
+				}
+			} else if ((resp >= 300) && (resp < 700)) {
 				if ((resp != 487))
 					ast_verb(3, "Incoming call: Got SIP response %d \"%s\" back from %s\n", resp, rest, ast_sockaddr_stringify(&p->sa));
 				switch(resp) {




More information about the asterisk-commits mailing list