diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 5da170d2dc..5a77d49f64 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -26851,6 +26851,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; }