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

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Mon Apr 11 16:25:26 2011 +0200

b/f: fixes INV w/ immediate CANCEL use-case.

---

 apps/sbc/SBC.cpp          |    5 +----
 core/AmB2BSession.cpp     |   12 +++++++++++-
 core/AmSipDispatcher.cpp  |    2 +-
 core/SipCtrlInterface.cpp |    2 +-
 4 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/apps/sbc/SBC.cpp b/apps/sbc/SBC.cpp
index 5da47df..65f8d6e 100644
--- a/apps/sbc/SBC.cpp
+++ b/apps/sbc/SBC.cpp
@@ -878,11 +878,8 @@ void SBCDialog::onBye(const AmSipRequest& req)
 void SBCDialog::onCancel()
 {
   if(dlg.getStatus() == AmSipDialog::Pending) {
-    DBG("Wait for leg B to terminate");
-  } else {
-    DBG("Canceling leg A on CANCEL since dialog is not pending");
+    stopCall();
     dlg.reply(invite_req, 487, "Request terminated");
-    setStopped();
   }
 }
 
diff --git a/core/AmB2BSession.cpp b/core/AmB2BSession.cpp
index 3a32b60..c053fd4 100644
--- a/core/AmB2BSession.cpp
+++ b/core/AmB2BSession.cpp
@@ -843,8 +843,18 @@ void AmB2BCallerSession::onB2BEvent(B2BEvent* ev)
 
     AmSipReply& reply = ((B2BSipReplyEvent*)ev)->reply;
 
+    if(other_id.empty()){
+      DBG("Discarding B2BSipReply from other leg (other_id empty)\n");
+      DBG("reply code=%i; method=%s; callid=%s; local_tag=%s; "
+         "remote_tag=%s; cseq=%i\n",
+         
reply.code,reply.method.c_str(),reply.callid.c_str(),reply.local_tag.c_str(),
+         reply.remote_tag.c_str(),reply.cseq);
+      return;
+    }
+
     if(other_id != reply.local_tag){
-      DBG("Dialog mismatch!\n");
+      DBG("Dialog mismatch! (oi=%s;lt=%s)\n",
+         other_id.c_str(),reply.local_tag.c_str());
       return;
     }
 
diff --git a/core/AmSipDispatcher.cpp b/core/AmSipDispatcher.cpp
index f0283a0..9248e8b 100644
--- a/core/AmSipDispatcher.cpp
+++ b/core/AmSipDispatcher.cpp
@@ -51,7 +51,7 @@ void AmSipDispatcher::handleSipMsg(AmSipReply &reply)
             "unhandled SIP reply: %s\n", reply.print().c_str());
       }
     } else {
-      ERROR("unhandled SIP reply: %s\n", reply.print().c_str());
+      WARN("unhandled SIP reply: %s\n", reply.print().c_str());
     }
     delete ev;
   }
diff --git a/core/SipCtrlInterface.cpp b/core/SipCtrlInterface.cpp
index e8eeddb..ee5c305 100644
--- a/core/SipCtrlInterface.cpp
+++ b/core/SipCtrlInterface.cpp
@@ -690,7 +690,7 @@ void 
SipCtrlInterface::handle_reply_timeout(AmSipTimeoutEvent::EvType evt,
   }
 
   if(!AmEventDispatcher::instance()->post(c2stlstr(tr->to_tag), tmo_evt)){
-      ERROR("Could not post timeout event (sess. id: 
%.*s)\n",tr->to_tag.len,tr->to_tag.s);
+      DBG("Could not post timeout event (sess. id: 
%.*s)\n",tr->to_tag.len,tr->to_tag.s);
       delete tmo_evt;
   }
 }

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

Reply via email to