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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Jul 5 13:35:00 CDT 2011


branch "session-decorator" has been updated
       via  f256218dea09a6d6e3e177b35d333b6881bc6ed7 (commit)
       via  ba77572c9c5e5d5abdff517a1f4e144440d5906f (commit)
      from  bd53a89af2c3104984d46c118e2b7b158155f25c (commit)

Summary of changes:
 src/PJSipSessionModuleConstruction.cpp |    2 +-
 src/SipSession.cpp                     |   22 ++++++++++++++--------
 2 files changed, 15 insertions(+), 9 deletions(-)


- Log -----------------------------------------------------------------
commit f256218dea09a6d6e3e177b35d333b6881bc6ed7
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Jun 30 14:56:41 2011 -0500

    Safely remove session proxy from the object adapter when the session is destroyed

diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index a3b47bb..610e450 100644
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -130,6 +130,7 @@ public:
 
     void addListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener)
     {
+        lg(Debug) << "Hey there?";
         mListeners.push_back(listener);
         if (mInviteSession)
         {
@@ -189,6 +190,11 @@ public:
     AsteriskSCF::SessionCommunications::V1::SessionPrx mSessionProxy;
 
     /**
+     * A proxy to the decorator for this session.
+     */
+    AsteriskSCF::SessionCommunications::V1::SessionPrx mSessionDecoratorProxy;
+
+    /**
      * The Ice object adapter that our proxies were added to.
      */
     Ice::ObjectAdapterPtr mAdapter;
@@ -316,7 +322,7 @@ void SipSession::initializePJSIPStructs()
 
 void SipSession::setSessionProxy(const AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionDecoratorHookSeq& hooks)
 {
-    AsteriskSCF::SessionCommunications::V1::SessionPrx us = 
+    mImplPriv->mSessionProxy = 
         AsteriskSCF::SessionCommunications::V1::SessionPrx::uncheckedCast(mImplPriv->mAdapter->addWithUUID(this));
 
     bool decoratorSet = false;
@@ -328,7 +334,7 @@ void SipSession::setSessionProxy(const AsteriskSCF::SessionCommunications::Exten
 
         try
         {
-            result = (*iter)->decorateSession(us, decorator);
+            result = (*iter)->decorateSession(mImplPriv->mSessionProxy, decorator);
         }
         catch (const Ice::Exception& ex)
         {
@@ -339,16 +345,12 @@ void SipSession::setSessionProxy(const AsteriskSCF::SessionCommunications::Exten
 
         if (result.status == AsteriskSCF::System::Hook::V1::Succeeded)
         {
-            mImplPriv->mSessionProxy = decorator;
+            lg(Debug) << "Setting our session proxy to be the decorator " << decorator->ice_getIdentity().name;
+            mImplPriv->mSessionDecoratorProxy = decorator;
             decoratorSet = true;
             break;
         }
     }
-    
-    if (!decoratorSet)
-    {
-        mImplPriv->mSessionProxy = us;
-    }
 }
 
 /**
@@ -1291,6 +1293,10 @@ SipEndpointPtr SipSession::getEndpoint()
  */
 AsteriskSCF::SessionCommunications::V1::SessionPrx& SipSession::getSessionProxy()
 {
+    if (mImplPriv->mSessionDecoratorProxy)
+    {
+        return mImplPriv->mSessionDecoratorProxy;
+    }
     return mImplPriv->mSessionProxy;
 }
 

commit ba77572c9c5e5d5abdff517a1f4e144440d5906f
Author: Mark Michelson <mmichelson at digium.com>
Date:   Wed Jun 29 17:45:19 2011 -0500

    Populate the session decorator with something for real.

diff --git a/src/PJSipSessionModuleConstruction.cpp b/src/PJSipSessionModuleConstruction.cpp
index 6dd0a56..9aeb449 100644
--- a/src/PJSipSessionModuleConstruction.cpp
+++ b/src/PJSipSessionModuleConstruction.cpp
@@ -118,7 +118,7 @@ PJSipSessionModule::PJSipSessionModule(pjsip_endpoint *endpt,
     : mName(moduleName), mEndpointFactory(endpointFactoryPtr),
       mSessionRouter(sessionRouter), mServiceLocator(serviceLocator),
       mStateReplicator(stateReplicator), mReplica(replica), mEndpoint(endpt),
-      mAdapter(adapter)
+      mSessionDecorator(new SipSessionDecorator()), mAdapter(adapter)
 {
     sessionModule = this;
     mModule.name = pj_str(moduleName);

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list