[asterisk-scf-commits] asterisk-scf/integration/test_channel.git branch "route_replica" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Apr 25 16:41:08 CDT 2011


branch "route_replica" has been updated
       via  4c3019c1b9a3b3c1eea7a86df7fa315fb8ec60d5 (commit)
       via  c70e1e97b4cd0c2d0bc4cb67d8de3c5dbeae4f1d (commit)
       via  eee61313875db02d8159c74d426bb64a406d9d6b (commit)
       via  eecb7046abd3fcd0dcf069da962004591ae68972 (commit)
       via  fc859d79f234dfe789e669efd771e615eb52ddcc (commit)
       via  fffdcb241ce942415bb8fe17a9f266d0e7a1ecdf (commit)
       via  396cbc558718ce9f6abd2c47e89a9b1b55ed2083 (commit)
       via  8c2c50a7406cacfb529a3e510e953f960035778b (commit)
       via  9f163f823e256bd86b841d924997983b14b840b0 (commit)
      from  81cf42c29d10018e8d8f7f59b7c054f9774aff24 (commit)

Summary of changes:
 src/MediaSession.h   |    4 +-
 src/Service.cpp      |   52 +++++++++++++++++++++++++++++++++++++++++++------
 src/TestEndpoint.cpp |   44 +++++++++++++++++++++++++-----------------
 src/TestEndpoint.h   |    2 +-
 4 files changed, 74 insertions(+), 28 deletions(-)


- Log -----------------------------------------------------------------
commit 4c3019c1b9a3b3c1eea7a86df7fa315fb8ec60d5
Merge: c70e1e9 81cf42c
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Mon Apr 25 16:40:02 2011 -0500

    Updating for recent changes in release.


commit c70e1e97b4cd0c2d0bc4cb67d8de3c5dbeae4f1d
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Wed Dec 22 17:37:58 2010 -0600

    Changes for AMD operation on EndpointLocator interface.

diff --git a/src/TestEndpoint.cpp b/src/TestEndpoint.cpp
index 2ad670e..050e287 100644
--- a/src/TestEndpoint.cpp
+++ b/src/TestEndpoint.cpp
@@ -539,11 +539,11 @@ public:
         adapter->addFacet(mCommands, adapter->getCommunicator()->stringToIdentity(id), "Commands");
     }
 
-    AsteriskSCF::Core::Endpoint::V1::EndpointSeq lookup(const std::string&, const Ice::Current&)
+    virtual void lookup_async(const ::AsteriskSCF::Core::Routing::V1::AMD_EndpointLocator_lookupPtr& cb, const ::std::string& destination, const ::Ice::Current&)
     {
         AsteriskSCF::Core::Endpoint::V1::EndpointSeq result;
         result.push_back(mEndpointProxy);
-        return result;
+        cb->ice_response(result);
     }
 
 private:

commit eee61313875db02d8159c74d426bb64a406d9d6b
Merge: eecb704 8c2c50a
Author: Joshua Colp <jcolp at digium.com>
Date:   Thu Apr 21 12:11:05 2011 -0300

    Merge branch 'indicate'


commit eecb7046abd3fcd0dcf069da962004591ae68972
Author: Brent Eagles <beagles at digium.com>
Date:   Tue Apr 19 14:04:28 2011 -0230

    Fix merge introduced build error.

diff --git a/src/Service.cpp b/src/Service.cpp
index 36bf53b..7d6169a 100644
--- a/src/Service.cpp
+++ b/src/Service.cpp
@@ -43,7 +43,7 @@ TestChannelDriver::TestChannelDriver()
 {
 }
 
-void TestChannelDriver::start(const std::string&, const Ice::CommunicatorPtr& communicator, const Ice::StringSeq&)
+void TestChannelDriver::start(const std::string& name, const Ice::CommunicatorPtr& communicator, const Ice::StringSeq&)
 {
     mLogger.getTraceStream() << "Launching AsteriskSCF Session-Oriented Test Channel Service." << std::endl;
 

commit fc859d79f234dfe789e669efd771e615eb52ddcc
Author: Brent Eagles <beagles at digium.com>
Date:   Tue Apr 19 13:25:50 2011 -0230

    Modifying the test channel to be more usable through service discovery by:
    - configured a default for the adapter configuration, both in endpoints
      and thread pool configuration
    - made the test command proxy a facet of the endpoint

diff --git a/src/Service.cpp b/src/Service.cpp
index af0e1ed..36bf53b 100644
--- a/src/Service.cpp
+++ b/src/Service.cpp
@@ -46,14 +46,52 @@ TestChannelDriver::TestChannelDriver()
 void TestChannelDriver::start(const std::string&, const Ice::CommunicatorPtr& communicator, const Ice::StringSeq&)
 {
     mLogger.getTraceStream() << "Launching AsteriskSCF Session-Oriented Test Channel Service." << std::endl;
-    mAdapter = communicator->createObjectAdapter("AsteriskSCF.TestChannelService");
+
+    //
+    // It is standard practice to base the adapter name on the configured
+    // service instance name.
+    //
+    std::string adapterName;
+    if(name.size() == 0)
+    {
+        adapterName = "TestChannel";
+    }
+    else
+    {
+        adapterName = name + ".TestChannel";
+    }
+
+    //
+    // Check on the threadpool properties, make sure that they are compatible with the requirements of this 
+    // service. This could be moved into a helper method, but it is somehow more clear for seeing what
+    // is going on during initialization to leave it here.
+    //
+    // TODO: Are there any other properties that need to be double-checked before proceeding?
+    //
+    Ice::Int defaultPoolSize = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.ThreadPool.Server.Size", 0);
+    if (communicator->getProperties()->getPropertyAsIntWithDefault(adapterName + ".ThreadPool.Size", 0) < 4)
+    {
+        if (defaultPoolSize < 4)
+        {
+            communicator->getProperties()->setProperty(adapterName + ".ThreadPool.Size", "4");
+        }
+    }
+
+    //
+    // TODO: All adapter ids should be globally unique. This would allow replicas to be identified.
+    // How this might be useful is that it might be used as a replicated state item to identify
+    // which adapter is currently the primary in a group of replicas.
+    //
+    mAdapter = communicator->createObjectAdapterWithEndpoints(adapterName,
+        communicator->getProperties()->getPropertyWithDefault(adapterName + ".Endpoints", "default"));
+
     mAdapter->activate();
 
-    AsteriskSCF::Core::Routing::V1::EndpointLocatorPtr servant = AsteriskSCF::TestUtil::TestEndpoint::create(mAdapter, "TestChannel.Locator");
-    AsteriskSCF::Core::Routing::V1::EndpointLocatorPrx endpointLocatorPrx =
-        AsteriskSCF::Core::Routing::V1::EndpointLocatorPrx::checkedCast(mAdapter->add(servant, communicator->stringToIdentity("TestChannel")));
+    AsteriskSCF::Core::Routing::V1::EndpointLocatorPrx endpointLocatorPrx = 
+        AsteriskSCF::TestUtil::TestEndpoint::create(mAdapter, "TestChannel.Locator");
 
-    AsteriskSCF::Core::Discovery::V1::ServiceLocatorManagementPrx management = AsteriskSCF::Core::Discovery::V1::ServiceLocatorManagementPrx::checkedCast(communicator->propertyToProxy("ServiceLocatorManagementProxy"));
+    AsteriskSCF::Core::Discovery::V1::ServiceLocatorManagementPrx management = 
+        AsteriskSCF::Core::Discovery::V1::ServiceLocatorManagementPrx::checkedCast(communicator->propertyToProxy("ServiceLocatorManagementProxy"));
     mServiceManagement = AsteriskSCF::Core::Discovery::V1::ServiceManagementPrx::uncheckedCast(management->addService(endpointLocatorPrx, "TestChannel"));
     AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsPtr params = new AsteriskSCF::Core::Discovery::V1::ServiceLocatorParams();
     params->category = "TestChannel";
diff --git a/src/TestEndpoint.cpp b/src/TestEndpoint.cpp
index b6717f1..fc1191d 100644
--- a/src/TestEndpoint.cpp
+++ b/src/TestEndpoint.cpp
@@ -527,7 +527,7 @@ public:
         mEndpointProxy =
             AsteriskSCF::Core::Endpoint::V1::BaseEndpointPrx::checkedCast(adapter->add(mManager, adapter->getCommunicator()->stringToIdentity(mManagerId + ".Endpoint")));
         mCommands = new CommandImpl(mManager);
-        adapter->add(mCommands, adapter->getCommunicator()->stringToIdentity(mManagerId + ".Commands"));
+        adapter->addFacet(mCommands, adapter->getCommunicator()->stringToIdentity(id), "Commands");
     }
 
     AsteriskSCF::Core::Endpoint::V1::EndpointSeq lookup(const std::string&, const Ice::Current&)
@@ -555,11 +555,11 @@ namespace AsteriskSCF
 namespace TestUtil
 {
 
-AsteriskSCF::Core::Routing::V1::EndpointLocatorPtr TestEndpoint::create(const Ice::ObjectAdapterPtr& adapter, const std::string& id)
+AsteriskSCF::Core::Routing::V1::EndpointLocatorPrx TestEndpoint::create(const Ice::ObjectAdapterPtr& adapter, const std::string& id)
 {
-
     EndpointLocatorIPtr impl(new EndpointLocatorI(adapter, id));
-    return  AsteriskSCF::Core::Routing::V1::EndpointLocatorPtr::dynamicCast(impl);
+    return AsteriskSCF::Core::Routing::V1::EndpointLocatorPrx::uncheckedCast(adapter->add(impl, 
+        adapter->getCommunicator()->stringToIdentity(id)));
 }
 
 }
diff --git a/src/TestEndpoint.h b/src/TestEndpoint.h
index 827efa8..3bed6fc 100644
--- a/src/TestEndpoint.h
+++ b/src/TestEndpoint.h
@@ -34,7 +34,7 @@ class TestEndpoint
     //
     TestEndpoint() {}
 public:
-    static AsteriskSCF::Core::Routing::V1::EndpointLocatorPtr create(const Ice::ObjectAdapterPtr& adapter, const std::string& id);
+    static AsteriskSCF::Core::Routing::V1::EndpointLocatorPrx create(const Ice::ObjectAdapterPtr& adapter, const std::string& id);
 };
 }
 } // End of namespace AsteriskSCF

commit fffdcb241ce942415bb8fe17a9f266d0e7a1ecdf
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Thu Apr 14 13:25:27 2011 -0500

    Minor fixes for various code constructs that trip up GCC with new warning
    options enabled (-Wextra, -Wconversion, -Wformat, and others).

diff --git a/src/MediaSession.h b/src/MediaSession.h
index a95faeb..511cc22 100644
--- a/src/MediaSession.h
+++ b/src/MediaSession.h
@@ -64,7 +64,7 @@ public:
         return mId;
     }
 
-    void requestFormat(const AsteriskSCF::Media::V1::FormatPtr& format, const Ice::Current&)
+    void requestFormat(const AsteriskSCF::Media::V1::FormatPtr&, const Ice::Current&)
     {
         // XXX
     }
@@ -131,7 +131,7 @@ public:
         return mId;
     }
 
-    void requestFormat(const AsteriskSCF::Media::V1::FormatPtr& format, const Ice::Current&)
+    void requestFormat(const AsteriskSCF::Media::V1::FormatPtr&, const Ice::Current&)
     {
         // XXX
     }
diff --git a/src/Service.cpp b/src/Service.cpp
index 9ec19e5..af0e1ed 100644
--- a/src/Service.cpp
+++ b/src/Service.cpp
@@ -43,7 +43,7 @@ TestChannelDriver::TestChannelDriver()
 {
 }
 
-void TestChannelDriver::start(const std::string& name, const Ice::CommunicatorPtr& communicator, const Ice::StringSeq& args)
+void TestChannelDriver::start(const std::string&, const Ice::CommunicatorPtr& communicator, const Ice::StringSeq&)
 {
     mLogger.getTraceStream() << "Launching AsteriskSCF Session-Oriented Test Channel Service." << std::endl;
     mAdapter = communicator->createObjectAdapter("AsteriskSCF.TestChannelService");
@@ -81,7 +81,7 @@ void TestChannelDriver::stop()
 }
 
 extern "C" {
-ASTERISK_SCF_ICEBOX_EXPORT ::IceBox::Service* create(Ice::CommunicatorPtr communicator)
+ASTERISK_SCF_ICEBOX_EXPORT ::IceBox::Service* create(Ice::CommunicatorPtr)
 {
     return new TestChannelDriver;
 }
diff --git a/src/TestEndpoint.cpp b/src/TestEndpoint.cpp
index f921bb8..b6717f1 100644
--- a/src/TestEndpoint.cpp
+++ b/src/TestEndpoint.cpp
@@ -185,7 +185,7 @@ public:
         mEndpointManager->log(mId, __FUNCTION__);
     }
 
-    void progress(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& response, const Ice::Current&)
+    void progress(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&, const Ice::Current&)
     {
         mEndpointManager->log(mId, __FUNCTION__);
     }
@@ -207,7 +207,7 @@ public:
         mEndpointManager->log(mId, __FUNCTION__);
     }
 
-    void stop(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& response, const Ice::Current&)
+    void stop(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&, const Ice::Current&)
     {
         mEndpointManager->log(mId, __FUNCTION__);
     }
@@ -308,7 +308,7 @@ public:
 
     AsteriskSCF::SessionCommunications::V1::SessionPrx createSession(
         const std::string& destination,
-            const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
+            const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx&,
             const Ice::Current& current)
     {
         InternalSessionInfo info;
@@ -323,7 +323,7 @@ public:
         return info.session;
     }
 
-    AsteriskSCF::SessionCommunications::V1::SessionSeq getSessions(const Ice::Current& current)
+    AsteriskSCF::SessionCommunications::V1::SessionSeq getSessions(const Ice::Current&)
     {
         boost::shared_lock<boost::shared_mutex> lock(mMutex);
         AsteriskSCF::SessionCommunications::V1::SessionSeq result;
@@ -530,7 +530,7 @@ public:
         adapter->add(mCommands, adapter->getCommunicator()->stringToIdentity(mManagerId + ".Commands"));
     }
 
-    AsteriskSCF::Core::Endpoint::V1::EndpointSeq lookup(const std::string& destination, const Ice::Current&)
+    AsteriskSCF::Core::Endpoint::V1::EndpointSeq lookup(const std::string&, const Ice::Current&)
     {
         AsteriskSCF::Core::Endpoint::V1::EndpointSeq result;
         result.push_back(mEndpointProxy);

commit 396cbc558718ce9f6abd2c47e89a9b1b55ed2083
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Tue Apr 12 16:34:14 2011 -0500

    Resolve a variable shadowing warning.

diff --git a/src/TestEndpoint.cpp b/src/TestEndpoint.cpp
index 830bdbf..f921bb8 100644
--- a/src/TestEndpoint.cpp
+++ b/src/TestEndpoint.cpp
@@ -422,13 +422,13 @@ public:
         std::cerr << "Unknown id" << std::endl;
     }
 
-    void getlog(const std::string& id, std::vector<std::string>& log)
+    void getlog(const std::string& id, std::vector<std::string>& result)
     {
         boost::unique_lock<boost::shared_mutex> lock(mMutex);
         SessionMap::iterator i = mSessions.find(id);
         if(i != mSessions.end())
         {
-            log = i->second.log;
+            result = i->second.log;
             return;
         }
         std::cerr << "Unknown id" << std::endl;

commit 8c2c50a7406cacfb529a3e510e953f960035778b
Author: Joshua Colp <jcolp at digium.com>
Date:   Thu Apr 7 11:19:52 2011 -0300

    Finish migration to new indicate support.

diff --git a/src/TestEndpoint.cpp b/src/TestEndpoint.cpp
index 5c84d69..5e6569c 100644
--- a/src/TestEndpoint.cpp
+++ b/src/TestEndpoint.cpp
@@ -73,37 +73,41 @@ public:
     //
     void connected()
     {
-        mPublisher->connected(mSession);
+	mPublisher->indicated(mSession, new AsteriskSCF::SessionCommunications::V1::ConnectedIndication());
     }
 
     void flashed()
     {
-        mPublisher->flashed(mSession);
+	mPublisher->indicated(mSession, new AsteriskSCF::SessionCommunications::V1::FlashedIndication());
     }
 
     void held()
     {
-        mPublisher->held(mSession);
+	mPublisher->indicated(mSession, new AsteriskSCF::SessionCommunications::V1::HeldIndication());
     }
 
     void progressing(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& response)
     {
-        mPublisher->progressing(mSession, response);
+	AsteriskSCF::SessionCommunications::V1::ProgressingIndicationPtr progressing(new AsteriskSCF::SessionCommunications::V1::ProgressingIndication());
+        progressing->response = response;
+        mPublisher->indicated(mSession, progressing);
     }
 
     void ringing()
     {
-        mPublisher->ringing(mSession);
+	mPublisher->indicated(mSession, new AsteriskSCF::SessionCommunications::V1::RingingIndication());
     }
 
     void stopped(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& response)
     {
-        mPublisher->stopped(mSession, response);
+	AsteriskSCF::SessionCommunications::V1::StoppedIndicationPtr stopped(new AsteriskSCF::SessionCommunications::V1::StoppedIndication());
+	stopped->response = response;
+	mPublisher->indicated(mSession, stopped);
     }
 
     void unheld()
     {
-        mPublisher->unheld(mSession);
+	mPublisher->indicated(mSession, new AsteriskSCF::SessionCommunications::V1::UnheldIndication());
     }
 
     void setProxy(const AsteriskSCF::SessionCommunications::V1::SessionPrx& prx)

commit 9f163f823e256bd86b841d924997983b14b840b0
Author: Joshua Colp <jcolp at digium.com>
Date:   Thu Apr 7 10:21:51 2011 -0300

    Add new indicate support.

diff --git a/src/TestEndpoint.cpp b/src/TestEndpoint.cpp
index 830bdbf..5c84d69 100644
--- a/src/TestEndpoint.cpp
+++ b/src/TestEndpoint.cpp
@@ -145,6 +145,11 @@ public:
         return mInfo;
     }
 
+    void indicate(const AsteriskSCF::SessionCommunications::V1::IndicationPtr&, const Ice::Current&)
+    {
+	mEndpointManager->log(mId, __FUNCTION__);
+    }
+
     void connect(const Ice::Current&)
     {
         mEndpointManager->log(mId, __FUNCTION__);

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


-- 
asterisk-scf/integration/test_channel.git



More information about the asterisk-scf-commits mailing list