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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Sun Jun 26 23:14:47 CDT 2011


branch "registrar" has been updated
       via  768256f0d324d42905eb9f3832c054193cd750b2 (commit)
       via  162d8a50bf6df93a6bc24d06e9042b5026c088ee (commit)
       via  41e944174785ff3370b4e165d491e8ff92cc0827 (commit)
       via  f860396ac01e1581dfe5f56ca30434c8b01b4270 (commit)
       via  be2641c8edb8a41556c4a0d9c2d86fb023917792 (commit)
       via  1ea02fa8ec59f386d62f04a0ef3c1adb77fd5319 (commit)
       via  3fa68dd21a3f9a62ca80400e48832d0e6225a2ea (commit)
       via  c977ec5bbe15874cd222c0b181c8c75419975224 (commit)
       via  4f75a2866c33895ced0757ea9f12e31fc40ba093 (commit)
       via  fc2f64b78c4c57c4c3b8fea3233a9fd3f52147f6 (commit)
       via  1de67641a3e4c2c0bfcfa244a455543af8797ac0 (commit)
       via  0d651e8263be7bee4cbbf00f8e58f4b09e15f447 (commit)
       via  a6453ee3997ea4797c32ebd103a14f60bd6930d5 (commit)
       via  85f9eed8c9e2add8d2cb62a7a5b84f5ec9e67bd5 (commit)
       via  4cc73e761cbe287f3d79572a07054d22316e665a (commit)
       via  7e5c7f003fefb179ba7d4861a6bbea00b74ff064 (commit)
       via  575abed0a58ba2e9f321b8ccc121a32356c7288d (commit)
       via  b0d2423c8b01c4432c7289f9648213e16406174a (commit)
       via  b49bbffd540cb56846df38c934fb05b14fbb61dd (commit)
       via  14ca1270f07e4bd0ce0debd064cd5a4c9c8a0372 (commit)
       via  8e234734142c206ccdf66647e05567b10d5cfd72 (commit)
       via  a04d0359ca706f2a8ce2a3b21464c9ba6e062785 (commit)
       via  289eae68054b0f290bdab7f0e14660493548dadf (commit)
       via  3246440509df7b0d357d507039ab408e03a7a355 (commit)
       via  c486b08a719eca0b3bb87bb5faa81602e4c65ab6 (commit)
       via  5f4c5725e89df126109a572417fd3f6ac36b3d8b (commit)
       via  384cb9af005a7ca75d7599aa2f356e9904024a90 (commit)
       via  09511d65f232bb4d04758c6e124a8649f20ad19b (commit)
       via  397eed56f8c9621c4e6a3fc9910405d5acca69af (commit)
       via  e8b826ae01d1de3261627a3f75ab1bca6b337ce4 (commit)
       via  c75f3b9b6d21058d881faf51736b4221522cc7d3 (commit)
       via  d9ad2557af844f4241a8e9c42cdf7da57d63ac98 (commit)
      from  1dda9776c5a1f55037ac61f5290593e25a5677cb (commit)

Summary of changes:
 .gitmodules                                        |    9 -
 CMakeLists.txt                                     |    7 +-
 cmake                                              |    1 -
 config/SipConfigurator.py                          |   62 ++--
 logger                                             |    1 -
 slice                                              |    1 -
 .../SipSessionManager}/SipConfigurationIf.ice      |   13 +-
 .../SipSessionManager}/SipStateReplicationIf.ice   |   18 +-
 {local-slice => slice}/SipIf.ice                   |    0
 src/CMakeLists.txt                                 |  110 +++---
 src/PJSipManager.cpp                               |    4 +-
 src/PJSipManager.h                                 |    4 +-
 src/PJSipModule.h                                  |    2 +-
 src/PJSipRegistrarModule.cpp                       |  366 +++++++++++++++-----
 src/PJSipRegistrarModule.h                         |   45 ++-
 src/PJSipRegistrarModuleConstruction.cpp           |    3 +-
 src/PJSipSessionModule.cpp                         |   69 +++-
 src/PJSipSessionModule.h                           |    5 +-
 src/PJSipSessionModuleConstruction.cpp             |   23 ++-
 src/SipConfiguration.cpp                           |   64 ++--
 src/SipEndpoint.cpp                                |   88 -----
 src/SipEndpoint.h                                  |   18 -
 src/SipEndpointFactory.cpp                         |   13 -
 src/SipEndpointFactory.h                           |    2 -
 src/SipSession.cpp                                 |  180 ++++++++++-
 src/SipSession.h                                   |   15 +-
 src/SipSessionManagerApp.cpp                       |   23 +-
 src/SipStateReplicator.h                           |   12 +-
 src/SipStateReplicatorApp.cpp                      |   13 +-
 src/SipStateReplicatorListener.cpp                 |   11 +-
 30 files changed, 751 insertions(+), 431 deletions(-)
 delete mode 100644 .gitmodules
 delete mode 160000 cmake
 delete mode 160000 logger
 delete mode 160000 slice
 rename {local-slice => slice/AsteriskSCF/Configuration/SipSessionManager}/SipConfigurationIf.ice (98%)
 rename {local-slice => slice/AsteriskSCF/Replication/SipSessionManager}/SipStateReplicationIf.ice (95%)
 rename {local-slice => slice}/SipIf.ice (100%)


- Log -----------------------------------------------------------------
commit 768256f0d324d42905eb9f3832c054193cd750b2
Author: Mark Michelson <mmichelson at digium.com>
Date:   Sun Jun 26 23:14:25 2011 -0500

    Use a work queue for registrar methods.

diff --git a/src/PJSipRegistrarModule.cpp b/src/PJSipRegistrarModule.cpp
index 5363154..0425179 100644
--- a/src/PJSipRegistrarModule.cpp
+++ b/src/PJSipRegistrarModule.cpp
@@ -161,6 +161,33 @@ RegistrarI::~RegistrarI()
     }
 }
 
+class AddListener : public Work
+{
+public:
+    AddListener(
+            const AMD_Registrar_addListenerPtr& cb,
+            const RegistrarListenerPrx& listener,
+            const RegistrarIPtr& registrar)
+        : mCB(cb), mListener(listener), mRegistrar(registrar) { }
+    
+    void execute()
+    {
+        std::vector<AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx>& listeners(mRegistrar->getListeners());
+
+        if (std::find(listeners.begin(), listeners.end(), mListener) == listeners.end())
+        {
+            lg(Debug) << "Adding Listener " << mListener->ice_getIdentity().name << " to registrar";
+            listeners.push_back(mListener);
+        }
+        //We should maybe throw an exception if someone tries to insert a duplicate?
+        //XXX Need to update this to actually return something.
+        mCB->ice_response(ContactDict());
+    }
+private:
+    AMD_Registrar_addListenerPtr mCB;
+    RegistrarListenerPrx mListener;
+    RegistrarIPtr mRegistrar;
+};
 
 //XXX Queueable operation
 void RegistrarI::addListener_async(
@@ -168,16 +195,32 @@ void RegistrarI::addListener_async(
         const RegistrarListenerPrx& listener,
         const Ice::Current&)
 {
-    if (std::find(mListeners.begin(), mListeners.end(), listener) == mListeners.end())
+    mQueue->enqueueWork(new AddListener(cb, listener, this));
+}
+
+class RemoveListener : public Work
+{
+public:
+    RemoveListener(
+            const AMD_Registrar_removeListenerPtr& cb,
+            const RegistrarListenerPrx& listener,
+            const RegistrarIPtr& registrar)
+        : mCB(cb), mListener(listener), mRegistrar(registrar) { }
+
+    void execute()
     {
-        lg(Debug) << "Adding Listener " << listener->ice_getIdentity().name << " to registrar";
-        mListeners.push_back(listener);
+        std::vector<AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx>& listeners(mRegistrar->getListeners());
+
+        listeners.erase(std::remove(listeners.begin(), listeners.end(), mListener));
+        mCB->ice_response();
     }
-    //We should maybe throw an exception if someone tries to insert a duplicate?
-    //XXX Are we ever even populating mContacts??
-    cb->ice_response(mContacts);
-    return;
-}
+
+private:
+    AMD_Registrar_removeListenerPtr mCB;
+    RegistrarListenerPrx mListener;
+    RegistrarIPtr mRegistrar;
+
+};
 
 //XXX Queueable operation
 void RegistrarI::removeListener_async(
@@ -185,54 +228,93 @@ void RegistrarI::removeListener_async(
         const RegistrarListenerPrx& listener,
         const Ice::Current&)
 {
-    mListeners.erase(std::remove(mListeners.begin(), mListeners.end(), listener));
-    cb->ice_response();
+    mQueue->enqueueWork(new RemoveListener(cb, listener, this));
 }
 
+class GetAllBindings : public Work
+{
+public:
+    GetAllBindings(
+            const AMD_Registrar_getAllBindingsPtr& cb,
+            const RegistrarIPtr& registrar)
+        : mCB(cb), mRegistrar(registrar) { }
+
+    void execute()
+    {
+        BindingDict returnedBindings;
+        //XXX
+        //This is suboptimal. What may work better is to maintain 
+        //parallel maps of BindingWrappers and Bindings so that
+        //we can quickly return the appropriate information instead of
+        //having to construct a BindingDict on each call.
+
+        BindingWrapperDict& regBindings = mRegistrar->getBindings();
+        for (BindingWrapperDict::iterator iter = regBindings.begin();
+                iter != regBindings.end(); ++iter)
+        {
+            BindingSeq bindings;
+            for (BindingWrapperSeq::iterator seqIter = iter->second.begin();
+                    seqIter != iter->second.end(); ++seqIter)
+            {
+                bindings.push_back((*seqIter)->mBinding);
+            }
+            returnedBindings.insert(make_pair(iter->first, bindings));
+        }
+        mCB->ice_response(returnedBindings);
+    }
+private:
+    AMD_Registrar_getAllBindingsPtr mCB;
+    RegistrarIPtr mRegistrar;
+};
+
 //XXX Queueable operation
 void RegistrarI::getAllBindings_async(
         const AMD_Registrar_getAllBindingsPtr& cb,
         const Ice::Current&)
 {
-    BindingDict returnedBindings;
-    //XXX
-    //This is suboptimal. What may work better is to maintain 
-    //parallel maps of BindingWrappers and Bindings so that
-    //we can quickly return the appropriate information instead of
-    //having to construct a BindingDict on each call.
-    for (BindingWrapperDict::iterator iter = mBindings.begin();
-            iter != mBindings.end(); ++iter)
+    mQueue->enqueueWork(new GetAllBindings(cb, this));
+}
+
+class GetAORBindings : public Work
+{
+public:
+    GetAORBindings(
+            const AMD_Registrar_getAORBindingsPtr& cb,
+            const std::string &aor,
+            const RegistrarIPtr& registrar)
+        : mCB(cb), mAOR(aor), mRegistrar(registrar) { }
+
+    void execute()
     {
-        BindingSeq bindings;
-        for (BindingWrapperSeq::iterator seqIter = iter->second.begin();
-                seqIter != iter->second.end(); ++seqIter)
+        BindingWrapperDict& regBindings = mRegistrar->getBindings();
+        BindingWrapperDict::iterator iter = regBindings.find(mAOR);
+        if (iter != regBindings.end())
         {
-            bindings.push_back((*seqIter)->mBinding);
+            BindingSeq bindings;
+            for (BindingWrapperSeq::iterator seqIter = iter->second.begin();
+                    seqIter != iter->second.end(); ++seqIter)
+            {
+                bindings.push_back((*seqIter)->mBinding);
+            }
+            mCB->ice_response(bindings);
+            return;
         }
-        returnedBindings.insert(make_pair(iter->first, bindings));
+        mCB->ice_response(BindingSeq());
     }
-    cb->ice_response(returnedBindings);
-}
+
+private:
+    AMD_Registrar_getAORBindingsPtr mCB;
+    const std::string mAOR;
+    RegistrarIPtr mRegistrar;
+};
 
 //XXX Queueable Operation
 void RegistrarI::getAORBindings_async(
         const AMD_Registrar_getAORBindingsPtr& cb,
-        const std::string &aor,
+        const std::string& aor,
         const Ice::Current&)
 {
-    BindingWrapperDict::iterator iter = mBindings.find(aor);
-    if (iter != mBindings.end())
-    {
-        BindingSeq bindings;
-        for (BindingWrapperSeq::iterator seqIter = iter->second.begin();
-                seqIter != iter->second.end(); ++seqIter)
-        {
-            bindings.push_back((*seqIter)->mBinding);
-        }
-        cb->ice_response(bindings);
-        return;
-    }
-    cb->ice_response(BindingSeq());
+    mQueue->enqueueWork(new GetAORBindings(cb, aor, this));
 }
 
 static BindingWrapperSeq Empty;

commit 162d8a50bf6df93a6bc24d06e9042b5026c088ee
Author: Mark Michelson <mmichelson at digium.com>
Date:   Sun Jun 26 22:38:51 2011 -0500

    Use AMD for Registrar operations.
    
    I'm not actually using the work queue yet. That's next.

diff --git a/src/PJSipRegistrarModule.cpp b/src/PJSipRegistrarModule.cpp
index 243c1e0..5363154 100644
--- a/src/PJSipRegistrarModule.cpp
+++ b/src/PJSipRegistrarModule.cpp
@@ -163,7 +163,10 @@ RegistrarI::~RegistrarI()
 
 
 //XXX Queueable operation
-ContactDict RegistrarI::addListener(const RegistrarListenerPrx& listener, const Ice::Current&)
+void RegistrarI::addListener_async(
+        const AMD_Registrar_addListenerPtr& cb,
+        const RegistrarListenerPrx& listener,
+        const Ice::Current&)
 {
     if (std::find(mListeners.begin(), mListeners.end(), listener) == mListeners.end())
     {
@@ -171,17 +174,25 @@ ContactDict RegistrarI::addListener(const RegistrarListenerPrx& listener, const
         mListeners.push_back(listener);
     }
     //We should maybe throw an exception if someone tries to insert a duplicate?
-    return mContacts;
+    //XXX Are we ever even populating mContacts??
+    cb->ice_response(mContacts);
+    return;
 }
 
 //XXX Queueable operation
-void RegistrarI::removeListener(const RegistrarListenerPrx& listener, const Ice::Current&)
+void RegistrarI::removeListener_async(
+        const AMD_Registrar_removeListenerPtr& cb,
+        const RegistrarListenerPrx& listener,
+        const Ice::Current&)
 {
     mListeners.erase(std::remove(mListeners.begin(), mListeners.end(), listener));
+    cb->ice_response();
 }
 
 //XXX Queueable operation
-BindingDict RegistrarI::getAllBindings(const Ice::Current&)
+void RegistrarI::getAllBindings_async(
+        const AMD_Registrar_getAllBindingsPtr& cb,
+        const Ice::Current&)
 {
     BindingDict returnedBindings;
     //XXX
@@ -200,11 +211,14 @@ BindingDict RegistrarI::getAllBindings(const Ice::Current&)
         }
         returnedBindings.insert(make_pair(iter->first, bindings));
     }
-    return returnedBindings;
+    cb->ice_response(returnedBindings);
 }
 
 //XXX Queueable Operation
-BindingSeq RegistrarI::getAORBindings(const std::string &aor, const Ice::Current&)
+void RegistrarI::getAORBindings_async(
+        const AMD_Registrar_getAORBindingsPtr& cb,
+        const std::string &aor,
+        const Ice::Current&)
 {
     BindingWrapperDict::iterator iter = mBindings.find(aor);
     if (iter != mBindings.end())
@@ -215,9 +229,10 @@ BindingSeq RegistrarI::getAORBindings(const std::string &aor, const Ice::Current
         {
             bindings.push_back((*seqIter)->mBinding);
         }
-        return bindings;
+        cb->ice_response(bindings);
+        return;
     }
-    return BindingSeq();
+    cb->ice_response(BindingSeq());
 }
 
 static BindingWrapperSeq Empty;
diff --git a/src/PJSipRegistrarModule.h b/src/PJSipRegistrarModule.h
index 28ac125..76b422a 100644
--- a/src/PJSipRegistrarModule.h
+++ b/src/PJSipRegistrarModule.h
@@ -39,10 +39,25 @@ class RegistrarI : public AsteriskSCF::SIP::Registration::V1::Registrar
 public:
     RegistrarI(const AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx& defaultListener);
     ~RegistrarI();
-    AsteriskSCF::SIP::Registration::V1::ContactDict addListener(const AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx& listener, const Ice::Current&);
-    void removeListener(const AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx& listener, const Ice::Current&);
-    AsteriskSCF::SIP::Registration::V1::BindingDict getAllBindings(const Ice::Current&);
-    AsteriskSCF::SIP::Registration::V1::BindingSeq getAORBindings(const std::string &aor, const Ice::Current&);
+
+    void addListener_async(
+            const AsteriskSCF::SIP::Registration::V1::AMD_Registrar_addListenerPtr& cb,
+            const AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx& listener,
+            const Ice::Current&);
+
+    void removeListener_async(
+            const AsteriskSCF::SIP::Registration::V1::AMD_Registrar_removeListenerPtr& cb,
+            const AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx& listener,
+            const Ice::Current&);
+
+    void getAllBindings_async(
+            const AsteriskSCF::SIP::Registration::V1::AMD_Registrar_getAllBindingsPtr& cb,
+            const Ice::Current&);
+
+    void getAORBindings_async(
+            const AsteriskSCF::SIP::Registration::V1::AMD_Registrar_getAORBindingsPtr& cb,
+            const std::string &aor,
+            const Ice::Current&);
 
     BindingWrapperSeq& getAORBindingWrappers(const std::string &aor);
 

commit 41e944174785ff3370b4e165d491e8ff92cc0827
Author: Mark Michelson <mmichelson at digium.com>
Date:   Sun Jun 26 21:49:05 2011 -0500

    Switch the workQueue to live on the registrar instead of the PJSIP module.

diff --git a/src/PJSipRegistrarModule.cpp b/src/PJSipRegistrarModule.cpp
index 15f7897..243c1e0 100644
--- a/src/PJSipRegistrarModule.cpp
+++ b/src/PJSipRegistrarModule.cpp
@@ -17,6 +17,8 @@
 #include <AsteriskSCF/SIP/SIPRegistrarIf.h>
 #include <AsteriskSCF/logger.h>
 #include <AsteriskSCF/System/WorkQueue/WorkQueueIf.h>
+#include <AsteriskSCF/WorkQueue/WorkQueue.h>
+#include <AsteriskSCF/WorkQueue/DefaultQueueListener.h>
 
 #include "PJSipRegistrarModule.h"
 
@@ -66,7 +68,7 @@ static void registrationExpired(pj_timer_heap_t *, struct pj_timer_entry *entry)
     BindingWrapper *wrapper = static_cast<BindingWrapper *>(entry->user_data);
     //Create a BindingWrapperPtr so that when we remove the wrapper from the
     //registrar, it doesn't get deleted.
-    wrapper->mRegModule->getQueue()->enqueueWork(new RegistrationExpired(wrapper));
+    wrapper->mRegModule->getRegistrar()->getQueue()->enqueueWork(new RegistrationExpired(wrapper));
 }
 
 static int expirationId;
@@ -142,9 +144,24 @@ void BindingWrapper::updateBinding(const std::string& callID, int cSeq, int expi
 RegistrarI::RegistrarI(const RegistrarListenerPrx& defaultListener)
 {
     lg(Debug) << "In RegistrarI constructor, should be adding a listener...";
+    mQueue = new AsteriskSCF::WorkQueue::WorkQueue();
+    AsteriskSCF::WorkQueue::DefaultQueueListenerPtr listener(new AsteriskSCF::WorkQueue::DefaultQueueListener(mQueue));
+    mQueue->setListener(listener);
     mListeners.push_back(defaultListener);
 }
 
+RegistrarI::~RegistrarI()
+{
+    try
+    {
+        mQueue->shutdown();
+    }
+    catch (const AsteriskSCF::System::WorkQueue::V1::ShuttingDown&)
+    {
+    }
+}
+
+
 //XXX Queueable operation
 ContactDict RegistrarI::addListener(const RegistrarListenerPrx& listener, const Ice::Current&)
 {
@@ -252,7 +269,7 @@ std::vector<AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx>& Registrar
     return mListeners;
 }
 
-QueuePtr PJSipRegistrarModule::getQueue()
+QueuePtr RegistrarI::getQueue()
 {
     return mQueue;
 }
@@ -606,7 +623,7 @@ pj_bool_t PJSipRegistrarModule::on_rx_request(pjsip_rx_data *rdata)
             }
             else
             {
-                (*bindingToUpdate)->updateBinding(callID, cSeq, expiration, mQueue);
+                (*bindingToUpdate)->updateBinding(callID, cSeq, expiration, mRegistrar->getQueue());
                 lg(Debug) << "Maintaining " << (*bindingToUpdate)->mBinding->contact << " in our existing bindings";
                 existingBindings.push_back(*bindingToUpdate);
             }
@@ -619,7 +636,7 @@ pj_bool_t PJSipRegistrarModule::on_rx_request(pjsip_rx_data *rdata)
         }
     }
 
-    mRegistrar->updateBindings(aor, newBindings, removedBindings, mQueue);
+    mRegistrar->updateBindings(aor, newBindings, removedBindings, mRegistrar->getQueue());
 
     pjsip_tx_data *tdata;
     pjsip_endpt_create_response(tsx->endpt, rdata, 200, NULL, &tdata);
diff --git a/src/PJSipRegistrarModule.h b/src/PJSipRegistrarModule.h
index 9637f5c..28ac125 100644
--- a/src/PJSipRegistrarModule.h
+++ b/src/PJSipRegistrarModule.h
@@ -38,6 +38,7 @@ class RegistrarI : public AsteriskSCF::SIP::Registration::V1::Registrar
 {
 public:
     RegistrarI(const AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx& defaultListener);
+    ~RegistrarI();
     AsteriskSCF::SIP::Registration::V1::ContactDict addListener(const AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx& listener, const Ice::Current&);
     void removeListener(const AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx& listener, const Ice::Current&);
     AsteriskSCF::SIP::Registration::V1::BindingDict getAllBindings(const Ice::Current&);
@@ -62,12 +63,16 @@ public:
     AsteriskSCF::SIP::Registration::V1::BindingDict createBindingDict(const std::string& aor, const BindingWrapperSeq& bindings);
 
     std::vector<AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx>& getListeners();
+
     BindingWrapperDict& getBindings();
 
+    AsteriskSCF::System::WorkQueue::V1::QueuePtr getQueue();
+
 private:
     BindingWrapperDict mBindings;
     AsteriskSCF::SIP::Registration::V1::ContactDict mContacts;
     std::vector<AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx> mListeners;
+    AsteriskSCF::System::WorkQueue::V1::QueuePtr mQueue;
 };
 
 typedef IceUtil::Handle<RegistrarI> RegistrarIPtr;
@@ -79,7 +84,6 @@ public:
             pjsip_endpoint *endpt,
             const AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx& defaultListener,
             const AsteriskSCF::Discovery::SmartProxy<AsteriskSCF::Replication::SipSessionManager::V1::SipStateReplicatorPrx>& stateReplicator);
-    ~PJSipRegistrarModule();
     pj_status_t load(pjsip_endpoint *endpoint);
     pj_status_t start();
     pj_status_t stop();
@@ -91,8 +95,6 @@ public:
     void on_tsx_state(pjsip_transaction *tsx, pjsip_event *event);
     RegistrarIPtr getRegistrar();
 
-    AsteriskSCF::System::WorkQueue::V1::QueuePtr getQueue();
-
     /**
      * Replicate state of bindings currently held by this registrar.
      *
@@ -136,7 +138,6 @@ private:
     pjsip_endpoint *mEndpoint;
     RegistrarIPtr mRegistrar;
     AsteriskSCF::Discovery::SmartProxy<AsteriskSCF::Replication::SipSessionManager::V1::SipStateReplicatorPrx> mStateReplicator;
-    AsteriskSCF::System::WorkQueue::V1::QueuePtr mQueue;
 };
 
 typedef IceUtil::Handle<PJSipRegistrarModule> PJSipRegistrarModulePtr;
diff --git a/src/PJSipRegistrarModuleConstruction.cpp b/src/PJSipRegistrarModuleConstruction.cpp
index 660ccd6..45958bc 100644
--- a/src/PJSipRegistrarModuleConstruction.cpp
+++ b/src/PJSipRegistrarModuleConstruction.cpp
@@ -16,11 +16,7 @@
 
 #include "PJSipRegistrarModule.h"
 
-#include <AsteriskSCF/WorkQueue/WorkQueue.h>
-#include <AsteriskSCF/WorkQueue/DefaultQueueListener.h>
-
 using namespace AsteriskSCF::SIP::Registration::V1;
-using namespace AsteriskSCF::WorkQueue;
 
 namespace AsteriskSCF
 {
@@ -101,22 +97,8 @@ PJSipRegistrarModule::PJSipRegistrarModule(
     mModule.on_tx_response = registrarOnTxResponse;
     mModule.on_tsx_state = registrarOnTsxState;
 
-    mQueue = new AsteriskSCF::WorkQueue::WorkQueue();
-    AsteriskSCF::WorkQueue::DefaultQueueListenerPtr listener(new AsteriskSCF::WorkQueue::DefaultQueueListener(mQueue));
-    mQueue->setListener(listener);
     pjsip_endpt_register_module(mEndpoint, &mModule);
 }
 
-PJSipRegistrarModule::~PJSipRegistrarModule()
-{
-    try
-    {
-        mQueue->shutdown();
-    }
-    catch (const AsteriskSCF::System::WorkQueue::V1::ShuttingDown&)
-    {
-    }
-}
-
 };
 };
diff --git a/src/SipStateReplicatorListener.cpp b/src/SipStateReplicatorListener.cpp
index 8a3dd2a..c25b800 100644
--- a/src/SipStateReplicatorListener.cpp
+++ b/src/SipStateReplicatorListener.cpp
@@ -126,7 +126,7 @@ public:
                 //that we've already expired and removed. No biggie. Just
                 //keep going.
             }
-            regModule->getRegistrar()->updateBindings(dictIter->first, emptySeq, toRemove, regModule->getQueue());
+            regModule->getRegistrar()->updateBindings(dictIter->first, emptySeq, toRemove, regModule->getRegistrar()->getQueue());
         }
     }
 
@@ -166,7 +166,7 @@ public:
                 BindingWrapperPtr wrapper = createBindingWrapper(dictIter->first, *seqIter, regModule);
                 wrapperSeq.push_back(wrapper);
             }
-            regModule->getRegistrar()->updateBindings(dictIter->first, wrapperSeq, emptySeq, regModule->getQueue());
+            regModule->getRegistrar()->updateBindings(dictIter->first, wrapperSeq, emptySeq, regModule->getRegistrar()->getQueue());
         }
     }
 
@@ -198,12 +198,12 @@ public:
                 }
                 else
                 {
-                    (*bindingToUpdate)->updateBinding((*seqIter)->callid, (*seqIter)->cseq, (*seqIter)->expiration - time(NULL), regModule->getQueue());
+                    (*bindingToUpdate)->updateBinding((*seqIter)->callid, (*seqIter)->cseq, (*seqIter)->expiration - time(NULL), regModule->getRegistrar()->getQueue());
                 }
             }
             if (!newBindings.empty())
             {
-                regModule->getRegistrar()->updateBindings(dictIter->first, newBindings, emptySeq, regModule->getQueue());
+                regModule->getRegistrar()->updateBindings(dictIter->first, newBindings, emptySeq, regModule->getRegistrar()->getQueue());
             }
         }
     }

commit f860396ac01e1581dfe5f56ca30434c8b01b4270
Author: Mark Michelson <mmichelson at digium.com>
Date:   Sun Jun 26 21:38:30 2011 -0500

    Initial moves toward using a work queue in the registrar.

diff --git a/src/PJSipRegistrarModule.cpp b/src/PJSipRegistrarModule.cpp
index eba02df..15f7897 100644
--- a/src/PJSipRegistrarModule.cpp
+++ b/src/PJSipRegistrarModule.cpp
@@ -16,11 +16,13 @@
 
 #include <AsteriskSCF/SIP/SIPRegistrarIf.h>
 #include <AsteriskSCF/logger.h>
+#include <AsteriskSCF/System/WorkQueue/WorkQueueIf.h>
 
 #include "PJSipRegistrarModule.h"
 
 using namespace AsteriskSCF::SIP::Registration::V1;
 using namespace AsteriskSCF::System::Logging;
+using namespace AsteriskSCF::System::WorkQueue::V1;
 
 namespace
 {
@@ -33,26 +35,38 @@ namespace AsteriskSCF
 namespace SipSessionManager
 {
 
-//XXX QueueableOperation
+class RegistrationExpired : public Work
+{
+public:
+    RegistrationExpired(const BindingWrapperPtr& wrapper)
+        : mWrapper(wrapper) { }
+
+    void execute()
+    {
+        lg(Debug) << "Detected expiration of binding " << mWrapper->mBinding->contact;
+        mWrapper->cancelRegistrationExpiration();
+        RegistrarIPtr registrar = mWrapper->mRegModule->getRegistrar();
+        BindingWrapperSeq& currentBindings = registrar->getAORBindingWrappers(mWrapper->mAOR);
+        registrar->removeBinding(currentBindings, mWrapper);
+        if (currentBindings.empty())
+        {
+            registrar->removeAOR(mWrapper->mAOR);
+        }
+        BindingWrapperSeq emptySeq;
+        BindingWrapperSeq toRemove;
+        toRemove.push_back(mWrapper);
+        mWrapper->mRegModule->replicateState(mWrapper->mAOR, emptySeq, emptySeq, toRemove);
+    }
+private:
+    BindingWrapperPtr mWrapper;
+};
+
 static void registrationExpired(pj_timer_heap_t *, struct pj_timer_entry *entry)
 {
     BindingWrapper *wrapper = static_cast<BindingWrapper *>(entry->user_data);
     //Create a BindingWrapperPtr so that when we remove the wrapper from the
     //registrar, it doesn't get deleted.
-    BindingWrapperPtr wrapperPtr(new BindingWrapper(*wrapper));
-    lg(Debug) << "Detected expiration of binding " << wrapperPtr->mBinding->contact;
-    wrapperPtr->cancelRegistrationExpiration();
-    RegistrarIPtr registrar = wrapperPtr->mRegModule->getRegistrar();
-    BindingWrapperSeq& currentBindings = registrar->getAORBindingWrappers(wrapperPtr->mAOR);
-    registrar->removeBinding(currentBindings, wrapperPtr);
-    if (currentBindings.empty())
-    {
-        registrar->removeAOR(wrapperPtr->mAOR);
-    }
-    BindingWrapperSeq emptySeq;
-    BindingWrapperSeq toRemove;
-    toRemove.push_back(wrapperPtr);
-    wrapperPtr->mRegModule->replicateState(wrapperPtr->mAOR, emptySeq, emptySeq, toRemove);
+    wrapper->mRegModule->getQueue()->enqueueWork(new RegistrationExpired(wrapper));
 }
 
 static int expirationId;
@@ -97,15 +111,32 @@ void BindingWrapper::scheduleRegistrationExpiration(int expiration)
     pjsip_endpt_schedule_timer(mEndpoint, &mEntry, &delay);
 }
 
-//XXX Queueable operation
-void BindingWrapper::updateBinding(const std::string &callID, int cSeq, int expiration)
+class UpdateBinding : public Work
 {
-    mBinding->callid = callID;
-    mBinding->cseq = cSeq;
-    mBinding->expiration = time(NULL) + expiration;
-    cancelRegistrationExpiration();
-    lg(Debug) << "Renewing binding " << mBinding->contact << " for another " << expiration << " seconds.";
-    scheduleRegistrationExpiration(expiration);
+public:
+    UpdateBinding(const BindingWrapperPtr& wrapper, const std::string& callID, int cSeq, int expiration)
+        : mWrapper(wrapper), mCallID(callID), mCSeq(cSeq), mExpiration(expiration) { }
+
+    void execute()
+    {
+        mWrapper->mBinding->callid = mCallID;
+        mWrapper->mBinding->cseq = mCSeq;
+        mWrapper->mBinding->expiration = time(NULL) + mExpiration;
+        mWrapper->cancelRegistrationExpiration();
+        lg(Debug) << "Renewing binding " << mWrapper->mBinding->contact << " for another " << mExpiration << " seconds.";
+        mWrapper->scheduleRegistrationExpiration(mExpiration);
+    }
+
+private:
+    BindingWrapperPtr mWrapper;
+    const std::string mCallID;
+    const int mCSeq;
+    const int mExpiration;
+};
+
+void BindingWrapper::updateBinding(const std::string& callID, int cSeq, int expiration, const QueuePtr& queue)
+{
+    queue->enqueueWork(new UpdateBinding(this, callID, cSeq, expiration));
 }
 
 RegistrarI::RegistrarI(const RegistrarListenerPrx& defaultListener)
@@ -211,6 +242,21 @@ BindingDict RegistrarI::createBindingDict(const std::string& aor, const BindingW
     return dict;
 }
 
+BindingWrapperDict& RegistrarI::getBindings()
+{
+    return mBindings;
+}
+
+std::vector<AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx>& RegistrarI::getListeners()
+{
+    return mListeners;
+}
+
+QueuePtr PJSipRegistrarModule::getQueue()
+{
+    return mQueue;
+}
+
 void PJSipRegistrarModule::replicateState(
         const std::string &aor,
         const BindingWrapperSeq& existingBindings,
@@ -272,49 +318,72 @@ void PJSipRegistrarModule::replicateState(
     }
 }
 
-//XXX Potential queueable operation
-void RegistrarI::updateBindings(const std::string &aor, BindingWrapperSeq& newBindings, BindingWrapperSeq& removedBindings)
+class UpdateBindings : public Work
 {
+public:
+    UpdateBindings(
+            const RegistrarIPtr& registrar,
+            const std::string& aor,
+            const BindingWrapperSeq& newBindings,
+            const BindingWrapperSeq& removedBindings)
+        : mRegistrar(registrar), mAOR(aor), mNewBindings(newBindings), mRemovedBindings(removedBindings) {}
 
-    BindingWrapperDict::iterator aorBindings = mBindings.find(aor);
-
-    if (aorBindings == mBindings.end())
-    {
-        if (!newBindings.empty())
-        {
-            lg(Debug) << "Adding new bindings for aor " << aor;
-            mBindings.insert(make_pair(aor, newBindings));
-        }
-    }
-    else
+    void execute()
     {
-        BindingWrapperSeq& currentBindings = aorBindings->second;
-        if (!newBindings.empty())
+        BindingWrapperDict& regBindings = mRegistrar->getBindings();
+        BindingWrapperDict::iterator aorBindings = regBindings.find(mAOR);
+
+        if (aorBindings == regBindings.end())
         {
-            lg(Debug) << "Adding new bindings for aor " << aor;
-            currentBindings.insert(currentBindings.end(), newBindings.begin(), newBindings.end());
+            if (!mNewBindings.empty())
+            {
+                lg(Debug) << "Adding new bindings for aor " << mAOR;
+                regBindings.insert(make_pair(mAOR, mNewBindings));
+            }
         }
-        for (BindingWrapperSeq::iterator iter = removedBindings.begin(); iter != removedBindings.end(); ++iter)
+        else
         {
-            removeBinding(currentBindings, *iter);
+            BindingWrapperSeq& currentBindings = aorBindings->second;
+            if (!mNewBindings.empty())
+            {
+                lg(Debug) << "Adding new bindings for aor " << mAOR;
+                currentBindings.insert(currentBindings.end(), mNewBindings.begin(), mNewBindings.end());
+            }
+            for (BindingWrapperSeq::iterator iter = mRemovedBindings.begin(); iter != mRemovedBindings.end(); ++iter)
+            {
+                mRegistrar->removeBinding(currentBindings, *iter);
+            }
+            if (currentBindings.empty())
+            {
+                mRegistrar->removeAOR(mAOR);
+            }
         }
-        if (currentBindings.empty())
+
+        // We have our internal stuff all sorted out. Now we need to notify listeners and replicas.
+        BindingUpdateSeq newBindingUpdateSeq(mRegistrar->createBindingUpdateSeq(mAOR, mNewBindings));
+        BindingUpdateSeq removedBindingUpdateSeq(mRegistrar->createBindingUpdateSeq(mAOR, mRemovedBindings));
+        std::vector<RegistrarListenerPrx>& listeners = mRegistrar->getListeners();
+        for (std::vector<RegistrarListenerPrx>::iterator iter = listeners.begin();
+                iter != listeners.end(); ++iter)
         {
-            removeAOR(aor);
+            //Listeners are only concerned with new and removed bindings. There's no need to tell them of existing ones.
+            lg(Debug) << "Alerting listener " << (*iter)->ice_getIdentity().name << " about changes to bindings";
+            (*iter)->contactsAdded(newBindingUpdateSeq);
+            (*iter)->contactsRemoved(removedBindingUpdateSeq);
         }
     }
+private:
+    RegistrarIPtr mRegistrar;
+    const std::string mAOR;
+    BindingWrapperSeq mNewBindings;
+    BindingWrapperSeq mRemovedBindings;
+};
 
-    // We have our internal stuff all sorted out. Now we need to notify listeners and replicas.
-    BindingUpdateSeq newBindingUpdateSeq(createBindingUpdateSeq(aor, newBindings));
-    BindingUpdateSeq removedBindingUpdateSeq(createBindingUpdateSeq(aor, removedBindings));
-    for (std::vector<RegistrarListenerPrx>::iterator iter = mListeners.begin();
-            iter != mListeners.end(); ++iter)
-    {
-        //Listeners are only concerned with new and removed bindings. There's no need to tell them of existing ones.
-        lg(Debug) << "Alerting listener " << (*iter)->ice_getIdentity().name << " about changes to bindings";
-        (*iter)->contactsAdded(newBindingUpdateSeq);
-        (*iter)->contactsRemoved(removedBindingUpdateSeq);
-    }
+//XXX Potential queueable operation
+void RegistrarI::updateBindings(const std::string &aor, BindingWrapperSeq& newBindings, BindingWrapperSeq& removedBindings, const QueuePtr& queue)
+{
+
+    queue->enqueueWork(new UpdateBindings(this, aor, newBindings, removedBindings));
 }
 
 BindingUpdateSeq RegistrarI::createBindingUpdateSeq(const std::string& aor, BindingWrapperSeq& bindings)
@@ -537,7 +606,7 @@ pj_bool_t PJSipRegistrarModule::on_rx_request(pjsip_rx_data *rdata)
             }
             else
             {
-                (*bindingToUpdate)->updateBinding(callID, cSeq, expiration);
+                (*bindingToUpdate)->updateBinding(callID, cSeq, expiration, mQueue);
                 lg(Debug) << "Maintaining " << (*bindingToUpdate)->mBinding->contact << " in our existing bindings";
                 existingBindings.push_back(*bindingToUpdate);
             }
@@ -550,7 +619,7 @@ pj_bool_t PJSipRegistrarModule::on_rx_request(pjsip_rx_data *rdata)
         }
     }
 
-    mRegistrar->updateBindings(aor, newBindings, removedBindings);
+    mRegistrar->updateBindings(aor, newBindings, removedBindings, mQueue);
 
     pjsip_tx_data *tdata;
     pjsip_endpt_create_response(tsx->endpt, rdata, 200, NULL, &tdata);
diff --git a/src/PJSipRegistrarModule.h b/src/PJSipRegistrarModule.h
index 005657b..9637f5c 100644
--- a/src/PJSipRegistrarModule.h
+++ b/src/PJSipRegistrarModule.h
@@ -30,7 +30,7 @@ namespace SipSessionManager
 {
 
 class BindingWrapper;
-typedef boost::shared_ptr<BindingWrapper> BindingWrapperPtr;
+typedef IceUtil::Handle<BindingWrapper> BindingWrapperPtr;
 typedef std::vector<BindingWrapperPtr> BindingWrapperSeq;
 typedef std::map<std::string, BindingWrapperSeq> BindingWrapperDict;
 
@@ -51,7 +51,8 @@ public:
     void updateBindings(
             const std::string &aor,
             BindingWrapperSeq& newBindings,
-            BindingWrapperSeq& removedBindings);
+            BindingWrapperSeq& removedBindings,
+            const AsteriskSCF::System::WorkQueue::V1::QueuePtr& queue);
 
     AsteriskSCF::SIP::Registration::V1::BindingUpdateSeq createBindingUpdateSeq(
             const std::string& aor,
@@ -60,6 +61,9 @@ public:
     
     AsteriskSCF::SIP::Registration::V1::BindingDict createBindingDict(const std::string& aor, const BindingWrapperSeq& bindings);
 
+    std::vector<AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx>& getListeners();
+    BindingWrapperDict& getBindings();
+
 private:
     BindingWrapperDict mBindings;
     AsteriskSCF::SIP::Registration::V1::ContactDict mContacts;
@@ -87,6 +91,8 @@ public:
     void on_tsx_state(pjsip_transaction *tsx, pjsip_event *event);
     RegistrarIPtr getRegistrar();
 
+    AsteriskSCF::System::WorkQueue::V1::QueuePtr getQueue();
+
     /**
      * Replicate state of bindings currently held by this registrar.
      *
@@ -135,7 +141,7 @@ private:
 
 typedef IceUtil::Handle<PJSipRegistrarModule> PJSipRegistrarModulePtr;
 
-class BindingWrapper
+class BindingWrapper : public IceUtil::Shared
 {
 public:
     BindingWrapper(
@@ -164,7 +170,7 @@ public:
      * Update the binding in the wrapper with new information. This will
      * result in rescheduling destruction of the binding.
      */
-    void updateBinding(const std::string &callID, int cSeq, int expiration);
+    void updateBinding(const std::string &callID, int cSeq, int expiration, const AsteriskSCF::System::WorkQueue::V1::QueuePtr& queue);
 
     bool operator==(const BindingWrapper& rhs);
     bool operator==(const AsteriskSCF::SIP::Registration::V1::BindingPtr& rhs);
diff --git a/src/SipStateReplicatorListener.cpp b/src/SipStateReplicatorListener.cpp
index bf52fe9..8a3dd2a 100644
--- a/src/SipStateReplicatorListener.cpp
+++ b/src/SipStateReplicatorListener.cpp
@@ -126,7 +126,7 @@ public:
                 //that we've already expired and removed. No biggie. Just
                 //keep going.
             }
-            regModule->getRegistrar()->updateBindings(dictIter->first, emptySeq, toRemove);
+            regModule->getRegistrar()->updateBindings(dictIter->first, emptySeq, toRemove, regModule->getQueue());
         }
     }
 
@@ -166,7 +166,7 @@ public:
                 BindingWrapperPtr wrapper = createBindingWrapper(dictIter->first, *seqIter, regModule);
                 wrapperSeq.push_back(wrapper);
             }
-            regModule->getRegistrar()->updateBindings(dictIter->first, wrapperSeq, emptySeq);
+            regModule->getRegistrar()->updateBindings(dictIter->first, wrapperSeq, emptySeq, regModule->getQueue());
         }
     }
 
@@ -198,12 +198,12 @@ public:
                 }
                 else
                 {
-                    (*bindingToUpdate)->updateBinding((*seqIter)->callid, (*seqIter)->cseq, (*seqIter)->expiration - time(NULL));
+                    (*bindingToUpdate)->updateBinding((*seqIter)->callid, (*seqIter)->cseq, (*seqIter)->expiration - time(NULL), regModule->getQueue());
                 }
             }
             if (!newBindings.empty())
             {
-                regModule->getRegistrar()->updateBindings(dictIter->first, newBindings, emptySeq);
+                regModule->getRegistrar()->updateBindings(dictIter->first, newBindings, emptySeq, regModule->getQueue());
             }
         }
     }

commit be2641c8edb8a41556c4a0d9c2d86fb023917792
Author: Mark Michelson <mmichelson at digium.com>
Date:   Sat Jun 25 17:58:15 2011 -0500

    Mark potential queuable operations.

diff --git a/src/PJSipRegistrarModule.cpp b/src/PJSipRegistrarModule.cpp
index 7e52733..eba02df 100644
--- a/src/PJSipRegistrarModule.cpp
+++ b/src/PJSipRegistrarModule.cpp
@@ -33,6 +33,7 @@ namespace AsteriskSCF
 namespace SipSessionManager
 {
 
+//XXX QueueableOperation
 static void registrationExpired(pj_timer_heap_t *, struct pj_timer_entry *entry)
 {
     BindingWrapper *wrapper = static_cast<BindingWrapper *>(entry->user_data);
@@ -96,6 +97,7 @@ void BindingWrapper::scheduleRegistrationExpiration(int expiration)
     pjsip_endpt_schedule_timer(mEndpoint, &mEntry, &delay);
 }
 
+//XXX Queueable operation
 void BindingWrapper::updateBinding(const std::string &callID, int cSeq, int expiration)
 {
     mBinding->callid = callID;
@@ -112,6 +114,7 @@ RegistrarI::RegistrarI(const RegistrarListenerPrx& defaultListener)
     mListeners.push_back(defaultListener);
 }
 
+//XXX Queueable operation
 ContactDict RegistrarI::addListener(const RegistrarListenerPrx& listener, const Ice::Current&)
 {
     if (std::find(mListeners.begin(), mListeners.end(), listener) == mListeners.end())
@@ -123,11 +126,13 @@ ContactDict RegistrarI::addListener(const RegistrarListenerPrx& listener, const
     return mContacts;
 }
 
+//XXX Queueable operation
 void RegistrarI::removeListener(const RegistrarListenerPrx& listener, const Ice::Current&)
 {
     mListeners.erase(std::remove(mListeners.begin(), mListeners.end(), listener));
 }
 
+//XXX Queueable operation
 BindingDict RegistrarI::getAllBindings(const Ice::Current&)
 {
     BindingDict returnedBindings;
@@ -150,6 +155,7 @@ BindingDict RegistrarI::getAllBindings(const Ice::Current&)
     return returnedBindings;
 }
 
+//XXX Queueable Operation
 BindingSeq RegistrarI::getAORBindings(const std::string &aor, const Ice::Current&)
 {
     BindingWrapperDict::iterator iter = mBindings.find(aor);
@@ -266,6 +272,7 @@ void PJSipRegistrarModule::replicateState(
     }
 }
 
+//XXX Potential queueable operation
 void RegistrarI::updateBindings(const std::string &aor, BindingWrapperSeq& newBindings, BindingWrapperSeq& removedBindings)
 {
 

commit 1ea02fa8ec59f386d62f04a0ef3c1adb77fd5319
Author: Mark Michelson <mmichelson at digium.com>
Date:   Sat Jun 25 17:52:34 2011 -0500

    Add a WorkQueue onto the registrar module.

diff --git a/src/PJSipRegistrarModule.h b/src/PJSipRegistrarModule.h
index 8607570..005657b 100644
--- a/src/PJSipRegistrarModule.h
+++ b/src/PJSipRegistrarModule.h
@@ -18,6 +18,7 @@
 
 #include <AsteriskSCF/Discovery/SmartProxy.h>
 #include <AsteriskSCF/SIP/SIPRegistrarIf.h>
+#include <AsteriskSCF/System/WorkQueue/WorkQueueIf.h>
 
 #include "SipStateReplicator.h"
 #include "PJSipModule.h"
@@ -74,6 +75,7 @@ public:
             pjsip_endpoint *endpt,
             const AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx& defaultListener,
             const AsteriskSCF::Discovery::SmartProxy<AsteriskSCF::Replication::SipSessionManager::V1::SipStateReplicatorPrx>& stateReplicator);
+    ~PJSipRegistrarModule();
     pj_status_t load(pjsip_endpoint *endpoint);
     pj_status_t start();
     pj_status_t stop();
@@ -128,6 +130,7 @@ private:
     pjsip_endpoint *mEndpoint;
     RegistrarIPtr mRegistrar;
     AsteriskSCF::Discovery::SmartProxy<AsteriskSCF::Replication::SipSessionManager::V1::SipStateReplicatorPrx> mStateReplicator;
+    AsteriskSCF::System::WorkQueue::V1::QueuePtr mQueue;
 };
 
 typedef IceUtil::Handle<PJSipRegistrarModule> PJSipRegistrarModulePtr;
diff --git a/src/PJSipRegistrarModuleConstruction.cpp b/src/PJSipRegistrarModuleConstruction.cpp
index 46a3b10..660ccd6 100644
--- a/src/PJSipRegistrarModuleConstruction.cpp
+++ b/src/PJSipRegistrarModuleConstruction.cpp
@@ -16,7 +16,11 @@
 
 #include "PJSipRegistrarModule.h"
 
+#include <AsteriskSCF/WorkQueue/WorkQueue.h>
+#include <AsteriskSCF/WorkQueue/DefaultQueueListener.h>
+
 using namespace AsteriskSCF::SIP::Registration::V1;
+using namespace AsteriskSCF::WorkQueue;
 
 namespace AsteriskSCF
 {
@@ -96,8 +100,23 @@ PJSipRegistrarModule::PJSipRegistrarModule(
     mModule.on_tx_request = registrarOnTxRequest;
     mModule.on_tx_response = registrarOnTxResponse;
     mModule.on_tsx_state = registrarOnTsxState;
+
+    mQueue = new AsteriskSCF::WorkQueue::WorkQueue();
+    AsteriskSCF::WorkQueue::DefaultQueueListenerPtr listener(new AsteriskSCF::WorkQueue::DefaultQueueListener(mQueue));
+    mQueue->setListener(listener);
     pjsip_endpt_register_module(mEndpoint, &mModule);
 }
 
+PJSipRegistrarModule::~PJSipRegistrarModule()
+{
+    try
+    {
+        mQueue->shutdown();
+    }
+    catch (const AsteriskSCF::System::WorkQueue::V1::ShuttingDown&)
+    {
+    }
+}
+
 };
 };

commit 3fa68dd21a3f9a62ca80400e48832d0e6225a2ea
Merge: fc2f64b c977ec5
Author: Mark Michelson <mmichelson at digium.com>
Date:   Sat Jun 25 17:33:56 2011 -0500

    Merge branch 'master' into registrar
    
    Conflicts:
    	config/SipConfigurator.py


commit c977ec5bbe15874cd222c0b181c8c75419975224
Merge: 4f75a28 1de6764
Author: Mark Michelson <mmichelson at digium.com>
Date:   Sat Jun 25 17:33:12 2011 -0500

    Merge branch 'master' of git.asterisk.org:asterisk-scf/release/sip
    
    Conflicts:
    	src/PJSipSessionModuleConstruction.cpp


commit 4f75a2866c33895ced0757ea9f12e31fc40ba093
Author: Mark Michelson <mmichelson at digium.com>
Date:   Sat Jun 25 17:31:56 2011 -0500

    Fix merge problem.

diff --git a/src/PJSipSessionModuleConstruction.cpp b/src/PJSipSessionModuleConstruction.cpp
index c7af8d2..a9e1220 100644
--- a/src/PJSipSessionModuleConstruction.cpp
+++ b/src/PJSipSessionModuleConstruction.cpp
@@ -19,6 +19,13 @@
 
 #include "PJSipSessionModule.h"
 
+using namespace AsteriskSCF::System::Logging;
+
+namespace
+{
+Logger lg = getLoggerFactory().getLogger("AsteriskSCF.SipSessionManager");
+}
+
 namespace AsteriskSCF
 {
 
@@ -162,7 +169,7 @@ PJSipSessionModule::~PJSipSessionModule()
     {
         mPoolQueue->shutdown();
     }
-    catch (const ShuttingDown&)
+    catch (const AsteriskSCF::System::WorkQueue::V1::ShuttingDown&)
     {
         lg(Warning) << "Attempted to shut down a Queue that is already shut down.";
     }

commit fc2f64b78c4c57c4c3b8fea3233a9fd3f52147f6
Merge: 575abed 4cc73e7
Author: Mark Michelson <mmichelson at digium.com>
Date:   Sat Jun 25 16:21:37 2011 -0500

    Merge branch 'master' into registrar


commit 575abed0a58ba2e9f321b8ccc121a32356c7288d
Author: Mark Michelson <mmichelson at digium.com>
Date:   Fri Jun 24 16:18:55 2011 -0500

    Adjust for changes made by build system reorganization.

diff --git a/config/SipConfigurator.py b/config/SipConfigurator.py
index 980cded..31793e8 100755
--- a/config/SipConfigurator.py
+++ b/config/SipConfigurator.py
@@ -22,23 +22,23 @@
 import Ice, Configurator, sys
 
 # Load our component specific configuration definitions
-Ice.loadSlice('-I. -I/opt/Ice-3.4.1/slice -I../../slice --all ../local-slice/SipConfigurationIf.ice')
-import AsteriskSCF.SIP.V1
+Ice.loadSlice('-I. -I/opt/Ice-3.4.1/slice -I../../slice/slice --all ../slice/AsteriskSCF/Configuration/SipSessionManager/SipConfigurationIf.ice')
+import AsteriskSCF.Configuration.SipSessionManager.V1
 
 # Add our own visitor implementations for the sections we support
 class SipSectionVisitors(Configurator.SectionVisitors):
     def visit_general(self, config, section):
-        group = AsteriskSCF.SIP.V1.SipGeneralGroup()
+        group = AsteriskSCF.Configuration.SipSessionManager.V1.SipGeneralGroup()
         group.configurationItems = { }
         self.groups.append(group)
 
     def visit_transport_udp(self, config, section):
-        group = AsteriskSCF.SIP.V1.SipUDPTransportGroup()
+        group = AsteriskSCF.Configuration.SipSessionManager.V1.SipUDPTransportGroup()
         group.name = section
         group.configurationItems = { }
 
         mapper = Configurator.OptionMapper()
-        item = AsteriskSCF.SIP.V1.SipHostItem()
+        item = AsteriskSCF.Configuration.SipSessionManager.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):
@@ -49,12 +49,12 @@ class SipSectionVisitors(Configurator.SectionVisitors):
         self.groups.append(group)
 
     def visit_transport_tcp(self, config, section):
-        group = AsteriskSCF.SIP.V1.SipTCPTransportGroup()
+        group = AsteriskSCF.Configuration.SipSessionManager.V1.SipTCPTransportGroup()
         group.name = section
         group.configurationItems = { }
 
         mapper = Configurator.OptionMapper()
-        item = AsteriskSCF.SIP.V1.SipHostItem()
+        item = AsteriskSCF.Configuration.SipSessionManager.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):
@@ -65,12 +65,12 @@ class SipSectionVisitors(Configurator.SectionVisitors):
         self.groups.append(group)
 
     def visit_transport_tls(self, config, section):
-        group = AsteriskSCF.SIP.V1.SipTLSTransportGroup()
+        group = AsteriskSCF.Configuration.SipSessionManager.V1.SipTLSTransportGroup()
         group.name = section
         group.configurationItems = { }
 
         mapper = Configurator.OptionMapper()
-        item = AsteriskSCF.SIP.V1.SipHostItem()
+        item = AsteriskSCF.Configuration.SipSessionManager.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):
@@ -81,19 +81,19 @@ class SipSectionVisitors(Configurator.SectionVisitors):
         self.groups.append(group)
 
     def visit_endpoint(self, config, section):
-        group = AsteriskSCF.SIP.V1.SipEndpointGroup()
+        group = AsteriskSCF.Configuration.SipSessionManager.V1.SipEndpointGroup()
         group.name = section
         group.configurationItems = { }
 
         mapper = Configurator.OptionMapper()
 
-        mapper.map('routing', AsteriskSCF.SIP.V1.SipRoutingItem(), 'routingServiceName', 'routingService', config.get, None)
+        mapper.map('routing', AsteriskSCF.Configuration.SipSessionManager.V1.SipRoutingItem(), 'routingServiceName', 'routingService', config.get, None)
 
-        item = AsteriskSCF.SIP.V1.SipSourceTransportAddressItem()
+        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipSourceTransportAddressItem()
         mapper.map('sourcehost', item, 'host', 'sourceaddress', config.get, None)
         mapper.map('sourceport', item, 'port', 'sourceaddress', config.getint, 5060)
 
-        item = AsteriskSCF.SIP.V1.SipTargetDestinationAddressItem()
+        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipTargetDestinationAddressItem()
         mapper.map('targethost', item, 'host', 'targetaddress', config.get, None)
         mapper.map('targetport', item, 'port', 'targetaddress', config.getint, 5060)
 
@@ -102,35 +102,35 @@ class SipSectionVisitors(Configurator.SectionVisitors):
                 self.config = config
             def get(self, section, item):
                 if self.config.get(section, item) == 'inbound':
-                    return AsteriskSCF.SIP.V1.SipAllowableCallDirection.Inbound
+                    return AsteriskSCF.Configuration.SipSessionManager.V1.SipAllowableCallDirection.Inbound
                 elif self.config.get(section, item) == 'outbound':
-                    return AsteriskSCF.SIP.V1.SipAllowableCallDirection.Outbound
+                    return AsteriskSCF.Configuration.SipSessionManager.V1.SipAllowableCallDirection.Outbound
                 elif self.config.get(section, item) == 'both':
-                    return AsteriskSCF.SIP.V1.SipAllowableCallDirection.Both
+                    return AsteriskSCF.Configuration.SipSessionManager.V1.SipAllowableCallDirection.Both
                 elif self.config.get(section, item) == 'none':
-                    return AsteriskSCF.SIP.V1.SipAllowableCallDirection.Disabled
+                    return AsteriskSCF.Configuration.SipSessionManager.V1.SipAllowableCallDirection.Disabled
 
         transformer = AllowableCallDirectionTransformer(config)
 
-        mapper.map('direction', AsteriskSCF.SIP.V1.SipAllowableCallDirectionItem(), 'callDirection', 'callDirection', transformer.get, None)
+        mapper.map('direction', AsteriskSCF.Configuration.SipSessionManager.V1.SipAllowableCallDirectionItem(), 'callDirection', 'callDirection', transformer.get, None)
 
-        mapper.map('securetransport', AsteriskSCF.SIP.V1.SipEndpointTransportItem(), 'secureTransport', 'transport', transformer.get, None)
+        mapper.map('securetransport', AsteriskSCF.Configuration.SipSessionManager.V1.SipEndpointTransportItem(), 'secureTransport', 'transport', transformer.get, None)
 
-        item = AsteriskSCF.SIP.V1.SipRTPMediaServiceItem()
+        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipRTPMediaServiceItem()
         mapper.map('rtpoveripv6', item, 'requireIPv6', 'mediaservice', config.getboolean, None)
 
-        item = AsteriskSCF.SIP.V1.SipCryptoCertificateItem()
+        item = AsteriskSCF.Configuration.SipSessionManager.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.SIP.V1.SipCryptoRequirementsItem()
+        item = AsteriskSCF.Configuration.SipSessionManager.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.SIP.V1.SipCryptoItem()
+        item = AsteriskSCF.Configuration.SipSessionManager.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)
@@ -140,15 +140,15 @@ class SipSectionVisitors(Configurator.SectionVisitors):
                 self.config = config
             def get(self, section, item):
                 if self.config.get(section, item) == 'unspecified':
-                    return AsteriskSCF.SIP.V1.TLSProtocolMethod.PROTOCOLMETHODUNSPECIFIED
+                    return AsteriskSCF.Configuration.SipSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODUNSPECIFIED
                 elif self.config.get(section, item) == 'tlsv1':
-                    return AsteriskSCF.SIP.V1.TLSProtocolMethod.PROTOCOLMETHODTLSV1
+                    return AsteriskSCF.Configuration.SipSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODTLSV1
                 elif self.config.get(section, item) == 'sslv2':
-                    return AsteriskSCF.SIP.V1.TLSProtocolMethod.PROTOCOLMETHODTSSLV2
+                    return AsteriskSCF.Configuration.SipSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODTSSLV2
                 elif self.config.get(section, item) == 'sslv3':
-                    return AsteriskSCF.SIP.V1.TLSProtocolMethod.PROTOCOLMETHODSSLV3
+                    return AsteriskSCF.Configuration.SipSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODSSLV3
                 elif self.config.get(section, item) == 'sslv23':
-                    return AsteriskSCF.SIP.V1.TLSProtocolMethod.PROTOCOLMETHODSSLV23
+                    return AsteriskSCF.Configuration.SipSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODSSLV23
 
         transformer = TLSProtocolMethodTransformer(config)
         mapper.map('tlsprotocolmethod', item, 'protocolMethod', 'crypto', transformer.get, None)
@@ -170,8 +170,8 @@ class SipSectionVisitors(Configurator.SectionVisitors):
             self.visit_endpoint(config, section)
 
 # In order to do service locator based lookup we need to pass in a params object
-serviceLocatorParams = AsteriskSCF.SIP.V1.SipConfigurationParams()
-serviceLocatorParams.category = AsteriskSCF.SIP.V1.ConfigurationDiscoveryCategory
+serviceLocatorParams = AsteriskSCF.Configuration.SipSessionManager.V1.SipConfigurationParams()
+serviceLocatorParams.category = AsteriskSCF.Configuration.SipSessionManager.V1.ConfigurationDiscoveryCategory
 
 # Make a configurator application and let it run
 app = Configurator.ConfiguratorApp('Sip.config', SipSectionVisitors(), None, serviceLocatorParams)
diff --git a/src/PJSipManager.cpp b/src/PJSipManager.cpp
index fc9f2f4..87f0e2d 100644
--- a/src/PJSipManager.cpp
+++ b/src/PJSipManager.cpp
@@ -98,7 +98,7 @@ void PJSipManager::registerLoggingModule()
 
 void PJSipManager::registerRegistrarModule(
         const RegistrarListenerPrx& defaultListener,
-        const AsteriskSCF::Discovery::SmartProxy<AsteriskSCF::SIP::V1::SipStateReplicatorPrx>& stateReplicator,
+        const AsteriskSCF::Discovery::SmartProxy<AsteriskSCF::Replication::SipSessionManager::V1::SipStateReplicatorPrx>& stateReplicator,
         Ice::ObjectAdapterPtr& adapter)
 {
     mRegistrarModule = new PJSipRegistrarModule(mEndpoint, defaultListener, stateReplicator);
diff --git a/src/PJSipManager.h b/src/PJSipManager.h
index 0c099cd..226a674 100644
--- a/src/PJSipManager.h
+++ b/src/PJSipManager.h
@@ -96,7 +96,7 @@ public:
      */
     void registerRegistrarModule(
             const AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx& defaultListener,
-            const AsteriskSCF::Discovery::SmartProxy<AsteriskSCF::SIP::V1::SipStateReplicatorPrx>& stateReplicator,
+            const AsteriskSCF::Discovery::SmartProxy<AsteriskSCF::Replication::SipSessionManager::V1::SipStateReplicatorPrx>& stateReplicator,
             Ice::ObjectAdapterPtr& adapter);
 
     /**
diff --git a/src/PJSipRegistrarModule.cpp b/src/PJSipRegistrarModule.cpp
index 44498a4..7e52733 100644
--- a/src/PJSipRegistrarModule.cpp
+++ b/src/PJSipRegistrarModule.cpp
@@ -213,8 +213,8 @@ void PJSipRegistrarModule::replicateState(
 {
     try
     {
-        AsteriskSCF::SIP::V1::SipStateReplicatorPrx oneWayStateReplicator =
-            AsteriskSCF::SIP::V1::SipStateReplicatorPrx::uncheckedCast(mStateReplicator->ice_oneway());
+        AsteriskSCF::Replication::SipSessionManager::V1::SipStateReplicatorPrx oneWayStateReplicator =
+            AsteriskSCF::Replication::SipSessionManager::V1::SipStateReplicatorPrx::uncheckedCast(mStateReplicator->ice_oneway());
     }
     catch (const Ice::NoEndpointException&)
     {
diff --git a/src/PJSipRegistrarModule.h b/src/PJSipRegistrarModule.h
index ab7ed34..8607570 100644
--- a/src/PJSipRegistrarModule.h
+++ b/src/PJSipRegistrarModule.h
@@ -73,7 +73,7 @@ public:
     PJSipRegistrarModule(
             pjsip_endpoint *endpt,
             const AsteriskSCF::SIP::Registration::V1::RegistrarListenerPrx& defaultListener,
-            const AsteriskSCF::Discovery::SmartProxy<AsteriskSCF::SIP::V1::SipStateReplicatorPrx>& stateReplicator);
+            const AsteriskSCF::Discovery::SmartProxy<AsteriskSCF::Replication::SipSessionManager::V1::SipStateReplicatorPrx>& stateReplicator);
     pj_status_t load(pjsip_endpoint *endpoint);
     pj_status_t start();
     pj_status_t stop();
@@ -127,7 +127,7 @@ private:
 
     pjsip_endpoint *mEndpoint;
     RegistrarIPtr mRegistrar;
-    AsteriskSCF::Discovery::SmartProxy<AsteriskSCF::SIP::V1::SipStateReplicatorPrx> mStateReplicator;
+    AsteriskSCF::Discovery::SmartProxy<AsteriskSCF::Replication::SipSessionManager::V1::SipStateReplicatorPrx> mStateReplicator;
 };
 
 typedef IceUtil::Handle<PJSipRegistrarModule> PJSipRegistrarModulePtr;
diff --git a/src/PJSipRegistrarModuleConstruction.cpp b/src/PJSipRegistrarModuleConstruction.cpp
index 2996cd8..46a3b10 100644
--- a/src/PJSipRegistrarModuleConstruction.cpp
+++ b/src/PJSipRegistrarModuleConstruction.cpp
@@ -76,7 +76,7 @@ static void registrarOnTsxState(pjsip_transaction *tsx, pjsip_event *event)
 PJSipRegistrarModule::PJSipRegistrarModule(
         pjsip_endpoint *endpt,
         const RegistrarListenerPrx& defaultListener,
-        const AsteriskSCF::Discovery::SmartProxy<AsteriskSCF::SIP::V1::SipStateReplicatorPrx>& stateReplicator)
+        const AsteriskSCF::Discovery::SmartProxy<AsteriskSCF::Replication::SipSessionManager::V1::SipStateReplicatorPrx>& stateReplicator)
     : mEndpoint(endpt), mRegistrar(new RegistrarI(defaultListener)), mStateReplicator(stateReplicator)
 {
     registrarModule = this;

commit b0d2423c8b01c4432c7289f9648213e16406174a
Merge: 1dda977 b49bbff
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Jun 23 14:24:51 2011 -0500

    Merge branch 'master' into registrar
    
    Conflicts:
    	slice/AsteriskSCF/Replication/SipSessionManager/SipStateReplicationIf.ice
    	src/CMakeLists.txt
    	src/SipEndpointFactory.cpp
    	src/SipStateReplicator.h
    	src/SipStateReplicatorListener.cpp

diff --cc slice/AsteriskSCF/Replication/SipSessionManager/SipStateReplicationIf.ice
index 9a0b52b,5e613db..4a8efc2
--- a/slice/AsteriskSCF/Replication/SipSessionManager/SipStateReplicationIf.ice
+++ b/slice/AsteriskSCF/Replication/SipSessionManager/SipStateReplicationIf.ice
@@@ -155,22 -157,13 +160,27 @@@ module V
        AsteriskSCF::Media::V1::Session *mMediaSession;
        SessionListenerSeq mListeners;
        AsteriskSCF::SessionCommunications::V1::Bridge *mBridge;
+       AsteriskSCF::SessionCommunications::V1::SessionCookieDict mCookies;
     };
  
 +   class SipRegistrarStateItem extends SipStateItem
 +   {
 +      /**
 +       * The bindings whose states are being set/removed
 +       */
 +      AsteriskSCF::SIP::Registration::V1::BindingDict bindings;
 +      /**
 +       * In the case of setting state, this distinguishes if
 +       * the bindings are new. If not, then the bindings are
 +       * all ones the replicator listener already has record of.
 +       */
 +      bool newBindings;
 +   };
 +
- }; //module V1
- }; //module SIP
- }; //module Asterisk SCF
+ }; /* module V1 */
+ 
+ }; /* module SipSessionManager */
+ 
+ }; /* module Replication */
+ 
+ }; /* module AsteriskSCF */
diff --cc src/CMakeLists.txt
index 5e1b573,2412342..b4570ac
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@@ -5,49 -5,42 +5,47 @@@ if(OPENSSL_FOUND
  endif()
  
  include_directories(${logger_dir}/include)
- include_directories(${ice-util-cpp_dir}/include)
- include_directories(${API_INCLUDE_DIR})
+ include_directories(${astscf-ice-util-cpp_dir}/include)
  
- asterisk_scf_slice_include_directories(${API_SLICE_DIR})
- 
- asterisk_scf_component_init(SipSessionManager)
- asterisk_scf_component_add_file(SipSessionManager SipSessionManagerApp.cpp)
- asterisk_scf_component_add_file(SipSessionManager SipSessionManagerEventPublisher.cpp)
- asterisk_scf_component_add_file(SipSessionManager SipSessionManagerEventPublisher.h)
- asterisk_scf_component_add_file(SipSessionManager SipSessionManagerEndpointLocator.cpp)
- asterisk_scf_component_add_file(SipSessionManager SipSessionManagerEndpointLocator.h)
- asterisk_scf_component_add_file(SipSessionManager SipEndpointFactory.cpp)
- asterisk_scf_component_add_file(SipSessionManager SipEndpointFactory.h)
- asterisk_scf_component_add_file(SipSessionManager SipEndpoint.cpp)
- asterisk_scf_component_add_file(SipSessionManager SipEndpoint.h)
- asterisk_scf_component_add_file(SipSessionManager SipSession.cpp)
- asterisk_scf_component_add_file(SipSessionManager SipSession.h)
- asterisk_scf_component_add_file(SipSessionManager PJSipManager.cpp)
- asterisk_scf_component_add_file(SipSessionManager PJSipManager.h)
- asterisk_scf_component_add_file(SipSessionManager PJSipModule.cpp)
- asterisk_scf_component_add_file(SipSessionManager PJSipModule.h)
- asterisk_scf_component_add_file(SipSessionManager PJSipSessionModule.cpp)
- asterisk_scf_component_add_file(SipSessionManager PJSipSessionModuleConstruction.cpp)
- asterisk_scf_component_add_file(SipSessionManager PJSipSessionModule.h)
- asterisk_scf_component_add_file(SipSessionManager PJSipLoggingModule.cpp)
- asterisk_scf_component_add_file(SipSessionManager PJSipLoggingModuleConstruction.cpp)
- asterisk_scf_component_add_file(SipSessionManager PJSipLoggingModule.h)
- asterisk_scf_component_add_file(SipSessionManager PJSipRegistrarModule.cpp)
- asterisk_scf_component_add_file(SipSessionManager PJSipRegistrarModuleConstruction.cpp)
- asterisk_scf_component_add_file(SipSessionManager PJSipRegistrarModule.h)
- asterisk_scf_component_add_file(SipSessionManager SipConfiguration.cpp)
- asterisk_scf_component_add_file(SipSessionManager SipConfiguration.h)
- asterisk_scf_component_add_file(SipSessionManager SipStateReplicatorListener.cpp)
- asterisk_scf_component_add_file(SipSessionManager SipStateReplicator.h)
- asterisk_scf_component_add_file(SipSessionManager SipRegistrarListener.cpp)
- asterisk_scf_component_add_file(SipSessionManager SipRegistrarListener.h)
- asterisk_scf_component_add_slice(SipSessionManager ../local-slice/SipIf.ice)
- asterisk_scf_component_add_slice(SipSessionManager ../local-slice/SipStateReplicationIf.ice)
- asterisk_scf_component_add_slice(SipSessionManager ../local-slice/SipConfigurationIf.ice)
- asterisk_scf_component_add_ice_libraries(SipSessionManager IceStorm)
- asterisk_scf_component_add_boost_libraries(SipSessionManager core)
- asterisk_scf_component_build_icebox(SipSessionManager)
- target_link_libraries(SipSessionManager logging-client ice-util-cpp ${OPENSSL_LIBRARIES})
+ astscf_component_init(SipSessionManager)
+ astscf_component_add_files(SipSessionManager SipSessionManagerApp.cpp)
+ 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 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 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 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 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_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 logging-client astscf-ice-util-cpp ${OPENSSL_LIBRARIES})
  pjproject_link(SipSessionManager pjsip)
  pjproject_link(SipSessionManager pjmedia)
  pjproject_link(SipSessionManager pjlib-util)
diff --cc src/SipSessionManagerApp.cpp
index 3eaff42,1d89753..6ca80c9
--- a/src/SipSessionManagerApp.cpp
+++ b/src/SipSessionManagerApp.cpp
@@@ -597,14 -575,7 +585,11 @@@ void SipSessionManager::initialize(cons
          mGlobalAdapter->activate();
          mLocalAdapter->activate();
          lg(Debug) << "Activated object adapters";
- 
-         configureEndpoints();
-         lg(Debug) << "Endpoints configured";
      }
 +    catch(const Ice::Exception& ex)
 +    {
 +        lg(Critical) << "Caught exception during initialization: " << ex.what();
 +    }
      catch(...)
      {
          lg(Critical) << "Major problems in " << mAppName << " initialization()";
diff --cc src/SipStateReplicator.h
index 47ef37c,135daed..a6bbb22
--- a/src/SipStateReplicator.h
+++ b/src/SipStateReplicator.h
@@@ -44,8 -44,7 +44,8 @@@ class SipStateReplicatorListenerI : pub
  public:
      SipStateReplicatorListenerI(const boost::shared_ptr<SipEndpointFactory>& factory, PJSipManager *manager);
      void stateRemoved(const Ice::StringSeq&, const Ice::Current&);
-     void stateRemovedForItems(const AsteriskSCF::SIP::V1::SipStateItemSeq&, const Ice::Current&);
-     void stateSet(const AsteriskSCF::SIP::V1::SipStateItemSeq&, const Ice::Current&);
++    void stateRemovedForItems(const AsteriskSCF::Replication::SipSessionManager::V1::SipStateItemSeq&, const Ice::Current&);
+     void stateSet(const AsteriskSCF::Replication::SipSessionManager::V1::SipStateItemSeq&, const Ice::Current&);
      bool operator==(const SipStateReplicatorListenerI &rhs);
  private:
      boost::shared_ptr<SipStateReplicatorListenerImpl> mImpl;
diff --cc src/SipStateReplicatorListener.cpp
index 26e4402,6949339..bf52fe9
--- a/src/SipStateReplicatorListener.cpp
+++ b/src/SipStateReplicatorListener.cpp
@@@ -31,8 -30,7 +31,8 @@@ namespace AsteriskSC
  namespace SipSessionManager
  {
  
- using namespace AsteriskSCF::SIP::V1;
 +using namespace AsteriskSCF::SIP::Registration::V1;
+ using namespace AsteriskSCF::Replication::SipSessionManager::V1;
  
  class SipStateReplicatorItem
  {

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list