[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
Mon Feb 7 16:43:30 CST 2011


branch "master" has been updated
       via  7217fe2813f620da720dfbdd65951ce0e8a6942c (commit)
      from  94fbff7a05572c610bcf98bca77a9a8ec8afa4b8 (commit)

Summary of changes:
 src/PJSipManager.cpp         |   14 ++++----------
 src/PJSipManager.h           |    5 ++---
 src/SipSessionManagerApp.cpp |   10 +++++-----
 3 files changed, 11 insertions(+), 18 deletions(-)


- Log -----------------------------------------------------------------
commit 7217fe2813f620da720dfbdd65951ce0e8a6942c
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Feb 7 14:47:52 2011 -0600

    Get rid of some bad code involving pjsip_endpoints.
    
    Specifically, the PJSipManager was being fed one of its own private
    members in order to pass along to the various PJSIP modules it would
    register. This was overwhelmingly silly. Furthermore, I removed
    the getEndpoint() method from PJSipManager because it's not needed.
    Any interaction with the pjsip_endpoint should be done through
    some public member function of PJSipManager instead.
    
    Next change is going to involve the handling of PJSipModules within
    the PJSipManager. This is going to have a direct effect on the
    authentication extension point I'm currently working on.

diff --git a/src/PJSipManager.cpp b/src/PJSipManager.cpp
index 366ce6f..22b5955 100644
--- a/src/PJSipManager.cpp
+++ b/src/PJSipManager.cpp
@@ -70,26 +70,20 @@ PJSipManager::PJSipManager(Ice::PropertiesPtr props)
     }
 }
 
-void PJSipManager::registerSessionModule(pjsip_endpoint *endpt,
-    boost::shared_ptr<SipEndpointFactory> endpointFactoryPtr,
+void PJSipManager::registerSessionModule(boost::shared_ptr<SipEndpointFactory> endpointFactoryPtr,
     AsteriskSCF::SmartProxy::SmartProxy<AsteriskSCF::SessionCommunications::V1::SessionRouterPrx> sessionRouter,
     AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx serviceLocator,
     AsteriskSCF::SmartProxy::SmartProxy<AsteriskSCF::SIP::V1::SipStateReplicatorPrx> stateReplicator,
     AsteriskSCF::System::Component::V1::ReplicaPtr replica
     )
 {
-    mSessionModule = new PJSipSessionModule(endpt, endpointFactoryPtr, sessionRouter,
+    mSessionModule = new PJSipSessionModule(mEndpoint, endpointFactoryPtr, sessionRouter,
         serviceLocator, stateReplicator, replica);
 }
 
-void PJSipManager::registerLoggingModule(pjsip_endpoint *endpt)
+void PJSipManager::registerLoggingModule()
 {
-    mLoggingModule = new PJSipLoggingModule(endpt);
-}
-
-pjsip_endpoint *PJSipManager::getEndpoint()
-{
-    return mEndpoint;
+    mLoggingModule = new PJSipLoggingModule(mEndpoint);
 }
 
 PJSipSessionModule *PJSipManager::getSessionModule()
diff --git a/src/PJSipManager.h b/src/PJSipManager.h
index 3db7875..eaedf0d 100644
--- a/src/PJSipManager.h
+++ b/src/PJSipManager.h
@@ -68,8 +68,7 @@ public:
      * Register the PJSipSessionModule, responsible
      * for basic call handling
      */
-    void registerSessionModule(pjsip_endpoint *endpt,
-        boost::shared_ptr<SipEndpointFactory> endpointFactoryPtr,
+    void registerSessionModule(boost::shared_ptr<SipEndpointFactory> endpointFactoryPtr,
         AsteriskSCF::SmartProxy::SmartProxy<AsteriskSCF::SessionCommunications::V1::SessionRouterPrx> sessionRouter,
         AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx serviceLocator,
         AsteriskSCF::SmartProxy::SmartProxy<AsteriskSCF::SIP::V1::SipStateReplicatorPrx> stateReplicator,
@@ -80,7 +79,7 @@ public:
      * Register the PJSipLoggingModule, responsible
      * for logging incoming and outgoing SIP messages
      */
-    void registerLoggingModule(pjsip_endpoint *endpt);
+    void registerLoggingModule();
 private:
     static PJSipManager *mInstance;
     pjsip_endpoint *mEndpoint;
diff --git a/src/SipSessionManagerApp.cpp b/src/SipSessionManagerApp.cpp
index 4c5a5ae..2afe7ab 100644
--- a/src/SipSessionManagerApp.cpp
+++ b/src/SipSessionManagerApp.cpp
@@ -94,7 +94,7 @@ private:
     void registerWithRoutingService();
     void deregisterFromRoutingService();
     void configureEndpoints();
-    void registerPJSipModules(pjsip_endpoint *endpt);
+    void registerPJSipModules();
     void deregisterFromStateReplicator();
 
     bool mDone;
@@ -445,7 +445,7 @@ void SipSessionManager::configureEndpoints()
     }
 }
 
-void SipSessionManager::registerPJSipModules(pjsip_endpoint *endpt)
+void SipSessionManager::registerPJSipModules()
 {
     Ice::PropertiesPtr props = mCommunicator->getProperties();
     Ice::StringSeq moduleNames = props->getPropertyAsList("Sip.Modules");
@@ -459,12 +459,12 @@ void SipSessionManager::registerPJSipModules(pjsip_endpoint *endpt)
         //we'll just do it here instead.
         if (*i == "Session")
         {
-            mPJSipManager->registerSessionModule(endpt, mEndpointFactory,
+            mPJSipManager->registerSessionModule(mEndpointFactory,
                 mSessionRouter, mServiceLocator, mStateReplicator, mReplicaService);
         }
         else if (*i == "Logging" || *i == "Logger")
         {
-            mPJSipManager->registerLoggingModule(endpt);
+            mPJSipManager->registerLoggingModule();
         }
     }
     lg(Debug) << "Registered PJSIP modules";
@@ -576,7 +576,7 @@ void SipSessionManager::start(const string& name, const Ice::CommunicatorPtr& ic
     // Locate the State Replicator so we can fail over!
     locateStateReplicator();
 
-    registerPJSipModules(mPJSipManager->getEndpoint());
+    registerPJSipModules();
 
     // Register with the state replicator if we are a listener
     registerWithStateReplicator();

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


-- 
asterisk-scf/release/sip.git



More information about the asterisk-scf-commits mailing list