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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Sun Aug 28 21:51:27 CDT 2011


branch "rearrange" has been updated
       via  39cd935b6da0d93b926133e103eaa04ba8462af0 (commit)
       via  e24b07740f6edacdd7eb545d6defec92d5ffd38d (commit)
       via  f37a3cc07e0c31573506654b550f7ee41924477c (commit)
      from  42e66ded3b440ec80bf272d26336546b3f056931 (commit)

Summary of changes:
 src/CMakeLists.txt                 |    1 -
 src/Session/SipSession.cpp         |  235 +++++++++++++++---------------------
 src/Session/SipSession.h           |    6 +-
 src/Session/SipSessionOperations.h |   97 +++++++++++++++
 4 files changed, 200 insertions(+), 139 deletions(-)
 create mode 100644 src/Session/SipSessionOperations.h


- Log -----------------------------------------------------------------
commit 39cd935b6da0d93b926133e103eaa04ba8462af0
Author: Mark Michelson <mmichelson at digium.com>
Date:   Sun Aug 28 21:52:34 2011 -0500

    Use const references where we can.

diff --git a/src/Session/SipSessionOperations.h b/src/Session/SipSessionOperations.h
index b05db5d..57a6c24 100644
--- a/src/Session/SipSessionOperations.h
+++ b/src/Session/SipSessionOperations.h
@@ -31,7 +31,7 @@ template<class F, class A>
 class GeneralAMDSessionOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
 {
 public:
-    GeneralAMDSessionOperation(boost::function<F()> function,
+    GeneralAMDSessionOperation(const boost::function<F()>& function,
             const A& cb)
         : mFunction(function), mCB(cb) { }
 
@@ -56,7 +56,7 @@ template<class A>
 class GeneralAMDSessionOperation<void, A> : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
 {
 public:
-    GeneralAMDSessionOperation(boost::function<void()> function,
+    GeneralAMDSessionOperation(const boost::function<void()>& function,
             const A& cb)
         : mFunction(function), mCB(cb) { }
 
@@ -81,7 +81,7 @@ private:
 class GeneralSessionOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
 {
 public:
-    GeneralSessionOperation(boost::function<void()> function)
+    GeneralSessionOperation(const boost::function<void()>& function)
         : mFunction(function) { }
 
     AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&)

commit e24b07740f6edacdd7eb545d6defec92d5ffd38d
Author: Mark Michelson <mmichelson at digium.com>
Date:   Sun Aug 28 14:40:59 2011 -0500

    Make general session operation classes to use.

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6d0fd3e..acb0b57 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -29,7 +29,6 @@ astscf_component_add_files(SipSessionManager SipEndpoint.cpp)
 astscf_component_add_files(SipSessionManager SipEndpoint.h)
 astscf_component_add_files(SipSessionManager Session/SipSession.cpp)
 astscf_component_add_files(SipSessionManager Session/SipSession.h)
-astscf_component_add_files(SipSessionManager Session/SipSessionOperations.cpp)
 astscf_component_add_files(SipSessionManager Session/SipSessionOperations.h)
 astscf_component_add_files(SipSessionManager Session/SipTelephonyEventSource.cpp)
 astscf_component_add_files(SipSessionManager Session/SipTelephonyEventSource.h)
diff --git a/src/Session/SipSession.cpp b/src/Session/SipSession.cpp
index c5da94a..5c83256 100755
--- a/src/Session/SipSession.cpp
+++ b/src/Session/SipSession.cpp
@@ -28,6 +28,7 @@
 #include <boost/thread.hpp>
 #include <boost/thread/shared_mutex.hpp>
 #include <boost/lexical_cast.hpp>
+#include <boost/bind.hpp>
 
 #include <AsteriskSCF/System/WorkQueue/WorkQueueIf.h>
 #include <AsteriskSCF/logger.h>
@@ -751,7 +752,7 @@ void SipSession::activateIceObjects(const AsteriskSCF::SessionCommunications::Ex
             // typically called from a queued operation.
             // It's safe to do here since the session is
             // in the process of being created.
-            setCookies(out->cookies);
+            setTheCookies(out->cookies);
             in = out;
         }
     }
@@ -879,7 +880,9 @@ void SipSession::addListener_async(
         const Ice::Current&)
 {
     lg(Debug) << "Queueing addListener operation";
-    enqueueSessionWork(new AddListenerOperation(cb, listener, this));
+    boost::function<SessionInfoPtr()> func =
+        boost::bind(&SipSession::addListener, this, listener);
+    enqueueSessionWork(new GeneralAMDSessionOperation<SessionInfoPtr, AMD_Session_addListenerPtr>(func, cb));
 }
 
 SessionInfoPtr SipSession::addListener(const SessionListenerPrx& listener)
@@ -897,7 +900,9 @@ void SipSession::indicate_async(
         const Ice::Current&)
 {
     lg(Debug) << "Queuing an indicate operation";
-    enqueueSessionWork(new IndicateOperation(cb, indication, this));
+    boost::function<void()> func =
+        boost::bind(&SipSession::indicate, this, indication);
+    enqueueSessionWork(new GeneralAMDSessionOperation<void, AMD_Session_indicatePtr>(func, cb));
 }
 
 void SipSession::indicate(const IndicationPtr& indication)
@@ -966,7 +971,9 @@ void SipSession::getEndpoint_async(
         const Ice::Current&)
 {
     lg(Debug) << "Queuing a getEndpoint operation";
-    enqueueSessionWork(new GetEndpointOperation(cb, this));
+    boost::function<SessionEndpointPrx()> func =
+        boost::bind(&SipSession::getEndpointProxy, this);
+    enqueueSessionWork(new GeneralAMDSessionOperation<SessionEndpointPrx, AMD_Session_getEndpointPtr>(func, cb));
 }
 
 /**
@@ -977,7 +984,9 @@ void SipSession::getInfo_async(
         const Ice::Current&)
 {
     lg(Debug) << "queuing a getInfo operation";
-    enqueueSessionWork(new GetInfoOperation(cb, this));
+    boost::function<SessionInfoPtr()> func =
+        boost::bind(&SipSession::getInfo, this);
+    enqueueSessionWork(new GeneralAMDSessionOperation<SessionInfoPtr, AMD_Session_getInfoPtr>(func, cb));
 }
 
 SessionInfoPtr SipSession::getInfo()
@@ -1024,7 +1033,9 @@ void SipSession::getMediaSession_async(
         const Ice::Current&)
 {
     lg(Debug) << "queuing a getMediaSession operation";
-    enqueueSessionWork(new GetMediaSessionOperation(cb, this));
+    boost::function<AsteriskSCF::Media::V1::SessionPrx()> func =
+        boost::bind(&SipSession::getMediaSession, this);
+    enqueueSessionWork(new GeneralAMDSessionOperation<AsteriskSCF::Media::V1::SessionPrx, AMD_Session_getMediaSessionPtr>(func, cb));
 }
 
 AsteriskSCF::Media::V1::SessionPrx SipSession::getMediaSession()
@@ -1040,7 +1051,9 @@ void SipSession::getBridge_async(
         const Ice::Current&)
 {
     lg(Debug) << "queuing a getBridge operation";
-    enqueueSessionWork(new GetBridgeOperation(cb, this));
+    boost::function<BridgePrx()> func =
+        boost::bind(&SipSession::getBridge, this);
+    enqueueSessionWork(new GeneralAMDSessionOperation<BridgePrx, AMD_Session_getBridgePtr>(func, cb));
 }
 
 BridgePrx SipSession::getBridge()
@@ -1060,7 +1073,9 @@ void SipSession::getStreams_async(
     const Ice::Current&)
 {
     lg(Debug) << "queuing a getStreams operation";
-    enqueueSessionWork(new GetStreamsOperation(cb, this));
+    boost::function<StreamInformationDict()> func =
+        boost::bind(&SipSession::getStreams, this);
+    enqueueSessionWork(new GeneralAMDSessionOperation<StreamInformationDict, AMD_Session_getStreamsPtr>(func, cb));
 }
 
 StreamInformationDict SipSession::getStreams()
@@ -1077,7 +1092,9 @@ void SipSession::setAndGetSessionController_async(
     const Ice::Current&)
 {
     lg(Debug) << "queueing a setAndGetSessionController operation";
-    enqueueSessionWork(new SetAndGetSessionControllerOperation(cb, controller, this));
+    boost::function<SessionControllerPrx()> func =
+        boost::bind(&SipSession::setAndGetSessionController, this, controller);
+    enqueueSessionWork(new GeneralAMDSessionOperation<SessionControllerPrx, AMD_Session_setAndGetSessionControllerPtr>(func, cb));
 }
 
 SessionControllerPrx SipSession::setAndGetSessionController(const SessionControllerPrx& controller)
@@ -1099,7 +1116,9 @@ void SipSession::removeSessionController_async(const AsteriskSCF::SessionCommuni
                                                const Ice::Current&)
 {
     lg(Debug) << "queueing a removeSessionController operation";
-    enqueueSessionWork(new RemoveSessionControllerOperation(cb, controller, this));
+    boost::function<void()> func =
+        boost::bind(&SipSession::removeSessionController, this, controller);
+    enqueueSessionWork(new GeneralAMDSessionOperation<void, AMD_Session_removeSessionControllerPtr>(func, cb));
 }
 
 void SipSession::removeSessionController(const SessionControllerPrx& controller)
@@ -1120,7 +1139,9 @@ void SipSession::setBridge_async(
     const Ice::Current&)
 {
     lg(Debug) << "queuing a setBridge operation";
-    enqueueSessionWork(new SetBridgeOperation(cb, bridge, listener, this));
+    boost::function<SessionInfoPtr()> func =
+        boost::bind(&SipSession::setBridge, this, bridge, listener);
+    enqueueSessionWork(new GeneralAMDSessionOperation<SessionInfoPtr, AMD_Session_setBridgePtr>(func, cb));
 }
 
 SessionInfoPtr SipSession::setBridge(
@@ -1150,7 +1171,9 @@ void SipSession::removeBridge_async(
         const Ice::Current&)
 {
     lg(Debug) << "queuing a removeBridge operation";
-    enqueueSessionWork(new RemoveBridgeOperation(cb, listener, this));
+    boost::function<void()> func =
+        boost::bind(&SipSession::removeBridge, this, listener);
+    enqueueSessionWork(new GeneralAMDSessionOperation<void, AMD_Session_removeBridgePtr>(func, cb));
 }
 
 void SipSession::removeBridge(const SessionListenerPrx& listener)
@@ -1171,7 +1194,9 @@ void SipSession::removeBridge(const SessionListenerPrx& listener)
 void SipSession::removeListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current&)
 {
     lg(Debug) << "removeListener called. Queuing operation";
-    enqueueSessionWork(new RemoveListenerOperation(listener, this));
+    boost::function<void()> func =
+        boost::bind(&SipSession::removeListener, this, listener);
+    enqueueSessionWork(new GeneralSessionOperation(func));
 }
 
 void SipSession::removeListener(const SessionListenerPrx& listener)
@@ -1179,7 +1204,6 @@ void SipSession::removeListener(const SessionListenerPrx& listener)
     mImplPriv->removeListener(listener);
 }
 
-
 /**
  * An implementation of the start method as defined in SessionCommunications.ice which sends
  * an INVITE with SDP to the SIP endpoint.
@@ -1187,7 +1211,9 @@ void SipSession::removeListener(const SessionListenerPrx& listener)
 void SipSession::start(const Ice::Current&)
 {
     lg(Debug) << "We've been asked to start a session.";
-    enqueueSessionWork(new StartOperation(this));
+    boost::function<void()> func =
+        boost::bind(&SipSession::start, this);
+    enqueueSessionWork(new GeneralSessionOperation(func));
 }
 
 void SipSession::start()
@@ -1220,7 +1246,9 @@ void SipSession::start()
 void SipSession::stop(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& response, const Ice::Current&)
 {
     lg(Debug) << "queuing a stop operation";
-    enqueueSessionWork(new StopOperation(response, this));
+    boost::function<void()> func =
+        boost::bind(&SipSession::stop, this, response);
+    enqueueSessionWork(new GeneralSessionOperation(func));
 }
 
 void SipSession::stop(const ResponseCodePtr& response)
@@ -1252,13 +1280,15 @@ void SipSession::stop(const ResponseCodePtr& response)
 void SipSession::setCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookies, const Ice::Current&)
 {
     lg(Debug) << "queuing a setCookies operation";
-    enqueueSessionWork(new SetCookiesOperation(cookies, this));
+    boost::function<void()> func =
+        boost::bind(&SipSession::setTheCookies, this, cookies);
+    enqueueSessionWork(new GeneralSessionOperation(func));
 }
 
 /**
  * Typically called from queued operations
  */
-void SipSession::setCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookies)
+void SipSession::setTheCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookies)
 {
    for (AsteriskSCF::SessionCommunications::V1::SessionCookies::const_iterator i = cookies.begin();
         i != cookies.end();
@@ -1291,7 +1321,9 @@ void SipSession::setCookies(const AsteriskSCF::SessionCommunications::V1::Sessio
 void SipSession::removeCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookieTypes, const Ice::Current&)
 {
     lg(Debug) << "queuing a removeCookies operation";
-    enqueueSessionWork(new RemoveCookiesOperation(cookieTypes, this));
+    boost::function<void()> func =
+        boost::bind(&SipSession::removeCookies, this, cookieTypes);
+    enqueueSessionWork(new GeneralSessionOperation(func));
 }
 
 void SipSession::removeCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookieTypes)
@@ -1365,7 +1397,9 @@ void SipSession::getSources_async(
         const AsteriskSCF::SessionCommunications::V1::AMD_TelephonySession_getSourcesPtr& cb,
         const Ice::Current&)
 {
-    enqueueSessionWork(new GetSources(cb, this));
+    boost::function<TelephonyEventSourceSeq()> func =
+        boost::bind(&SipSession::getSources, this);
+    enqueueSessionWork(new GeneralAMDSessionOperation<TelephonyEventSourceSeq, AMD_TelephonySession_getSourcesPtr>(func, cb));
 }
 
 AsteriskSCF::SessionCommunications::V1::TelephonyEventSourceSeq SipSession::getSources()
@@ -1382,7 +1416,9 @@ void SipSession::getSinks_async(
         const AsteriskSCF::SessionCommunications::V1::AMD_TelephonySession_getSinksPtr& cb,
         const Ice::Current&)
 {
-    enqueueSessionWork(new GetSinks(cb, this));
+    boost::function<TelephonyEventSinkSeq()> func =
+        boost::bind(&SipSession::getSinks, this);
+    enqueueSessionWork(new GeneralAMDSessionOperation<TelephonyEventSinkSeq, AMD_TelephonySession_getSinksPtr>(func, cb));
 }
 
 AsteriskSCF::SessionCommunications::V1::TelephonyEventSinkSeq SipSession::getSinks()
@@ -1401,7 +1437,9 @@ AsteriskSCF::SessionCommunications::V1::TelephonyEventSinkSeq SipSession::getSin
 void SipSession::destroy()
 {
     lg(Debug) << "queuing a destroy operation";
-    enqueueSessionWork(new DestroyOperation(this));
+    boost::function<void()> func =
+        boost::bind(&SipSession::queuedDestroy, this);
+    enqueueSessionWork(new GeneralSessionOperation(func));
 }
 
 void SipSession::queuedDestroy()
@@ -2373,6 +2411,11 @@ SipEndpointPtr SipSession::getEndpoint()
     return mImplPriv->mEndpoint;
 }
 
+SessionEndpointPrx SipSession::getEndpointProxy()
+{
+    return getEndpoint()->getEndpointProxy();
+}
+
 /**
  * Internal function which gets the proxy to the session.
  */
diff --git a/src/Session/SipSession.h b/src/Session/SipSession.h
index edf9fe8..7d90774 100644
--- a/src/Session/SipSession.h
+++ b/src/Session/SipSession.h
@@ -225,7 +225,7 @@ public:
      * Also used during session creation when modifications hooks have changed
      * the cookies
      */
-    void setCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies&);
+    void setTheCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies&);
     /**
      * Used during replication
      */
@@ -324,6 +324,8 @@ public:
 
     SipEndpointPtr getEndpoint();
 
+    AsteriskSCF::SessionCommunications::V1::SessionEndpointPrx getEndpointProxy();
+
     AsteriskSCF::SessionCommunications::V1::SessionPrx& getSessionProxy();
 
     AsteriskSCF::Media::V1::SessionPrx& getMediaSessionProxy();
diff --git a/src/Session/SipSessionOperations.cpp b/src/Session/SipSessionOperations.cpp
deleted file mode 100644
index 5116c1f..0000000
--- a/src/Session/SipSessionOperations.cpp
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Asterisk SCF -- An open-source communications framework.
- *
- * Copyright (C) 2011, Digium, Inc.
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk SCF project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE.txt file
- * at the top of the source tree.
- */
-
-#include "Session/SipSessionOperations.h"
-#include "SipEndpoint.h"
-
-using namespace AsteriskSCF::System::Logging;
-
-namespace
-{
-Logger lg = getLoggerFactory().getLogger("AsteriskSCF.SipSessionManager");
-}
-
-namespace AsteriskSCF
-{
-
-namespace SipSessionManager
-{
-
-using namespace AsteriskSCF::System::WorkQueue::V1;
-using namespace AsteriskSCF::SessionCommunications::V1;
-
-DestroyOperation::DestroyOperation(const SipSessionPtr& session)
-    : mSession(session) { }
-
-SuspendableWorkResult DestroyOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    mSession->queuedDestroy();
-    return Complete;
-}
-
-AddListenerOperation::AddListenerOperation(
-        const AMD_Session_addListenerPtr& cb,
-        const SessionListenerPrx& listener,
-        const SipSessionPtr& session)
-    : mCb(cb), mListener(listener), mSession(session) { }
-
-SuspendableWorkResult AddListenerOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    lg(Debug) << "Executing addListener operation";
-    mCb->ice_response(mSession->addListener(mListener));
-    return Complete;
-}
-
-IndicateOperation::IndicateOperation(
-        const AMD_Session_indicatePtr& cb,
-        const IndicationPtr& indication,
-        const SipSessionPtr& session)
-    : mCb(cb), mIndication(indication), mSession(session) { }
-
-SuspendableWorkResult IndicateOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    lg(Debug) << "Executing indicate operation";
-    mSession->indicate(mIndication);
-    mCb->ice_response();
-    return Complete;
-}
-
-GetEndpointOperation::GetEndpointOperation(
-        const AMD_Session_getEndpointPtr& cb,
-        const SipSessionPtr& session)
-    : mCb(cb), mSession(session) { }
-
-SuspendableWorkResult GetEndpointOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    lg(Debug) << "Executing a getEndpoint Operation";
-    mCb->ice_response(mSession->getEndpoint()->getEndpointProxy());
-    return Complete;
-}
-
-GetInfoOperation::GetInfoOperation(
-        const AMD_Session_getInfoPtr& cb,
-        const SipSessionPtr& session)
-    : mCb(cb), mSession(session) { }
-
-SuspendableWorkResult GetInfoOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    lg(Debug) << "Executing a GetInfo operation";
-    mCb->ice_response(mSession->getInfo());
-    return Complete;
-}
-
-GetMediaSessionOperation::GetMediaSessionOperation(
-        const AMD_Session_getMediaSessionPtr& cb,
-        const SipSessionPtr& session)
-    : mCb(cb), mSession(session) { }
-
-SuspendableWorkResult GetMediaSessionOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    lg(Debug) << "Executing a GetMediaSession operation";
-    mCb->ice_response(mSession->getMediaSessionProxy());
-    return Complete;
-}
-
-GetBridgeOperation::GetBridgeOperation(const AMD_Session_getBridgePtr& cb,
-        const SipSessionPtr& session)
-    : mCb(cb), mSession(session) { }
-
-SuspendableWorkResult GetBridgeOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    lg(Debug) << "Executing a GetBridge operation";
-    BridgePrx bridge;
-    try
-    {
-        bridge = mSession->getBridge();
-    }
-    catch (const AsteriskSCF::SessionCommunications::V1::NotBridged& ex)
-    {
-        mCb->ice_exception(ex);
-        return Complete;
-    }
-    mCb->ice_response(bridge);
-    return Complete;
-}
-
-GetStreamsOperation::GetStreamsOperation(const AMD_Session_getStreamsPtr& cb,
-        const SipSessionPtr& session)
-    : mCb(cb), mSession(session) { }
-
-SuspendableWorkResult GetStreamsOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    lg(Debug) << "Executing a GetStreams operation";
-    mCb->ice_response(mSession->getStreams());
-    return Complete;
-}
-
-SetAndGetSessionControllerOperation::SetAndGetSessionControllerOperation(const AMD_Session_setAndGetSessionControllerPtr& cb,
-        const SessionControllerPrx& controller,
-        const SipSessionPtr& session)
-    : mCb(cb), mController(controller), mSession(session) { }
-
-SuspendableWorkResult SetAndGetSessionControllerOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    lg(Debug) << "Executing a SetAndGetSessionController operation";
-    
-    SessionControllerPrx toReturn;
-    try
-    {
-        toReturn = mSession->setAndGetSessionController(mController);
-        mCb->ice_response(toReturn);
-    }
-    catch (const std::exception& ex)
-    {
-        mCb->ice_exception(ex);
-    }
-    return Complete;
-}
-
-RemoveSessionControllerOperation::RemoveSessionControllerOperation(
-        const AMD_Session_removeSessionControllerPtr& cb,
-        const SessionControllerPrx& controller,
-        const SipSessionPtr& session)
-    : mCb(cb), mController(controller), mSession(session) { }
-
-SuspendableWorkResult RemoveSessionControllerOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    lg(Debug) << "Executing a RemoveSessionController operation";
-
-    mSession->removeSessionController(mController);
-    mCb->ice_response();
-    return Complete;
-}
-
-SetBridgeOperation::SetBridgeOperation(
-        const AMD_Session_setBridgePtr& cb,
-        const BridgePrx& bridge,
-        const SessionListenerPrx& listener,
-        const SipSessionPtr& session)
-    : mCb(cb), mBridge(bridge), mListener(listener), mSession(session) { }
-
-SuspendableWorkResult SetBridgeOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    lg(Debug) << "Executing a SetBridge operation";
-    mCb->ice_response(mSession->setBridge(mBridge, mListener));
-    return Complete;
-}
-
-RemoveBridgeOperation::RemoveBridgeOperation(
-        const AMD_Session_removeBridgePtr& cb,
-        const SessionListenerPrx& listener,
-        const SipSessionPtr& session)
-    : mCb(cb), mListener(listener), mSession(session){ }
-
-SuspendableWorkResult RemoveBridgeOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    lg(Debug) << "Executing a removeBridge operation";
-
-    try
-    {
-        mSession->removeBridge(mListener);
-        mCb->ice_response();
-    }
-    catch (const Ice::Exception& ex)
-    {
-        mCb->ice_exception(ex);
-    }
-    return Complete;
-}
-
-RemoveListenerOperation::RemoveListenerOperation(
-        const SessionListenerPrx& listener,
-        const SipSessionPtr& session)
-    : mListener(listener), mSession(session) { }
-
-SuspendableWorkResult RemoveListenerOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    lg(Debug) << "Actually removing listener";
-    mSession->removeListener(mListener);
-    return Complete;
-}
-
-StartOperation::StartOperation(const SipSessionPtr& session)
-    : mSession(session) { }
-
-SuspendableWorkResult StartOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    lg(Debug) << "Executing a start operation";
-    mSession->start();
-    return Complete;
-}
-
-StopOperation::StopOperation(const ResponseCodePtr response,
-        const SipSessionPtr& session)
-    : mResponse(response), mSession(session) { }
-
-SuspendableWorkResult StopOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    mSession->stop(mResponse);
-    return Complete;
-}
-
-SetCookiesOperation::SetCookiesOperation(const SessionCookies& cookies,
-                    const SipSessionPtr& session)
-    : mCookies(cookies), mSession(session) { }
-
-SuspendableWorkResult SetCookiesOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    mSession->setCookies(mCookies);
-    return Complete;
-}
-
-RemoveCookiesOperation::RemoveCookiesOperation(const SessionCookies& cookieTypes,
-        const SipSessionPtr& session)
-    : mCookieTypes(cookieTypes), mSession(session) { }
-
-SuspendableWorkResult RemoveCookiesOperation::execute(const SuspendableWorkListenerPtr&)
-{
-    mSession->removeCookies(mCookieTypes);
-    return Complete;
-}
-
-GetSources::GetSources(
-        const AMD_TelephonySession_getSourcesPtr& cb,
-        const SipSessionPtr& session)
-    : mCB(cb), mSession(session) { }
-
-SuspendableWorkResult GetSources::execute(const SuspendableWorkListenerPtr&)
-{
-    mCB->ice_response(mSession->getSources());
-    return Complete;
-}
-
-GetSinks::GetSinks(
-        const AMD_TelephonySession_getSinksPtr& cb,
-        const SipSessionPtr& session)
-    : mCB(cb), mSession(session) { }
-
-SuspendableWorkResult GetSinks::execute(const SuspendableWorkListenerPtr&)
-{
-    mCB->ice_response(mSession->getSinks());
-    return Complete;
-}
-
-}
-}
diff --git a/src/Session/SipSessionOperations.h b/src/Session/SipSessionOperations.h
index 8e839c1..b05db5d 100644
--- a/src/Session/SipSessionOperations.h
+++ b/src/Session/SipSessionOperations.h
@@ -16,6 +16,8 @@
 
 #pragma once
 
+#include <boost/function.hpp>
+
 #include <AsteriskSCF/System/WorkQueue/WorkQueueIf.h>
 #include "Session/SipSession.h"
 
@@ -25,274 +27,70 @@ namespace AsteriskSCF
 namespace SipSessionManager
 {
 
-/**
- * Internal function called to destroy an endpoint. This is controlled by signaling.
- */
-class DestroyOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
-{
-public:
-    DestroyOperation(const SipSessionPtr& session);
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-private:
-    SipSessionPtr mSession;
-};
-
-class AddListenerOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
-{
-public:
-    AddListenerOperation(
-            const AsteriskSCF::SessionCommunications::V1::AMD_Session_addListenerPtr& cb,
-            const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
-            const SipSessionPtr& session);
-
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-
-private:
-    AsteriskSCF::SessionCommunications::V1::AMD_Session_addListenerPtr mCb;
-    AsteriskSCF::SessionCommunications::V1::SessionListenerPrx mListener;
-    SipSessionPtr mSession;
-};
-
-class IndicateOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
-{
-public:
-    IndicateOperation(
-            const AsteriskSCF::SessionCommunications::V1::AMD_Session_indicatePtr& cb,
-            const AsteriskSCF::SessionCommunications::V1::IndicationPtr& indication,
-            const SipSessionPtr& session);
-
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-
-private:
-    AsteriskSCF::SessionCommunications::V1::AMD_Session_indicatePtr mCb;
-    AsteriskSCF::SessionCommunications::V1::IndicationPtr mIndication;
-    SipSessionPtr mSession;
-};
-
-class GetEndpointOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
-{
-public:
-    GetEndpointOperation(
-            const AsteriskSCF::SessionCommunications::V1::AMD_Session_getEndpointPtr& cb,
-            const SipSessionPtr& session);
-
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-
-private:
-    AsteriskSCF::SessionCommunications::V1::AMD_Session_getEndpointPtr mCb;
-    SipSessionPtr mSession;
-};
-
-class GetInfoOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
-{
-public:
-    GetInfoOperation(
-            const AsteriskSCF::SessionCommunications::V1::AMD_Session_getInfoPtr& cb,
-            const SipSessionPtr& session);
-
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-
-private:
-    AsteriskSCF::SessionCommunications::V1::AMD_Session_getInfoPtr mCb;
-    SipSessionPtr mSession;
-};
-
-class GetMediaSessionOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
-{
-public:
-    GetMediaSessionOperation(
-            const AsteriskSCF::SessionCommunications::V1::AMD_Session_getMediaSessionPtr& cb,
-            const SipSessionPtr& session);
-
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-
-private:
-    AsteriskSCF::SessionCommunications::V1::AMD_Session_getMediaSessionPtr mCb;
-    SipSessionPtr mSession;
-};
-
-class GetBridgeOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
-{
-public:
-    GetBridgeOperation(const AsteriskSCF::SessionCommunications::V1::AMD_Session_getBridgePtr& cb,
-            const SipSessionPtr& session);
-
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-
-private:
-    AsteriskSCF::SessionCommunications::V1::AMD_Session_getBridgePtr mCb;
-    SipSessionPtr mSession;
-};
-
-class GetStreamsOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
-{
-public:
-    GetStreamsOperation(const AsteriskSCF::SessionCommunications::V1::AMD_Session_getStreamsPtr& cb,
-            const SipSessionPtr& session);
-
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-
-private:
-    AsteriskSCF::SessionCommunications::V1::AMD_Session_getStreamsPtr mCb;
-    SipSessionPtr mSession;
-};
-
-class SetAndGetSessionControllerOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
-{
-public:
-    SetAndGetSessionControllerOperation(
-            const AsteriskSCF::SessionCommunications::V1::AMD_Session_setAndGetSessionControllerPtr& cb,
-            const AsteriskSCF::SessionCommunications::V1::SessionControllerPrx& controller,
-            const SipSessionPtr& session);
-
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-    
-private:
-    AsteriskSCF::SessionCommunications::V1::AMD_Session_setAndGetSessionControllerPtr mCb;
-    AsteriskSCF::SessionCommunications::V1::SessionControllerPrx mController;
-    SipSessionPtr mSession;
-};
-
-class RemoveSessionControllerOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
-{
-public:
-    RemoveSessionControllerOperation(
-            const AsteriskSCF::SessionCommunications::V1::AMD_Session_removeSessionControllerPtr& cb,
-            const AsteriskSCF::SessionCommunications::V1::SessionControllerPrx& controller,
-            const SipSessionPtr& session);
-
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-
-private:
-    AsteriskSCF::SessionCommunications::V1::AMD_Session_removeSessionControllerPtr mCb;
-    AsteriskSCF::SessionCommunications::V1::SessionControllerPrx mController;
-    SipSessionPtr mSession;
-};
-
-class SetBridgeOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
-{
-public:
-    SetBridgeOperation(
-            const AsteriskSCF::SessionCommunications::V1::AMD_Session_setBridgePtr& cb,
-            const AsteriskSCF::SessionCommunications::V1::BridgePrx& bridge,
-            const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
-            const SipSessionPtr& session);
-    
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-
-private:
-    AsteriskSCF::SessionCommunications::V1::AMD_Session_setBridgePtr mCb;
-    AsteriskSCF::SessionCommunications::V1::BridgePrx mBridge;
-    AsteriskSCF::SessionCommunications::V1::SessionListenerPrx mListener;
-    SipSessionPtr mSession;
-};
-
-class RemoveBridgeOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
-{
-public:
-    RemoveBridgeOperation(
-            const AsteriskSCF::SessionCommunications::V1::AMD_Session_removeBridgePtr& cb,
-            const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
-            const SipSessionPtr& session);
-
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-    
-private:
-    AsteriskSCF::SessionCommunications::V1::AMD_Session_removeBridgePtr mCb;
-    AsteriskSCF::SessionCommunications::V1::SessionListenerPrx mListener;
-    SipSessionPtr mSession;
-};
-
-class RemoveListenerOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
-{
-public:
-    RemoveListenerOperation(
-            const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
-            const SipSessionPtr& session);
-
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-    
-private:
-    AsteriskSCF::SessionCommunications::V1::SessionListenerPrx mListener;
-    SipSessionPtr mSession;
-};
-
-class StartOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
-{
-public:
-    StartOperation(const SipSessionPtr& session);
-
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-
-private:
-    SipSessionPtr mSession;
-};
-
-class StopOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+template<class F, class A>
+class GeneralAMDSessionOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
 {
 public:
-    StopOperation(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr response,
-            const SipSessionPtr& session);
+    GeneralAMDSessionOperation(boost::function<F()> function,
+            const A& cb)
+        : mFunction(function), mCB(cb) { }
 
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-    
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&)
+    {
+        try
+        {
+            mCB->ice_response(mFunction());
+        }
+        catch (const Ice::Exception& ex)
+        {
+            mCB->ice_exception(ex);
+        }
+        return AsteriskSCF::System::WorkQueue::V1::Complete;
+    }
 private:
-    AsteriskSCF::SessionCommunications::V1::ResponseCodePtr mResponse;
-    SipSessionPtr mSession;
+    boost::function<F()> mFunction;
+    A mCB;
 };
 
-class SetCookiesOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+template<class A>
+class GeneralAMDSessionOperation<void, A> : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
 {
 public:
-    SetCookiesOperation(const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookies,
-                        const SipSessionPtr& session);
-
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-    
-private:
-    AsteriskSCF::SessionCommunications::V1::SessionCookies mCookies;
-    SipSessionPtr mSession;
-};
-
-class RemoveCookiesOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
-{
-public:
-    RemoveCookiesOperation(const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookieTypes,
-            const SipSessionPtr& session);
-
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-
-private:
-    AsteriskSCF::SessionCommunications::V1::SessionCookies mCookieTypes;
-    SipSessionPtr mSession;
-};
-
-class GetSources : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
-{
-public:
-    GetSources(
-            const AsteriskSCF::SessionCommunications::V1::AMD_TelephonySession_getSourcesPtr& cb,
-            const SipSessionPtr& session);
-
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+    GeneralAMDSessionOperation(boost::function<void()> function,
+            const A& cb)
+        : mFunction(function), mCB(cb) { }
 
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&)
+    {
+        try
+        {
+            mFunction();
+            mCB->ice_response();
+        }
+        catch (const Ice::Exception& ex)
+        {
+            mCB->ice_exception(ex);
+        }
+        return AsteriskSCF::System::WorkQueue::V1::Complete;
+    }
 private:
-    AsteriskSCF::SessionCommunications::V1::AMD_TelephonySession_getSourcesPtr mCB;
-    SipSessionPtr mSession;
+    boost::function<void()> mFunction;
+    A mCB;
 };
 
-class GetSinks : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+class GeneralSessionOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
 {
 public:
-    GetSinks(
-            const AsteriskSCF::SessionCommunications::V1::AMD_TelephonySession_getSinksPtr& cb,
-            const SipSessionPtr& session);
+    GeneralSessionOperation(boost::function<void()> function)
+        : mFunction(function) { }
 
-    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
-    
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&)
+    {
+        mFunction();
+        return AsteriskSCF::System::WorkQueue::V1::Complete;
+    }
 private:
-    AsteriskSCF::SessionCommunications::V1::AMD_TelephonySession_getSinksPtr mCB;
-    SipSessionPtr mSession;
+    boost::function<void()> mFunction;
 };
 
 }

commit f37a3cc07e0c31573506654b550f7ee41924477c
Author: Mark Michelson <mmichelson at digium.com>
Date:   Sun Aug 28 10:10:09 2011 -0500

    Finish up the Session operation moving.

diff --git a/src/Session/SipSession.cpp b/src/Session/SipSession.cpp
index 9aaeaa7..c5da94a 100755
--- a/src/Session/SipSession.cpp
+++ b/src/Session/SipSession.cpp
@@ -1213,42 +1213,6 @@ void SipSession::start()
     pjsip_inv_send_msg(mImplPriv->mInviteSession, packet);
 }
 
-class StopOperation : public SuspendableWork
-{
-public:
-    StopOperation(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr response,
-            pjsip_inv_session *inv)
-        : mResponse(response), mInviteSession(inv) { }
-
-    SuspendableWorkResult execute(const SuspendableWorkListenerPtr&)
-    {
-        pjsip_tx_data *packet;
-        // Assume a 503 until proven otherwise
-        unsigned int code = 503;
-
-        // TODO: Convert ALL response codes to equivalent SIP ones, and allow configuration to change it
-        if (mResponse->isdnCode == 17)
-        {
-            code = 486;
-        }
-
-        // We have to check the existence of packet due to an edge case that we can trigger here.
-        // On an outbound call, if we have not received a provisional response yet, then PJSIP will
-        // set packet NULL but still return PJ_SUCCESS. In this case, if we attempt to call pjsip_inv_send_msg,
-        // then we will trigger an assertion since the packet we pass in is NULL.
-        if (mInviteSession && (pjsip_inv_end_session(mInviteSession, code, NULL, &packet) == PJ_SUCCESS) && packet)
-        {
-            pjsip_inv_send_msg(mInviteSession, packet);
-        }
-
-        return Complete;
-    }
-
-private:
-    AsteriskSCF::SessionCommunications::V1::ResponseCodePtr mResponse;
-    pjsip_inv_session *mInviteSession;
-};
-
 /**
  * An implementation of the stop method as defined in SessionCommunications.ice which sends
  * a BYE or applicable response code to the SIP endpoint depending upon the state of the dialog.
@@ -1256,26 +1220,30 @@ private:
 void SipSession::stop(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& response, const Ice::Current&)
 {
     lg(Debug) << "queuing a stop operation";
-    enqueueSessionWork(new StopOperation(response, mImplPriv->mInviteSession));
+    enqueueSessionWork(new StopOperation(response, this));
 }
 
-class SetCookiesOperation : public SuspendableWork
+void SipSession::stop(const ResponseCodePtr& response)
 {
-public:
-    SetCookiesOperation(const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookies,
-                        const SipSessionPtr& session)
-        : mCookies(cookies), mSession(session) { }
+    pjsip_tx_data *packet;
+    // Assume a 503 until proven otherwise
+    unsigned int code = 503;
 
-    SuspendableWorkResult execute(const SuspendableWorkListenerPtr&)
+    // TODO: Convert ALL response codes to equivalent SIP ones, and allow configuration to change it
+    if (response->isdnCode == 17)
     {
-        mSession->setCookies(mCookies);
-        return Complete;
+        code = 486;
     }
 
-private:
-    AsteriskSCF::SessionCommunications::V1::SessionCookies mCookies;
-    SipSessionPtr mSession;
-};
+    // We have to check the existence of packet due to an edge case that we can trigger here.
+    // On an outbound call, if we have not received a provisional response yet, then PJSIP will
+    // set packet NULL but still return PJ_SUCCESS. In this case, if we attempt to call pjsip_inv_send_msg,
+    // then we will trigger an assertion since the packet we pass in is NULL.
+    if (mImplPriv->mInviteSession && (pjsip_inv_end_session(mImplPriv->mInviteSession, code, NULL, &packet) == PJ_SUCCESS) && packet)
+    {
+        pjsip_inv_send_msg(mImplPriv->mInviteSession, packet);
+    }
+}
 
 /**
  * An implementation of the setCookies method as defined in SessionCommunications.ice which sets cookies
@@ -1316,37 +1284,6 @@ void SipSession::setCookies(const AsteriskSCF::SessionCommunications::V1::Sessio
     mImplPriv->mSessionCookies = cookies;
 }
 
-class RemoveCookiesOperation : public SuspendableWork
-{
-public:
-    RemoveCookiesOperation(const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookieTypes,
-                        const boost::shared_ptr<SipSessionPriv>& sessionPriv)
-        : mCookieTypes(cookieTypes), mImplPriv(sessionPriv) { }
-
-    SuspendableWorkResult execute(const SuspendableWorkListenerPtr&)
-        {
-            for (AsteriskSCF::SessionCommunications::V1::SessionCookies::const_iterator i = mCookieTypes.begin();
-                 i != mCookieTypes.end();
-                 ++i)
-            {
-                mImplPriv->mSessionCookies.erase((*i)->ice_id());
-            }
-
-            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);
-                mImplPriv->mManager->getSessionModule()->replicateState(NULL, NULL, session_mod_info);
-            }
-
-            return Complete;
-        }
-
-private:
-    AsteriskSCF::SessionCommunications::V1::SessionCookies mCookieTypes;
-    boost::shared_ptr<SipSessionPriv> mImplPriv;
-};
-
 /**
  * An implementation of the removeCookies method as defined in SessionCommunications.ice which removes specific
  * cookies from the session.
@@ -1354,7 +1291,24 @@ private:
 void SipSession::removeCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookieTypes, const Ice::Current&)
 {
     lg(Debug) << "queuing a removeCookies operation";
-    enqueueSessionWork(new RemoveCookiesOperation(cookieTypes, mImplPriv));
+    enqueueSessionWork(new RemoveCookiesOperation(cookieTypes, this));
+}
+
+void SipSession::removeCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookieTypes)
+{
+    for (AsteriskSCF::SessionCommunications::V1::SessionCookies::const_iterator i = cookieTypes.begin();
+         i != cookieTypes.end();
+         ++i)
+    {
+        mImplPriv->mSessionCookies.erase((*i)->ice_id());
+    }
+
+    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);
+        mImplPriv->mManager->getSessionModule()->replicateState(NULL, NULL, session_mod_info);
+    }
 }
 
 /**
@@ -1407,24 +1361,6 @@ AsteriskSCF::SessionCommunications::V1::SessionCookieDict SipSession::getAllCook
     return mImplPriv->mSessionCookies;
 }
 
-class GetSources : public SuspendableWork
-{
-public:
-    GetSources(
-            const AsteriskSCF::SessionCommunications::V1::AMD_TelephonySession_getSourcesPtr& cb,
-            const SipSessionPtr& session)
-        : mCB(cb), mSession(session) { }
-
-    SuspendableWorkResult execute(const SuspendableWorkListenerPtr&)
-    {
-        mCB->ice_response(mSession->getSources());
-        return Complete;
-    }
-private:
-    AsteriskSCF::SessionCommunications::V1::AMD_TelephonySession_getSourcesPtr mCB;
-    SipSessionPtr mSession;
-};
-
 void SipSession::getSources_async(
         const AsteriskSCF::SessionCommunications::V1::AMD_TelephonySession_getSourcesPtr& cb,
         const Ice::Current&)
@@ -1442,24 +1378,6 @@ AsteriskSCF::SessionCommunications::V1::TelephonyEventSourceSeq SipSession::getS
     return sources;
 }
 
-class GetSinks : public SuspendableWork
-{
-public:
-    GetSinks(
-            const AsteriskSCF::SessionCommunications::V1::AMD_TelephonySession_getSinksPtr& cb,
-            const SipSessionPtr& session)
-        : mCB(cb), mSession(session) { }
-
-    SuspendableWorkResult execute(const SuspendableWorkListenerPtr&)
-    {
-        mCB->ice_response(mSession->getSinks());
-        return Complete;
-    }
-private:
-    AsteriskSCF::SessionCommunications::V1::AMD_TelephonySession_getSinksPtr mCB;
-    SipSessionPtr mSession;
-};
-
 void SipSession::getSinks_async(
         const AsteriskSCF::SessionCommunications::V1::AMD_TelephonySession_getSinksPtr& cb,
         const Ice::Current&)
diff --git a/src/Session/SipSession.h b/src/Session/SipSession.h
index a6f2436..edf9fe8 100644
--- a/src/Session/SipSession.h
+++ b/src/Session/SipSession.h
@@ -217,6 +217,7 @@ public:
     void start();
 
     void stop(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&, const Ice::Current&);
+    void stop(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&);
     void unhold(const Ice::Current&);
     void setCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies&, const Ice::Current&);
     /**
@@ -230,6 +231,7 @@ public:
      */
     void setCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookieDict&);
     void removeCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies&, const Ice::Current&);
+    void removeCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies&);
     AsteriskSCF::SessionCommunications::V1::SessionCookies getCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies&, const Ice::Current&);
     AsteriskSCF::SessionCommunications::V1::SessionCookies getCookies();
     AsteriskSCF::SessionCommunications::V1::SessionCookieDict getAllCookies();
diff --git a/src/Session/SipSessionOperations.cpp b/src/Session/SipSessionOperations.cpp
new file mode 100644
index 0000000..5116c1f
--- /dev/null
+++ b/src/Session/SipSessionOperations.cpp
@@ -0,0 +1,288 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2011, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#include "Session/SipSessionOperations.h"
+#include "SipEndpoint.h"
+
+using namespace AsteriskSCF::System::Logging;
+
+namespace
+{
+Logger lg = getLoggerFactory().getLogger("AsteriskSCF.SipSessionManager");
+}
+
+namespace AsteriskSCF
+{
+
+namespace SipSessionManager
+{
+
+using namespace AsteriskSCF::System::WorkQueue::V1;
+using namespace AsteriskSCF::SessionCommunications::V1;
+
+DestroyOperation::DestroyOperation(const SipSessionPtr& session)
+    : mSession(session) { }
+
+SuspendableWorkResult DestroyOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    mSession->queuedDestroy();
+    return Complete;
+}
+
+AddListenerOperation::AddListenerOperation(
+        const AMD_Session_addListenerPtr& cb,
+        const SessionListenerPrx& listener,
+        const SipSessionPtr& session)
+    : mCb(cb), mListener(listener), mSession(session) { }
+
+SuspendableWorkResult AddListenerOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    lg(Debug) << "Executing addListener operation";
+    mCb->ice_response(mSession->addListener(mListener));
+    return Complete;
+}
+
+IndicateOperation::IndicateOperation(
+        const AMD_Session_indicatePtr& cb,
+        const IndicationPtr& indication,
+        const SipSessionPtr& session)
+    : mCb(cb), mIndication(indication), mSession(session) { }
+
+SuspendableWorkResult IndicateOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    lg(Debug) << "Executing indicate operation";
+    mSession->indicate(mIndication);
+    mCb->ice_response();
+    return Complete;
+}
+
+GetEndpointOperation::GetEndpointOperation(
+        const AMD_Session_getEndpointPtr& cb,
+        const SipSessionPtr& session)
+    : mCb(cb), mSession(session) { }
+
+SuspendableWorkResult GetEndpointOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    lg(Debug) << "Executing a getEndpoint Operation";
+    mCb->ice_response(mSession->getEndpoint()->getEndpointProxy());
+    return Complete;
+}
+
+GetInfoOperation::GetInfoOperation(
+        const AMD_Session_getInfoPtr& cb,
+        const SipSessionPtr& session)
+    : mCb(cb), mSession(session) { }
+
+SuspendableWorkResult GetInfoOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    lg(Debug) << "Executing a GetInfo operation";
+    mCb->ice_response(mSession->getInfo());
+    return Complete;
+}
+
+GetMediaSessionOperation::GetMediaSessionOperation(
+        const AMD_Session_getMediaSessionPtr& cb,
+        const SipSessionPtr& session)
+    : mCb(cb), mSession(session) { }
+
+SuspendableWorkResult GetMediaSessionOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    lg(Debug) << "Executing a GetMediaSession operation";
+    mCb->ice_response(mSession->getMediaSessionProxy());
+    return Complete;
+}
+
+GetBridgeOperation::GetBridgeOperation(const AMD_Session_getBridgePtr& cb,
+        const SipSessionPtr& session)
+    : mCb(cb), mSession(session) { }
+
+SuspendableWorkResult GetBridgeOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    lg(Debug) << "Executing a GetBridge operation";
+    BridgePrx bridge;
+    try
+    {
+        bridge = mSession->getBridge();
+    }
+    catch (const AsteriskSCF::SessionCommunications::V1::NotBridged& ex)
+    {
+        mCb->ice_exception(ex);
+        return Complete;
+    }
+    mCb->ice_response(bridge);
+    return Complete;
+}
+
+GetStreamsOperation::GetStreamsOperation(const AMD_Session_getStreamsPtr& cb,
+        const SipSessionPtr& session)
+    : mCb(cb), mSession(session) { }
+
+SuspendableWorkResult GetStreamsOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    lg(Debug) << "Executing a GetStreams operation";
+    mCb->ice_response(mSession->getStreams());
+    return Complete;
+}
+
+SetAndGetSessionControllerOperation::SetAndGetSessionControllerOperation(const AMD_Session_setAndGetSessionControllerPtr& cb,
+        const SessionControllerPrx& controller,
+        const SipSessionPtr& session)
+    : mCb(cb), mController(controller), mSession(session) { }
+
+SuspendableWorkResult SetAndGetSessionControllerOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    lg(Debug) << "Executing a SetAndGetSessionController operation";
+    
+    SessionControllerPrx toReturn;
+    try
+    {
+        toReturn = mSession->setAndGetSessionController(mController);
+        mCb->ice_response(toReturn);
+    }
+    catch (const std::exception& ex)
+    {
+        mCb->ice_exception(ex);
+    }
+    return Complete;
+}
+
+RemoveSessionControllerOperation::RemoveSessionControllerOperation(
+        const AMD_Session_removeSessionControllerPtr& cb,
+        const SessionControllerPrx& controller,
+        const SipSessionPtr& session)
+    : mCb(cb), mController(controller), mSession(session) { }
+
+SuspendableWorkResult RemoveSessionControllerOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    lg(Debug) << "Executing a RemoveSessionController operation";
+
+    mSession->removeSessionController(mController);
+    mCb->ice_response();
+    return Complete;
+}
+
+SetBridgeOperation::SetBridgeOperation(
+        const AMD_Session_setBridgePtr& cb,
+        const BridgePrx& bridge,
+        const SessionListenerPrx& listener,
+        const SipSessionPtr& session)
+    : mCb(cb), mBridge(bridge), mListener(listener), mSession(session) { }
+
+SuspendableWorkResult SetBridgeOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    lg(Debug) << "Executing a SetBridge operation";
+    mCb->ice_response(mSession->setBridge(mBridge, mListener));
+    return Complete;
+}
+
+RemoveBridgeOperation::RemoveBridgeOperation(
+        const AMD_Session_removeBridgePtr& cb,
+        const SessionListenerPrx& listener,
+        const SipSessionPtr& session)
+    : mCb(cb), mListener(listener), mSession(session){ }
+
+SuspendableWorkResult RemoveBridgeOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    lg(Debug) << "Executing a removeBridge operation";
+
+    try
+    {
+        mSession->removeBridge(mListener);
+        mCb->ice_response();
+    }
+    catch (const Ice::Exception& ex)
+    {
+        mCb->ice_exception(ex);
+    }
+    return Complete;
+}
+
+RemoveListenerOperation::RemoveListenerOperation(
+        const SessionListenerPrx& listener,
+        const SipSessionPtr& session)
+    : mListener(listener), mSession(session) { }
+
+SuspendableWorkResult RemoveListenerOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    lg(Debug) << "Actually removing listener";
+    mSession->removeListener(mListener);
+    return Complete;
+}
+
+StartOperation::StartOperation(const SipSessionPtr& session)
+    : mSession(session) { }
+
+SuspendableWorkResult StartOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    lg(Debug) << "Executing a start operation";
+    mSession->start();
+    return Complete;
+}
+
+StopOperation::StopOperation(const ResponseCodePtr response,
+        const SipSessionPtr& session)
+    : mResponse(response), mSession(session) { }
+
+SuspendableWorkResult StopOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    mSession->stop(mResponse);
+    return Complete;
+}
+
+SetCookiesOperation::SetCookiesOperation(const SessionCookies& cookies,
+                    const SipSessionPtr& session)
+    : mCookies(cookies), mSession(session) { }
+
+SuspendableWorkResult SetCookiesOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    mSession->setCookies(mCookies);
+    return Complete;
+}
+
+RemoveCookiesOperation::RemoveCookiesOperation(const SessionCookies& cookieTypes,
+        const SipSessionPtr& session)
+    : mCookieTypes(cookieTypes), mSession(session) { }
+
+SuspendableWorkResult RemoveCookiesOperation::execute(const SuspendableWorkListenerPtr&)
+{
+    mSession->removeCookies(mCookieTypes);
+    return Complete;
+}
+
+GetSources::GetSources(
+        const AMD_TelephonySession_getSourcesPtr& cb,
+        const SipSessionPtr& session)
+    : mCB(cb), mSession(session) { }
+
+SuspendableWorkResult GetSources::execute(const SuspendableWorkListenerPtr&)
+{
+    mCB->ice_response(mSession->getSources());
+    return Complete;
+}
+
+GetSinks::GetSinks(
+        const AMD_TelephonySession_getSinksPtr& cb,
+        const SipSessionPtr& session)
+    : mCB(cb), mSession(session) { }
+
+SuspendableWorkResult GetSinks::execute(const SuspendableWorkListenerPtr&)
+{
+    mCB->ice_response(mSession->getSinks());
+    return Complete;
+}
+
+}
+}
diff --git a/src/Session/SipSessionOperations.h b/src/Session/SipSessionOperations.h
new file mode 100644
index 0000000..8e839c1
--- /dev/null
+++ b/src/Session/SipSessionOperations.h
@@ -0,0 +1,299 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2011, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#pragma once
+
+#include <AsteriskSCF/System/WorkQueue/WorkQueueIf.h>
+#include "Session/SipSession.h"
+
+namespace AsteriskSCF
+{
+
+namespace SipSessionManager
+{
+
+/**
+ * Internal function called to destroy an endpoint. This is controlled by signaling.
+ */
+class DestroyOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    DestroyOperation(const SipSessionPtr& session);
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+private:
+    SipSessionPtr mSession;
+};
+
+class AddListenerOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    AddListenerOperation(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_addListenerPtr& cb,
+            const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
+            const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+
+private:
+    AsteriskSCF::SessionCommunications::V1::AMD_Session_addListenerPtr mCb;
+    AsteriskSCF::SessionCommunications::V1::SessionListenerPrx mListener;
+    SipSessionPtr mSession;
+};
+
+class IndicateOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    IndicateOperation(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_indicatePtr& cb,
+            const AsteriskSCF::SessionCommunications::V1::IndicationPtr& indication,
+            const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+
+private:
+    AsteriskSCF::SessionCommunications::V1::AMD_Session_indicatePtr mCb;
+    AsteriskSCF::SessionCommunications::V1::IndicationPtr mIndication;
+    SipSessionPtr mSession;
+};
+
+class GetEndpointOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    GetEndpointOperation(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_getEndpointPtr& cb,
+            const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+
+private:
+    AsteriskSCF::SessionCommunications::V1::AMD_Session_getEndpointPtr mCb;
+    SipSessionPtr mSession;
+};
+
+class GetInfoOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    GetInfoOperation(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_getInfoPtr& cb,
+            const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+
+private:
+    AsteriskSCF::SessionCommunications::V1::AMD_Session_getInfoPtr mCb;
+    SipSessionPtr mSession;
+};
+
+class GetMediaSessionOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    GetMediaSessionOperation(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_getMediaSessionPtr& cb,
+            const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+
+private:
+    AsteriskSCF::SessionCommunications::V1::AMD_Session_getMediaSessionPtr mCb;
+    SipSessionPtr mSession;
+};
+
+class GetBridgeOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    GetBridgeOperation(const AsteriskSCF::SessionCommunications::V1::AMD_Session_getBridgePtr& cb,
+            const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+
+private:
+    AsteriskSCF::SessionCommunications::V1::AMD_Session_getBridgePtr mCb;
+    SipSessionPtr mSession;
+};
+
+class GetStreamsOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    GetStreamsOperation(const AsteriskSCF::SessionCommunications::V1::AMD_Session_getStreamsPtr& cb,
+            const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+
+private:
+    AsteriskSCF::SessionCommunications::V1::AMD_Session_getStreamsPtr mCb;
+    SipSessionPtr mSession;
+};
+
+class SetAndGetSessionControllerOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    SetAndGetSessionControllerOperation(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_setAndGetSessionControllerPtr& cb,
+            const AsteriskSCF::SessionCommunications::V1::SessionControllerPrx& controller,
+            const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+    
+private:
+    AsteriskSCF::SessionCommunications::V1::AMD_Session_setAndGetSessionControllerPtr mCb;
+    AsteriskSCF::SessionCommunications::V1::SessionControllerPrx mController;
+    SipSessionPtr mSession;
+};
+
+class RemoveSessionControllerOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    RemoveSessionControllerOperation(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_removeSessionControllerPtr& cb,
+            const AsteriskSCF::SessionCommunications::V1::SessionControllerPrx& controller,
+            const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+
+private:
+    AsteriskSCF::SessionCommunications::V1::AMD_Session_removeSessionControllerPtr mCb;
+    AsteriskSCF::SessionCommunications::V1::SessionControllerPrx mController;
+    SipSessionPtr mSession;
+};
+
+class SetBridgeOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    SetBridgeOperation(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_setBridgePtr& cb,
+            const AsteriskSCF::SessionCommunications::V1::BridgePrx& bridge,
+            const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
+            const SipSessionPtr& session);
+    
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+
+private:
+    AsteriskSCF::SessionCommunications::V1::AMD_Session_setBridgePtr mCb;
+    AsteriskSCF::SessionCommunications::V1::BridgePrx mBridge;
+    AsteriskSCF::SessionCommunications::V1::SessionListenerPrx mListener;
+    SipSessionPtr mSession;
+};
+
+class RemoveBridgeOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    RemoveBridgeOperation(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_removeBridgePtr& cb,
+            const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
+            const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+    
+private:
+    AsteriskSCF::SessionCommunications::V1::AMD_Session_removeBridgePtr mCb;
+    AsteriskSCF::SessionCommunications::V1::SessionListenerPrx mListener;
+    SipSessionPtr mSession;
+};
+
+class RemoveListenerOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    RemoveListenerOperation(
+            const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
+            const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+    
+private:
+    AsteriskSCF::SessionCommunications::V1::SessionListenerPrx mListener;
+    SipSessionPtr mSession;
+};
+
+class StartOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    StartOperation(const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+
+private:
+    SipSessionPtr mSession;
+};
+
+class StopOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    StopOperation(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr response,
+            const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+    
+private:
+    AsteriskSCF::SessionCommunications::V1::ResponseCodePtr mResponse;
+    SipSessionPtr mSession;
+};
+
+class SetCookiesOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    SetCookiesOperation(const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookies,
+                        const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+    
+private:
+    AsteriskSCF::SessionCommunications::V1::SessionCookies mCookies;
+    SipSessionPtr mSession;
+};
+
+class RemoveCookiesOperation : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    RemoveCookiesOperation(const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookieTypes,
+            const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+
+private:
+    AsteriskSCF::SessionCommunications::V1::SessionCookies mCookieTypes;
+    SipSessionPtr mSession;
+};
+
+class GetSources : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    GetSources(
+            const AsteriskSCF::SessionCommunications::V1::AMD_TelephonySession_getSourcesPtr& cb,
+            const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+
+private:
+    AsteriskSCF::SessionCommunications::V1::AMD_TelephonySession_getSourcesPtr mCB;
+    SipSessionPtr mSession;
+};
+
+class GetSinks : public AsteriskSCF::System::WorkQueue::V1::SuspendableWork
+{
+public:
+    GetSinks(
+            const AsteriskSCF::SessionCommunications::V1::AMD_TelephonySession_getSinksPtr& cb,
+            const SipSessionPtr& session);
+
+    AsteriskSCF::System::WorkQueue::V1::SuspendableWorkResult execute(const AsteriskSCF::System::WorkQueue::V1::SuspendableWorkListenerPtr&);
+    
+private:
+    AsteriskSCF::SessionCommunications::V1::AMD_TelephonySession_getSinksPtr mCB;
+    SipSessionPtr mSession;
+};
+
+}
+}

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list