[asterisk-scf-commits] asterisk-scf/integration/media_rtp_pjmedia.git branch "configuration-replication" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue May 17 07:00:31 CDT 2011


branch "configuration-replication" has been updated
       via  a9f2d2c2f87162aaeec2d1080b860e059fe31cbd (commit)
       via  cd8b75e4635108c0a032348c1c159441ffbbb26f (commit)
       via  7c62f27966769e9d75d22eb80044d055bc4dd195 (commit)
       via  590ca45f3604f215b8019bf0f8d9cc9a8f952b33 (commit)
       via  4740d0813de6b66cd70000b8b7c10dd883520ac6 (commit)
       via  e04d914ecae9eb1c24a87fb18d8f93b46335c760 (commit)
      from  6eaa470cd582ad9231eb69aa335312a880cce9fe (commit)

Summary of changes:
 config/RtpConfigurator.py     |    6 +++++-
 config/test_component.config  |    8 ++++++++
 src/MediaRTPpjmedia.cpp       |   13 ++++++++-----
 src/RTPSession.cpp            |    4 ++--
 src/RtpStateReplicatorApp.cpp |    2 +-
 5 files changed, 24 insertions(+), 9 deletions(-)


- Log -----------------------------------------------------------------
commit a9f2d2c2f87162aaeec2d1080b860e059fe31cbd
Author: Joshua Colp <jcolp at digium.com>
Date:   Tue May 17 09:01:32 2011 -0300

    Use the new service locator support in Configurator.

diff --git a/config/RtpConfigurator.py b/config/RtpConfigurator.py
index 87b3f65..56d2bff 100755
--- a/config/RtpConfigurator.py
+++ b/config/RtpConfigurator.py
@@ -47,6 +47,10 @@ class RtpSectionVisitors(Configurator.SectionVisitors):
 
         self.groups.append(group)
 
+# In order to do service locator based lookup we need to pass in a params object
+serviceLocatorParams = AsteriskSCF.Media.RTP.V1.RtpConfigurationParams()
+serviceLocatorParams.category = AsteriskSCF.Media.RTP.V1.ConfigurationDiscoveryCategory
+
 # Make a configurator application and let it run
-app = Configurator.ConfiguratorApp('Rtp.config', RtpSectionVisitors())
+app = Configurator.ConfiguratorApp('Rtp.config', RtpSectionVisitors(), None, serviceLocatorParams)
 sys.exit(app.main(sys.argv))

commit cd8b75e4635108c0a032348c1c159441ffbbb26f
Author: Joshua Colp <jcolp at digium.com>
Date:   Tue May 17 08:44:00 2011 -0300

    Fix logic malfunction. When operating in a replica group our configuration service should always be registered.

diff --git a/src/MediaRTPpjmedia.cpp b/src/MediaRTPpjmedia.cpp
index a6be66a..3c397e0 100644
--- a/src/MediaRTPpjmedia.cpp
+++ b/src/MediaRTPpjmedia.cpp
@@ -500,6 +500,10 @@ void MediaRTPpjmediaApp::start(const std::string&, const Ice::CommunicatorPtr& c
         mManagement->addCompare(mConfigCompareGuid, configCompareProxy);
         mConfigurationManagement->addLocatorParams(configurationParams, mConfigCompareGuid);
     }
+    else if (mStateReplicator)
+    {
+	mStateReplicator->registerConfigurationService(mConfigurationServiceProxy);
+    }
 
     if (mStateReplicator)
     {
@@ -512,10 +516,6 @@ void MediaRTPpjmediaApp::start(const std::string&, const Ice::CommunicatorPtr& c
 	if (mCommunicator->getProperties()->getPropertyWithDefault("Rtp.StateReplicatorListener", "no") == "yes")
 	{
 	    mStateReplicator->addListener(mReplicatorListenerProxy);
-	    if (mCommunicator->getProperties()->getPropertyWithDefault("Rtp.Standalone", "false") == "false")
-	    {
-		mStateReplicator->registerConfigurationService(mConfigurationServiceProxy);
-	    }
 	    mReplicaService->standby();
 	    lg(Info) << "Operating as a standby replica." << endl;
 	}

commit 7c62f27966769e9d75d22eb80044d055bc4dd195
Author: Joshua Colp <jcolp at digium.com>
Date:   Tue May 17 08:40:03 2011 -0300

    Only unregister the configuration service from the service locator if it was actually added.

diff --git a/src/MediaRTPpjmedia.cpp b/src/MediaRTPpjmedia.cpp
index 97f3bbd..a6be66a 100644
--- a/src/MediaRTPpjmedia.cpp
+++ b/src/MediaRTPpjmedia.cpp
@@ -570,7 +570,10 @@ void MediaRTPpjmediaApp::stop()
     {
 	mGeneralState->mServiceManagement->unregister();
     }
-    mConfigurationManagement->unregister();
+    if (mConfigurationManagement)
+    {
+	mConfigurationManagement->unregister();
+    }
     if (!mConfigCompareGuid.empty())
     {
 	mManagement->removeCompare(mConfigCompareGuid);

commit 590ca45f3604f215b8019bf0f8d9cc9a8f952b33
Author: Joshua Colp <jcolp at digium.com>
Date:   Tue May 17 08:36:00 2011 -0300

    Update test configuration file since new properties are required.

diff --git a/config/test_component.config b/config/test_component.config
index 97311ed..fb6e341 100644
--- a/config/test_component.config
+++ b/config/test_component.config
@@ -56,6 +56,14 @@ 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

commit 4740d0813de6b66cd70000b8b7c10dd883520ac6
Author: Joshua Colp <jcolp at digium.com>
Date:   Tue May 17 08:35:44 2011 -0300

    Use a separate property for the RTP IceStorm so as to not conflict.

diff --git a/src/RtpStateReplicatorApp.cpp b/src/RtpStateReplicatorApp.cpp
index 6628c8d..123b368 100644
--- a/src/RtpStateReplicatorApp.cpp
+++ b/src/RtpStateReplicatorApp.cpp
@@ -274,7 +274,7 @@ void RtpStateReplicatorService::initialize(const string& appName, const Ice::Com
     mIceStorm = new CollocatedIceStorm("RtpStateReplicatorIceStorm", ic->getProperties());
 
     IceStorm::TopicManagerPrx topicManager = IceStorm::TopicManagerPrx::checkedCast(
-	ic->propertyToProxy("TopicManager.Proxy"));
+	ic->propertyToProxy("RtpStateReplicatorTopicManager.Proxy"));
 
     IceStorm::TopicPrx topic;
 

commit e04d914ecae9eb1c24a87fb18d8f93b46335c760
Author: Joshua Colp <jcolp at digium.com>
Date:   Tue May 17 08:35:30 2011 -0300

    I *always* screw up my assertions.

diff --git a/src/RTPSession.cpp b/src/RTPSession.cpp
index 2254f36..ebe0206 100644
--- a/src/RTPSession.cpp
+++ b/src/RTPSession.cpp
@@ -144,7 +144,7 @@ RTPSessionImpl::RTPSessionImpl(const Ice::ObjectAdapterPtr& adapter, const Forma
     /* Create an endpoint in pjmedia for our media. */
     pj_status_t status = pjmedia_endpt_create(factory, NULL, configurationService->getWorkerThreadCount(), &mImpl->mEndpoint);
 
-    assert(status != PJ_SUCCESS);
+    assert(status == PJ_SUCCESS);
 
     int minimumPort = configurationService->getStartPort();
     int maximumPort = configurationService->getEndPort();
@@ -191,7 +191,7 @@ RTPSessionImpl::RTPSessionImpl(const Ice::ObjectAdapterPtr& adapter, pj_pool_fac
 
     pj_status_t status = pjmedia_endpt_create(factory, NULL, configurationService->getWorkerThreadCount(), &mImpl->mEndpoint);
 
-    assert(status != PJ_SUCCESS);
+    assert(status == PJ_SUCCESS);
 
     if ((status = pjmedia_transport_udp_create2(mImpl->mEndpoint, "RTP", NULL, port, 0, &mImpl->mTransport))
             != PJ_SUCCESS)

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


-- 
asterisk-scf/integration/media_rtp_pjmedia.git



More information about the asterisk-scf-commits mailing list