diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-01-23 20:58:20 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-01-23 20:58:20 +0000 |
commit | 7121ec22350c17be0d65a50d4e304d79816b92c6 (patch) | |
tree | 0e16dae50a0289e3b3dfd72e461bb3175ddeafcf /channels | |
parent | 169c57c005883acf850c1b67a8655a3c7b7d5d77 (diff) |
Make sure we don't cancel destruction on calls in CANCEL state, even if we
get 183 while waiting for answer on our CANCEL.
(issue #11736)
Reported by: MVF
Patches:
bug11736.txt uploaded by oej (license 306)
Tested by: MVF
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@99977 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 779633b3d..2ed95f926 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3547,6 +3547,7 @@ 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) { @@ -3562,7 +3563,6 @@ static int sip_hangup(struct ast_channel *ast) INVITE, but do set an autodestruct just in case we never get it. */ needdestroy = 0; sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); - p->invitestate = INV_CANCELLED; } if ( p->initid != -1 ) { /* channel still up - reverse dec of inUse counter @@ -12026,14 +12026,14 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru switch (resp) { case 100: /* Trying */ case 101: /* Dialog establishment */ - if (!ast_test_flag(req, SIP_PKT_IGNORE)) + if (!ast_test_flag(req, SIP_PKT_IGNORE) && (p->invitestate != INV_CANCELLED)) sip_cancel_destroy(p); check_pendings(p); break; case 180: /* 180 Ringing */ case 182: /* 182 Queued */ - if (!ast_test_flag(req, SIP_PKT_IGNORE)) + if (!ast_test_flag(req, SIP_PKT_IGNORE) && (p->invitestate != INV_CANCELLED)) sip_cancel_destroy(p); if (!ast_test_flag(req, SIP_PKT_IGNORE) && p->owner) { ast_queue_control(p->owner, AST_CONTROL_RINGING); @@ -12053,7 +12053,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru break; case 183: /* Session progress */ - if (!ast_test_flag(req, SIP_PKT_IGNORE)) + if (!ast_test_flag(req, SIP_PKT_IGNORE) && (p->invitestate != INV_CANCELLED)) sip_cancel_destroy(p); /* Ignore 183 Session progress without SDP */ if (find_sdp(req)) { @@ -12068,7 +12068,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru break; case 200: /* 200 OK on invite - someone's answering our call */ - if (!ast_test_flag(req, SIP_PKT_IGNORE)) + if (!ast_test_flag(req, SIP_PKT_IGNORE) && (p->invitestate != INV_CANCELLED)) sip_cancel_destroy(p); p->authtries = 0; if (find_sdp(req)) { |