[asterisk-scf-commits] asterisk-scf/release/bridging.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Jun 26 13:14:11 CDT 2012


branch "master" has been updated
       via  8bb1c91e824a16fa876315c2e55985821c6f4a21 (commit)
      from  9075e0355ec2f660b4764127f5cf67762bb94634 (commit)

Summary of changes:
 src/BridgeImpl.cpp        |   60 ++++++++++++++++++++++++++++----------------
 src/BridgeManagerImpl.cpp |    9 ++++--
 src/MediaSplicer.cpp      |   29 ++++++++++++---------
 src/ServiceUtil.h         |   45 +++++++++++++++++++++++++++++++++
 src/SessionListener.cpp   |    2 +-
 src/SessionOperations.cpp |   45 ++++++++++++---------------------
 src/SessionWrapper.cpp    |   16 ++++++++---
 7 files changed, 134 insertions(+), 72 deletions(-)
 mode change 100755 => 100644 src/BridgeCreationExtensionPointImpl.cpp
 mode change 100755 => 100644 src/BridgeCreationExtensionPointImpl.h
 mode change 100755 => 100644 src/BridgeImpl.cpp
 mode change 100755 => 100644 src/MediaMixer.cpp
 mode change 100755 => 100644 src/MediaSplicer.cpp


- Log -----------------------------------------------------------------
commit 8bb1c91e824a16fa876315c2e55985821c6f4a21
Author: Brent Eagles <beagles at digium.com>
Date:   Tue Jun 26 15:27:14 2012 -0230

    Added a load of extra identification to contexts to hopefully prevent collisions.

diff --git a/src/BridgeCreationExtensionPointImpl.cpp b/src/BridgeCreationExtensionPointImpl.cpp
old mode 100755
new mode 100644
diff --git a/src/BridgeCreationExtensionPointImpl.h b/src/BridgeCreationExtensionPointImpl.h
old mode 100755
new mode 100644
diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
old mode 100755
new mode 100644
index fd8624e..a3b537a
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -428,7 +428,8 @@ protected:
             
             // Forward the info via the SessionController for this session.
             sessionController->updateRedirections(
-                calculateOperationContext(mRootContext, identityToString(sessionController->ice_getIdentity())),
+                computeContextToTarget(mRootContext, mSourceSession, sessionController, 
+                    "d2339e4f-6886-4e50-a2bc-4b9ab96d27dd"),
                 currentRedirections);
         }
     }
@@ -563,8 +564,10 @@ protected:
         if (sessionController)
         {
             // Forward the info via the SessionController for this session.
-            sessionController->updateConnectedLine(calculateOperationContext(mRootContext, identityToString(sessionController->ice_getIdentity())),
-                currentConnectedLine);
+            sessionController->updateConnectedLine(
+                    computeContextToTarget(mRootContext, mSourceSession, sessionController,
+                        "5e89f521-0989-499e-9d3c-964ae40cb5ce"),
+                    currentConnectedLine);
         }
     }
 
@@ -678,7 +681,8 @@ protected:
         if (sessionController)
         {
             sessionController->updateCallerID(
-                calculateOperationContext(mRootContext, identityToString(sessionController->ice_getIdentity())),
+                computeContextToTarget(mRootContext, mSource, sessionController, 
+                    "eab3f089-d64e-40e3-a029-f8d4728065e3"),
                     currentCallerID);
         }
     }
@@ -864,7 +868,8 @@ protected:
                 continue;
             }
             tasksDispatched = true;
-            (*i)->begin_setBridge(calculateOperationContext(mRootContext, identityToString(mBridge->ice_getIdentity())), mBridge,
+            (*i)->begin_setBridge(computeContextToTarget(mRootContext, mBridge, (*i), 
+                        "7cdbbe09-d3e5-4262-b5c5-d4b978f59863"), mBridge,
                 mSessionListener, newCallback_Session_setBridge(this, &SetBridgeTask::set,
                     &SetBridgeTask::failed), session);
         }
@@ -1136,7 +1141,7 @@ protected:
                 SessionControllerPrx::uncheckedCast(mAdapter->add(controller, mAdapter->getCommunicator()->stringToIdentity(identity)));
             
             (*i)->begin_setAndGetSessionController(
-                calculateOperationContext(mRootContext, identityToString((*i)->ice_getIdentity())), 
+                computeContextToTarget(mRootContext, controllerPrx, (*i), "d144f4fa-fe30-4bd2-bbd0-1b985f43581a"), 
                 controllerPrx, 
                 newCallback_Session_setAndGetSessionController(this, &SetAndGetSessionControllerTask::get, 
                     &SetAndGetSessionControllerTask::failed), session);
@@ -1237,7 +1242,8 @@ protected:
             // Remove the session controller from the session itself
             SessionControllerPrx controller = SessionControllerPrx::uncheckedCast(mAdapter->createProxy(
                     mAdapter->getCommunicator()->stringToIdentity(identity)));
-            (*i)->removeSessionController(calculateOperationContext(mRootContext, identity), controller);
+            (*i)->removeSessionController(computeContextToTarget(mRootContext, controller, (*i), 
+                        "46bb60d2-8e42-4831-88bf-e4d3c29892e5"), controller);
         }
         return true;
     }
@@ -1574,7 +1580,8 @@ protected:
         for(TelephonyEventSourceSeq::iterator i=fromSources.begin();   
             i != fromSources.end(); ++i)
         {
-            (*i)->removeSinks(calculateOperationContext(mRootContext, identityToString((*i)->ice_getIdentity())),
+            (*i)->removeSinks(computeContextToTarget(mRootContext, sourceSession, (*i), 
+                        "2973215c-b71d-4bb7-b3d3-81fdee943819"),
                 sinksToRemove);
         }
     }
@@ -1952,7 +1959,8 @@ void BridgeImpl::shutdown(const AsteriskSCF::System::V1::OperationContextPtr& op
                 {
                     Ice::StringSeq keys;
                     keys.push_back(mState->key);
-                    mReplicator->removeState(calculateOperationContext(operationContext, mName), keys);
+                    mReplicator->removeState(computeContextToTarget(operationContext, mPrx, mReplicator.initialize(), 
+                                "667121ba-9287-465c-8100-0ebf2d7c4b0c"), keys);
                 }
             }
             catch (const Ice::Exception&)
@@ -2041,7 +2049,8 @@ void BridgeImpl::destroy(const AsteriskSCF::System::V1::OperationContextPtr& con
         {
             Ice::StringSeq keys;
             keys.push_back(mState->key);
-            mReplicator->removeState(calculateOperationContext(context, mName), keys);
+            mReplicator->removeState(computeContextToTarget(context, mPrx, mReplicator.initialize(),
+                        "76d07ea0-46f2-42a6-ac15-31f453d20bbf"), keys);
         }
     }
     catch (const Ice::Exception&)
@@ -2066,7 +2075,6 @@ void BridgeImpl::addListener(const AsteriskSCF::System::V1::OperationContextPtr&
                 //
                 return;
             }
-
             //
             // Careful about ordering lest short-circuit become an issue
             //
@@ -2074,7 +2082,8 @@ void BridgeImpl::addListener(const AsteriskSCF::System::V1::OperationContextPtr&
             {
                 ReplicatedStateItemSeq seq;
                 seq.push_back(createFirstListenerUpdate(listener));
-                mReplicator->setState(calculateOperationContext(operationContext, mName + ".addListener"), seq);
+                mReplicator->setState(computeContextToTarget(operationContext, mPrx, listener, 
+                            ".0d5ea297-46ec-4468-890d-d3b14f769239.addListener"), seq);
             }
             data->getMonitor()->setCompleted();
         }
@@ -2133,7 +2142,8 @@ void BridgeImpl::removeListener(const AsteriskSCF::System::V1::OperationContextP
                     {
                         Ice::StringSeq keys;
                         keys.push_back(key);
-                        mReplicator->removeState(calculateOperationContext(operationContext, mName + ".removeListener"), keys);
+                        mReplicator->removeState(computeContextToTarget(operationContext, 
+                                    mPrx, mReplicator.initialize(), ".eca196c5-3982-483c-a9df-dffa599beb5c.removeListener"), keys);
                     }
                     catch (const std::exception& ex)
                     {
@@ -2543,45 +2553,51 @@ void BridgeImpl::getAddSessionsTasks(QueuedTasks& tasks,
     SessionsTrackerPtr tracker(new SessionsTracker);
     SessionWrapperPtr sourceSessionWrapper = getSessions()->getSession(source);
     //
+    // Setup a derived context that includes part of the operation name to
+    // distinguish code flow.
+    //
+    AsteriskSCF::System::V1::OperationContextPtr localContext = calculateOperationContext(context, mName + ".getAddSessionsTasks");
+    //
     // FAILOVER: You don't want this to happen after failover.
     //
-    tasks.push_back(new UnplugMedia(calculateOperationContext(context, "UnplugMedia"), this));
+    tasks.push_back(new UnplugMedia(calculateOperationContext(localContext, "UnplugMedia.A"), this));
     //
     // FAILOVER: This probably isn't so bad.
     //
-    tasks.push_back(new SetBridgeTask(calculateOperationContext(context, "SetBridgeTask"),
+    tasks.push_back(new SetBridgeTask(calculateOperationContext(localContext, "SetBridgeTask.B"),
                 mSessions, mPrx, mSessionListenerPrx, sessions, tracker));
     //
     // FAILOVER: Also not so bad as long as duplicates are handled properly.
     //
-    tasks.push_back(new AddToListeners(calculateOperationContext(context, "AddToListeners"), mListeners, tracker, getCookies()));
+    tasks.push_back(new AddToListeners(calculateOperationContext(localContext, "AddToListeners.C"), mListeners, tracker, getCookies()));
     //
     // FAILOVER: This might have side-effects. Might be best not to redo it.
     //
-    tasks.push_back(new SetAndGetSessionControllerTask(calculateOperationContext(context, "SetAndGetSessionController"),
+    tasks.push_back(new SetAndGetSessionControllerTask(calculateOperationContext(localContext, 
+                    "SetAndGetSessionController.D"),
             mObjAdapter, mSessions, sessions, this, mLogger));
     //
     // FAILOVER: Avoid redoing.
     //
-    tasks.push_back(new ForwardCallerIDTask(calculateOperationContext(context, "ForwardCallerIDTask"), this, source, callerID, mLogger));
+    tasks.push_back(new ForwardCallerIDTask(calculateOperationContext(context, "ForwardCallerIDTask.E"), this, source, callerID, mLogger));
     //
     // FAILOVER: Avoid redoing.
     //
-    tasks.push_back(new ForwardRedirectionsUpdatedTask(calculateOperationContext(context, "ForwardRedirectionsUpdateTask"),
+    tasks.push_back(new ForwardRedirectionsUpdatedTask(calculateOperationContext(context, "ForwardRedirectionsUpdateTask.F"),
             this, source, redirects, mLogger));
     //
     // FAILOVER: Avoid redoing.
     //
-    tasks.push_back(new SetupMedia(calculateOperationContext(context, "SetupMedia"), this));
+    tasks.push_back(new SetupMedia(calculateOperationContext(context, "SetupMedia.G"), this));
     //
     // FAILOVER: Avoid redoing.
     //
-    tasks.push_back(new ConnectTelephonyEventsTask(calculateOperationContext(context, "ConnectTelephonyEventsTask"),
+    tasks.push_back(new ConnectTelephonyEventsTask(calculateOperationContext(context, "ConnectTelephonyEventsTask.H"),
             this, sessions, mLogger));
     //
     // FAILOVER: No point in doing this one again.
     //
-    tasks.push_back(new UpdateTask(calculateOperationContext(context, "UpdateTask"), this));
+    tasks.push_back(new UpdateTask(calculateOperationContext(context, "UpdateTask.I"), this));
 }
 
 void BridgeImpl::statePreCheck()
diff --git a/src/BridgeManagerImpl.cpp b/src/BridgeManagerImpl.cpp
index be2da67..f1982eb 100644
--- a/src/BridgeManagerImpl.cpp
+++ b/src/BridgeManagerImpl.cpp
@@ -31,6 +31,7 @@
 #include <AsteriskSCF/Operations/OperationContextCache.h>
 
 #include <AsteriskSCF/Operations/OperationMonitor.h>
+#include "ServiceUtil.h"
 
 using namespace AsteriskSCF::System::Logging;
 using namespace AsteriskSCF::System;
@@ -43,6 +44,7 @@ using namespace AsteriskSCF::Replication::BridgeService::V1;
 using namespace AsteriskSCF::SessionCommunications::ExtensionPoints::V1;
 using namespace AsteriskSCF::SessionCommunications::PartyIdentification::V1;
 using namespace AsteriskSCF::Operations;
+using namespace AsteriskSCF;
 using namespace std;
 
 namespace 
@@ -70,7 +72,7 @@ public:
     BridgeManagerImpl(const Ice::ObjectAdapterPtr& adapter, 
             const string& name,
             const BridgePartyIdExtensionPointPtr& partyIdExtensionPoint,
-            const BridgeReplicationContextPtr& replicationContext, const Logging::Logger& logger);
+            const BridgeReplicationContextPtr& replicationContext, const AsteriskSCF::System::Logging::Logger& logger);
     
     ~BridgeManagerImpl();
 
@@ -171,7 +173,7 @@ BridgeManagerImpl::BridgeManagerImpl(const Ice::ObjectAdapterPtr& adapter,
     const string& name, 
     const BridgePartyIdExtensionPointPtr& partyIdExtensionPoint,
     const BridgeReplicationContextPtr& replicationContext,
-    const Logger& logger) :
+    const AsteriskSCF::System::Logging::Logger& logger) :
         mName(name),
         mPartyIdExtensionPoint(partyIdExtensionPoint),
         mAdapter(adapter),
@@ -720,7 +722,8 @@ void BridgeManagerImpl::shutdown(const AsteriskSCF::System::V1::OperationContext
                 if (mCreationExtensionPointServicePrx)
                 {
                     mCreationExtensionPointServicePrx->unregister(
-                        calculateOperationContext(operationContext, mName + ".shutdown"));
+                        computeContextToTarget(operationContext, mSourceProxy, mCreationExtensionPointServicePrx, 
+                            mName + ".85cd0174-fceb-44de-8186-b0222fbee6c5.shutdown"));
                 }
             }
             catch (const std::exception& ex)
diff --git a/src/MediaMixer.cpp b/src/MediaMixer.cpp
old mode 100755
new mode 100644
diff --git a/src/MediaSplicer.cpp b/src/MediaSplicer.cpp
old mode 100755
new mode 100644
index 6720176..a25d874
--- a/src/MediaSplicer.cpp
+++ b/src/MediaSplicer.cpp
@@ -268,7 +268,8 @@ public:
         {
             try
             {
-                pairing->first->setSource(calculateOperationContext(rootContext, mBridgeId), StreamSourcePrx());
+                pairing->first->setSource(computeContextToTarget(rootContext, pairing->first, StreamSourcePrx(), 
+                            mBridgeId + ".c502b8f6-6e02-4bfa-8801-49c4ea406fac.resetSource"), StreamSourcePrx());
             }
             catch (const Ice::Exception& ex)
             {
@@ -282,7 +283,9 @@ public:
         {
             try
             {
-                pairing->first->removeSink(calculateOperationContext(rootContext, mBridgeId), pairing->second);
+                pairing->first->removeSink(computeContextToTarget(rootContext, pairing->first, 
+                            pairing->second, 
+                            mBridgeId + ".1552aca8-4ed9-48a0-bfc6-69e908162061.removeSink"), pairing->second);
             }
             catch (const Ice::Exception& ex)
             {
@@ -338,7 +341,8 @@ public:
         {
             try
             {
-                pairing->first->setSource(calculateOperationContext(context, mBridgeId + ".disconnectMedia"), StreamSourcePrx());
+                pairing->first->setSource(computeContextToTarget(context, pairing->first, StreamSourcePrx(),
+                        mBridgeId + "7aa6c3e6-5267-4bb5-93aa-8432f23d53d7.disconnectMedia"), StreamSourcePrx());
             }
             catch (const Ice::Exception& ex)
             {
@@ -352,7 +356,9 @@ public:
         {
             try
             {
-                pairing->first->removeSink(calculateOperationContext(context, mBridgeId + ".disconnectMedia"), pairing->second);
+                pairing->first->removeSink(computeContextToTarget(context, pairing->first, 
+                        pairing->second, mBridgeId + ".8b1bab10-f6cb-476a-8db7-1bb02f6fdddf.disconnectMedia"), 
+                        pairing->second);
             }
             catch (const Ice::Exception& ex)
             {
@@ -972,12 +978,11 @@ protected:
         {
             OutgoingHelperPtr h(new OutgoingHelper(this, index));
             i->second->begin_addSink(
-                calculateOperationContext(mMaterials->rootContext,
-                    identityToString(i->second->ice_getIdentity())), 
-                i->first, AsteriskSCF::Media::V1::newCallback_StreamSource_addSink(h, &OutgoingHelper::addSinkCB, &OutgoingHelper::failed));
+                computeContextToTarget(mMaterials->rootContext, i->first, i->second, __LINE__),
+                i->first, 
+                AsteriskSCF::Media::V1::newCallback_StreamSource_addSink(h, &OutgoingHelper::addSinkCB, &OutgoingHelper::failed)); 
             i->first->begin_setSource(
-                calculateOperationContext(mMaterials->rootContext,
-                    identityToString(i->first->ice_getIdentity())), 
+                computeContextToTarget(mMaterials->rootContext, i->second, i->first, __LINE__),
                 i->second, AsteriskSCF::Media::V1::newCallback_StreamSink_setSource(h, &OutgoingHelper::setSourceCB, &OutgoingHelper::failed));
             ++index;
         }
@@ -986,12 +991,10 @@ protected:
         {
             IncomingHelperPtr h(new IncomingHelper(this, index));
             i->first->begin_addSink(
-                calculateOperationContext(mMaterials->rootContext,
-                    identityToString(i->first->ice_getIdentity())), 
+                computeContextToTarget(mMaterials->rootContext, i->first, i->second, __LINE__), 
                 i->second,  AsteriskSCF::Media::V1::newCallback_StreamSource_addSink(h, &IncomingHelper::addSinkCB, &IncomingHelper::failed));
             i->second->begin_setSource(
-                calculateOperationContext(mMaterials->rootContext,
-                    identityToString(i->second->ice_getIdentity())), 
+                computeContextToTarget(mMaterials->rootContext, i->second, i->first, __LINE__), 
                 i->first,  AsteriskSCF::Media::V1::newCallback_StreamSink_setSource(h, &IncomingHelper::setSourceCB, &IncomingHelper::failed));
             ++index;
         }
diff --git a/src/ServiceUtil.h b/src/ServiceUtil.h
index dfb0bfc..5287a56 100644
--- a/src/ServiceUtil.h
+++ b/src/ServiceUtil.h
@@ -20,6 +20,7 @@
 #include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
 #include <AsteriskSCF/Operations/OperationContext.h>
 #include <string>
+#include <sstream>
 
 namespace AsteriskSCF
 {
@@ -162,4 +163,48 @@ PrxType tryOneWay(const PrxType& orig)
     return orig;
 }
 
+template <typename LABELTYPE>
+inline AsteriskSCF::System::V1::OperationContextPtr computeContextToTarget(
+    const AsteriskSCF::System::V1::OperationContextPtr& sourceContext, 
+    const Ice::ObjectPrx& source,
+    const Ice::ObjectPrx& destination,
+    const LABELTYPE& label)
+{
+    std::stringstream suffix;
+    bool separator = false;
+    if (source)
+    {
+        Ice::Identity id = source->ice_getIdentity();
+        suffix << id.name;
+        if (!id.category.empty())
+        {
+            suffix << "/" << id.category;
+        }
+        separator = true;
+    }
+    if (destination)
+    {
+        if (separator)
+        {
+            suffix << '-';
+        }
+        Ice::Identity id = destination->ice_getIdentity();
+        suffix << id.name;
+        if (!id.category.empty())
+        {
+            suffix << "/" << id.category;
+        }
+    }
+    suffix << label;
+    return AsteriskSCF::Operations::calculateOperationContext(sourceContext, suffix.str());
+}
+
+inline AsteriskSCF::System::V1::OperationContextPtr computeContextToTarget(
+    const AsteriskSCF::System::V1::OperationContextPtr& sourceContext, 
+    const Ice::ObjectPrx& source,
+    const Ice::ObjectPrx& destination)
+{
+    return computeContextToTarget(sourceContext, source, destination, std::string(""));
+}
+
 }; /** End of namespace AsteriskSCF */
diff --git a/src/SessionListener.cpp b/src/SessionListener.cpp
index 70ef8a6..de47ecf 100644
--- a/src/SessionListener.cpp
+++ b/src/SessionListener.cpp
@@ -164,7 +164,7 @@ public:
                             return;
                         }
 
-                        session->setup(calculateOperationContext(context, identityToString(mBridgePrx->ice_getIdentity())));
+                        session->setup(computeContextToTarget(context, mBridgePrx, source, ".sessionListener.Setup"));
             
                         ConnectSessionOperation connector(context, source, mLogger);
                         mSessions->visitSessions(connector);
diff --git a/src/SessionOperations.cpp b/src/SessionOperations.cpp
index 3c9cdaa..342ec01 100644
--- a/src/SessionOperations.cpp
+++ b/src/SessionOperations.cpp
@@ -16,6 +16,7 @@
 
 #include "SessionOperations.h"
 #include <AsteriskSCF/Operations/OperationContext.h>
+#include "ServiceUtil.h"
 
 using namespace AsteriskSCF::System::Logging;
 using namespace AsteriskSCF::SessionCommunications::V1;
@@ -100,7 +101,7 @@ void ShutdownSessionOperation::operator()(const SessionWrapperPtr& wrapper)
 {
     if (mSkipExclude || wrapper->getSession()->ice_getIdentity() != mExclude)
     {
-        wrapper->shutdown(calculateOperationContext(mRootContext, wrapper->id()), mObjectAdapter, mListener, mResponse);
+        wrapper->shutdown(mRootContext, mObjectAdapter, mListener, mResponse);
     }
 }
 
@@ -125,7 +126,8 @@ void RelayIndication::operator()(const SessionWrapperPtr& session)
             //
             // TODO: AMI.. or would this be better as a oneway. Do we care if we get a response etc?
             //
-	    s->indicate(calculateOperationContext(mRootContext, session->id()), mIndication);
+	    s->indicate(computeContextToTarget(mRootContext, Ice::ObjectPrx(), s, 
+                        ".RelayIndication.c356fb71-1d8a-4b01-95fe-cd00bdee903e"), mIndication);
         }
         catch (const Ice::ObjectNotExistException& ex)
         {
@@ -170,7 +172,8 @@ void AddStreamsOperation::operator()(const SessionWrapperPtr& session)
 
     // Go ahead and request that the streams be added
     controller->begin_addStreams(
-        calculateOperationContext(mRootContext, session->id()), mStreams,
+        computeContextToTarget(mRootContext, session->getSession(), controller, 
+            ".535ce1e7-ab89-48a9-ae2c-81a39289b5f2"), mStreams,
         newCallback_SessionController_addStreams(this, &AddStreamsOperation::added, &AddStreamsOperation::failed),
                                  session);
 
@@ -184,10 +187,11 @@ void AddStreamsOperation::added(const AsteriskSCF::Media::V1::StreamInformationD
     // If any streams were added set up media so it flows
     if (!streams.empty())
     {
-        session->unplugMedia(mRootContext);
-        mSelf->unplugMedia(mRootContext);
-        session->setupMedia(mRootContext);
-        mSelf->setupMedia(mRootContext);
+        AsteriskSCF::System::V1::OperationContextPtr c = calculateOperationContext(mRootContext, "AddStreamsOperation");
+        session->unplugMedia(c);
+        mSelf->unplugMedia(c);
+        session->setupMedia(c);
+        mSelf->setupMedia(c);
     }
 
     // Now that everything is ready go ahead and respond
@@ -250,7 +254,8 @@ void RemoveStreamsOperation::operator()(const SessionWrapperPtr& session)
         return;
     }
 
-    controller->begin_removeStreams(calculateOperationContext(mRootContext, session->id()),
+    controller->begin_removeStreams(computeContextToTarget(mRootContext, controller, session->getSession(),
+                "RemoveStreamsOperation.793517b6-5f5b-4823-b00c-e53ab6d36295"),
         remove, newCallback_SessionController_removeStreams(this, &RemoveStreamsOperation::removed,
             &RemoveStreamsOperation::failed), session);
 
@@ -326,16 +331,8 @@ void ConnectTelephonyOperation::connectSinks(const TelephonySessionPrx& sourceSe
     for(TelephonyEventSourceSeq::iterator i=toSources.begin();   
         i != toSources.end(); ++i)
     {
-        Ice::Identity id = (*i)->ice_getIdentity();
-
-        //
-        // Strictly speaking, dealing with the members of an Ice identity
-        // directly is kind of frowned upon, but it is the shortest
-        // distance between two points here.
-        //
-        string idString = id.name + id.category;
-        
-        (*i)->addSinks(calculateOperationContext(mRootContext, idString), sinksToAdd);
+        (*i)->addSinks(computeContextToTarget(mRootContext, sinkSession, (*i), 
+                    "connectSinks.a7b4d747-9e78-4506-8df7-9af9d67dcf3b"), sinksToAdd);
     }
 }
 
@@ -377,16 +374,8 @@ void DisconnectTelephonyOperation::disconnectSinks(const TelephonySessionPrx& so
     for(TelephonyEventSourceSeq::iterator i=fromSources.begin();   
         i != fromSources.end(); ++i)
     {
-        Ice::Identity id = (*i)->ice_getIdentity();
-
-        //
-        // Strictly speaking, dealing with the members of an Ice identity
-        // directly is kind of frowned upon, but it is the shortest
-        // distance between two points here.
-        //
-        string idString = id.name + id.category;
-
-        (*i)->removeSinks(calculateOperationContext(mRootContext, idString), sinksToRemove);
+        (*i)->removeSinks(computeContextToTarget(mRootContext, sinkSession, (*i), 
+                    "disconnectSinks.cd2a19fc-3c25-4967-a575-bf8a3ad90bd8"), sinksToRemove);
     }
 }
 
diff --git a/src/SessionWrapper.cpp b/src/SessionWrapper.cpp
index 4357fb2..d46fe0f 100644
--- a/src/SessionWrapper.cpp
+++ b/src/SessionWrapper.cpp
@@ -104,7 +104,8 @@ protected:
     bool executeImpl()
     {
         mSession->getSession()->begin_removeBridge(
-            AsteriskSCF::Operations::createContext(mRootContext), mSessionListener,
+            computeContextToTarget(mRootContext, mSessionListener, mSession->getSession(), 
+                "RemoveBridgeTask.92e94edb-1cd5-4718-b085-8c34aeb16b8f"), mSessionListener,
                 newCallback_Session_removeBridge(this, &RemoveBridgeTask::removed,
                         &RemoveBridgeTask::failed));
         return false;
@@ -183,8 +184,8 @@ protected:
     bool executeImpl()
     {
         mSession->getSession()->begin_stop(
-            calculateOperationContext(mRootContext,
-                identityToString(mSession->getSession()->ice_getIdentity()) + ".SessionStopTask"),
+            computeContextToTarget(mRootContext, Ice::ObjectPrx(), mSession->getSession(), 
+                "SessionStopTask.c32c7072-dfc1-4694-be30-5f53777675fe") ,
             mCode, newCallback_Session_stop(this, &SessionStopTask::removed,
                 &SessionStopTask::failed));
         return false;
@@ -491,7 +492,8 @@ void SessionWrapper::connect(const AsteriskSCF::System::V1::OperationContextPtr&
         mLogger(Trace) << FUNLOG << " sending ConnectIndication() to " << mId;
 
         mSession->session->begin_indicate(
-            calculateOperationContext(rootContext, ".bridgeConnect"),
+            computeContextToTarget(rootContext, Ice::ObjectPrx(), getSession(), 
+                ".bridgeConnect.b3989581-30b2-4021-afdb-83ac5f87710f"),
 	    new AsteriskSCF::SessionCommunications::V1::ConnectIndication(),
             newCallback_Session_indicate(new ConnectRequestCallback(this, mLogger),
 		&ConnectRequestCallback::connectCB,
@@ -578,7 +580,11 @@ void SessionWrapper::setupMedia(const AsteriskSCF::System::V1::OperationContextP
     //
     // The context already includes bridge specific info, so all is well.
     //
-    mSplicer->connect(calculateOperationContext(context, mId), this, mSession->session);
+    // The UUID is not necessarily required, but it further delineates the
+    // code flow...
+    // 
+    mSplicer->connect(calculateOperationContext(context, mId + ".934ffc49-86e8-4c72-8969-d4354b3f8c6a"), 
+            this, mSession->session);
 }
 
 void SessionWrapper::setConnector(const MediaConnectorPtr& connector)

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


-- 
asterisk-scf/release/bridging.git



More information about the asterisk-scf-commits mailing list