don't destroy calls when re-INVITE messages ask for things we can't do (issue #5384)
authorKevin P. Fleming <kpfleming@digium.com>
Tue, 4 Oct 2005 22:09:23 +0000 (22:09 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Tue, 4 Oct 2005 22:09:23 +0000 (22:09 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6714 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 97f5c67..4895a17 100755 (executable)
@@ -10103,7 +10103,8 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
                if (required_profile) {         /* They require something */
                        /* At this point we support no extensions, so fail */
                        transmit_response_with_unsupported(p, "420 Bad extension", req, required);
-                       ast_set_flag(p, SIP_NEEDDESTROY);       
+                       if (!p->lastinvite)
+                               ast_set_flag(p, SIP_NEEDDESTROY);       
                        return -1;
                        
                }
@@ -10136,7 +10137,8 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
                        if (!strcasecmp(get_header(req, "Content-Type"), "application/sdp")) {
                                if (process_sdp(p, req)) {
                                        transmit_response(p, "488 Not acceptable here", req);
-                                       ast_set_flag(p, SIP_NEEDDESTROY);       
+                                       if (!p->lastinvite)
+                                               ast_set_flag(p, SIP_NEEDDESTROY);       
                                        return -1;
                                }
                        } else {