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

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Mon Apr  8 15:40:43 2013 +0200

sip: fixed issues related to forking behind the SBC.

---

 core/AmBasicSipDialog.cpp |    2 +-
 core/AmSipDialog.cpp      |    5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/core/AmBasicSipDialog.cpp b/core/AmBasicSipDialog.cpp
index 8c848c4..5793941 100644
--- a/core/AmBasicSipDialog.cpp
+++ b/core/AmBasicSipDialog.cpp
@@ -423,7 +423,7 @@ void AmBasicSipDialog::updateDialogTarget(const AmSipReply& 
reply)
 
 void AmBasicSipDialog::setRemoteTag(const string& new_rt)
 {
-  if(!new_rt.empty() && remote_tag.empty()){
+  if(new_rt != remote_tag){
     remote_tag = new_rt;
   }
 }
diff --git a/core/AmSipDialog.cpp b/core/AmSipDialog.cpp
index 80c509b..2100206 100644
--- a/core/AmSipDialog.cpp
+++ b/core/AmSipDialog.cpp
@@ -343,7 +343,7 @@ bool AmSipDialog::onRxReplyStatus(const AmSipReply& reply,
     case Trying:
     case Proceeding:
       if(reply.code < 200){
-       if(reply.to_tag.empty())
+       if(reply.code == 100 || reply.to_tag.empty())
          setStatus(Proceeding);
        else {
          setStatus(Early);
@@ -367,6 +367,7 @@ bool AmSipDialog::onRxReplyStatus(const AmSipReply& reply,
 
       if(reply.code >= 300) {// error reply
        setStatus(Disconnected);
+       setRemoteTag(reply.to_tag);
       }
       else if(cancel_pending){
        cancel_pending = false;
@@ -392,6 +393,7 @@ bool AmSipDialog::onRxReplyStatus(const AmSipReply& reply,
       }
       else { // error reply
        setStatus(Disconnected);
+       setRemoteTag(reply.to_tag);
       }
       break;
 
@@ -404,6 +406,7 @@ bool AmSipDialog::onRxReplyStatus(const AmSipReply& reply,
       else if(reply.code < 300){
        // CANCEL rejected
        DBG("CANCEL rejected/too late - bye()\n");
+       setRemoteTag(reply.to_tag);
        bye();
        // if BYE could not be sent,
        // there is nothing we can do anymore...

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to