Module: sems
Branch: 1.4
Commit: cdcce5c482eea1a5e69805ee0c1b69ab2248d4c8
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=cdcce5c482eea1a5e69805ee0c1b69ab2248d4c8

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 c50c019..e97e20a 100644
--- a/core/AmSipDialog.cpp
+++ b/core/AmSipDialog.cpp
@@ -781,13 +781,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
@@ -798,7 +807,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

Reply via email to