[asterisk-scf-commits] asterisk-scf/integration/media_operations_core.git branch "retry_deux" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Fri Mar 16 09:41:56 CDT 2012
branch "retry_deux" has been updated
via 667591c3b27242bb2962e8fa80ce49d7474c7358 (commit)
via 9ef786e8925ddbf636727aff181f7af6c7806d35 (commit)
via 27e97f6760f2b8a788efffcaa02459c16b87f0c6 (commit)
via e5008e1679a0dde9a77b3b49fbfeee91d43fb90b (commit)
via 1d1e6e1775cfbbe2a1077e1d8c79c44cb70c898b (commit)
via c91a0c85688818d5278f056fdeb65a4ab15e7695 (commit)
via 3f25585831ec69af4f2b0cb788c64dac667186c5 (commit)
from 1a4ed1cd8a7c95d30a80fc7a46fd116793074f38 (commit)
Summary of changes:
src/CMakeLists.txt | 2 +-
src/ComponentStateReplicator.cpp | 113 +++++++++++++++++++++++++++++
src/MediaOperationStateReplicatorApp.cpp | 114 ------------------------------
3 files changed, 114 insertions(+), 115 deletions(-)
create mode 100644 src/ComponentStateReplicator.cpp
delete mode 100644 src/MediaOperationStateReplicatorApp.cpp
- Log -----------------------------------------------------------------
commit 667591c3b27242bb2962e8fa80ce49d7474c7358
Merge: 1a4ed1c 9ef786e
Author: David M. Lee <dlee at digium.com>
Date: Fri Mar 16 09:34:35 2012 -0500
Merge branch 'master' into retry_deux
Conflicts:
src/DSP.cpp
src/MediaOperationStateReplicatorApp.cpp
commit 9ef786e8925ddbf636727aff181f7af6c7806d35
Author: Ken Hunt <ken.hunt at digium.com>
Date: Fri Feb 10 11:39:46 2012 -0600
Changes to base ComponentStateReplicator constructor args.
diff --git a/src/ComponentStateReplicator.cpp b/src/ComponentStateReplicator.cpp
index 2a58cac..64c2ab7 100644
--- a/src/ComponentStateReplicator.cpp
+++ b/src/ComponentStateReplicator.cpp
@@ -48,7 +48,8 @@ public:
ComponentStateReplicator() :
AsteriskSCF::Component::ComponentStateReplicator(lg,
AsteriskSCF::Replication::MediaOperationsCore::V1::StateReplicatorComponentCategory,
- false)
+ false,
+ "")
{
}
commit 27e97f6760f2b8a788efffcaa02459c16b87f0c6
Author: David M. Lee <dlee at digium.com>
Date: Thu Feb 9 10:32:12 2012 -0600
Pass exceptions on up to the test framework.
Fixes set-but-not-used errors.
diff --git a/test/TestMediaOperations.cpp b/test/TestMediaOperations.cpp
index bf4358d..617d5f3 100644
--- a/test/TestMediaOperations.cpp
+++ b/test/TestMediaOperations.cpp
@@ -279,69 +279,55 @@ struct GlobalIceFixture
::boost::debug::detect_memory_leaks(false);
::boost::unit_test::unit_test_log.set_stream( std::cout );
- int status = 0;
- try
- {
- //Since our translator makes calls to pjlib, we have to
- //register our threads with pjlib
- Ice::InitializationData id;
- id.threadHook = new pjlibHook();
- id.properties = IceBoxTestEnv.communicator->getProperties();
- Testbed.communicator = Ice::initialize(id);
-
- Testbed.adapter =
- Testbed.communicator->createObjectAdapterWithEndpoints("Adapter", "default");
- Testbed.adapter->activate();
- Testbed.locator = ServiceLocatorPrx::checkedCast(Testbed.communicator->propertyToProxy("LocatorService.Proxy"));
-
- if (!Testbed.locator) {
- throw "Invalid service locator proxy";
- }
+ //Since our translator makes calls to pjlib, we have to
+ //register our threads with pjlib
+ Ice::InitializationData id;
+ id.threadHook = new pjlibHook();
+ id.properties = IceBoxTestEnv.communicator->getProperties();
+ Testbed.communicator = Ice::initialize(id);
+
+ Testbed.adapter =
+ Testbed.communicator->createObjectAdapterWithEndpoints("Adapter", "default");
+ Testbed.adapter->activate();
+ Testbed.locator = ServiceLocatorPrx::checkedCast(Testbed.communicator->propertyToProxy("LocatorService.Proxy"));
+
+ if (!Testbed.locator) {
+ throw "Invalid service locator proxy";
+ }
- Testbed.ulaw = new G711uLAW();
- Testbed.ulaw->name = G711uLAWName;
+ Testbed.ulaw = new G711uLAW();
+ Testbed.ulaw->name = G711uLAWName;
- Testbed.alaw = new G711aLAW();
- Testbed.alaw->name = G711aLAWName;
+ Testbed.alaw = new G711aLAW();
+ Testbed.alaw->name = G711aLAWName;
- Testbed.slin8 = new SignedLinear();
- Testbed.slin8->name = SignedLinear8Name;
- Testbed.slin8->sampleRate = 8000;
+ Testbed.slin8 = new SignedLinear();
+ Testbed.slin8->name = SignedLinear8Name;
+ Testbed.slin8->sampleRate = 8000;
- Testbed.slin16 = new SignedLinear();
- Testbed.slin16->name = SignedLinear16Name;
- Testbed.slin16->sampleRate = 16000;
+ Testbed.slin16 = new SignedLinear();
+ Testbed.slin16->name = SignedLinear16Name;
+ Testbed.slin16->sampleRate = 16000;
- Testbed.g722 = new G722();
- Testbed.g722->name = G722Name;
+ Testbed.g722 = new G722();
+ Testbed.g722->name = G722Name;
- Testbed.sampleAlawFrame = new Frame(Testbed.alaw, new ByteSeqPayload(Ice::ByteSeq(sampleAlaw, sampleAlaw + sizeof(sampleAlaw))));
- Testbed.sampleAlawFrameSize = sizeof(sampleAlaw);
+ Testbed.sampleAlawFrame = new Frame(Testbed.alaw, new ByteSeqPayload(Ice::ByteSeq(sampleAlaw, sampleAlaw + sizeof(sampleAlaw))));
+ Testbed.sampleAlawFrameSize = sizeof(sampleAlaw);
- Testbed.sampleUlawFrame = new Frame(Testbed.ulaw, new ByteSeqPayload(Ice::ByteSeq(sampleUlaw, sampleUlaw + sizeof(sampleUlaw))));
- Testbed.sampleUlawFrameSize = sizeof(sampleUlaw);
+ Testbed.sampleUlawFrame = new Frame(Testbed.ulaw, new ByteSeqPayload(Ice::ByteSeq(sampleUlaw, sampleUlaw + sizeof(sampleUlaw))));
+ Testbed.sampleUlawFrameSize = sizeof(sampleUlaw);
- ShortSeqPayloadPtr slin8Payload(new ShortSeqPayload(Ice::ShortSeq(sampleSlin8, sampleSlin8 + (sizeof(sampleSlin8) / 2))));
- Testbed.sampleSlin8Frame = new Frame(Testbed.slin8, slin8Payload);
- Testbed.sampleSlin8FrameSize = slin8Payload->payload.size();
+ ShortSeqPayloadPtr slin8Payload(new ShortSeqPayload(Ice::ShortSeq(sampleSlin8, sampleSlin8 + (sizeof(sampleSlin8) / 2))));
+ Testbed.sampleSlin8Frame = new Frame(Testbed.slin8, slin8Payload);
+ Testbed.sampleSlin8FrameSize = slin8Payload->payload.size();
- ShortSeqPayloadPtr slin16Payload(new ShortSeqPayload(Ice::ShortSeq(sampleSlin16, sampleSlin16 + (sizeof(sampleSlin16) / 2))));
- Testbed.sampleSlin16Frame = new Frame(Testbed.slin16, slin16Payload);
- Testbed.sampleSlin16FrameSize = slin16Payload->payload.size();
+ ShortSeqPayloadPtr slin16Payload(new ShortSeqPayload(Ice::ShortSeq(sampleSlin16, sampleSlin16 + (sizeof(sampleSlin16) / 2))));
+ Testbed.sampleSlin16Frame = new Frame(Testbed.slin16, slin16Payload);
+ Testbed.sampleSlin16FrameSize = slin16Payload->payload.size();
- Testbed.sampleG722Frame = new Frame(Testbed.g722, new ByteSeqPayload(Ice::ByteSeq(sampleG722, sampleG722 + sizeof(sampleG722))));
- Testbed.sampleG722FrameSize = sizeof(sampleG722);
- }
- catch (const Ice::Exception& ex)
- {
- std::cerr << ex << std::endl;
- status = 1;
- }
- catch (...)
- {
- std::cerr << "Some non-Ice exception got encaughtened." << std::endl;
- status = 1;
- }
+ Testbed.sampleG722Frame = new Frame(Testbed.g722, new ByteSeqPayload(Ice::ByteSeq(sampleG722, sampleG722 + sizeof(sampleG722))));
+ Testbed.sampleG722FrameSize = sizeof(sampleG722);
}
~GlobalIceFixture()
commit e5008e1679a0dde9a77b3b49fbfeee91d43fb90b
Author: Ken Hunt <ken.hunt at digium.com>
Date: Mon Feb 6 18:52:48 2012 -0600
Correction to the unit test.
diff --git a/test/TestMediaOperations.cpp b/test/TestMediaOperations.cpp
index 355dfcb..bf4358d 100644
--- a/test/TestMediaOperations.cpp
+++ b/test/TestMediaOperations.cpp
@@ -342,7 +342,6 @@ struct GlobalIceFixture
std::cerr << "Some non-Ice exception got encaughtened." << std::endl;
status = 1;
}
- BOOST_CHECK_EQUAL(0, status);
}
~GlobalIceFixture()
commit 1d1e6e1775cfbbe2a1077e1d8c79c44cb70c898b
Author: Ken Hunt <ken.hunt at digium.com>
Date: Mon Feb 6 11:37:12 2012 -0600
Correction for file name case change.
diff --git a/src/ComponentStateReplicator.cpp b/src/ComponentStateReplicator.cpp
index 9912a2f..2a58cac 100644
--- a/src/ComponentStateReplicator.cpp
+++ b/src/ComponentStateReplicator.cpp
@@ -21,7 +21,7 @@
#include <AsteriskSCF/Component/ComponentStateReplicator.h>
#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
#include <AsteriskSCF/Replication/MediaOperationsCore/MediaOperationsCoreIf.h>
-#include <AsteriskSCF/logger.h>
+#include <AsteriskSCF/Logger.h>
using namespace AsteriskSCF::System::Logging;
commit c91a0c85688818d5278f056fdeb65a4ab15e7695
Author: Ken Hunt <ken.hunt at digium.com>
Date: Fri Feb 3 18:00:47 2012 -0600
Using base class for ComponentStateReplicator.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4cee3e7..c6a52da 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -44,7 +44,7 @@ pjproject_link(MediaOperationsCore pjnath)
astscf_component_install(MediaOperationsCore)
astscf_component_init(MediaOperationStateReplicator)
-astscf_component_add_files(MediaOperationStateReplicator MediaOperationStateReplicatorApp.cpp)
+astscf_component_add_files(MediaOperationStateReplicator ComponentStateReplicator.cpp)
astscf_component_add_files(MediaOperationStateReplicator MediaOperationStateReplicator.h)
astscf_component_add_slices(MediaOperationStateReplicator PROJECT AsteriskSCF/Replication/MediaOperationsCore/MediaOperationsCoreIf.ice)
astscf_component_add_slice_collection_libraries(MediaOperationStateReplicator ASTSCF)
diff --git a/src/ComponentStateReplicator.cpp b/src/ComponentStateReplicator.cpp
new file mode 100644
index 0000000..9912a2f
--- /dev/null
+++ b/src/ComponentStateReplicator.cpp
@@ -0,0 +1,112 @@
+/*
+ * 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 "MediaOperationStateReplicator.h"
+
+#include <Ice/Ice.h>
+
+#include <AsteriskSCF/Component/ComponentStateReplicator.h>
+#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
+#include <AsteriskSCF/Replication/MediaOperationsCore/MediaOperationsCoreIf.h>
+#include <AsteriskSCF/logger.h>
+
+using namespace AsteriskSCF::System::Logging;
+
+namespace
+{
+Logger lg = getLoggerFactory().getLogger("AsteriskSCF.MediaOperationStateReplicator");
+
+const std::string ReplicatorId("MediaOperationStateReplicator");
+}
+
+namespace AsteriskSCF
+{
+
+namespace MediaOperationsCore
+{
+
+using namespace AsteriskSCF::Core::Discovery::V1;
+using namespace AsteriskSCF::Replication::MediaOperationsCore::V1;
+using namespace AsteriskSCF::Discovery;
+
+class ComponentStateReplicator : public AsteriskSCF::Component::ComponentStateReplicator
+{
+public:
+ ComponentStateReplicator() :
+ AsteriskSCF::Component::ComponentStateReplicator(lg,
+ AsteriskSCF::Replication::MediaOperationsCore::V1::StateReplicatorComponentCategory,
+ false)
+ {
+ }
+
+ ~ComponentStateReplicator() {};
+
+ ///////////////////////////////////////////////////
+ // Required overrides
+
+ void createPrimaryServices();
+ void preparePrimaryServicesForDiscovery();
+
+ MediaOperationStateReplicatorImplPtr mReplicator;
+ MediaOperationStateReplicatorPrx mReplicatorPrx;
+ LocatorRegistrationWrapperPtr mStateReplicatorRegistration;
+};
+
+/**
+ * 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(mReplicatorPrx,
+ 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 state replication servant.
+ mReplicator = new MediaOperationStateReplicatorImpl;
+ mReplicatorPrx = MediaOperationStateReplicatorPrx::uncheckedCast(
+ getServiceAdapter()->add(mReplicator, getCommunicator()->stringToIdentity(ReplicatorId)));
+
+ assert(mReplicatorPrx != 0);
+ if(mReplicatorPrx == 0)
+ {
+ throw IceBox::FailureException(__FILE__, __LINE__, "Unable to instantiate MediaOperationsCore replicator object");
+ }
+}
+
+extern "C"
+{
+ASTSCF_DLL_EXPORT IceBox::Service* create(Ice::CommunicatorPtr)
+{
+ return new ComponentStateReplicator;
+}
+}
+
+} //end namespace MediaOperationsCore
+} //end namespace AsteriskSCF
diff --git a/src/MediaOperationStateReplicatorApp.cpp b/src/MediaOperationStateReplicatorApp.cpp
deleted file mode 100644
index a40cdfb..0000000
--- a/src/MediaOperationStateReplicatorApp.cpp
+++ /dev/null
@@ -1,112 +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 "MediaOperationStateReplicator.h"
-
-#include <Ice/Ice.h>
-#include <IceBox/IceBox.h>
-
-#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
-#include <AsteriskSCF/Replication/MediaOperationsCore/MediaOperationsCoreIf.h>
-#include <AsteriskSCF/Logger.h>
-
-using namespace AsteriskSCF::System::Logging;
-
-namespace
-{
-Logger lg = getLoggerFactory().getLogger("AsteriskSCF.MediaOperationStateReplicator");
-
-const std::string ReplicatorId("MediaOperationStateReplicator");
-}
-
-namespace AsteriskSCF
-{
-
-namespace MediaOperationsCore
-{
-
-using namespace AsteriskSCF::Core::Discovery::V1;
-using namespace AsteriskSCF::Replication::MediaOperationsCore::V1;
-
-class MediaOperationStateReplicatorService : public IceBox::Service
-{
-public:
- virtual void start(
- const std::string& name,
- const Ice::CommunicatorPtr&,
- const Ice::StringSeq&);
-
- virtual void stop();
-
- void createStateReplicator(const Ice::CommunicatorPtr& communicator);
- void registerWithServiceLocator(const Ice::CommunicatorPtr& communicator,
- const std::string& appName);
-
- ServiceLocatorManagementPrx mManagement;
- Ice::ObjectAdapterPtr mAdapter;
- MediaOperationStateReplicatorImplPtr mReplicator;
-};
-
-void MediaOperationStateReplicatorService::createStateReplicator(const Ice::CommunicatorPtr& communicator)
-{
- mReplicator = new MediaOperationStateReplicatorImpl;
- mAdapter->add(mReplicator, communicator->stringToIdentity(ReplicatorId));
-}
-
-void MediaOperationStateReplicatorService::registerWithServiceLocator(const Ice::CommunicatorPtr& communicator,
- const std::string& appName)
-{
- MediaOperationStateReplicatorPrx stateReplicatorProxy =
- MediaOperationStateReplicatorPrx::uncheckedCast(mAdapter->createDirectProxy(communicator->stringToIdentity(ReplicatorId)));
-
- ServiceManagementPrx serviceManagement = mManagement->addService(stateReplicatorProxy, ReplicatorId);
-
- ServiceLocatorParamsPtr params = new ServiceLocatorParams();
- params->category = StateReplicatorDiscoveryCategory;
- params->service = communicator->getProperties()->getPropertyWithDefault(appName + ".ServiceName", "default");
- params->id = appName;
- serviceManagement->addLocatorParams(params, "");
-}
-
-void MediaOperationStateReplicatorService::start(
- const std::string& appName,
- const Ice::CommunicatorPtr& communicator,
- const Ice::StringSeq&)
-{
- mManagement = ServiceLocatorManagementPrx::checkedCast(communicator->propertyToProxy("LocatorServiceManagement.Proxy"));
- mAdapter = communicator->createObjectAdapter(appName + ".Adapter");
-
- createStateReplicator(communicator);
- registerWithServiceLocator(communicator, appName);
-
- mAdapter->activate();
-}
-
-void MediaOperationStateReplicatorService::stop()
-{
- //stub
-}
-
-extern "C"
-{
-ASTSCF_DLL_EXPORT IceBox::Service* create(Ice::CommunicatorPtr)
-{
- return new MediaOperationStateReplicatorService;
-}
-}
-
-} //end namespace MediaOperationsCore
-} //end namespace AsteriskSCF
commit 3f25585831ec69af4f2b0cb788c64dac667186c5
Author: Brent Eagles <beagles at digium.com>
Date: Mon Jan 9 16:44:01 2012 -0330
Fix build error on windows.
diff --git a/src/DSP.cpp b/src/DSP.cpp
index 8bddd01..9d868f0 100644
--- a/src/DSP.cpp
+++ b/src/DSP.cpp
@@ -1,3 +1,4 @@
+#define _USE_MATH_DEFINES
#include <cmath>
#include "DSP.h"
-----------------------------------------------------------------------
--
asterisk-scf/integration/media_operations_core.git
More information about the asterisk-scf-commits
mailing list