Issue #7351 - sending CANCEL when the call at some point has been in UP state is...
authorOlle Johansson <oej@edvina.net>
Mon, 18 Sep 2006 19:56:44 +0000 (19:56 +0000)
committerOlle Johansson <oej@edvina.net>
Mon, 18 Sep 2006 19:56:44 +0000 (19:56 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43214 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 5314f49..f59c3ba 100644 (file)
@@ -3201,7 +3201,7 @@ static int sip_hangup(struct ast_channel *ast)
                return 0;
        }
        /* If the call is not UP, we need to send CANCEL instead of BYE */
                return 0;
        }
        /* If the call is not UP, we need to send CANCEL instead of BYE */
-       if (ast->_state != AST_STATE_UP) {
+       if (ast->_state == AST_STATE_RING || ast->_state == AST_STATE_RINGING) {
                needcancel = TRUE;
                if (option_debug > 3)
                        ast_log(LOG_DEBUG, "Hanging up channel in state %s (not UP)\n", ast_state2str(ast->_state));
                needcancel = TRUE;
                if (option_debug > 3)
                        ast_log(LOG_DEBUG, "Hanging up channel in state %s (not UP)\n", ast_state2str(ast->_state));
@@ -14172,6 +14172,7 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
                        } 
                        check_pendings(p);
                }
                        } 
                        check_pendings(p);
                }
+               /* Got an ACK that we did not match. Ignore silently */
                if (!p->lastinvite && ast_strlen_zero(p->randdata))
                        ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);    
                break;
                if (!p->lastinvite && ast_strlen_zero(p->randdata))
                        ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);    
                break;