From a9c7556c2c05595a25f7e0c162b6f2c9a7e5db7e Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Tue, 22 Feb 2011 19:06:01 +0100 Subject: [PATCH] b/f: ignore prov replies in canceled INV - provisional replies received for canceled INVITEs are ignored - if bye() is called for pending call and no UAC trans to cancel, go into Disconnected state --- core/AmSipDialog.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/AmSipDialog.cpp b/core/AmSipDialog.cpp index bbdf2990..772c2719 100644 --- a/core/AmSipDialog.cpp +++ b/core/AmSipDialog.cpp @@ -329,13 +329,18 @@ void AmSipDialog::updateStatus(const AmSipReply& reply) switch(status){ case Disconnecting: if (trans_method == SIP_METH_INVITE) { + // ignore provisional reply in canceled INVITE + if (reply.code < 200) + break; if(reply.code == 487){ // CANCEL accepted + DBG("CANCEL accepted, status -> Disconnected\n"); status = Disconnected; } else { // CANCEL rejected + DBG("CANCEL rejected/too late - bye()\n"); bye(); // if BYE could not be sent, // there is nothing we can do anymore... @@ -776,6 +781,7 @@ int AmSipDialog::bye(const string& hdrs, int flags) // to send the reply on behalf of the app. DBG("ignoring bye() in Pending state: " "no UAC transaction to cancel.\n"); + status = Disconnected; } return 0; default: