From: Walter Doekes Date: Sun, 12 Oct 2014 08:10:51 +0000 (+0000) Subject: chan_sip: Fix so asterisk won't send reINVITE after a BYE. X-Git-Tag: 1.8.32.0-rc1~20 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=78077fdb3aaa554e582874369bde50fb740ee03f;p=thirdparty%2Fasterisk.git chan_sip: Fix so asterisk won't send reINVITE after a BYE. After a reINVITE glare situation, Asterisk would re-send the reINVITE even though the call had been hung up in the mean time. This patch unschedules the reinvite when handling the BYE. ASTERISK-22791 #close Reported by: Paolo Compagnini Tested by: Paolo Compagnini Review: https://reviewboard.asterisk.org/r/4056/ (testcase is in review r4055) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@425296 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 6af69d00a3..93f50ec2c9 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -24743,6 +24743,10 @@ static int handle_request_bye(struct sip_pvt *p, struct sip_request *req) transmit_response(p, "200 OK", req); } + /* Destroy any pending invites so we won't try to do another + * scheduled reINVITE. */ + AST_SCHED_DEL_UNREF(sched, p->waitid, dialog_unref(p, "decrement refcount from sip_destroy because waitid won't be scheduled")); + return 1; }