[asterisk-scf-commits] asterisk-scf/integration/media_rtp_pjmedia.git branch "locate-with-id" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Jun 28 20:26:08 CDT 2011


branch "locate-with-id" has been created
        at  ca4fcb7248369de65f6d90b45ebf8e6df778c378 (commit)

- Log -----------------------------------------------------------------
commit ca4fcb7248369de65f6d90b45ebf8e6df778c378
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Tue Jun 28 20:25:30 2011 -0500

    Mods for changes to ServiceLocatorParams.

diff --git a/config/test_component.config b/config/test_component.config
index fb6e341..d507786 100644
--- a/config/test_component.config
+++ b/config/test_component.config
@@ -7,6 +7,8 @@
 IceBox.InheritProperties=1
 IceBox.LoadOrder=ServiceDiscovery,RtpStateReplicator,MediaRTPpjmedia,MediaRTPpjmediaTest
 
+Ice.Override.Timeout=5000
+
 # RtpStateReplicator Configuration
 IceBox.Service.RtpStateReplicator=RtpStateReplicator:create
 
diff --git a/config/test_component_v6.config b/config/test_component_v6.config
index 36021d4..7349902 100644
--- a/config/test_component_v6.config
+++ b/config/test_component_v6.config
@@ -7,6 +7,8 @@
 IceBox.InheritProperties=1
 IceBox.LoadOrder=ServiceDiscovery,RtpStateReplicator,MediaRTPpjmedia,MediaRTPpjmediaTest
 
+Ice.Override.Timeout=5000
+
 # RtpStateReplicator Configuration
 IceBox.Service.RtpStateReplicator=RtpStateReplicator:create
 
diff --git a/local-slice/RtpConfigurationIf.ice b/local-slice/RtpConfigurationIf.ice
index 09fc822..4d3a594 100644
--- a/local-slice/RtpConfigurationIf.ice
+++ b/local-slice/RtpConfigurationIf.ice
@@ -38,17 +38,6 @@ module V1
    const string ConfigurationDiscoveryCategory = "RtpConfiguration";
 
    /**
-    * Service locator parameters class for discovering the configuration service
-    */
-   unsliceable class RtpConfigurationParams extends AsteriskSCF::Core::Discovery::V1::ServiceLocatorParams
-   {
-       /**
-	* Unique name for the configuration service
-	*/
-       string name;
-   };
-
-   /**
     * Local visitor class for visiting RTP configuration groups
     */
    local class RtpConfigurationGroupVisitor extends AsteriskSCF::System::Configuration::V1::ConfigurationGroupVisitor
diff --git a/local-slice/RtpStateReplicationIf.ice b/local-slice/RtpStateReplicationIf.ice
index a8b4ac8..9453c1a 100644
--- a/local-slice/RtpStateReplicationIf.ice
+++ b/local-slice/RtpStateReplicationIf.ice
@@ -39,11 +39,6 @@ module V1
     const string StateReplicatorComponentCategory = "RtpStateReplicatorComponent";
     const string StateReplicatorDiscoveryCategory = "RtpStateReplicator";
     
-    unsliceable class RtpStateReplicatorParams extends AsteriskSCF::Core::Discovery::V1::ServiceLocatorParams
-    {
-	string mName;
-    };
-    
     ["visitor"] local class RtpStateItemVisitor
     {
     };
diff --git a/src/MediaRTPpjmedia.cpp b/src/MediaRTPpjmedia.cpp
index a76217b..1cfe458 100644
--- a/src/MediaRTPpjmedia.cpp
+++ b/src/MediaRTPpjmedia.cpp
@@ -394,28 +394,6 @@ private:
 };
 
 /**
- * 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 ReplicaPtr& replicaService,
@@ -500,10 +478,11 @@ void MediaRTPpjmediaApp::start(const std::string&, const Ice::CommunicatorPtr& c
     ServiceLocatorPrx locator = ServiceLocatorPrx::checkedCast(mCommunicator->propertyToProxy("LocatorService.Proxy"));
 
     // Look for the configured state replicator or default one
-    RtpStateReplicatorParamsPtr replicatorParams = new RtpStateReplicatorParams();
+    ServiceLocatorParamsPtr replicatorParams = new ServiceLocatorParams();
     replicatorParams->category = StateReplicatorDiscoveryCategory;
-    replicatorParams->mName =
-        mCommunicator->getProperties()->getPropertyWithDefault("Sip.StateReplicatorName", "default");
+    replicatorParams->service = mCommunicator->getProperties()->getPropertyWithDefault("Rtp.StateReplicatorService", "default"); 
+    replicatorParams->id =
+        mCommunicator->getProperties()->getPropertyWithDefault("Rtp.StateReplicatorName", "default"); 
 
     try
     {  
@@ -515,6 +494,9 @@ void MediaRTPpjmediaApp::start(const std::string&, const Ice::CommunicatorPtr& c
         lg(Error) << "State replicator could not be found, operating without.";
     }
 
+    std::string serviceName = mCommunicator->getProperties()->getPropertyWithDefault(
+          "Rtp.ServiceName", "default");
+
     RTPMediaServiceImplPtr rtpmediaservice =
         new RTPMediaServiceImpl(mGlobalAdapter, mReplicaService, mStateReplicator, mConfigurationService);
 
@@ -525,18 +507,12 @@ void MediaRTPpjmediaApp::start(const std::string&, const Ice::CommunicatorPtr& c
             mManagement->addService(mConfigurationServiceProxy, ""));
 
         // Populate the configuration parameters with details so we can be found
-        RtpConfigurationParamsPtr configurationParams = new RtpConfigurationParams();
+        ServiceLocatorParamsPtr configurationParams = new ServiceLocatorParams();
         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));
+        configurationParams->service = serviceName;
+        configurationParams->id = mCommunicator->getProperties()->getPropertyWithDefault("RtpConfiguration.Name", "");
 
-        mConfigCompareGuid = IceUtil::generateUUID();
-        mManagement->addCompare(mConfigCompareGuid, configCompareProxy);
-        mConfigurationManagement->addLocatorParams(configurationParams, mConfigCompareGuid);
+        mConfigurationManagement->addLocatorParams(configurationParams, "");
     }
     else if (mStateReplicator)
     {
@@ -571,8 +547,8 @@ void MediaRTPpjmediaApp::start(const std::string&, const Ice::CommunicatorPtr& c
     
     if (mReplicaService->isActive() == true)
     {
-	mGeneralState->mComparatorId = IceUtil::generateUUID();
-	mManagement->addCompare(mGeneralState->mComparatorId, RTPMediaComparatorServiceProxy);
+	    mGeneralState->mComparatorId = IceUtil::generateUUID();
+	    mManagement->addCompare(mGeneralState->mComparatorId, RTPMediaComparatorServiceProxy);
     }
 
 
@@ -587,6 +563,7 @@ void MediaRTPpjmediaApp::start(const std::string&, const Ice::CommunicatorPtr& c
             mManagement->addService(RTPMediaServiceProxy, "media_rtp_pjmedia"));
 	/* Now we can add some parameters to help find us. */
 	rtpparams->category = "rtp";
+    rtpparams->service = serviceName;
 	mGeneralState->mServiceManagement->addLocatorParams(rtpparams, mGeneralState->mComparatorId);
     }
 
@@ -601,13 +578,14 @@ void MediaRTPpjmediaApp::start(const std::string&, const Ice::CommunicatorPtr& c
     mComponentServiceManagement =
         ServiceManagementPrx::uncheckedCast(mManagement->addService(ComponentServiceProxy, "media_rtp_pjmedia"));
     genericparams->category = "Component/media_rtp_pjmedia";
+    genericparams->service = serviceName;
     mComponentServiceManagement->addLocatorParams(genericparams, "");
 
     // Replicate general state information so the backup is ready
     if (mStateReplicator && mReplicaService->isActive() == true)
     {
         RtpStateItemSeq items;
-	items.push_back(mGeneralState);
+	    items.push_back(mGeneralState);
         RtpStateReplicatorPrx oneway = RtpStateReplicatorPrx::uncheckedCast(mStateReplicator->ice_oneway());
         oneway->setState(items);
     }
diff --git a/src/RtpStateReplicatorApp.cpp b/src/RtpStateReplicatorApp.cpp
index 189e809..ee6e851 100644
--- a/src/RtpStateReplicatorApp.cpp
+++ b/src/RtpStateReplicatorApp.cpp
@@ -59,6 +59,7 @@ public:
     };
     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);
@@ -75,7 +76,6 @@ private:
     CollocatedIceStormPtr mIceStorm;
     Ice::ObjectPrx mConfigurationPublisher;
     Discovery::V1::ServiceManagementPrx mConfigurationManagement;
-    std::string mConfigCompareGuid;
 };
 
 static const string ComponentServiceId("RtpStateReplicatorComponent");
@@ -110,44 +110,6 @@ private:
     RtpStateReplicatorService& mService;
 };
 
-class RtpStateReplicatorCompare : public ServiceLocatorParamsCompare
-{
-public:
-    RtpStateReplicatorCompare(const string& name) : mName(name) {}
-    bool isSupported(const ServiceLocatorParamsPtr &params, const Ice::Current &)
-    {
-        RtpStateReplicatorParamsPtr sipParams = RtpStateReplicatorParamsPtr::dynamicCast(params);
-        if (sipParams->mName == mName)
-        {
-            return true;
-        }
-        return false;
-    }
-private:
-    string mName;
-};
-
-typedef IceUtil::Handle<RtpStateReplicatorCompare> RtpStateReplicatorComparePtr;
-
-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;
-
 class ConfigurationReplicatorI : public ConfigurationReplicator
 {
 public:
@@ -207,7 +169,8 @@ void RtpStateReplicatorService::registerWithServiceLocator(const Ice::Communicat
         // Add category as a parameter to enable other components look this component up.
         ServiceLocatorParamsPtr genericparams = new ServiceLocatorParams();
         genericparams->category = AsteriskSCF::Media::RTP::V1::StateReplicatorComponentCategory;
-
+        genericparams->service =  ic->getProperties()->getPropertyWithDefault("RtpStateReplicator.ComponentService.Service", "default");
+        genericparams->id = mAppName;
         mComponentServiceManagement->addLocatorParams(genericparams, "");
 
         Ice::ObjectPrx stateReplicatorObjectPrx = mAdapter->createDirectProxy(ic->stringToIdentity(ServiceDiscoveryId));
@@ -219,33 +182,20 @@ void RtpStateReplicatorService::registerWithServiceLocator(const Ice::Communicat
 
         ServiceLocatorParamsPtr discoveryParams = new ServiceLocatorParams;
         discoveryParams->category = AsteriskSCF::Media::RTP::V1::StateReplicatorDiscoveryCategory;
+        discoveryParams->service = ic->getProperties()->getPropertyWithDefault("RtpStateReplicator.Service", "default");
+        discoveryParams->id = mAppName;
+        mStateReplicationManagement->addLocatorParams(discoveryParams, "");
 
-        string replicatorName = ic->getProperties()->getPropertyWithDefault("RtpStateReplicator.Name", "default");
-        RtpStateReplicatorCompare* nameCompare = new RtpStateReplicatorCompare(replicatorName);
-        ServiceLocatorParamsComparePrx compareProxy = ServiceLocatorParamsComparePrx::uncheckedCast(
-            mAdapter->addWithUUID(nameCompare));
-
-        string compareGuid = IceUtil::generateUUID();
-        mServiceLocatorManagement->addCompare(compareGuid, compareProxy);
-        mStateReplicationManagement->addLocatorParams(discoveryParams, compareGuid);
-
-	// Publish the configuration service IceStorm topic so everybody gets configuration
-	mConfigurationManagement = ServiceManagementPrx::uncheckedCast(
+	    // 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
-	RtpConfigurationParamsPtr configurationParams = new RtpConfigurationParams();
-	configurationParams->category = ConfigurationDiscoveryCategory;
-	configurationParams->name = ic->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(
-            mAdapter->addWithUUID(configNameCompare));
-
-        mConfigCompareGuid = IceUtil::generateUUID();
-        mServiceLocatorManagement->addCompare(mConfigCompareGuid, configCompareProxy);
-	mConfigurationManagement->addLocatorParams(configurationParams, mConfigCompareGuid);
+	    // Populate the configuration parameters with details so we can be found
+	    ServiceLocatorParamsPtr configurationParams = new ServiceLocatorParams();
+	    configurationParams->category = ConfigurationDiscoveryCategory;
+	    configurationParams->service = ic->getProperties()->getPropertyWithDefault("RtpConfiguration.Service", "default");
+	    configurationParams->id = mAppName;
+        mConfigurationManagement->addLocatorParams(configurationParams, "");
 
         // TBD... We may have other interfaces to publish to the Service Locator.
     }
@@ -265,8 +215,7 @@ void RtpStateReplicatorService::deregisterFromServiceLocator()
     try
     {
         mComponentServiceManagement->unregister();
-	mConfigurationManagement->unregister();
-	mServiceLocatorManagement->removeCompare(mConfigCompareGuid);
+        mConfigurationManagement->unregister();
     }
     catch(...)
     {
diff --git a/test/TestRTPpjmedia.cpp b/test/TestRTPpjmedia.cpp
index 1bb6f19..dae217f 100644
--- a/test/TestRTPpjmedia.cpp
+++ b/test/TestRTPpjmedia.cpp
@@ -20,7 +20,7 @@
 #define BOOST_TEST_MODULE RTPpjmediaTestSuite
 #endif
 #define BOOST_TEST_NO_MAIN
-
+                      
 #include <boost/test/unit_test.hpp>
 #include <boost/test/debug.hpp>
 #include <boost/thread/thread.hpp>
@@ -128,15 +128,15 @@ public:
      */
     FrameSeq frames;
 
-	/**
-	 * Lock to be used with the below condition, for when we get state information.
-	 */
-	boost::mutex mLock;
+    /**
+     * Lock to be used with the below condition, for when we get state information.
+     */
+    boost::mutex mLock;
 
-	/**
-	 * Condition used to signal test thread that state was set.
-	 */
-	boost::condition mCondition;
+    /**
+     * Condition used to signal test thread that state was set.
+     */
+    boost::condition mCondition;
 };
 static SharedTestData Testbed;
 
@@ -150,39 +150,39 @@ void TestRtpReplicatorListener::stateSet(const RtpStateItemSeq& items, const Ice
     {
     public:
         visitor(TestRtpReplicatorListener *listener) : mListener(listener)
-	{
-	}
+    {
+    }
 
     private:
-	TestRtpReplicatorListener *mListener;
-
-	void visitRtpGeneralStateItem(const RtpGeneralStateItemPtr &item)
-	{
-	    boost::mutex::scoped_lock lock(Testbed.mLock);
-	    mListener->mGeneral = item;
-	    Testbed.mCondition.notify_one();
-	}
-
-	void visitRtpSessionStateItem(const RtpSessionStateItemPtr &item)
-	{
-	    boost::mutex::scoped_lock lock(Testbed.mLock);
-	    mListener->mSession = item;
-	    Testbed.mCondition.notify_one();
-	}
-
-	void visitRtpStreamSinkStateItem(const RtpStreamSinkStateItemPtr &item)
-	{
-	    boost::mutex::scoped_lock lock(Testbed.mLock);
-	    mListener->mSink = item;
-	    Testbed.mCondition.notify_one();
-	}
-
-	void visitRtpStreamSourceStateItem(const RtpStreamSourceStateItemPtr &item)
-	{
-	    boost::mutex::scoped_lock lock(Testbed.mLock);
-	    mListener->mSource = item;
-	    Testbed.mCondition.notify_one();
-	}
+    TestRtpReplicatorListener *mListener;
+
+    void visitRtpGeneralStateItem(const RtpGeneralStateItemPtr &item)
+    {
+        boost::mutex::scoped_lock lock(Testbed.mLock);
+        mListener->mGeneral = item;
+        Testbed.mCondition.notify_one();
+    }
+
+    void visitRtpSessionStateItem(const RtpSessionStateItemPtr &item)
+    {
+        boost::mutex::scoped_lock lock(Testbed.mLock);
+        mListener->mSession = item;
+        Testbed.mCondition.notify_one();
+    }
+
+    void visitRtpStreamSinkStateItem(const RtpStreamSinkStateItemPtr &item)
+    {
+        boost::mutex::scoped_lock lock(Testbed.mLock);
+        mListener->mSink = item;
+        Testbed.mCondition.notify_one();
+    }
+
+    void visitRtpStreamSourceStateItem(const RtpStreamSourceStateItemPtr &item)
+    {
+        boost::mutex::scoped_lock lock(Testbed.mLock);
+        mListener->mSource = item;
+        Testbed.mCondition.notify_one();
+    }
     };
 
     AsteriskSCF::Media::RTP::V1::RtpStateItemVisitorPtr v = new visitor(this);
@@ -202,9 +202,9 @@ public:
      */
     void write(const AsteriskSCF::Media::V1::FrameSeq& frames, const Ice::Current&)
     {
-	boost::mutex::scoped_lock lock(Testbed.mLock);
-	Testbed.frames = frames;
-	Testbed.mCondition.notify_one();
+    boost::mutex::scoped_lock lock(Testbed.mLock);
+    Testbed.frames = frames;
+    Testbed.mCondition.notify_one();
     }
 
     /**
@@ -270,9 +270,9 @@ struct GlobalIceFixture
 
             Testbed.sink = StreamSinkPrx::uncheckedCast(Testbed.adapter->addWithUUID(sink));
 
-	    Testbed.mListener = new TestRtpReplicatorListener();
+            Testbed.mListener = new TestRtpReplicatorListener();
 
-	    Testbed.mListenerProxy = RtpStateReplicatorListenerPrx::uncheckedCast(Testbed.adapter->addWithUUID(Testbed.mListener));
+            Testbed.mListenerProxy = RtpStateReplicatorListenerPrx::uncheckedCast(Testbed.adapter->addWithUUID(Testbed.mListener));
 
             Testbed.adapter->activate();
 
@@ -320,8 +320,9 @@ BOOST_AUTO_TEST_CASE(ServiceFoundUsingName)
     bool found = false;
 
     try {
-	RTPServiceLocatorParamsPtr params = new RTPServiceLocatorParams();
-	params->category = "rtp";
+        RTPServiceLocatorParamsPtr params = new RTPServiceLocatorParams();
+        params->category = "rtp";
+        params->service = "";
 
         Testbed.locator->locate(params);
 
@@ -344,13 +345,14 @@ BOOST_AUTO_TEST_CASE(ReplicatorFound)
 
     try
     {
-        RtpStateReplicatorParamsPtr params = new RtpStateReplicatorParams();
+        ServiceLocatorParamsPtr params = new ServiceLocatorParams();
         params->category = StateReplicatorDiscoveryCategory;
-        params->mName = "default";
+        params->service = "default";
+        params->id = "";
 
-	Testbed.mStateReplicator = RtpStateReplicatorPrx::uncheckedCast(Testbed.locator->locate(params));
+    Testbed.mStateReplicator = RtpStateReplicatorPrx::uncheckedCast(Testbed.locator->locate(params));
 
-	found = true;
+    found = true;
     }
     catch (const Ice::Exception &e)
     {
@@ -373,9 +375,9 @@ BOOST_AUTO_TEST_CASE(AddListenertoStateReplicator)
 
     try
     {
-	Testbed.mStateReplicator->addListener(Testbed.mListenerProxy);
+    Testbed.mStateReplicator->addListener(Testbed.mListenerProxy);
 
-	added = true;
+    added = true;
     }
     catch (const Ice::Exception &e)
     {
@@ -399,7 +401,7 @@ BOOST_AUTO_TEST_CASE(CheckReplicatedGeneralStateItem)
 
     if (!Testbed.mListener->mGeneral)
     {
-	Testbed.mCondition.wait(lock);
+    Testbed.mCondition.wait(lock);
     }
 
     BOOST_CHECK(Testbed.mListener->mGeneral);
@@ -418,8 +420,9 @@ BOOST_AUTO_TEST_CASE(AllocateRTPSession)
     {
         RTPServiceLocatorParamsPtr params = new RTPServiceLocatorParams();
         params->category = "rtp";
+        params->service = "";
 #ifdef IPV6_TEST
-	params->ipv6 = true;
+    params->ipv6 = true;
 #endif
 
         RTPMediaServicePrx service = RTPMediaServicePrx::uncheckedCast(Testbed.locator->locate(params));
@@ -431,13 +434,13 @@ BOOST_AUTO_TEST_CASE(AllocateRTPSession)
         FormatSeq formats;
         formats.push_back(format);
 
-	// You might think "geez, this should deadlock due to state replication" but no, we use one ways for that
-	boost::mutex::scoped_lock lock(Testbed.mLock);
+        // You might think "geez, this should deadlock due to state replication" but no, we use one ways for that
+        boost::mutex::scoped_lock lock(Testbed.mLock);
 
         Testbed.session = service->allocate(params);
 
-	// Give the RTP component time to replicate this session
-	Testbed.mCondition.wait(lock);
+        // Give the RTP component time to replicate this session
+        Testbed.mCondition.wait(lock);
 
         allocated = true;
     }
@@ -539,12 +542,12 @@ BOOST_AUTO_TEST_CASE(VerifyLocalAddressonSources)
         for (StreamSourceSeq::const_iterator i = sources.begin(); i != sources.end(); ++i)
         {
             StreamSourceRTPPrx source = StreamSourceRTPPrx::checkedCast((*i));
-	    std::string address = source->getLocalAddress();
+        std::string address = source->getLocalAddress();
 
 #ifdef IPV6_TEST
-	    std::string valid_char = ":";
+        std::string valid_char = ":";
 #else
-	    std::string valid_char = ".";
+        std::string valid_char = ".";
 #endif
 
             if (address.empty() || !source->getLocalPort() || address.find(valid_char) == string::npos)
@@ -695,9 +698,9 @@ BOOST_AUTO_TEST_CASE(ConfirmRemoteAddressSetting)
             StreamSinkRTPPrx sink = StreamSinkRTPPrx::checkedCast((*i));
 
 #ifdef IPV6_TEST
-	    std::string address = "::1";
+        std::string address = "::1";
 #else
-	    std::string address = "127.0.0.1";
+        std::string address = "127.0.0.1";
 #endif
             sink->setRemoteDetails(address, 10000);
 
@@ -813,13 +816,13 @@ BOOST_AUTO_TEST_CASE(SetupLoopback)
         StreamSinkSeq sinks = Testbed.session->getSinks();
         StreamSinkRTPPrx sink = StreamSinkRTPPrx::uncheckedCast(sinks.front());
 
-	boost::mutex::scoped_lock lock(Testbed.mLock);
+    boost::mutex::scoped_lock lock(Testbed.mLock);
 
         sink->setRemoteDetails(address, port);
 
         looped = true;
 
-	Testbed.mCondition.wait(lock);
+    Testbed.mCondition.wait(lock);
     }
     catch (const Ice::Exception &e)
     {
@@ -888,13 +891,13 @@ BOOST_AUTO_TEST_CASE(TransmitandReceiveFrame)
         StreamSinkSeq sinks = Testbed.session->getSinks();
         StreamSinkRTPPrx sink = StreamSinkRTPPrx::uncheckedCast(sinks.front());
 
-	boost::mutex::scoped_lock lock(Testbed.mLock);
+    boost::mutex::scoped_lock lock(Testbed.mLock);
 
         sink->write(frames);
 
         /* It takes time for the packet to get sent and received so we wait until we get it here.
          */
-	Testbed.mCondition.wait(lock);
+    Testbed.mCondition.wait(lock);
 
         /* We only sent a single frame, so we should only get a single frame. */
         AudioFramePtr received_frame;
@@ -984,8 +987,9 @@ BOOST_AUTO_TEST_CASE(ReceiveUnknownRTPPacket)
     {
         RTPServiceLocatorParamsPtr params = new RTPServiceLocatorParams();
         params->category = "rtp";
+        params->service = "";
 #ifdef IPV6_TEST
-	params->ipv6 = true;
+    params->ipv6 = true;
 #endif
 
         RTPMediaServicePrx service = RTPMediaServicePrx::uncheckedCast(Testbed.locator->locate(params));
@@ -1065,16 +1069,16 @@ BOOST_AUTO_TEST_CASE(SetInvalidAddressFamilyAddress)
         {
             StreamSinkRTPPrx sink = StreamSinkRTPPrx::checkedCast((*i));
 
-	    /* No, these are not accidentally reversed. We want to try to set an IPv4 address
-	     * on an IPv6 sink and vice versa to make sure that an exception does get thrown.
-	     */
+        /* No, these are not accidentally reversed. We want to try to set an IPv4 address
+         * on an IPv6 sink and vice versa to make sure that an exception does get thrown.
+         */
 #ifdef IPV6_TEST
             sink->setRemoteDetails("127.0.0.1", 10000);
 #else
-	    sink->setRemoteDetails("::1", 10000);
+        sink->setRemoteDetails("::1", 10000);
 #endif
 
-	    set = true;
+        set = true;
         }
     }
     catch (const Ice::Exception &e)
@@ -1126,7 +1130,8 @@ BOOST_AUTO_TEST_CASE(IPv6ServiceNotFoundUsingName)
     try {
         RTPServiceLocatorParamsPtr params = new RTPServiceLocatorParams();
         params->category = "rtp";
-	params->ipv6 = true;
+        params->service = "";
+        params->ipv6 = true;
 
         Testbed.locator->locate(params);
 
@@ -1153,7 +1158,7 @@ void MediaRTPpjmediaTest::start(std::string const& name,
          ++i)
     {
         argv.push_back(i->c_str());
-	mCachedArgs.argc++;
+        mCachedArgs.argc++;
     }
     // null terminated list
     argv.push_back((const char *) 0);

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


-- 
asterisk-scf/integration/media_rtp_pjmedia.git



More information about the asterisk-scf-commits mailing list