Module: sems Branch: master Commit: 3a76c9045b58e973233d5b04add615396abab9cb URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=3a76c9045b58e973233d5b04add615396abab9cb
Author: Raphael Coeffic <[email protected]> Committer: Raphael Coeffic <[email protected]> Date: Tue Apr 12 13:58:44 2011 +0200 b/f: close INV trans (w/ 200 ack) before sending BYE. --- core/AmSipDialog.cpp | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/AmSipDialog.cpp b/core/AmSipDialog.cpp index 1f04aec..21a3636 100644 --- a/core/AmSipDialog.cpp +++ b/core/AmSipDialog.cpp @@ -782,13 +782,22 @@ int AmSipDialog::reply_error(const AmSipRequest& req, unsigned int code, int AmSipDialog::bye(const string& hdrs, int flags) { switch(status){ + case Disconnecting: case Connected: + for (TransMap::iterator it=uac_trans.begin(); + it != uac_trans.end(); it++) { + if (it->second.method == "INVITE"){ + // finish any UAC transaction before sending BYE + send_200_ack(it->second); + } + } status = Disconnected; return sendRequest("BYE", "", "", hdrs, flags); + case Pending: status = Disconnecting; - if(getUACTransPending()) + if(getUACInvTransPending()) return cancel(); else { // missing AmSipRequest to be able @@ -799,7 +808,7 @@ int AmSipDialog::bye(const string& hdrs, int flags) } return 0; default: - if(getUACTransPending()) + if(getUACInvTransPending()) return cancel(); else { DBG("bye(): we are not connected " _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
