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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Nov 18 18:24:40 CST 2010


branch "cleanup" has been created
        at  34ce99c2d1e10d40be12c6066a30a6b0b6ad504e (commit)

- Log -----------------------------------------------------------------
commit 34ce99c2d1e10d40be12c6066a30a6b0b6ad504e
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Thu Nov 18 18:18:40 2010 -0600

    Refactored redundant code into reusable methods. Cleanup from some
    late-night fixes leading up to AstriCon.

diff --git a/src/SessionRouter.cpp b/src/SessionRouter.cpp
index 9aec3aa..1afe420 100644
--- a/src/SessionRouter.cpp
+++ b/src/SessionRouter.cpp
@@ -43,16 +43,68 @@ namespace AsteriskSCF
 namespace BasicRoutingService
 {
 
-class SessionListenerImpl : public SessionListener
+/**
+ * A simple utility to make the retry process a little cleaner until a SmartProxy
+ * or other such mechanism has this functionality built-in. 
+ */
+class RetryPolicy
 {
 public:
-    SessionListenerImpl(Ice::ObjectAdapterPtr adapter, const SessionPrx& session) :
-        mAdapter(adapter), mTerminated(false), mListenerPrx(0)
+    /**
+     * Constructor:
+     *  @param maxRetries Maximum number of times to retry. 
+     *  @intervalInMilliseconds Will sleep this amount in the retry() method. 
+     */
+    RetryPolicy(size_t maxRetries, size_t intervalInMilliseconds) :
+        mMaxRetries(maxRetries),
+        mRetryInterval(intervalInMilliseconds),
+        mCounter(0)
+    {
+    }
+
+    /**
+     * Indicates whether additional retries are warrented. 
+     */
+    bool canRetry()
+    {
+        return mCounter < mMaxRetries;
+    }
+
+    /**
+     * Using must call this for each attempt. Applies the delay between calls and does
+     * bookkeeping.
+     */
+    bool retry()
     {
+        lg(Debug) << "Retrying for the " << mCounter + 1 << " time.";
+        IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(mRetryInterval));
+        ++mCounter;
+        return canRetry();
     }
 
-    SessionListenerImpl(Ice::ObjectAdapterPtr adapter, SessionSeq& sessionSequence) :
-        mAdapter(adapter), mTerminated(false), mListenerPrx(0)
+    /**
+     * Accessor for the number of retries allowed. 
+     */
+    size_t maxRetries()
+    {
+        return mMaxRetries;
+    }
+
+private:
+    size_t mMaxRetries;
+    size_t mRetryInterval;
+    size_t mCounter;
+};
+
+/**
+ * Listener used to monitor sessions during the routing process. Primarily used to 
+ * insure the relevant sessions haven't stopped prior to being bridged. 
+ */
+class SessionListenerImpl : public SessionListener
+{
+public:
+    SessionListenerImpl() :
+        mTerminated(false), mListenerPrx(0)
     {
     }
 
@@ -60,6 +112,8 @@ public:
     {
     }
 
+public: // The following operations are implementations of the SessionListener interface.
+
     void connected(const SessionPrx& session, const Ice::Current&)
     {
     }
@@ -112,10 +166,12 @@ public:
     {
     }
 
+public: 
+
     /**
      * Adds a session to be tracked by the listener. This operation doesn't actually call addListener on the Session.
      * When we ask an endpoint to create a session, we pass our listener in to the creation process.
-     * So the listener has been attached to the session, but we just need to keep track of it in this object.
+     * So the listener has been attached to the session, but we want to keep track of it in this object.
      */
     void addSession(SessionPrx session)
     {
@@ -204,7 +260,6 @@ public:
 private:
     boost::shared_mutex mLock;
 
-    Ice::ObjectAdapterPtr mAdapter;
     SessionSeq mSessions;
     bool mTerminated;
     SessionListenerPrx mListenerPrx;
@@ -220,7 +275,7 @@ class SessionListenerAllocator
 {
 public:
     SessionListenerAllocator(Ice::ObjectAdapterPtr adapter, const SessionPrx& session)
-        : mSessionListener(new SessionListenerImpl(adapter, session)),
+        : mSessionListener(new SessionListenerImpl()),
           mAdapter(adapter)
     {
         Ice::ObjectPrx prx = adapter->addWithUUID(mSessionListener);
@@ -231,7 +286,7 @@ public:
     }
 
     SessionListenerAllocator(Ice::ObjectAdapterPtr adapter, SessionSeq& sessionSequence)
-        : mSessionListener(new SessionListenerImpl(adapter, sessionSequence)),
+        : mSessionListener(new SessionListenerImpl()),
           mAdapter(adapter)
     {
         Ice::ObjectPrx prx = adapter->addWithUUID(mSessionListener);
@@ -283,6 +338,9 @@ private:
     Ice::ObjectAdapterPtr mAdapter;
 };
 
+/**
+ * Private operations and state of the SessionRouter. 
+ */
 class SessionRouterPriv
 {
 public:
@@ -298,11 +356,17 @@ public:
     {
     }
 
+    /**
+     * Set the accessor to the bridge. 
+     */
     void setBridgeAccessor(BridgeManagerAccessorPtr bridgeAccessor)
     {
         mBridgeManagerAccessor = bridgeAccessor;
     }
 
+    /**
+     * Do a lookup of the requested endpoint. 
+     */
     EndpointSeq lookupEndpoints(const std::string& destination, const Ice::Current& current)
     {
         EndpointSeq endpoints;
@@ -331,6 +395,9 @@ public:
     }
 
 
+    /**
+     * Forward the start() operation to all sessions in a given sequence. 
+     */
     void forwardStart(SessionSeq& sessions)
     {
         for (SessionSeq::iterator s = sessions.begin(); s != sessions.end(); ++s)
@@ -348,6 +415,138 @@ public:
         }
     }
 
+    /**
+     * Provide access to the bridge for a given session. 
+     */
+    BridgePrx getBridge(SessionPrx session)
+    {
+        BridgePrx result(0);
+
+        RetryPolicy policy(5, 500);
+        while(policy.canRetry())
+        {
+            try
+            {
+                result = session->getBridge();
+                break;
+            }
+            catch(const Ice::ConnectionLostException&)
+            {
+                if(!policy.retry())
+                {
+                    lg(Error) << "getBridge(): ConnectionLostException getting bridge for session, failed "  << policy.maxRetries() << " retries." << std::endl;
+                    throw;
+                }
+            }
+            catch(const NotBridged& e)
+            {
+                lg(Error) << "getBridge(): session is not bridged."  << std::endl;
+                throw e; // rethrow
+            }
+            catch(const Ice::Exception& e)
+            {
+                lg(Error) << "getBridge(): Ice exception getting bridge for session:"  << e.what() << std::endl;
+                throw e; // rethrow
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * Add a session to each of a given set of endpoints, and return a collection of the 
+     * newly added sessions. 
+     */
+    SessionSeq addSessionToEndpoints(EndpointSeq& endpoints, const string& destination, SessionListenerAllocator& listener)
+    {
+        // Add a session
+        SessionSeq newSessions;
+        for (EndpointSeq::iterator e = endpoints.begin(); e != endpoints.end(); ++e)
+        {
+            try
+            {
+                SessionEndpointPrx sessionEndpoint = SessionEndpointPrx::checkedCast(*e);
+
+                // Create a session on the destination.
+                lg(Debug) << "addSessionToEndpoints(): Creating a session at destination " << destination;
+                SessionPrx destSession = sessionEndpoint->createSession(destination, listener->getProxy());
+                lg(Debug) << "  Session proxy: " << destSession->ice_toString() << std::endl;
+
+                listener->addSession(destSession);
+                newSessions.push_back(destSession);
+            }
+            catch(const Ice::Exception &exception)
+            {
+                lg(Error) << "Unable to create session for " << destination << ". " << exception.what();
+                // We may be able to reach SOME of the endpoints.
+            }
+        }
+        return newSessions;
+    }
+    
+    /**
+     * Accessor for the sessions in a bridge.
+     *   @bridge The bridge whose sessions are to be accessed.
+     *   @except An optional session proxy to be excluded from the list of sessions. 
+     */
+    SessionSeq getSessionsInBridge(BridgePrx bridge, SessionPrx except=0)
+    {
+        SessionSeq sessions; 
+        try
+        {
+            SessionSeq allSessions = bridge->listSessions();
+
+            if (except == 0)
+            {
+                return allSessions;
+            }
+
+            for(SessionSeq::iterator s = allSessions.begin(); s !=allSessions.end(); ++s)
+            {
+                if (except->ice_getIdentity() != (*s)->ice_getIdentity())
+                {
+                    sessions.push_back(*s);
+                }
+            }
+        }
+        catch(const Ice::Exception &e)
+        {
+            lg(Error) << "Unable to get list of sessions for bridge. Throwing " << e.what() << std::endl;
+            throw e; // rethrow
+        }
+        return sessions;
+    }
+
+    /**
+     * Removes sessions from a bridge.
+     *   @param bridge The bridge whose sessions are to be removed.
+     *   @param except The only session to be left in the bridge. 
+     */
+    SessionSeq removeSessionsFromBridge(BridgePrx bridge, SessionPrx except)
+    {
+        SessionSeq removedSessions;
+        try
+        {
+            SessionSeq allSessions = bridge->listSessions();
+            for(SessionSeq::iterator s = allSessions.begin(); s != allSessions.end(); ++s)
+            {
+                if ((*s)->ice_getIdentity() != except->ice_getIdentity())
+                {
+                    removedSessions.push_back(*s);
+                }
+            }
+
+            lg(Debug) << "Removing sessions from bridge." ;
+            bridge->removeSessions(removedSessions);
+        }
+        catch(const Ice::Exception&)
+        {
+            lg(Warning) << "Unable to remove sessions. " ;
+            // We won't give up because of this.
+        }
+        return removedSessions;
+    }
+
 public:
     Ice::ObjectAdapterPtr mAdapter;
     EndpointRegistryPtr mEndpointRegistry;
@@ -389,28 +588,8 @@ void SessionRouter::routeSession(const AsteriskSCF::SessionCommunications::V1::S
     lg(Debug) << "routeSession(): Routing destination " << destination << std::endl;
     EndpointSeq endpoints = mImpl->lookupEndpoints(destination, current);
 
-    // Add a session
-    SessionSeq newSessions;
-    for (EndpointSeq::iterator e = endpoints.begin(); e != endpoints.end(); ++e)
-    {
-        try
-        {
-            SessionEndpointPrx sessionEndpoint = SessionEndpointPrx::checkedCast(*e);
-
-            // Create a session on the destination.
-            lg(Debug) << "routeSession(): Creating a session at destination " << destination;
-            SessionPrx destSession = sessionEndpoint->createSession(destination, listener->getProxy());
-            lg(Debug) << "  Session proxy: " << destSession->ice_toString() << std::endl;
-
-            listener->addSession(destSession);
-            newSessions.push_back(destSession);
-        }
-        catch(const Ice::Exception &exception)
-        {
-            lg(Error) << "Unable to create session for " << destination << ". " << exception.what();
-            // We may be able to reach SOME of the endpoints.
-        }
-    }
+    // Add a session to the endpoints. 
+    SessionSeq newSessions = mImpl->addSessionToEndpoints(endpoints, destination, listener);
 
     if (listener->getNumSessions() < 2)
     {
@@ -421,6 +600,7 @@ void SessionRouter::routeSession(const AsteriskSCF::SessionCommunications::V1::S
     {
         throw SourceTerminatedPreBridgingException(source->getEndpoint()->getId());
     }
+
     // We're through listening, and we will probably interfere with the Bridge's functionality if
     // we keep listening.
     listener->unregister();
@@ -465,60 +645,9 @@ void SessionRouter::connectBridgedSessionsWithDestination(const SessionPrx& sess
 {
     lg(Debug) << "connectBridgedSessionsWithDestination() entered with destination " << destination << std::endl;
 
-    BridgePrx bridge(0);
-
-    size_t count = 0;
-    bool done = false;
-    size_t sleepInterval = 500; // XXX Make configurable.
-    size_t numberOfRetries = 5;
-    while(!done && count < numberOfRetries)
-    {
-        try
-        {
-            bridge = sessionToReplace->getBridge();
-            done = true;
-        }
-        catch(const Ice::ConnectionLostException&)
-        {
-            IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(sleepInterval));
-            ++count;
-            if(count >= numberOfRetries)
-            {
-                lg(Error) << "connectBridgedSessionsWithDestination(): ConnectionLostException getting bridge, failed "  << numberOfRetries << " retries." << std::endl;
-                throw;
-            }
-        }
-        catch(const NotBridged& e)
-        {
-            lg(Error) << "connectBridgedSessionsWithDestination(): sessionToReplace() is not bridged."  << std::endl;
-            throw e; // rethrow
-        }
-        catch(const Ice::Exception& e)
-        {
-            lg(Error) << "connectBridgedSessionsWithDestination(): Ice exception getting bridge:"  << e.what() << std::endl;
-            throw e; // rethrow
-        }
-    }
-
-    SessionSeq seq;
-    try
-    {
-        seq = bridge->listSessions();
-    }
-    catch(const Ice::Exception &e)
-    {
-        lg(Error) << "Unable to get list of sesssions for bridge in connectBridgedSessionsWithDestination(). " ;
-        throw e; // rethrow
-    }
+    BridgePrx bridge(sessionToReplace->getBridge());
 
-    SessionSeq remainingSessions;
-    for(SessionSeq::iterator s = seq.begin(); s !=seq.end(); ++s)
-    {
-        if (sessionToReplace->ice_getIdentity() != (*s)->ice_getIdentity()) // Don't listen to the session being replaced.
-        {
-            remainingSessions.push_back(*s);
-        }
-    }
+    SessionSeq remainingSessions = mImpl->getSessionsInBridge(bridge, sessionToReplace);
 
     // Create a listener for the sessions not being replaced to handle early termination.
     // The wrapper we're using will remove the listener and free it when
@@ -530,27 +659,8 @@ void SessionRouter::connectBridgedSessionsWithDestination(const SessionPrx& sess
     lg(Debug) << "connectBridgedSessionsWithDestination(): Routing destination " << destination;
     EndpointSeq endpoints = mImpl->lookupEndpoints(destination, current);
 
-    // Add a session
-    SessionSeq newSessions;
-    for (EndpointSeq::iterator e = endpoints.begin(); e != endpoints.end(); ++e)
-    {
-        try
-        {
-            SessionEndpointPrx sessionEndpoint = SessionEndpointPrx::checkedCast(*e);
-
-            // Create a session on the destination.
-            SessionPrx destSession = sessionEndpoint->createSession(destination, listener->getProxy());
-            listener->addSession(destSession);
-            newSessions.push_back(destSession);
-
-            lg(Debug) << "connectBridgedSessionsWithDestination(): Created session for routed destination " << destination;
-        }
-        catch(const Ice::Exception &exception)
-        {
-            lg(Error) << "connectBridgedSessionsWithDestination(): Unable to create sessionEndpoint for " << destination << ". " << exception.what();
-            // We may be able to reach SOME of the endpoints.
-        }
-    }
+    // Add a session 
+    SessionSeq newSessions = mImpl->addSessionToEndpoints(endpoints, destination, listener);
 
     if (listener->getNumSessions() < 2)
     {
@@ -584,6 +694,7 @@ void SessionRouter::connectBridgedSessionsWithDestination(const SessionPrx& sess
 
 } // SessionRouter::connectBridgedSessionsWithDestination(...)
 
+
 /**
  * Replace one session in a Bridge with sessions from another bridge.
  * No routing is actually performed. This operation exists here for consistency,
@@ -604,59 +715,9 @@ void SessionRouter::connectBridgedSessions(const SessionPrx& sessionToReplace,
     lg(Debug) << "connectBridgedSessions() entered... " << std::endl;
 
     // Get the bridge being merged into.
-    BridgePrx mergeBridge(0);
-
-    size_t count = 0;
-    bool done = false;
-    size_t sleepInterval = 500; // XXX Make configurable.
-    size_t numberOfRetries = 5;
-    while(!done && count < numberOfRetries)
-    {
-        try
-        {
-            mergeBridge = sessionToReplace->getBridge();
-            done = true;
-        }
-        catch(const Ice::ConnectionLostException&)
-        {
-            IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(sleepInterval));
-            ++count;
-            if(count >= numberOfRetries)
-            {
-                lg(Error) << "connectBridgedSessionsWithDestination(): ConnectionLostException getting bridge for sessionToReplace, failed "  << numberOfRetries << " retries." << std::endl;
-                throw;
-            }
-        }
-        catch(const NotBridged& e)
-        {
-            lg(Error) << "connectBridgedSessionsWithDestination(): sessionToReplace() is not bridged."  << std::endl;
-            throw e; // rethrow
-        }
-        catch(const Ice::Exception& e)
-        {
-            lg(Error) << "connectBridgedSessionsWithDestination(): Ice exception getting bridge for sessionToReplace:"  << e.what() << std::endl;
-            throw e; // rethrow
-        }
-    }
-
-    SessionSeq preserveSessions;
-    try
-    {
-        SessionSeq sourceSessions = mergeBridge->listSessions();
-        for(SessionSeq::iterator s = sourceSessions.begin(); s !=sourceSessions.end(); ++s)
-        {
-            if (sessionToReplace->ice_getIdentity() != (*s)->ice_getIdentity())
-            {
-                preserveSessions.push_back(*s);
-            }
-        }
-    }
-    catch(const Ice::Exception &e)
-    {
-        lg(Error) << "connectBridgedSessions(): Unable to get list of sesssions for bridge in connectBridgedSessions(). " ;
-        throw e; // rethrow
-    }
+    BridgePrx mergeBridge = mImpl->getBridge(sessionToReplace);
 
+    SessionSeq preserveSessions = mImpl->getSessionsInBridge(mergeBridge, sessionToReplace);
 
     // Create a listener for the sessions not being replaced to handle early termination.
     // The wrapper we're using will remove the listener and free it when
@@ -665,63 +726,9 @@ void SessionRouter::connectBridgedSessions(const SessionPrx& sessionToReplace,
     SessionListenerAllocator listener(mImpl->mAdapter, preserveSessions);
 
     // Get the bridge for the sessions being moved.
+    BridgePrx oldBridge = mImpl->getBridge(bridgedSession);
 
-    BridgePrx oldBridge(0);
-    count = 0;
-    done = false;
-    while(!done && count < numberOfRetries)
-    {
-        try
-        {
-            oldBridge = bridgedSession->getBridge();
-            done = true;
-        }
-        catch(const Ice::ConnectionLostException&)
-        {
-            IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(sleepInterval));
-            ++count;
-            if(count >= numberOfRetries)
-            {
-                lg(Error) << "connectBridgedSessionsWithDestination(): ConnectionLostException getting bridge for bridgedSession, failed "  << numberOfRetries << " retries." << std::endl;
-                throw;
-            }
-        }
-        catch(const NotBridged& e)
-        {
-            lg(Error) << "connectBridgedSessionsWithDestination(): bridgedSession() is not bridged."  << std::endl;
-            throw e; // rethrow
-        }
-        catch(const Ice::Exception& e)
-        {
-            lg(Error) << "connectBridgedSessionsWithDestination(): Ice exception getting bridge for bridgedSession:"  << e.what() << std::endl;
-            throw e; // rethrow
-        }
-    }
-
-    SessionSeq migratingSessions;
-    if (oldBridge != 0)
-    {
-        try
-        {
-            // Remove the sessions being moved from their old bridge.
-            SessionSeq allSessions = oldBridge->listSessions();
-            for(SessionSeq::iterator s = allSessions.begin(); s != allSessions.end(); ++s)
-            {
-                if ((*s)->ice_getIdentity() != bridgedSession->ice_getIdentity())
-                {
-                    migratingSessions.push_back(*s);
-                }
-            }
-
-            lg(Debug) << "connectBridgedSessions(): Removing migrating sessions from bridge." ;
-            oldBridge->removeSessions(migratingSessions);
-        }
-        catch(const Ice::Exception&)
-        {
-            lg(Warning) << "connectBridgedSessions(): Unable to remove sessions in connectBridgedSessions(). " ;
-            // We won't give up because of this.
-        }
-    }
+    SessionSeq migratingSessions = mImpl->removeSessionsFromBridge(oldBridge, bridgedSession);
 
     // Check for early termination by the source.
     if (listener->isTerminated())

commit 9aad91812cb36d4f1f4fc3cc3880b6d1f1756706
Author: David M. Lee <dlee at digium.com>
Date:   Mon Nov 15 14:03:38 2010 -0600

    Updated indentation to match the style guide.

diff --git a/src/BasicRoutingServiceApp.cpp b/src/BasicRoutingServiceApp.cpp
index 5909e74..6b2684e 100644
--- a/src/BasicRoutingServiceApp.cpp
+++ b/src/BasicRoutingServiceApp.cpp
@@ -53,15 +53,15 @@ namespace BasicRoutingService
 
 class BasicRoutingServiceApp : public IceBox::Service
 {
-public: 
+public:
     BasicRoutingServiceApp() :
-        mDone(false), mInitialized(false), mRunning(false) 
+        mDone(false), mInitialized(false), mRunning(false)
     {
 
     }
     ~BasicRoutingServiceApp()
     {
-        // Smart pointers do your thing. 
+        // Smart pointers do your thing.
         mSessionRouter = 0;
         mAdminInteface = 0;
         mComponentService = 0;
@@ -116,14 +116,14 @@ static const string ComponentServiceId("BasicRoutingComponent");
 static const string SessionRouterObjectId("SessionRouter");
 
 /**
- * This class provides implementation for the ComponentService interface. 
- * Every Asterisk SCF component is expected to expose the ComponentService interface. 
+ * This class provides implementation for the ComponentService interface.
+ * Every Asterisk SCF component is expected to expose the ComponentService interface.
  */
 class ComponentServiceImpl : public ComponentService
 {
 public:
-    ComponentServiceImpl(BasicRoutingServiceApp &app) : 
-        mApp(app) 
+    ComponentServiceImpl(BasicRoutingServiceApp &app) :
+        mApp(app)
     {
     }
 
@@ -133,7 +133,7 @@ public: // Overrides of the ComponentService interface.
         mApp.suspend();
     }
 
-    void resume(const Ice::Current&) 
+    void resume(const Ice::Current&)
     {
         mApp.resume();
     }
@@ -149,7 +149,7 @@ private:
 
 /**
  * Helper function to add some parameters to one of our registered interfaces in the ServiceLocator, so that
- * other components can look up our interfaces. 
+ * other components can look up our interfaces.
  */
 void BasicRoutingServiceApp::setCategory(const Discovery::V1::ServiceManagementPrx& serviceManagement, const string& category)
 {
@@ -160,15 +160,15 @@ void BasicRoutingServiceApp::setCategory(const Discovery::V1::ServiceManagementP
 }
 
 /**
- * Register this component's primary public interfaces with the Service Locator. 
- * This enables other Asterisk SCF components to locate the interfaces we are publishing. 
+ * Register this component's primary public interfaces with the Service Locator.
+ * This enables other Asterisk SCF components to locate the interfaces we are publishing.
  */
 void BasicRoutingServiceApp::registerWithServiceLocator()
 {
     try
     {
         // Get a proxy to the management interface for the Service Locator, so we can add ourselves into the system discovery mechanisms.
-        mServiceLocatorManagement = ServiceLocatorManagementPrx::checkedCast(mCommunicator->propertyToProxy("LocatorServiceManagement.Proxy")); 
+        mServiceLocatorManagement = ServiceLocatorManagementPrx::checkedCast(mCommunicator->propertyToProxy("LocatorServiceManagement.Proxy"));
 
         if (mServiceLocatorManagement == 0)
         {
@@ -176,7 +176,7 @@ void BasicRoutingServiceApp::registerWithServiceLocator()
             return;
         }
 
-        // Register our RoutingAdmin interface with the Service Locator. 
+        // Register our RoutingAdmin interface with the Service Locator.
         Ice::ObjectPrx adminObjectPrx = mAdapter->createDirectProxy(mCommunicator->stringToIdentity(RoutingAdminObjectId));
         RoutingServiceAdminPrx adminPrx = RoutingServiceAdminPrx::checkedCast(adminObjectPrx);
         string adminServiceGuid("BasicRoutingServiceAdmin"); // Should be unique for reporting.
@@ -184,7 +184,7 @@ void BasicRoutingServiceApp::registerWithServiceLocator()
 
         setCategory(mAdminManagement, Routing::V1::RoutingServiceAdminDiscoveryCategory);
 
-        // Register our RegistryLocator interface with the Service Locator. 
+        // Register our RegistryLocator interface with the Service Locator.
         Ice::ObjectPrx locatorObjectPrx = mAdapter->createDirectProxy(mCommunicator->stringToIdentity(RegistryLocatorObjectId));
         LocatorRegistryPrx locatorRegistryPrx = LocatorRegistryPrx::checkedCast(locatorObjectPrx);
         string locatorServiceGuid("BasicRoutingServiceRegistryLocator");  // Should be unique for reporting.
@@ -192,7 +192,7 @@ void BasicRoutingServiceApp::registerWithServiceLocator()
 
         setCategory(mRegistryLocatorManagement, Routing::V1::RoutingServiceLocatorRegistryDiscoveryCategory);
 
-        // Register the ComponentService interface with the Service Locator. 
+        // Register the ComponentService interface with the Service Locator.
         Ice::ObjectPrx componentServiceObjectPrx = mAdapter->createDirectProxy(mCommunicator->stringToIdentity(ComponentServiceId));
         ComponentServicePrx componentServicePrx = ComponentServicePrx::checkedCast(componentServiceObjectPrx);
         string componentServiceGuid("BasicRoutingService");   // Should be unique for reporting.
@@ -200,7 +200,7 @@ void BasicRoutingServiceApp::registerWithServiceLocator()
 
         setCategory(mComponentServiceManagement, Routing::V1::ComponentServiceDiscoveryCategory);
 
-        // Register the SessionRouter interface with the Service Locator.  
+        // 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);
         string sessionRouterGuid("SessionRouter");   // Should be unique
@@ -216,9 +216,9 @@ void BasicRoutingServiceApp::registerWithServiceLocator()
 }
 
 /**
- * Deregister this component's primary public interfaces from the Service Locator. 
+ * Deregister this component's primary public interfaces from the Service Locator.
  * This is done at shutdown, and whenever we want to keep other services from locating
- * our interfaces. 
+ * our interfaces.
  */
 void BasicRoutingServiceApp::deregisterFromServiceLocator()
 {
@@ -236,27 +236,27 @@ void BasicRoutingServiceApp::deregisterFromServiceLocator()
 }
 
 /**
- * Create the primary functional objects of this component. 
- *   @param appName Name of the application or component. 
+ * Create the primary functional objects of this component.
+ *   @param appName Name of the application or component.
  */
 void BasicRoutingServiceApp::initialize()
 {
     try
     {
-        // Create the adapter. 
+        // Create the adapter.
         mAdapter = mCommunicator->createObjectAdapter("BasicRoutingServiceAdapter");
 
-        mEventPublisher = new RoutingServiceEventPublisher(mAdapter); 
+        mEventPublisher = new RoutingServiceEventPublisher(mAdapter);
 
         // setup the logger
         ConfiguredIceLoggerPtr mIceLogger = createIceLogger(mAdapter);
         getLoggerFactory().setLogOutput(mIceLogger->getLogger());
 
-        // Create and configure the EndpointRegistry. 
+        // Create and configure the EndpointRegistry.
         ScriptProcessor* scriptProcesor(new LuaScriptProcessor());
         mEndpointRegistry = new EndpointRegistry(scriptProcesor, mEventPublisher);
 
-        // Publish the LocatorRegistry interface.  
+        // Publish the LocatorRegistry interface.
         mAdapter->add(mEndpointRegistry, mCommunicator->stringToIdentity(RegistryLocatorObjectId));
 
         // Create publish the SessionRouter interface.
@@ -276,7 +276,7 @@ void BasicRoutingServiceApp::initialize()
         mAdapter->activate();
 
         // Get a proxy to the interface for the Service Locator.
-        mServiceLocator = ServiceLocatorPrx::checkedCast(mCommunicator->propertyToProxy("LocatorService.Proxy")); 
+        mServiceLocator = ServiceLocatorPrx::checkedCast(mCommunicator->propertyToProxy("LocatorService.Proxy"));
 
         mInitialized = true;
     }
@@ -316,15 +316,15 @@ void BasicRoutingServiceApp::start(const string& name, const Ice::CommunicatorPt
     }
 
     // Plug back into the Asterisk SCF discovery system so that the interfaces we provide
-    // can be located. 
+    // can be located.
     registerWithServiceLocator();
 
     mRunning = true;
     lg(Info) << "Started";
 }
 
-/** 
- * Things we do to resume operation after a pause(). 
+/**
+ * Things we do to resume operation after a pause().
  */
 void BasicRoutingServiceApp::resume()
 {
@@ -333,7 +333,7 @@ void BasicRoutingServiceApp::resume()
         mAdapter->activate();
 
         // Plug back into the Asterisk SCF discovery system so that the interfaces we provide
-        // can be located. 
+        // can be located.
         registerWithServiceLocator();
     }
 
@@ -371,11 +371,11 @@ void BasicRoutingServiceApp::stop()
 } // end AsteriskSCF
 
 
-extern "C" 
+extern "C"
 {
-    ASTERISK_SCF_ICEBOX_EXPORT IceBox::Service* create(Ice::CommunicatorPtr communicator)
-    {
-        return new AsteriskSCF::BasicRoutingService::BasicRoutingServiceApp;
-    }
+ASTERISK_SCF_ICEBOX_EXPORT IceBox::Service* create(Ice::CommunicatorPtr communicator)
+{
+    return new AsteriskSCF::BasicRoutingService::BasicRoutingServiceApp;
+}
 }
 
diff --git a/src/BridgeManagerAccessor.cpp b/src/BridgeManagerAccessor.cpp
index f2f2d89..ab85026 100644
--- a/src/BridgeManagerAccessor.cpp
+++ b/src/BridgeManagerAccessor.cpp
@@ -30,25 +30,25 @@ namespace BasicRoutingService
 {
 
 /**
- * The private implementation of BridgeManagerAccessor. 
+ * The private implementation of BridgeManagerAccessor.
  */
 class BridgeManagerAccessorPriv
 {
 public:
-    BridgeManagerAccessorPriv(const ServiceLocatorPrx& locator) :  
+    BridgeManagerAccessorPriv(const ServiceLocatorPrx& locator) :
         mServiceLocator(locator), mInitialized(false)
     {
         initialize();
     }
 
     /**
-     * Initialization. Primarily involves acquring access to specific IceStorm topic. 
+     * Initialization. Primarily involves acquring access to specific IceStorm topic.
      */
     void initialize()
     {
         try
         {
-            // Use the locator to find the BridgeManger. 
+            // Use the locator to find the BridgeManger.
             ServiceLocatorParamsPtr nameparam = new ServiceLocatorParams;
             nameparam->category = BridgeServiceDiscoveryCategory;
             Ice::ObjectPrx bridgeManagerObject = mServiceLocator->locate(nameparam);
@@ -56,7 +56,7 @@ public:
         }
         catch(const Ice::Exception &e)
         {
-            cout << "Exception locating " << BridgeServiceDiscoveryCategory << ": " << e.what() << endl; 
+            cout << "Exception locating " << BridgeServiceDiscoveryCategory << ": " << e.what() << endl;
             return;
         }
 
@@ -69,7 +69,7 @@ public:
     }
 
     /**
-     * Utiltity to check for initialization state. 
+     * Utiltity to check for initialization state.
      */
     bool verifyInitialized()
     {
@@ -78,7 +78,7 @@ public:
             return true;
         }
 
-        // Try again to initialize. 
+        // Try again to initialize.
         initialize();
 
         if (!mInitialized)
@@ -104,9 +104,9 @@ private:
 };
 
 /**
- * Class constructor. 
+ * Class constructor.
  */
-BridgeManagerAccessor::BridgeManagerAccessor(const ServiceLocatorPrx& locator) : 
+BridgeManagerAccessor::BridgeManagerAccessor(const ServiceLocatorPrx& locator) :
     mImpl(new BridgeManagerAccessorPriv(locator))
 {
 }
diff --git a/src/BridgeManagerAccessor.h b/src/BridgeManagerAccessor.h
index f921541..0892930 100644
--- a/src/BridgeManagerAccessor.h
+++ b/src/BridgeManagerAccessor.h
@@ -28,18 +28,18 @@ namespace BasicRoutingService
 class BridgeManagerAccessorPriv;
 
 /**
- * A wrapper for the Bridge Manager proxy.  
+ * A wrapper for the Bridge Manager proxy.
  */
 class BridgeManagerAccessor
 {
 public:
-    BridgeManagerAccessor(const AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx& locator); 
+    BridgeManagerAccessor(const AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx& locator);
 
     const SessionCommunications::V1::BridgeManagerPrx& getBridgeManager() const;
     bool isInitialized();
 
 private:
-    boost::shared_ptr<BridgeManagerAccessorPriv> mImpl; // pimpl idiom applied. 
+    boost::shared_ptr<BridgeManagerAccessorPriv> mImpl; // pimpl idiom applied.
 };
 
 typedef boost::shared_ptr<BridgeManagerAccessor> BridgeManagerAccessorPtr;
diff --git a/src/EndpointRegistry.cpp b/src/EndpointRegistry.cpp
index 6209162..6eecc72 100644
--- a/src/EndpointRegistry.cpp
+++ b/src/EndpointRegistry.cpp
@@ -13,7 +13,7 @@
  * the GNU General Public License Version 2. See the LICENSE.txt file
  * at the top of the source tree.
  */
-#include <boost/regex.hpp> 
+#include <boost/regex.hpp>
 #include <boost/thread/thread.hpp>
 #include <boost/thread/shared_mutex.hpp>
 
@@ -41,7 +41,7 @@ struct RegisteredLocator
 {
 public:
     RegisteredLocator() {}
-    RegisteredLocator(const EndpointLocatorPrx& l, const RegExSeq &inputStringList) : 
+    RegisteredLocator(const EndpointLocatorPrx& l, const RegExSeq &inputStringList) :
         locator(l)
     {
         setRegEx(inputStringList);
@@ -68,13 +68,13 @@ typedef map<std::string, RegisteredLocator>::iterator EndpointLocatorMapIterator
 typedef map<std::string, RegisteredLocator> EndpointLocatorMap;
 
 /**
- * Provides the private implementation of the EndpointRegistry. 
+ * Provides the private implementation of the EndpointRegistry.
  */
 class EndpointRegistryPriv
 {
 public:
-    EndpointRegistryPriv(ScriptProcessor* scriptProcessor, const RoutingEventsPtr& eventPublisher) : 
-        mScriptProcessor(scriptProcessor), mEventPublisher(eventPublisher) 
+    EndpointRegistryPriv(ScriptProcessor* scriptProcessor, const RoutingEventsPtr& eventPublisher) :
+        mScriptProcessor(scriptProcessor), mEventPublisher(eventPublisher)
     {
     }
 
@@ -119,19 +119,19 @@ public:
 /**
  * Constructor.
  */
-EndpointRegistry::EndpointRegistry(ScriptProcessor* scriptProcessor, const RoutingEventsPtr& eventPublisher) : 
+EndpointRegistry::EndpointRegistry(ScriptProcessor* scriptProcessor, const RoutingEventsPtr& eventPublisher) :
     mImpl(new EndpointRegistryPriv(scriptProcessor, eventPublisher))
 {
 }
 
 /**
  * Register an EndpointLocator that can provide endpoints.
- *   @param id A unique identifier for the added EndpointLocator. 
- *   @param destinationIdRangeList A set of regular expressions that define the valid endpoint ids 
- *     the locator being added supports. 
+ *   @param id A unique identifier for the added EndpointLocator.
+ *   @param destinationIdRangeList A set of regular expressions that define the valid endpoint ids
+ *     the locator being added supports.
  */
-void EndpointRegistry::addEndpointLocator(const std::string& locatorId, const RegExSeq& regexList, const EndpointLocatorPrx& locator, 
-  const Ice::Current&)
+void EndpointRegistry::addEndpointLocator(const std::string& locatorId, const RegExSeq& regexList, const EndpointLocatorPrx& locator,
+    const Ice::Current&)
 {
     try
     {
@@ -169,7 +169,7 @@ void EndpointRegistry::addEndpointLocator(const std::string& locatorId, const Re
 
 /**
  * Remove an EndpointLocator.
- *   @param The unique id of the locator to remove. 
+ *   @param The unique id of the locator to remove.
  */
 void EndpointRegistry::removeEndpointLocator(const std::string& locatorId, const Ice::Current&)
 {
@@ -208,13 +208,13 @@ void EndpointRegistry::removeEndpointLocator(const std::string& locatorId, const
 }
 
 /**
- * Modify the range of device ids managed by a previously added EndpointLocator. 
- *   @param id A unique identifier for the added EndpointLocator. 
- *   @param A list of reqular expressions that define the the valid endpoint ids. This 
- *     set of regular expressions completely replaces the current set. 
+ * Modify the range of device ids managed by a previously added EndpointLocator.
+ *   @param id A unique identifier for the added EndpointLocator.
+ *   @param A list of reqular expressions that define the the valid endpoint ids. This
+ *     set of regular expressions completely replaces the current set.
  */
-void EndpointRegistry::setEndpointLocatorDestinationIds(const std::string& locatorId, 
-  const AsteriskSCF::Core::Routing::V1::RegExSeq& regExList, const Ice::Current&)
+void EndpointRegistry::setEndpointLocatorDestinationIds(const std::string& locatorId,
+    const AsteriskSCF::Core::Routing::V1::RegExSeq& regExList, const Ice::Current&)
 {
     try
     {
@@ -233,7 +233,7 @@ void EndpointRegistry::setEndpointLocatorDestinationIds(const std::string& locat
             throw DestinationNotFoundException(locatorId);
         }
 
-        // Replace the regular expression. 
+        // Replace the regular expression.
         existing->second.setRegEx(regExList);
         mImpl->mEventPublisher->setEndpointLocatorDestinationIdsEvent(locatorId, regExList, Event::SUCCESS);
 
@@ -248,8 +248,8 @@ void EndpointRegistry::setEndpointLocatorDestinationIds(const std::string& locat
 }
 
 /**
- * Returns the endpoints that match the specified destination id. 
- *   @param id String identifier of the the destination. 
+ * Returns the endpoints that match the specified destination id.
+ *   @param id String identifier of the the destination.
  */
 AsteriskSCF::Core::Endpoint::V1::EndpointSeq EndpointRegistry::lookup(const std::string& destination, const Ice::Current&)
 {
@@ -274,7 +274,7 @@ AsteriskSCF::Core::Endpoint::V1::EndpointSeq EndpointRegistry::lookup(const std:
 
     for(EndpointLocatorMapIterator entry = locatorMap.begin(); entry != locatorMap.end(); ++entry)
     {
-        // Test to see if the destination matches any of this entry's regular expressions. 
+        // Test to see if the destination matches any of this entry's regular expressions.
         for(vector<boost::regex>::iterator reg = entry->second.regexList.begin(); reg != entry->second.regexList.end(); ++reg)
         {
             if (boost::regex_match(modifiedDestination, *reg))
@@ -305,14 +305,14 @@ AsteriskSCF::Core::Endpoint::V1::EndpointSeq EndpointRegistry::lookup(const std:
 }
 
 /**
- * Configure this object with a ScriptProcessor. 
+ * Configure this object with a ScriptProcessor.
  */
 void EndpointRegistry::setScriptProcessor(ScriptProcessor* scriptProcessor)
-{ 
+{
     if (scriptProcessor == mImpl->mScriptProcessor.get())
     {
         // Calling this method with a pointer to the scriptProcessor that's already held in the shared_ptr would
-        // result in deleting the very object we're trying to set. 
+        // result in deleting the very object we're trying to set.
         return;
     }
 
@@ -322,7 +322,7 @@ void EndpointRegistry::setScriptProcessor(ScriptProcessor* scriptProcessor)
 }
 
 /**
- * Drop references to all EndpointLocators that have been registered. 
+ * Drop references to all EndpointLocators that have been registered.
  * Note: Admin function.
  */
 void EndpointRegistry::clearEndpointLocators()
@@ -332,10 +332,10 @@ void EndpointRegistry::clearEndpointLocators()
 }
 
 /**
- * Sends a policy string to the script processor. The default implementation is a no-op, 
- * but site-specific scripts may make use it. 
+ * Sends a policy string to the script processor. The default implementation is a no-op,
+ * but site-specific scripts may make use it.
  * Note: Admin function.
- *    @param policy A site-specific policy specification.  
+ *    @param policy A site-specific policy specification.
  */
 void EndpointRegistry::setPolicy(const std::string& policy)
 {
diff --git a/src/EndpointRegistry.h b/src/EndpointRegistry.h
index 090a145..d85a015 100644
--- a/src/EndpointRegistry.h
+++ b/src/EndpointRegistry.h
@@ -33,59 +33,59 @@ public:
     EndpointRegistry(ScriptProcessor* scriptProcessor, const AsteriskSCF::Core::Routing::V1::Event::RoutingEventsPtr& eventPublisher );
 
     /**
-     * Configure the EndpointRegistry to use a different scriptProcessor than the 
-     * one created with. 
+     * Configure the EndpointRegistry to use a different scriptProcessor than the
+     * one created with.
      */
     void setScriptProcessor(ScriptProcessor* scriptProcessor);
 
-public: 
+public:
     // LocatorRegistry overrides
 
     /**
      * Register an EndpointLocator that can provide endpoints.
-     *   @param id A unique identifier for the added EndpointLocator. 
-     *   @param destinationIdRangeList A set of regular expressions that define the valid endpoint ids 
-     *     the locator being added supports. 
+     *   @param id A unique identifier for the added EndpointLocator.
+     *   @param destinationIdRangeList A set of regular expressions that define the valid endpoint ids
+     *     the locator being added supports.
      */
-    void addEndpointLocator(const std::string& locatorId, const AsteriskSCF::Core::Routing::V1::RegExSeq& regexList, 
-      const AsteriskSCF::Core::Routing::V1::EndpointLocatorPrx& locator, const Ice::Current&);
+    void addEndpointLocator(const std::string& locatorId, const AsteriskSCF::Core::Routing::V1::RegExSeq& regexList,
+        const AsteriskSCF::Core::Routing::V1::EndpointLocatorPrx& locator, const Ice::Current&);
 
     /**
      * Remove an EndpointLocator from the registry. The EndpointLocator must have been previously added
-     * via a call to addEndpointLocator. 
-     *   @param The unique id of the locator to remove. 
+     * via a call to addEndpointLocator.
+     *   @param The unique id of the locator to remove.
      */
     void removeEndpointLocator(const std::string& locatorId, const Ice::Current& );
 
 
     /**
-     * Modify the range of ids managed by a previously added EndpointLocator. 
-     *   @param id A unique identifier for the added EndpointLocator. 
-     *   @param A list of reqular expressions that define the the valid endpoint ids. This 
-     *     set of regular expressions completely replaces the current set. 
+     * Modify the range of ids managed by a previously added EndpointLocator.
+     *   @param id A unique identifier for the added EndpointLocator.
+     *   @param A list of reqular expressions that define the the valid endpoint ids. This
+     *     set of regular expressions completely replaces the current set.
      */
-    void setEndpointLocatorDestinationIds(const std::string& locatorId, const AsteriskSCF::Core::Routing::V1::RegExSeq& regexList, 
-      const Ice::Current&);
+    void setEndpointLocatorDestinationIds(const std::string& locatorId, const AsteriskSCF::Core::Routing::V1::RegExSeq& regexList,
+        const Ice::Current&);
 
     // EndpointLocator overrides
 
     /**
-     * Returns the endpoints that match the specified destination id. 
-     *   @param id String identifier of the the destination. 
+     * Returns the endpoints that match the specified destination id.
+     *   @param id String identifier of the the destination.
      */
     AsteriskSCF::Core::Endpoint::V1::EndpointSeq lookup(const std::string& destination, const Ice::Current&);
 
 public:
 
     /**
-     * Drop references to all EndpointLocators that have been registered. 
+     * Drop references to all EndpointLocators that have been registered.
      */
     void clearEndpointLocators();
 
     /**
-     * Sends a policy string to the script processor. The default implementation is a no-op, 
-     * but site-specific scripts may make use it. 
-     *    @param policy A site-specific policy specification.  
+     * Sends a policy string to the script processor. The default implementation is a no-op,
+     * but site-specific scripts may make use it.
+     *    @param policy A site-specific policy specification.
      */
     void setPolicy(const std::string& policy);
 
diff --git a/src/LuaScriptProcessor.cpp b/src/LuaScriptProcessor.cpp
index 216d667..c4ce529 100644
--- a/src/LuaScriptProcessor.cpp
+++ b/src/LuaScriptProcessor.cpp
@@ -45,18 +45,18 @@ public:
 typedef std::vector<RawEndpointId> RawEndpointVector;
 
 /**
- * Provides the private implementation of the LuaScriptProcessor. 
+ * Provides the private implementation of the LuaScriptProcessor.
  */
 class LuaScriptProcessorPriv
 {
 public:
-    LuaScriptProcessorPriv() : 
+    LuaScriptProcessorPriv() :
         mInitialized(false)
     {
         initialize();
     }
 
-    ~LuaScriptProcessorPriv() 
+    ~LuaScriptProcessorPriv()
     {
         boost::shared_lock<boost::shared_mutex> lock(mLock);
 
@@ -139,7 +139,7 @@ public:
         }
         catch (...)
         {
-            // TBD... Most likely a script error of some type. 
+            // TBD... Most likely a script error of some type.
             lg(Error) << "Lua Script error in call to lookup().";
         }
     }
@@ -192,31 +192,31 @@ private:
 /**
  * Constructor.
  */
-LuaScriptProcessor::LuaScriptProcessor() : 
+LuaScriptProcessor::LuaScriptProcessor() :
     mImpl(new LuaScriptProcessorPriv())
 {
 }
 
 /**
- * Check with the script confirmLookup method to see if a lookup should be allowed. 
+ * Check with the script confirmLookup method to see if a lookup should be allowed.
  * Also allows the script to alter the destination.
- * @param destination The destination to be looked up. 
+ * @param destination The destination to be looked up.
  * @param modifiedDestination The destination as modified by the script.
- * @return true if the lookup is allowed. 
+ * @return true if the lookup is allowed.
  */
 bool LuaScriptProcessor::confirmLookup(const std::string& destination, std::string& modifiedDestination)
 {
-   return mImpl->confirmLookup(destination, modifiedDestination);
+    return mImpl->confirmLookup(destination, modifiedDestination);
 }
 
 /**
- * Sets a policy for the script. The default script implementation is a no-op. 
- * This allows for site-specific policy implementations. 
- * @param policy New value for the policy setting. 
+ * Sets a policy for the script. The default script implementation is a no-op.
+ * This allows for site-specific policy implementations.
+ * @param policy New value for the policy setting.
  */
 void LuaScriptProcessor::setPolicy(const string& policy)
 {
-   mImpl->setPolicy(policy);
+    mImpl->setPolicy(policy);
 }
 
 } // end BasicRoutingService
diff --git a/src/LuaScriptProcessor.h b/src/LuaScriptProcessor.h
index ffa05c8..aa34bfd 100644
--- a/src/LuaScriptProcessor.h
+++ b/src/LuaScriptProcessor.h
@@ -25,9 +25,9 @@ namespace AsteriskSCF
 namespace BasicRoutingService
 {
 class LuaScriptProcessorPriv;
- 
+
 /**
- * Wrapper for the Lua script processor. 
+ * Wrapper for the Lua script processor.
  */
 class LuaScriptProcessor : public ScriptProcessor
 {
diff --git a/src/RoutingAdmin.cpp b/src/RoutingAdmin.cpp
index c7b1a95..1974426 100644
--- a/src/RoutingAdmin.cpp
+++ b/src/RoutingAdmin.cpp
@@ -13,7 +13,7 @@
  * the GNU General Public License Version 2. See the LICENSE.txt file
  * at the top of the source tree.
  */
-#include <boost/regex.hpp> 
+#include <boost/regex.hpp>
 
 #include "RoutingAdmin.h"
 #include "EndpointRegistry.h"
@@ -26,30 +26,30 @@ namespace AsteriskSCF
 namespace BasicRoutingService
 {
 
-RoutingAdmin::RoutingAdmin(const EndpointRegistryPtr& endpointRegistry) : 
+RoutingAdmin::RoutingAdmin(const EndpointRegistryPtr& endpointRegistry) :
     mEndpointRegistry(endpointRegistry)
 {
 }
 
 /**
- * Drop references to all EndpointLocators that have been registered. 
+ * Drop references to all EndpointLocators that have been registered.
  */
 void RoutingAdmin::clearEndpointLocators(const Ice::Current&)
 {
-    // For now we just forward to the registry. Some type of authentication may be required 
-    // in the future, or perhaps the access to the interface is controlled externally. 
+    // For now we just forward to the registry. Some type of authentication may be required
+    // in the future, or perhaps the access to the interface is controlled externally.
     mEndpointRegistry->clearEndpointLocators();
 }
 
 /**
- * Sends a policy string to the script processor. The default implementation is a no-op, 
- * but site-specific scripts may make use it. 
- *    @param policy A site-specific policy specification.  
+ * Sends a policy string to the script processor. The default implementation is a no-op,
+ * but site-specific scripts may make use it.
+ *    @param policy A site-specific policy specification.
  */
 void RoutingAdmin::setPolicy(const std::string& policy, const Ice::Current&)
 {
-    // For now we just forward to the registry. Some type of authentication may be required 
-    // in the future, or perhaps the access to the interface is controlled externally. 
+    // For now we just forward to the registry. Some type of authentication may be required
+    // in the future, or perhaps the access to the interface is controlled externally.
     mEndpointRegistry->setPolicy(policy);
 }
 
diff --git a/src/RoutingAdmin.h b/src/RoutingAdmin.h
index fdec8af..dece098 100644
--- a/src/RoutingAdmin.h
+++ b/src/RoutingAdmin.h
@@ -25,7 +25,7 @@ namespace BasicRoutingService
 class EndpointRegistryPriv;
 
 /**
- * This class exists to provide separation between the EndpointRegistry and the administrative functions. 
+ * This class exists to provide separation between the EndpointRegistry and the administrative functions.
  */
 class RoutingAdmin : public AsteriskSCF::Core::Routing::V1::RoutingServiceAdmin
 {
@@ -35,14 +35,14 @@ public:
 public:  // RoutingServiceAdmin overrides
 
     /**
-     * Drop references to all EndpointLocators that have been registered. 
+     * Drop references to all EndpointLocators that have been registered.
      */
     void clearEndpointLocators(const ::Ice::Current&);
 
     /**
-     * Sends a policy string to the script processor. The default implementation is a no-op, 
-     * but site-specific scripts may make use it. 
-     *    @param policy A site-specific policy specification.  
+     * Sends a policy string to the script processor. The default implementation is a no-op,
+     * but site-specific scripts may make use it.
+     *    @param policy A site-specific policy specification.
      */
     void setPolicy(const ::std::string& policy, const ::Ice::Current&);
 
diff --git a/src/RoutingServiceEventPublisher.cpp b/src/RoutingServiceEventPublisher.cpp
index e0dd732..8aae895 100644
--- a/src/RoutingServiceEventPublisher.cpp
+++ b/src/RoutingServiceEventPublisher.cpp
@@ -34,19 +34,19 @@ namespace BasicRoutingService
 {
 
 /**
- * The private implementation of RoutingServiceEventPublisher. 
+ * The private implementation of RoutingServiceEventPublisher.
  */
 class RoutingServiceEventPublisherPriv
 {
 public:
-    RoutingServiceEventPublisherPriv(const Ice::ObjectAdapterPtr& adapter) :  
+    RoutingServiceEventPublisherPriv(const Ice::ObjectAdapterPtr& adapter) :
         mAdapter(adapter), mInitialized(false)
     {
         initialize();
     }
 
     /**
-     * Initialization. Primarily involves acquring access to specific IceStorm topic. 
+     * Initialization. Primarily involves acquring access to specific IceStorm topic.
      */
     void initialize()
     {
@@ -71,7 +71,7 @@ public:
 
         IceStorm::TopicPrx topic;
         try
-        {  
+        {
             topic = topicManager->retrieve(Event::TopicId);
         }
         catch(const IceStorm::NoSuchTopic&)
@@ -95,7 +95,7 @@ public:
     }
 
     /**
-     * Utiltity to check for initialization state. 
+     * Utiltity to check for initialization state.
      */
     bool isInitialized()
     {
@@ -104,7 +104,7 @@ public:
             return true;
         }
 
-        // Try again to initialize. 
+        // Try again to initialize.
         initialize();
 
         if (!mInitialized)
@@ -124,9 +124,9 @@ private:
 };
 
 /**
- * Class constructor. 
+ * Class constructor.
  */
-RoutingServiceEventPublisher::RoutingServiceEventPublisher(const Ice::ObjectAdapterPtr& adapter) : 
+RoutingServiceEventPublisher::RoutingServiceEventPublisher(const Ice::ObjectAdapterPtr& adapter) :
     mImpl(new RoutingServiceEventPublisherPriv(adapter))
 {
 }
@@ -134,8 +134,8 @@ RoutingServiceEventPublisher::RoutingServiceEventPublisher(const Ice::ObjectAdap
 /**
  * Send a message to the service's event topic to report a lookup event.
  */
-void RoutingServiceEventPublisher::lookupEvent(const std::string& destination, 
-  AsteriskSCF::Core::Routing::V1::Event::OperationResult result, const Ice::Current &)
+void RoutingServiceEventPublisher::lookupEvent(const std::string& destination,
+    AsteriskSCF::Core::Routing::V1::Event::OperationResult result, const Ice::Current &)
 {
     if (!mImpl->isInitialized())
     {
@@ -156,9 +156,9 @@ void RoutingServiceEventPublisher::lookupEvent(const std::string& destination,
 /**
  * Send a message to the service's event topic to report the addEndpointLocator event.
  */
-void RoutingServiceEventPublisher::addEndpointLocatorEvent(const std::string& locatorId, 
-  const ::AsteriskSCF::Core::Routing::V1::RegExSeq& regexList, AsteriskSCF::Core::Routing::V1::Event::OperationResult result,
-  const Ice::Current &)
+void RoutingServiceEventPublisher::addEndpointLocatorEvent(const std::string& locatorId,
+    const ::AsteriskSCF::Core::Routing::V1::RegExSeq& regexList, AsteriskSCF::Core::Routing::V1::Event::OperationResult result,
+    const Ice::Current &)
 {
     if (!mImpl->isInitialized())
     {
@@ -178,8 +178,8 @@ void RoutingServiceEventPublisher::addEndpointLocatorEvent(const std::string& lo
 /**
  * Send a message to the service's event topic to report the removeEndpointLocator event.
  */
-void RoutingServiceEventPublisher::removeEndpointLocatorEvent(const std::string& locatorId, 
-  AsteriskSCF::Core::Routing::V1::Event::OperationResult result, const Ice::Current &)
+void RoutingServiceEventPublisher::removeEndpointLocatorEvent(const std::string& locatorId,
+    AsteriskSCF::Core::Routing::V1::Event::OperationResult result, const Ice::Current &)
 {
     if (!mImpl->isInitialized())
     {
@@ -199,9 +199,9 @@ void RoutingServiceEventPublisher::removeEndpointLocatorEvent(const std::string&
 /**
  * Send a message to the service's event topic to report the setEndpointLocatorDestinationIds event.
  */
-void RoutingServiceEventPublisher::setEndpointLocatorDestinationIdsEvent(const std::string& locatorId, 
-  const AsteriskSCF::Core::Routing::V1::RegExSeq& regexList, AsteriskSCF::Core::Routing::V1::Event::OperationResult result,
-  const Ice::Current &)
+void RoutingServiceEventPublisher::setEndpointLocatorDestinationIdsEvent(const std::string& locatorId,
+    const AsteriskSCF::Core::Routing::V1::RegExSeq& regexList, AsteriskSCF::Core::Routing::V1::Event::OperationResult result,
+    const Ice::Current &)
 {
     if (!mImpl->isInitialized())
     {
diff --git a/src/RoutingServiceEventPublisher.h b/src/RoutingServiceEventPublisher.h
index bc01924..b3972b6 100644
--- a/src/RoutingServiceEventPublisher.h
+++ b/src/RoutingServiceEventPublisher.h
@@ -27,48 +27,48 @@ namespace BasicRoutingService
 class RoutingServiceEventPublisherPriv;
 
 /**
- * Publishes key events to the rest of the system. 
+ * Publishes key events to the rest of the system.
  */
 class RoutingServiceEventPublisher : public ::AsteriskSCF::Core::Routing::V1::Event::RoutingEvents
 {
 public:
-    RoutingServiceEventPublisher(const Ice::ObjectAdapterPtr& adapter); 
+    RoutingServiceEventPublisher(const Ice::ObjectAdapterPtr& adapter);
 
     // Overrides
 
     /**
      * Send a message to the service's event topic to report a lookup event.
-     *  @param destination The destination to be looked up. 
-     *  @param result Informs event listeners of the operations success or failure. 
+     *  @param destination The destination to be looked up.
+     *  @param result Informs event listeners of the operations success or failure.
      */
     void lookupEvent(const std::string& destination, AsteriskSCF::Core::Routing::V1::Event::OperationResult result,
-      const Ice::Current&);
+        const Ice::Current&);
 
     /**
      * Send a message to the service's event topic to report an addEndpointLocator event.
-     *  @param locatorId The identity of the EndpointLocator being added. 
-     *  @param regexList List of regex strings used to identify the destinations available by this locator. 
-     *  @param result Informs event listeners of the operations success or failure. 
+     *  @param locatorId The identity of the EndpointLocator being added.
+     *  @param regexList List of regex strings used to identify the destinations available by this locator.
+     *  @param result Informs event listeners of the operations success or failure.
      */
-    void addEndpointLocatorEvent(const std::string& locatorId, const AsteriskSCF::Core::Routing::V1::RegExSeq& regexList, 
-      AsteriskSCF::Core::Routing::V1::Event::OperationResult result, const Ice::Current&);
+    void addEndpointLocatorEvent(const std::string& locatorId, const AsteriskSCF::Core::Routing::V1::RegExSeq& regexList,
+        AsteriskSCF::Core::Routing::V1::Event::OperationResult result, const Ice::Current&);
 
     /**
      * Send a message to the service's event topic to report a removeEndpointLocator event.
-     *  @param locatorId The identity of the EndpointLocator being removed. 
-     *  @param result Informs event listeners of the operations success or failure. 
+     *  @param locatorId The identity of the EndpointLocator being removed.
+     *  @param result Informs event listeners of the operations success or failure.
      */
     void removeEndpointLocatorEvent(const std::string& locatorId, AsteriskSCF::Core::Routing::V1::Event::OperationResult result,
-      const Ice::Current&);
+        const Ice::Current&);
 
     /**
      * Send a message to the service's event topic to report a aetEndpointLocatorDestinationIds event.
-     *  @param locatorId The identity of the EndpointLocator whose destination specifications should be changed. 
-     *  @param regexList New list of regex strings to be used to identify the destinations available by this locator. 
-     *  @param result Informs event listeners of the operations success or failure. 
+     *  @param locatorId The identity of the EndpointLocator whose destination specifications should be changed.
+     *  @param regexList New list of regex strings to be used to identify the destinations available by this locator.
+     *  @param result Informs event listeners of the operations success or failure.
      */
-    void setEndpointLocatorDestinationIdsEvent(const std::string& locatorId, const AsteriskSCF::Core::Routing::V1::RegExSeq& regexList, 
-      AsteriskSCF::Core::Routing::V1::Event::OperationResult result, const Ice::Current&);
+    void setEndpointLocatorDestinationIdsEvent(const std::string& locatorId, const AsteriskSCF::Core::Routing::V1::RegExSeq& regexList,
+        AsteriskSCF::Core::Routing::V1::Event::OperationResult result, const Ice::Current&);
 
 
     /**
@@ -82,7 +82,7 @@ public:
     void setPolicyEvent(const std::string& policy, const Ice::Current&);
 
 private:
-    boost::shared_ptr<RoutingServiceEventPublisherPriv> mImpl; // pimpl idiom applied. 
+    boost::shared_ptr<RoutingServiceEventPublisherPriv> mImpl; // pimpl idiom applied.
 };
 
 } // end BasicRoutingService
diff --git a/src/ScriptProcessor.h b/src/ScriptProcessor.h
index 062d45a..3d549e6 100644
--- a/src/ScriptProcessor.h
+++ b/src/ScriptProcessor.h
@@ -22,7 +22,7 @@ namespace AsteriskSCF
 namespace BasicRoutingService
 {
 /**
- * Interface for all script processors. 
+ * Interface for all script processors.
  */
 class ScriptProcessor
 {
diff --git a/src/SessionRouter.cpp b/src/SessionRouter.cpp
index 966440d..9aec3aa 100644
--- a/src/SessionRouter.cpp
+++ b/src/SessionRouter.cpp
@@ -36,7 +36,7 @@ Logger &lg = getLoggerFactory().getLogger("AsteriskSCF.BasicRoutingService");
 }
 
 /**
- * TBD... This code should be refactored for AMD and use AMI on outgoing calls. 
+ * TBD... This code should be refactored for AMD and use AMI on outgoing calls.
  */
 namespace AsteriskSCF
 {
@@ -46,12 +46,12 @@ namespace BasicRoutingService
 class SessionListenerImpl : public SessionListener
 {
 public:
-    SessionListenerImpl(Ice::ObjectAdapterPtr adapter, const SessionPrx& session) : 
+    SessionListenerImpl(Ice::ObjectAdapterPtr adapter, const SessionPrx& session) :
         mAdapter(adapter), mTerminated(false), mListenerPrx(0)
     {
     }
 
-    SessionListenerImpl(Ice::ObjectAdapterPtr adapter, SessionSeq& sessionSequence) : 
+    SessionListenerImpl(Ice::ObjectAdapterPtr adapter, SessionSeq& sessionSequence) :
         mAdapter(adapter), mTerminated(false), mListenerPrx(0)
     {
     }
@@ -64,7 +64,7 @@ public:
     {
     }
 
-    void flashed(const SessionPrx& session, const Ice::Current&) 
+    void flashed(const SessionPrx& session, const Ice::Current&)
     {
     }
 
@@ -114,7 +114,7 @@ public:
 
     /**
      * Adds a session to be tracked by the listener. This operation doesn't actually call addListener on the Session.
-     * When we ask an endpoint to create a session, we pass our listener in to the creation process. 
+     * When we ask an endpoint to create a session, we pass our listener in to the creation process.
      * So the listener has been attached to the session, but we just need to keep track of it in this object.
      */
     void addSession(SessionPrx session)
@@ -124,7 +124,7 @@ public:
     }
 
     /**
-     * Add a session to be tracked by this listener, and attach this listener to the session. 
+     * Add a session to be tracked by this listener, and attach this listener to the session.
      */
     void addSessionAndListen(SessionPrx session)
     {
@@ -159,7 +159,7 @@ public:
     }
 
     /**
-     * Stop listening to all sessions we're monitoring. 
+     * Stop listening to all sessions we're monitoring.
      */
     void unregister()
     {
@@ -212,14 +212,14 @@ private:
 typedef IceInternal::Handle<SessionListenerImpl> SessionListenerImplPtr;
 
 /**
- * This class uses RAII to manage the lifecycle of a session listener. 
- * It's sort of a smart pointer for the listener, but it's tightly 
- * coupled to the specifics of our private impl. 
+ * This class uses RAII to manage the lifecycle of a session listener.
+ * It's sort of a smart pointer for the listener, but it's tightly
+ * coupled to the specifics of our private impl.
  */
 class SessionListenerAllocator
 {
 public:
-    SessionListenerAllocator(Ice::ObjectAdapterPtr adapter, const SessionPrx& session) 
+    SessionListenerAllocator(Ice::ObjectAdapterPtr adapter, const SessionPrx& session)
         : mSessionListener(new SessionListenerImpl(adapter, session)),
           mAdapter(adapter)
     {
@@ -230,7 +230,7 @@ public:
         mSessionListener->addSessionAndListen(session);
     }
 
-    SessionListenerAllocator(Ice::ObjectAdapterPtr adapter, SessionSeq& sessionSequence) 
+    SessionListenerAllocator(Ice::ObjectAdapterPtr adapter, SessionSeq& sessionSequence)
         : mSessionListener(new SessionListenerImpl(adapter, sessionSequence)),
           mAdapter(adapter)
     {
@@ -240,15 +240,15 @@ public:
 
         for(SessionSeq::iterator s = sessionSequence.begin(); s != sessionSequence.end(); ++s)
         {
-           mSessionListener->addSessionAndListen(*s);
+            mSessionListener->addSessionAndListen(*s);
         }
     }
 
     ~SessionListenerAllocator()
     {
-        // Our private SessionListener implementation adds itself as a servant. It 
-        // can't really undo that without getting itself deleted. So undo it 
-        // in proper order. 
+        // Our private SessionListener implementation adds itself as a servant. It
+        // can't really undo that without getting itself deleted. So undo it
+        // in proper order.
         try
         {
             lg(Debug) << "About to unregister the listener..." << std::endl ;
@@ -263,7 +263,7 @@ public:
         try
         {
             // Only the adapter holds a smart pointer for this servant, so this will
-            // cause it to be delted. 
+            // cause it to be delted.
             lg(Debug) << "Removing listener from object adapter." ;
             mAdapter->remove(mSessionListener->getProxy()->ice_getIdentity());
         }
@@ -273,10 +273,10 @@ public:
         }
     }
 
-	SessionListenerImpl* operator->()
-	{
-		return mSessionListener;
-	}
+    SessionListenerImpl* operator->()
+    {
+        return mSessionListener;
+    }
 
 private:
     SessionListenerImpl *mSessionListener;
@@ -285,18 +285,18 @@ private:
 
 class SessionRouterPriv
 {
-public: 
+public:
     SessionRouterPriv(const Ice::ObjectAdapterPtr& objectAdapter, const EndpointRegistryPtr& endpointRegistry,
-      const AsteriskSCF::Core::Routing::V1::Event::RoutingEventsPtr& eventPublisher) : 
-        mAdapter(objectAdapter), 
-        mEndpointRegistry(endpointRegistry), 
-        mEventPublisher(eventPublisher) 
+        const AsteriskSCF::Core::Routing::V1::Event::RoutingEventsPtr& eventPublisher) :
+        mAdapter(objectAdapter),
+        mEndpointRegistry(endpointRegistry),
+        mEventPublisher(eventPublisher)
     {
     }
 
-    ~SessionRouterPriv()  
+    ~SessionRouterPriv()
     {
-     }
+    }
 
     void setBridgeAccessor(BridgeManagerAccessorPtr bridgeAccessor)
     {
@@ -308,7 +308,7 @@ public:
         EndpointSeq endpoints;
         try
         {
-            // Lookup the destination. 
+            // Lookup the destination.
             endpoints = mEndpointRegistry->lookup(destination, current);
 
             if (endpoints.empty())
@@ -323,7 +323,7 @@ public:
         }
         catch (const Ice::Exception &)
         {
-            // Probably couldn't access the EndpointLocator of the registered channel. 
+            // Probably couldn't access the EndpointLocator of the registered channel.
             throw EndpointUnreachableException(destination);
         }
 
@@ -356,12 +356,12 @@ public:
 };
 
 SessionRouter::SessionRouter(const Ice::ObjectAdapterPtr& objectAdapter, const EndpointRegistryPtr& endpointRegistry,
-  const AsteriskSCF::Core::Routing::V1::Event::RoutingEventsPtr& eventPublisher) : 
+    const AsteriskSCF::Core::Routing::V1::Event::RoutingEventsPtr& eventPublisher) :
     mImpl(new SessionRouterPriv(objectAdapter, endpointRegistry, eventPublisher))
 {
 }
 
-SessionRouter::~SessionRouter() 
+SessionRouter::~SessionRouter()
 {
     mImpl.reset();
 }
@@ -372,18 +372,18 @@ void SessionRouter::setBridgeManagerAccessor(const BridgeManagerAccessorPtr& bri
 }
 
 /**
- * Route the session by looking up the destination endpoint and configuring a complimentary session for the destination. 
+ * Route the session by looking up the destination endpoint and configuring a complimentary session for the destination.
  *   TBD - Need to rework with asynch support.
  */
-void SessionRouter::routeSession(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const std::string& destination, 
-  const Ice::Current& current)
+void SessionRouter::routeSession(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const std::string& destination,
+    const Ice::Current& current)
 {
     lg(Debug) << "routeSession() entered with destination " << destination << std::endl;
 
-    // Create a listener for the source to handle early termination. 
-    // The wrapper we're using will remove the listener and free it when 
-    // this method is left. 
-    SessionListenerAllocator listener(mImpl->mAdapter, source); 
+    // Create a listener for the source to handle early termination.
+    // The wrapper we're using will remove the listener and free it when
+    // this method is left.
+    SessionListenerAllocator listener(mImpl->mAdapter, source);
 
     // Route the destination
     lg(Debug) << "routeSession(): Routing destination " << destination << std::endl;
@@ -391,13 +391,13 @@ void SessionRouter::routeSession(const AsteriskSCF::SessionCommunications::V1::S
 
     // Add a session
     SessionSeq newSessions;
-    for (EndpointSeq::iterator e = endpoints.begin(); e != endpoints.end(); ++e) 
+    for (EndpointSeq::iterator e = endpoints.begin(); e != endpoints.end(); ++e)
     {
         try
         {
             SessionEndpointPrx sessionEndpoint = SessionEndpointPrx::checkedCast(*e);
 
-            // Create a session on the destination. 
+            // Create a session on the destination.
             lg(Debug) << "routeSession(): Creating a session at destination " << destination;
             SessionPrx destSession = sessionEndpoint->createSession(destination, listener->getProxy());
             lg(Debug) << "  Session proxy: " << destSession->ice_toString() << std::endl;
@@ -422,7 +422,7 @@ void SessionRouter::routeSession(const AsteriskSCF::SessionCommunications::V1::S
         throw SourceTerminatedPreBridgingException(source->getEndpoint()->getId());
     }
     // We're through listening, and we will probably interfere with the Bridge's functionality if
-    // we keep listening. 
+    // we keep listening.
     listener->unregister();
 
     // Create the bridge
@@ -445,7 +445,7 @@ void SessionRouter::routeSession(const AsteriskSCF::SessionCommunications::V1::S
 
         throw BridgingException(source->getEndpoint()->getId(), destination);
     }
-   
+
 
     // Forward the start to all the destinations routed to.
     lg(Debug) << "routeSession(): Sending start() to newly routed destination.";
@@ -455,13 +455,13 @@ void SessionRouter::routeSession(const AsteriskSCF::SessionCommunications::V1::S
 
 /**
  * Replace one session in a Bridge with a new
- * session routable by the destination param. 
- *   @param source The session initiating the routing event. 
- *   @param destination The address or id of the destination to be routed. 
+ * session routable by the destination param.
+ *   @param source The session initiating the routing event.
+ *   @param destination The address or id of the destination to be routed.
  */
-void SessionRouter::connectBridgedSessionsWithDestination(const SessionPrx& sessionToReplace, 
-                                                          const ::std::string& destination,
-                                                          const Ice::Current& current)
+void SessionRouter::connectBridgedSessionsWithDestination(const SessionPrx& sessionToReplace,
+    const ::std::string& destination,
+    const Ice::Current& current)
 {
     lg(Debug) << "connectBridgedSessionsWithDestination() entered with destination " << destination << std::endl;
 
@@ -507,8 +507,8 @@ void SessionRouter::connectBridgedSessionsWithDestination(const SessionPrx& sess
     }
     catch(const Ice::Exception &e)
     {
-       lg(Error) << "Unable to get list of sesssions for bridge in connectBridgedSessionsWithDestination(). " ;
-       throw e; // rethrow
+        lg(Error) << "Unable to get list of sesssions for bridge in connectBridgedSessionsWithDestination(). " ;
+        throw e; // rethrow
     }
 
     SessionSeq remainingSessions;
@@ -520,11 +520,11 @@ void SessionRouter::connectBridgedSessionsWithDestination(const SessionPrx& sess
         }
     }
 
-    // Create a listener for the sessions not being replaced to handle early termination. 
-    // The wrapper we're using will remove the listener and free it when 
-    // this method is left. 
+    // Create a listener for the sessions not being replaced to handle early termination.
+    // The wrapper we're using will remove the listener and free it when
+    // this method is left.
     lg(Debug) << "connectBridgedSessionsWithDestination(): Attaching listener";
-    SessionListenerAllocator listener(mImpl->mAdapter, remainingSessions); 
+    SessionListenerAllocator listener(mImpl->mAdapter, remainingSessions);
 
     // Route the destination
     lg(Debug) << "connectBridgedSessionsWithDestination(): Routing destination " << destination;
@@ -532,13 +532,13 @@ void SessionRouter::connectBridgedSessionsWithDestination(const SessionPrx& sess
 
     // Add a session
     SessionSeq newSessions;
-    for (EndpointSeq::iterator e = endpoints.begin(); e != endpoints.end(); ++e) 
+    for (EndpointSeq::iterator e = endpoints.begin(); e != endpoints.end(); ++e)
     {
         try
         {
             SessionEndpointPrx sessionEndpoint = SessionEndpointPrx::checkedCast(*e);
 
-            // Create a session on the destination. 
+            // Create a session on the destination.
             SessionPrx destSession = sessionEndpoint->createSession(destination, listener->getProxy());
             listener->addSession(destSession);
             newSessions.push_back(destSession);
@@ -564,7 +564,7 @@ void SessionRouter::connectBridgedSessionsWithDestination(const SessionPrx& sess
         throw SourceTerminatedPreBridgingException(remainingSessions[0]->getEndpoint()->getId());
     }
     // We're through listening, and we will probably interfere with the Bridge's functionality if
-    // we keep listening. 
+    // we keep listening.
     listener->unregister();
 
     // Modify the bridge
@@ -585,21 +585,21 @@ void SessionRouter::connectBridgedSessionsWithDestination(const SessionPrx& sess
 } // SessionRouter::connectBridgedSessionsWithDestination(...)
 
 /**
- * Replace one session in a Bridge with sessions from another bridge. 
+ * Replace one session in a Bridge with sessions from another bridge.
  * No routing is actually performed. This operation exists here for consistency,
- * since connectBridgedSessionsWithDestination(...) is implemented by this interface. 
- * @param sessionToReplace The session that is to be replaced in a 
+ * since connectBridgedSessionsWithDestination(...) is implemented by this interface.
+ * @param sessionToReplace The session that is to be replaced in a
  *   bridge. The bridge obejct associated with this session will survive, and
- *   all sessions bridged to this session will be kept in the bridge. 
+ *   all sessions bridged to this session will be kept in the bridge.
  * @param bridgedSession This session is assumed to be bridged to the sessions
  *   that are to be moved to another bridge. The bridgedSession itself will not
  *   be connected to the other bridge. The sessions being moved will be removed from
- *   their current bridge before being added to the bridge currenltly attached to 
- *   sessionToReplace. 
+ *   their current bridge before being added to the bridge currenltly attached to
+ *   sessionToReplace.
  */
-void SessionRouter::connectBridgedSessions(const SessionPrx& sessionToReplace, 
-                                           const SessionPrx& bridgedSession,
-                                           const Ice::Current&)
+void SessionRouter::connectBridgedSessions(const SessionPrx& sessionToReplace,
+    const SessionPrx& bridgedSession,
+    const Ice::Current&)
 {
     lg(Debug) << "connectBridgedSessions() entered... " << std::endl;
 
@@ -653,18 +653,18 @@ void SessionRouter::connectBridgedSessions(const SessionPrx& sessionToReplace,
     }
     catch(const Ice::Exception &e)
     {
-       lg(Error) << "connectBridgedSessions(): Unable to get list of sesssions for bridge in connectBridgedSessions(). " ;
-       throw e; // rethrow
+        lg(Error) << "connectBridgedSessions(): Unable to get list of sesssions for bridge in connectBridgedSessions(). " ;
+        throw e; // rethrow
     }
 
 
-    // Create a listener for the sessions not being replaced to handle early termination. 
-    // The wrapper we're using will remove the listener and free it when 
-    // this method is left. 
+    // Create a listener for the sessions not being replaced to handle early termination.
+    // The wrapper we're using will remove the listener and free it when
+    // this method is left.
     lg(Debug) << "connectBridgedSessions(): Adding listener to " << preserveSessions.size() << " session(s)." ;
-    SessionListenerAllocator listener(mImpl->mAdapter, preserveSessions); 
+    SessionListenerAllocator listener(mImpl->mAdapter, preserveSessions);
 
-    // Get the bridge for the sessions being moved. 
+    // Get the bridge for the sessions being moved.
 
     BridgePrx oldBridge(0);
     count = 0;
@@ -703,7 +703,7 @@ void SessionRouter::connectBridgedSessions(const SessionPrx& sessionToReplace,
     {
         try
         {
-            // Remove the sessions being moved from their old bridge. 
+            // Remove the sessions being moved from their old bridge.
             SessionSeq allSessions = oldBridge->listSessions();
             for(SessionSeq::iterator s = allSessions.begin(); s != allSessions.end(); ++s)
             {
@@ -719,7 +719,7 @@ void SessionRouter::connectBridgedSessions(const SessionPrx& sessionToReplace,
         catch(const Ice::Exception&)
         {
             lg(Warning) << "connectBridgedSessions(): Unable to remove sessions in connectBridgedSessions(). " ;
-            // We won't give up because of this. 
+            // We won't give up because of this.
         }
     }
 
@@ -730,11 +730,11 @@ void SessionRouter::connectBridgedSessions(const SessionPrx& sessionToReplace,
         throw SourceTerminatedPreBridgingException(preserveSessions[0]->getEndpoint()->getId());
     }
     // We're through listening, and we will probably interfere with the Bridge's functionality if
-    // we keep listening. 
+    // we keep listening.
     lg(Debug) << "connectBridgedSessions(): Removing listener. " ;
     listener->unregister();
 
-    // Now replace the sessions. 
+    // Now replace the sessions.
     try
     {
         lg(Debug) << "connectBridgedSessions(): Asking bridge to replace sessions." ;
@@ -742,8 +742,8 @@ void SessionRouter::connectBridgedSessions(const SessionPrx& sessionToReplace,
     }
     catch(const Ice::Exception& e)
     {
-       lg(Error) << "connectBridgedSessions(): Unable to replace session for bridge in connectBridgedSessions(). " ;
-       throw e; // rethrow
+        lg(Error) << "connectBridgedSessions(): Unable to replace session for bridge in connectBridgedSessions(). " ;
+        throw e; // rethrow
     }
 
 } // SessionRouter::connectBridgedSessions(...)
diff --git a/src/SessionRouter.h b/src/SessionRouter.h
index 87d0fd0..3453436 100644
--- a/src/SessionRouter.h
+++ b/src/SessionRouter.h
@@ -29,52 +29,52 @@ namespace BasicRoutingService
 class SessionRouterPriv;
 
 /**
- * This class routes sessions. 
+ * This class routes sessions.
  */
 class SessionRouter : public AsteriskSCF::SessionCommunications::V1::SessionRouter
 {
 public:
     SessionRouter(const Ice::ObjectAdapterPtr& objectAdapter,  const EndpointRegistryPtr& endpointRegistry,
-      const AsteriskSCF::Core::Routing::V1::Event::RoutingEventsPtr& eventPublisher);
+        const AsteriskSCF::Core::Routing::V1::Event::RoutingEventsPtr& eventPublisher);
     ~SessionRouter();
 
     void setBridgeManagerAccessor(const BridgeManagerAccessorPtr& bridgeAccessor);
 
-public:  
+public:
     // SessionRouter overrides
 
     /**
      * Execute the routing functionality for the given session. The given session
-     * will be bridged with the destination if it is successfully routed. 
-     *   @param source The session initiating the routing event. 
-     *   @param destination The address or id of the destination to be routed. 
+     * will be bridged with the destination if it is successfully routed.
+     *   @param source The session initiating the routing event.
+     *   @param destination The address or id of the destination to be routed.
      */
-    void routeSession(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, 
-                      const std::string& destination, 
... 22125 lines suppressed ...


-- 
asterisk-scf/integration/routing.git



More information about the asterisk-scf-commits mailing list