[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "x_safe_constructors" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Jul 11 13:55:20 CDT 2012


branch "x_safe_constructors" has been created
        at  288cdf2f20572064244732b8a897342fb9c3792a (commit)

- Log -----------------------------------------------------------------
commit 288cdf2f20572064244732b8a897342fb9c3792a
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Jul 11 15:25:06 2012 -0230

    Move operations that are not good to have in constructors out of them and put
    them into activateIceObjects. Interestingly enough this method was actually
    there before but did not do what the name suggests. Now it does.

diff --git a/src/SIPSession.cpp b/src/SIPSession.cpp
index b9811f0..e6ce9dc 100755
--- a/src/SIPSession.cpp
+++ b/src/SIPSession.cpp
@@ -145,7 +145,7 @@ public:
           mAdapter(adapter), mDialog(0), mInviteSession(0), mEndpoint(endpoint), mDestination(destination),
           mManager(manager), mServiceLocator(serviceLocator), mReplicationContext(replicationContext), 
           mNatOptions(natOptions), mSDP(0), 
-          mOperationContextCache(OperationContextCache::create(180)),
+          mOperationContextCache(OperationContextCache::create(180, lg, endpoint->getName() + ".SIPSessionPriv ")),
           mSDPPool(0)
     { 
 
@@ -361,6 +361,10 @@ public:
 
     AsteriskSCF::Operations::OperationContextCachePtr mOperationContextCache;
 
+    Ice::Identity mSessionIdentity;
+    Ice::Identity mMediaSessionIdentity;
+    Ice::Identity mSessionControllerIdentity;
+
     /**
      * Get our pjsip memory pool for the current SDP negotiation session. Using an
      * independent pool prevents memory growth for long running sessions as the pool
@@ -1475,8 +1479,33 @@ void SIPSession::initializePJSIPStructs()
     setInviteSession(inviteSession);
 }
 
-void SIPSession::activateIceObjects(const AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookSeq& hooks)
+void SIPSession::activateIceObjects(const AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookSeq& hooks, 
+    const SIPEndpointConfig& config,
+    bool isUAC)
 {
+    mImplPriv->mSessionProxy = 
+        AsteriskSCF::SessionCommunications::V1::SessionPrx::uncheckedCast(mImplPriv->mAdapter->add(this, mImplPriv->mSessionIdentity));
+
+    mImplPriv->mMediaSession = new SIPMediaSession(this, mImplPriv);
+    mImplPriv->mMediaSessionProxy =
+        AsteriskSCF::Media::V1::SessionPrx::uncheckedCast(mImplPriv->mAdapter->add(mImplPriv->mMediaSession,
+                mImplPriv->mMediaSessionIdentity)); 
+
+    mImplPriv->mOurSessionController = new SIPSessionController(mImplPriv, this);
+    mImplPriv->mOurSessionControllerProxy =
+        AsteriskSCF::SessionCommunications::V1::SessionControllerPrx::uncheckedCast(mImplPriv->mAdapter->add(mImplPriv->mOurSessionController,
+                mImplPriv->mSessionControllerIdentity));
+
+    DirectMediaConnectionPtr directMedia = new SIPDirectMediaConnection(mImplPriv, this);
+    mImplPriv->mAdapter->addFacet(directMedia, mImplPriv->mSessionProxy->ice_getIdentity(), directMediaConnectionFacet); 
+
+    if (isUAC)
+    {
+        lg(Debug) << "New session is UAC, so we're creating the necessary PJSIP structures";
+        initializePJSIPStructs();
+        setTelephonyEventSourcesAndSinks(config);
+    }
+
     AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookDataPtr initial(
             new AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookData(mImplPriv->mSessionProxy, mImplPriv->mListeners, getCookies()));
 
@@ -1561,8 +1590,6 @@ SIPSessionPtr SIPSession::create(
         serviceLocator,
         replicationContext, 
         doIpV6, 
-        isUAC, 
-        config,
         natOptions);
 
     AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookSeq hooks = 
@@ -1572,7 +1599,7 @@ SIPSessionPtr SIPSession::create(
     {
         hooks.push_back(oneShotHook);
     }
-    newSession->activateIceObjects(hooks);
+    newSession->activateIceObjects(hooks, config, isUAC);
 
     return newSession;
 }
@@ -1615,8 +1642,6 @@ SIPSessionPtr SIPSession::create(
         manager, 
         serviceLocator,
         replicationContext, 
-        isUAC, 
-        config,
         natOptions);
 
     AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookSeq hooks =
@@ -1626,7 +1651,7 @@ SIPSessionPtr SIPSession::create(
     {
         hooks.push_back(oneShotHook);
     }
-    newSession->activateIceObjects(hooks);
+    newSession->activateIceObjects(hooks, config, isUAC);
 
     return newSession;
 }
@@ -1645,8 +1670,6 @@ SIPSession::SIPSession(
     const AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx& serviceLocator,
     const SIPReplicationContextPtr& replicationContext, 
     bool /* ipv6 */, 
-    bool isUAC, 
-    const SIPEndpointConfig &config,
     const NATEndpointOptions& natOptions)
     : mImplPriv(new SIPSessionPriv(operationContext, adapter, endpoint, destination, manager, serviceLocator, replicationContext, natOptions))
 {
@@ -1656,27 +1679,13 @@ SIPSession::SIPSession(
     {
         mImplPriv->mSessionCookies[(*i)->ice_id()] = (*i);
     }
+    ostringstream idStream;
+    idStream << endpoint->getName()  << ".session." <<  IceUtil::generateUUID();
+    string rootId = idStream.str();
 
-    mImplPriv->mSessionProxy = 
-        AsteriskSCF::SessionCommunications::V1::SessionPrx::uncheckedCast(mImplPriv->mAdapter->addWithUUID(this));
-
-    mImplPriv->mMediaSession = new SIPMediaSession(this, mImplPriv);
-    mImplPriv->mMediaSessionProxy =
-        AsteriskSCF::Media::V1::SessionPrx::uncheckedCast(adapter->addWithUUID(mImplPriv->mMediaSession));
-
-    mImplPriv->mOurSessionController = new SIPSessionController(mImplPriv, this);
-    mImplPriv->mOurSessionControllerProxy =
-        AsteriskSCF::SessionCommunications::V1::SessionControllerPrx::uncheckedCast(adapter->addWithUUID(mImplPriv->mOurSessionController));
-
-    DirectMediaConnectionPtr directMedia = new SIPDirectMediaConnection(mImplPriv, this);
-    adapter->addFacet(directMedia, mImplPriv->mSessionProxy->ice_getIdentity(), directMediaConnectionFacet);
-
-    if (isUAC)
-    {
-        lg(Debug) << "New session is UAC, so we're creating the necessary PJSIP structures";
-        initializePJSIPStructs();
-        setTelephonyEventSourcesAndSinks(config);
-    }
+    mImplPriv->mSessionIdentity = adapter->getCommunicator()->stringToIdentity(rootId);
+    mImplPriv->mMediaSessionIdentity = adapter->getCommunicator()->stringToIdentity(rootId + ".mediaSession");
+    mImplPriv->mSessionControllerIdentity = adapter->getCommunicator()->stringToIdentity(rootId + ".sessionController");
 }
 
 /**
@@ -1697,36 +1706,17 @@ SIPSession::SIPSession(
     const PJSIPManagerPtr& manager,
     const AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx& serviceLocator,
     const SIPReplicationContextPtr& replicationContext,
-    bool isUAC,
-    const SIPEndpointConfig &config,
     const NATEndpointOptions& natOptions)
     : mImplPriv(new SIPSessionPriv(operationContext, adapter, endpoint, destination, manager, serviceLocator, replicationContext, natOptions))
 {
-    mImplPriv->mSessionProxy = 
-        AsteriskSCF::SessionCommunications::V1::SessionPrx::uncheckedCast(mImplPriv->mAdapter->addWithUUID(this));
-
-    mImplPriv->mMediaSession = new SIPMediaSession(this, mImplPriv);
-    mImplPriv->mMediaSessionProxy =
-        AsteriskSCF::Media::V1::SessionPrx::uncheckedCast(adapter->add(mImplPriv->mMediaSession, mediaid));
-
-    mImplPriv->mOurSessionController = new SIPSessionController(mImplPriv, this);
-    mImplPriv->mOurSessionControllerProxy =
-        AsteriskSCF::SessionCommunications::V1::SessionControllerPrx::uncheckedCast(adapter->add(mImplPriv->mOurSessionController, controllerid));
-
-    DirectMediaConnectionPtr directMedia = new SIPDirectMediaConnection(mImplPriv, this);
-    adapter->addFacet(directMedia, sessionid, directMediaConnectionFacet);
+    mImplPriv->mSessionIdentity = sessionid;
+    mImplPriv->mMediaSessionIdentity = mediaid;
+    mImplPriv->mSessionControllerIdentity = controllerid;
 
     mImplPriv->mRTPSessions = mediasessions;
     mImplPriv->mUDPTLSessions = udptlMediaSessions;
     mImplPriv->mSources = sources;
     mImplPriv->mSinks = sinks;
-
-    if (isUAC)
-    {
-        initializePJSIPStructs();
-        setTelephonyEventSourcesAndSinks(config);
-    }
-
 }
 
 class AddListenerOperation : public SuspendableWork
diff --git a/src/SIPSession.h b/src/SIPSession.h
index e4aa05a..cb131c2 100644
--- a/src/SIPSession.h
+++ b/src/SIPSession.h
@@ -212,7 +212,10 @@ public:
         const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx&,
         const Ice::Current&);
 
-    void activateIceObjects(const AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookSeq& hooks);
+    void activateIceObjects(const AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookSeq& hooks,
+        const SIPEndpointConfig& config,
+        bool isUAC
+        );
 
     void removeListener(
         const AsteriskSCF::System::V1::OperationContextPtr& operationContext,
@@ -413,7 +416,7 @@ private:
         const PJSIPManagerPtr& manager,
         const AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx& serviceLocator,
         const SIPReplicationContextPtr& replicationContext,
-        bool ipv6, bool isUAC, const SIPEndpointConfig& config, const NATEndpointOptions& natOptions);
+        bool ipv6, const NATEndpointOptions& natOptions);
 
     SIPSession(
         const AsteriskSCF::System::V1::OperationContextPtr&,
@@ -423,7 +426,7 @@ private:
         const AsteriskSCF::Media::V1::StreamSourceSeq&, const AsteriskSCF::Media::V1::StreamSinkSeq&,
         const PJSIPManagerPtr& manager, const AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx& serviceLocator,
         const SIPReplicationContextPtr& replicationContext,
-        bool isUAC, const SIPEndpointConfig& config, const NATEndpointOptions& natOptions);
+        const NATEndpointOptions& natOptions);
 
 
     void initializePJSIPStructs();

commit 3a7e2976052fd0ba3c0e88a7b986d3f0881c3b2f
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Tue Jun 26 17:20:49 2012 -0500

    Bump up reference count of the dialog on the pjsip callback thread so that the dialog is still around when we need it in the WorkQueue.

diff --git a/src/PJSIPSessionModule.cpp b/src/PJSIPSessionModule.cpp
index a223c74..bc009ae 100644
--- a/src/PJSIPSessionModule.cpp
+++ b/src/PJSIPSessionModule.cpp
@@ -1779,7 +1779,15 @@ class InviteStateOperation : public SIPQueueableOperation
 {
 public:
     InviteStateOperation(const PJSIPSessionModulePtr& module, pjsip_inv_session* inv, const int eventType, const int invState, const std::string branch)
-        : mSessionModule(module), mInv(inv), mEventType(eventType), mInvState(invState), mEventBranch(branch) { }
+        : mSessionModule(module), mInv(inv), mEventType(eventType), mInvState(invState), mEventBranch(branch) 
+    {
+        pjsip_dlg_inc_session(mInv->dlg, &mSessionModule->getModule());
+    }
+
+    ~InviteStateOperation()
+    {
+        pjsip_dlg_dec_session(mInv->dlg, &mSessionModule->getModule());
+    }
 
 protected:
     SuspendableWorkResult initial(const SuspendableWorkListenerPtr&)

commit 6e7550862734bf6d108911a01166eea7be92f587
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Jun 20 22:05:50 2012 -0230

    Refereneces to SIPSession objects end up getting kept in an operation context
    cache. When the cache prunes in a timer task it ends up cleaning up the
    SIPSession servant from an Ice internal timer thread, not a pjsip library
    registered one. This unfortunately results in a crash. The current workaround
    is to release the pool in the DestroyOperation. Of course... if the SIPSession
    goes away through other means, that could become problematic.

diff --git a/src/SIPSession.cpp b/src/SIPSession.cpp
index 77dfcb5..b9811f0 100755
--- a/src/SIPSession.cpp
+++ b/src/SIPSession.cpp
@@ -153,10 +153,6 @@ public:
 
     ~SIPSessionPriv()
     {
-        if (mSDPPool)
-        {
-            pj_pool_release(mSDPPool);
-        }
     }
 
 
@@ -422,6 +418,14 @@ public:
         }
     }
 
+    void destroyPool()
+    {
+        if (mSDPPool)
+        {
+            pj_pool_release(mSDPPool);
+        }
+    }
+
 private:
     static ReadOnlyCookieTypes mReadOnlyCookieTypes;
 
@@ -3346,6 +3350,7 @@ public:
             delete mInfo;
             mInfo = 0;
         }
+        mSessionPriv->destroyPool();
 
         return Complete;
     }

commit fa10d8cd8919f61ab26756dd7cd6051d561673bd
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Jun 20 16:53:27 2012 -0230

    Fix a servant leak issue. The facets added in association with the SIPSession
    were causing some stuff to hang around.

diff --git a/src/SIPSession.cpp b/src/SIPSession.cpp
index 7931776..77dfcb5 100755
--- a/src/SIPSession.cpp
+++ b/src/SIPSession.cpp
@@ -3287,6 +3287,8 @@ public:
     {
         // Remove all of the different interfaces we have exposed to the world.
         mSessionPriv->mAdapter->remove(mSessionPriv->mSessionProxy->ice_getIdentity());
+        mSessionPriv->mAdapter->removeAllFacets(mSessionPriv->mSessionProxy->ice_getIdentity());
+        mSessionPriv->mAdapter->remove(mSessionPriv->mOurSessionControllerProxy->ice_getIdentity());
 
         mSessionPriv->mAdapter->remove(mSessionPriv->mMediaSessionProxy->ice_getIdentity());
         if (mSessionPriv->mEventSink)
@@ -3300,6 +3302,7 @@ public:
             mSessionPriv->mAdapter->remove(mSessionPriv->mEventSourcePrx->ice_getIdentity());
         }
         mSessionPriv->mMediaSession = 0;
+        mSessionPriv->mOurSessionController = 0;
 
         if (mSessionPriv->mReplicationContext->isActive() == true)
         {

commit ffe3315c21acd1dfc04ebfdd1451961f99155017
Author: Brent Eagles <beagles at digium.com>
Date:   Tue Jun 19 17:06:42 2012 -0230

    Under some conditions it appears that the dialog for the invite_session is
    null, so I added a if() for the code that uses it.

diff --git a/src/PJSIPSessionModule.cpp b/src/PJSIPSessionModule.cpp
index 1fae5f7..a223c74 100644
--- a/src/PJSIPSessionModule.cpp
+++ b/src/PJSIPSessionModule.cpp
@@ -1890,11 +1890,16 @@ protected:
             }
             session_mod_info->mNeedsRemoval = true;
             pjsip_dialog *dlg = mInv->dlg;
-            PJSIPDialogModInfo *dlg_mod_info = (PJSIPDialogModInfo*) dlg->mod_data[mSessionModule->getModule().id];
-            if (dlg_mod_info)
+            PJSIPDialogModInfo *dlg_mod_info = 0;
+            if (dlg)
             {
-                dlg_mod_info->mNeedsRemoval = true;
+                dlg_mod_info = (PJSIPDialogModInfo*) dlg->mod_data[mSessionModule->getModule().id];
+                if (dlg_mod_info)
+                {
+                    dlg_mod_info->mNeedsRemoval = true;
+                }
             }
+
             lg(Debug) << "Replicating state on DISCONNECTED inv_state.";
             mSessionModule->replicateState(dlg_mod_info, NULL, session_mod_info);
             session_mod_info->destroy();

commit bc607a12fbd4420f10835a6fb0d5dcaef57faebd
Author: Brent Eagles <beagles at digium.com>
Date:   Fri Jun 15 18:09:38 2012 -0230

    On the odd chance that the mechanism we use for getting the
    PJSIPSessionModInfo structure is not being held on until we get to the
    destroy step, we'll pass the pointer through to the destroy. That memory at
    least is allocated on the heap, so pjsip won't be messing with it.

diff --git a/src/PJSIPSessionModule.cpp b/src/PJSIPSessionModule.cpp
index 93593a6..1fae5f7 100644
--- a/src/PJSIPSessionModule.cpp
+++ b/src/PJSIPSessionModule.cpp
@@ -203,7 +203,10 @@ void PJSIPSessionModInfo::destroy()
     }
     if (t)
     {
-        t->destroy();
+        //
+        // The actual deletion of this object will occur from another thread.
+        //
+        t->destroy(this);
     }
 }
 
@@ -1784,7 +1787,8 @@ protected:
         if (mInvState == PJSIP_INV_STATE_DISCONNECTED)
         {
             PJSIPSessionModInfo *session_mod_info = (PJSIPSessionModInfo*)mInv->mod_data[mSessionModule->getModule().id];
-            if (session_mod_info == 0)
+            mInv->mod_data[mSessionModule->getModule().id] = 0;
+            if (session_mod_info == 0 || session_mod_info->mNeedsRemoval)
             {
                 return Complete;
             }
@@ -1894,6 +1898,7 @@ protected:
             lg(Debug) << "Replicating state on DISCONNECTED inv_state.";
             mSessionModule->replicateState(dlg_mod_info, NULL, session_mod_info);
             session_mod_info->destroy();
+
             if (dlg_mod_info)
             {
                 dlg->mod_data[mSessionModule->getModule().id] = 0;
diff --git a/src/PJSIPSessionModule.h b/src/PJSIPSessionModule.h
index bddb492..d08b475 100644
--- a/src/PJSIPSessionModule.h
+++ b/src/PJSIPSessionModule.h
@@ -326,7 +326,7 @@ public:
 
 typedef IceUtil::Handle<SIPQueueableOperation> SIPQueueableOperationPtr;
 
-class SIPAMICallbackOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+class SIPAMICallbackOperation : virtual public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
 {
 public:
     SIPAMICallbackOperation(const Ice::AsyncResultPtr& r, const SIPQueueableOperationPtr& operation)
diff --git a/src/SIPSession.cpp b/src/SIPSession.cpp
index 1a86101..7931776 100755
--- a/src/SIPSession.cpp
+++ b/src/SIPSession.cpp
@@ -197,8 +197,11 @@ public:
         if (mInviteSession)
         {
             PJSIPSessionModInfo *session_mod_info = static_cast<PJSIPSessionModInfo*>(mInviteSession->mod_data[mManager->getSessionModule()->getModule().id]);
-            session_mod_info->updateSessionState(mInviteSession);
-            mManager->getSessionModule()->replicateState(NULL, NULL, session_mod_info);
+            if (session_mod_info)
+            {
+                session_mod_info->updateSessionState(mInviteSession);
+                mManager->getSessionModule()->replicateState(NULL, NULL, session_mod_info);
+            }
         }
     }
 
@@ -2926,7 +2929,10 @@ void SIPSession::setCookies(const AsteriskSCF::SessionCommunications::V1::Sessio
    if (mImplPriv->mInviteSession)
    {
        PJSIPSessionModInfo *session_mod_info = static_cast<PJSIPSessionModInfo*>(mImplPriv->mInviteSession->mod_data[mImplPriv->mManager->getSessionModule()->getModule().id]);
-       session_mod_info->updateSessionState(mImplPriv->mInviteSession);
+       if (session_mod_info)
+       {
+           session_mod_info->updateSessionState(mImplPriv->mInviteSession);
+       }
        mImplPriv->mManager->getSessionModule()->replicateState(NULL, NULL, session_mod_info);
    }
 }
@@ -3273,8 +3279,9 @@ class DestroyOperation : public SuspendableWork
 {
 public:
 
-    DestroyOperation(const SIPSessionPtr& session, const boost::shared_ptr<SIPSessionPriv>& sessionPriv)
-        : mSession(session), mSessionPriv(sessionPriv) { }
+    DestroyOperation(const SIPSessionPtr& session, const boost::shared_ptr<SIPSessionPriv>& sessionPriv, 
+        PJSIPSessionModInfo* info)
+        : mSession(session), mSessionPriv(sessionPriv), mInfo(info){ }
 
     SuspendableWorkResult execute(const SuspendableWorkListenerPtr&)
     {
@@ -3331,13 +3338,10 @@ public:
         // and the pending operations in the session object. The only other way to do it would've been to have
         // cancelled and replaced all the pending operations... a bigger deal by far.
         //
-        if (mSessionPriv->mInviteSession)
+        if (mInfo)
         {
-            PJSIPSessionModInfo *session_mod_info =
-                static_cast<PJSIPSessionModInfo*>(
-                    mSessionPriv->mInviteSession->mod_data[mSessionPriv->mManager->getSessionModule()->getModule().id]);
-            mSessionPriv->mInviteSession->mod_data[mSessionPriv->mManager->getSessionModule()->getModule().id] = 0;
-            delete session_mod_info;
+            delete mInfo;
+            mInfo = 0;
         }
 
         return Complete;
@@ -3346,15 +3350,16 @@ public:
 private:
     SIPSessionPtr mSession;
     boost::shared_ptr<SIPSessionPriv> mSessionPriv;
+    PJSIPSessionModInfo* mInfo;
 };
 
 /**
  * Internal function called to destroy an endpoint. This is controlled by signaling.
  */
-void SIPSession::destroy()
+void SIPSession::destroy(PJSIPSessionModInfo* info)
 {
     lg(Debug) << "queuing a destroy operation";
-    enqueueSessionWork(new DestroyOperation(this, mImplPriv));
+    enqueueSessionWork(new DestroyOperation(this, mImplPriv, info));
 }
 
 void SIPSession::addKeys(const SIPEndpointMediaSRTPConfig& config, pjmedia_sdp_media* mediaSDP)
diff --git a/src/SIPSession.h b/src/SIPSession.h
index cc1d5d3..e4aa05a 100644
--- a/src/SIPSession.h
+++ b/src/SIPSession.h
@@ -58,6 +58,7 @@ struct NATEndpointOptions;
 
 class SIPEndpointSessionConfig;
 class SIPEndpointMediaSRTPConfig;
+class PJSIPSessionModInfo;
 
 /*
  * Private implementation class for SIPSession.
@@ -309,7 +310,7 @@ public:
      * Implementation specific functions.
      */
 
-    void destroy();
+    void destroy(PJSIPSessionModInfo* info);
 
     void addNATAttributes(const SIPEndpointSessionConfig& config, 
         const AsteriskSCF::System::NAT::V1::InteractiveConnectionAgentPrx& iceAgent,
diff --git a/src/SIPStateReplicatorListener.cpp b/src/SIPStateReplicatorListener.cpp
index 3c48ac2..0148319 100644
--- a/src/SIPStateReplicatorListener.cpp
+++ b/src/SIPStateReplicatorListener.cpp
@@ -49,7 +49,7 @@ public:
         pjsip_inv_terminate(mSession->getInviteSession(), 500, PJ_FALSE);
 
         // Now that pjsip is taken care of we can drop the session itself and consider life good
-        mSession->destroy();
+        mSession->destroy(0);
     }
 
     // Helper function which sets the session on this replicator item

commit cab9a8e0b2f81f913f2c263226475737d93b53fb
Author: Brent Eagles <beagles at digium.com>
Date:   Fri Jun 15 16:54:23 2012 -0230

    SessionWork derives from two reference counted base classes, resulting in a
    problem with mulitple instances of reference counted bases. Might be
    causing race condition issues depending on the order in which things are
    destroyed. Adding virtual inheritance to cause there to be only one
    reference counted base.

diff --git a/src/SIPSession.h b/src/SIPSession.h
index 867e842..cc1d5d3 100644
--- a/src/SIPSession.h
+++ b/src/SIPSession.h
@@ -69,7 +69,7 @@ class SIPSessionPriv;
  *
  * Each session will have its own SessionWork object to which it will queue suspendable work.
  */
-class SessionWork : public AsteriskSCF::System::WorkQueue::V1::Work, public AsteriskSCF::System::WorkQueue::V1::QueueListener
+class SessionWork : virtual public AsteriskSCF::System::WorkQueue::V1::Work, virtual public AsteriskSCF::System::WorkQueue::V1::QueueListener
 {
 public:
     /**

commit 4bcc38bbb526a17215d53c1791b8ea1493fb4a85
Author: Brent Eagles <beagles at digium.com>
Date:   Fri Jun 15 16:26:29 2012 -0230

    Fix a race condition between PJSIPSessionModule's handling of some helper
    classes and the SIPSession itself. The former was deleting the latter, with
    the latter still being around to use it. Bad form wot?

diff --git a/src/PJSIPSessionModule.cpp b/src/PJSIPSessionModule.cpp
index 064a5ff..93593a6 100644
--- a/src/PJSIPSessionModule.cpp
+++ b/src/PJSIPSessionModule.cpp
@@ -99,11 +99,6 @@ PJSIPSessionModInfo::PJSIPSessionModInfo(pjsip_inv_session *inv_session,
 
 PJSIPSessionModInfo::~PJSIPSessionModInfo()
 {
-    if (mSession)
-    {
-        mSession->destroy();
-        mSession = 0;
-    }
 }
 
 void PJSIPSessionModInfo::updateSessionState(pjsip_inv_session *inv_session)
@@ -114,14 +109,14 @@ void PJSIPSessionModInfo::updateSessionState(pjsip_inv_session *inv_session)
         mSessionState->endpointName = mSession->getEndpoint()->getName();
         mSessionState->sessionObjectId = mSession->getSessionProxy()->ice_getIdentity();
         mSessionState->mediaSessionObjectId = mSession->getMediaSessionProxy()->ice_getIdentity();
-	    mSessionState->sessionControllerObjectId = mSession->getOurSessionControllerProxy()->ice_getIdentity();
+        mSessionState->sessionControllerObjectId = mSession->getOurSessionControllerProxy()->ice_getIdentity();
         mSessionState->originalContext = mSession->getOperationContext();
         mSessionState->sources = mSession->getMediaSources();
         mSessionState->sinks = mSession->getMediaSinks();
         mSessionState->rtpMediaSessions = mSession->getRTPMediaSessions();
         mSessionState->udptlMediaSessions = mSession->getUDPTLMediaSessions();
         mSessionState->listeners = mSession->getListeners();
-	    mSessionState->streams = mSession->getStreams();
+        mSessionState->streams = mSession->getStreams();
         try
         {
             mSessionState->bridge = mSession->getBridge();
@@ -198,6 +193,20 @@ SessionWorkPtr PJSIPSessionModInfo::getSessionWork()
     return mSessionWork;
 }
 
+void PJSIPSessionModInfo::destroy()
+{
+    SIPSessionPtr t;
+    {
+        boost::unique_lock<boost::shared_mutex> lock(mLock);
+        t = mSession;
+        mSession = 0;
+    }
+    if (t)
+    {
+        t->destroy();
+    }
+}
+
 SIPSessionCreationExtensionPoint::SIPSessionCreationExtensionPoint() :
     mOperationContextCache(OperationContextCache::create(120))
 {
@@ -1884,12 +1893,11 @@ protected:
             }
             lg(Debug) << "Replicating state on DISCONNECTED inv_state.";
             mSessionModule->replicateState(dlg_mod_info, NULL, session_mod_info);
-            mInv->mod_data[mSessionModule->getModule().id] = 0;
-            delete session_mod_info;
+            session_mod_info->destroy();
             if (dlg_mod_info)
             {
-                delete dlg_mod_info;
                 dlg->mod_data[mSessionModule->getModule().id] = 0;
+                delete dlg_mod_info;
             }
         }
         if (mEventType == PJSIP_EVENT_RX_MSG && mInvState == PJSIP_INV_STATE_CONFIRMED)
diff --git a/src/PJSIPSessionModule.h b/src/PJSIPSessionModule.h
index 91fb6e4..bddb492 100644
--- a/src/PJSIPSessionModule.h
+++ b/src/PJSIPSessionModule.h
@@ -49,8 +49,20 @@ public:
     SIPSessionPtr getSessionPtr();
     void setSessionPtr(const SIPSessionPtr& sessionPtr);
     SessionWorkPtr getSessionWork();
+
+    //
+    // The PJSIP call should not destroy this object directly (ie. you should
+    // not see a delete anywhere!) It needs to tell it to run through the
+    // destroy protocol. How that works is it removes a reference to the
+    // session object from itself and calls destroy on the session. The Session
+    // object will take care of cleaning it up from the pjsip library.
+    // Hack'ish, I know but it's broken the way it is now!
+    //
+    void destroy();
+
     SIPSessionStateItemPtr mSessionState;
     SIPInviteSessionStateItemPtr mInviteState;
+
     bool mNeedsReplication;
     bool mNeedsRemoval;
     boost::shared_mutex mLock;
diff --git a/src/SIPSession.cpp b/src/SIPSession.cpp
index a963e9a..1a86101 100755
--- a/src/SIPSession.cpp
+++ b/src/SIPSession.cpp
@@ -3325,6 +3325,21 @@ public:
             }
         }
         mSessionPriv->mEndpoint->removeSession(mSession);
+
+        //
+        // We moved the clean up of this object to here to avoid conflicts between pjsip originating operations
+        // and the pending operations in the session object. The only other way to do it would've been to have
+        // cancelled and replaced all the pending operations... a bigger deal by far.
+        //
+        if (mSessionPriv->mInviteSession)
+        {
+            PJSIPSessionModInfo *session_mod_info =
+                static_cast<PJSIPSessionModInfo*>(
+                    mSessionPriv->mInviteSession->mod_data[mSessionPriv->mManager->getSessionModule()->getModule().id]);
+            mSessionPriv->mInviteSession->mod_data[mSessionPriv->mManager->getSessionModule()->getModule().id] = 0;
+            delete session_mod_info;
+        }
+
         return Complete;
     }
 

commit 9f493878cda3744160f72866833a80f451837642
Author: Brent Eagles <beagles at digium.com>
Date:   Fri Jun 15 15:22:25 2012 -0230

    Invite rejection code is only designed to handle a rejection by message,
    not by other event. Added a check to make sure the code is only entered
    if there is some data expected to be there for it to work with.

diff --git a/src/PJSIPSessionModule.cpp b/src/PJSIPSessionModule.cpp
index b6a01d2..064a5ff 100644
--- a/src/PJSIPSessionModule.cpp
+++ b/src/PJSIPSessionModule.cpp
@@ -1944,7 +1944,7 @@ void PJSIPSessionModule::invOnStateChanged(pjsip_inv_session *inv, pjsip_event *
             //Received a 1XX or 2XX message in response to our initial outgoing INVITE.
             handleInviteResponse(inv, event->body.tsx_state.src.rdata, inv->dlg);
         }
-        else if (inv->state == PJSIP_INV_STATE_DISCONNECTED)
+        else if (event->body.tsx_state.type == PJSIP_EVENT_RX_MSG && inv->state == PJSIP_INV_STATE_DISCONNECTED)
         {
             handleInviteRejection(inv, event->body.tsx_state.src.rdata, event->body.tsx_state.tsx);
         }

commit 447c46a76ebf4f537f302213e35195b3f04aef48
Author: Brent Eagles <beagles at digium.com>
Date:   Fri Jun 15 14:29:42 2012 -0230

    Add a fix to get around a race condition resulting in pjsip flip/flopping
    SDP session related pools while we are using them in another thread. The
    fix involves creating a separate SDP pool in SIPSession for its own use and
    managing it in sync with its own requirements.

diff --git a/src/SIPSession.cpp b/src/SIPSession.cpp
index aabfde6..a963e9a 100755
--- a/src/SIPSession.cpp
+++ b/src/SIPSession.cpp
@@ -145,11 +145,20 @@ public:
           mAdapter(adapter), mDialog(0), mInviteSession(0), mEndpoint(endpoint), mDestination(destination),
           mManager(manager), mServiceLocator(serviceLocator), mReplicationContext(replicationContext), 
           mNatOptions(natOptions), mSDP(0), 
-          mOperationContextCache(OperationContextCache::create(180))
+          mOperationContextCache(OperationContextCache::create(180)),
+          mSDPPool(0)
     { 
 
     }
 
+    ~SIPSessionPriv()
+    {
+        if (mSDPPool)
+        {
+            pj_pool_release(mSDPPool);
+        }
+    }
+
 
     void removeListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener)
     {
@@ -353,9 +362,78 @@ public:
 
     AsteriskSCF::Operations::OperationContextCachePtr mOperationContextCache;
 
+    /**
+     * Get our pjsip memory pool for the current SDP negotiation session. Using an
+     * independent pool prevents memory growth for long running sessions as the pool
+     * is reset whenever starting a new SDP session. Of course, this means you should
+     * not cache pointers to memory in the pool outside the context of an SDP 
+     * negotiation session.
+     *
+     * WARNING: All of SIPSession's operations that appear to be related to SDP
+     * negotiation are not necessarily called during an SDP negotiation session
+     * (they are called before). This pool is not (and probably should not) be
+     * used in these places at the moment. If the code changes in the future to
+     * break the "in process" SDP negotation related code out of the standard
+     * initialization code, then this could be used there as well if necessary.
+     */
+    pj_pool_t* getSDPPool()
+    {
+        //
+        // We should not be looking at SDP pool if we are not within and invite.
+        //
+        if (!mInviteSession || !mInviteSession->dlg)
+        {
+            return 0;
+        }
+
+        if (!mSDPPool)
+        {
+            string sdpPoolName = mEndpoint->getName() + ".sdp.pool";
+            mSDPPool = pjsip_endpt_create_pool(
+                mInviteSession->dlg->endpt, 
+                sdpPoolName.c_str(),
+                256, 
+                256);
+        }
+        return mSDPPool;
+    }
+
+    /**
+     * Reset our internal SDP pool. Should be called when starting SDP
+     * negotiation.  So far, the only place where we use it is in responding to
+     * an offer. 
+     *
+     * WARNING: All of SIPSession's operations that appear to be related to SDP
+     * negotiation are not necessarily called during an SDP negotiation session
+     * (they are called before). This pool is not (and probably should not) be
+     * used in these places at the moment. If the code changes in the future to
+     * break the "in process" SDP negotation related code out of the standard
+     * initialization code, then this could be used there as well if necessary.
+     */
+    void resetSDPPool()
+    {
+        pj_pool_t* t = getSDPPool();
+        if (t)
+        {
+            pj_pool_reset(t);
+        }
+    }
+
 private:
     static ReadOnlyCookieTypes mReadOnlyCookieTypes;
 
+    //
+    // There is race condition in pjsip with the memory pool flip/flopping
+    // before and after negotiation. It is not safe when a separate worker thread
+    // handles the SDP negotiation operations (as it does here).  The really
+    // safe thing to do is to have our own memory pool for SDP related stuff
+    // and reset it whenever we enter and SDP call flow. These calls cannot (or
+    // should not) be made recursively for a given session, so contention and
+    // races should not be an issue. The data member is accessed through
+    // accessors to prevent repetition of boilerplate.
+    //
+    pj_pool_t* mSDPPool;
+
 }; // class SIPSessionPriv
 typedef boost::shared_ptr<SIPSessionPriv> SIPSessionPrivPtr;
 
@@ -3789,6 +3867,11 @@ pjmedia_sdp_session *SIPSession::createSDPAnswer(
     const pjmedia_sdp_session* offer,
     AsteriskSCF::Media::V1::StreamInformationDict& newStreams)
 {
+    //
+    // Entering a new SDP negotiation, restart our pool.
+    //
+    mImplPriv->resetSDPPool();
+
     // Create the most common part of the SDP if not already done
     if (!mImplPriv->mSDP)
     {
@@ -3878,7 +3961,7 @@ pjmedia_sdp_session *SIPSession::createSDPAnswer(
                                                      &offer->media[stream]->desc.fmt[format])))
             {
                 pjmedia_sdp_rtpmap *rtpmap;
-                if ((pjmedia_sdp_attr_to_rtpmap(mImplPriv->mInviteSession->pool_active, attr, &rtpmap)) == PJ_SUCCESS)
+                if ((pjmedia_sdp_attr_to_rtpmap(mImplPriv->getSDPPool(), attr, &rtpmap)) == PJ_SUCCESS)
                 {
                     descriptor->subtype = std::string(pj_strbuf(&rtpmap->enc_name), pj_strlen(&rtpmap->enc_name));
                     descriptor->samplerate = rtpmap->clock_rate;

commit 58cc573539da83eb5bf2fc45c404fdfbf88560ec
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Mon May 14 18:02:49 2012 -0500

    Updated the configurator script and some additional cleanup for transition to name Session Gateway.

diff --git a/config/SIPConfigurator.py b/config/SIPConfigurator.py
index f66891e..2ca3456 100755
--- a/config/SIPConfigurator.py
+++ b/config/SIPConfigurator.py
@@ -27,18 +27,18 @@ sys.path.append("/opt/Ice-3.4/python")
 import ConfigParser, Ice, Configurator, traceback, uuid
 
 # Load our component specific configuration definitions
-Configurator.astscfLoadSlice("sip", "AsteriskSCF/Configuration/SIPSessionManager/SIPConfigurationIf.ice")
+Configurator.astscfLoadSlice("sip", "AsteriskSCF/Configuration/SIPSessionGateway/SIPConfigurationIf.ice")
 
-import AsteriskSCF.Configuration.SIPSessionManager.V1
+import AsteriskSCF.Configuration.SIPSessionGateway.V1
 
 
 # Add our own visitor implementations for the sections we support
 class SIPSectionVisitors(Configurator.SectionVisitors):
     def visit_general(self, config, section):
-        group = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPGeneralGroup()
+        group = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPGeneralGroup()
         group.configurationItems = { }
         mapper = Configurator.OptionMapper()
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPUserAgentItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPUserAgentItem()
         mapper.map('useragent', item, 'userAgent', 'userAgent', config.get, None)
         for option in config.options(section):
             mapper.execute(group, section, option)
@@ -48,12 +48,12 @@ class SIPSectionVisitors(Configurator.SectionVisitors):
         self.groups.append(group)
 
     def visit_transport_udp(self, config, section):
-        group = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPUDPTransportGroup()
+        group = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPUDPTransportGroup()
         group.name = section
         group.configurationItems = { }
 
         mapper = Configurator.OptionMapper()
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPHostItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPHostItem()
         mapper.map('host', item, 'host', 'address', config.get, None)
         mapper.map('port', item, 'port', 'address', config.getint, 5060)
         for option in config.options(section):
@@ -64,12 +64,12 @@ class SIPSectionVisitors(Configurator.SectionVisitors):
         self.groups.append(group)
 
     def visit_transport_tcp(self, config, section):
-        group = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPTCPTransportGroup()
+        group = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPTCPTransportGroup()
         group.name = section
         group.configurationItems = { }
 
         mapper = Configurator.OptionMapper()
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPHostItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPHostItem()
         mapper.map('host', item, 'host', 'address', config.get, None)
         mapper.map('port', item, 'port', 'address', config.getint, 5060)
         for option in config.options(section):
@@ -80,12 +80,12 @@ class SIPSectionVisitors(Configurator.SectionVisitors):
         self.groups.append(group)
 
     def visit_transport_tls(self, config, section):
-        group = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPTLSTransportGroup()
+        group = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPTLSTransportGroup()
         group.name = section
         group.configurationItems = { }
 
         mapper = Configurator.OptionMapper()
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPHostItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPHostItem()
         mapper.map('host', item, 'host', 'address', config.get, None)
         mapper.map('port', item, 'port', 'address', config.getint, 5060)
         for option in config.options(section):
@@ -96,16 +96,16 @@ class SIPSectionVisitors(Configurator.SectionVisitors):
         self.groups.append(group)
 
     def visit_transport_stun(self, config, section):
-        group = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPSTUNTransportGroup()
+        group = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPSTUNTransportGroup()
         group.name = section
         group.configurationItems = {}
         mapper = Configurator.OptionMapper()
 
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPSignalingSTUNHostItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPSignalingSTUNHostItem()
         mapper.map('stunhost', item, 'address', 'stunServer', config.get, None)
         mapper.map('stunport', item, 'port', 'stunServer', config.getint, 3478)
 
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPHostItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPHostItem()
         mapper.map('baseaddress', item, 'host', 'baseAddress', config.get, None)
         mapper.map('baseport', item, 'port', 'baseAddress', config.getint, 4512)
 
@@ -128,23 +128,23 @@ class SIPSectionVisitors(Configurator.SectionVisitors):
 
                 for contact in contacts:
                     uri, slash, expiration = contact.partition('/')
-                    info = AsteriskSCF.Configuration.SIPSessionManager.V1.ContactInfo()
+                    info = AsteriskSCF.Configuration.SIPSessionGateway.V1.ContactInfo()
                     info.contactURI = uri
                     info.expiration = int(expiration)
                     ret.append(info)
 
                 return ret
 
-        group = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPRegistrationGroup()
+        group = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPRegistrationGroup()
         group.name = section
         group.configurationItems = {}
 
         mapper = Configurator.OptionMapper()
 
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPClientRegistrationItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPClientRegistrationItem()
 
         mapper.map('aor', item, 'aor', 'registration', config.get, None)
-        mapper.map('expiration', item, 'defaultExpiration', 'registration', config.getint, AsteriskSCF.Configuration.SIPSessionManager.V1.DefaultRegistrationExpirationSeconds)
+        mapper.map('expiration', item, 'defaultExpiration', 'registration', config.getint, AsteriskSCF.Configuration.SIPSessionGateway.V1.DefaultRegistrationExpirationSeconds)
         handler = RegistrationContactHandler(config)
         mapper.map('contacts', item, 'contacts', 'registration', handler.get, None)
 
@@ -156,13 +156,13 @@ class SIPSectionVisitors(Configurator.SectionVisitors):
         self.groups.append(group)
 
     def visit_identity(self, config, section):
-        group = AsteriskSCF.Configuration.SIPSessionManager.V1.IdentityGroup()
+        group = AsteriskSCF.Configuration.SIPSessionGateway.V1.IdentityGroup()
         group.name = section
         group.configurationItems = { }
 
         mapper = Configurator.OptionMapper()
 
-        item =  AsteriskSCF.Configuration.SIPSessionManager.V1.IdentityItem()
+        item =  AsteriskSCF.Configuration.SIPSessionGateway.V1.IdentityItem()
 	#      map(option, object, item, item_name, method, default)
         mapper.map('name', item, 'name', 'id', config.get, None)
         mapper.map('number', item, 'number', 'id', config.get, None)
@@ -175,15 +175,15 @@ class SIPSectionVisitors(Configurator.SectionVisitors):
         self.groups.append(group)
 
     def visit_endpoint(self, config, section):
-        group = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPEndpointGroup()
+        group = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPEndpointGroup()
         group.name = section
         group.configurationItems = { }
 
         mapper = Configurator.OptionMapper()
 
-        mapper.map('routing', AsteriskSCF.Configuration.SIPSessionManager.V1.SIPRoutingItem(), 'routingServiceName', 'routingService', config.get, None)
+        mapper.map('routing', AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPRoutingItem(), 'routingServiceName', 'routingService', config.get, None)
 
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.IdentityItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.IdentityItem()
         mapper.map('name', item, 'name', 'identity', config.get, None)
         mapper.map('number', item, 'number', 'identity', config.get, None)
 
@@ -192,29 +192,29 @@ class SIPSectionVisitors(Configurator.SectionVisitors):
             ids = config.get(section, 'ids')
             idList = ids.split(',')
             for id in idList:
-                item = AsteriskSCF.Configuration.SIPSessionManager.V1.IdentityGroupRef()
+                item = AsteriskSCF.Configuration.SIPSessionGateway.V1.IdentityGroupRef()
                 item.identityGroupName = id
                 group.configurationItems[id] = item
 	except ConfigParser.NoOptionError:
 	    # It's legit to omit the ids option from this section.
 	    pass
 
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPSourceTransportAddressItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPSourceTransportAddressItem()
         mapper.map('sourcehost', item, 'host', 'sourceaddress', config.get, None)
         mapper.map('sourceport', item, 'port', 'sourceaddress', config.getint, 5060)
 
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPTargetDestinationAddressItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPTargetDestinationAddressItem()
         mapper.map('targethost', item, 'host', 'targetaddress', config.get, None)
         mapper.map('targetport', item, 'port', 'targetaddress', config.getint, 5060)
 
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPSignalingNATItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPSignalingNATItem()
         mapper.map('enablestun', item, 'stun', 'enableSTUN', config.get, None)
 
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPMediaNATItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPMediaNATItem()
         mapper.map('enablertpoverice', item, 'enableICE', 'enableRTPICE', config.get, None)
         mapper.map('enableturn', item, 'enableTURN', 'enableRTPICE', config.get, None)
 
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SRTPCryptoItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SRTPCryptoItem()
 
         #
         # Maps key/suite pairs to SRTPCryptoKey configuration
@@ -274,7 +274,7 @@ class SIPSectionVisitors(Configurator.SectionVisitors):
                                 cryptoKeyPairs[suffix][1] = value
 
                     for k in cryptoKeyPairs.values():
-                        cryptoKey = AsteriskSCF.Configuration.SIPSessionManager.V1.SRTPCryptoKey()
+                        cryptoKey = AsteriskSCF.Configuration.SIPSessionGateway.V1.SRTPCryptoKey()
                         cryptoKey.suite = k[0]
                         cryptoKey.cryptoKey = k[1]
                         self.cryptoItem.cryptoKeys.append(cryptoKey)
@@ -290,45 +290,45 @@ class SIPSectionVisitors(Configurator.SectionVisitors):
                 self.config = config
             def get(self, section, item):
                 if self.config.get(section, item) == 'inbound':
-                    return AsteriskSCF.Configuration.SIPSessionManager.V1.SIPAllowableCallDirection.Inbound
+                    return AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPAllowableCallDirection.Inbound
                 elif self.config.get(section, item) == 'outbound':
-                    return AsteriskSCF.Configuration.SIPSessionManager.V1.SIPAllowableCallDirection.Outbound
+                    return AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPAllowableCallDirection.Outbound
                 elif self.config.get(section, item) == 'both':
-                    return AsteriskSCF.Configuration.SIPSessionManager.V1.SIPAllowableCallDirection.Both
+                    return AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPAllowableCallDirection.Both
                 elif self.config.get(section, item) == 'none':
-                    return AsteriskSCF.Configuration.SIPSessionManager.V1.SIPAllowableCallDirection.Disabled
+                    return AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPAllowableCallDirection.Disabled
 
         transformer = AllowableCallDirectionTransformer(config)
 
-        mapper.map('direction', AsteriskSCF.Configuration.SIPSessionManager.V1.SIPAllowableCallDirectionItem(), 'callDirection', 'callDirection', transformer.get, None)
+        mapper.map('direction', AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPAllowableCallDirectionItem(), 'callDirection', 'callDirection', transformer.get, None)
 
-        mapper.map('securetransport', AsteriskSCF.Configuration.SIPSessionManager.V1.SIPEndpointTransportItem(), 'secureTransport', 'transport', transformer.get, None)
+        mapper.map('securetransport', AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPEndpointTransportItem(), 'secureTransport', 'transport', transformer.get, None)
 
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPRTPMediaServiceItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPRTPMediaServiceItem()
         mapper.map('rtpoveripv6', item, 'requireIPv6', 'mediaservice', config.getboolean, None)
         mapper.map('rtpmediaservice', item, 'mediaServiceName', 'mediaservice', config.get, None)
 
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.DirectMediaItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.DirectMediaItem()
         mapper.map('directmedia', item, 'enabled', 'directmedia', config.getboolean, None)
 
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPUDPTLMediaServiceItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPUDPTLMediaServiceItem()
         mapper.map('udptloveripv6', item, 'requireIPv6', 'udptlmediaservice', config.getboolean, None)
         mapper.map('udptloverice', item, 'enableICE', 'udptlmediaservice', config.getboolean, None)
         mapper.map('udptlwithturn', item, 'enableTURN', 'udptlmediaservice', config.getboolean, None)
         mapper.map('udptlmediaservice', item, 'mediaServiceName', 'udptlmediaservice', config.get, None);
 
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPCryptoCertificateItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPCryptoCertificateItem()
         mapper.map('certificateauthorityfile', item, 'certificateAuthority', 'cryptocert', config.get, None)
         mapper.map('certificatefile', item, 'certificate', 'cryptocert', config.get, None)
         mapper.map('privatekeyfile', item, 'privateKey', 'cryptocert', config.get, None)
         mapper.map('privatekeypassword', item, 'privateKeyPassword', 'cryptocert', config.get, None)
 
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPCryptoRequirementsItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPCryptoRequirementsItem()
         mapper.map('requireverifiedserver', item, 'requireVerifiedServer', 'cryptorequirements', config.getboolean, None)
         mapper.map('requireverifiedclient', item, 'requireVerifiedClient', 'cryptorequirements', config.getboolean, None)
         mapper.map('requireclientcertificate', item, 'requireClientCertificate', 'cryptorequirements', config.getboolean, None)
 
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPCryptoItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPCryptoItem()
         mapper.map('supportedciphers', item, 'supportedCiphers', 'crypto', config.get, None)
         mapper.map('tlsservername', item, 'serverName', 'crypto', config.get, None)
         mapper.map('tlstimeout', item, 'timeout', 'crypto', config.getint, None)
@@ -338,15 +338,15 @@ class SIPSectionVisitors(Configurator.SectionVisitors):
                 self.config = config
             def get(self, section, item):
                 if self.config.get(section, item) == 'unspecified':
-                    return AsteriskSCF.Configuration.SIPSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODUNSPECIFIED
+                    return AsteriskSCF.Configuration.SIPSessionGateway.V1.TLSProtocolMethod.PROTOCOLMETHODUNSPECIFIED
                 elif self.config.get(section, item) == 'tlsv1':
-                    return AsteriskSCF.Configuration.SIPSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODTLSV1
+                    return AsteriskSCF.Configuration.SIPSessionGateway.V1.TLSProtocolMethod.PROTOCOLMETHODTLSV1
                 elif self.config.get(section, item) == 'sslv2':
-                    return AsteriskSCF.Configuration.SIPSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODTSSLV2
+                    return AsteriskSCF.Configuration.SIPSessionGateway.V1.TLSProtocolMethod.PROTOCOLMETHODTSSLV2
                 elif self.config.get(section, item) == 'sslv3':
-                    return AsteriskSCF.Configuration.SIPSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODSSLV3
+                    return AsteriskSCF.Configuration.SIPSessionGateway.V1.TLSProtocolMethod.PROTOCOLMETHODSSLV3
                 elif self.config.get(section, item) == 'sslv23':
-                    return AsteriskSCF.Configuration.SIPSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODSSLV23
+                    return AsteriskSCF.Configuration.SIPSessionGateway.V1.TLSProtocolMethod.PROTOCOLMETHODSSLV23
 
         transformer = TLSProtocolMethodTransformer(config)
         mapper.map('tlsprotocolmethod', item, 'protocolMethod', 'crypto', transformer.get, None)
@@ -356,15 +356,15 @@ class SIPSectionVisitors(Configurator.SectionVisitors):
                 self.config = config
             def get(self, section, item):
                 if self.config.get(section, item) == 'info':
-                    return AsteriskSCF.Configuration.SIPSessionManager.V1.SIPDTMFOption.INFO
+                    return AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPDTMFOption.INFO
                 if self.config.get(section, item) == 'rfc4733' or self.config.get(section.item) == 'rfc2833':
-                    return AsteriskSCF.Configuration.SIPSessionManager.V1.SIPDTMFOption.RFC4733
+                    return AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPDTMFOption.RFC4733
                 if self.config.get(section, item) == 'inband':
-                    return AsteriskSCF.Configuration.SIPSessionManager.V1.SIPDTMFOption.Inband
+                    return AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPDTMFOption.Inband
 
-        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPDTMFItem()
+        item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPDTMFItem()
         dtmfTransformer = DTMFMethodTransformer(config)
-        mapper.map('dtmfmethod', item, 'dtmf', 'dtmfmethod', dtmfTransformer.get, AsteriskSCF.Configuration.SIPSessionManager.V1.SIPDTMFOption.RFC4733)
+        mapper.map('dtmfmethod', item, 'dtmf', 'dtmfmethod', dtmfTransformer.get, AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPDTMFOption.RFC4733)
 
         for option in config.options(section):
             mapper.execute(group, section, option)
@@ -374,7 +374,7 @@ class SIPSectionVisitors(Configurator.SectionVisitors):
             formats = config.get(section, 'formats')
             configuredFormats = formats.split(',')
             for format in configuredFormats:
-                item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPMediaFormatItem()
+                item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPMediaFormatItem()
 
                 front, found, rest = format.partition('/')
                 if found:
@@ -418,7 +418,7 @@ class SIPSectionVisitors(Configurator.SectionVisitors):
             registrations = config.get(section, 'registrations')
             registrationList = registrations.split(',')
             for reg in registrationList:
-                item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPRegistrationGroupRef()
+                item = AsteriskSCF.Configuration.SIPSessionGateway.V1.SIPRegistrationGroupRef()
                 item.registrationGroupName = reg
                 group.configurationItems[reg] = item
         except:
@@ -442,7 +442,7 @@ class SIPSectionVisitors(Configurator.SectionVisitors):
 
 # In order to do service locator based lookup we need to pass in a params object
 serviceLocatorParams = AsteriskSCF.Core.Discovery.V1.ServiceLocatorParams()
-serviceLocatorParams.category = AsteriskSCF.Configuration.SIPSessionManager.V1.ConfigurationDiscoveryCategory
+serviceLocatorParams.category = AsteriskSCF.Configuration.SIPSessionGateway.V1.ConfigurationDiscoveryCategory
 serviceLocatorParams.service = 'default' 
 
 # Make a configurator application and let it run
diff --git a/slice/SIPIf.ice b/slice/SIPIf.ice
index 0488b35..85b9e36 100644
--- a/slice/SIPIf.ice
+++ b/slice/SIPIf.ice
@@ -41,7 +41,7 @@ module V1
    };
    
    /**
-    * Interface for monitoring the SIP Session Manager events. 
+    * Interface for monitoring the SIP Session Gateway events. 
     */
    interface SIPSessionGatewayEvents
    {
diff --git a/src/Component.cpp b/src/Component.cpp
index 707cb76..c38816d 100644
--- a/src/Component.cpp
+++ b/src/Component.cpp
@@ -391,7 +391,7 @@ void Component::registerPJSIPModules()
          ++i)
     {
         //We should probably delegate the responsibility of mapping
-        //module names to modules to the PJSIP session manager instead.
+        //module names to modules to the PJSIP session gateway instead.
         //Since there's only a single configurable module at the moment,
         //we'll just do it here instead.
         //
@@ -452,7 +452,7 @@ void Component::onPreInitialize()
 /**
  * Register our own Endpoint Locator with the Routing Service so that
  * the endpoints that this channel manages can be accessed from any
- * Session Manager in the Asterisk SCF system.
+ * Session Gateway in the Asterisk SCF system.
  */
 void Component::registerWithRoutingService()
 {
@@ -538,7 +538,7 @@ void Component::createPrimaryServices()
             boost::static_pointer_cast<SIPReplicationContext>(getReplicationContext());
 
         mEventPublisher.reset(new SIPSessionGatewayEventPublisher(getServiceAdapter()));
-        lg(Debug) << "Created SIP Session Manager event publisher";
+        lg(Debug) << "Created SIP Session Gateway event publisher";
 
         mEndpointFactory.reset(new SIPEndpointFactory(
                     getServiceAdapter(),
diff --git a/src/SIPSessionGatewayEndpointLocator.h b/src/SIPSessionGatewayEndpointLocator.h
index 1f6737c..7f75c40 100644
--- a/src/SIPSessionGatewayEndpointLocator.h
+++ b/src/SIPSessionGatewayEndpointLocator.h
@@ -28,7 +28,7 @@ namespace SIPSessionGateway
 /**
  * An implementation of the Routing Service EndpointLocator interface.
  * This class provides lookups of all the endpoints managed by this
- * Session Manager component, so that the rest of the Asterisk SCF system
+ * Session Gateway component, so that the rest of the Asterisk SCF system
  * can bridge our endpoints.
  */
 class SIPSessionGatewayEndpointLocator : public AsteriskSCF::Core::Routing::V1::EndpointLocator

commit 94b328038ff72e9230039d302be1f66b09b0345d
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Mon May 14 15:31:40 2012 -0500

    Name transition from SessionManager to SessionGateway.

diff --git a/config/test_sip.conf b/config/test_sip.conf
index e94f85d..3254e57 100644
--- a/config/test_sip.conf
+++ b/config/test_sip.conf
@@ -3,52 +3,35 @@
 # Adapter parameters for this component
 # The IP address and port specified here *must* match between master and slave
 # for Ice proxies to remain valid.
-SipSessionManagerAdapter.Endpoints=tcp -h 127.0.0.1 -p 9985
-SipSessionManagerAdapter.ThreadPool.Size=4
+SIPSessionGateway.ServiceAdapter.Endpoints=tcp -h 127.0.0.1 -p 4461
+SIPSessionGateway.ServiceAdapter.ThreadPool.Size=4
 
 # Adapter parameters for the object adapter unique to this instance of the component
 # This should have a specified IP address and port so the replica control utility can find it.
-SipSessionManagerLocalAdapter.Endpoints=default -h 127.0.0.1 
-SipSessionManagerLocalAdapter.ThreadPool.Size=4
+SIPSessionGateway.BackplaneAdapter.Endpoints=default -h 127.0.0.1 -p 4462
+SIPSessionGateway.BackplaneAdapter.ThreadPool.Size=4
 
 # A proxy to the IceStorm topic manager
-TopicManager.Proxy=AsteriskSCFIceStorm/TopicManager:default  -h 127.0.0.1 -p 10000
+TopicManager.Proxy=AsteriskSCFIceStorm/TopicManager:default  -h 127.0.0.1 -p 4421
 
 # A proxy to the service locator management service
-LocatorServiceManagement.Proxy=LocatorServiceManagement:tcp  -h 127.0.0.1 -p 4422
+LocatorServiceManagement.Proxy=LocatorServiceManagement:tcp  -h 127.0.0.1 -p 4412
 
 # A proxy to the service locator service
 LocatorService.Proxy=LocatorService:tcp -h 127.0.0.1  -p 4411
 
 # ID to use when registering with the routing service
 # Useful if registering multiple active SIP session managers
-Sip.RoutingDestinationId=pjsip
+SIPSessionGateway.SIP.RoutingDestinationId=pjsip
 
 # PJSIP Modules to register
-Sip.Modules=Session
-
-# UDP Bind address.
-Sip.Transport.UdpBindAddr=0.0.0.0:5060
+SIPSessionGateway.SIP.Modules=Session
 
 # The service name of the State replicator to use
-Sip.StateReplicatorService=default
-
-# Whether we are only a listener or not
-Sip.StateReplicatorListener=no
-
-# Endpoints that we know about
-Sip.Endpoints=cisco 18005558355
-
-
-# This is Josh's phone
-Sip.Endpoint.cisco.Session.CallDirection=Both
-
-Sip.Endpoint.18005558355.Session.CallDirection=Both
-Sip.Endpoint.18005558355.Session.SourceAddress=172.16.1.13
-Sip.Endpoint.18005558355.Transport.Address=172.16.1.10
+SIPSessionGateway.SIP.StateReplicatorService=default
 
 IceBox.InheritProperties = 1
-IceBox.Service.SipSessionManager=SipSessionManager:create
+IceBox.Service.SIPSessionGateway=SIPSessionGateway:create
 
-SipSessionManager.Standalone=true
+SIPSessionGateway.Standalone=true
 
diff --git a/config/test_sip_state_replicator.conf b/config/test_sip_state_replicator.conf
index bf46ede..ef34305 100644
--- a/config/test_sip_state_replicator.conf
+++ b/config/test_sip_state_replicator.conf
@@ -1,6 +1,6 @@
 # Adapter parameters for this component
-SipStateReplicator.Endpoints=default -h 127.0.0.1
-SipStateReplicator.ThreadPool.Size=4
+SIPStateReplicator.Endpoints=default -h 127.0.0.1
+SIPStateReplicator.ThreadPool.Size=4
 
 # A proxy to the IceStorm topic manager
 TopicManager.Proxy=AsteriskSCFIceStorm/TopicManager:default  -h 127.0.0.1 -p 10000
@@ -12,15 +12,15 @@ LocatorServiceManagement.Proxy=LocatorServiceManagement:tcp  -h 127.0.0.1 -p 442
 LocatorService.Proxy=LocatorService:tcp  -h 127.0.0.1 -p 4411
 
 # The name of the state replicator
-SipStateReplicator.Name=default
+SIPStateReplicator.Name=default
 
 IceBox.InheritProperties = 1
-IceBox.Service.SipStateReplicator=SipStateReplicator:create
+IceBox.Service.SIPStateReplicator=SIPStateReplicator:create
 
-SipStateReplicatorIceStorm.InstanceName=SipStateReplicatorIceStorm
-SipStateReplicatorIceStorm.TopicManager.Endpoints=default -h 127.0.0.1  -p 10007
-SipStateReplicatorIceStorm.Publish.Endpoints=default -h 127.0.0.1  -p 10008
-SipStateReplicatorIceStorm.Trace.TopicManager=2
-SipStateReplicatorIceStorm.Transient=1
-SipStateReplicatorIceStorm.Flush.Timeout=2000
-SipStateReplicatorTopicManager.Proxy=SipStateReplicatorIceStorm/TopicManager:default  -h 127.0.0.1 -p 10007
+SIPStateReplicatorIceStorm.InstanceName=SIPStateReplicatorIceStorm
+SIPStateReplicatorIceStorm.TopicManager.Endpoints=default -h 127.0.0.1  -p 10007
+SIPStateReplicatorIceStorm.Publish.Endpoints=default -h 127.0.0.1  -p 10008
+SIPStateReplicatorIceStorm.Trace.TopicManager=2
+SIPStateReplicatorIceStorm.Transient=1
+SIPStateReplicatorIceStorm.Flush.Timeout=2000
+SIPStateReplicatorTopicManager.Proxy=SIPStateReplicatorIceStorm/TopicManager:default  -h 127.0.0.1 -p 10007
diff --git a/slice/AsteriskSCF/Configuration/SIPSessionManager/SIPConfigurationIf.ice b/slice/AsteriskSCF/Configuration/SIPSessionGateway/SIPConfigurationIf.ice
similarity index 99%
rename from slice/AsteriskSCF/Configuration/SIPSessionManager/SIPConfigurationIf.ice
rename to slice/AsteriskSCF/Configuration/SIPSessionGateway/SIPConfigurationIf.ice
index 78e0700..416b146 100644
--- a/slice/AsteriskSCF/Configuration/SIPSessionManager/SIPConfigurationIf.ice
+++ b/slice/AsteriskSCF/Configuration/SIPSessionGateway/SIPConfigurationIf.ice
@@ -27,7 +27,7 @@ module AsteriskSCF
 module Configuration
 {
 
-module SIPSessionManager
+module SIPSessionGateway
 {
 
 ["suppress"]
@@ -621,7 +621,7 @@ class SIPRegistrationGroupRef extends SIPConfigurationItem
 
 }; /* module V1 */
 
-}; /* module SIPSessionManager */
+}; /* module SIPSessionGateway */
 
 }; /* module Configuration */
 
diff --git a/slice/AsteriskSCF/Replication/SIPSessionManager/SIPStateReplicationIf.ice b/slice/AsteriskSCF/Replication/SIPSessionGateway/SIPStateReplicationIf.ice
similarity index 99%
rename from slice/AsteriskSCF/Replication/SIPSessionManager/SIPStateReplicationIf.ice
rename to slice/AsteriskSCF/Replication/SIPSessionGateway/SIPStateReplicationIf.ice
index 0bb964c..621bf8c 100644
--- a/slice/AsteriskSCF/Replication/SIPSessionManager/SIPStateReplicationIf.ice
+++ b/slice/AsteriskSCF/Replication/SIPSessionGateway/SIPStateReplicationIf.ice
@@ -32,7 +32,7 @@ module AsteriskSCF
 module Replication
 {
 
-module SIPSessionManager
+module SIPSessionGateway
 {
 
 ["suppress"]
@@ -229,7 +229,7 @@ module V1
 
 }; /* module V1 */
 
-}; /* module SIPSessionManager */
+}; /* module SIPSessionGateway */
 
 }; /* module Replication */
 
diff --git a/slice/AsteriskSCF/SessionCookies/SIPSessionManager/SIPSessionCookiesIf.ice b/slice/AsteriskSCF/SessionCookies/SIPSessionGateway/SIPSessionCookiesIf.ice
similarity index 95%
rename from slice/AsteriskSCF/SessionCookies/SIPSessionManager/SIPSessionCookiesIf.ice
rename to slice/AsteriskSCF/SessionCookies/SIPSessionGateway/SIPSessionCookiesIf.ice
index a34f8ea..373df71 100644
--- a/slice/AsteriskSCF/SessionCookies/SIPSessionManager/SIPSessionCookiesIf.ice
+++ b/slice/AsteriskSCF/SessionCookies/SIPSessionGateway/SIPSessionCookiesIf.ice
@@ -24,7 +24,7 @@ module AsteriskSCF
 module SessionCookies
 {
 
-module SIPSessionManager
+module SIPSessionGateway
 {
 
 ["suppress"]
@@ -45,6 +45,6 @@ unsliceable class ReferredByCookie extends AsteriskSCF::SessionCommunications::V
 };
 
 }; //end module V1
-}; //end module SIPSessionManager
+}; //end module SIPSessionGateway
 }; //end module SessionCookies
 }; //end module AsteriskSCF
diff --git a/slice/SIPIf.ice b/slice/SIPIf.ice
index 617f44c..0488b35 100644
--- a/slice/SIPIf.ice
+++ b/slice/SIPIf.ice
@@ -26,7 +26,7 @@ module SIP
 module V1
 {
    const string Version = "V1";
-   const string ComponentServiceDiscoveryCategory = "SIPSessionManager";
+   const string ComponentServiceDiscoveryCategory = "SIPSessionGateway";
    const string AuthExtensionPointCategory = "SIPAuthExtensionPoint";
 
    // A submodule for our event publication.
@@ -43,7 +43,7 @@ module V1
    /**
     * Interface for monitoring the SIP Session Manager events. 
     */
-   interface SIPSessionManagerEvents
+   interface SIPSessionGatewayEvents
    {
       /**
        * Notification that a lookup was attempted on our published EndpointLocator.
diff --git a/src/AuthManager.cpp b/src/AuthManager.cpp
index e36f718..b111a4e 100644
--- a/src/AuthManager.cpp
+++ b/src/AuthManager.cpp
@@ -25,7 +25,7 @@ using namespace AsteriskSCF::System::Logging;
 namespace AsteriskSCF
 {
 
-namespace SIPSessionManager
+namespace SIPSessionGateway
 {
 
 class AuthHookWrapper
diff --git a/src/AuthManager.h b/src/AuthManager.h
index a07272b..23d0d0e 100644
--- a/src/AuthManager.h
+++ b/src/AuthManager.h
@@ -27,7 +27,7 @@
 namespace AsteriskSCF
 {
 
-namespace SIPSessionManager
+namespace SIPSessionGateway
 {
 
 class AuthHookWrapper;
@@ -198,5 +198,5 @@ private:
 
 typedef boost::shared_ptr<AuthManager> AuthManagerPtr;
 
-}; //end namespace SIPSessionManager
+}; //end namespace SIPSessionGateway
 }; //end namespace AsteriskSCF
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index aa40d6f..3e602da 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -15,89 +15,89 @@ if(${CMAKE_CL_64})
     add_definitions("/bigobj")
 endif()
 
-astscf_component_init(SIPSessionManager)
-astscf_component_add_files(SIPSessionManager Component.cpp)
-astscf_component_add_files(SIPSessionManager SIPReplicationContext.h)
-astscf_component_add_files(SIPSessionManager SIPSessionManagerEventPublisher.cpp)
-astscf_component_add_files(SIPSessionManager SIPSessionManagerEventPublisher.h)
-astscf_component_add_files(SIPSessionManager SIPSessionManagerEndpointLocator.cpp)
-astscf_component_add_files(SIPSessionManager SIPSessionManagerEndpointLocator.h)
-astscf_component_add_files(SIPSessionManager SIPEndpointFactory.cpp)
-astscf_component_add_files(SIPSessionManager SIPEndpointFactory.h)
-astscf_component_add_files(SIPSessionManager SIPEndpoint.cpp)
-astscf_component_add_files(SIPSessionManager SIPEndpoint.h)
-astscf_component_add_files(SIPSessionManager SIPSession.cpp)
-astscf_component_add_files(SIPSessionManager SIPSession.h)
-astscf_component_add_files(SIPSessionManager SIPTelephonyEventSource.cpp)
-astscf_component_add_files(SIPSessionManager SIPTelephonyEventSource.h)
-astscf_component_add_files(SIPSessionManager SIPTelephonyEventSink.cpp)
-astscf_component_add_files(SIPSessionManager SIPTelephonyEventSink.h)
-astscf_component_add_files(SIPSessionManager PJSIPManager.cpp)
-astscf_component_add_files(SIPSessionManager PJSIPManager.h)
-astscf_component_add_files(SIPSessionManager PJSIPModule.cpp)
-astscf_component_add_files(SIPSessionManager PJSIPModule.h)
-astscf_component_add_files(SIPSessionManager SIPTransfer.cpp)
-astscf_component_add_files(SIPSessionManager SIPTransfer.h)
-astscf_component_add_files(SIPSessionManager PJSIPSessionModule.cpp)
-astscf_component_add_files(SIPSessionManager PJSIPSessionModuleConstruction.cpp)
-astscf_component_add_files(SIPSessionManager PJSIPSessionModule.h)
-astscf_component_add_files(SIPSessionManager PJSIPLoggingModule.cpp)
-astscf_component_add_files(SIPSessionManager PJSIPLoggingModuleConstruction.cpp)
-astscf_component_add_files(SIPSessionManager PJSIPLoggingModule.h)
-astscf_component_add_files(SIPSessionManager PJSIPRegistrarModule.cpp)
-astscf_component_add_files(SIPSessionManager PJSIPRegistrarModuleConstruction.cpp)
-astscf_component_add_files(SIPSessionManager PJSIPRegistrarModule.h)
-astscf_component_add_files(SIPSessionManager SIPClientRegistration.cpp)
-astscf_component_add_files(SIPSessionManager SIPClientRegistration.h)
-astscf_component_add_files(SIPSessionManager AuthManager.cpp)
-astscf_component_add_files(SIPSessionManager AuthManager.h)
-astscf_component_add_files(SIPSessionManager SIPConfiguration.cpp)
-astscf_component_add_files(SIPSessionManager SIPConfiguration.h)
-astscf_component_add_files(SIPSessionManager SIPStateReplicatorListener.cpp)
-astscf_component_add_files(SIPSessionManager SIPStateReplicator.h)
-astscf_component_add_files(SIPSessionManager Transports.cpp)
-astscf_component_add_files(SIPSessionManager Transports.h)
-astscf_component_add_files(SIPSessionManager UDPTransport.cpp)
-astscf_component_add_files(SIPSessionManager UDPTransport.h)
-astscf_component_add_files(SIPSessionManager TCPTransport.cpp)
-astscf_component_add_files(SIPSessionManager TCPTransport.h)
-astscf_component_add_files(SIPSessionManager TLSTransport.cpp)
-astscf_component_add_files(SIPSessionManager TLSTransport.h)
-astscf_component_add_files(SIPSessionManager PJUtil.h)
-astscf_component_add_files(SIPSessionManager DebugUtil.h)
-astscf_component_add_files(SIPSessionManager SIPModule.h)
-astscf_component_add_files(SIPSessionManager STUNModule.cpp)
-astscf_component_add_files(SIPSessionManager STUNModule.h)
-astscf_component_add_files(SIPSessionManager STUNTransport.cpp)
-astscf_component_add_files(SIPSessionManager STUNTransport.h)
-astscf_component_add_files(SIPSessionManager STUNTransportConfig.cpp)
-astscf_component_add_files(SIPSessionManager STUNTransportConfig.h)
-astscf_component_add_files(SIPSessionManager NATOptions.h)
-astscf_component_add_files(SIPSessionManager SIPRegistrarListener.cpp)
-astscf_component_add_files(SIPSessionManager SIPRegistrarListener.h)
-astscf_component_add_slices(SIPSessionManager PROJECT SIPIf.ice)
-astscf_component_add_slices(SIPSessionManager PROJECT AsteriskSCF/Replication/SIPSessionManager/SIPStateReplicationIf.ice)
-astscf_component_add_slices(SIPSessionManager PROJECT AsteriskSCF/Configuration/SIPSessionManager/SIPConfigurationIf.ice)
-astscf_component_add_slices(SIPSessionManager PROJECT AsteriskSCF/SessionCookies/SIPSessionManager/SIPSessionCookiesIf.ice)
-astscf_component_add_ice_libraries(SIPSessionManager IceStorm)
-astscf_component_add_boost_libraries(SIPSessionManager core)
-astscf_component_add_slice_collection_libraries(SIPSessionManager ASTSCF)
-astscf_component_build_icebox(SIPSessionManager)
-target_link_libraries(SIPSessionManager LoggingClient ASTSCFIceUtilCpp ASTSCFIceUtilCppPJLIB ${OPENSSL_LIBRARIES})
+astscf_component_init(SIPSessionGateway)
+astscf_component_add_files(SIPSessionGateway Component.cpp)
+astscf_component_add_files(SIPSessionGateway SIPReplicationContext.h)
+astscf_component_add_files(SIPSessionGateway SIPSessionGatewayEventPublisher.cpp)
+astscf_component_add_files(SIPSessionGateway SIPSessionGatewayEventPublisher.h)
+astscf_component_add_files(SIPSessionGateway SIPSessionGatewayEndpointLocator.cpp)
+astscf_component_add_files(SIPSessionGateway SIPSessionGatewayEndpointLocator.h)
+astscf_component_add_files(SIPSessionGateway SIPEndpointFactory.cpp)
+astscf_component_add_files(SIPSessionGateway SIPEndpointFactory.h)
+astscf_component_add_files(SIPSessionGateway SIPEndpoint.cpp)
+astscf_component_add_files(SIPSessionGateway SIPEndpoint.h)
+astscf_component_add_files(SIPSessionGateway SIPSession.cpp)
+astscf_component_add_files(SIPSessionGateway SIPSession.h)
+astscf_component_add_files(SIPSessionGateway SIPTelephonyEventSource.cpp)
+astscf_component_add_files(SIPSessionGateway SIPTelephonyEventSource.h)
+astscf_component_add_files(SIPSessionGateway SIPTelephonyEventSink.cpp)
+astscf_component_add_files(SIPSessionGateway SIPTelephonyEventSink.h)
+astscf_component_add_files(SIPSessionGateway PJSIPManager.cpp)
+astscf_component_add_files(SIPSessionGateway PJSIPManager.h)
+astscf_component_add_files(SIPSessionGateway PJSIPModule.cpp)
+astscf_component_add_files(SIPSessionGateway PJSIPModule.h)
+astscf_component_add_files(SIPSessionGateway SIPTransfer.cpp)
+astscf_component_add_files(SIPSessionGateway SIPTransfer.h)
+astscf_component_add_files(SIPSessionGateway PJSIPSessionModule.cpp)
+astscf_component_add_files(SIPSessionGateway PJSIPSessionModuleConstruction.cpp)
+astscf_component_add_files(SIPSessionGateway PJSIPSessionModule.h)
+astscf_component_add_files(SIPSessionGateway PJSIPLoggingModule.cpp)
+astscf_component_add_files(SIPSessionGateway PJSIPLoggingModuleConstruction.cpp)
+astscf_component_add_files(SIPSessionGateway PJSIPLoggingModule.h)
+astscf_component_add_files(SIPSessionGateway PJSIPRegistrarModule.cpp)
+astscf_component_add_files(SIPSessionGateway PJSIPRegistrarModuleConstruction.cpp)
+astscf_component_add_files(SIPSessionGateway PJSIPRegistrarModule.h)
+astscf_component_add_files(SIPSessionGateway SIPClientRegistration.cpp)
+astscf_component_add_files(SIPSessionGateway SIPClientRegistration.h)
+astscf_component_add_files(SIPSessionGateway AuthManager.cpp)
+astscf_component_add_files(SIPSessionGateway AuthManager.h)
+astscf_component_add_files(SIPSessionGateway SIPConfiguration.cpp)
+astscf_component_add_files(SIPSessionGateway SIPConfiguration.h)
+astscf_component_add_files(SIPSessionGateway SIPStateReplicatorListener.cpp)
+astscf_component_add_files(SIPSessionGateway SIPStateReplicator.h)
+astscf_component_add_files(SIPSessionGateway Transports.cpp)
+astscf_component_add_files(SIPSessionGateway Transports.h)
+astscf_component_add_files(SIPSessionGateway UDPTransport.cpp)
+astscf_component_add_files(SIPSessionGateway UDPTransport.h)
+astscf_component_add_files(SIPSessionGateway TCPTransport.cpp)
+astscf_component_add_files(SIPSessionGateway TCPTransport.h)
+astscf_component_add_files(SIPSessionGateway TLSTransport.cpp)
+astscf_component_add_files(SIPSessionGateway TLSTransport.h)
+astscf_component_add_files(SIPSessionGateway PJUtil.h)
+astscf_component_add_files(SIPSessionGateway DebugUtil.h)
+astscf_component_add_files(SIPSessionGateway SIPModule.h)
+astscf_component_add_files(SIPSessionGateway STUNModule.cpp)
+astscf_component_add_files(SIPSessionGateway STUNModule.h)
+astscf_component_add_files(SIPSessionGateway STUNTransport.cpp)
+astscf_component_add_files(SIPSessionGateway STUNTransport.h)
+astscf_component_add_files(SIPSessionGateway STUNTransportConfig.cpp)
+astscf_component_add_files(SIPSessionGateway STUNTransportConfig.h)
+astscf_component_add_files(SIPSessionGateway NATOptions.h)
+astscf_component_add_files(SIPSessionGateway SIPRegistrarListener.cpp)
+astscf_component_add_files(SIPSessionGateway SIPRegistrarListener.h)
+astscf_component_add_slices(SIPSessionGateway PROJECT SIPIf.ice)
+astscf_component_add_slices(SIPSessionGateway PROJECT AsteriskSCF/Replication/SIPSessionGateway/SIPStateReplicationIf.ice)
+astscf_component_add_slices(SIPSessionGateway PROJECT AsteriskSCF/Configuration/SIPSessionGateway/SIPConfigurationIf.ice)
+astscf_component_add_slices(SIPSessionGateway PROJECT AsteriskSCF/SessionCookies/SIPSessionGateway/SIPSessionCookiesIf.ice)
+astscf_component_add_ice_libraries(SIPSessionGateway IceStorm)
+astscf_component_add_boost_libraries(SIPSessionGateway core)
+astscf_component_add_slice_collection_libraries(SIPSessionGateway ASTSCF)
+astscf_component_build_icebox(SIPSessionGateway)
+target_link_libraries(SIPSessionGateway LoggingClient ASTSCFIceUtilCpp ASTSCFIceUtilCppPJLIB ${OPENSSL_LIBRARIES})
 
-pjproject_link(SIPSessionManager pjsip)
-pjproject_link(SIPSessionManager pjmedia)
-pjproject_link(SIPSessionManager pjnath)
-pjproject_link(SIPSessionManager pjlib-util)
-pjproject_link(SIPSessionManager pjlib)
-astscf_component_install(SIPSessionManager)
+pjproject_link(SIPSessionGateway pjsip)
+pjproject_link(SIPSessionGateway pjmedia)
+pjproject_link(SIPSessionGateway pjnath)
+pjproject_link(SIPSessionGateway pjlib-util)
+pjproject_link(SIPSessionGateway pjlib)
+astscf_component_install(SIPSessionGateway)
 
 astscf_component_init(SIPStateReplicator)
 astscf_component_add_files(SIPStateReplicator ComponentStateReplicator.cpp)
 astscf_component_add_files(SIPStateReplicator SIPStateReplicator.h)
 astscf_component_add_slices(SIPStateReplicator PROJECT SIPIf.ice)
-astscf_component_add_slices(SIPStateReplicator PROJECT AsteriskSCF/Replication/SIPSessionManager/SIPStateReplicationIf.ice)
-astscf_component_add_slices(SIPStateReplicator PROJECT AsteriskSCF/Configuration/SIPSessionManager/SIPConfigurationIf.ice)
+astscf_component_add_slices(SIPStateReplicator PROJECT AsteriskSCF/Replication/SIPSessionGateway/SIPStateReplicationIf.ice)
+astscf_component_add_slices(SIPStateReplicator PROJECT AsteriskSCF/Configuration/SIPSessionGateway/SIPConfigurationIf.ice)
 astscf_component_add_ice_libraries(SIPStateReplicator IceStorm)
 astscf_component_add_boost_libraries(SIPStateReplicator thread date_time)
 astscf_component_add_slice_collection_libraries(SIPStateReplicator ASTSCF)
diff --git a/src/Component.cpp b/src/Component.cpp
index e353b2f..707cb76 100644
--- a/src/Component.cpp
+++ b/src/Component.cpp
@@ -36,8 +36,8 @@
 #include <AsteriskSCF/PJLIB/ThreadHook.h>
 #include <AsteriskSCF/Replication/ReplicationContext.h>
 
-#include "SIPSessionManagerEventPublisher.h"
-#include "SIPSessionManagerEndpointLocator.h"
+#include "SIPSessionGatewayEventPublisher.h"
+#include "SIPSessionGatewayEndpointLocator.h"
 #include "SIPEndpointFactory.h"
 #include "PJSIPSessionModule.h"
 #include "PJSIPManager.h"
@@ -48,8 +48,8 @@
 #include "SIPReplicationContext.h"
 
 using namespace std;
-using namespace AsteriskSCF::SIPSessionManager;
-using namespace AsteriskSCF::Configuration::SIPSessionManager::V1;
+using namespace AsteriskSCF::SIPSessionGateway;
+using namespace AsteriskSCF::Configuration::SIPSessionGateway::V1;
 using namespace AsteriskSCF::Core;
 using namespace AsteriskSCF::Core::Routing::V1;
 using namespace AsteriskSCF::Core::Discovery::V1;
@@ -72,7 +72,7 @@ Logger lg = getLoggerFactory().getLogger("AsteriskSCF.SIPSessionGateway");
 
 namespace AsteriskSCF
 {
-namespace SIPSessionManager
+namespace SIPSessionGateway
 {
 
 class SIPAuthExtensionPoint : public AuthExtensionPoint
@@ -175,7 +175,7 @@ private:
     SIPStateReplicatorListenerPrx mReplicatorListenerProxy;
 
     // Implementation support classes
-    boost::shared_ptr<SIPSessionManagerEventPublisher> mEventPublisher;
+    boost::shared_ptr<SIPSessionGatewayEventPublisher> mEventPublisher;
     Routing::V1::EndpointLocatorPtr mEndpointLocator;
     boost::shared_ptr<SIPEndpointFactory> mEndpointFactory;
     PJSIPManagerPtr mPJSIPManager;
@@ -537,7 +537,7 @@ void Component::createPrimaryServices()
         SIPReplicationContextPtr sipReplicationContext =
             boost::static_pointer_cast<SIPReplicationContext>(getReplicationContext());
 
-        mEventPublisher.reset(new SIPSessionManagerEventPublisher(getServiceAdapter()));
+        mEventPublisher.reset(new SIPSessionGatewayEventPublisher(getServiceAdapter()));
         lg(Debug) << "Created SIP Session Manager event publisher";
 
         mEndpointFactory.reset(new SIPEndpointFactory(
@@ -555,7 +555,7 @@ void Component::createPrimaryServices()
         locateRoutingService();
 
         // Create and configure our Endpoint Locator.
-        mEndpointLocator = new SIPSessionManagerEndpointLocator(mEndpointFactory);
+        mEndpointLocator = new SIPSessionGatewayEndpointLocator(mEndpointFactory);
         getServiceAdapter()->add(mEndpointLocator, getCommunicator()->stringToIdentity(EndpointLocatorObjectId));
         lg(Debug) << "Got proxy to endpoint locator";
 
@@ -646,9 +646,9 @@ extern "C"
 {
 ASTSCF_DLL_EXPORT IceBox::Service* create(Ice::CommunicatorPtr)
 {
-    return new AsteriskSCF::SIPSessionManager::Component;
+    return new AsteriskSCF::SIPSessionGateway::Component;
 }
 }
 
-}; // end SIPSessionManager
+}; // end SIPSessionGateway
 }; // end AsteriskSCF
diff --git a/src/ComponentStateReplicator.cpp b/src/ComponentStateReplicator.cpp
index d2f6383..b8b1be9 100644
--- a/src/ComponentStateReplicator.cpp
+++ b/src/ComponentStateReplicator.cpp
@@ -27,16 +27,16 @@
 using namespace std;
 using namespace AsteriskSCF::Core;
 using namespace AsteriskSCF::Core::Discovery::V1;
-using namespace AsteriskSCF::Replication::SIPSessionManager::V1;
+using namespace AsteriskSCF::Replication::SIPSessionGateway::V1;
 using namespace AsteriskSCF::System::Component::V1;
 using namespace AsteriskSCF::System::Logging;
-using namespace AsteriskSCF::SIPSessionManager;
+using namespace AsteriskSCF::SIPSessionGateway;
 
 using namespace AsteriskSCF::Discovery;
 
 namespace
 {
-Logger lg = getLoggerFactory().getLogger("AsteriskSCF.SIPSessionManagerReplicator");
+Logger lg = getLoggerFactory().getLogger("AsteriskSCF.SIPSessionGatewayReplicator");
 }
 
 class ComponentStateReplicator : public AsteriskSCF::Component::ComponentStateReplicator
@@ -44,9 +44,9 @@ class ComponentStateReplicator : public AsteriskSCF::Component::ComponentStateRe
 public:
     ComponentStateReplicator() :
       AsteriskSCF::Component::ComponentStateReplicator(lg, 
-          AsteriskSCF::Replication::SIPSessionManager::V1::StateReplicatorComponentCategory, 
+          AsteriskSCF::Replication::SIPSessionGateway::V1::StateReplicatorComponentCategory, 
           true,                               // if true, supports configuration
-          AsteriskSCF::Configuration::SIPSessionManager::V1::ConfigurationDiscoveryCategory) 
+          AsteriskSCF::Configuration::SIPSessionGateway::V1::ConfigurationDiscoveryCategory) 
     {
     }
 
@@ -78,7 +78,7 @@ void ComponentStateReplicator::preparePrimaryServicesForDiscovery()
     {
         // Wrap our authentication extensions point for the Service Locator.
         mStateReplicatorRegistration = wrapServiceForRegistration(mStateReplicatorPrx,
-                                                                  AsteriskSCF::Replication::SIPSessionManager::V1::StateReplicatorDiscoveryCategory);
+                                                                  AsteriskSCF::Replication::SIPSessionGateway::V1::StateReplicatorDiscoveryCategory);
         managePrimaryService(mStateReplicatorRegistration);
     }
     catch(const std::exception& e)
diff --git a/src/NATOptions.h b/src/NATOptions.h
index 58f6e6a..a00ba4a 100644
--- a/src/NATOptions.h
+++ b/src/NATOptions.h
@@ -20,7 +20,7 @@
 
 namespace AsteriskSCF
 {
-namespace SIPSessionManager
+namespace SIPSessionGateway
 {
 struct NATEndpointOptions 
 {
@@ -35,5 +35,5 @@ struct NATEndpointOptions
     {
     }
 };
-} /* End of namespace SIPSessionManager */
+} /* End of namespace SIPSessionGateway */
 } /* End of namespace AsteriskSCF */
diff --git a/src/PJSIPLoggingModule.cpp b/src/PJSIPLoggingModule.cpp
index 1397204..5d11c4d 100644
--- a/src/PJSIPLoggingModule.cpp
+++ b/src/PJSIPLoggingModule.cpp
@@ -29,7 +29,7 @@ Logger lg = getLoggerFactory().getLogger("AsteriskSCF.SIPSessionGateway");
 namespace AsteriskSCF
 {
 
-namespace SIPSessionManager
+namespace SIPSessionGateway
 {
 
 pj_status_t PJSIPLoggingModule::load(pjsip_endpoint*)
diff --git a/src/PJSIPLoggingModule.h b/src/PJSIPLoggingModule.h
index e0d49fa..3d5efd0 100644
--- a/src/PJSIPLoggingModule.h
+++ b/src/PJSIPLoggingModule.h
@@ -21,7 +21,7 @@
 namespace AsteriskSCF
 {
 
-namespace SIPSessionManager
+namespace SIPSessionGateway
 {
 
 class PJSIPLoggingModule : public PJSIPModule
diff --git a/src/PJSIPLoggingModuleConstruction.cpp b/src/PJSIPLoggingModuleConstruction.cpp
index f5d809a..04365da 100644
--- a/src/PJSIPLoggingModuleConstruction.cpp
+++ b/src/PJSIPLoggingModuleConstruction.cpp
@@ -19,7 +19,7 @@
 namespace AsteriskSCF
 {
 
-namespace SIPSessionManager
+namespace SIPSessionGateway
 {
 
 static PJSIPLoggingModule *loggingModule;
diff --git a/src/PJSIPManager.cpp b/src/PJSIPManager.cpp
index 11a917a..10fa36b 100644
--- a/src/PJSIPManager.cpp
+++ b/src/PJSIPManager.cpp
@@ -47,7 +47,7 @@ const std::string RegistrarId("SIPRegistrar");
 namespace AsteriskSCF
 {
 
-namespace SIPSessionManager
+namespace SIPSessionGateway
 {
 
 using namespace AsteriskSCF::SIP::Registration::V1;
@@ -99,7 +99,7 @@ static void *monitorThread(void *endpt)
     return NULL;
 }
 
-PJSIPManagerPtr AsteriskSCF::SIPSessionManager::PJSIPManager::create(const std::string& managerName,
+PJSIPManagerPtr AsteriskSCF::SIPSessionGateway::PJSIPManager::create(const std::string& managerName,
         const Ice::PropertiesPtr& properties)
 {
     PJSIPManagerPtr result(new PJSIPManager);
@@ -302,6 +302,6 @@ PJSIPManager::PJSIPManager() :
     }
 }
 
-}; //End namespace SIPSessionManager
+}; //End namespace SIPSessionGateway
 
 }; //End namespace AsteriskSCF
diff --git a/src/PJSIPManager.h b/src/PJSIPManager.h
index ca10ca6..e5eecef 100644
--- a/src/PJSIPManager.h
+++ b/src/PJSIPManager.h
@@ -39,7 +39,7 @@
 namespace AsteriskSCF
 {
 
-namespace SIPSessionManager
+namespace SIPSessionGateway
 {
 
 class PJSIPManager;
@@ -163,6 +163,6 @@ private:
     PJSIPManager();
 };
 
-}; //End namespace SIPSessionManager
+}; //End namespace SIPSessionGateway
 
 }; //End namespace AsteriskSCF
diff --git a/src/PJSIPModule.cpp b/src/PJSIPModule.cpp
index 37ffe31..915cbf6 100644
--- a/src/PJSIPModule.cpp
+++ b/src/PJSIPModule.cpp
@@ -29,7 +29,7 @@ Logger lg = getLoggerFactory().getLogger("AsteriskSCF.SIPSessionGateway");
 namespace AsteriskSCF
 {
 
-namespace SIPSessionManager
+namespace SIPSessionGateway
 {
 
 //Arbitrarily chosen URI size. Used for times when I need
diff --git a/src/PJSIPModule.h b/src/PJSIPModule.h
index f655efd..aa66136 100644
--- a/src/PJSIPModule.h
+++ b/src/PJSIPModule.h
@@ -31,10 +31,10 @@
 namespace AsteriskSCF
 {
 
-namespace SIPSessionManager
+namespace SIPSessionGateway
 {
 
-using namespace AsteriskSCF::Replication::SIPSessionManager::V1;
+using namespace AsteriskSCF::Replication::SIPSessionGateway::V1;
 
 class PJSIPModule : public IceUtil::Shared
 {
@@ -86,5 +86,5 @@ private:
     TransactionState transactionStateTranslate(pjsip_tsx_state_e state);
 };
 
-}; //end namespace SIPSessionManager
+}; //end namespace SIPSessionGateway
 }; //end namespace AsteriskSCF
diff --git a/src/PJSIPRegistrarModule.cpp b/src/PJSIPRegistrarModule.cpp
index d2df307..1821f41 100644
--- a/src/PJSIPRegistrarModule.cpp
+++ b/src/PJSIPRegistrarModule.cpp
@@ -43,7 +43,7 @@ Logger lg = getLoggerFactory().getLogger("AsteriskSCF.SIPSessionGateway");
 namespace AsteriskSCF
 {
 
-namespace SIPSessionManager
+namespace SIPSessionGateway
 {
 
 class RegistrationExpired : public Work, public IceUtil::TimerTask
diff --git a/src/PJSIPRegistrarModule.h b/src/PJSIPRegistrarModule.h
index ea0211b..43dc6a6 100644
--- a/src/PJSIPRegistrarModule.h
+++ b/src/PJSIPRegistrarModule.h
@@ -28,7 +28,7 @@
 namespace AsteriskSCF
 {
 
-namespace SIPSessionManager
+namespace SIPSessionGateway
 {
 
 class BindingWrapper;
diff --git a/src/PJSIPRegistrarModuleConstruction.cpp b/src/PJSIPRegistrarModuleConstruction.cpp
index c3e89b8..012f4e8 100644
--- a/src/PJSIPRegistrarModuleConstruction.cpp
+++ b/src/PJSIPRegistrarModuleConstruction.cpp
@@ -21,7 +21,7 @@ using namespace AsteriskSCF::SIP::Registration::V1;
 namespace AsteriskSCF
 {
 
-namespace SIPSessionManager
+namespace SIPSessionGateway
 {
 
 static char registrarModuleName[] = "PJSIPRegistrarModule";
diff --git a/src/PJSIPSessionModule.cpp b/src/PJSIPSessionModule.cpp
index f8de853..b6a01d2 100644
--- a/src/PJSIPSessionModule.cpp
+++ b/src/PJSIPSessionModule.cpp
@@ -64,7 +64,7 @@ const std::string ConnectedCallbackName("connected");
 namespace AsteriskSCF
 {
 
-namespace SIPSessionManager
+namespace SIPSessionGateway
 {
 
 using namespace AsteriskSCF::Core::Routing::V1;
@@ -74,7 +74,7 @@ using namespace AsteriskSCF::SessionCommunications::ExtensionPoints::V1;
 using namespace AsteriskSCF::Media::V1;
 using namespace AsteriskSCF::Media::RTP::V1;
 using namespace AsteriskSCF::Media::SDP::V1;
-using namespace AsteriskSCF::Replication::SIPSessionManager::V1;
+using namespace AsteriskSCF::Replication::SIPSessionGateway::V1;
 using namespace AsteriskSCF::System::ThreadPool::V1;
 using namespace AsteriskSCF::System::WorkQueue::V1;
 using namespace AsteriskSCF::WorkQueue;
@@ -2456,5 +2456,5 @@ void SessionWork::enqueueWork(const SuspendableWorkPtr& work)
     }
 }
 
-}; //end namespace SIPSessionManager
+}; //end namespace SIPSessionGateway
 }; //end namespace AsteriskSCF
diff --git a/src/PJSIPSessionModule.h b/src/PJSIPSessionModule.h
index 941704b..91fb6e4 100644
--- a/src/PJSIPSessionModule.h
+++ b/src/PJSIPSessionModule.h
@@ -37,7 +37,7 @@
 namespace AsteriskSCF
 {
 
-namespace SIPSessionManager
+namespace SIPSessionGateway
 {
 
 class PJSIPSessionModInfo
@@ -409,5 +409,5 @@ private:
 
 typedef IceUtil::Handle<SIPAMICallbackCookie> SIPAMICallbackCookiePtr;
 
-}; //end namespace SIPSessionManager
+}; //end namespace SIPSessionGateway
 }; //end namespace AsteriskSCF
... 8852 lines suppressed ...


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list