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

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Fri Mar 25 10:39:33 2011 +0100

b/f: fixes prev commit (1052e9e632ebc5b944b274686cb1436627599db0)

---

 core/AmSessionContainer.cpp |    1 -
 core/AmSipDispatcher.cpp    |   23 +++++++++++++----------
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/core/AmSessionContainer.cpp b/core/AmSessionContainer.cpp
index 4252cd0..bff01ed 100644
--- a/core/AmSessionContainer.cpp
+++ b/core/AmSessionContainer.cpp
@@ -328,7 +328,6 @@ void AmSessionContainer::startSessionUAS(AmSipRequest& req)
 
        try {
          session->start();
-         session.release();
        } catch (...) {
          AmEventDispatcher::instance()->
            delEventQueue(req.callid,req.from_tag,local_tag);
diff --git a/core/AmSipDispatcher.cpp b/core/AmSipDispatcher.cpp
index ac8dc85..f0283a0 100644
--- a/core/AmSipDispatcher.cpp
+++ b/core/AmSipDispatcher.cpp
@@ -85,22 +85,25 @@ void AmSipDispatcher::handleSipMsg(AmSipRequest &req)
       return;
   }
 
-  if(ev_disp->postSipRequest(callid, remote_tag, req)){
-         
-      return;
-  }
-  
   DBG("method: `%s' [%zd].\n", req.method.c_str(), req.method.length());
   if(req.method == "INVITE"){
       
       AmSessionContainer::instance()->startSessionUAS(req);
   }
-  else if( (req.method == "CANCEL") || 
-            (req.method == "BYE") ){
+  else if(req.method == "CANCEL"){
       
-    // CANCEL/BYE of a (here) non-existing dialog
-    AmSipDialog::reply_error(req,481,
-                            "Call leg/Transaction does not exist");
+    if(ev_disp->postSipRequest(callid, remote_tag, req)){
+      return;
+    }
+  
+    // CANCEL of a (here) non-existing dialog
+    AmSipDialog::reply_error(req,481,SIP_REPLY_NOT_EXIST);
+    return;
+  } 
+  else if(req.method == "BYE"){
+    
+    // BYE of a (here) non-existing dialog
+    AmSipDialog::reply_error(req,481,SIP_REPLY_NOT_EXIST);
     return;
 
   } else {

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

Reply via email to