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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue May 31 14:21:03 CDT 2011


branch "master" has been updated
       via  f8f80a33da9ca89ee1c2d6f7e01a53eeddb723d5 (commit)
      from  700a00bcbae0ee7d6e04353b35007daedd87e2cf (commit)

Summary of changes:
 src/PJSipSessionModule.cpp |   35 +++++++++++++++++++----------------
 1 files changed, 19 insertions(+), 16 deletions(-)


- Log -----------------------------------------------------------------
commit f8f80a33da9ca89ee1c2d6f7e01a53eeddb723d5
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue May 31 14:17:41 2011 -0500

    Fix potential crash bug.
    
    If calling from an unknown endpoint, then the InviteStateOperation will
    crash since no session has been created yet, and the assumption is that
    one has been.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 429b4e0..6d3d980 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -359,9 +359,9 @@ protected:
         // Now we can actually set a for-real non-NULL session on the session module information.
         session_mod_info->setSessionPtr(mSession);
 
-	dlg_mod_info->mPending = false;
+        dlg_mod_info->mPending = false;
 
-	session_mod_info->updateSessionState(mInv);
+        session_mod_info->updateSessionState(mInv);
     
         lg(Debug) << "Replicating state on reception of new SIP INVITE.";
         mSessionModule->replicateState(dlg_mod_info, tsx_mod_info, session_mod_info);
@@ -1149,22 +1149,25 @@ protected:
                 // TODO: See what cause is on a normal call completion
                 response->isdnCode = 0;
             }
-            std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx> listeners = session->getListeners();
-            lg(Debug) << "Relating stopped state to " << listeners.size() << " listeners";
-            AsteriskSCF::SessionCommunications::V1::StoppedIndicationPtr stopped(new AsteriskSCF::SessionCommunications::V1::StoppedIndication());
-            stopped->response = response;
-            for (std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx>::iterator listener =
-                     listeners.begin();
-                 listener != listeners.end();
-                 ++listener)
+            if (session)
             {
-                try
-                {
-                    (*listener)->indicated(session->getSessionProxy(), stopped);
-                }
-                catch (const Ice::Exception &ex)
+                std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx> listeners = session->getListeners();
+                lg(Debug) << "Relating stopped state to " << listeners.size() << " listeners";
+                AsteriskSCF::SessionCommunications::V1::StoppedIndicationPtr stopped(new AsteriskSCF::SessionCommunications::V1::StoppedIndication());
+                stopped->response = response;
+                for (std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx>::iterator listener =
+                         listeners.begin();
+                     listener != listeners.end();
+                     ++listener)
                 {
-                    lg(Error) << "Ice exception when attempting to relate stopped state: " << ex.what();
+                    try
+                    {
+                        (*listener)->indicated(session->getSessionProxy(), stopped);
+                    }
+                    catch (const Ice::Exception &ex)
+                    {
+                        lg(Error) << "Ice exception when attempting to relate stopped state: " << ex.what();
+                    }
                 }
             }
             session_mod_info->mNeedsRemoval = true;

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


-- 
asterisk-scf/release/sip.git



More information about the asterisk-scf-commits mailing list