[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Sep 14 20:59:16 CDT 2010


branch "master" has been updated
       via  f73f78192ac31a578416a7dab314b9585b86eaee (commit)
       via  8146ee2c28e13a9736c05982c7963c2d1629749d (commit)
      from  4cba60c52ea9e6bc7e37842cc4b0648b14e1553c (commit)

Summary of changes:
 src/PJSipSessionModule.cpp |   17 ++++++++++++++++-
 src/SipSession.cpp         |    2 +-
 2 files changed, 17 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit f73f78192ac31a578416a7dab314b9585b86eaee
Author: Joshua Colp <jcolp at digium.com>
Date:   Tue Sep 14 23:05:10 2010 -0300

    Handle exceptions thrown by the session router.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index e5e0d5b..85de8e9 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -333,7 +333,22 @@ static void handle_new_invite(pjsip_rx_data *rdata)
 	dlg->mod_data[module->id] = (void *)dlg_mod_info;
 
 	AsteriskSCF::SessionCommunications::V1::SessionRouterPrx router = dataModel.getSessionRouter();
-	router->routeSession((*session)->getSessionProxy(), destination);
+	try
+	{
+	   router->routeSession((*session)->getSessionProxy(), destination);
+	}
+	catch (AsteriskSCF::Core::Routing::V1::DestinationNotFoundException&)
+	{
+	   // Destination not found is special since we can actually map it to a good response code, 404
+	   pjsip_inv_answer(inv_session, 404, NULL, NULL, &tdata);
+	   pjsip_inv_send_msg(inv_session, tdata);
+	}
+	catch (...)
+	{
+	   // Everything else doesn't really map so they just become internal server errors
+	   pjsip_inv_answer(inv_session, 500, NULL, NULL, &tdata);
+	   pjsip_inv_send_msg(inv_session, tdata);
+	}
 }
 
 static pj_bool_t sessionOnReceiveRequest(pjsip_rx_data *rdata)

commit 8146ee2c28e13a9736c05982c7963c2d1629749d
Author: Joshua Colp <jcolp at digium.com>
Date:   Tue Sep 14 23:02:01 2010 -0300

    Use the correct response code when ending a session.

diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index ffb005c..8ac8930 100644
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -333,7 +333,7 @@ void SipSession::stop(const AsteriskSCF::SessionCommunications::V1::ResponseCode
       code = 486;
    }
 
-   if ((pjsip_inv_end_session(mImplPriv->mInviteSession, 503, NULL, &packet)) == PJ_SUCCESS)
+   if ((pjsip_inv_end_session(mImplPriv->mInviteSession, code, NULL, &packet)) == PJ_SUCCESS)
    {
       pjsip_inv_send_msg(mImplPriv->mInviteSession, packet);
    }

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list