[asterisk-scf-commits] asterisk-scf/integration/routing.git branch "route_replica" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Mar 7 01:16:31 CST 2011


branch "route_replica" has been created
        at  87dec489be1edc35387c4a774a33b4a59ea68112 (commit)

- Log -----------------------------------------------------------------
commit 87dec489be1edc35387c4a774a33b4a59ea68112
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Mon Mar 7 01:14:16 2011 -0600

    Changes to support replication and testing.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 66e9657..01eadd2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,8 +10,8 @@
 
 if(NOT integrated_build STREQUAL "true")
 
-   # Minimum we require is 2.6
-   cmake_minimum_required(VERSION 2.6)
+   # Minimum we require is 2.8
+   cmake_minimum_required(VERSION 2.8)
 
    # Include common AsteriskSCF build infrastructure. Make sure your submodules are pulled.
    include(cmake/AsteriskSCF.cmake)
@@ -28,7 +28,6 @@ if(NOT integrated_build STREQUAL "true")
    set(integrated_build false)
 endif()
 
-add_subdirectory(local-slice)
 add_subdirectory(src)
 add_subdirectory(config)
 add_subdirectory(test)
diff --git a/local-slice/BasicRoutingStateReplicationIf.ice b/local-slice/BasicRoutingStateReplicationIf.ice
index 75cebde..0a0d740 100644
--- a/local-slice/BasicRoutingStateReplicationIf.ice
+++ b/local-slice/BasicRoutingStateReplicationIf.ice
@@ -17,8 +17,8 @@
 #pragma once
 #include <Ice/BuiltinSequences.ice>
 #include <Ice/Identity.ice>
-#include <Core/Discovery/ServiceLocatorIf.ice>
-#include <SessionCommunications/SessionCommunicationsIf.ice>
+#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.ice>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice>
 
 module AsteriskSCF
 {
@@ -58,37 +58,12 @@ module V1
        idempotent RoutingStateItemSeq getAllState();
     };
 
-/***
-    enum RouteSessionOpState
-    {
-         START,
-         WAITLOOKUP,
-         BRIDGING,
-         COMPLETE
-    };
-
-    enum  ConnectBridgedSessionsWithDestinationOpState
-    {
-        START,
-        WAIT_LOOKUP_RESULTS,
-        BRIDGING,
-        COMPLETE
-    };
-
-    enum ConnectBridgedSessionsOpState
-    {
-        START,
-        COMPLETE
-    };
-
-***/
-
     ///////////////////////////////////
     // These state items represent the state transistions of the RouteSession operation.
 
 	/**
 	 * Indicates the RouteSessionOperation started. 
-	 * The key (in the base state item) is the transactionId of this operation. 
+	 * The key (in the base state item) is the transactionId of this operation + ".START". 
 	 */
     class RouteSessionOpStart extends RoutingStateItem
     {
@@ -97,27 +72,30 @@ module V1
         string destination;
     };
 
+    const string RouteSessionOpStartKeyMod = ".START";
 
+	/**
+	 * Indicates the RouteSessionOperation is waiting for an AMI endpoint lookup() reply. 
+	 * The key (in the base state item) is the transactionId of this operation + ".WAITLOOKUP". 
+	 */
     class RouteSessionOpWaitLookupState extends RoutingStateItem
     {
         string transactionId; 
     };
 
+    const string RouteSessionOpWaitLookupKeyMod = ".WAITLOOKUP";
 
+	/**
+	 * Indicates the RouteSessionOperation is going to create the bridge. 
+	 * The key (in the base state item) is the transactionId of this operation + ".BRIDGING". 
+	 */
     class RouteSessionOpBridgingState extends RoutingStateItem
     {
         string transactionId; 
         AsteriskSCF::Core::Endpoint::V1::EndpointSeq endpoints;
     };
 
-	/**
-	 * Indicates the RouteSessionOperation completed. 
-	 * The key (in the base state item) is the transactionId of this operation. 
-	 */
-    class RouteSessionOpComplete extends RoutingStateItem
-    {
-        string transactionId; 
-    };
+    const string RouteSessionOpBridgingKeyMod = ".BRIDGING";
 
 
     /////////////////////////////////////
@@ -139,7 +117,6 @@ module V1
         string transactionId; 
     };
 
-
     class ConnectBridgedSessionsWithDestinationOpBridgingState extends RoutingStateItem
     {
         string transactionId; 
@@ -185,7 +162,7 @@ module V1
 
 	/**  
 	 * Represents an added endpoint locator. 
-	 * The key (in the base state item) is the locatorId. 
+	 * The key (in the base state item) is the locator id. 
 	 */
     class EndpointLocatorAdd extends RoutingStateItem
     { 
diff --git a/src/BasicRoutingServiceApp.cpp b/src/BasicRoutingServiceApp.cpp
index b572f43..0babd69 100644
--- a/src/BasicRoutingServiceApp.cpp
+++ b/src/BasicRoutingServiceApp.cpp
@@ -19,23 +19,23 @@
 #include <boost/thread.hpp>
 #include <boost/shared_ptr.hpp>
 
-#include "SmartProxy.h"
-#include "ReplicaIf.h"
-#include "Core/Routing/RoutingIf.h"
-#include "Core/Discovery/ServiceLocatorIf.h"
-#include "SessionCommunications/SessionCommunicationsIf.h"
-#include "System/Component/ComponentServiceIf.h"
-#include "BasicRoutingStateReplicationIf.h"
+#include <AsteriskSCF/Core/Routing/RoutingIf.h>
+#include <AsteriskSCF/System/Component/ReplicaIf.h>
+#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
+#include <AsteriskSCF/System/Component/ComponentServiceIf.h>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 
+#include <AsteriskSCF/SmartProxy.h>
+#include <AsteriskSCF/Logger/IceLogger.h>
+#include <AsteriskSCF/logger.h>
+
+#include "AsteriskSCF/Threading/SimpleWorkQueue.h"
 #include "BasicRoutingStateReplicator.h"
 #include "LuaScriptProcessor.h"
 #include "RoutingServiceEventPublisher.h"
 #include "EndpointRegistry.h"
 #include "RoutingAdmin.h"
 #include "SessionRouter.h"
-#include "AsteriskSCF/Threading/SimpleWorkQueue.h"
-#include "IceLogger.h"
-#include "logger.h"
 
 using namespace std;
 using namespace AsteriskSCF::SessionCommunications::V1;
@@ -49,7 +49,7 @@ using namespace AsteriskSCF::BasicRoutingService::V1;
 
 namespace
 {
-Logger &lg = getLoggerFactory().getLogger("AsteriskSCF.BasicRoutingService");
+Logger lg = getLoggerFactory().getLogger("AsteriskSCF.BasicRoutingService");
 }
 using namespace AsteriskSCF::Core::Routing::V1::Event;
 
@@ -71,13 +71,6 @@ public:
 
     ~BasicRoutingServiceApp()
     {
-        // Smart pointers do your thing.
-        mSessionRouter = 0;
-        mAdminInteface = 0;
-        mComponentService = 0;
-        mEndpointRegistry = 0;
-        mEventPublisher = 0;
-        // XXX unnecessary.
     }
 
     void resume();
@@ -119,6 +112,7 @@ private:
     BasicSessionRouterPtr mSessionRouter;
     RoutingServiceAdminPtr mAdminInteface;
     ComponentServicePtr mComponentService;
+    ComponentTestPtr mComponentTest;
     AsteriskSCF::SmartProxy::SmartProxy<BridgeManagerPrx> mBridgeManager;
     RoutingServiceEventPublisherPtr mEventPublisher;
     EndpointRegistryPtr mEndpointRegistry;
@@ -172,6 +166,27 @@ private:
     BasicRoutingServiceApp& mApp;
 };
 
+class ComponentTestImpl : public ComponentTest
+{
+public:
+    ComponentTestImpl(BasicRoutingServiceApp& app) :
+        mApp(app)
+    {
+    }
+
+    void setTestMode(const ::std::string&, const ::Ice::Current&)
+    {
+    }
+
+    void setTestModeWithArgs(const ::std::string&, 
+                             const ComponentTestParamSeq&, const ::Ice::Current&)
+    {
+    }
+
+private:
+    BasicRoutingServiceApp& mApp;
+};
+
 /**
  * This class provides implementation for the Replica interface.
  * It also tracks the active/standby state of this component. 
@@ -352,6 +367,11 @@ void BasicRoutingServiceApp::registerWithServiceLocator()
 
         setCategory(mComponentServiceManagement, Routing::V1::ComponentServiceDiscoveryCategory);
 
+#ifdef TEST_BUILD
+        // Register our test servant as a facet of the ComponentService interface.
+        mAdapter->addFacet(mComponentTest, componentServicePrx->ice_getIdentity(), AsteriskSCF::System::Component::V1::ComponentTestFacet);
+#endif
+
         // Register the SessionRouter interface with the Service Locator.
         Ice::ObjectPrx sessionRouterObjectPrx = mAdapter->createDirectProxy(mCommunicator->stringToIdentity(SessionRouterObjectId));
         AsteriskSCF::SessionCommunications::V1::SessionRouterPrx sessionRouterPrx = AsteriskSCF::SessionCommunications::V1::SessionRouterPrx::checkedCast(sessionRouterObjectPrx);
@@ -415,6 +435,8 @@ void BasicRoutingServiceApp::locateStateReplicator()
 
     AsteriskSCF::SmartProxy::SmartProxy<RoutingStateReplicatorPrx> pw(mServiceLocator, replicatorParams, lg);
     mStateReplicator = pw;
+
+    mSessionRouter->setStateReplicator(mStateReplicator);
 }
 
 void BasicRoutingServiceApp::pushStateReplicator()
@@ -448,6 +470,12 @@ void BasicRoutingServiceApp::initialize()
         // Publish the LocatorRegistry interface.
         mAdapter->add(mEndpointRegistry, mCommunicator->stringToIdentity(RegistryLocatorObjectId));
 
+#ifdef TEST_BUILD
+        // Create and publish the ComponentTest servant. This will be exposed
+        // as a facet of ComponentService.
+        mComponentTest = new ComponentTestImpl(*this);
+#endif
+
         // Create publish the SessionRouter interface.
         SessionRouter *rawSessionRouter(new SessionRouter(mAdapter, mEndpointRegistry, mEventPublisher, mWorkQueue));
         BasicSessionRouterPtr basicSessionPtr(rawSessionRouter);
diff --git a/src/BasicRoutingStateReplicator.h b/src/BasicRoutingStateReplicator.h
index 3d915c8..9b267f9 100644
--- a/src/BasicRoutingStateReplicator.h
+++ b/src/BasicRoutingStateReplicator.h
@@ -17,8 +17,8 @@
 #pragma once
 
 #include <Ice/Ice.h>
+#include <AsteriskSCF/StateReplicator.h>
 #include "BasicRoutingStateReplicationIf.h"
-#include "StateReplicator.h"
 #include "EndpointRegistry.h"
 
 namespace AsteriskSCF
diff --git a/src/BasicRoutingStateReplicatorApp.cpp b/src/BasicRoutingStateReplicatorApp.cpp
index d102102..65f0bc7 100644
--- a/src/BasicRoutingStateReplicatorApp.cpp
+++ b/src/BasicRoutingStateReplicatorApp.cpp
@@ -19,12 +19,13 @@
 #include <IceStorm/IceStorm.h>
 #include <IceBox/IceBox.h>
 
-#include "ServiceLocatorIf.h"
-#include "ComponentServiceIf.h"
+#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
+#include <AsteriskSCF/System/Component/ComponentServiceIf.h>
+#include <AsteriskSCF/logger.h>
+#include <AsteriskSCF/Logger/IceLogger.h>
+
 #include "BasicRoutingStateReplicationIf.h"
 #include "BasicRoutingStateReplicator.h"
-#include "IceLogger.h"
-#include "logger.h"
 
 using namespace std;
 using namespace AsteriskSCF::Core;
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 592a0b3..64b7aec 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -2,6 +2,9 @@
 asterisk_scf_component_init(BasicRoutingService CXX)
 find_package(Lua51 REQUIRED)
 include_directories(${LUA_INCLUDE_DIR})
+
+asterisk_scf_slice_include_directories(${API_SLICE_DIR})
+
 asterisk_scf_component_add_slice(BasicRoutingService RoutingIf)
 asterisk_scf_component_add_slice(BasicRoutingService ServiceLocatorIf)
 asterisk_scf_component_add_slice(BasicRoutingService EndpointIf)
@@ -42,10 +45,10 @@ asterisk_scf_component_add_boost_libraries(BasicRoutingService thread date_time
 if(NOT logger_dir)
    message(FATAL_ERROR "The logger directory could not be found ${logger_dir}")
 endif()
-include_directories(${logger_dir}/common)
-include_directories(${logger_dir}/client/src)
+include_directories(${logger_dir}/include)
+include_directories(${API_INCLUDE_DIR})
 
-include_directories(${utils_dir}/SmartProxy/src)
+include_directories(${utils_dir}/SmartProxy/include)
 
 include_directories(${util_cpp_dir}/Threading/include)
 include_directories(${util_cpp_dir}/StateMachine/include)
@@ -53,8 +56,12 @@ include_directories(${util_cpp_dir}/StateMachine/include)
 asterisk_scf_component_build_icebox(BasicRoutingService)
 target_link_libraries(BasicRoutingService ${LUA_LIBRARIES})
 target_link_libraries(BasicRoutingService logging-client)
+
 target_link_libraries(BasicRoutingService Threading)
 
+# Enable test instrumentation in the component. 
+add_definitions(-DTEST_BUILD)
+
 #asterisk_scf_component_install(BasicRoutingService RUNTIME bin "Basic Routing Service" Core)
 
 ########################################
@@ -62,6 +69,8 @@ target_link_libraries(BasicRoutingService Threading)
 
 asterisk_scf_component_init(BasicRoutingStateReplicator CXX)
 
+asterisk_scf_slice_include_directories(${API_SLICE_DIR})
+
 asterisk_scf_component_add_slice(BasicRoutingStateReplicator ServiceLocatorIf)
 asterisk_scf_component_add_slice(BasicRoutingStateReplicator ComponentServiceIf)
 asterisk_scf_component_add_slice(BasicRoutingStateReplicator BasicRoutingStateReplicationIf)
@@ -72,17 +81,20 @@ asterisk_scf_component_add_slice(BasicRoutingStateReplicator RoutingIf)
 # permanent of changes and assumes the directories are
 # structured in the way that gitall structures them.
 
-include_directories(${utils_dir}/StateReplicator/src)
-include_directories(${utils_dir}/SmartProxy/src)
+include_directories(${utils_dir}/StateReplicator/include)
+include_directories(${utils_dir}/SmartProxy/include)
+include_directories(${API_INCLUDE_DIR})
 
 asterisk_scf_component_add_file(BasicRoutingStateReplicator BasicRoutingStateReplicatorApp.cpp)
 asterisk_scf_component_add_file(BasicRoutingStateReplicator BasicRoutingStateReplicator.h)
+asterisk_scf_component_add_slice(BasicRoutingStateReplicator  ../local-slice/BasicRoutingStateReplicationIf.ice)
 
 asterisk_scf_component_add_ice_libraries(BasicRoutingStateReplicator IceStorm)
 
 asterisk_scf_component_build_icebox(BasicRoutingStateReplicator)
 
 target_link_libraries(BasicRoutingStateReplicator logging-client)
+target_link_libraries(BasicRoutingStateReplicator asterisk-scf-api)
 
 #asterisk_scf_component_install(BasicRoutingStateReplicator RUNTIME bin "Basic Routing Service State Replicator" BasicRoutingStateReplicator)
 
diff --git a/src/ConnectBridgedSessionsOperation.cpp b/src/ConnectBridgedSessionsOperation.cpp
index 8bca93d..4e45033 100644
--- a/src/ConnectBridgedSessionsOperation.cpp
+++ b/src/ConnectBridgedSessionsOperation.cpp
@@ -16,7 +16,7 @@
 #include <boost/shared_ptr.hpp>
 #include <boost/bind.hpp>
 
-#include "logger.h"
+#include <AsteriskSCF/logger.h>
 
 #include "ConnectBridgedSessionsOperation.h"
 
@@ -61,6 +61,14 @@ ConnectBridgedSessionsOperation::ConnectBridgedSessionsOperation(const AMD_Sessi
         mBridgedSession(bridgedSession),
         mIceCurrent(current)
 {
+    Ice::Context::const_iterator it = current.ctx.find(::AsteriskSCF::SessionCommunications::V1::TransactionKey);
+    if (it == current.ctx.end())
+    {
+         lg(Error) << "ConnectBridgedSessionsOperation() called with no transaction ID set!"  ;
+         throw InvalidParamsException();
+    }
+
+    mTransactionId = (it->second);
         mStateMachine.addState(ConnectBridgedSessionsOp::STATE_CONNECT, boost::bind(&ConnectBridgedSessionsOperation::connectBridgedSessionsState, this));
 }
 
diff --git a/src/ConnectBridgedSessionsOperation.h b/src/ConnectBridgedSessionsOperation.h
index bd96b3d..fc9364f 100644
--- a/src/ConnectBridgedSessionsOperation.h
+++ b/src/ConnectBridgedSessionsOperation.h
@@ -17,8 +17,8 @@
 
 #include <boost/function.hpp>
 
-#include "RoutingIf.h"
-#include "SessionCommunications/SessionCommunicationsIf.h"
+#include <AsteriskSCF/Core/Routing/RoutingIf.h>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 #include "AsteriskSCF/StateMachine/SimpleStateMachine.h"
 
 #include "SessionRouterOperation.h"
diff --git a/src/ConnectBridgedSessionsWithDestinationOperation.cpp b/src/ConnectBridgedSessionsWithDestinationOperation.cpp
index 718d348..0ef9de0 100644
--- a/src/ConnectBridgedSessionsWithDestinationOperation.cpp
+++ b/src/ConnectBridgedSessionsWithDestinationOperation.cpp
@@ -16,7 +16,7 @@
 #include <boost/shared_ptr.hpp>
 #include <boost/bind.hpp>
 
-#include "logger.h"
+#include <AsteriskSCF/logger.h>
 
 #include "ConnectBridgedSessionsWithDestinationOperation.h"
 
@@ -59,6 +59,14 @@ ConnectBridgedSessionsWithDestinationOperation::ConnectBridgedSessionsWithDestin
         mDestination(destination),
         mIceCurrent(current)
 {
+    Ice::Context::const_iterator it = current.ctx.find(::AsteriskSCF::SessionCommunications::V1::TransactionKey);
+    if (it == current.ctx.end())
+    {
+         lg(Error) << "ConnectBridgedSessionsWithDestinationOperation() called with no transaction ID set!"  ;
+         throw InvalidParamsException();
+    }
+
+    mTransactionId = (it->second);
     mStateMachine.addState(ConnectBridgedSessionsWithDestinationOp::STATE_LOOKUP, boost::bind(&ConnectBridgedSessionsWithDestinationOperation::lookupState, this));
     mStateMachine.addState(ConnectBridgedSessionsWithDestinationOp::STATE_WAIT_LOOKUP_RESULTS, boost::bind(&ConnectBridgedSessionsWithDestinationOperation::waitOnLookupState, this));
     mStateMachine.addState(ConnectBridgedSessionsWithDestinationOp::STATE_BRIDGING, boost::bind(&ConnectBridgedSessionsWithDestinationOperation::establishBridgeState, this));
diff --git a/src/ConnectBridgedSessionsWithDestinationOperation.h b/src/ConnectBridgedSessionsWithDestinationOperation.h
index 06ef0a8..61557a2 100644
--- a/src/ConnectBridgedSessionsWithDestinationOperation.h
+++ b/src/ConnectBridgedSessionsWithDestinationOperation.h
@@ -17,8 +17,9 @@
 
 #include <boost/function.hpp>
 
-#include "RoutingIf.h"
-#include "SessionCommunications/SessionCommunicationsIf.h"
+#include <AsteriskSCF/Core/Routing/RoutingIf.h>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
+
 #include "AsteriskSCF/StateMachine/SimpleStateMachine.h"
 
 #include "SessionRouterOperation.h"
diff --git a/src/EndpointRegistry.cpp b/src/EndpointRegistry.cpp
index d784770..34eb1a2 100644
--- a/src/EndpointRegistry.cpp
+++ b/src/EndpointRegistry.cpp
@@ -17,14 +17,15 @@
 #include <boost/thread/thread.hpp>
 #include <boost/thread/shared_mutex.hpp>
 
+#include <AsteriskSCF/logger.h>
+#include  <AsteriskSCF/SmartProxy.h>
+
+#include "RoutingServiceEventPublisher.h"
 #include "EndpointRegistry.h"
-#include "SmartProxy.h"
 #include "BasicRoutingStateReplicator.h"
 #include "RoutingServiceEventPublisher.h"
 #include "ScriptProcessor.h"
 
-#include "logger.h"
-
 using namespace ::AsteriskSCF::Core::Endpoint::V1;
 using namespace ::AsteriskSCF::Core::Routing::V1;
 using namespace ::AsteriskSCF::System::Logging;
@@ -33,7 +34,7 @@ using namespace ::std;
 
 namespace
 {
-Logger &lg = getLoggerFactory().getLogger("AsteriskSCF.BasicRoutingService");
+Logger lg = getLoggerFactory().getLogger("AsteriskSCF.BasicRoutingService");
 }
 
 namespace AsteriskSCF
@@ -329,7 +330,7 @@ void EndpointRegistry::addEndpointLocator(const std::string& locatorId, const Re
         lg(Debug) << "EndpointRegistry::addEndpointLocator() adding locator for " << locatorId << ". Proxy details: " << locator->ice_toString() << std::endl;
 
         EndpointLocatorMapIterator existing;
-		bool exists = locatorExists(mImpl->mEndpointLocatorMap, locatorId, mImpl->mLock, existing);
+        bool exists = locatorExists(mImpl->mEndpointLocatorMap, locatorId, mImpl->mLock, existing);
 
         if (exists)
         {
@@ -362,7 +363,7 @@ void EndpointRegistry::removeEndpointLocator(const std::string& locatorId, const
         lg(Debug) << "EndpointRegistry::removeEndpointLocator() removing locator " << locatorId;
 
         EndpointLocatorMapIterator existing;
-		bool exists = locatorExists(mImpl->mEndpointLocatorMap, locatorId, mImpl->mLock, existing);
+        bool exists = locatorExists(mImpl->mEndpointLocatorMap, locatorId, mImpl->mLock, existing);
 
         if (!exists)
         {
@@ -396,7 +397,7 @@ void EndpointRegistry::setEndpointLocatorDestinationIds(const std::string& locat
     try
     {
         EndpointLocatorMapIterator existing;
-		bool exists = locatorExists(mImpl->mEndpointLocatorMap, locatorId, mImpl->mLock, existing);
+        bool exists = locatorExists(mImpl->mEndpointLocatorMap, locatorId, mImpl->mLock, existing);
 
         if (!exists)
         {
diff --git a/src/EndpointRegistry.h b/src/EndpointRegistry.h
index 466b9f4..d655880 100644
--- a/src/EndpointRegistry.h
+++ b/src/EndpointRegistry.h
@@ -17,8 +17,9 @@
 
 #include <boost/shared_ptr.hpp>
 
-#include "RoutingIf.h"
-#include "SmartProxy.h"
+#include <AsteriskSCF/Core/Routing/RoutingIf.h>
+#include <AsteriskSCF/SmartProxy.h>
+
 #include "BasicRoutingStateReplicationIf.h"
 
 namespace AsteriskSCF
diff --git a/src/LuaScriptProcessor.cpp b/src/LuaScriptProcessor.cpp
index c4ce529..fcc3066 100644
--- a/src/LuaScriptProcessor.cpp
+++ b/src/LuaScriptProcessor.cpp
@@ -18,8 +18,9 @@
 #include <boost/thread/locks.hpp>
 #include <boost/thread/shared_mutex.hpp>
 
+#include <AsteriskSCF/logger.h>
+
 #include "LuaScriptProcessor.h"
-#include "logger.h"
 
 using namespace ::AsteriskSCF::Core::Endpoint::V1;
 using namespace ::AsteriskSCF::System::Logging;
@@ -27,7 +28,7 @@ using namespace ::std;
 
 namespace
 {
-Logger &lg = getLoggerFactory().getLogger("AsteriskSCF.BasicRoutingService");
+Logger lg = getLoggerFactory().getLogger("AsteriskSCF.BasicRoutingService");
 }
 
 namespace AsteriskSCF
diff --git a/src/LuaScriptProcessor.h b/src/LuaScriptProcessor.h
index aa34bfd..b43c60a 100644
--- a/src/LuaScriptProcessor.h
+++ b/src/LuaScriptProcessor.h
@@ -17,8 +17,8 @@
 
 #include <boost/shared_ptr.hpp>
 
+#include <AsteriskSCF/Core/Routing/RoutingIf.h>
 #include "ScriptProcessor.h"
-#include "RoutingIf.h"
 
 namespace AsteriskSCF
 {
diff --git a/src/RouteSessionOperation.cpp b/src/RouteSessionOperation.cpp
index 94c82f2..127d3d8 100644
--- a/src/RouteSessionOperation.cpp
+++ b/src/RouteSessionOperation.cpp
@@ -16,14 +16,17 @@
 #include <boost/shared_ptr.hpp>
 #include <boost/bind.hpp>
 
-#include "logger.h"
+#include <AsteriskSCF/logger.h>
 
+#include "BasicRoutingStateReplicationIf.h"
 #include "RouteSessionOperation.h"
 
 using namespace AsteriskSCF;
 using namespace AsteriskSCF::Core::Routing::V1;
 using namespace AsteriskSCF::SessionCommunications::V1;
 using namespace AsteriskSCF::System::Logging;
+using namespace ::AsteriskSCF::BasicRoutingService::V1;
+using namespace AsteriskSCF::StateMachine;
 
 namespace
 {
@@ -36,6 +39,107 @@ namespace BasicRoutingService
 {
 
 /**
+ * This listener monitors the progress of an operation, and push
+ */
+class RouteSessionReplicatingListener : public SimpleStateMachine<RouteSessionOp::OperationState, boost::function<void ()> >::StateMachineListener
+{
+public:
+    RouteSessionReplicatingListener(RouteSessionOperation *op, 
+                          const AsteriskSCF::SmartProxy::SmartProxy<
+                            AsteriskSCF::BasicRoutingService::V1::RoutingStateReplicatorPrx>& replicator)  
+                            : mOperation(op), mReplicator(replicator)
+    {
+    }
+
+    /**
+     * This callback is called just before the execution of a state machine's current state handler. 
+     */
+    void stateExecutionStart(RouteSessionOp::OperationState state)
+    {
+        switch(state)
+        {
+        case RouteSessionOp::STATE_LOOKUP:
+            {
+            // Push this information to the state replicator.
+            RoutingStateItemSeq setItems;
+
+            RouteSessionOpStartPtr routeSessionOpStart(new RouteSessionOpStart());
+            routeSessionOpStart->key = mOperation->getTransactionId() + AsteriskSCF::BasicRoutingService::V1::RouteSessionOpStartKeyMod;
+            routeSessionOpStart->source = mOperation->getSource();
+            routeSessionOpStart->destination = mOperation->getDestination();
+
+            setItems.push_back(routeSessionOpStart);
+            mReplicator->setState(setItems);
+            }
+            break;
+
+        case RouteSessionOp::STATE_WAIT_LOOKUP_RESULTS:
+            {
+            // We just completed the entire operation. 
+            // Push this information to the state replicator.
+            RoutingStateItemSeq setItems;
+
+            RouteSessionOpWaitLookupStatePtr routeSessionOpWaitLookup(new RouteSessionOpWaitLookupState());
+            routeSessionOpWaitLookup->key = mOperation->getTransactionId() + AsteriskSCF::BasicRoutingService::V1::RouteSessionOpWaitLookupKeyMod;
+
+            setItems.push_back(routeSessionOpWaitLookup);
+            mReplicator->setState(setItems);
+            }
+            break;
+
+        case RouteSessionOp::STATE_BRIDGING:
+            {
+            // We just completed the entire operation. 
+            // Push this information to the state replicator.
+            RoutingStateItemSeq setItems;
+
+            RouteSessionOpBridgingStatePtr routeSessionOpBridging(new RouteSessionOpBridgingState());
+            routeSessionOpBridging->key = mOperation->getTransactionId() + AsteriskSCF::BasicRoutingService::V1::RouteSessionOpBridgingKeyMod;
+            routeSessionOpBridging->endpoints = mOperation->getLookupResult();
+
+            setItems.push_back(routeSessionOpBridging);
+            mReplicator->setState(setItems);
+            }
+            break;
+  
+        }
+    }
+
+    /**
+     * This callback is called just before the execution of a state machine's current state handler. 
+     */
+    void stateExecutionComplete(RouteSessionOp::OperationState state)
+    {
+        switch(state)
+        {
+        case RouteSessionOp::STATE_BRIDGING:
+            // We just completed the entire operation. 
+            // Remove the items that represented this operation's state transitions.
+            Ice::StringSeq stateKeys;
+
+             stateKeys.push_back(mOperation->getTransactionId() + AsteriskSCF::BasicRoutingService::V1::RouteSessionOpStartKeyMod);
+             stateKeys.push_back(mOperation->getTransactionId() + AsteriskSCF::BasicRoutingService::V1::RouteSessionOpWaitLookupKeyMod);
+             stateKeys.push_back(mOperation->getTransactionId() + AsteriskSCF::BasicRoutingService::V1::RouteSessionOpBridgingKeyMod);
+
+            mReplicator->removeState(stateKeys);
+            break;
+        }
+
+    }
+
+    /**
+     * This callback is called when a state transition is occuring. 
+     */
+    void stateTransition(RouteSessionOp::OperationState oldState, RouteSessionOp::OperationState newState)
+    {
+    }
+
+private:
+    RouteSessionOperation* mOperation;
+    AsteriskSCF::SmartProxy::SmartProxy<AsteriskSCF::BasicRoutingService::V1::RoutingStateReplicatorPrx> mReplicator;
+};
+
+/**
  * This is a specialization of the SessionRouterOperation<T> to handle the
  * routeSession() operation. The template parameter T is the type of the routeSession()
  * AMD callback handler to allow this object to send results to the initiator of this
@@ -59,6 +163,17 @@ RouteSessionOperation::RouteSessionOperation(const AMD_SessionRouter_routeSessio
                 mDestination(destination),
                 mIceCurrent(current)
 {
+    Ice::Context::const_iterator it = current.ctx.find(::AsteriskSCF::SessionCommunications::V1::TransactionKey);
+    if (it == current.ctx.end())
+    {
+         lg(Error) << "RouteSessionOperation() called with no transaction ID set!";
+         throw InvalidParamsException();
+    }
+    mTransactionId = (it->second);
+
+    boost::shared_ptr<SimpleStateMachine<RouteSessionOp::OperationState, boost::function<void ()> >::StateMachineListener > ptr(new RouteSessionReplicatingListener(this, context.stateReplicator));
+    mStateMachine.addListener(ptr);
+
     mStateMachine.addState(RouteSessionOp::STATE_LOOKUP, boost::bind(&RouteSessionOperation::lookupState, this));
     mStateMachine.addState(RouteSessionOp::STATE_WAIT_LOOKUP_RESULTS, boost::bind(&RouteSessionOperation::waitOnLookupState, this));
     mStateMachine.addState(RouteSessionOp::STATE_BRIDGING, boost::bind(&RouteSessionOperation::establishBridgeState, this));
diff --git a/src/RouteSessionOperation.h b/src/RouteSessionOperation.h
index 47202a6..2e83ae5 100644
--- a/src/RouteSessionOperation.h
+++ b/src/RouteSessionOperation.h
@@ -17,8 +17,8 @@
 
 #include <boost/function.hpp>
 
-#include "RoutingIf.h"
-#include "SessionCommunications/SessionCommunicationsIf.h"
+#include <AsteriskSCF/Core/Routing/RoutingIf.h>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 
 #include "SessionRouterOperation.h"
 
@@ -67,6 +67,10 @@ public:
 
     virtual ~RouteSessionOperation();
 
+    AsteriskSCF::SessionCommunications::V1::SessionPrx getSource() {return mSource;}
+
+    std::string getDestination() {return mDestination;}
+    
 private:
 
     /**
diff --git a/src/RoutingAdmin.h b/src/RoutingAdmin.h
index dece098..9cf679a 100644
--- a/src/RoutingAdmin.h
+++ b/src/RoutingAdmin.h
@@ -15,7 +15,7 @@
  */
 #pragma once
 
-#include "RoutingIf.h"
+#include <AsteriskSCF/Core/Routing/RoutingIf.h>
 #include "EndpointRegistry.h"
 
 namespace AsteriskSCF
diff --git a/src/RoutingServiceEventPublisher.cpp b/src/RoutingServiceEventPublisher.cpp
index c3c4256..f6163a8 100644
--- a/src/RoutingServiceEventPublisher.cpp
+++ b/src/RoutingServiceEventPublisher.cpp
@@ -13,14 +13,14 @@
  * the GNU General Public License Version 2. See the LICENSE.txt file
  * at the top of the source tree.
  */
+#include <boost/thread/mutex.hpp>
+
 #include <Ice/Ice.h>
 #include <IceStorm/IceStorm.h>
 
-#include <boost/thread/mutex.hpp>
+#include <AsteriskSCF/logger.h>
 
 #include "RoutingServiceEventPublisher.h"
-#include "LocalReplicaListener.h"
-#include "logger.h"
 
 using namespace ::std;
 using namespace ::AsteriskSCF::Core::Routing::V1;
@@ -29,7 +29,7 @@ using namespace ::AsteriskSCF::BasicRoutingService::V1;
 
 namespace
 {
-Logger &lg = getLoggerFactory().getLogger("AsteriskSCF.BasicRoutingService");
+Logger lg = getLoggerFactory().getLogger("AsteriskSCF.BasicRoutingService");
 }
 
 namespace AsteriskSCF
diff --git a/src/RoutingServiceEventPublisher.h b/src/RoutingServiceEventPublisher.h
index fc3a531..506e7cd 100644
--- a/src/RoutingServiceEventPublisher.h
+++ b/src/RoutingServiceEventPublisher.h
@@ -18,8 +18,9 @@
 #include <Ice/Ice.h>
 #include <boost/shared_ptr.hpp>
 
-#include "RoutingIf.h"
-#include "SmartProxy.h"
+#include <AsteriskSCF/Core/Routing/RoutingIf.h>
+#include <AsteriskSCF/SmartProxy.h>
+
 #include "BasicRoutingStateReplicationIf.h"
 
 namespace AsteriskSCF
diff --git a/src/ScriptProcessor.h b/src/ScriptProcessor.h
index 3d549e6..cb1a988 100644
--- a/src/ScriptProcessor.h
+++ b/src/ScriptProcessor.h
@@ -15,7 +15,7 @@
  */
 #pragma once
 
-#include "RoutingIf.h"
+#include <AsteriskSCF/Core/Routing/RoutingIf.h>
 
 namespace AsteriskSCF
 {
diff --git a/src/SessionListener.cpp b/src/SessionListener.cpp
index c96d7ec..484c766 100644
--- a/src/SessionListener.cpp
+++ b/src/SessionListener.cpp
@@ -17,7 +17,7 @@
 #include <boost/thread/shared_mutex.hpp>
 #include <boost/thread/thread.hpp>
 
-#include "logger.h"
+#include <AsteriskSCF/logger.h>
 
 #include "SessionRouter.h"
 #include "SessionListener.h"
diff --git a/src/SessionListener.h b/src/SessionListener.h
index 5d3485f..a0cbc0f 100644
--- a/src/SessionListener.h
+++ b/src/SessionListener.h
@@ -19,7 +19,7 @@
 
 #include <Ice/Ice.h>
 
-#include "SessionCommunications/SessionCommunicationsIf.h"
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 
 namespace AsteriskSCF
 {
diff --git a/src/SessionRouter.cpp b/src/SessionRouter.cpp
index fc0c935..cffaa60 100644
--- a/src/SessionRouter.cpp
+++ b/src/SessionRouter.cpp
@@ -21,6 +21,10 @@
 
 #include "AsteriskSCF/Threading/WorkQueue.h"
 
+#include <AsteriskSCF/Core/Routing/RoutingIf.h>
+#include <AsteriskSCF/Core/Endpoint/EndpointIf.h>
+#include <AsteriskSCF/logger.h>
+
 #include "SessionRouter.h"
 #include "RouteSessionOperation.h"
 #include "ConnectBridgedSessionsOperation.h"
@@ -28,9 +32,6 @@
 
 #include "SessionListener.h"
 #include "EndpointRegistry.h"
-#include "RoutingIf.h"
-#include "EndpointIf.h"
-#include "logger.h"
 
 using namespace AsteriskSCF;
 using namespace AsteriskSCF::Core::Routing::V1;
@@ -44,7 +45,7 @@ using namespace std;
 
 namespace
 {
-Logger &lg = getLoggerFactory().getLogger("AsteriskSCF.BasicRoutingService");
+Logger lg = getLoggerFactory().getLogger("AsteriskSCF.BasicRoutingService");
 }
 
 namespace AsteriskSCF
@@ -175,6 +176,17 @@ void SessionRouter::setBridgeManager(
     mImpl->mSessionContext.bridgeManager = bridgeAccessor;
 }
 
+/** 
+ * Our state replicator proxy can only be obtained once our object adapter is activated, so our
+ * replicator reference's initialization is deferred. 
+ */
+void SessionRouter::setStateReplicator(
+    const AsteriskSCF::SmartProxy::SmartProxy<
+        AsteriskSCF::BasicRoutingService::V1::RoutingStateReplicatorPrx>& replicatorPrx)
+{
+    mImpl->mSessionContext.stateReplicator = replicatorPrx;
+}
+
 /**
  * Route the session by looking up the destination endpoint and configuring a complimentary session for the destination.
  */
diff --git a/src/SessionRouter.h b/src/SessionRouter.h
index 0d775ea..008bcdb 100644
--- a/src/SessionRouter.h
+++ b/src/SessionRouter.h
@@ -18,13 +18,11 @@
 #include <Ice/Ice.h>
 #include <boost/shared_ptr.hpp>
 
+#include <AsteriskSCF/SmartProxy.h>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 #include "AsteriskSCF/Threading/WorkQueue.h"
-#include "SessionCommunications/SessionCommunicationsIf.h"
-
-#include "SmartProxy.h"
 #include "EndpointRegistry.h"
 
-
 namespace AsteriskSCF
 {
 namespace BasicRoutingService
@@ -45,7 +43,11 @@ public:
 
     void setBridgeManager(
         const AsteriskSCF::SmartProxy::SmartProxy<
-            SessionCommunications::V1::BridgeManagerPrx>& bridgeAccessor);
+            SessionCommunications::V1::BridgeManagerPrx >& bridgeAccessor);
+
+    void setStateReplicator(
+        const AsteriskSCF::SmartProxy::SmartProxy<
+            AsteriskSCF::BasicRoutingService::V1::RoutingStateReplicatorPrx >& replicatorPrx);
 
 public:
     // SessionRouter overrides
diff --git a/src/SessionRouterOperation.h b/src/SessionRouterOperation.h
index 047fb7b..3972fe7 100644
--- a/src/SessionRouterOperation.h
+++ b/src/SessionRouterOperation.h
@@ -20,13 +20,13 @@
 
 #include <Ice/Ice.h>
 
-#include "AsteriskSCF/Threading/WorkQueue.h"
-#include "AsteriskSCF/StateMachine/SimpleStateMachine.h"
+#include <AsteriskSCF/Threading/WorkQueue.h>
+#include <AsteriskSCF/StateMachine/SimpleStateMachine.h>
 
-#include "SessionCommunications/SessionCommunicationsIf.h"
-#include "SmartProxy.h"
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
+#include <AsteriskSCF/SmartProxy.h>
 
-#include "RoutingIf.h"
+#include <AsteriskSCF/Core/Routing/RoutingIf.h>
 
 #include "SessionListener.h"
 #include "EndpointRegistry.h"
@@ -62,7 +62,9 @@ public:
     const EndpointRegistryPtr endpointRegistry;
     const AsteriskSCF::Core::Routing::V1::Event::RoutingEventsPtr eventPublisher;
     const boost::shared_ptr<AsteriskSCF::Threading::WorkQueue> workQueue;
+
 	AsteriskSCF::SmartProxy::SmartProxy<AsteriskSCF::SessionCommunications::V1::BridgeManagerPrx> bridgeManager;
+	AsteriskSCF::SmartProxy::SmartProxy<AsteriskSCF::BasicRoutingService::V1::RoutingStateReplicatorPrx> stateReplicator;
 };
 
 /** 
@@ -108,7 +110,7 @@ public:
     SessionRouterOperation(const T& amdCallback,
                            const SessionContext& context,
                            OperationsManager* manager,
-                          S defaultState) 
+                           S defaultState) 
 		: mInitiatorCallback(amdCallback),
           mSessionContext(context),
           mFinished(false),
@@ -227,6 +229,21 @@ public:
 		}
 	}
 
+    AsteriskSCF::Core::Endpoint::V1::EndpointSeq getLookupResult()
+    {
+        return mLookupResult;
+    }
+
+    void setTransactionId(const std::string& transactionId)
+    {
+        mTransactionId = transactionId;
+    }
+
+    std::string getTransactionId()
+    {
+        return mTransactionId;
+    }
+
 protected:
     T mInitiatorCallback;
     SessionContext mSessionContext;
@@ -237,7 +254,8 @@ protected:
     SessionListenerManagerPtr mListenerManager;
     OperationsManager* mOperationsManager;
 
-    AsteriskSCF::StateMachine::SimpleStateMachine<S, boost::function<void ()> > mStateMachine; 
+    AsteriskSCF::StateMachine::SimpleStateMachine<S, boost::function<void ()> > mStateMachine;
+    std::string mTransactionId;
 
 }; // class SessionRouterOperation
 
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index fca99ba..c2935e1 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,8 +1,5 @@
 # Create Basic Routing Service test project.
 asterisk_scf_component_init(RoutingTest CXX)
-asterisk_scf_component_add_slice(RoutingTest RoutingIf)
-asterisk_scf_component_add_slice(RoutingTest ServiceLocatorIf)
-asterisk_scf_component_add_slice(RoutingTest SessionCommunicationsIf)
 
 asterisk_scf_component_add_file(RoutingTest TestRouting.cpp)
 asterisk_scf_component_add_file(RoutingTest SharedTestData.h)
@@ -19,7 +16,9 @@ asterisk_scf_component_add_file(RoutingTest MockEndpointLocator.cpp)
 
 asterisk_scf_component_add_ice_libraries(RoutingTest IceStorm)
 asterisk_scf_component_add_boost_libraries(RoutingTest unit_test_framework)
+include_directories(${API_INCLUDE_DIR})
 asterisk_scf_component_build_icebox(RoutingTest)
+target_link_libraries(RoutingTest asterisk-scf-api)
 
 if(integrated_build STREQUAL "true")
    icebox_add_test(RoutingTest ../config/routingtest-integ.config)
diff --git a/test/MockBridge.h b/test/MockBridge.h
index 1854c72..5a116bb 100644
--- a/test/MockBridge.h
+++ b/test/MockBridge.h
@@ -16,7 +16,7 @@
 #pragma once
 
 #include <Ice/Ice.h>
-#include "SessionCommunications/SessionCommunicationsIf.h"
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 
 namespace AsteriskSCF
 {
diff --git a/test/MockBridgeManager.h b/test/MockBridgeManager.h
index 7c25c73..f741908 100644
--- a/test/MockBridgeManager.h
+++ b/test/MockBridgeManager.h
@@ -16,7 +16,7 @@
 #pragma once
 
 #include <Ice/Ice.h>
-#include "SessionCommunications/SessionCommunicationsIf.h"
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 
 namespace AsteriskSCF
 {
diff --git a/test/MockEndpointLocator.cpp b/test/MockEndpointLocator.cpp
index 1b0a808..aacd0c7 100644
--- a/test/MockEndpointLocator.cpp
+++ b/test/MockEndpointLocator.cpp
@@ -15,8 +15,9 @@
  */
 #include <Ice/Ice.h>
 
-#include "EndpointIf.h"
-#include "RoutingIf.h"
+#include <AsteriskSCF/Core/Endpoint/EndpointIf.h>
+#include <AsteriskSCF/Core/Routing/RoutingIf.h>
+
 #include "MockEndpointLocator.h"
 #include "SharedTestData.h"
 
diff --git a/test/MockSession.h b/test/MockSession.h
index 3bdcdd8..0e59151 100644
--- a/test/MockSession.h
+++ b/test/MockSession.h
@@ -16,7 +16,7 @@
 #pragma once
 
 #include <Ice/Ice.h>
-#include "SessionCommunicationsIf.h"
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 
 namespace AsteriskSCF
 {
diff --git a/test/MockSessionEndpoint.h b/test/MockSessionEndpoint.h
index cebcd0e..55a2de6 100644
--- a/test/MockSessionEndpoint.h
+++ b/test/MockSessionEndpoint.h
@@ -16,7 +16,7 @@
 #pragma once
 
 #include <Ice/Ice.h>
-#include "SessionCommunicationsIf.h"
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 #include "MockSession.h"
 
 namespace AsteriskSCF
diff --git a/test/SharedTestData.h b/test/SharedTestData.h
index e1770eb..dd7d145 100644
--- a/test/SharedTestData.h
+++ b/test/SharedTestData.h
@@ -17,13 +17,13 @@
 
 #include <Ice/Ice.h>
 
+#include <AsteriskSCF/Core/Routing/RoutingIf.h>
+#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
+
 #include "MockBridgeManager.h"
 #include "MockEndpointLocator.h"
 
-#include "RoutingIf.h"
-#include "ServiceLocatorIf.h"
-#include "SessionCommunicationsIf.h"
-
 namespace AsteriskSCF
 {
 namespace RoutingTest
diff --git a/test/TestRouting.cpp b/test/TestRouting.cpp
index 9ba8016..01eb44c 100644
--- a/test/TestRouting.cpp
+++ b/test/TestRouting.cpp
@@ -21,6 +21,11 @@
 
 #include <Ice/Ice.h>
 #include <IceBox/IceBox.h>
+#include <IceUtil/UUID.h>
+
+#include <AsteriskSCF/Core/Routing/RoutingIf.h>
+#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 
 #include "SharedTestData.h"
 #include "MockBridge.h"
@@ -28,10 +33,6 @@
 #include "MockSession.h"
 #include "MockSessionEndpoint.h"
 
-#include "RoutingIf.h"
-#include "ServiceLocatorIf.h"
-#include "SessionCommunicationsIf.h"
-
 using namespace std;
 using namespace AsteriskSCF::Core::Routing::V1;
 using namespace AsteriskSCF::Core::Endpoint::V1;
@@ -409,7 +410,9 @@ BOOST_FIXTURE_TEST_CASE(RouteSession, PerTestFixture)
         SharedTestData::instance.mBridgeConnected = false;
 
         BOOST_TEST_MESSAGE("Routing the session...");
-        SharedTestData::instance.sessionRouter->routeSession(session, "102");
+        Ice::Context iceContext;
+        iceContext[AsteriskSCF::SessionCommunications::V1::TransactionKey] = "Test_RouteSession_" + IceUtil::generateUUID();
+        SharedTestData::instance.sessionRouter->routeSession(session, "102", iceContext);
 
         BOOST_CHECK(SharedTestData::instance.mBridgeConnected);
 
@@ -468,7 +471,9 @@ BOOST_FIXTURE_TEST_CASE(BlindTransfer, PerTestFixture)
         SharedTestData::instance.mSessionReplaced = false;
 
         BOOST_TEST_MESSAGE("Routing the session...");
-        SharedTestData::instance.sessionRouter->routeSession(session, "102");
+        Ice::Context iceContext;
+        iceContext[AsteriskSCF::SessionCommunications::V1::TransactionKey] = "Test_BlindTransfer_" + IceUtil::generateUUID();
+        SharedTestData::instance.sessionRouter->routeSession(session, "102", iceContext);
 
         BridgePrx bridge = session->getBridge();
         BOOST_CHECK(bridge != 0);
@@ -529,7 +534,9 @@ BOOST_FIXTURE_TEST_CASE(AttendedTransfer, PerTestFixture)
         SharedTestData::instance.mBridgeConnected = false;
 
         BOOST_TEST_MESSAGE("Routing for the first pair...");
-        SharedTestData::instance.sessionRouter->routeSession(session101, "102");
+        Ice::Context iceContext;
+        iceContext[AsteriskSCF::SessionCommunications::V1::TransactionKey] = "Test_AttendedTransfer_102_" + IceUtil::generateUUID();
+        SharedTestData::instance.sessionRouter->routeSession(session101, "102", iceContext);
 
         BOOST_CHECK(SharedTestData::instance.mBridgeConnected);
 
@@ -544,7 +551,10 @@ BOOST_FIXTURE_TEST_CASE(AttendedTransfer, PerTestFixture)
         SharedTestData::instance.mSessionReplaced = false;
 
         BOOST_TEST_MESSAGE("Routing the second pair...");
-        SharedTestData::instance.sessionRouter->routeSession(session103, "104");
+
+        iceContext.clear();
+        iceContext[AsteriskSCF::SessionCommunications::V1::TransactionKey] = "Test_AttendedTransfer_104_" + IceUtil::generateUUID();
+        SharedTestData::instance.sessionRouter->routeSession(session103, "104", iceContext);
 
         BOOST_CHECK(SharedTestData::instance.mBridgeConnected);
 

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


-- 
asterisk-scf/integration/routing.git



More information about the asterisk-scf-commits mailing list