[asterisk-scf-commits] asterisk-scf/integration/media_operations_core.git branch "operation-context-propagation" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Feb 6 14:07:26 CST 2012


branch "operation-context-propagation" has been created
        at  4033edff283592099f35029024c2ad5eda54cf42 (commit)

- Log -----------------------------------------------------------------
commit 4033edff283592099f35029024c2ad5eda54cf42
Author: Brent Eagles <beagles at digium.com>
Date:   Mon Feb 6 16:36:46 2012 -0330

    Initial addition of operation context to match slice interface changes.

diff --git a/src/InbandTelephonyEvents.cpp b/src/InbandTelephonyEvents.cpp
index 9a0ebd7..e7c6ce0 100644
--- a/src/InbandTelephonyEvents.cpp
+++ b/src/InbandTelephonyEvents.cpp
@@ -18,6 +18,7 @@
 #include <AsteriskSCF/SessionCommunications/TelephonyEventsIf.h>
 #include <AsteriskSCF/Media/Formats/AudioFormatsIf.h>
 #include <AsteriskSCF/Replication/MediaOperationsCore/MediaOperationsCoreIf.h>
+#include <AsteriskSCF/Helpers/OperationContext.h>
 
 #include <IceUtil/UUID.h>
 
@@ -68,8 +69,9 @@ class InbandTelephonyEventOperation : public TranslatorOperation
             : mLogger(logger) { }
 
         void addSinks_async(const AMD_TelephonyEventSource_addSinksPtr& cb,
-                const TelephonyEventSinkSeq& sinks,
-                const Ice::Current&)
+            const AsteriskSCF::System::V1::OperationContextPtr&,
+            const TelephonyEventSinkSeq& sinks,
+            const Ice::Current&)
         {
             for (TelephonyEventSinkSeq::const_iterator i = sinks.begin(); i != sinks.end(); ++i)
             {
@@ -82,8 +84,9 @@ class InbandTelephonyEventOperation : public TranslatorOperation
         }
 
         void removeSinks_async(const AMD_TelephonyEventSource_removeSinksPtr& cb,
-                const TelephonyEventSinkSeq& sinks,
-                const Ice::Current&)
+            const AsteriskSCF::System::V1::OperationContextPtr&,
+            const TelephonyEventSinkSeq& sinks,
+            const Ice::Current&)
         {
             for (TelephonyEventSinkSeq::const_iterator i = sinks.begin(); i != sinks.end(); ++i)
             {
@@ -104,7 +107,7 @@ class InbandTelephonyEventOperation : public TranslatorOperation
             {
                 try
                 {
-                    (*iter)->write(event);
+                    (*iter)->write(AsteriskSCF::createContext(), event);
                 }
                 catch (const std::exception&)
                 {
@@ -336,6 +339,7 @@ InbandTelephonyEventOperationFactory::InbandTelephonyEventOperationFactory(
 };
 
 MediaOperationPrx InbandTelephonyEventOperationFactory::createMediaOperation(
+            const AsteriskSCF::System::V1::OperationContextPtr&,
             const StreamSourcePrx& source,
             const StreamSinkPrx& sink,
             const Ice::Current&)
diff --git a/src/InbandTelephonyEvents.h b/src/InbandTelephonyEvents.h
index da2f636..db1919a 100644
--- a/src/InbandTelephonyEvents.h
+++ b/src/InbandTelephonyEvents.h
@@ -36,6 +36,7 @@ public:
         const MediaOperationReplicationContextPtr& replicationContext);
 
     AsteriskSCF::Media::V1::MediaOperationPrx createMediaOperation(
+            const AsteriskSCF::System::V1::OperationContextPtr&,
             const AsteriskSCF::Media::V1::StreamSourcePrx& source,
             const AsteriskSCF::Media::V1::StreamSinkPrx& sink,
             const Ice::Current&);
diff --git a/src/MediaOperationStateReplicatorApp.cpp b/src/MediaOperationStateReplicatorApp.cpp
index a40cdfb..8223eb5 100644
--- a/src/MediaOperationStateReplicatorApp.cpp
+++ b/src/MediaOperationStateReplicatorApp.cpp
@@ -22,6 +22,7 @@
 #include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
 #include <AsteriskSCF/Replication/MediaOperationsCore/MediaOperationsCoreIf.h>
 #include <AsteriskSCF/Logger.h>
+#include <AsteriskSCF/Helpers/OperationContext.h>
 
 using namespace AsteriskSCF::System::Logging;
 
@@ -78,7 +79,7 @@ void MediaOperationStateReplicatorService::registerWithServiceLocator(const Ice:
     params->category = StateReplicatorDiscoveryCategory;
     params->service = communicator->getProperties()->getPropertyWithDefault(appName + ".ServiceName", "default");
     params->id = appName;
-    serviceManagement->addLocatorParams(params, "");
+    serviceManagement->addLocatorParams(AsteriskSCF::createContext(), params, "");
 }
 
 void MediaOperationStateReplicatorService::start(
diff --git a/src/TranslatorOperationFactory.cpp b/src/TranslatorOperationFactory.cpp
index 82137fb..efe97d4 100644
--- a/src/TranslatorOperationFactory.cpp
+++ b/src/TranslatorOperationFactory.cpp
@@ -41,6 +41,7 @@ TranslatorOperationFactory::TranslatorOperationFactory(
 TranslatorOperationFactory::~TranslatorOperationFactory() { }
 
 MediaOperationPrx TranslatorOperationFactory::createMediaOperation(
+        const AsteriskSCF::System::V1::OperationContextPtr&,
         const StreamSourcePrx& source,
         const StreamSinkPrx& sink,
         const Ice::Current&)
diff --git a/src/TranslatorOperationFactory.h b/src/TranslatorOperationFactory.h
index ee2a279..9dd1562 100644
--- a/src/TranslatorOperationFactory.h
+++ b/src/TranslatorOperationFactory.h
@@ -50,6 +50,7 @@ public:
      * the formats have been determined.
      */
     AsteriskSCF::Media::V1::MediaOperationPrx createMediaOperation(
+            const AsteriskSCF::System::V1::OperationContextPtr&,
             const AsteriskSCF::Media::V1::StreamSourcePrx& source,
             const AsteriskSCF::Media::V1::StreamSinkPrx& sink,
             const Ice::Current&);
diff --git a/src/TranslatorSource.cpp b/src/TranslatorSource.cpp
index b24cc68..02a6c4e 100644
--- a/src/TranslatorSource.cpp
+++ b/src/TranslatorSource.cpp
@@ -70,7 +70,8 @@ std::string TranslatorSource::getId(const Ice::Current&)
 //XXX
 //I interpreted this to essentially be a check to make sure that
 //the format we actually are using matches what is expected.
-void TranslatorSource::requestFormat(const FormatPtr& format, const Ice::Current&)
+void TranslatorSource::requestFormat(const AsteriskSCF::System::V1::OperationContextPtr&, 
+    const FormatPtr& format, const Ice::Current&)
 {
     FormatPtr supportedFormat = mSupportedFormats.front();
 
diff --git a/src/TranslatorSource.h b/src/TranslatorSource.h
index 06bdbf5..f3cd278 100644
--- a/src/TranslatorSource.h
+++ b/src/TranslatorSource.h
@@ -43,7 +43,8 @@ public:
 
     std::string getId(const Ice::Current&);
 
-    void requestFormat(const AsteriskSCF::Media::V1::FormatPtr& format, const Ice::Current&);
+    void requestFormat(const AsteriskSCF::System::V1::OperationContextPtr&,
+        const AsteriskSCF::Media::V1::FormatPtr& format, const Ice::Current&);
 
     void distributeToSinks(const AsteriskSCF::Media::V1::FrameSeq& translatedFrames);
 
diff --git a/test/TestMediaOperations.cpp b/test/TestMediaOperations.cpp
index 355dfcb..394c547 100644
--- a/test/TestMediaOperations.cpp
+++ b/test/TestMediaOperations.cpp
@@ -31,6 +31,7 @@
 #include <AsteriskSCF/Media/MediaIf.h>
 #include <AsteriskSCF/Media/MediaOperationIf.h>
 #include <AsteriskSCF/Media/Formats/AudioFormatsIf.h>
+#include <AsteriskSCF/Helpers/OperationContext.h>
 
 #include <boost/test/debug.hpp>
 #include <boost/thread/mutex.hpp>
@@ -467,10 +468,12 @@ BOOST_FIXTURE_TEST_CASE(createMediaOperations, PerTestFixture)
         //translators and ulaw to alaw translators even though we searched for the factory with
         //an input of alaw and an output of ulaw.
         MediaOperationPrx alaw2ulawTranslator =
-            ulawAlawFactory->createMediaOperation(Testbed.alawSourceProxy, Testbed.ulawSinkProxy);
+            ulawAlawFactory->createMediaOperation(AsteriskSCF::createContext(), 
+                Testbed.alawSourceProxy, Testbed.ulawSinkProxy);
 
         MediaOperationPrx ulaw2alawTranslator =
-            ulawAlawFactory->createMediaOperation(Testbed.ulawSourceProxy, Testbed.alawSinkProxy);
+            ulawAlawFactory->createMediaOperation(AsteriskSCF::createContext(), 
+                Testbed.ulawSourceProxy, Testbed.alawSinkProxy);
 
         BOOST_CHECK(alaw2ulawTranslator != 0);
         BOOST_CHECK(ulaw2alawTranslator != 0);
@@ -495,7 +498,8 @@ BOOST_FIXTURE_TEST_CASE(translateAlawToUlaw, PerTestFixture)
         MediaOperationFactoryPrx::checkedCast(Testbed.locator->locate(alaw2ulawParams));
 
     MediaOperationPrx alaw2ulawTranslator =
-        alaw2ulawFactory->createMediaOperation(Testbed.alawSourceProxy, Testbed.ulawSinkProxy);
+        alaw2ulawFactory->createMediaOperation(AsteriskSCF::createContext(), 
+            Testbed.alawSourceProxy, Testbed.ulawSinkProxy);
 
     StreamSinkPrx translateSink = alaw2ulawTranslator->getSink();
     StreamSourcePrx translateSource = alaw2ulawTranslator->getSource();
@@ -555,7 +559,8 @@ BOOST_FIXTURE_TEST_CASE(translateAlawToSlin8, PerTestFixture)
         MediaOperationFactoryPrx::checkedCast(Testbed.locator->locate(alaw2slin8Params));
 
     MediaOperationPrx alaw2slin8Translator =
-        alaw2slin8Factory->createMediaOperation(Testbed.alawSourceProxy, Testbed.slin8SinkProxy);
+        alaw2slin8Factory->createMediaOperation(AsteriskSCF::createContext(), 
+            Testbed.alawSourceProxy, Testbed.slin8SinkProxy);
 
     StreamSinkPrx translateSink = alaw2slin8Translator->getSink();
     StreamSourcePrx translateSource = alaw2slin8Translator->getSource();
@@ -616,7 +621,8 @@ BOOST_FIXTURE_TEST_CASE(translateSlin8ToAlaw, PerTestFixture)
         MediaOperationFactoryPrx::checkedCast(Testbed.locator->locate(slin82AlawParams));
 
     MediaOperationPrx slin82AlawTranslator =
-        slin82AlawFactory->createMediaOperation(Testbed.slin8SourceProxy, Testbed.alawSinkProxy);
+        slin82AlawFactory->createMediaOperation(AsteriskSCF::createContext(), 
+            Testbed.slin8SourceProxy, Testbed.alawSinkProxy);
 
     StreamSinkPrx translateSink = slin82AlawTranslator->getSink();
     StreamSourcePrx translateSource = slin82AlawTranslator->getSource();
@@ -677,7 +683,8 @@ BOOST_FIXTURE_TEST_CASE(translateUlawToAlaw, PerTestFixture)
         MediaOperationFactoryPrx::checkedCast(Testbed.locator->locate(ulaw2alawParams));
 
     MediaOperationPrx ulaw2alawTranslator =
-        ulaw2alawFactory->createMediaOperation(Testbed.ulawSourceProxy, Testbed.alawSinkProxy);
+        ulaw2alawFactory->createMediaOperation(AsteriskSCF::createContext(), 
+            Testbed.ulawSourceProxy, Testbed.alawSinkProxy);
 
     StreamSinkPrx translateSink = ulaw2alawTranslator->getSink();
     StreamSourcePrx translateSource = ulaw2alawTranslator->getSource();
@@ -738,7 +745,8 @@ BOOST_FIXTURE_TEST_CASE(translateUlawToSlin8, PerTestFixture)
         MediaOperationFactoryPrx::checkedCast(Testbed.locator->locate(ulaw2slin8Params));
 
     MediaOperationPrx ulaw2slin8Translator =
-        ulaw2slin8Factory->createMediaOperation(Testbed.ulawSourceProxy, Testbed.slin8SinkProxy);
+        ulaw2slin8Factory->createMediaOperation(AsteriskSCF::createContext(), 
+            Testbed.ulawSourceProxy, Testbed.slin8SinkProxy);
 
     StreamSinkPrx translateSink = ulaw2slin8Translator->getSink();
     StreamSourcePrx translateSource = ulaw2slin8Translator->getSource();
@@ -799,7 +807,8 @@ BOOST_FIXTURE_TEST_CASE(translateSlin8ToUlaw, PerTestFixture)
         MediaOperationFactoryPrx::checkedCast(Testbed.locator->locate(slin82UlawParams));
 
     MediaOperationPrx slin82UlawTranslator =
-        slin82UlawFactory->createMediaOperation(Testbed.slin8SourceProxy, Testbed.ulawSinkProxy);
+        slin82UlawFactory->createMediaOperation(AsteriskSCF::createContext(), 
+            Testbed.slin8SourceProxy, Testbed.ulawSinkProxy);
 
     StreamSinkPrx translateSink = slin82UlawTranslator->getSink();
     StreamSourcePrx translateSource = slin82UlawTranslator->getSource();
@@ -865,7 +874,8 @@ BOOST_FIXTURE_TEST_CASE(resample8To16, PerTestFixture)
         MediaOperationFactoryPrx::checkedCast(Testbed.locator->locate(eightToSixteenParams));
 
     MediaOperationPrx eightToSixteenResampler =
-        eightToSixteenFactory->createMediaOperation(Testbed.slin8SourceProxy, Testbed.slin16SinkProxy);
+        eightToSixteenFactory->createMediaOperation(AsteriskSCF::createContext(), 
+            Testbed.slin8SourceProxy, Testbed.slin16SinkProxy);
 
     StreamSinkPrx resampleSink = eightToSixteenResampler->getSink();
     StreamSourcePrx resampleSource = eightToSixteenResampler->getSource();
@@ -924,7 +934,8 @@ BOOST_FIXTURE_TEST_CASE(resample16To8, PerTestFixture)
         MediaOperationFactoryPrx::checkedCast(Testbed.locator->locate(sixteenToEightParams));
 
     MediaOperationPrx sixteenToEightResampler =
-        sixteenToEightFactory->createMediaOperation(Testbed.slin16SourceProxy, Testbed.slin8SinkProxy);
+        sixteenToEightFactory->createMediaOperation(AsteriskSCF::createContext(), 
+            Testbed.slin16SourceProxy, Testbed.slin8SinkProxy);
 
     StreamSinkPrx resampleSink = sixteenToEightResampler->getSink();
     StreamSourcePrx resampleSource = sixteenToEightResampler->getSource();
@@ -983,7 +994,8 @@ BOOST_FIXTURE_TEST_CASE(slin8toG722, PerTestFixture)
         MediaOperationFactoryPrx::checkedCast(Testbed.locator->locate(slinToG722Params));
 
     MediaOperationPrx slinToG722Translator =
-        slinToG722Factory->createMediaOperation(Testbed.slin8SourceProxy, Testbed.g722SinkProxy);
+        slinToG722Factory->createMediaOperation(AsteriskSCF::createContext(), 
+            Testbed.slin8SourceProxy, Testbed.g722SinkProxy);
 
     StreamSinkPrx translatorSink = slinToG722Translator->getSink();
     StreamSourcePrx translatorSource = slinToG722Translator->getSource();
@@ -1042,7 +1054,8 @@ BOOST_FIXTURE_TEST_CASE(slin16toG722, PerTestFixture)
         MediaOperationFactoryPrx::checkedCast(Testbed.locator->locate(slinToG722Params));
 
     MediaOperationPrx slinToG722Translator =
-        slinToG722Factory->createMediaOperation(Testbed.slin16SourceProxy, Testbed.g722SinkProxy);
+        slinToG722Factory->createMediaOperation(AsteriskSCF::createContext(), 
+            Testbed.slin16SourceProxy, Testbed.g722SinkProxy);
 
     StreamSinkPrx translatorSink = slinToG722Translator->getSink();
     StreamSourcePrx translatorSource = slinToG722Translator->getSource();
@@ -1101,7 +1114,8 @@ BOOST_FIXTURE_TEST_CASE(g722ToSlin8, PerTestFixture)
         MediaOperationFactoryPrx::checkedCast(Testbed.locator->locate(g722ToSlinParams));
 
     MediaOperationPrx g722ToSlinTranslator =
-        g722ToSlinFactory->createMediaOperation(Testbed.g722SourceProxy, Testbed.slin8SinkProxy);
+        g722ToSlinFactory->createMediaOperation(AsteriskSCF::createContext(), 
+            Testbed.g722SourceProxy, Testbed.slin8SinkProxy);
 
     StreamSinkPrx translatorSink = g722ToSlinTranslator->getSink();
     StreamSourcePrx translatorSource = g722ToSlinTranslator->getSource();
@@ -1160,7 +1174,8 @@ BOOST_FIXTURE_TEST_CASE(g722ToSlin16, PerTestFixture)
         MediaOperationFactoryPrx::checkedCast(Testbed.locator->locate(g722ToSlinParams));
 
     MediaOperationPrx g722ToSlinTranslator =
-        g722ToSlinFactory->createMediaOperation(Testbed.g722SourceProxy, Testbed.slin16SinkProxy);
+        g722ToSlinFactory->createMediaOperation(AsteriskSCF::createContext(), 
+            Testbed.g722SourceProxy, Testbed.slin16SinkProxy);
 
     StreamSinkPrx translatorSink = g722ToSlinTranslator->getSink();
     StreamSourcePrx translatorSource = g722ToSlinTranslator->getSource();
diff --git a/test/TestStreamSource.cpp b/test/TestStreamSource.cpp
index 456b107..2ed9920 100644
--- a/test/TestStreamSource.cpp
+++ b/test/TestStreamSource.cpp
@@ -66,7 +66,8 @@ std::string TestStreamSource::getId(const Ice::Current&)
 /**
  * Does nothing. Don't call this you silly head!
  */
-void TestStreamSource::requestFormat(const FormatPtr&, const Ice::Current&)
+void TestStreamSource::requestFormat(const AsteriskSCF::System::V1::OperationContextPtr&,
+    const FormatPtr&, const Ice::Current&)
 {
 }
 
diff --git a/test/TestStreamSource.h b/test/TestStreamSource.h
index 782db7b..14f5e32 100644
--- a/test/TestStreamSource.h
+++ b/test/TestStreamSource.h
@@ -50,7 +50,8 @@ public:
     /**
      * Does nothing. Don't call this you silly head!
      */
-    void requestFormat(const AsteriskSCF::Media::V1::FormatPtr&, const Ice::Current&);
+    void requestFormat(const AsteriskSCF::System::V1::OperationContextPtr&,
+        const AsteriskSCF::Media::V1::FormatPtr&, const Ice::Current&);
 
     /**
      * Writes the given frame to all its sinks. Presumably, there will

commit ba2acb2290c6482f8f2a415545ecd0e8f0ba8a9c
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue Jan 3 14:37:40 2012 -0600

    Adjust component library names and update test config files

diff --git a/config/test_component.conf b/config/test_component.conf
index 4af3deb..1305e3d 100644
--- a/config/test_component.conf
+++ b/config/test_component.conf
@@ -5,7 +5,7 @@ IceBox.InstanceName=IceBox
 IceBox.ServiceManager.Endpoints=tcp -h 127.0.0.1 -p 10007
 
 IceBox.Service.MediaOperationsCore=MediaOperationsCore:create
-IceBox.Service.ServiceDiscovery=service_locator:create
+IceBox.Service.ServiceDiscovery=ServiceLocator:create
 
 IceBox.Service.MediaOperationsCoreTest=MediaOperationsCoreTest:create --log_level=all
 

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


-- 
asterisk-scf/integration/media_operations_core.git



More information about the asterisk-scf-commits mailing list