From fedfc4745e386162f5ca98cb9887b0b99d7081d2 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Mon, 20 Jul 2009 09:40:10 +0000 Subject: [PATCH] - BYE handling for unknown dialogs added. - in case no factory can be found, reply 404 instead of 500. git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1474 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/AmSipDispatcher.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/AmSipDispatcher.cpp b/core/AmSipDispatcher.cpp index a8f93fb1..c44ddd27 100644 --- a/core/AmSipDispatcher.cpp +++ b/core/AmSipDispatcher.cpp @@ -85,7 +85,7 @@ void AmSipDispatcher::handleSipMsg(AmSipRequest &req) DBG("method: `%s' [%zd].\n", req.method.c_str(), req.method.length()); - if((req.method == "INVITE")){ + if(req.method == "INVITE"){ AmSessionContainer::instance()->startSessionUAS(req); } @@ -95,8 +95,10 @@ void AmSipDispatcher::handleSipMsg(AmSipRequest &req) AmSipDialog::reply_error(req,200,"OK"); return; - } else if(req.method == "CANCEL"){ - // CANCEL to a (here) non-existing dialog + } else if( (req.method == "CANCEL") || + (req.method == "BYE") ){ + + // CANCEL/BYE of a (here) non-existing dialog AmSipDialog::reply_error(req,481, "Call leg/Transaction does not exist"); return; @@ -106,7 +108,7 @@ void AmSipDispatcher::handleSipMsg(AmSipRequest &req) AmSessionFactory* sess_fact = AmPlugIn::instance()->findSessionFactory(req); if(!sess_fact){ - AmSipDialog::reply_error(req,500,"Not implemented"); + AmSipDialog::reply_error(req,404,"Not found"); return; }