[asterisk-scf-commits] asterisk-scf/integration/bridging.git branch "single-api-lib" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Jan 13 09:10:36 CST 2011


branch "single-api-lib" has been created
        at  f5dcb73aa6740cbfdcd9acf67dee0749d7591b0a (commit)

- Log -----------------------------------------------------------------
commit f5dcb73aa6740cbfdcd9acf67dee0749d7591b0a
Author: David M. Lee <dlee at digium.com>
Date:   Wed Jan 12 18:27:56 2011 -0600

    Fix slice #includes

diff --git a/src/MediaSplicer.h b/src/MediaSplicer.h
index a8154db..b600235 100644
--- a/src/MediaSplicer.h
+++ b/src/MediaSplicer.h
@@ -16,7 +16,7 @@
 #pragma once
 
 #include <IceUtil/Shared.h>
-#include <Media/MediaIf.h>
+#include <AsteriskSCF/Media/MediaIf.h>
 #include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 #include <memory>
 

commit d1f56f5716ef3a5ab6efc8947e17660058b23465
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Fri Jan 7 14:47:21 2011 -0600

    Adjust #includes to use <> and prefix paths with AsteriskSCF.

diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index efb0221..68e6ed0 100755
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -14,9 +14,9 @@
  * at the top of the source tree.
  */
 #include "BridgeImpl.h"
-#include "logger.h"
-#include <System/Component/ComponentServiceIf.h>
-#include <SessionCommunications/SessionCommunicationsIf.h>
+#include <AsteriskSCF/logger.h>
+#include <AsteriskSCF/System/Component/ComponentServiceIf.h>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 #include <Ice/Ice.h>
 #include <memory>
 #include <algorithm>
diff --git a/src/BridgeImpl.h b/src/BridgeImpl.h
index 8044d24..dffb7c4 100644
--- a/src/BridgeImpl.h
+++ b/src/BridgeImpl.h
@@ -15,7 +15,7 @@
  */
 #pragma once
 
-#include <SessionCommunications/SessionCommunicationsIf.h>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 #include <boost/thread/shared_mutex.hpp>
 #include <vector>
 #include "MediaSplicer.h"
diff --git a/src/BridgeListenerMgr.h b/src/BridgeListenerMgr.h
index 041fd0d..ba4db4a 100644
--- a/src/BridgeListenerMgr.h
+++ b/src/BridgeListenerMgr.h
@@ -18,7 +18,7 @@
 #include <string>
 #include <Ice/Ice.h>
 #include "ListenerManager.h"
-#include <SessionCommunications/SessionCommunicationsIf.h>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 
 namespace AsteriskSCF
 {
diff --git a/src/BridgeManagerImpl.cpp b/src/BridgeManagerImpl.cpp
index dd5c293..c820cc2 100644
--- a/src/BridgeManagerImpl.cpp
+++ b/src/BridgeManagerImpl.cpp
@@ -19,7 +19,7 @@
 #include <boost/thread/locks.hpp>
 #include "BridgeListenerMgr.h"
 #include "BridgeManagerListenerMgr.h"
-#include "logger.h"
+#include <AsteriskSCF/logger.h>
 
 using namespace AsteriskSCF::System::Logging;
 
diff --git a/src/BridgeManagerImpl.h b/src/BridgeManagerImpl.h
index c2a18a5..014106c 100644
--- a/src/BridgeManagerImpl.h
+++ b/src/BridgeManagerImpl.h
@@ -15,7 +15,7 @@
  */
 #pragma once
 
-#include <SessionCommunications/SessionCommunicationsIf.h>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 #include <boost/thread/shared_mutex.hpp>
 #include <vector>
 
diff --git a/src/BridgeManagerListenerMgr.h b/src/BridgeManagerListenerMgr.h
index 1579772..b2758ab 100644
--- a/src/BridgeManagerListenerMgr.h
+++ b/src/BridgeManagerListenerMgr.h
@@ -18,7 +18,7 @@
 #include <string>
 #include <Ice/Ice.h>
 #include "ListenerManager.h"
-#include <SessionCommunications/SessionCommunicationsIf.h>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 
 namespace AsteriskSCF
 {
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8cf2694..2e42923 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -21,8 +21,7 @@ asterisk_scf_component_add_boost_libraries(bridgeservice 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)
 
 asterisk_scf_component_build_icebox(bridgeservice)
 target_link_libraries(bridgeservice logging-client)
diff --git a/src/MediaSplicer.cpp b/src/MediaSplicer.cpp
index 3f87f23..8c5d10a 100755
--- a/src/MediaSplicer.cpp
+++ b/src/MediaSplicer.cpp
@@ -16,7 +16,7 @@
 #include "MediaSplicer.h"
 #include <IceUtil/Shared.h>
 #include <IceUtil/Handle.h>
-#include "logger.h"
+#include <AsteriskSCF/logger.h>
 
 using namespace AsteriskSCF::System::Logging;
 namespace
diff --git a/src/MediaSplicer.h b/src/MediaSplicer.h
index 466bb1d..a8154db 100644
--- a/src/MediaSplicer.h
+++ b/src/MediaSplicer.h
@@ -17,7 +17,7 @@
 
 #include <IceUtil/Shared.h>
 #include <Media/MediaIf.h>
-#include <SessionCommunications/SessionCommunicationsIf.h>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 #include <memory>
 
 namespace AsteriskSCF
diff --git a/src/Service.cpp b/src/Service.cpp
index 406760d..99820e9 100644
--- a/src/Service.cpp
+++ b/src/Service.cpp
@@ -19,9 +19,9 @@
 #include <IceBox/IceBox.h>
 #include <IceStorm/IceStorm.h>
 
-#include "Core/Discovery/ServiceLocatorIf.h"
-#include "IceLogger.h"
-#include "logger.h"
+#include <AsteriskSCF/Logger/IceLogger.h>
+#include <AsteriskSCF/logger.h>
+#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
 
 using namespace AsteriskSCF::System::Logging;
 
diff --git a/test/BridgeListenerI.h b/test/BridgeListenerI.h
index 7f56615..8e0e255 100644
--- a/test/BridgeListenerI.h
+++ b/test/BridgeListenerI.h
@@ -15,7 +15,7 @@
  */
 #pragma once
 
-#include <SessionCommunications/SessionCommunicationsIf.h>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 
 namespace AsteriskSCF
 {
diff --git a/test/BridgeManagerListenerI.h b/test/BridgeManagerListenerI.h
index 206e5c1..fbf4854 100644
--- a/test/BridgeManagerListenerI.h
+++ b/test/BridgeManagerListenerI.h
@@ -15,7 +15,7 @@
  */
 #pragma once
 
-#include <SessionCommunications/SessionCommunicationsIf.h>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
 
 namespace AsteriskSCF
 {
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 8f01913..22bba34 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -23,8 +23,7 @@ asterisk_scf_component_add_boost_libraries(bridging_unit_test unit_test_framewor
 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)
 
 asterisk_scf_component_build_icebox(bridging_unit_test)
 target_link_libraries(bridging_unit_test logging-client)
diff --git a/test/SessionListenerI.h b/test/SessionListenerI.h
index f33091e..19152fd 100644
--- a/test/SessionListenerI.h
+++ b/test/SessionListenerI.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/TestBridging.cpp b/test/TestBridging.cpp
index 3c03bac..b6762c9 100644
--- a/test/TestBridging.cpp
+++ b/test/TestBridging.cpp
@@ -19,8 +19,8 @@
 #include <boost/bind.hpp>
 #include <boost/test/unit_test.hpp>
 #include <boost/test/debug.hpp>
-#include <SessionCommunications/SessionCommunicationsIf.h>
-#include <Media/MediaIf.h>
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
+#include <AsteriskSCF/Media/MediaIf.h>
 
 #include "BridgeManagerListenerI.h"
 #include "BridgeListenerI.h"

commit 6f03b48a979daa54af637d238cb93679fc5b8936
Author: David M. Lee <dlee at digium.com>
Date:   Fri Dec 10 14:36:08 2010 -0600

    Ref-counting Logger changes.

diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index 8924abb..efb0221 100755
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -37,7 +37,7 @@ using namespace AsteriskSCF::System::Logging;
 
 namespace
 {
-Logger &lg = getLoggerFactory().getLogger("AsteriskSCF.BridgeService");
+Logger lg = getLoggerFactory().getLogger("AsteriskSCF.BridgeService");
 
 class RetryPolicy
 {
diff --git a/src/BridgeManagerImpl.cpp b/src/BridgeManagerImpl.cpp
index 3540bc6..dd5c293 100644
--- a/src/BridgeManagerImpl.cpp
+++ b/src/BridgeManagerImpl.cpp
@@ -25,7 +25,7 @@ using namespace AsteriskSCF::System::Logging;
 
 namespace
 {
-Logger &lg = getLoggerFactory().getLogger("AsteriskSCF.BridgeService");
+Logger lg = getLoggerFactory().getLogger("AsteriskSCF.BridgeService");
 }
 
 //
diff --git a/src/MediaSplicer.cpp b/src/MediaSplicer.cpp
index 81fc3e7..3f87f23 100755
--- a/src/MediaSplicer.cpp
+++ b/src/MediaSplicer.cpp
@@ -21,7 +21,7 @@
 using namespace AsteriskSCF::System::Logging;
 namespace
 {
-Logger &lg = getLoggerFactory().getLogger("AsteriskSCF.BridgeService");
+Logger lg = getLoggerFactory().getLogger("AsteriskSCF.BridgeService");
 }
 
 namespace AsteriskSCF
diff --git a/src/Service.cpp b/src/Service.cpp
index cfc0021..406760d 100644
--- a/src/Service.cpp
+++ b/src/Service.cpp
@@ -27,7 +27,7 @@ using namespace AsteriskSCF::System::Logging;
 
 namespace
 {
-Logger &lg = getLoggerFactory().getLogger(
+Logger lg = getLoggerFactory().getLogger(
     "AsteriskSCF.BridgeService");
 
 static const std::string ManagerName = "BridgeManager";

commit 7592be4bfddffc1f8a4845444acf19fee690edfe
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Fri Dec 3 11:31:50 2010 -0600

    Manage boost link options in CMake.

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d666099..8cf2694 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -16,7 +16,7 @@ asterisk_scf_component_add_file(bridgeservice MediaSplicer.h)
 asterisk_scf_component_add_file(bridgeservice MediaSplicer.cpp)
 asterisk_scf_component_add_ice_libraries(bridgeservice IceStorm)
 asterisk_scf_component_add_ice_libraries(bridgeservice IceBox)
-asterisk_scf_component_add_boost_libraries(bridgeservice thread)
+asterisk_scf_component_add_boost_libraries(bridgeservice thread date_time)
 
 if(NOT logger_dir)
    message(FATAL_ERROR "The logger directory could not be found ${logger_dir}")
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index fb53388..8f01913 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -18,8 +18,7 @@ asterisk_scf_component_add_file(bridging_unit_test TestCommandDriver.cpp)
 asterisk_scf_component_add_file(bridging_unit_test TestCommandDriver.h)
 asterisk_scf_component_add_ice_libraries(bridging_unit_test IceStorm)
 asterisk_scf_component_add_ice_libraries(bridging_unit_test IceBox)
-asterisk_scf_component_add_boost_libraries(bridging_unit_test unit_test_framework)
-asterisk_scf_component_add_boost_libraries(bridging_unit_test thread)
+asterisk_scf_component_add_boost_libraries(bridging_unit_test unit_test_framework thread)
 
 if(NOT logger_dir)
    message(FATAL_ERROR "The logger directory could not be found ${logger_dir}")
diff --git a/test/SessionListenerI.cpp b/test/SessionListenerI.cpp
index d798509..4d402e3 100644
--- a/test/SessionListenerI.cpp
+++ b/test/SessionListenerI.cpp
@@ -13,7 +13,6 @@
  * the GNU General Public License Version 2. See the LICENSE.txt file
  * at the top of the source tree.
  */
-#define BOOST_TEST_DYN_LINK
 #include "SessionListenerI.h"
 #include <boost/test/unit_test.hpp>
 
diff --git a/test/TestBridging.cpp b/test/TestBridging.cpp
index a9192cf..3c03bac 100644
--- a/test/TestBridging.cpp
+++ b/test/TestBridging.cpp
@@ -13,8 +13,6 @@
  * the GNU General Public License Version 2. See the LICENSE.txt file
  * at the top of the source tree.
  */
-#define BOOST_TEST_DYN_LINK
-
 #include <BridgeImpl.h>
 #include <BridgeManagerImpl.h>
 

commit 6d5df48797464117d25ab060aa40b554c252a271
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/BridgeImpl.cpp b/src/BridgeImpl.cpp
index 53e788e..8924abb 100755
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -24,16 +24,16 @@
 
 using namespace AsteriskSCF::System::Logging;
 
-/** 
+/**
  *
  * NOTE: Code must be reviewed/refactored for exception safety/consistency.
  * Operations involving establishing media connections may or may not be
  * catastrophic. An example of a non-catastrophic situation might be a media
  * allocation operation that might immediately fail for transient reasons but
  * can be initialized in the background in a relatively timely fashion (of
- * course this would depend on the context). 
+ * course this would depend on the context).
  *
- */ 
+ */
 
 namespace
 {
@@ -70,7 +70,7 @@ private:
 
 void checkSessions(const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions)
 {
-    Ice::LongSeq invalidIndexes; 
+    Ice::LongSeq invalidIndexes;
     Ice::Long index = 0;
     for(AsteriskSCF::SessionCommunications::V1::SessionSeq::const_iterator i = sessions.begin(); i != sessions.end(); ++i, ++index)
     {
@@ -96,162 +96,103 @@ static const std::string TopicPrefix("AsteriskSCF.Bridge.");
 //
 // TODO:
 // Operations that are performed on all bridge sessions might be better done as AMI requests.
-// 
+//
 namespace AsteriskSCF
 {
 namespace BridgeService
 {
-    //
-    // Functor to support using for_each on shutdown.
-    //
-    class ShutdownImpl : public std::unary_function<BridgeImpl::BridgeSessionPtr, void>
+//
+// Functor to support using for_each on shutdown.
+//
+class ShutdownImpl : public std::unary_function<BridgeImpl::BridgeSessionPtr, void>
+{
+public:
+    ShutdownImpl(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
+        const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& response) :
+        mListener(listener),
+        mResponse(response)
     {
-    public:
-        ShutdownImpl(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, 
-          const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& response) :
-            mListener(listener),
-            mResponse(response)
-        {
-        }
-
-        void operator()(const BridgeImpl::BridgeSessionPtr& b) 
-        {
-            try
-            {
-                b->getSession()->removeBridge(mListener);
-                b->disconnect();
-                b->getSession()->stop(mResponse);
-            }
-            catch(const Ice::ObjectNotExistException& ex)
-            {
-                lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
-                mNonExistent.push_back(b);
-            }
-            catch(const Ice::Exception& ex)
-            {
-                lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
-            }
-        }
+    }
 
-        const std::vector<BridgeImpl::BridgeSessionPtr>& nonExistentObjects()
-        {
-            return mNonExistent;
-        }
-    private:
-        AsteriskSCF::SessionCommunications::V1::SessionListenerPrx mListener;
-        AsteriskSCF::SessionCommunications::V1::ResponseCodePtr mResponse;
-        std::vector<BridgeImpl::BridgeSessionPtr> mNonExistent;
-    };
-    
-    class ProgressingImpl : public std::unary_function<BridgeImpl::BridgeSessionPtr, void>
+    void operator()(const BridgeImpl::BridgeSessionPtr& b)
     {
-    public:
-        ProgressingImpl(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& response) :
-            mResponse(response)
+        try
         {
+            b->getSession()->removeBridge(mListener);
+            b->disconnect();
+            b->getSession()->stop(mResponse);
         }
-
-        void operator()(const BridgeImpl::BridgeSessionPtr& b) 
+        catch(const Ice::ObjectNotExistException& ex)
         {
-            try
-            {
-                b->getSession()->progress(mResponse);
-            }
-            catch(const Ice::ObjectNotExistException& ex)
-            {
-                mNonExistent.push_back(b);
-                lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
-            }
-            catch(const Ice::Exception& ex)
-            {
-                lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
-            }
+            lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
+            mNonExistent.push_back(b);
         }
-
-        const std::vector<BridgeImpl::BridgeSessionPtr>& nonExistentObjects()
+        catch(const Ice::Exception& ex)
         {
-            return mNonExistent;
+            lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
         }
+    }
+
+    const std::vector<BridgeImpl::BridgeSessionPtr>& nonExistentObjects()
+    {
+        return mNonExistent;
+    }
+private:
+    AsteriskSCF::SessionCommunications::V1::SessionListenerPrx mListener;
+    AsteriskSCF::SessionCommunications::V1::ResponseCodePtr mResponse;
+    std::vector<BridgeImpl::BridgeSessionPtr> mNonExistent;
+};
 
-    private:
-        AsteriskSCF::SessionCommunications::V1::ResponseCodePtr mResponse;
-        std::vector<BridgeImpl::BridgeSessionPtr> mNonExistent;
-    };
+class ProgressingImpl : public std::unary_function<BridgeImpl::BridgeSessionPtr, void>
+{
+public:
+    ProgressingImpl(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& response) :
+        mResponse(response)
+    {
+    }
 
-    class RingImpl : public std::unary_function<BridgeImpl::BridgeSessionPtr, void>
+    void operator()(const BridgeImpl::BridgeSessionPtr& b)
     {
-    public:
-        RingImpl(const AsteriskSCF::SessionCommunications::V1::SessionPrx& exclude) :
-            mExclude(exclude)
+        try
         {
+            b->getSession()->progress(mResponse);
         }
-        
-        void operator()(const BridgeImpl::BridgeSessionPtr& b) 
+        catch(const Ice::ObjectNotExistException& ex)
         {
-            if(b->getSession() != mExclude)
-            {
-                try
-                {
-                    b->ring();
-                }
-                catch(const Ice::ObjectNotExistException& ex)
-                {
-                    mNonExistent.push_back(b);
-                    lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
-                }
-                catch(const Ice::Exception& ex)
-                {
-                    lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
-                }
-            }
+            mNonExistent.push_back(b);
+            lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
         }
-
-        const std::vector<BridgeImpl::BridgeSessionPtr>& nonExistentObjects()
+        catch(const Ice::Exception& ex)
         {
-            return mNonExistent;
+            lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
         }
+    }
+
+    const std::vector<BridgeImpl::BridgeSessionPtr>& nonExistentObjects()
+    {
+        return mNonExistent;
+    }
 
-    private:
-        AsteriskSCF::SessionCommunications::V1::SessionPrx mExclude;
-        std::vector<BridgeImpl::BridgeSessionPtr> mNonExistent;
-    };
+private:
+    AsteriskSCF::SessionCommunications::V1::ResponseCodePtr mResponse;
+    std::vector<BridgeImpl::BridgeSessionPtr> mNonExistent;
+};
 
-    class FlashImpl : public std::unary_function<BridgeImpl::BridgeSessionPtr, void>
+class RingImpl : public std::unary_function<BridgeImpl::BridgeSessionPtr, void>
+{
+public:
+    RingImpl(const AsteriskSCF::SessionCommunications::V1::SessionPrx& exclude) :
+        mExclude(exclude)
     {
-    public:
-        void operator()(const BridgeImpl::BridgeSessionPtr& b) 
-        {
-            try
-            {
-                b->getSession()->flash();
-            }
-            catch(const Ice::ObjectNotExistException& ex)
-            {
-                mNonExistent.push_back(b);
-                lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
-            }
-            catch(const Ice::Exception& ex)
-            {
-                lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
-            }
-        }
+    }
 
-        const std::vector<BridgeImpl::BridgeSessionPtr>& nonExistentObjects()
-        {
-            return mNonExistent;
-        }
-    private:
-        std::vector<BridgeImpl::BridgeSessionPtr> mNonExistent;
-    };
-    
-    class HoldImpl : public std::unary_function<BridgeImpl::BridgeSessionPtr, void>
+    void operator()(const BridgeImpl::BridgeSessionPtr& b)
     {
-    public:
-        void operator()(const BridgeImpl::BridgeSessionPtr& b) 
+        if(b->getSession() != mExclude)
         {
             try
             {
-                b->getSession()->hold();
+                b->ring();
             }
             catch(const Ice::ObjectNotExistException& ex)
             {
@@ -263,173 +204,232 @@ namespace BridgeService
                 lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
             }
         }
+    }
+
+    const std::vector<BridgeImpl::BridgeSessionPtr>& nonExistentObjects()
+    {
+        return mNonExistent;
+    }
+
+private:
+    AsteriskSCF::SessionCommunications::V1::SessionPrx mExclude;
+    std::vector<BridgeImpl::BridgeSessionPtr> mNonExistent;
+};
 
-        const std::vector<BridgeImpl::BridgeSessionPtr>& nonExistentObjects()
+class FlashImpl : public std::unary_function<BridgeImpl::BridgeSessionPtr, void>
+{
+public:
+    void operator()(const BridgeImpl::BridgeSessionPtr& b)
+    {
+        try
         {
-            return mNonExistent;
+            b->getSession()->flash();
         }
-    private:
-        std::vector<BridgeImpl::BridgeSessionPtr> mNonExistent;
-    };
-    
-    class UnholdImpl : public std::unary_function<BridgeImpl::BridgeSessionPtr, void>
-    {
-    public:
-        void operator()(const BridgeImpl::BridgeSessionPtr& b) 
+        catch(const Ice::ObjectNotExistException& ex)
         {
-            try
-            {
-                b->getSession()->unhold();
-            }
-            catch(const Ice::ObjectNotExistException& ex)
-            {
-                mNonExistent.push_back(b);
-                lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
-            }
-            catch(const Ice::Exception& ex)
-            {
-                lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
-            }
+            mNonExistent.push_back(b);
+            lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
         }
-
-        const std::vector<BridgeImpl::BridgeSessionPtr>& nonExistentObjects()
+        catch(const Ice::Exception& ex)
         {
-            return mNonExistent;
+            lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
         }
-    private:
-        std::vector<BridgeImpl::BridgeSessionPtr> mNonExistent;
-    };
+    }
 
-    class ConnectImpl : public std::unary_function<BridgeImpl::BridgeSessionPtr, void>
+    const std::vector<BridgeImpl::BridgeSessionPtr>& nonExistentObjects()
     {
-    public:
-        ConnectImpl(const AsteriskSCF::SessionCommunications::V1::SessionPrx& exclude) :
-            mExclude(exclude)
+        return mNonExistent;
+    }
+private:
+    std::vector<BridgeImpl::BridgeSessionPtr> mNonExistent;
+};
+
+class HoldImpl : public std::unary_function<BridgeImpl::BridgeSessionPtr, void>
+{
+public:
+    void operator()(const BridgeImpl::BridgeSessionPtr& b)
+    {
+        try
         {
+            b->getSession()->hold();
         }
-        
-        void operator()(BridgeImpl::BridgeSessionPtr& b)
+        catch(const Ice::ObjectNotExistException& ex)
         {
-            if(b->getSession() != mExclude) 
-            {
-                try
-                {
-                    b->connect();
-                }
-                catch(const Ice::ObjectNotExistException& ex)
-                {
-                    mNonExistent.push_back(b);
-                    lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
-                }
-                catch(const Ice::Exception& ex)
-                {
-                    lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
-                }
-            }
+            mNonExistent.push_back(b);
+            lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
         }
-
-        const std::vector<BridgeImpl::BridgeSessionPtr>& nonExistentObjects()
+        catch(const Ice::Exception& ex)
         {
-            return mNonExistent;
+            lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
         }
+    }
 
-    private:
-        AsteriskSCF::SessionCommunications::V1::SessionPrx mExclude;
-        std::vector<BridgeImpl::BridgeSessionPtr> mNonExistent;
-    };
+    const std::vector<BridgeImpl::BridgeSessionPtr>& nonExistentObjects()
+    {
+        return mNonExistent;
+    }
+private:
+    std::vector<BridgeImpl::BridgeSessionPtr> mNonExistent;
+};
 
-    class FindImpl : public std::unary_function<BridgeImpl::BridgeSessionPtr, bool>
+class UnholdImpl : public std::unary_function<BridgeImpl::BridgeSessionPtr, void>
+{
+public:
+    void operator()(const BridgeImpl::BridgeSessionPtr& b)
     {
-    public:
-        FindImpl(const AsteriskSCF::SessionCommunications::V1::SessionPrx& prx) :
-            mPrx(prx)
+        try
+        {
+            b->getSession()->unhold();
+        }
+        catch(const Ice::ObjectNotExistException& ex)
         {
+            mNonExistent.push_back(b);
+            lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
         }
-        
-        bool operator()(const BridgeImpl::BridgeSessionPtr& b)
+        catch(const Ice::Exception& ex)
         {
-            return b->getSession() == mPrx;
+            lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
         }
-    private:
-        AsteriskSCF::SessionCommunications::V1::SessionPrx mPrx;
-    };
+    }
 
+    const std::vector<BridgeImpl::BridgeSessionPtr>& nonExistentObjects()
+    {
+        return mNonExistent;
+    }
+private:
+    std::vector<BridgeImpl::BridgeSessionPtr> mNonExistent;
+};
 
-    //
-    // For events that require modification to the bridge, we use helper methods on the bridge itself.
-    // For events result in distribution to the bridge sessions, we copy the current sessions and
-    // run the calls from the listener itself.
-    //
-    class SessionListener : public AsteriskSCF::SessionCommunications::V1::SessionListener
+class ConnectImpl : public std::unary_function<BridgeImpl::BridgeSessionPtr, void>
+{
+public:
+    ConnectImpl(const AsteriskSCF::SessionCommunications::V1::SessionPrx& exclude) :
+        mExclude(exclude)
     {
-    public:
-        SessionListener(const BridgeImplPtr& b) :
-            mBridge(b)
-        {
-        }
+    }
 
-        void connected(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const Ice::Current&)
+    void operator()(BridgeImpl::BridgeSessionPtr& b)
+    {
+        if(b->getSession() != mExclude)
         {
             try
             {
-                mBridge->sessionConnected(source);
+                b->connect();
+            }
+            catch(const Ice::ObjectNotExistException& ex)
+            {
+                mNonExistent.push_back(b);
+                lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
             }
             catch(const Ice::Exception& ex)
             {
                 lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
-                throw;
             }
-            std::vector<BridgeImpl::BridgeSessionPtr> sessions(mBridge->currentSessions());
-            std::for_each(sessions.begin(), sessions.end(), ConnectImpl(source));
         }
+    }
 
-        void flashed(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const Ice::Current&)
-        {
-        }
+    const std::vector<BridgeImpl::BridgeSessionPtr>& nonExistentObjects()
+    {
+        return mNonExistent;
+    }
 
-        void held(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const Ice::Current&)
-        {
-        }
+private:
+    AsteriskSCF::SessionCommunications::V1::SessionPrx mExclude;
+    std::vector<BridgeImpl::BridgeSessionPtr> mNonExistent;
+};
+
+class FindImpl : public std::unary_function<BridgeImpl::BridgeSessionPtr, bool>
+{
+public:
+    FindImpl(const AsteriskSCF::SessionCommunications::V1::SessionPrx& prx) :
+        mPrx(prx)
+    {
+    }
+
+    bool operator()(const BridgeImpl::BridgeSessionPtr& b)
+    {
+        return b->getSession() == mPrx;
+    }
+private:
+    AsteriskSCF::SessionCommunications::V1::SessionPrx mPrx;
+};
+
+
+//
+// For events that require modification to the bridge, we use helper methods on the bridge itself.
+// For events result in distribution to the bridge sessions, we copy the current sessions and
+// run the calls from the listener itself.
+//
+class SessionListener : public AsteriskSCF::SessionCommunications::V1::SessionListener
+{
+public:
+    SessionListener(const BridgeImplPtr& b) :
+        mBridge(b)
+    {
+    }
 
-        void progressing(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& response, const Ice::Current&)
+    void connected(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const Ice::Current&)
+    {
+        try
         {
+            mBridge->sessionConnected(source);
         }
-
-        void ringing(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const Ice::Current&)
+        catch(const Ice::Exception& ex)
         {
-            std::vector<BridgeImpl::BridgeSessionPtr> sessions(mBridge->currentSessions());
-            if(sessions.size() > 0)
-            {
-                std::for_each(sessions.begin(), sessions.end(), RingImpl(source));
-            }
+            lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
+            throw;
         }
+        std::vector<BridgeImpl::BridgeSessionPtr> sessions(mBridge->currentSessions());
+        std::for_each(sessions.begin(), sessions.end(), ConnectImpl(source));
+    }
+
+    void flashed(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const Ice::Current&)
+    {
+    }
 
-        void stopped(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& response, const Ice::Current& current)
+    void held(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const Ice::Current&)
+    {
+    }
+
+    void progressing(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& response, const Ice::Current&)
+    {
+    }
+
+    void ringing(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const Ice::Current&)
+    {
+        std::vector<BridgeImpl::BridgeSessionPtr> sessions(mBridge->currentSessions());
+        if(sessions.size() > 0)
         {
-            size_t endpointCount = mBridge->sessionStopped(source, response);
-            if(endpointCount < 2)
-            {
-                mBridge->spawnShutdown();
-            }
+            std::for_each(sessions.begin(), sessions.end(), RingImpl(source));
         }
+    }
 
-        void unheld(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const Ice::Current&)
+    void stopped(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& response, const Ice::Current& current)
+    {
+        size_t endpointCount = mBridge->sessionStopped(source, response);
+        if(endpointCount < 2)
         {
+            mBridge->spawnShutdown();
         }
+    }
+
+    void unheld(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const Ice::Current&)
+    {
+    }
+
+private:
+    BridgeImplPtr mBridge;
+};
 
-    private:
-        BridgeImplPtr mBridge;
-    };
-    
 } // End of namespace BridgeService
 } // End of namespace AsteriskSCF
 
 AsteriskSCF::BridgeService::BridgeImpl::BridgeImpl(
-  const Ice::ObjectAdapterPtr& adapter,
-  const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx& ev,
-  const AsteriskSCF::BridgeService::BridgeListenerMgrPtr& listenerMgr,
-  const AsteriskSCF::SessionCommunications::V1::BridgePrx& prx
-  ) :
+    const Ice::ObjectAdapterPtr& adapter,
+        const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx& ev,
+        const AsteriskSCF::BridgeService::BridgeListenerMgrPtr& listenerMgr,
+        const AsteriskSCF::SessionCommunications::V1::BridgePrx& prx
+    ) :
     mState(Running),
     mObjAdapter(adapter),
     mListeners(listenerMgr),
@@ -442,10 +442,10 @@ AsteriskSCF::BridgeService::BridgeImpl::BridgeImpl(
     }
     std::string listenerId = mObjAdapter->getCommunicator()->identityToString(prx->ice_getIdentity());
     listenerId += ".sessionListener";
-    mSessionListenerPrx = 
+    mSessionListenerPrx =
         AsteriskSCF::SessionCommunications::V1::SessionListenerPrx::uncheckedCast(
-          mObjAdapter->add(mSessionListener, mObjAdapter->getCommunicator()->stringToIdentity(listenerId))
-          );
+            mObjAdapter->add(mSessionListener, mObjAdapter->getCommunicator()->stringToIdentity(listenerId))
+            );
 }
 
 AsteriskSCF::BridgeService::BridgeImpl::~BridgeImpl()
@@ -480,7 +480,7 @@ void AsteriskSCF::BridgeService::BridgeImpl::addSessions(const AsteriskSCF::Sess
             std::vector<BridgeSessionPtr>::iterator j = find_if(mSessions.begin(), mSessions.end(), AsteriskSCF::BridgeService::FindImpl(*i));
             if(j != mSessions.end())
             {
-                lg(Debug) << __FUNCTION__ << ": " << (*i)->ice_toString() << " is already registered with this bridge."; 
+                lg(Debug) << __FUNCTION__ << ": " << (*i)->ice_toString() << " is already registered with this bridge.";
                 continue;
             }
 
@@ -489,7 +489,7 @@ void AsteriskSCF::BridgeService::BridgeImpl::addSessions(const AsteriskSCF::Sess
             {
                 RetryPolicy policy(5, 500);
                 //
-                // canRetry should never return false since we throw ourselves out of this loop. But 
+                // canRetry should never return false since we throw ourselves out of this loop. But
                 // we'll do it here in case we decide to do something else.
                 //
                 while(policy.canRetry())
@@ -497,7 +497,7 @@ void AsteriskSCF::BridgeService::BridgeImpl::addSessions(const AsteriskSCF::Sess
                     try
                     {
                         info = (*i)->setBridge(mPrx, mSessionListenerPrx);
-			break;
+                        break;
                     }
                     catch(const Ice::ConnectionLostException&)
                     {
@@ -517,15 +517,15 @@ void AsteriskSCF::BridgeService::BridgeImpl::addSessions(const AsteriskSCF::Sess
             //
             if(info->currentState == "ready")
             {
-                lg(Debug) << __FUNCTION__ << ": " << (*i)->ice_toString() << " current state is ready (not yet connected), not establishing media connections."; 
+                lg(Debug) << __FUNCTION__ << ": " << (*i)->ice_toString() << " current state is ready (not yet connected), not establishing media connections.";
                 mSessions.push_back(new BridgeSession(*i, 0, false));
             }
             else
             {
-                lg(Debug) << __FUNCTION__ << ": " << (*i)->ice_toString() << " media is expected to be establishing, plugging media into bridge."; 
+                lg(Debug) << __FUNCTION__ << ": " << (*i)->ice_toString() << " media is expected to be establishing, plugging media into bridge.";
                 mSessions.push_back(new BridgeSession(*i, mSplicer.connect(*i), false));;
             }
-                
+
             addedSessions.push_back(*i);
         }
     }
@@ -557,7 +557,7 @@ void AsteriskSCF::BridgeService::BridgeImpl::removeSessions(const AsteriskSCF::S
                 }
                 catch(const Ice::Exception& ex)
                 {
-                    lg(Info) << __FUNCTION__ << ": removingthe bridge from " << (*j)->getSession() << " threw " << ex.what(); 
+                    lg(Info) << __FUNCTION__ << ": removingthe bridge from " << (*j)->getSession() << " threw " << ex.what();
                 }
                 (*j)->disconnect();
                 mSessions.erase(j);
@@ -605,7 +605,7 @@ void AsteriskSCF::BridgeService::BridgeImpl::shutdown(const Ice::Current& curren
 {
     //
     // When shutting down, the bridge makes a copy of its current state and unlocks, proceeding with
-    // no other internal locks. 
+    // no other internal locks.
     //
     lg(Debug) << __FUNCTION__ << ":" << current.adapter->getCommunicator()->identityToString(current.id) ;
     boost::unique_lock<boost::shared_mutex> lock(mLock);
@@ -620,7 +620,7 @@ void AsteriskSCF::BridgeService::BridgeImpl::shutdown(const Ice::Current& curren
         throw Ice::ObjectNotExistException(__FILE__, __LINE__);
     }
     mState = ShuttingDown;
-    
+
     mListeners->stopping();
 
     //
@@ -629,7 +629,7 @@ void AsteriskSCF::BridgeService::BridgeImpl::shutdown(const Ice::Current& curren
     if(mSessions.size() > 0)
     {
         std::for_each(mSessions.begin(), mSessions.end(),
-                AsteriskSCF::BridgeService::ShutdownImpl(mSessionListenerPrx, new AsteriskSCF::SessionCommunications::V1::ResponseCode));
+            AsteriskSCF::BridgeService::ShutdownImpl(mSessionListenerPrx, new AsteriskSCF::SessionCommunications::V1::ResponseCode));
     }
 
     lg(Info) << current.adapter->getCommunicator()->identityToString(current.id) << ": is shutdown." ;
@@ -670,24 +670,24 @@ void AsteriskSCF::BridgeService::BridgeImpl::destroy(const Ice::Current& current
     }
 
     //
-    // The bridge manager removes us from the object adapter on reaping. 
+    // The bridge manager removes us from the object adapter on reaping.
     //
 }
 
 void AsteriskSCF::BridgeService::BridgeImpl::addListener(const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx& listener,
-        const Ice::Current&)
+    const Ice::Current&)
 {
     mListeners->addListener(listener);
 }
 
 void AsteriskSCF::BridgeService::BridgeImpl::removeListener(const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx& listener,
-        const Ice::Current&)
+    const Ice::Current&)
 {
     mListeners->removeListener(listener);
 }
 
-void AsteriskSCF::BridgeService::BridgeImpl::replaceSession(const AsteriskSCF::SessionCommunications::V1::SessionPrx& oldSession, 
-  const AsteriskSCF::SessionCommunications::V1::SessionSeq& newSessions, const Ice::Current& current)
+void AsteriskSCF::BridgeService::BridgeImpl::replaceSession(const AsteriskSCF::SessionCommunications::V1::SessionPrx& oldSession,
+    const AsteriskSCF::SessionCommunications::V1::SessionSeq& newSessions, const Ice::Current& current)
 {
     lg(Debug) << __FUNCTION__ << ":" << current.adapter->getCommunicator()->identityToString(current.id) ;
     BridgeSessionPtr toRemove;
@@ -709,7 +709,7 @@ void AsteriskSCF::BridgeService::BridgeImpl::replaceSession(const AsteriskSCF::S
         //
         if(i != mSessions.end())
         {
-            lg(Debug) << __FUNCTION__ << ": found session to replace : " << oldSession->ice_toString(); 
+            lg(Debug) << __FUNCTION__ << ": found session to replace : " << oldSession->ice_toString();
             toRemove = *i;
             toRemove->disconnect();
             mSessions.erase(i);
@@ -725,7 +725,7 @@ void AsteriskSCF::BridgeService::BridgeImpl::replaceSession(const AsteriskSCF::S
         {
             RetryPolicy policy(5, 500);
             //
-            // canRetry should never return false since we throw ourselves out of this loop. But 
+            // canRetry should never return false since we throw ourselves out of this loop. But
             // we'll do it here in case we decide to do something else.
             //
             while(policy.canRetry())
@@ -754,7 +754,7 @@ void AsteriskSCF::BridgeService::BridgeImpl::replaceSession(const AsteriskSCF::S
             // really be required if things like replaceSessions() were to be
             // atomic.
             //
-            lg(Info) << __FUNCTION__ << ": setting the bridge on " << *i << " threw " << ex.what(); 
+            lg(Info) << __FUNCTION__ << ": setting the bridge on " << *i << " threw " << ex.what();
         }
     }
     assert(infoSeq.size() == newMembers.size());
@@ -778,7 +778,7 @@ void AsteriskSCF::BridgeService::BridgeImpl::replaceSession(const AsteriskSCF::S
     {
         RetryPolicy policy(5, 500);
         //
-        // canRetry should never return false since we throw ourselves out of this loop. But 
+        // canRetry should never return false since we throw ourselves out of this loop. But
         // we'll do it here in case we decide to do something else.
         //
         while(policy.canRetry())
@@ -786,11 +786,11 @@ void AsteriskSCF::BridgeService::BridgeImpl::replaceSession(const AsteriskSCF::S
             try
             {
                 toRemove->getSession()->removeBridge(mSessionListenerPrx);
-		break;
+                break;
             }
             catch(const AsteriskSCF::SessionCommunications::V1::NotBridged&)
             {
-                lg(Info) << __FUNCTION__ << ": removeBridge on session being replaced threw a `NotBridged' exception"; 
+                lg(Info) << __FUNCTION__ << ": removeBridge on session being replaced threw a `NotBridged' exception";
                 break;
             }
             catch(const Ice::ConnectionLostException&)
@@ -858,8 +858,8 @@ void AsteriskSCF::BridgeService::BridgeImpl::sessionConnected(const AsteriskSCF:
     }
 }
 
-size_t AsteriskSCF::BridgeService::BridgeImpl::sessionStopped(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session, 
-        const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& response)
+size_t AsteriskSCF::BridgeService::BridgeImpl::sessionStopped(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session,
+    const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& response)
 {
     lg(Debug) << __FUNCTION__ << ": session terminated from " << session->ice_toString() ;
     try
@@ -915,7 +915,7 @@ namespace
 class ShutdownThread : public IceUtil::Thread
 {
 public:
-    ShutdownThread(const AsteriskSCF::SessionCommunications::V1::BridgePrx& bridge) : 
+    ShutdownThread(const AsteriskSCF::SessionCommunications::V1::BridgePrx& bridge) :
         mBridge(bridge)
     {
     }
diff --git a/src/BridgeImpl.h b/src/BridgeImpl.h
index a807714..8044d24 100644
--- a/src/BridgeImpl.h
+++ b/src/BridgeImpl.h
@@ -25,162 +25,162 @@ namespace AsteriskSCF
 {
 namespace BridgeService
 {
-    //
-    // BridgeImpl is an implmentation of AsteriskSCF::Bridging::V1::Bridge.
-    //
-    class BridgeImpl : public SessionCommunications::V1::Bridge
+//
+// BridgeImpl is an implmentation of AsteriskSCF::Bridging::V1::Bridge.
+//
+class BridgeImpl : public SessionCommunications::V1::Bridge
+{
+public:
+    class BridgeSession : public IceUtil::Shared
     {
     public:
-        class BridgeSession : public IceUtil::Shared
-        {
-        public:
 
-            BridgeSession(const SessionCommunications::V1::SessionPrx& s, const MediaConnectorPtr& con, bool isConnected) :
-                mSession(s),
-                mConnector(con),
-                mConnected(isConnected)
-            {
-            }
-
-            bool isConnected()
-            {
-                IceUtil::Mutex::Lock lock(mMutex);
-                return mConnected;
-            }
-
-            void connect()
-            {
-                //
-                // Only call connect on a session if its not already connected.
-                //
-                IceUtil::Mutex::Lock lock(mMutex);
-                if(mConnected)
-                    return;
-
-                mSession->connect();
-                mConnected = true;
-            }
+        BridgeSession(const SessionCommunications::V1::SessionPrx& s, const MediaConnectorPtr& con, bool isConnected) :
+            mSession(s),
+            mConnector(con),
+            mConnected(isConnected)
+        {
+        }
 
-            void ring()
-            {
-                //
-                // Don't relay ring notifications to connected sessions.
-                //
-                IceUtil::Mutex::Lock lock(mMutex);
-                if(mConnected)
-                    return;
-                mSession->ring();
-            }
+        bool isConnected()
+        {
+            IceUtil::Mutex::Lock lock(mMutex);
+            return mConnected;
+        }
 
-            void setConnected()
-            {
-                IceUtil::Mutex::Lock lock(mMutex);
-                mConnected = true;
-            }
+        void connect()
+        {
+            //
+            // Only call connect on a session if its not already connected.
+            //
+            IceUtil::Mutex::Lock lock(mMutex);
+            if(mConnected)
+                return;
+
+            mSession->connect();
+            mConnected = true;
+        }
+
+        void ring()
+        {
+            //
+            // Don't relay ring notifications to connected sessions.
+            //
+            IceUtil::Mutex::Lock lock(mMutex);
+            if(mConnected)
+                return;
+            mSession->ring();
+        }
+
+        void setConnected()
+        {
+            IceUtil::Mutex::Lock lock(mMutex);
+            mConnected = true;
+        }
 
-            SessionCommunications::V1::SessionPrx getSession() const
-            {
-                return mSession;
-            }
+        SessionCommunications::V1::SessionPrx getSession() const
+        {
+            return mSession;
+        }
 
-            void setConnector(const MediaConnectorPtr& connector)
-            {
-                IceUtil::Mutex::Lock lock(mMutex);
-                mConnector = connector;
-            }
+        void setConnector(const MediaConnectorPtr& connector)
+        {
+            IceUtil::Mutex::Lock lock(mMutex);
+            mConnector = connector;
+        }
 
-            void disconnect()
+        void disconnect()
+        {
+            IceUtil::Mutex::Lock lock(mMutex);
+            if(mConnector)
             {
-                IceUtil::Mutex::Lock lock(mMutex);
-                if(mConnector)
+                try
                 {
-                    try
-                    {
-                        mConnector->unplug();
-                    }
-                    catch(const Ice::Exception&)
-                    {
-                        //
-                        // There are several valid reasons why this might occur, so we'll ignore it and move on.
-                        //
-                    }
-                    mConnector = 0;
+                    mConnector->unplug();
                 }
+                catch(const Ice::Exception&)
+                {
+                    //
+                    // There are several valid reasons why this might occur, so we'll ignore it and move on.
+                    //
+                }
+                mConnector = 0;
             }
+        }
+
+    private:
+        SessionCommunications::V1::SessionPrx mSession;
+        MediaConnectorPtr mConnector;
+        bool mConnected;
+        IceUtil::Mutex mMutex;
+    };
+    typedef IceUtil::Handle<BridgeSession> BridgeSessionPtr;
 
-        private:
-            SessionCommunications::V1::SessionPrx mSession;
-            MediaConnectorPtr mConnector;
-            bool mConnected;
-            IceUtil::Mutex mMutex;
-        };
-        typedef IceUtil::Handle<BridgeSession> BridgeSessionPtr;
+    BridgeImpl(const Ice::ObjectAdapterPtr& objAdapter,
+        const SessionCommunications::V1::BridgeListenerPrx& ev,
+        const AsteriskSCF::BridgeService::BridgeListenerMgrPtr& listenerMgr,
+        const AsteriskSCF::SessionCommunications::V1::BridgePrx& prx);
 
-        BridgeImpl(const Ice::ObjectAdapterPtr& objAdapter,
-                const SessionCommunications::V1::BridgeListenerPrx& ev,
-                const AsteriskSCF::BridgeService::BridgeListenerMgrPtr& listenerMgr,
-                const AsteriskSCF::SessionCommunications::V1::BridgePrx& prx);
+    ~BridgeImpl();
 
-        ~BridgeImpl();
+    //
+    // AsteriskSCF::SessionCommunications::Bridging::Bridge Interface
+    //
+    void addSessions(const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions, const Ice::Current& current);
+    void removeSessions(const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions, const Ice::Current& current);
 
-        //
-        // AsteriskSCF::SessionCommunications::Bridging::Bridge Interface
-        //
-        void addSessions(const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions, const Ice::Current& current);
-        void removeSessions(const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions, const Ice::Current& current);
+    AsteriskSCF::SessionCommunications::V1::SessionSeq listSessions(const Ice::Current&);
+    void shutdown(const Ice::Current& current);
+    void destroy(const Ice::Current& current);
 
-        AsteriskSCF::SessionCommunications::V1::SessionSeq listSessions(const Ice::Current&);
-        void shutdown(const Ice::Current& current);
-        void destroy(const Ice::Current& current);
+    void addListener(const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx& listener, const Ice::Current& current);
+    void removeListener(const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx& listener, const Ice::Current& current);
 
-        void addListener(const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx& listener, const Ice::Current& current);
-        void removeListener(const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx& listener, const Ice::Current& current);
+    void replaceSession(const AsteriskSCF::SessionCommunications::V1::SessionPrx& ,
+        const AsteriskSCF::SessionCommunications::V1::SessionSeq& newSessions, const Ice::Current& current);
 
-        void replaceSession(const AsteriskSCF::SessionCommunications::V1::SessionPrx& ,
-          const AsteriskSCF::SessionCommunications::V1::SessionSeq& newSessions, const Ice::Current& current);
+    //
+    // Internal methods
+    //
+    bool destroyed();
+    void destroyImpl();
 
-        //
-        // Internal methods
-        //
-        bool destroyed();
-        void destroyImpl();
+    void sessionConnected(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session);
+    size_t sessionStopped(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session,
+        const SessionCommunications::V1::ResponseCodePtr& response);
 
-        void sessionConnected(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session);
-        size_t sessionStopped(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session,
-                const SessionCommunications::V1::ResponseCodePtr& response);
-        
-        std::vector<BridgeSessionPtr> currentSessions();
+    std::vector<BridgeSessionPtr> currentSessions();
 
-        void spawnShutdown();
+    void spawnShutdown();
 
-    private:
+private:
 
-        boost::shared_mutex mLock;
-        enum ServiceStates
-        { 
-            Running, 
-            ShuttingDown, 
-            Destroyed 
-        };
-        ServiceStates mState;
+    boost::shared_mutex mLock;
+    enum ServiceStates
+    {
+        Running,
+        ShuttingDown,
+        Destroyed
+    };
+    ServiceStates mState;
 
-        std::vector<BridgeSessionPtr> mSessions;
+    std::vector<BridgeSessionPtr> mSessions;
 
-        MediaSplicer mSplicer;
+    MediaSplicer mSplicer;
 
-        const std::string mName;
-        Ice::ObjectAdapterPtr mObjAdapter;
+    const std::string mName;
+    Ice::ObjectAdapterPtr mObjAdapter;
 
-        BridgeListenerMgrPtr mListeners;
-        SessionCommunications::V1::SessionListenerPtr mSessionListener;
-        SessionCommunications::V1::SessionListenerPrx mSessionListenerPrx;
-        AsteriskSCF::SessionCommunications::V1::BridgePrx mPrx;
+    BridgeListenerMgrPtr mListeners;
+    SessionCommunications::V1::SessionListenerPtr mSessionListener;
+    SessionCommunications::V1::SessionListenerPrx mSessionListenerPrx;
+    AsteriskSCF::SessionCommunications::V1::BridgePrx mPrx;
 
-        IceUtil::Handle<IceUtil::Thread> mShutdownThread;
+    IceUtil::Handle<IceUtil::Thread> mShutdownThread;
 
-        void statePreCheck();
-    };
+    void statePreCheck();
+};
 
-    typedef IceUtil::Handle<BridgeImpl> BridgeImplPtr;
+typedef IceUtil::Handle<BridgeImpl> BridgeImplPtr;
 } // End of namespace Bridging.
 } // End of namespace AsteriskSCF.
diff --git a/src/BridgeListenerMgr.cpp b/src/BridgeListenerMgr.cpp
index a7456e1..675b6e3 100644
--- a/src/BridgeListenerMgr.cpp
+++ b/src/BridgeListenerMgr.cpp
@@ -16,8 +16,8 @@
 #include "BridgeListenerMgr.h"
 
 AsteriskSCF::BridgeService::BridgeListenerMgr::BridgeListenerMgr(const Ice::CommunicatorPtr& comm,
-        const std::string& name,
-        const AsteriskSCF::SessionCommunications::V1::BridgePrx& bridgeProxy) :
+    const std::string& name,
+    const AsteriskSCF::SessionCommunications::V1::BridgePrx& bridgeProxy) :
     ListenerManagerT<AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx>(comm, name, false),
     mPrx(bridgeProxy)
 {
diff --git a/src/BridgeListenerMgr.h b/src/BridgeListenerMgr.h
index 69a7fcc..041fd0d 100644
--- a/src/BridgeListenerMgr.h
+++ b/src/BridgeListenerMgr.h
@@ -24,21 +24,21 @@ namespace AsteriskSCF
 {
 namespace BridgeService
 {
-    class BridgeListenerMgr : virtual public ListenerManagerT<AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx>
-    {
-    public:
-        BridgeListenerMgr(const Ice::CommunicatorPtr& communicator, const std::string& name,
-                const AsteriskSCF::SessionCommunications::V1::BridgePrx& source);
+class BridgeListenerMgr : virtual public ListenerManagerT<AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx>
+{
+public:
+    BridgeListenerMgr(const Ice::CommunicatorPtr& communicator, const std::string& name,
+        const AsteriskSCF::SessionCommunications::V1::BridgePrx& source);
 
-        void sessionsAdded(const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions);
-        void sessionsRemoved(const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions);
-        void stopped();
-        void stopping();
+    void sessionsAdded(const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions);
+    void sessionsRemoved(const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions);
+    void stopped();
+    void stopping();
 
-    private:
-        AsteriskSCF::SessionCommunications::V1::BridgePrx mPrx;
-    };
+private:
+    AsteriskSCF::SessionCommunications::V1::BridgePrx mPrx;
+};
 
-    typedef IceUtil::Handle<BridgeListenerMgr> BridgeListenerMgrPtr;
+typedef IceUtil::Handle<BridgeListenerMgr> BridgeListenerMgrPtr;
 } // End of namespace BridgeService
 } // End of namespace AsteriskSCF
diff --git a/src/BridgeManagerImpl.cpp b/src/BridgeManagerImpl.cpp
index 66ea54e..3540bc6 100644
--- a/src/BridgeManagerImpl.cpp
+++ b/src/BridgeManagerImpl.cpp
@@ -39,33 +39,33 @@ namespace AsteriskSCF
 {
 namespace BridgeService
 {
-    //
-    // Functor used with for_each on shutdown.
-    //
-    class BridgeMgrShutdownImpl : public std::unary_function<BridgeManagerImpl::BridgeInfo, void>
+//
+// Functor used with for_each on shutdown.
+//
+class BridgeMgrShutdownImpl : public std::unary_function<BridgeManagerImpl::BridgeInfo, void>
+{
+public:
+    BridgeMgrShutdownImpl(const Ice::Current& c) :
+        mCurrent(c)
     {
-    public:
-        BridgeMgrShutdownImpl(const Ice::Current& c) :
-            mCurrent(c)
-        {
-        }
+    }
 
-        void operator()(const BridgeManagerImpl::BridgeInfo& b) 
-        { 
-            b.servant->shutdown(mCurrent); 
-        }
+    void operator()(const BridgeManagerImpl::BridgeInfo& b)
+    {
+        b.servant->shutdown(mCurrent);
+    }
 
-    private:
-        const Ice::Current mCurrent;
-    };
+private:
+    const Ice::Current mCurrent;
+};
 
 } // End of namespace BridgeService
 } // End of namespace AsteriskSCF
 
 AsteriskSCF::BridgeService::BridgeManagerImpl::BridgeManagerImpl(
     const Ice::ObjectAdapterPtr& adapter,
-    const std::string& name,
-    const AsteriskSCF::SessionCommunications::V1::BridgeManagerPrx& prx) :
+        const std::string& name,
+        const AsteriskSCF::SessionCommunications::V1::BridgeManagerPrx& prx) :
     mName(name),
     mShuttingDown(false),
     mSuspended(false),
@@ -86,9 +86,9 @@ AsteriskSCF::BridgeService::BridgeManagerImpl::~BridgeManagerImpl()
 }
 
 AsteriskSCF::SessionCommunications::V1::BridgePrx AsteriskSCF::BridgeService::BridgeManagerImpl::createBridge(
-  const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions,
-  const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx& listener,
-  const Ice::Current& current)
+    const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions,
+        const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx& listener,
+        const Ice::Current& current)
 {
     lg(Debug) << __FUNCTION__ << ":" << current.adapter->getCommunicator()->identityToString(current.id) ;
 
@@ -110,10 +110,10 @@ AsteriskSCF::SessionCommunications::V1::BridgePrx AsteriskSCF::BridgeService::Br
     AsteriskSCF::SessionCommunications::V1::BridgePrx prx(
         AsteriskSCF::SessionCommunications::V1::BridgePrx::uncheckedCast(mAdapter->createProxy(id)));
     AsteriskSCF::BridgeService::BridgeListenerMgrPtr mgr(new BridgeListenerMgr(mAdapter->getCommunicator(), stringId, prx));
-    
+
     AsteriskSCF::BridgeService::BridgeImplPtr bridge = new AsteriskSCF::BridgeService::BridgeImpl(mAdapter, listener, mgr, prx);
     Ice::ObjectPrx obj = mAdapter->add(bridge, id);
-    
+
     lg(Info) << current.adapter->getCommunicator()->identityToString(current.id) << ": creating new bridge " << obj->ice_toString() << "." ;
     BridgeInfo info;
     info.servant = bridge;
diff --git a/src/BridgeManagerImpl.h b/src/BridgeManagerImpl.h
index fa62ae3..c2a18a5 100644
--- a/src/BridgeManagerImpl.h
+++ b/src/BridgeManagerImpl.h
@@ -26,45 +26,45 @@ namespace AsteriskSCF
 {
 namespace BridgeService
 {
-    class BridgeManagerImpl : public SessionCommunications::V1::BridgeManager
-    {
-    public:
-        
-        BridgeManagerImpl(const Ice::ObjectAdapterPtr& adapter, const std::string& name, const AsteriskSCF::SessionCommunications::V1::BridgeManagerPrx& prx);
-        ~BridgeManagerImpl();
-                
-        //
-        // AsteriskSCF::SessionCommunications::V1::BridgeManager Interface
-        //
-        SessionCommunications::V1::BridgePrx createBridge(
-            const SessionCommunications::V1::SessionSeq& endpoints,
+class BridgeManagerImpl : public SessionCommunications::V1::BridgeManager
+{
+public:
+
+    BridgeManagerImpl(const Ice::ObjectAdapterPtr& adapter, const std::string& name, const AsteriskSCF::SessionCommunications::V1::BridgeManagerPrx& prx);
+    ~BridgeManagerImpl();
+
+    //
+    // AsteriskSCF::SessionCommunications::V1::BridgeManager Interface
+    //
+    SessionCommunications::V1::BridgePrx createBridge(
+        const SessionCommunications::V1::SessionSeq& endpoints,
             const SessionCommunications::V1::BridgeListenerPrx& listener,
             const Ice::Current& current);
-        
-        void addListener(const SessionCommunications::V1::BridgeManagerListenerPrx& listener, const Ice::Current& current);
-        void removeListener(const SessionCommunications::V1::BridgeManagerListenerPrx& listener, const Ice::Current& current);
-        SessionCommunications::V1::BridgeSeq listBridges(const Ice::Current& current);
-        void shutdown(const Ice::Current& current);
 
-        struct BridgeInfo
-        {
-            BridgeImplPtr servant;
-            SessionCommunications::V1::BridgePrx proxy;
-        };
-        
-    private:
-        
-        boost::shared_mutex mLock;
-        std::string mName;
-        std::vector<BridgeInfo> mBridges;
-        bool mShuttingDown;
-        bool mSuspended;
-        Ice::ObjectAdapterPtr mAdapter;
-        AsteriskSCF::SessionCommunications::V1::BridgeManagerPrx mSourceProxy;
-        BridgeManagerListenerMgrPtr mListeners;
-        void reap();
+    void addListener(const SessionCommunications::V1::BridgeManagerListenerPrx& listener, const Ice::Current& current);
+    void removeListener(const SessionCommunications::V1::BridgeManagerListenerPrx& listener, const Ice::Current& current);
+    SessionCommunications::V1::BridgeSeq listBridges(const Ice::Current& current);
+    void shutdown(const Ice::Current& current);
+
+    struct BridgeInfo
+    {
+        BridgeImplPtr servant;
+        SessionCommunications::V1::BridgePrx proxy;
     };
 
-    typedef IceUtil::Handle<BridgeManagerImpl> BridgeManagerImplPtr;
+private:
+
+    boost::shared_mutex mLock;
+    std::string mName;
+    std::vector<BridgeInfo> mBridges;
+    bool mShuttingDown;
+    bool mSuspended;
+    Ice::ObjectAdapterPtr mAdapter;
+    AsteriskSCF::SessionCommunications::V1::BridgeManagerPrx mSourceProxy;
+    BridgeManagerListenerMgrPtr mListeners;
+    void reap();
+};
+
+typedef IceUtil::Handle<BridgeManagerImpl> BridgeManagerImplPtr;
 };
 };
diff --git a/src/BridgeManagerListenerMgr.cpp b/src/BridgeManagerListenerMgr.cpp
index f7c4b5b..dd7b6f9 100644
--- a/src/BridgeManagerListenerMgr.cpp
+++ b/src/BridgeManagerListenerMgr.cpp
@@ -16,7 +16,7 @@
 #include "BridgeManagerListenerMgr.h"
 
 AsteriskSCF::BridgeService::BridgeManagerListenerMgr::BridgeManagerListenerMgr(const Ice::CommunicatorPtr& communicator, const std::string& name,
-        const AsteriskSCF::SessionCommunications::V1::BridgeManagerPrx& source) :
+    const AsteriskSCF::SessionCommunications::V1::BridgeManagerPrx& source) :
     AsteriskSCF::BridgeService::ListenerManagerT<AsteriskSCF::SessionCommunications::V1::BridgeManagerListenerPrx>(communicator, name, true),
     mPrx(source)
 {
diff --git a/src/BridgeManagerListenerMgr.h b/src/BridgeManagerListenerMgr.h
index 5af19b6..1579772 100644
--- a/src/BridgeManagerListenerMgr.h
+++ b/src/BridgeManagerListenerMgr.h
@@ -24,21 +24,21 @@ namespace AsteriskSCF
 {
 namespace BridgeService
 {
-    class BridgeManagerListenerMgr : virtual public ListenerManagerT<AsteriskSCF::SessionCommunications::V1::BridgeManagerListenerPrx>
-    {
-    public:
-        BridgeManagerListenerMgr(const Ice::CommunicatorPtr& communicator, const std::string& name,
-                const AsteriskSCF::SessionCommunications::V1::BridgeManagerPrx& source);
+class BridgeManagerListenerMgr : virtual public ListenerManagerT<AsteriskSCF::SessionCommunications::V1::BridgeManagerListenerPrx>
+{
+public:
+    BridgeManagerListenerMgr(const Ice::CommunicatorPtr& communicator, const std::string& name,
+        const AsteriskSCF::SessionCommunications::V1::BridgeManagerPrx& source);
 
-        void bridgeCreated(const AsteriskSCF::SessionCommunications::V1::BridgePrx& bridge);
-        void stopped();
-        void stopping();
+    void bridgeCreated(const AsteriskSCF::SessionCommunications::V1::BridgePrx& bridge);
+    void stopped();
+    void stopping();
 
-        void setSource(const AsteriskSCF::SessionCommunications::V1::BridgeManagerPrx& source);
-    private:
-        AsteriskSCF::SessionCommunications::V1::BridgeManagerPrx mPrx;
-    };
+    void setSource(const AsteriskSCF::SessionCommunications::V1::BridgeManagerPrx& source);
+private:
+    AsteriskSCF::SessionCommunications::V1::BridgeManagerPrx mPrx;
+};
 
-    typedef IceUtil::Handle<BridgeManagerListenerMgr> BridgeManagerListenerMgrPtr;
+typedef IceUtil::Handle<BridgeManagerListenerMgr> BridgeManagerListenerMgrPtr;
 } // End of namespace BridgeService
 } // End of namespace AsteriskSCF
diff --git a/src/BridgeServiceImpl.h b/src/BridgeServiceImpl.h
index b29c58b..edf00e1 100644
--- a/src/BridgeServiceImpl.h
+++ b/src/BridgeServiceImpl.h
@@ -13,10 +13,10 @@
 
 namespace AsteriskSCF
 {
-   namespace BridgeService
-   {
-      class BridgeImpl
-   }
+namespace BridgeService
+{
+class BridgeImpl
+}
 }
 
 #endif
diff --git a/src/InternalExceptions.h b/src/InternalExceptions.h
index 2eca5cd..17d189e 100644
--- a/src/InternalExceptions.h
+++ b/src/InternalExceptions.h
@@ -17,36 +17,36 @@ namespace AsteriskSCF
 {
 namespace BridgeService
 {
-    class ConfigException : public std::exception
-    {
-    public:
+class ConfigException : public std::exception
+{
+public:
 
-        ConfigException(const std::string& propertyName, const std::string& message) 
+    ConfigException(const std::string& propertyName, const std::string& message)
+    {
+        std::stringstream what;
+        what << propertyName << " configuration error: ";
+        if(message.size() != 0)
         {
-            std::stringstream what;
-            what << propertyName << " configuration error: ";
-            if(message.size() != 0)
-            {
-                what << message;
-            }
-            else
-            {
-                what << "(no message)";
-            }
-            mWhat = what.str();
+            what << message;
         }
-
-        ~ConfigException() throw()
+        else
         {
+            what << "(no message)";
         }
+        mWhat = what.str();
+    }
 
-        const char* what() const throw()
-        {
-            return mWhat.c_str();
-        }
+    ~ConfigException() throw()
+    {
+    }
+
+    const char* what() const throw()
+    {
+        return mWhat.c_str();
+    }
 
-    private:
-        std::string mWhat;
-    };
+private:
+    std::string mWhat;
+};
 }
 }
diff --git a/src/ListenerManager.h b/src/ListenerManager.h
index 170e9cb..e0e8700 100644
--- a/src/ListenerManager.h
+++ b/src/ListenerManager.h
@@ -21,245 +21,245 @@ namespace AsteriskSCF
 {
 namespace BridgeService
 {
-    //
-    // Helper template for classes that need to implement listener style interfaces.
-    //
-    template <class T>
-    class ListenerManagerT : public IceUtil::Shared
+//
+// Helper template for classes that need to implement listener style interfaces.
+//
+template <class T>
+class ListenerManagerT : public IceUtil::Shared
+{
+    typedef std::vector<T> ListenerSeq;
+    typename std::vector<T>::iterator ListenerIter;
+
+    class InitializationThread : public IceUtil::Thread
     {
-        typedef std::vector<T> ListenerSeq;
-        typename std::vector<T>::iterator ListenerIter;
+    public:
+        InitializationThread(const typename IceUtil::Handle<ListenerManagerT>& mgr) :
+            mMgr(mgr),
+            mStopped(false)
+        {
+        }
 
-        class InitializationThread : public IceUtil::Thread
+        void run()
         {
-        public:
-            InitializationThread(const typename IceUtil::Handle<ListenerManagerT>& mgr) : 
-                mMgr(mgr),
-                mStopped(false)
+            bool initialized = false;
+            IceUtil::Monitor<IceUtil::Mutex>::Lock lock(mMonitor);
+            while(!mStopped && !initialized)
             {
+                //
+                // TODO: Make configurable.
+                //
+                mMonitor.timedWait(IceUtil::Time::seconds(15));
+                initialized = mMgr->init();
             }
+        }
 
-            void run()
-            {
-                bool initialized = false;
-                IceUtil::Monitor<IceUtil::Mutex>::Lock lock(mMonitor);
-                while(!mStopped && !initialized)
-                {
-                    //
-                    // TODO: Make configurable.
-                    //
-                    mMonitor.timedWait(IceUtil::Time::seconds(15));
-                    initialized = mMgr->init();
-                }
-            }
+        void stop()
+        {
+            IceUtil::Monitor<IceUtil::Mutex>::Lock lock(mMonitor);
+            mStopped = true;
+            mMonitor.notify();
+        }
 
-            void stop()
-            {
-                IceUtil::Monitor<IceUtil::Mutex>::Lock lock(mMonitor);
-                mStopped = true;
-                mMonitor.notify();
-            }
+    private:
+        IceUtil::Monitor<IceUtil::Mutex> mMonitor;
+        typename IceUtil::Handle<ListenerManagerT> mMgr;
+        bool mStopped;
+    };
 
-        private:
-            IceUtil::Monitor<IceUtil::Mutex> mMonitor;
-            typename IceUtil::Handle<ListenerManagerT> mMgr;
-            bool mStopped;
-        };
+public:
+    ListenerManagerT(const Ice::CommunicatorPtr& communicator, const std::string& topicName, bool enableBackgroundInit) :
+        mCommunicator(communicator),
+        mTopicName(topicName),
+        mInitialized(false)
+    {
+        try
+        {
+            init();
+        }
+        catch(const Ice::Exception&)
+        {
+        }
+        if(!mInitialized && enableBackgroundInit)
+        {
+            mInitThread = new InitializationThread(this);
+            mInitThread->start();
+        }
+    }
 
-    public:
-        ListenerManagerT(const Ice::CommunicatorPtr& communicator, const std::string& topicName, bool enableBackgroundInit) :
-            mCommunicator(communicator),
-            mTopicName(topicName),
-            mInitialized(false)
+    virtual ~ListenerManagerT()
+    {
+        if(mTopic)
         {
             try
             {
-                init();
-            }
-            catch(const Ice::Exception&)
-            {
+                mTopic->destroy();
             }
-            if(!mInitialized && enableBackgroundInit)
+            catch(...)
             {
-                mInitThread = new InitializationThread(this);
-                mInitThread->start();
+                //
+                // Destructors are no-throw!
+                //
             }
         }
+    }
 
-        virtual ~ListenerManagerT()
+    //
+    // NOTE: The current implementation is a little fast and loose here. Inconsistent conditions
+    // and whatnot are not flagged.
+    //
+    void addListener(const T& listener)
+    {
+        boost::unique_lock<boost::shared_mutex> lock(mLock);
+        if(std::find(mListeners.begin(), mListeners.end(), listener) == mListeners.end())
         {
-            if(mTopic)
-            {
-                try
-                {
-                    mTopic->destroy();
-                }
-                catch(...)
-                {
-                    //
-                    // Destructors are no-throw!
-                    //
-                }
-            }
+            mListeners.push_back(listener);
         }
 
-        //
-        // NOTE: The current implementation is a little fast and loose here. Inconsistent conditions
-        // and whatnot are not flagged.
-        //
-        void addListener(const T& listener)
+        if(mInitialized)
         {
-            boost::unique_lock<boost::shared_mutex> lock(mLock);
-            if(std::find(mListeners.begin(), mListeners.end(), listener) == mListeners.end())
+            IceStorm::QoS qos;
+            qos["reliability"] = "ordered";
+
+            try
             {
-                mListeners.push_back(listener);
+                mTopic->subscribeAndGetPublisher(qos, listener);
             }
-           
-            if(mInitialized)
... 28440 lines suppressed ...


-- 
asterisk-scf/integration/bridging.git



More information about the asterisk-scf-commits mailing list