diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-12 18:18:44 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-12 18:18:44 +0000 |
commit | ef998aeddaa8ab3ba449dbb1300666bb5c6d60ab (patch) | |
tree | 39080f791116cfea8535caed7280060ec0923218 /channels | |
parent | d2dd860b2d8d477c8bad9c0f46551fb7faf72527 (diff) |
Set the invitestate to INV_CANCELLED only if we are actually sending a SIP CANCEL.
The problem was that the hangup code was setting the invitestate too early. The result of
this was that we would always send a CANCEL request, even if it was not an appropriate
time to do so (e.g. we have not yet received a provisional response for our INVITE).
Note that this same fix had been applied to trunk and the 1.6.X branches starting with
revision 155467. This is why you will see this revision being blocked from those places.
AST-216
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@193880 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index ddcc81773..f744e073b 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3658,7 +3658,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) { @@ -3668,6 +3667,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 |