[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
Wed Sep 15 09:47:52 CDT 2010


branch "master" has been updated
       via  b6b37fab41b072465702d6102321d9b294317eee (commit)
       via  74d5348c786af0b48cd6aee387c1bfd9a8cb0a69 (commit)
       via  e44753d38d96eb12f609bb9466dbd442934b3597 (commit)
      from  861616b41938948b7289d4b99a685f32ab83eded (commit)

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


- Log -----------------------------------------------------------------
commit b6b37fab41b072465702d6102321d9b294317eee
Author: Joshua Colp <jcolp at digium.com>
Date:   Wed Sep 15 11:53:54 2010 -0300

    Catch exceptions from the service locator when looking for media formats, and use a copy of the listeners when calling stopped().

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 85de8e9..f51f1ee 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -560,14 +560,16 @@ static void invOnStateChanged(pjsip_inv_session *inv, pjsip_event *event)
 	 // TODO: See what cause is on a normal call completion
 	 response->isdnCode = 0;
       }
-      std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx>& listeners = (*session)->getListeners();
-      std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx>::const_iterator listener;
-      for (listener = listeners.begin(); listener != listeners.end(); ++listener)
+      std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx> listeners = (*session)->getListeners();
+      for (std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx>::iterator listener = listeners.begin();
+	   listener != listeners.end();
+	   ++listener)
       {
 	 (*listener)->stopped((*session)->getSessionProxy(), response);
       }
       (*session)->destroy();
       delete session;
+      inv->mod_data[pjsip_ua_instance()->id] = 0;
    }
 	//stub
 }
@@ -676,13 +678,21 @@ static void invOnMediaUpdate(pjsip_inv_session *inv, pj_status_t status)
 	 }
 
 	 SipChannelServiceDataModel &dataModel = SipChannelServiceDataModel::getInstance();
-	 MediaFormatServicePrx service = MediaFormatServicePrx::uncheckedCast(dataModel.getServiceLocator()->locate(params));
 
-	 // It is entirely possible for the service locator to not find a service that knows about this media format
-	 if (service != 0)
+	 try
 	 {
-	    FormatPtr format = FormatPtr::dynamicCast(service->getFormat(params));
-	    formats.push_back(format);
+	    MediaFormatServicePrx service = MediaFormatServicePrx::uncheckedCast(dataModel.getServiceLocator()->locate(params));
+
+	    // It is entirely possible for the service locator to not find a service that knows about this media format
+	    if (service != 0)
+	    {
+	       FormatPtr format = FormatPtr::dynamicCast(service->getFormat(params));
+	       formats.push_back(format);
+	    }
+	 }
+	 catch (...)
+	 {
+	    // If we get here the format just isn't supported...
 	 }
       }
    }

commit 74d5348c786af0b48cd6aee387c1bfd9a8cb0a69
Author: Joshua Colp <jcolp at digium.com>
Date:   Wed Sep 15 11:52:00 2010 -0300

    Comment out some unsafe code, for now.

diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index 80763bf..4e19b02 100644
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -190,6 +190,7 @@ AsteriskSCF::SessionCommunications::V1::SessionInfoPtr SipSession::getInfo(const
 {
    AsteriskSCF::SessionCommunications::V1::SessionInfoPtr sessioninfo = new AsteriskSCF::SessionCommunications::V1::SessionInfo();
 
+   /* TODO: Utilize locking so this becomes safe
    if (!mImplPriv->mInviteSession || mImplPriv->mInviteSession->state == PJSIP_INV_STATE_NULL)
    {
       sessioninfo->currentState = "ready";
@@ -218,6 +219,7 @@ AsteriskSCF::SessionCommunications::V1::SessionInfoPtr SipSession::getInfo(const
    {
       sessioninfo->currentState = "disconnected";
    }
+   */
 
    return sessioninfo;
 }

commit e44753d38d96eb12f609bb9466dbd442934b3597
Author: Joshua Colp <jcolp at digium.com>
Date:   Wed Sep 15 10:11:21 2010 -0300

    Move location of session pointer to mod_data on the invite session.

diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index 56fd9ea..80763bf 100644
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -312,10 +312,6 @@ void SipSession::start(const Ice::Current&)
       return;
    }
 
-   // Record our session within the dialog so code handling pjsip events can do STUFF
-   SipSessionPtr* session = new SipSessionPtr(this);
-   dialog->mod_data[pjsip_ua_instance()->id] = (void*)session;
-
    // Since the SDP generation requires a pool we use the dialog one, so it has to be set here
    mImplPriv->mDialog = dialog;
 
@@ -330,6 +326,10 @@ void SipSession::start(const Ice::Current&)
       return;
    }
 
+   // Record our session within the dialog so code handling pjsip events can do STUFF
+   SipSessionPtr* session = new SipSessionPtr(this);
+   inviteSession->mod_data[pjsip_ua_instance()->id] = (void*)session;
+
    // Create the actual INVITE packet
    pjsip_tx_data *packet;
    if ((pjsip_inv_invite(inviteSession, &packet)) != PJ_SUCCESS)

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list