[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
Mon Oct 18 18:44:26 CDT 2010


branch "master" has been updated
       via  18c4b0dbd24edb50a5b5903a22396c8fc043ba22 (commit)
      from  f851c92d442a922b5924bdf3ab113fa6ce949a3f (commit)

Summary of changes:
 src/PJSipSessionModule.cpp |   40 ++++++++++++++++++++++++++++++++++++----
 1 files changed, 36 insertions(+), 4 deletions(-)


- Log -----------------------------------------------------------------
commit 18c4b0dbd24edb50a5b5903a22396c8fc043ba22
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Oct 18 18:47:00 2010 -0500

    Add try-catch blocks around session listener operations.
    
    In addition, print the number of listeners being signaled per
    call.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 9f77224..705f9a7 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -630,9 +630,17 @@ void PJSipSessionModule::handleInviteResponse(pjsip_inv_session *inv,
       lg(Debug) << "Got 180 response";
       std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx>& listeners = session->getListeners();
       std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx>::const_iterator listener;
+	  lg(Debug) << "Relating ringing state to " << listeners.size() << " listeners";
       for (listener = listeners.begin(); listener != listeners.end(); ++listener)
       {
-         (*listener)->ringing(session->getSessionProxy());
+		  try
+		  {
+			  (*listener)->ringing(session->getSessionProxy());
+		  }
+		  catch (const Ice::Exception &ex)
+		  {
+			  lg(Error) << "Ice exception when attempting to relate ringing state: " << ex.what() << std::endl;
+		  }
       }
    }
    else if (respCode == 183)
@@ -642,9 +650,17 @@ void PJSipSessionModule::handleInviteResponse(pjsip_inv_session *inv,
       response->isdnCode = 42;
       std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx>& listeners = session->getListeners();
       std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx>::const_iterator listener;
+	  lg(Debug) << "Relating progressing state to " << listeners.size() << " listeners";
       for (listener = listeners.begin(); listener != listeners.end(); ++listener)
       {
-         (*listener)->progressing(session->getSessionProxy(), response);
+		  try
+		  {
+			  (*listener)->progressing(session->getSessionProxy(), response);
+		  }
+		  catch (const Ice::Exception &ex)
+		  {
+			  lg(Error) << "Ice exception when attempting to relate progressing state: " << ex.what() << std::endl;
+		  }
       }
    }
    else if (respCode == 200)
@@ -654,9 +670,17 @@ void PJSipSessionModule::handleInviteResponse(pjsip_inv_session *inv,
       {
          std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx>& listeners = session->getListeners();
          std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx>::const_iterator listener;
+		 lg(Debug) << "Relating connected state to " << listeners.size() << " listeners";
          for (listener = listeners.begin(); listener != listeners.end(); ++listener)
          {
-            (*listener)->connected(session->getSessionProxy());
+			 try
+			 {
+				 (*listener)->connected(session->getSessionProxy());
+			 }
+			 catch (const Ice::Exception &ex)
+			 {
+				 lg(Error) << "Ice exception when attempting to relate connected state: " << ex.what() << std::endl;
+			 }
          }
       }
    }
@@ -694,11 +718,19 @@ void PJSipSessionModule::invOnStateChanged(pjsip_inv_session *inv, pjsip_event *
          response->isdnCode = 0;
       }
       std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx> listeners = session->getListeners();
+	  lg(Debug) << "Relating stopped state to " << listeners.size() << " listeners";
       for (std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx>::iterator listener = listeners.begin();
            listener != listeners.end();
            ++listener)
       {
-         (*listener)->stopped(session->getSessionProxy(), response);
+		  try
+		  {
+			  (*listener)->stopped(session->getSessionProxy(), response);
+		  }
+		  catch (const Ice::Exception &ex)
+		  {
+			  lg(Error) << "Ice exception when attempting to relate stopped state: " << ex.what() << std::endl;
+		  }
       }
       session_mod_info->mNeedsRemoval = true;
       pjsip_dialog *dlg = inv->dlg;

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list