]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Ignore CANCEL on call that is already answered
authorOlle Johansson <oej@edvina.net>
Thu, 11 May 2006 08:25:20 +0000 (08:25 +0000)
committerOlle Johansson <oej@edvina.net>
Thu, 11 May 2006 08:25:20 +0000 (08:25 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@26757 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index e9cf9874a87d042d0a38e5f10835200719d6642d..137c353743c26da3e4ad2ab9454ae9f1af1a2ae3 100644 (file)
@@ -11436,6 +11436,14 @@ static int handle_request_cancel(struct sip_pvt *p, struct sip_request *req)
                
        check_via(p, req);
        ast_set_flag(&p->flags[0], SIP_ALREADYGONE);    
+       
+       if (p->owner && p->owner->_state == AST_STATE_UP) {
+               /* This call is up, cancel is ignored, we need a bye */
+               transmit_response(p, "200 OK", req);
+               if (option_debug)
+                       ast_log(LOG_DEBUG, "Got CANCEL on an answered call. Ignoring... \n");
+               return 0;
+       }
        if (p->rtp) {
                /* Immediately stop RTP */
                ast_rtp_stop(p->rtp);