From: Mark Michelson Date: Fri, 7 Nov 2008 23:41:44 +0000 (+0000) Subject: Set the invite state to INV_CANCELLED in a place that X-Git-Tag: 1.6.2.0-beta1~906 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=111203aed9c1ce36cd0b76ae0c9abf17666a9f97;p=thirdparty%2Fasterisk.git Set the invite state to INV_CANCELLED in a place that makes more sense. Where it was set before, it was impossible to actually delay sending a CANCEL if we had not yet received a provisional response to an INVITE. (closes issue #13626) Reported by: atis Patches: 13626.patch uploaded by putnopvut (license 60) Tested by: atis git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155467 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 7211f8de15..f13a12856b 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -5440,7 +5440,6 @@ static int sip_hangup(struct ast_channel *ast) if (ast_test_flag(&p->flags[0], SIP_OUTGOING)) { /* stop retransmitting an INVITE that has not received a response */ __sip_pretend_ack(p); - p->invitestate = INV_CANCELLED; /* if we can't send right now, mark it pending */ if (p->invitestate == INV_CALLING) { @@ -5450,6 +5449,7 @@ static int sip_hangup(struct ast_channel *ast) sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); append_history(p, "DELAY", "Not sending cancel, waiting for timeout"); } else { + p->invitestate = INV_CANCELLED; /* Send a new request: CANCEL */ transmit_request(p, SIP_CANCEL, p->lastinvite, XMIT_RELIABLE, FALSE); /* Actually don't destroy us yet, wait for the 487 on our original