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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Apr 23 18:26:52 CDT 2012


branch "retry_deux" has been updated
       via  3bee12a7e1f3bb1bb230dde1bb68d3d827869675 (commit)
      from  0269a698d8f7437fc785a7ec0b7bfac01b47d5a1 (commit)

Summary of changes:
 src/SIPSession.cpp |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 3bee12a7e1f3bb1bb230dde1bb68d3d827869675
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Mon Apr 23 18:26:21 2012 -0500

    Handle the ServiceNotFound exception when locating RTP Media Service.

diff --git a/src/SIPSession.cpp b/src/SIPSession.cpp
index 2bde33e..31a2e3d 100755
--- a/src/SIPSession.cpp
+++ b/src/SIPSession.cpp
@@ -55,6 +55,7 @@
 
 using namespace AsteriskSCF::System::Logging;
 using namespace AsteriskSCF::System::NAT::V1;
+using namespace AsteriskSCF::Core::Discovery::V1;
 using namespace AsteriskSCF::SessionCommunications::V1;
 using namespace AsteriskSCF::SessionCommunications::PartyIdentification::V1;
 using namespace AsteriskSCF::Media::RTP::V1;
@@ -3535,7 +3536,15 @@ pjmedia_sdp_session *SIPSession::createSDPOffer(const AsteriskSCF::Media::V1::St
             }
 
             // Try to find a factory for RTP sessions matching what we need
-            RTPMediaServicePrx factory = RTPMediaServicePrx::uncheckedCast(mImplPriv->mServiceLocator->locate(params));
+            RTPMediaServicePrx factory = 0;
+            try
+            {
+                factory = RTPMediaServicePrx::uncheckedCast(mImplPriv->mServiceLocator->locate(params));
+            }
+            catch(const ServiceNotFound& e)
+            {
+                lg(Error) << "RTP Media Service not found. Check configuration.";
+            }
 
             if (factory == 0)
             {
@@ -4035,7 +4044,15 @@ pjmedia_sdp_session *SIPSession::createSDPAnswer(const pjmedia_sdp_session* offe
                 }
 
                 // Try to find a factory for RTP sessions matching what we need
-                RTPMediaServicePrx factory = RTPMediaServicePrx::uncheckedCast(mImplPriv->mServiceLocator->locate(params));
+                RTPMediaServicePrx factory = 0;
+                try
+                {
+                    factory = RTPMediaServicePrx::uncheckedCast(mImplPriv->mServiceLocator->locate(params));
+                }
+                catch(const ServiceNotFound& e)
+                {
+                    lg(Error) << "RTP Media Service not found. Check configuration.";
+                }
 
                 // If none exist we can't provide accept the stream
                 if (factory == 0)

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list