[asterisk-scf-commits] asterisk-scf/integration/media_rtp_pjmedia.git branch "baserep" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Dec 16 08:42:59 CST 2011


branch "baserep" has been created
        at  b4e7312d683e688979c204155b2ad862a854e304 (commit)

- Log -----------------------------------------------------------------
commit b4e7312d683e688979c204155b2ad862a854e304
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Fri Dec 16 08:42:55 2011 -0600

    Renamed RtpStateReplicatorApp.cpp, which now also uses base replicator class.

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 10fee6a..440c048 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -58,7 +58,7 @@ pjproject_link(media_rtp_pjmedia pjnath)
 astscf_component_install(media_rtp_pjmedia)
 
 astscf_component_init(RtpStateReplicator)
-astscf_component_add_files(RtpStateReplicator RtpStateReplicatorApp.cpp)
+astscf_component_add_files(RtpStateReplicator ComponentStateReplicator.cpp)
 astscf_component_add_files(RtpStateReplicator RtpStateReplicator.h)
 astscf_component_add_slices(RtpStateReplicator PROJECT AsteriskSCF/Replication/MediaRTPPJMedia/RtpStateReplicationIf.ice)
 astscf_component_add_slices(RtpStateReplicator PROJECT AsteriskSCF/Configuration/MediaRTPPJMedia/RtpConfigurationIf.ice)
diff --git a/src/ComponentStateReplicator.cpp b/src/ComponentStateReplicator.cpp
new file mode 100644
index 0000000..b119c95
--- /dev/null
+++ b/src/ComponentStateReplicator.cpp
@@ -0,0 +1,114 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2011, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#include <pjlib.h>
+
+#include <Ice/Ice.h>
+
+#include <AsteriskSCF/Component/ComponentStateReplicator.h>
+#include <AsteriskSCF/System/Component/ComponentServiceIf.h>
+#include <AsteriskSCF/Logger/IceLogger.h>
+#include <AsteriskSCF/logger.h>
+#include <AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h>
+#include <AsteriskSCF/System/Component/ConfigurationIf.h>
+
+#include "RtpConfigurationIf.h"
+#include "RtpStateReplicator.h"
+
+using namespace std;
+using namespace AsteriskSCF::Core;
+using namespace AsteriskSCF::Discovery;
+using namespace AsteriskSCF::Core::Discovery::V1;
+using namespace AsteriskSCF::System::Component::V1;
+using namespace AsteriskSCF::System::Logging;
+using namespace AsteriskSCF::Media::RTP::V1;
+using namespace AsteriskSCF::Replication::MediaRTPPJMedia::V1;
+using namespace AsteriskSCF::Configuration::MediaRTPPJMedia::V1;
+
+namespace
+{
+Logger lg = getLoggerFactory().getLogger("AsteriskSCF.MediaRTP");
+}
+
+class ComponentStateReplicator : public AsteriskSCF::Component::ComponentStateReplicator
+{
+public:
+    ComponentStateReplicator() :
+      AsteriskSCF::Component::ComponentStateReplicator(lg, 
+          AsteriskSCF::Replication::MediaRTPPJMedia::V1::StateReplicatorComponentCategory, 
+          true)  // if true, supports configuration
+    {
+    }
+
+    ~ComponentStateReplicator() {};
+
+    ///////////////////////////////////////////////////
+    // Required overrides
+
+    void createPrimaryServices();
+    void preparePrimaryServicesForDiscovery();
+
+private:
+    RtpStateReplicatorIPtr mStateReplicator;
+    RtpStateReplicatorPrx mStateReplicatorPrx;
+    LocatorRegistrationWrapperPtr mStateReplicatorRegistration;
+};
+
+static const string ServiceDiscoveryId("RtpStateReplicatorService");
+
+/**
+ * Register this component's primary public interfaces with the Service Locator.
+ * This enables other Asterisk SCF components to locate our interfaces.
+ */
+void ComponentStateReplicator::preparePrimaryServicesForDiscovery()
+{
+    try
+    {
+        // Wrap our replicator interface for the Service Locator.
+        mStateReplicatorRegistration = wrapServiceForRegistration(mStateReplicatorPrx,
+                                                                  StateReplicatorDiscoveryCategory);
+        managePrimaryService(mStateReplicatorRegistration);
+    }
+    catch(const std::exception& e)
+    {
+        lg(Error) << "Unable to publish component interfaces in " << getName() << BOOST_CURRENT_FUNCTION <<
+            ". Exception: " << e.what();
+        throw; // rethrow
+    }
+}
+
+void ComponentStateReplicator::createPrimaryServices()
+{
+    // Create our instance of the StateReplicator template. 
+    mStateReplicator = new RtpStateReplicatorI;
+    mStateReplicatorPrx = RtpStateReplicatorPrx::uncheckedCast(
+        getServiceAdapter()->add(mStateReplicator, getCommunicator()->stringToIdentity(ServiceDiscoveryId)));
+
+    assert(mStateReplicatorPrx != 0);
+    if(mStateReplicatorPrx == 0)
+    {
+        throw IceBox::FailureException(__FILE__, __LINE__, "Unable to instantiate RTP State Replicator object");
+    }
+}
+
+extern "C"
+{
+ASTSCF_DLL_EXPORT IceBox::Service* create(Ice::CommunicatorPtr)
+{
+    return new ComponentStateReplicator;
+}
+}
+
diff --git a/src/RtpStateReplicatorApp.cpp b/src/RtpStateReplicatorApp.cpp
deleted file mode 100644
index d7fb661..0000000
--- a/src/RtpStateReplicatorApp.cpp
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * Asterisk SCF -- An open-source communications framework.
- *
- * Copyright (C) 2010, Digium, Inc.
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk SCF project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE.txt file
- * at the top of the source tree.
- */
-
-#include <pjlib.h>
-
-#include <Ice/Ice.h>
-#include <IceUtil/UUID.h>
-#include <IceStorm/IceStorm.h>
-#include <IceBox/IceBox.h>
-
-#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
-#include <AsteriskSCF/System/Component/ComponentServiceIf.h>
-#include <AsteriskSCF/Logger/IceLogger.h>
-#include <AsteriskSCF/logger.h>
-#include <AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h>
-#include <AsteriskSCF/System/Component/ConfigurationIf.h>
-
-#include "RtpConfigurationIf.h"
-#include "RtpStateReplicator.h"
-
-using namespace std;
-using namespace AsteriskSCF::Core;
-using namespace AsteriskSCF::Core::Discovery::V1;
-using namespace AsteriskSCF::System::Component::V1;
-using namespace AsteriskSCF::System::Logging;
-using namespace AsteriskSCF::Media::RTP::V1;
-using namespace AsteriskSCF::Replication::MediaRTPPJMedia::V1;
-using namespace AsteriskSCF::Configuration::MediaRTPPJMedia::V1;
-using namespace AsteriskSCF::CollocatedIceStorm;
-using namespace AsteriskSCF::System::Configuration::V1;
-
-namespace
-{
-Logger lg = getLoggerFactory().getLogger("AsteriskSCF.MediaRTP");
-}
-
-class RtpStateReplicatorService : public IceBox::Service
-{
-public:
-    RtpStateReplicatorService() { };
-    ~RtpStateReplicatorService()
-    {
-        mComponentService = 0;
-        mAdapter = 0;
-        mStateReplicator = 0;
-    mConfigurationReplicator = 0;
-    };
-    virtual void start(const string &name, const Ice::CommunicatorPtr& ic, const Ice::StringSeq& args);
-    virtual void stop();
-
-private:
-    void initialize(const string& appName, const Ice::CommunicatorPtr& ic);
-    void registerWithServiceLocator(const Ice::CommunicatorPtr& ic);
-    void deregisterFromServiceLocator();
-    std::string mAppName;
-    Ice::ObjectAdapterPtr mAdapter;
-    ServiceLocatorManagementPrx mServiceLocatorManagement;
-    Discovery::V1::ServiceManagementPrx mComponentServiceManagement;
-    Discovery::V1::ServiceManagementPrx mStateReplicationManagement;
-    ConfiguredIceLoggerPtr mIceLogger;
-    ComponentServicePtr mComponentService;
-    RtpStateReplicatorIPtr mStateReplicator;
-    ConfigurationReplicatorPtr mConfigurationReplicator;
-    CollocatedIceStormPtr mIceStorm;
-    Ice::ObjectPrx mConfigurationPublisher;
-    Discovery::V1::ServiceManagementPrx mConfigurationManagement;
-};
-
-static const string ComponentServiceId("RtpStateReplicatorComponent");
-static const string ServiceDiscoveryId("RtpStateReplicatorService");
-
-/**
- * This class provides implementation for the ComponentService interface, which
- * every Asterisk SCF component is expected to publish.
- */
-class ComponentServiceImpl : public ComponentService
-{
-public:
-    ComponentServiceImpl(RtpStateReplicatorService &service) : mService(service) {}
-
-public: // Overrides of the ComponentService interface.
-    virtual void suspend(const ::Ice::Current& = ::Ice::Current())
-    {
-        // TBD
-    }
-
-    virtual void resume(const ::Ice::Current& = ::Ice::Current())
-    {
-        // TBD
-    }
-
-    virtual void shutdown(const ::Ice::Current& = ::Ice::Current())
-    {
-        // TBD
-    }
-
-private:
-    RtpStateReplicatorService& mService;
-};
-
-class ConfigurationReplicatorI : public ConfigurationReplicator
-{
-public:
-    ConfigurationReplicatorI(const IceStorm::TopicPrx& topic) : mConfigurationReplicationTopic(topic) { };
-    void registerConfigurationService(const AsteriskSCF::System::Configuration::V1::ConfigurationServicePrx&, const Ice::Current&);
-private:
-    IceStorm::TopicPrx mConfigurationReplicationTopic;    
-};
-
-void ConfigurationReplicatorI::registerConfigurationService(const AsteriskSCF::System::Configuration::V1::ConfigurationServicePrx& service, const Ice::Current&)
-{
-    if (mConfigurationReplicationTopic)
-    {
-        IceStorm::QoS qos;
-        qos["reliability"] = "ordered";
-    
-        try
-        {
-            mConfigurationReplicationTopic->subscribeAndGetPublisher(qos, service);
-        }
-        catch (const IceStorm::AlreadySubscribed&)
-        {
-            // This is perfectly okay actually, it just means what they wanted us to do
-            // is already done.
-        }
-    }
-}
-
-/**
- * Register this component's primary public interfaces with the Service Locator.
- * This enables other Asterisk SCF components to locate our interfaces.
- */
-void RtpStateReplicatorService::registerWithServiceLocator(const Ice::CommunicatorPtr& ic)
-{
-    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(ic->propertyToProxy("LocatorServiceManagement.Proxy"));
-
-        if (mServiceLocatorManagement == 0)
-        {
-            lg(Error) << "Unable to obtain proxy to LocatorServiceManagement interface. Check config file. "
-                "This component can't be found until this is corrected.";
-            return;
-        }
-
-        // Get a proxy to our ComponentService interface and add it to the Service Locator.
-        Ice::ObjectPrx componentServiceObjectPrx = mAdapter->createDirectProxy(ic->stringToIdentity(ComponentServiceId));
-        ComponentServicePrx componentServicePrx = ComponentServicePrx::checkedCast(componentServiceObjectPrx);
-
-        // The GUID passed in to add service needs to be unique for reporting.
-        string componentServiceGuid(AsteriskSCF::Replication::MediaRTPPJMedia::V1::StateReplicatorComponentCategory);
-        mComponentServiceManagement = ServiceManagementPrx::uncheckedCast(
-            mServiceLocatorManagement->addService(componentServicePrx, componentServiceGuid));
-
-        // Add category as a parameter to enable other components look this component up.
-        ServiceLocatorParamsPtr genericparams = new ServiceLocatorParams();
-        genericparams->category = AsteriskSCF::Replication::MediaRTPPJMedia::V1::StateReplicatorComponentCategory;
-        genericparams->service =  ic->getProperties()->getPropertyWithDefault(mAppName + ".ServiceName", "default");
-        genericparams->id = mAppName;
-        mComponentServiceManagement->addLocatorParams(genericparams, "");
-
-        Ice::ObjectPrx stateReplicatorObjectPrx = mAdapter->createDirectProxy(ic->stringToIdentity(ServiceDiscoveryId));
-        RtpStateReplicatorPrx stateReplicatorPrx = RtpStateReplicatorPrx::checkedCast(stateReplicatorObjectPrx);
-
-        string stateReplicationGuid(AsteriskSCF::Replication::MediaRTPPJMedia::V1::StateReplicatorDiscoveryCategory);
-        mStateReplicationManagement = ServiceManagementPrx::uncheckedCast(
-            mServiceLocatorManagement->addService(stateReplicatorPrx, stateReplicationGuid));
-
-        ServiceLocatorParamsPtr discoveryParams = new ServiceLocatorParams;
-        discoveryParams->category = AsteriskSCF::Replication::MediaRTPPJMedia::V1::StateReplicatorDiscoveryCategory;
-        discoveryParams->service = ic->getProperties()->getPropertyWithDefault(mAppName + ".ServiceName", "default");
-        discoveryParams->id = mAppName;
-        mStateReplicationManagement->addLocatorParams(discoveryParams, "");
-
-        // Publish the configuration service IceStorm topic so everybody gets configuration
-        mConfigurationManagement = ServiceManagementPrx::uncheckedCast(
-        mServiceLocatorManagement->addService(mConfigurationPublisher, ""));
-
-        // Populate the configuration parameters with details so we can be found
-        ServiceLocatorParamsPtr configurationParams = new ServiceLocatorParams();
-        configurationParams->category = ConfigurationDiscoveryCategory;
-        configurationParams->service = ic->getProperties()->getPropertyWithDefault(mAppName + ".ServiceName", "default");
-        configurationParams->id = mAppName;
-        mConfigurationManagement->addLocatorParams(configurationParams, "");
-
-        // TBD... We may have other interfaces to publish to the Service Locator.
-    }
-    catch(...)
-    {
-        lg(Error) << "Exception in " << mAppName << " registerWithServiceLocator()";
-    }
-}
-
-/**
- * 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.
- */
-void RtpStateReplicatorService::deregisterFromServiceLocator()
-{
-    try
-    {
-        mComponentServiceManagement->unregister();
-        mConfigurationManagement->unregister();
-    }
-    catch(...)
-    {
-        lg(Error) << "Had trouble in deregisterFromServiceLocator().";
-    }
-}
-
-void RtpStateReplicatorService::initialize(const string& appName, const Ice::CommunicatorPtr& ic)
-{
-    mIceStorm = new CollocatedIceStorm(appName, ic->getProperties());
-
-    IceStorm::TopicManagerPrx topicManager = mIceStorm->createTopicManagerProxy(ic);
-
-    IceStorm::TopicPrx topic;
-
-    if (topicManager)
-    {
-        try
-        {
-        topic = topicManager->retrieve("ConfigurationReplication");
-        }
-        catch (const IceStorm::NoSuchTopic&)
-        {
-            try
-            {
-                topic = topicManager->create("ConfigurationReplication");
-            }
-            catch (const IceStorm::TopicExists&)
-            {
-                lg(Error) << "Oh snap! Race condition creating topic, aborting";
-                return;
-            }
-        }
-    // There is no cast here on purpose as this is just going to get passed to
-    // the service locator which just takes a plain ol' proxy anyway.
-    mConfigurationPublisher = topic->getPublisher();
-    }
-    else
-    {
-        lg(Info) << "IceStorm topic manager proxy not present, unable to perform configuration replication.";
-    }
-
-    mAdapter = ic->createObjectAdapter(appName + ".Adapter");
-
-    // setup logging client
-    mIceLogger = createIceLogger(mAdapter);
-    getLoggerFactory().setLogOutput(mIceLogger->getLogger());
-
-    mAppName = appName;
-    // Create and publish our ComponentService interface support.
-    mComponentService = new ComponentServiceImpl(*this);
-    mAdapter->add(mComponentService, ic->stringToIdentity(ComponentServiceId));
-    mStateReplicator = new RtpStateReplicatorI();
-    mAdapter->add(mStateReplicator, ic->stringToIdentity(ServiceDiscoveryId));
-    mConfigurationReplicator = new ConfigurationReplicatorI(topic);
-    mAdapter->addFacet(mConfigurationReplicator, ic->stringToIdentity(ServiceDiscoveryId),
-    ReplicatorFacet);
-
-    mAdapter->activate();
-}
-
-void RtpStateReplicatorService::start(const string &name, const Ice::CommunicatorPtr& ic, const Ice::StringSeq&)
-{
-    initialize(name, ic);
-    // Plug into the Asterisk SCF discovery system so that the interfaces we provide
-    // can be located.
-    registerWithServiceLocator(ic);
-}
-
-void RtpStateReplicatorService::stop()
-{
-    // Remove our interfaces from the service locator.
-    deregisterFromServiceLocator();
-
-    // Stop our local IceStorm instance
-    mIceStorm->stop();
-}
-
-extern "C"
-{
-ASTSCF_DLL_EXPORT IceBox::Service* create(Ice::CommunicatorPtr)
-{
-    return new RtpStateReplicatorService;
-}
-}
-

commit 6fef5dec075436182ff4ed713ae3622e1202d109
Author: Joshua Colp <jcolp at digium.com>
Date:   Tue Oct 4 18:34:33 2011 -0300

    Remove comparator ID replication that is no longer needed and do slight cleanup.

diff --git a/slice/AsteriskSCF/Replication/MediaRTPPJMedia/RtpStateReplicationIf.ice b/slice/AsteriskSCF/Replication/MediaRTPPJMedia/RtpStateReplicationIf.ice
index 3651d1d..bd0185e 100644
--- a/slice/AsteriskSCF/Replication/MediaRTPPJMedia/RtpStateReplicationIf.ice
+++ b/slice/AsteriskSCF/Replication/MediaRTPPJMedia/RtpStateReplicationIf.ice
@@ -70,12 +70,8 @@ module V1
     class RtpGeneralStateItem extends RtpStateItem
     {
 	AsteriskSCF::Core::Discovery::V1::ServiceManagement *serviceManagement;
-	string comparatorId;
     };
 
-    /**
-     * TODO: Data members in Slice defined classes should not have `m' prefixes.
-     */
     class RtpSessionStateItem extends RtpStateItem
     {
 	Ice::Identity sessionIdentity;
diff --git a/src/Component.cpp b/src/Component.cpp
index abfea53..8e27eaa 100644
--- a/src/Component.cpp
+++ b/src/Component.cpp
@@ -356,8 +356,7 @@ void Component::createPrimaryServices()
 
         if (rtpReplicationContext->isActive() == true)
         {
-            mGeneralState->comparatorId = IceUtil::generateUUID();
-            getServiceLocatorManagement()->addCompare(mGeneralState->comparatorId, mRtpMediaComparatorServicePrx);
+            getServiceLocatorManagement()->addCompare(getName() + ".RTP.Comparator", mRtpMediaComparatorServicePrx);
         }
 
     }
@@ -533,15 +532,11 @@ void Component::onRegisterPrimaryServices()
     }
 
     mGeneralState->serviceManagement = mRtpMediaServiceRegistration->getServiceManagement();
-    mGeneralState->serviceManagement->addLocatorParams(mRtpOverIceLocatorParams, mGeneralState->comparatorId);
+    mGeneralState->serviceManagement->addLocatorParams(mRtpOverIceLocatorParams, getName() + ".RTP.Comparator");
 }
 
 void Component::onStart()
 {
-    // Note: I don't think this is necessary. If we make the
-    // comparator computed from a "service" identifier (which could default
-    // to "default"), there's nothing replicated here that the standby component
-    // couldn't already determine itself.
     if (getReplicationContext()->isReplicating() == true)
     {
         RtpReplicationContextPtr rtpReplicationContext =
@@ -561,10 +556,7 @@ void Component::onStop()
        mGeneralState->serviceManagement->unregister();
     }
 
-    if (!mGeneralState->comparatorId.empty())
-    {
-        getServiceLocatorManagement()->removeCompare(mGeneralState->comparatorId);
-    }
+    getServiceLocatorManagement()->removeCompare(getName() + ".RTP.Comparator");
 }
 
 extern "C"
diff --git a/src/RtpStateReplicatorListener.cpp b/src/RtpStateReplicatorListener.cpp
index 95fbef3..ddf385d 100644
--- a/src/RtpStateReplicatorListener.cpp
+++ b/src/RtpStateReplicatorListener.cpp
@@ -98,7 +98,6 @@ public:
             void visitRtpGeneralStateItem(const RtpGeneralStateItemPtr &item)
             {
                 mImpl->mGeneralState->serviceManagement = item->serviceManagement;
-                mImpl->mGeneralState->comparatorId = item->comparatorId;
             }
                 
             void visitRtpSessionStateItem(const RtpSessionStateItemPtr &item)
diff --git a/test/TestRTPpjmedia.cpp b/test/TestRTPpjmedia.cpp
index 6bda9b9..ab4a68f 100644
--- a/test/TestRTPpjmedia.cpp
+++ b/test/TestRTPpjmedia.cpp
@@ -454,7 +454,6 @@ BOOST_AUTO_TEST_CASE(CheckReplicatedGeneralStateItem)
 
     BOOST_CHECK(Testbed.mListener->mGeneral);
     BOOST_CHECK(Testbed.mListener->mGeneral->serviceManagement);
-    BOOST_CHECK(Testbed.mListener->mGeneral->comparatorId.size());
 }
 
 /**

commit 7e39c4fff270f6e75b63c6a4c016de99e2ba1673
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Sun Oct 2 17:57:10 2011 -0500

    Adapt to API changes. The telephone addSink() operation is now addSinks(), and added support for new removeSinks() operation.

diff --git a/src/RTPTelephonyEventSource.cpp b/src/RTPTelephonyEventSource.cpp
index 5024232..9189150 100644
--- a/src/RTPTelephonyEventSource.cpp
+++ b/src/RTPTelephonyEventSource.cpp
@@ -45,15 +45,19 @@ RTPTelephonyEventSource::~RTPTelephonyEventSource()
 {
 }
 
-void RTPTelephonyEventSource::addSink_async(
-        const AMD_TelephonyEventSource_addSinkPtr& cb,
-        const TelephonyEventSinkPrx& sink,
+void RTPTelephonyEventSource::addSinks_async(
+        const AMD_TelephonyEventSource_addSinksPtr& cb,
+        const TelephonyEventSinkSeq& sinks,
         const Ice::Current&)
 {
     boost::unique_lock<boost::shared_mutex> lock(mLock);
-    if (std::find(mStateItem->sinks.begin(), mStateItem->sinks.end(), sink) == mStateItem->sinks.end())
+
+    for (TelephonyEventSinkSeq::const_iterator i; i != sinks.end(); ++i)
     {
-        mStateItem->sinks.push_back(sink);
+        if (std::find(mStateItem->sinks.begin(), mStateItem->sinks.end(), *i) == mStateItem->sinks.end())
+        {
+            mStateItem->sinks.push_back(*i);
+        }
     }
     mSessionAdapter->replicateState(mStateItem);
     cb->ice_response();
@@ -67,6 +71,25 @@ void RTPTelephonyEventSource::getSinks_async(
     cb->ice_response(mStateItem->sinks);
 }
 
+void RTPTelephonyEventSource::removeSinks_async(
+        const AMD_TelephonyEventSource_removeSinksPtr& cb,
+        const TelephonyEventSinkSeq& sinks,
+        const Ice::Current&)
+{
+    boost::unique_lock<boost::shared_mutex> lock(mLock);
+
+    for (TelephonyEventSinkSeq::const_iterator i; i != sinks.end(); ++i)
+    {
+        TelephonyEventSinkSeq::iterator found = std::find(mStateItem->sinks.begin(), mStateItem->sinks.end(), *i);
+        if (found != mStateItem->sinks.end())
+        {
+            mStateItem->sinks.erase(found);
+        }
+    }
+    mSessionAdapter->replicateState(mStateItem);
+    cb->ice_response();
+}
+
 void RTPTelephonyEventSource::read(const pjmedia_rtp_hdr* header, const Ice::Byte* payload)
 {
     //Even though this structure has "dtmf" in its name, it is used for
diff --git a/src/RTPTelephonyEventSource.h b/src/RTPTelephonyEventSource.h
index cb315a6..df88222 100644
--- a/src/RTPTelephonyEventSource.h
+++ b/src/RTPTelephonyEventSource.h
@@ -38,15 +38,20 @@ public:
     /**
      * Overrides of TelephonyEventSource interface
      */
-    void addSink_async(
-            const AsteriskSCF::SessionCommunications::V1::AMD_TelephonyEventSource_addSinkPtr& cb,
-            const AsteriskSCF::SessionCommunications::V1::TelephonyEventSinkPrx& sink,
+    void addSinks_async(
+            const AsteriskSCF::SessionCommunications::V1::AMD_TelephonyEventSource_addSinksPtr& cb,
+            const AsteriskSCF::SessionCommunications::V1::TelephonyEventSinkSeq& sinks,
             const Ice::Current&);
 
     void getSinks_async(
             const AsteriskSCF::SessionCommunications::V1::AMD_TelephonyEventSource_getSinksPtr& cb,
             const Ice::Current&);
 
+    void removeSinks_async(
+            const AsteriskSCF::SessionCommunications::V1::AMD_TelephonyEventSource_removeSinksPtr& cb,
+            const AsteriskSCF::SessionCommunications::V1::TelephonyEventSinkSeq& sinks,
+            const Ice::Current&);
+
     /**
      * Used to read a new RFC 4733 event in.
      */

commit a6641628f49f2554a7663c7d807dc4680f79519d
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Fri Sep 30 13:26:09 2011 -0500

    Use AsteriskSCF::PJLib::ThreadHook for tracking threads created by the
    Ice runtime.
    
    Review: https://code.asterisk.org/code/cru/CR-ASTSCF-168

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d130546..10fee6a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -49,7 +49,7 @@ astscf_component_add_slices(media_rtp_pjmedia PROJECT AsteriskSCF/Configuration/
 astscf_component_add_boost_libraries(media_rtp_pjmedia core thread)
 astscf_component_add_slice_collection_libraries(media_rtp_pjmedia ASTSCF)
 astscf_component_build_icebox(media_rtp_pjmedia)
-target_link_libraries(media_rtp_pjmedia logging-client astscf-ice-util-cpp)
+target_link_libraries(media_rtp_pjmedia logging-client astscf-ice-util-cpp astscf-ice-util-cpp-pjlib)
 
 pjproject_link(media_rtp_pjmedia pjlib)
 pjproject_link(media_rtp_pjmedia pjlib-util)
diff --git a/src/Component.cpp b/src/Component.cpp
index 2b4b3a2..abfea53 100644
--- a/src/Component.cpp
+++ b/src/Component.cpp
@@ -31,6 +31,7 @@
 #include <AsteriskSCF/logger.h>
 #include <AsteriskSCF/Discovery/SmartProxy.h>
 #include <AsteriskSCF/Component/Component.h>
+#include <AsteriskSCF/PJLib/ThreadHook.h>
 
 #include "RtpReplicationContext.h"
 #include "RTPSession.h"
@@ -67,7 +68,7 @@ static const string MediaComparatorServiceId("RTPMediaServiceComparator");
 class RTPMediaServiceImpl : public RTPMediaService
 {
 public:
-    RTPMediaServiceImpl(const Ice::ObjectAdapterPtr&, 
+    RTPMediaServiceImpl(const Ice::ObjectAdapterPtr&,
       const RtpReplicationContextPtr& replicationContext,
       const ConfigurationServiceImplPtr&);
 
@@ -138,7 +139,7 @@ public:
         {
             return false;
         }
-        
+
         RTPOverICEServiceLocatorParamsPtr iceParams = RTPOverICEServiceLocatorParamsPtr::dynamicCast(locatorParams);
         if (iceParams)
         {
@@ -176,13 +177,13 @@ private:
 };
 
 /**
- * Implementation of the Component class. 
+ * Implementation of the Component class.
  */
 class Component : public AsteriskSCF::Component::Component
 {
 public:
-    Component() : 
-       AsteriskSCF::Component::Component(lg, AsteriskSCF::Media::RTP::V1::ComponentServiceDiscoveryCategory), 
+    Component() :
+       AsteriskSCF::Component::Component(lg, AsteriskSCF::Media::RTP::V1::ComponentServiceDiscoveryCategory),
       mListeningToReplicator(false), mGeneralState(new RtpGeneralStateItem()) { mGeneralState->key = IceUtil::generateUUID(); };
 
 private:
@@ -199,7 +200,7 @@ private:
     virtual void onSuspend();
     virtual void onResume();
     virtual void onPreInitialize();
-    virtual void onStop();    
+    virtual void onStop();
     virtual void onStart();
 
     // Other base Component overrides
@@ -223,93 +224,35 @@ private:
     LocatorRegistrationWrapperPtr mRtpMediaServiceRegistration;
 
     // Media comparator service
-    ServiceLocatorParamsComparePtr mRtpMediaComparatorService; 
+    ServiceLocatorParamsComparePtr mRtpMediaComparatorService;
     ServiceLocatorParamsComparePrx mRtpMediaComparatorServicePrx;
     RTPOverICEServiceLocatorParamsPtr mRtpOverIceLocatorParams;
 
-    // Configuration state 
+    // Configuration state
     ConfigurationServiceImplPtr mConfigurationService;
     ConfigurationServicePrx mConfigurationServicePrx;
     LocatorRegistrationWrapperPtr mConfigurationRegistration;
 };
 
-void Component::onSuspend() 
+void Component::onSuspend()
 {
     mGeneralState->serviceManagement->suspend();
 }
 
-void Component::onResume() 
+void Component::onResume()
 {
     mGeneralState->serviceManagement->unsuspend();
 }
 
 /**
- * Wrapper class around pj_thread_desc.
- */
-class ThreadDescWrapper
-{
-public:
-    /**
-     * pjthread thread description information, must persist for the life of the thread
-     */
-    pj_thread_desc mDesc;
-};
-
-/**
- * Type definition used to create a smart pointer for the above.
- */
-typedef boost::shared_ptr<ThreadDescWrapper> ThreadDescWrapperPtr;
-
-/**
- * Implementation of the Ice::ThreadNotification class.
- */
-class pjlibHook : public Ice::ThreadNotification
-{
-public:
-    /**
-     * Implementation of the start function which is called when a thread starts.
-     */
-    void start()
-    {
-        ThreadDescWrapperPtr wrapper = ThreadDescWrapperPtr(new ThreadDescWrapper());
-        pj_thread_t *thread;
-        pj_thread_register("ICE Thread", wrapper->mDesc, &thread);
-        boost::lock_guard<boost::mutex> lock(mLock);
-        pjThreads.insert(make_pair(thread, wrapper));
-    }
-
-    /**
-     * Implementation of the stop function which is called when a thread stops.
-     */
-    void stop()
-    {
-        if (pj_thread_is_registered())
-        {
-            boost::lock_guard<boost::mutex> lock(mLock);
-            pjThreads.erase(pj_thread_this());
-        }
-    }
-private:
-    /**
-     * A map containing thread lifetime persistent data.
-     */
-    map<pj_thread_t*, ThreadDescWrapperPtr> pjThreads;
-
-    /**
-     * Mutex to protect the map
-     */
-    boost::mutex mLock;
-};
-
-/**
  * Constructor for the RTPMediaServiceImpl class.
  */
 RTPMediaServiceImpl::RTPMediaServiceImpl(const Ice::ObjectAdapterPtr& adapter,
     const RtpReplicationContextPtr& replicationContext,
     const ConfigurationServiceImplPtr& configurationService) :
-    mAdapter(adapter), 
+    mAdapter(adapter),
     mEnvironment(PJMediaEnvironment::create(adapter->getCommunicator()->getProperties(), configurationService)),
-    mReplicationContext(replicationContext), 
+    mReplicationContext(replicationContext),
     mConfigurationService(configurationService)
 {
 }
@@ -334,35 +277,28 @@ RTPSessionPrx RTPMediaServiceImpl::allocate(
             outputs);
 }
 
-void Component::onPreInitialize() 
+void Component::onPreInitialize()
 {
-    /* Initialize pjlib as pjmedia will be using it */
-    pj_status_t status = pj_init();
-    if (status != PJ_SUCCESS)
+    try
     {
-        lg(Error) << "PJ library initialization failed.";
-        return;
-    }
+	lg(Info) << "Initializing pjmedia rtp component" << endl;
+
+	Ice::InitializationData id;
+	id.threadHook = new AsteriskSCF::PJLib::ThreadHook("Ice");
+	id.properties = getCommunicator()->getProperties();
 
-    if ((status = pjlib_util_init()) != PJ_SUCCESS)
+	// To use our thread-hook, we need to set an alternate
+	// communicator in our Component base.
+	setCommunicator(Ice::initialize(id));
+    }
+    catch(const std::exception& e)
     {
-        lg(Error) << "PJ Utility library initialization failed.";
-        return;
+        lg(Critical) << "Major problems in " << getName() << " initialization: " << e.what();
     }
-
-    lg(Info) << "Initializing pjmedia rtp component" << endl;
-
-    Ice::InitializationData id;
-    id.threadHook = new pjlibHook();
-    id.properties = getCommunicator()->getProperties();
-
-    // To use our thread-hook, we need to set an alternate 
-    // communicator in our Component base. 
-    setCommunicator(Ice::initialize(id));
 }
 
 /**
- * Override of factory method to create our custom replication context. 
+ * Override of factory method to create our custom replication context.
  */
 ReplicationContextPtr Component::createReplicationContext(ReplicationStateType state)
 {
@@ -371,14 +307,14 @@ ReplicationContextPtr Component::createReplicationContext(ReplicationStateType s
 }
 
 /**
- * Create the objects that implement the main services this component provides 
+ * Create the objects that implement the main services this component provides
  * the system.
  */
 void Component::createPrimaryServices()
 {
     try
     {
-        RtpReplicationContextPtr rtpReplicationContext = 
+        RtpReplicationContextPtr rtpReplicationContext =
             boost::static_pointer_cast<RtpReplicationContext>(getReplicationContext());
 
         mConfigurationService = ConfigurationServiceImpl::create();
@@ -391,7 +327,7 @@ void Component::createPrimaryServices()
 
         mRtpMediaComparatorService = new RTPMediaServiceCompareServiceImpl(mConfigurationService);
         mRtpMediaComparatorServicePrx = ServiceLocatorParamsComparePrx::uncheckedCast(
-              getServiceAdapter()->add(mRtpMediaComparatorService, 
+              getServiceAdapter()->add(mRtpMediaComparatorService,
                   getCommunicator()->stringToIdentity(MediaComparatorServiceId)));
 
 
@@ -423,7 +359,7 @@ void Component::createPrimaryServices()
             mGeneralState->comparatorId = IceUtil::generateUUID();
             getServiceLocatorManagement()->addCompare(mGeneralState->comparatorId, mRtpMediaComparatorServicePrx);
         }
-    
+
     }
     catch(const Ice::Exception& e)
     {
@@ -437,13 +373,13 @@ void Component::createPrimaryServices()
  */
 void Component::prepareBackplaneServicesForDiscovery()
 {
-    // Insure the default Component services are prepped. 
+    // Insure the default Component services are prepped.
     AsteriskSCF::Component::Component::prepareBackplaneServicesForDiscovery();
 
     try
     {
         // Register our configuration interface with the Service Locator.
-        mConfigurationRegistration = wrapServiceForRegistration(mConfigurationServicePrx, 
+        mConfigurationRegistration = wrapServiceForRegistration(mConfigurationServicePrx,
                                                                 ConfigurationDiscoveryCategory);
         manageBackplaneService(mConfigurationRegistration);
     }
@@ -453,7 +389,7 @@ void Component::prepareBackplaneServicesForDiscovery()
     }
 }
 
-void Component::findRemoteServices() 
+void Component::findRemoteServices()
 {
     if (getReplicationContext()->getState() == ACTIVE_STANDALONE)
     {
@@ -468,14 +404,14 @@ void Component::findRemoteServices()
 
     try
     {
-        RtpReplicationContextPtr rtpReplicationContext = 
+        RtpReplicationContextPtr rtpReplicationContext =
             boost::static_pointer_cast<RtpReplicationContext>(getReplicationContext());
 
         AsteriskSCF::Discovery::SmartProxy<RtpStateReplicatorPrx> pw(getServiceLocator(), replicatorParams, lg);
         rtpReplicationContext->setReplicator(pw);
 
         // Since we're not in standalone mode, we'll get our configuration updates routed via the
-        // replicator service. 
+        // replicator service.
         ConfigurationReplicatorPrx configurationReplicator = ConfigurationReplicatorPrx::checkedCast(
             rtpReplicationContext->getReplicator().initialize(), ReplicatorFacet);
         configurationReplicator->registerConfigurationService(mConfigurationServicePrx);
@@ -491,7 +427,7 @@ void Component::createReplicationStateListeners()
 {
     try
     {
-        RtpReplicationContextPtr rtpReplicationContext = 
+        RtpReplicationContextPtr rtpReplicationContext =
             boost::static_pointer_cast<RtpReplicationContext>(getReplicationContext());
 
        // Create and publish our state replicator listener interface.
@@ -500,7 +436,7 @@ void Component::createReplicationStateListeners()
         RtpStateReplicatorListenerPrx replicatorListener = RtpStateReplicatorListenerPrx::uncheckedCast(
              getBackplaneAdapter()->addWithUUID(mReplicatorListener));
         mReplicatorListenerProxy = RtpStateReplicatorListenerPrx::uncheckedCast(replicatorListener->ice_oneway());
-            
+
         lg(Debug) << "Got proxy to RTP state replicator";
     }
     catch(const Ice::Exception &e)
@@ -512,7 +448,7 @@ void Component::createReplicationStateListeners()
 
 void Component::listenToStateReplicators()
 {
-    RtpReplicationContextPtr rtpReplicationContext = 
+    RtpReplicationContextPtr rtpReplicationContext =
         boost::static_pointer_cast<RtpReplicationContext>(getReplicationContext());
 
     if (mListeningToReplicator == true)
@@ -542,14 +478,14 @@ void Component::listenToStateReplicators()
     }
 }
 
-/** 
- * Unregister as a listener to our state replicator. 
+/**
+ * Unregister as a listener to our state replicator.
  * A component in active mode doesn't neeed to listen to
- * state replication data. 
+ * state replication data.
  */
 void Component::stopListeningToStateReplicators()
 {
-    RtpReplicationContextPtr rtpReplicationContext = 
+    RtpReplicationContextPtr rtpReplicationContext =
         boost::static_pointer_cast<RtpReplicationContext>(getReplicationContext());
 
     if ((!rtpReplicationContext->getReplicator().isInitialized()) || (mListeningToReplicator == false))
@@ -579,11 +515,11 @@ void Component::preparePrimaryServicesForDiscovery()
     {
         mRtpMediaServiceRegistration = wrapServiceForRegistration(mRtpMediaServicePrx,
                                                                   "rtp");
-        managePrimaryService(mRtpMediaServiceRegistration); 
+        managePrimaryService(mRtpMediaServiceRegistration);
     }
         catch(const std::exception& e)
     {
-        lg(Error) << "Unable to publish component interfaces in " << getName() << BOOST_CURRENT_FUNCTION << 
+        lg(Error) << "Unable to publish component interfaces in " << getName() << BOOST_CURRENT_FUNCTION <<
             ". Exception: " << e.what();
         throw; // rethrow
     }
@@ -600,15 +536,15 @@ void Component::onRegisterPrimaryServices()
     mGeneralState->serviceManagement->addLocatorParams(mRtpOverIceLocatorParams, mGeneralState->comparatorId);
 }
 
-void Component::onStart() 
+void Component::onStart()
 {
-    // Note: I don't think this is necessary. If we make the 
+    // Note: I don't think this is necessary. If we make the
     // comparator computed from a "service" identifier (which could default
     // to "default"), there's nothing replicated here that the standby component
-    // couldn't already determine itself. 
+    // couldn't already determine itself.
     if (getReplicationContext()->isReplicating() == true)
     {
-        RtpReplicationContextPtr rtpReplicationContext = 
+        RtpReplicationContextPtr rtpReplicationContext =
             boost::static_pointer_cast<RtpReplicationContext>(getReplicationContext());
 
         RtpStateItemSeq items;
@@ -618,7 +554,7 @@ void Component::onStart()
     }
 }
 
-void Component::onStop() 
+void Component::onStop()
 {
     if (getReplicationContext()->isActive() == true)
     {

commit 9cbd638d2c5620be9c1822374024b07705d4b268
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Wed Sep 28 13:42:26 2011 -0500

    Remove file leftover from Component base class conversion.

diff --git a/src/MediaRTPpjmedia.cpp b/src/MediaRTPpjmedia.cpp
deleted file mode 100644
index 8f9b4e7..0000000
--- a/src/MediaRTPpjmedia.cpp
+++ /dev/null
@@ -1,724 +0,0 @@
-/*
- * Asterisk SCF -- An open-source communications framework.
- *
- * Copyright (C) 2010, Digium, Inc.
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk SCF project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE.txt file
- * at the top of the source tree.
- */
-
-#include <pjlib.h>
-#include <pjmedia.h>
-
-#include <Ice/Ice.h>
-#include <IceBox/IceBox.h>
-#include <IceUtil/UUID.h>
-
-#include <boost/shared_ptr.hpp>
-
-#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
-#include <AsteriskSCF/Media/MediaIf.h>
-#include <AsteriskSCF/Media/RTP/MediaRTPIf.h>
-#include <AsteriskSCF/System/Component/ConfigurationIf.h>
-#include <AsteriskSCF/System/Component/ComponentServiceIf.h>
-#include <AsteriskSCF/System/Component/ReplicaIf.h>
-#include <AsteriskSCF/Logger/IceLogger.h>
-#include <AsteriskSCF/logger.h>
-#include <AsteriskSCF/Discovery/SmartProxy.h>
-
-#include "RtpStateReplicationIf.h"
-
-#include "RTPSession.h"
-#include "RtpStateReplicator.h"
-#include "RTPConfiguration.h"
-#include "RtpConfigurationIf.h"
-
-#include "PJMediaEnvironment.h"
-
-using namespace std;
-using namespace AsteriskSCF::Core::Discovery::V1;
-using namespace AsteriskSCF::Media::V1;
-using namespace AsteriskSCF::Media::RTP::V1;
-using namespace AsteriskSCF::Replication::MediaRTPPJMedia::V1;
-using namespace AsteriskSCF::Configuration::MediaRTPPJMedia::V1;
-using namespace AsteriskSCF::System::Configuration::V1;
-using namespace AsteriskSCF::System::Component::V1;
-using namespace AsteriskSCF::System::Logging;
-using namespace AsteriskSCF::Discovery;
-using namespace AsteriskSCF::PJMediaRTP;
-
-namespace
-{
-Logger lg = getLoggerFactory().getLogger("AsteriskSCF.MediaRTP");
-}
-
-static const string ReplicaServiceId("MediaRtpReplica");
-static const string MediaServiceId("RTPMediaService");
-static const string MediaComparatorServiceId("RTPMediaServiceComparator");
-
-/**
- * Implementation of the RTPMediaService interface as defined in MediaRTPIf.ice
- */
-class RTPMediaServiceImpl : public RTPMediaService
-{
-public:
-    RTPMediaServiceImpl(const Ice::ObjectAdapterPtr&, const ReplicaPrx&,
-	const AsteriskSCF::Discovery::SmartProxy<RtpStateReplicatorPrx>&,
-	const ConfigurationServiceImplPtr&);
-    RTPSessionPrx allocate(
-            const RTPServiceLocatorParamsPtr&,
-            const RTPOptionsPtr&,
-            RTPAllocationOutputsPtr&,
-            const Ice::Current&);
-    pj_pool_factory *getPoolFactory() { return mEnvironment->poolFactory(); };
-
-    PJMediaEnvironmentPtr getEnvironment()
-    {
-        return mEnvironment;
-    }
-
-private:
-    /**
-     * A pointer to the object adapter that objects should be added to.
-     */
-    Ice::ObjectAdapterPtr mAdapter;
-
-    /**
-     * The media environment object.
-     */
-    PJMediaEnvironmentPtr mEnvironment;
-
-    /**
-     * A proxy for the replica service
-     */
-    ReplicaPrx mReplicaServicePrx;
-
-    /**
-     * A pointer to the configuration service.
-     */
-    ConfigurationServiceImplPtr mConfigurationService;
-
-    /**
-     * A proxy to the state replicator.
-     */
-    AsteriskSCF::Discovery::SmartProxy<RtpStateReplicatorPrx> mStateReplicator;
-
-#if CONTROL_POINTS_ENABLED
-    AsteriskSCF::PJMediaRTPTesting mMediaServiceSwitchBoard;
-#endif
-};
-
-/**
- * Typedef which gives us a smart pointer type for RTPMediaServiceImpl class.
- */
-typedef IceUtil::Handle<RTPMediaServiceImpl> RTPMediaServiceImplPtr;
-
-/**                                                                                                                                                                                                                                          
- * This class provides implementation for the Replica interface.                                                                                                                                                                             
- */
-class ReplicaImpl : public Replica
-{
-public:
-    ReplicaImpl(const Ice::ObjectAdapterPtr& adapter) : mAdapter(adapter), mPaused(false), mActive(true) { }
-
-    bool isActive(const Ice::Current&)
-    {
-        return mActive;
-    }
-
-    bool activate(const Ice::Current&)
-    {
-        mActive = true;
-
-        for (vector<AsteriskSCF::System::Component::V1::ReplicaListenerPrx>::const_iterator listener =
-                 mListeners.begin(); listener != mListeners.end(); ++listener)
-        {
-            (*listener)->activated(ReplicaPrx::uncheckedCast(
-                        mAdapter->createDirectProxy(mAdapter->getCommunicator()->stringToIdentity(ReplicaServiceId))));
-        }
-
-        return true;
-    }
-
-    void standby(const Ice::Current&)
-    {
-        mActive = false;
-
-        for (vector<AsteriskSCF::System::Component::V1::ReplicaListenerPrx>::const_iterator listener =
-                 mListeners.begin(); listener != mListeners.end(); ++listener)
-        {
-            (*listener)->onStandby(ReplicaPrx::uncheckedCast(
-                        mAdapter->createDirectProxy(mAdapter->getCommunicator()->stringToIdentity(ReplicaServiceId))));
-        }
-    }
-
-    void addListener(const AsteriskSCF::System::Component::V1::ReplicaListenerPrx& listener, const Ice::Current&)
-    {
-        mListeners.push_back(listener);
-    }
-
-    void removeListener(const AsteriskSCF::System::Component::V1::ReplicaListenerPrx& listener, const Ice::Current&)
-    {
-        mListeners.erase(std::remove(mListeners.begin(), mListeners.end(), listener), mListeners.end());
-    }
-
-private:
-    /**                                                                                                                                                                                                                                      
-     * Pointer to the object adapter we exist on.                                                                                                                                                                                            
-     */
-    Ice::ObjectAdapterPtr mAdapter;
-
-    /**                                                                                                                                                                                                                                      
-     * Listeners that we need to push state change notifications out to.                                                                                                                                                                     
-     */
-    vector<AsteriskSCF::System::Component::V1::ReplicaListenerPrx> mListeners;
-
-    bool mPaused;
-
-    bool mActive;
-};
-
-/**
- * Implementation of the ServiceLocatorParamsCompare class
- */
-class RTPMediaServiceCompareServiceImpl : public ServiceLocatorParamsCompare
-{
-public:
-    RTPMediaServiceCompareServiceImpl(const ConfigurationServiceImplPtr& config) :
-        mConfig(config)
-    {
-    }
-
-    bool isSupported(const ServiceLocatorParamsPtr& locatorParams, const Ice::Current&)
-    {
-	RTPServiceLocatorParamsPtr params;
-
-	if (!(params = RTPServiceLocatorParamsPtr::dynamicCast(locatorParams)))
-	{
-	    return false;
-	}
-
-	bool result = true;
-
-	// This is done on purpose for additional checks in the future
-	if (params->ipv6 == true)
-	{
-#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0
-	    result = true;
-#else
-	    result = false;
-#endif
-	}
-        //
-        // We can ignore the SRTP criteria since we support it one way or the other.
-        //
-        if (!result)
-        {
-            return false;
-        }
-        
-        RTPOverICEServiceLocatorParamsPtr iceParams = RTPOverICEServiceLocatorParamsPtr::dynamicCast(locatorParams);
-        if (iceParams)
-        {
-            if (iceParams->enableRTPOverICE)
-            {
-                NATConfigPtr natConfig = mConfig->natConfig();
-
-                if (natConfig && natConfig->isSTUNEnabled())
-                {
-                    if (iceParams->enableTURN)
-                    {
-                        if (!natConfig->isTURNEnabled())
-                        {
-                            result = false;
-                        }
-                    }
-                }
-                else
-                {
-                    result = false;
-                }
-            }
-            //
-            // We ignore the else case because we can definitely do non-ICE related stuff... its not clear
-            // that negative matches in this case should be exclusionary. Actual ICE usage will be specified
-            // when the RTP session is allocated.
-            //
-        }
-
-	return result;
-    };
-
-private:
-    ConfigurationServiceImplPtr mConfig;
-};
-
-/**
- * Implementation of the IceBox::Service class
- */
-class MediaRTPpjmediaApp : public IceBox::Service
-{
-public:
-    MediaRTPpjmediaApp() : mGeneralState(new RtpGeneralStateItem()) { mGeneralState->key = IceUtil::generateUUID(); };
-    void start(const std::string&, const Ice::CommunicatorPtr&, const Ice::StringSeq&);
-    void stop();
-
-private:
-    /**
-     * Ice Communicator used for this service.
-     */
-    Ice::CommunicatorPtr mCommunicator;
-
-    /**
-     * Object adapter that global stuff is associated with.
-     */
-    Ice::ObjectAdapterPtr mGlobalAdapter;
-
-    /**
-     * Object adapter that local stuff is associated with.
-     */
-    Ice::ObjectAdapterPtr mLocalAdapter;
-
-    /**
-     * The object adapter for the Logger.
-     */
-    Ice::ObjectAdapterPtr mLoggerAdapter;
-
-    /**
-     * A proxy to the service locator manager for the component service.
-     */
-    ServiceManagementPrx mComponentServiceManagement;
-
-    /**
-     * Instance of our replica implementation.
-     */
-    ReplicaPtr mReplicaService;
-
-    /**
-     * A proxy to the replica control object.
-     */
-    ReplicaPrx mReplicaServicePrx;
-
-    /**
-     * Instance of our configuration service implementation.
-     */
-    ConfigurationServiceImplPtr mConfigurationService;
-
-    /**
-     * Instance of our state replicator listener.
-     */
-    RtpStateReplicatorListenerPtr mReplicatorListener;
-
-    /**
-     * A proxy to our state replicator listener.
-     */
-    RtpStateReplicatorListenerPrx mReplicatorListenerProxy;
-
-    /**
-     * A proxy to the state replicator.
-     */
-    AsteriskSCF::Discovery::SmartProxy<RtpStateReplicatorPrx> mStateReplicator;
-
-    /**
-     * An instance of the general state information class.
-     */
-    RtpGeneralStateItemPtr mGeneralState;
-
-    /**
-     * A proxy to the service locator management service.
-     */
-    ServiceLocatorManagementPrx mManagement;
-
-    /**
-     * A proxy to the service locator manager for the configuration service.
-     */
-    ServiceManagementPrx mConfigurationManagement;
-
-    /**
-     * Unique guid for configuration service name comparator.
-     */
-    std::string mConfigCompareGuid;
-};
-
-/**
- * Implementation of the ComponentService interface as defined in ComponentServiceIf.ice
- */
-class ComponentServicepjmediaImpl : public ComponentService
-{
-public:
-    /**
-     * A constructor for this implementation which just sets a few variables, nothing extreme.
-     */
-    ComponentServicepjmediaImpl(MediaRTPpjmediaApp& app, const RtpGeneralStateItemPtr& generalState) :
-        mApplication(app), mGeneralState(generalState) { };
-
-    /**
-     * An implementation of the suspend method which actually suspends ourselves
-     * from the service locator.
-     */
-    virtual void suspend(const ::Ice::Current&)
-    {
-        mGeneralState->serviceManagement->suspend();
-    }
-
-    /**
-     * An implementation of the resume method which actually unsuspends ourselves
-     * from the service locator.
-     */
-    virtual void resume(const ::Ice::Current&)
-    {
-        mGeneralState->serviceManagement->unsuspend();
-    }
-
-    /**
-     * An implementation of the shutdown method which really does shut us down.
-     * Goodbye cruel world.
-     */
-    virtual void shutdown(const ::Ice::Current&)
-    {
-        // TODO - Actually support this
-    }
-
-private:
-    /**
-     * Our application instance, used for shutting the component down.
-     */
-    MediaRTPpjmediaApp& mApplication;
-
-    /**
-     * Pointer to general state information.
-     */
-    RtpGeneralStateItemPtr mGeneralState;
-};
-
-/**
- * Wrapper class around pj_thread_desc.
- */
-class ThreadDescWrapper
-{
-public:
-    /**
-     * pjthread thread description information, must persist for the life of the thread
-     */
-    pj_thread_desc mDesc;
-};
-
-/**
- * Type definition used to create a smart pointer for the above.
- */
-typedef boost::shared_ptr<ThreadDescWrapper> ThreadDescWrapperPtr;
-
-/**
- * Implementation of the Ice::ThreadNotification class.
- */
-class pjlibHook : public Ice::ThreadNotification
-{
-public:
-    /**
-     * Implementation of the start function which is called when a thread starts.
-     */
-    void start()
-    {
-        ThreadDescWrapperPtr wrapper = ThreadDescWrapperPtr(new ThreadDescWrapper());
-        pj_thread_t *thread;
-        pj_thread_register("ICE Thread", wrapper->mDesc, &thread);
-        boost::lock_guard<boost::mutex> lock(mLock);
-        pjThreads.insert(make_pair(thread, wrapper));
-    }
-
-    /**
-     * Implementation of the stop function which is called when a thread stops.
-     */
-    void stop()
-    {
-        if (pj_thread_is_registered())
-        {
-            boost::lock_guard<boost::mutex> lock(mLock);
-            pjThreads.erase(pj_thread_this());
-        }
-    }
-private:
-    /**
-     * A map containing thread lifetime persistent data.
-     */
-    map<pj_thread_t*, ThreadDescWrapperPtr> pjThreads;
-
-    /**
-     * Mutex to protect the map
-     */
-    boost::mutex mLock;
-};
-
-/**
- * Comparator implementation for name based configuration service locating
- */
-class RtpConfigurationCompare : public ServiceLocatorParamsCompare
-{
-public:
-    RtpConfigurationCompare(const string& name) : mName(name) {}
-    bool isSupported(const ServiceLocatorParamsPtr &params, const Ice::Current &)
-    {
-	RtpConfigurationParamsPtr configParams = RtpConfigurationParamsPtr::dynamicCast(params);
-        if (configParams->name == mName)
-        {
-            return true;
-        }
-        return false;
-    }
-private:
-    string mName;
-};
-
-typedef IceUtil::Handle<RtpConfigurationCompare> RtpConfigurationComparePtr;
-
-/**
- * Constructor for the RTPMediaServiceImpl class.
- */
-RTPMediaServiceImpl::RTPMediaServiceImpl(const Ice::ObjectAdapterPtr& adapter, const ReplicaPrx& replicaService,
-    const AsteriskSCF::Discovery::SmartProxy<RtpStateReplicatorPrx>& stateReplicator,
-    const ConfigurationServiceImplPtr& configurationService) :
-    mAdapter(adapter), 
-    mEnvironment(PJMediaEnvironment::create(adapter->getCommunicator()->getProperties(), configurationService)),
-    mReplicaServicePrx(replicaService), 
-    mConfigurationService(configurationService),
-    mStateReplicator(stateReplicator)
-{
-}
-
-/**
- * Implementation of the allocate method as defined in MediaRTPIf.ice
- */
-RTPSessionPrx RTPMediaServiceImpl::allocate(
-        const RTPServiceLocatorParamsPtr& params,
-        const RTPOptionsPtr& options,
-        RTPAllocationOutputsPtr& outputs,
-        const Ice::Current&)
-{
-    return AsteriskSCF::PJMediaRTP::RTPSession::create(mAdapter, IceUtil::generateUUID(), params, mEnvironment,
-            mReplicaServicePrx, mStateReplicator, mConfigurationService, options, outputs);
-}
-
-/**
- * Implementation of the IceBox::Service::start method.
- */
-void MediaRTPpjmediaApp::start(const std::string&, const Ice::CommunicatorPtr& communicator,
-        const Ice::StringSeq&)
-{
-    // we need a logger before we're ready to build the real communicator.
-    // use the one we're provided to create the IceLogger.
-    mLoggerAdapter = communicator->createObjectAdapter("MediaRTPpjmediaAdapterLogger");
-    ConfiguredIceLoggerPtr iceLogger = createIceLogger(mLoggerAdapter);
-    getLoggerFactory().setLogOutput(iceLogger->getLogger());
-    mLoggerAdapter->activate();
-
-    /* Initialize pjlib as pjmedia will be using it */
-    pj_status_t status = pj_init();
-    if (status != PJ_SUCCESS)
-    {
-        lg(Error) << "PJ library initialization failed.";
-        return;
-    }
-
-    if ((status = pjlib_util_init()) != PJ_SUCCESS)
-    {
-        lg(Error) << "PJ Utility library initialization failed.";
-        return;
-    }
-
-    lg(Info) << "Initializing pjmedia rtp component" << endl;
-
-    Ice::InitializationData id;
-    id.threadHook = new pjlibHook();
-    id.properties = communicator->getProperties();
-
-    mCommunicator = Ice::initialize(id);
-
-    mLocalAdapter = mCommunicator->createObjectAdapter("MediaRTPpjmediaAdapterLocal");
-
-    mReplicaService = new ReplicaImpl(mLocalAdapter);
-    mReplicaServicePrx = ReplicaPrx::uncheckedCast(mLocalAdapter->add(mReplicaService, mCommunicator->stringToIdentity(ReplicaServiceId)));
-
-    mConfigurationService = ConfigurationServiceImpl::create();
-    ConfigurationServicePrx mConfigurationServiceProxy = mConfigurationService->activate(mLocalAdapter, IceUtil::generateUUID());
-    mLocalAdapter->activate();
-
-    mGlobalAdapter = mCommunicator->createObjectAdapter("MediaRTPpjmediaAdapter");
-
-    mGlobalAdapter->activate();
-
-    lg(Info) << "Activated pjmedia rtp component media service." << endl;
-
-    mManagement = ServiceLocatorManagementPrx::checkedCast(mCommunicator->propertyToProxy("ServiceLocatorManagementProxy"));
-
-    // The service locator is required for state replicator operation, so go ahead and find it
-    ServiceLocatorPrx locator = ServiceLocatorPrx::checkedCast(mCommunicator->propertyToProxy("LocatorService.Proxy"));
-
-    // Look for the configured state replicator or default one
-    RtpStateReplicatorParamsPtr replicatorParams = new RtpStateReplicatorParams();
-    replicatorParams->category = StateReplicatorDiscoveryCategory;
-    replicatorParams->name =
-        mCommunicator->getProperties()->getPropertyWithDefault("Rtp.StateReplicatorName", "default");
-
-    try
-    {  
-	AsteriskSCF::Discovery::SmartProxy<RtpStateReplicatorPrx> pw(locator, replicatorParams, lg);
-        mStateReplicator = pw;
-    }
-    catch (...)
-    {
-        lg(Error) << "State replicator could not be found, operating without.";
-    }
-
-    RTPMediaServiceImplPtr rtpmediaservice =
-        new RTPMediaServiceImpl(mGlobalAdapter, mReplicaServicePrx, mStateReplicator, mConfigurationService);
-
-    if (mCommunicator->getProperties()->getPropertyWithDefault("Rtp.Standalone", "false") == "true")
-    {
-        // Publish the configuration service IceStorm topic so everybody gets configuration
-        mConfigurationManagement = ServiceManagementPrx::uncheckedCast(
-            mManagement->addService(mConfigurationServiceProxy, ""));
-
-        // Populate the configuration parameters with details so we can be found
-        RtpConfigurationParamsPtr configurationParams = new RtpConfigurationParams();
-        configurationParams->category = ConfigurationDiscoveryCategory;
-        configurationParams->name = mCommunicator->getProperties()->getPropertyWithDefault("RtpConfiguration.Name", "");
-
-        // Add our custom comparator so we can support multiple simultaneous configuration sinks
-        RtpConfigurationComparePtr configNameCompare = new RtpConfigurationCompare(configurationParams->name);
-        ServiceLocatorParamsComparePrx configCompareProxy = ServiceLocatorParamsComparePrx::uncheckedCast(
-            mLocalAdapter->addWithUUID(configNameCompare));
-
-        mConfigCompareGuid = IceUtil::generateUUID();
-        mManagement->addCompare(mConfigCompareGuid, configCompareProxy);
-        mConfigurationManagement->addLocatorParams(configurationParams, mConfigCompareGuid);
-    }
-    else if (mStateReplicator)
-    {
-	ConfigurationReplicatorPrx configurationReplicator = ConfigurationReplicatorPrx::checkedCast(
-	    mStateReplicator.initialize(), ReplicatorFacet);
-	configurationReplicator->registerConfigurationService(mConfigurationServiceProxy);
-    }
-
-    if (mStateReplicator)
-    {
-        mReplicatorListener =
-            new RtpStateReplicatorListenerI(mGlobalAdapter, rtpmediaservice->getEnvironment(), mGeneralState,
-		mConfigurationService);
-        mReplicatorListenerProxy =
-            RtpStateReplicatorListenerPrx::uncheckedCast(mLocalAdapter->addWithUUID(mReplicatorListener));
-
-	if (mCommunicator->getProperties()->getPropertyWithDefault("Rtp.StateReplicatorListener", "no") == "yes")
-	{
-	    mStateReplicator->addListener(mReplicatorListenerProxy);
-	    mReplicaService->standby();
-	    lg(Info) << "Operating as a standby replica." << endl;
-	}
-	else
-	{
-	    lg(Info) << "Operating in an active state." << endl;
-	}
-    }
-
-    ServiceLocatorParamsComparePtr rtpmediacomparatorservice = new RTPMediaServiceCompareServiceImpl(mConfigurationService);
-    ServiceLocatorParamsComparePrx RTPMediaComparatorServiceProxy = ServiceLocatorParamsComparePrx::uncheckedCast(
-	mGlobalAdapter->add(rtpmediacomparatorservice, mCommunicator->stringToIdentity(MediaComparatorServiceId)));
-    
-    if (mReplicaService->isActive() == true)
-    {
-	mGeneralState->comparatorId = IceUtil::generateUUID();
-	mManagement->addCompare(mGeneralState->comparatorId, RTPMediaComparatorServiceProxy);
-    }
-
-
-    RTPMediaServicePrx RTPMediaServiceProxy = RTPMediaServicePrx::uncheckedCast(mGlobalAdapter->add(rtpmediaservice,
-	    mCommunicator->stringToIdentity(MediaServiceId)));
-
-    RTPOverICEServiceLocatorParamsPtr rtpparams = new RTPOverICEServiceLocatorParams;
-    rtpparams->category = "rtp";
-    PJMediaEnvironmentPtr mediaEnvironment = rtpmediaservice->getEnvironment();
-
-    //
-    // Service wide configuration is done through properties allowing certain features
-    // to be completely disabled.
-    //
-    NATConfigPtr natConfig = mediaEnvironment->natConfig();
-    if (natConfig && natConfig->isSTUNEnabled())
-    {
-        rtpparams->enableRTPOverICE = true;
-        rtpparams->enableTURN = natConfig->isTURNEnabled();
-    }
-    else
-    {
-        rtpparams->enableRTPOverICE = false;
-        rtpparams->enableTURN = false;
-    }
-
-    if (mReplicaService->isActive() == true)
-    {
-	mGeneralState->serviceManagement = ServiceManagementPrx::uncheckedCast(
-            mManagement->addService(RTPMediaServiceProxy, "media_rtp_pjmedia"));
-	/* Now we can add some parameters to help find us. */
-	mGeneralState->serviceManagement->addLocatorParams(rtpparams, mGeneralState->comparatorId);
-    }
-
-    ServiceLocatorParamsPtr genericparams = new ServiceLocatorParams();
-
-    /* One must provide a component service to manage us, if someone wants to */
-    ComponentServicePtr ComponentService = new ComponentServicepjmediaImpl(*this, mGeneralState);
-    ComponentServicePrx ComponentServiceProxy =
-        ComponentServicePrx::uncheckedCast(mLocalAdapter->addWithUUID(ComponentService));
-
-    /* Let's add the component service to the service locator first */
-    mComponentServiceManagement =
-        ServiceManagementPrx::uncheckedCast(mManagement->addService(ComponentServiceProxy, "media_rtp_pjmedia.component"));
-    genericparams->category = "Component/media_rtp_pjmedia";
-    mComponentServiceManagement->addLocatorParams(genericparams, "");
-
-    // Replicate general state information so the backup is ready
-    if (mStateReplicator && mReplicaService->isActive() == true)
-    {
-        RtpStateItemSeq items;
-	items.push_back(mGeneralState);
-        RtpStateReplicatorPrx oneway = RtpStateReplicatorPrx::uncheckedCast(mStateReplicator->ice_oneway());
-        oneway->setState(items);
-    }
-}
-
-/**
- * Implementation of the IceBox::Service::stop method.
- */
-void MediaRTPpjmediaApp::stop()
-{
-    mComponentServiceManagement->unregister();
-    if (mReplicaService->isActive() == true)
-    {
-	mGeneralState->serviceManagement->unregister();
-    }
-    if (mConfigurationManagement)
-    {
-	mConfigurationManagement->unregister();
-    }
-    if (!mConfigCompareGuid.empty())
-    {
-	mManagement->removeCompare(mConfigCompareGuid);
-	ServiceLocatorManagementPrx management =
-	    ServiceLocatorManagementPrx::checkedCast(mCommunicator->propertyToProxy("ServiceLocatorManagementProxy"));
-	management->removeCompare(mGeneralState->comparatorId);
-    }
-    mCommunicator->destroy();
-}
-
-extern "C"
-{
-ASTSCF_DLL_EXPORT IceBox::Service* create(Ice::CommunicatorPtr)
-{
-    return new MediaRTPpjmediaApp;
-}
-}

commit ca14499ac6e6bf66f3eb5a33bfc4d1a12f6452d2
Author: Brent Eagles <beagles at digium.com>
Date:   Tue Sep 27 12:50:15 2011 -0230

    Comments for the ICE and SRTP related configuration options.

diff --git a/config/Rtp.config b/config/Rtp.config
index e1a99dd..47b975d 100644
--- a/config/Rtp.config
+++ b/config/Rtp.config
@@ -16,3 +16,59 @@ workerthreadcount=4
 
 # IPv6 address we should bind sessions to
 #ipv6bind=
+
+#
+# Enable SRTP support for RTP. If not enabled, attempts to allocate
+# an SRTP media session will fail. Enabled by default.
+#
+# enablesrtp=false
+
+#
+# Configure ICE support for NAT. 
+#
+[rtpoverice]
+
+#
+# Enable the ICE transport. Disbled by default. 
+#
+# rtpovericeenable=false
+
+#
+# Enable including TURN as a NAT traversal option. Default false.
+#
+# rtpovericewithturn=false
+
+# 
+# Set the limits for the number of candidates that will be sussed out. It is
+# usually okay to leave this unset.
+#
+# rtpicemaxcandidates=10
+
+# 
+# Set the maximum number of ICE sessions supported. An ICE media flow 
+# is essentially a negotiated and managed flow between two endpoints, so
+# there is some resource consumption per connection.
+#
+# rtpicemaxcalls=50
+
+#
+# Configure the STUN server hostname. Note that some public STUN servers may
+# not reply in a timely manner so you may need to experiment here.
+#
+# stunserverhost=[insert STUN server host here]
+
+#
+# Configure the STUN server port number. You can usually leave this blank as
+# the default would suffice.
+#
+# stunserverport=3478
+
+#
+# Configure the TURN server hostname. 
+#
+# turnserverhost=[insert TURN server host here]
+
+#
+# Configure the TURN server port
+#
+# turnserverport=3478

commit 79856c7897e1d9552c43e7d368b7c7f0268e3f3d
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Tue Sep 20 16:01:47 2011 -0500

    Updated the unit test config files for the recent config changes.

diff --git a/config/test_component.conf b/config/test_component.conf
index b0c6d4f..8489207 100644
--- a/config/test_component.conf
+++ b/config/test_component.conf
@@ -15,17 +15,18 @@ Ice.Override.Timeout=5000
 
 IceBox.Service.ServiceDiscovery=service_locator:create
 
-AsteriskSCFIceStorm.InstanceName=AsteriskSCFIceStorm
-AsteriskSCFIceStorm.TopicManager.Endpoints=tcp -p 4421
-AsteriskSCFIceStorm.Publish.Endpoints=tcp -p 4423
-AsteriskSCFIceStorm.Trace.TopicManager=2
-AsteriskSCFIceStorm.Transient=1
-AsteriskSCFIceStorm.Flush.Timeout=2000
-TopicManager.Proxy=AsteriskSCFIceStorm/TopicManager:tcp -p 4421
-
-ServiceLocatorManagementAdapter.Endpoints=tcp -p 4422
-ServiceLocatorAdapter.Endpoints=tcp -p 4411
-ServiceLocatorLocalAdapter.Endpoints=tcp -p 4412
+ServiceDiscovery.IceStorm.InstanceName=ServiceDiscovery
+
+ServiceDiscovery.IceStorm.TopicManager.Endpoints=tcp -p 4421
+ServiceDiscovery.IceStorm.Publish.Endpoints=tcp -p 4423
+ServiceDiscovery.IceStorm.Trace.TopicManager=2
+ServiceDiscovery.IceStorm.Transient=1
+ServiceDiscovery.IceStorm.Flush.Timeout=2000
+
+TopicManager.Proxy=ServiceDiscovery/TopicManager:tcp -p 4421
+
+ServiceDiscovery.Management.ServiceAdapter.Endpoints=tcp -p 4412
+ServiceDiscovery.Locator.ServiceAdapter.Endpoints=tcp -p 4411
 
 #
 # RtpStateReplicator Configuration
@@ -36,13 +37,12 @@ IceBox.Service.RtpStateReplicator=RtpStateReplicator:create
 RtpStateReplicator.Adapter.Endpoints=tcp:udp
 
 # IceStorm parameters for the RTP state replicator
-RtpStateReplicatorIceStorm.InstanceName=RtpStateReplicatorIceStorm
-RtpStateReplicatorIceStorm.TopicManager.Endpoints=default -p 10005
-RtpStateReplicatorIceStorm.Publish.Endpoints=default -p 10006
-RtpStateReplicatorIceStorm.Trace.TopicManager=2
-RtpStateReplicatorIceStorm.Transient=1
-RtpStateReplicatorIceStorm.Flush.Timeout=2000
-RtpStateReplicatorTopicManager.Proxy=RtpStateReplicatorIceStorm/TopicManager:default -p 10005
+RtpStateReplicator.IceStorm.InstanceName=RtpStateReplicator
+RtpStateReplicator.IceStorm.TopicManager.Endpoints=default -p 10007
+RtpStateReplicator.IceStorm.Publish.Endpoints=default -p 10008
+RtpStateReplicator.IceStorm.Trace.TopicManager=2
+RtpStateReplicator.IceStorm.Transient=1
+RtpStateReplicator.IceStorm.Flush.Timeout=2000
 
 #
 # media_rtp_pjmedia Configuration
@@ -58,7 +58,7 @@ MediaServiceRTP.ServiceAdapter.Endpoints=tcp -p 4471
 MediaServiceRTP.BackplaneAdapter.Endpoints=tcp -p 4472
 
 # A proxy to the service locator management service
-LocatorServiceManagement.Proxy=LocatorServiceManagement:tcp -p 4422
+LocatorServiceManagement.Proxy=LocatorServiceManagement:tcp -p 4412
 
 # A proxy to the service locator service
 LocatorService.Proxy=LocatorService:tcp -p 4411
diff --git a/config/test_component_v6.conf b/config/test_component_v6.conf
index 31a76e5..c64742f 100644
--- a/config/test_component_v6.conf
+++ b/config/test_component_v6.conf
@@ -15,17 +15,18 @@ Ice.Override.Timeout=5000
 
 IceBox.Service.ServiceDiscovery=service_locator:create
 
-AsteriskSCFIceStorm.InstanceName=AsteriskSCFIceStorm
-AsteriskSCFIceStorm.TopicManager.Endpoints=tcp -p 4421
-AsteriskSCFIceStorm.Publish.Endpoints=tcp -p 4423
-AsteriskSCFIceStorm.Trace.TopicManager=2
-AsteriskSCFIceStorm.Transient=1
-AsteriskSCFIceStorm.Flush.Timeout=2000
-TopicManager.Proxy=AsteriskSCFIceStorm/TopicManager:tcp -p 4421
-
-ServiceLocatorManagementAdapter.Endpoints=tcp -p 4422
-ServiceLocatorAdapter.Endpoints=tcp -p 4411
-ServiceLocatorLocalAdapter.Endpoints=tcp -p 4412
+ServiceDiscovery.IceStorm.InstanceName=ServiceDiscovery
+
+ServiceDiscovery.IceStorm.TopicManager.Endpoints=tcp -p 4421
+ServiceDiscovery.IceStorm.Publish.Endpoints=tcp -p 4423
+ServiceDiscovery.IceStorm.Trace.TopicManager=2
+ServiceDiscovery.IceStorm.Transient=1
+ServiceDiscovery.IceStorm.Flush.Timeout=2000
+
+TopicManager.Proxy=ServiceDiscovery/TopicManager:tcp -p 4421
+
+ServiceDiscovery.Management.ServiceAdapter.Endpoints=tcp -p 4412
+ServiceDiscovery.Locator.ServiceAdapter.Endpoints=tcp -p 4411
 
 #
 # RtpStateReplicator Configuration
@@ -36,13 +37,12 @@ IceBox.Service.RtpStateReplicator=RtpStateReplicator:create
 RtpStateReplicator.Adapter.Endpoints=tcp:udp
 
 # IceStorm parameters for the RTP state replicator
-RtpStateReplicatorIceStorm.InstanceName=RtpStateReplicatorIceStorm
-RtpStateReplicatorIceStorm.TopicManager.Endpoints=default -p 10005
-RtpStateReplicatorIceStorm.Publish.Endpoints=default -p 10006
-RtpStateReplicatorIceStorm.Trace.TopicManager=2
-RtpStateReplicatorIceStorm.Transient=1
-RtpStateReplicatorIceStorm.Flush.Timeout=2000
-RtpStateReplicatorTopicManager.Proxy=RtpStateReplicatorIceStorm/TopicManager:default -p 10005
+RtpStateReplicator.IceStorm.InstanceName=RtpStateReplicator
+RtpStateReplicator.IceStorm.TopicManager.Endpoints=default -p 10007
+RtpStateReplicator.IceStorm.Publish.Endpoints=default -p 10008
+RtpStateReplicator.IceStorm.Trace.TopicManager=2
+RtpStateReplicator.IceStorm.Transient=1
+RtpStateReplicator.IceStorm.Flush.Timeout=2000
 
 #
 # media_rtp_pjmedia Configuration
@@ -58,7 +58,7 @@ MediaServiceRTP.ServiceAdapter.Endpoints=tcp -p 4471
 MediaServiceRTP.BackplaneAdapter.Endpoints=tcp -p 4472
 
 # A proxy to the service locator management service
-LocatorServiceManagement.Proxy=LocatorServiceManagement:tcp -p 4422
+LocatorServiceManagement.Proxy=LocatorServiceManagement:tcp -p 4412
 
 # A proxy to the service locator service
 LocatorService.Proxy=LocatorService:tcp -p 4411
diff --git a/config/test_rtp_ice.conf b/config/test_rtp_ice.conf
index f672a04..a2ce988 100644
--- a/config/test_rtp_ice.conf
+++ b/config/test_rtp_ice.conf
@@ -47,28 +47,21 @@ IceBox.Service.MediaRTPpjmediaTest=media_rtp_pjmedia_ice_test:create
 
 IceBox.Service.ServiceDiscovery=service_locator:create
 
-AsteriskSCFIceStorm.InstanceName=AsteriskSCFIceStorm
-AsteriskSCFIceStorm.TopicManager.Endpoints=default -p 10000
-AsteriskSCFIceStorm.Publish.Endpoints=tcp -p 10001:udp -p 10001
-AsteriskSCFIceStorm.Trace.TopicManager=2
-AsteriskSCFIceStorm.Transient=1
-AsteriskSCFIceStorm.Flush.Timeout=2000
-TopicManager.Proxy=AsteriskSCFIceStorm/TopicManager:default -p 10000
-
-#RtpStateReplicatorIceStorm.InstanceName=RtpStateReplicatorIceStorm
-#RtpStateReplicatorIceStorm.TopicManager.Endpoints=default -p 10005
-#RtpStateReplicatorIceStorm.Publish.Endpoints=default -p 10006
-#RtpStateReplicatorIceStorm.Trace.TopicManager=2
-#RtpStateReplicatorIceStorm.Transient=1
-#RtpStateReplicatorIceStorm.Flush.Timeout=2000
-#RtpStateReplicatorTopicManager.Proxy=RtpStateReplicatorIceStorm/TopicManager:default -p 10005
-
-ServiceLocatorManagementAdapter.Endpoints=tcp -p 4422
-ServiceLocatorAdapter.Endpoints=tcp -p 4411
-ServiceLocatorLocalAdapter.Endpoints=tcp -p 4412
+ServiceDiscovery.IceStorm.InstanceName=ServiceDiscovery
+
+ServiceDiscovery.IceStorm.TopicManager.Endpoints=tcp -p 4421
... 2773 lines suppressed ...


-- 
asterisk-scf/integration/media_rtp_pjmedia.git



More information about the asterisk-scf-commits mailing list