[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
Wed Jul 6 14:14:47 CDT 2011


branch "session-decorator" has been updated
       via  b41a0dc88850f05a29d0adbf62016e22e625a26e (commit)
      from  1b8c6f710bab05f5864611477838d6b56c673eb5 (commit)

Summary of changes:
 src/PJSipSessionModule.cpp             |   10 ++++------
 src/PJSipSessionModule.h               |    3 +--
 src/PJSipSessionModuleConstruction.cpp |   14 +++++++++-----
 src/SipSession.cpp                     |    6 +++---
 src/SipSession.h                       |    2 +-
 5 files changed, 18 insertions(+), 17 deletions(-)


- Log -----------------------------------------------------------------
commit b41a0dc88850f05a29d0adbf62016e22e625a26e
Author: Mark Michelson <mmichelson at digium.com>
Date:   Wed Jul 6 13:35:43 2011 -0500

    Make corrections based on CR-ASTSCF-115 feedback.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 1bc6327..41cf906 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -169,28 +169,26 @@ SessionWorkPtr PJSipSessionModInfo::getSessionWork()
     return mSessionWork;
 }
 
-SipSessionDecorator::SipSessionDecorator() { }
-
 void SipSessionDecorator::addDecorator(const SessionDecoratorHookPrx& hook, const Ice::Current&)
 {
     boost::unique_lock<boost::shared_mutex> lock(mLock);
-    hooks.push_back(hook);
+    mHooks.push_back(hook);
 }
 void SipSessionDecorator::removeDecorator(const SessionDecoratorHookPrx& hook, const Ice::Current&)
 {
     boost::unique_lock<boost::shared_mutex> lock(mLock);
-    hooks.erase(std::find(hooks.begin(), hooks.end(), hook));
+    mHooks.erase(std::find(mHooks.begin(), mHooks.end(), hook));
 }
 void SipSessionDecorator::clearDecorators(const Ice::Current&)
 {
     boost::unique_lock<boost::shared_mutex> lock(mLock);
-    hooks.clear();
+    mHooks.clear();
 }
 
 SessionDecoratorHookSeq SipSessionDecorator::getHooks()
 {
     boost::shared_lock<boost::shared_mutex> lock(mLock);
-    return hooks;
+    return mHooks;
 }
 
 void PJSipSessionModule::replicateState(PJSipDialogModInfo *dlgInfo, PJSipTransactionModInfo *tsxInfo,
diff --git a/src/PJSipSessionModule.h b/src/PJSipSessionModule.h
index c743a55..e3a72b0 100644
--- a/src/PJSipSessionModule.h
+++ b/src/PJSipSessionModule.h
@@ -85,14 +85,13 @@ typedef IceUtil::Handle<PJSipSessionModuleThreadPoolListener> PJSipSessionModule
 class SipSessionDecorator : public AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionDecoratorExtensionPoint
 {
 public:
-    SipSessionDecorator();
     void addDecorator(const AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionDecoratorHookPrx& hook, const Ice::Current&);
     void removeDecorator(const AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionDecoratorHookPrx& hook, const Ice::Current&);
     void clearDecorators(const Ice::Current&);
     AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionDecoratorHookSeq getHooks();
 
 private:
-    AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionDecoratorHookSeq hooks;
+    AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionDecoratorHookSeq mHooks;
     boost::shared_mutex mLock;
 };
 
diff --git a/src/PJSipSessionModuleConstruction.cpp b/src/PJSipSessionModuleConstruction.cpp
index 9aeb449..459cd9b 100644
--- a/src/PJSipSessionModuleConstruction.cpp
+++ b/src/PJSipSessionModuleConstruction.cpp
@@ -36,7 +36,7 @@ namespace SipSessionManager
 
 using namespace AsteriskSCF::WorkQueue;
 using namespace AsteriskSCF::ThreadPool;
-
+using namespace AsteriskSCF::SessionCommunications::ExtensionPoints::V1;
 
 static char moduleName[] = "PJSipSessionModule";
 
@@ -134,11 +134,11 @@ PJSipSessionModule::PJSipSessionModule(pjsip_endpoint *endpt,
     mModule.on_tsx_state = NULL;
 
     Ice::ObjectPrx decoratorObjPrx = mAdapter->add(mSessionDecorator, mAdapter->getCommunicator()->stringToIdentity(DecoratorId));
-    AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionDecoratorExtensionPointPrx decoratorPrx =
-        AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionDecoratorExtensionPointPrx::uncheckedCast(decoratorObjPrx);
+    SessionDecoratorExtensionPointPrx decoratorPrx =
+        SessionDecoratorExtensionPointPrx::uncheckedCast(decoratorObjPrx);
 
-    mDecoratorService = serviceLocatorManagement->addService(decoratorPrx, "Spit");
-    mDecoratorService->addLocatorParams(new AsteriskSCF::Core::Discovery::V1::ServiceLocatorParams(AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionDecoratorLocatorCategory), "");
+    mDecoratorService = serviceLocatorManagement->addService(decoratorPrx, DecoratorId);
+    mDecoratorService->addLocatorParams(new AsteriskSCF::Core::Discovery::V1::ServiceLocatorParams(SessionDecoratorLocatorCategory), "");
 
     mPoolQueue = new AsteriskSCF::WorkQueue::WorkQueue();
     mPoolListener = new PJSipSessionModuleThreadPoolListener(); 
@@ -188,6 +188,10 @@ PJSipSessionModule::~PJSipSessionModule()
     {
         lg(Warning) << "Attempted to shut down a Queue that is already shut down.";
     }
+    catch (const Ice::Exception& ex)
+    {
+        lg(Warning) << "Caught exception trying to destroy the PJSipSessionModule: " << ex.what();
+    }
 }
 
 }; //end namespace SipSessionManager
diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index 0bb8857..96efd1f 100644
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -319,7 +319,7 @@ void SipSession::initializePJSIPStructs()
     setInviteSession(inviteSession);
 }
 
-void SipSession::setSessionProxy(const AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionDecoratorHookSeq& hooks)
+void SipSession::activateIceObjects(const AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionDecoratorHookSeq& hooks)
 {
     mImplPriv->mSessionProxy = 
         AsteriskSCF::SessionCommunications::V1::SessionPrx::uncheckedCast(mImplPriv->mAdapter->addWithUUID(this));
@@ -366,7 +366,7 @@ SipSession::SipSession(const Ice::ObjectAdapterPtr& adapter, const SipEndpointPt
         mImplPriv->mListeners.push_back(listener);
     }
 
-    setSessionProxy(mImplPriv->mManager->getSessionModule()->getSessionDecoratorHooks());
+    activateIceObjects(mImplPriv->mManager->getSessionModule()->getSessionDecoratorHooks());
 
     mImplPriv->mMediaSession = new SipMediaSession(this);
     mImplPriv->mMediaSessionProxy =
@@ -394,7 +394,7 @@ SipSession::SipSession(const Ice::ObjectAdapterPtr& adapter, const SipEndpointPt
         const AsteriskSCF::System::Component::V1::ReplicaPtr& replica, bool isUAC)
     : mImplPriv(new SipSessionPriv(adapter, endpoint, destination, manager, serviceLocator, replica))
 {
-    setSessionProxy(mImplPriv->mManager->getSessionModule()->getSessionDecoratorHooks());
+    activateIceObjects(mImplPriv->mManager->getSessionModule()->getSessionDecoratorHooks());
 
     mImplPriv->mMediaSession = new SipMediaSession(this);
     mImplPriv->mMediaSessionProxy =
diff --git a/src/SipSession.h b/src/SipSession.h
index 54b7b95..541f1aa 100644
--- a/src/SipSession.h
+++ b/src/SipSession.h
@@ -156,7 +156,7 @@ public:
             const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx&,
             const Ice::Current&);
 
-    void setSessionProxy(const AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionDecoratorHookSeq& hooks);
+    void activateIceObjects(const AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionDecoratorHookSeq& hooks);
 
     void hold(const Ice::Current&);
     void progress(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&, const Ice::Current&);

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list