]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
For an INVITE transaction, treat all 2XX responses the same as a 200.
authorDavid Vossel <dvossel@digium.com>
Mon, 27 Sep 2010 22:03:54 +0000 (22:03 +0000)
committerDavid Vossel <dvossel@digium.com>
Mon, 27 Sep 2010 22:03:54 +0000 (22:03 +0000)
ABE-2305

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@289023 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 008062275d60a039d7acc6a104bcab408f96ab4e..742ff30f0f9b463478cf17c1718225f51f7f687c 100644 (file)
@@ -18830,6 +18830,11 @@ static void handle_response_invite(struct sip_pvt *p, int resp, const char *rest
        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 @@ static void handle_response(struct sip_pvt *p, int resp, const char *rest, struc
                        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 @@ static void handle_response(struct sip_pvt *p, int resp, const char *rest, struc
                                        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) {