diff options
author | Olle Johansson <oej@edvina.net> | 2006-03-10 12:18:00 +0000 |
---|---|---|
committer | Olle Johansson <oej@edvina.net> | 2006-03-10 12:18:00 +0000 |
commit | 9bbfae80e011815785016370abb066f7090ade81 (patch) | |
tree | 08509194770a3649b3c1e8398b879a8820d9dac4 /channels/chan_sip.c | |
parent | 11126fee1d089177214a30bade4d0939b10a1f3d (diff) |
Issue #5937 - Make sure that SIP CANCEL's are retransmitted properly
Importing revision 12495 from 1.2 with changes for svn trunk
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@12496 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index d09733c5c..56ea9d21d 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -2578,12 +2578,15 @@ static int sip_hangup(struct ast_channel *ast) if (!ast_test_flag(p, SIP_ALREADYGONE) && !ast_strlen_zero(p->initreq.data)) { if (needcancel) { /* Outgoing call, not up */ if (ast_test_flag(p, SIP_OUTGOING)) { + /* stop retransmitting an INVITE that has not received a response */ + __sip_pretend_ack(p); + + /* Send a new request: CANCEL */ transmit_request_with_auth(p, SIP_CANCEL, p->ocseq, XMIT_RELIABLE, 0); /* Actually don't destroy us yet, wait for the 487 on our original INVITE, but do set an autodestruct just in case we never get it. */ ast_clear_flag(&locflags, SIP_NEEDDESTROY); - /* stop retransmitting an INVITE that has not received a response */ - __sip_pretend_ack(p); + sip_scheddestroy(p, 32000); if ( p->initid != -1 ) { /* channel still up - reverse dec of inUse counter |