[asterisk-scf-commits] asterisk-scf/integration/test_channel.git branch "sessionparty" created.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Tue Aug 23 19:08:26 CDT 2011
branch "sessionparty" has been created
at 98c0cc2297ce853e7cfd9c2149406b560216fb78 (commit)
- Log -----------------------------------------------------------------
commit 98c0cc2297ce853e7cfd9c2149406b560216fb78
Author: Ken Hunt <ken.hunt at digium.com>
Date: Tue Aug 23 19:08:26 2011 -0500
Updates for changes to Session API.
diff --git a/src/TestEndpoint.cpp b/src/TestEndpoint.cpp
index b878150..b606c2c 100644
--- a/src/TestEndpoint.cpp
+++ b/src/TestEndpoint.cpp
@@ -35,6 +35,7 @@
using namespace AsteriskSCF::TestUtil;
using namespace AsteriskSCF::SessionCommunications::V1;
+using namespace AsteriskSCF::SessionCommunications::PartyIdentification::V1;
namespace
{
@@ -146,6 +147,31 @@ public:
{
mInfo = new AsteriskSCF::SessionCommunications::V1::SessionInfo;
mInfo->currentState = "ready";
+
+ NamePtr name = new Name("bar");
+ NumberPtr number = new Number("100");
+ IdPtr testId = new Id(name, number);
+ IdSeq idSeq;
+ idSeq.push_back(testId);
+ mCaller = new Caller(idSeq);
+
+ mSessionOwnerId = new SessionOwnerId(idSeq);
+
+ NamePtr dialedName = new Name("foo");
+ NumberPtr dialedNumber = new Number("104");
+ IdPtr dialedId = new Id(dialedName, dialedNumber);
+ IdSeq dialedSeq;
+ dialedSeq.push_back(dialedId);
+ mDialed = new Dialed(dialedNumber);
+
+ NamePtr redirName = new Name("scud");
+ NumberPtr redirNumber = new Number("666");
+ IdPtr connectedId = new Id(redirName, redirNumber);
+ IdSeq idSeq2;
+ idSeq2.push_back(connectedId);
+ mConnectedLine = new ConnectedLine(idSeq2);
+
+ mRedirecting = new Redirecting(dialedId, connectedId, 1);
}
void addListener_async(
@@ -366,6 +392,31 @@ public:
mListeners->setProxy(prx);
}
+ void getCaller_async(const AMD_Session_getCallerPtr& cb, const Ice::Current&)
+ {
+ cb->ice_response(mCaller);
+ }
+
+ void getDialed_async(const AMD_Session_getDialedPtr& cb, const Ice::Current&)
+ {
+ cb->ice_response(mDialed);
+ }
+
+ void getSessionOwnerId_async(const AMD_Session_getSessionOwnerIdPtr& cb, const ::Ice::Current&)
+ {
+ cb->ice_response(mSessionOwnerId);
+ }
+
+ void getConnectedLine_async(const AMD_Session_getConnectedLinePtr& cb, const ::Ice::Current&)
+ {
+ cb->ice_response(mConnectedLine);
+ }
+
+ void getRedirecting_async(const AMD_Session_getRedirectingPtr& cb, const Ice::Current& )
+ {
+ cb->ice_response(mRedirecting);
+ }
+
private:
boost::shared_mutex mMutex;
InternalManagerPtr mEndpointManager;
@@ -376,6 +427,11 @@ private:
AsteriskSCF::Media::V1::SessionPrx mMediaSession;
SessionListenerMgrPtr mListeners;
AsteriskSCF::SessionCommunications::V1::BridgePrx mCurrentBridge;
+ SessionOwnerIdPtr mSessionOwnerId;
+ CallerPtr mCaller;
+ DialedPtr mDialed;
+ ConnectedLinePtr mConnectedLine;
+ RedirectingPtr mRedirecting;
};
typedef IceUtil::Handle<SessionI> SessionIPtr;
commit c10e0132756cfa7a1bb57b7fdd11fcc2ac4e8636
Author: Ken Hunt <ken.hunt at digium.com>
Date: Thu Aug 11 17:07:53 2011 -0500
Updated for changes to collection templates in ice-util-cpp.
diff --git a/src/TestEndpoint.cpp b/src/TestEndpoint.cpp
index d9a6fac..b878150 100644
--- a/src/TestEndpoint.cpp
+++ b/src/TestEndpoint.cpp
@@ -26,7 +26,7 @@
#include <boost/thread/shared_mutex.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
-#include <AsteriskSCF/Collections/Set.h>
+#include <AsteriskSCF/Collections/ProxySet.h>
#include "Logger.h"
#include "MediaSession.h"
commit 9f6f85e248640c82ba463b104978979bbe920f0e
Author: Ken Hunt <ken.hunt at digium.com>
Date: Wed Aug 10 20:14:27 2011 -0500
gcc hates unused, named parameters.
diff --git a/src/TestEndpoint.cpp b/src/TestEndpoint.cpp
index 853d729..d9a6fac 100644
--- a/src/TestEndpoint.cpp
+++ b/src/TestEndpoint.cpp
@@ -534,7 +534,7 @@ public:
std::cerr << "Unknown id" << std::endl;
}
- void addDefaultSessionListener(const SessionListenerPrx& listener, const Ice::Current& current)
+ void addDefaultSessionListener(const SessionListenerPrx& listener, const Ice::Current& )
{
mDefaultListeners.add(listener);
}
@@ -544,12 +544,12 @@ public:
mDefaultListeners.remove(listener);
}
- void addDefaultSessionCookies(const SessionCookies& cookies,
+ void addDefaultSessionCookies(const SessionCookies&,
const Ice::Current&)
{
}
- void removeDefaultSessionCookies(const SessionCookies& cookies,
+ void removeDefaultSessionCookies(const SessionCookies&,
const Ice::Current&)
{
}
commit 26d9a3f52384f6c5a7dfe1164bd7d276af54ba9e
Author: Ken Hunt <ken.hunt at digium.com>
Date: Wed Aug 10 19:17:45 2011 -0500
Updates for changes to the SessionEndpoint API.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5ffa22a..e7ceaf0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,3 +1,6 @@
+include_directories(${astscf-ice-util-cpp_dir}/include)
+include_directories(${logger_dir}/include)
+
astscf_slice_include_collection(TEST_CHANNEL)
astscf_component_init(test_channel)
@@ -10,6 +13,7 @@ astscf_component_add_ice_libraries(test_channel IceStorm)
astscf_component_add_boost_libraries(test_channel thread date_time)
astscf_component_add_slice_collection_libraries(test_channel ASTSCF TEST_CHANNEL)
astscf_component_build_icebox(test_channel)
+target_link_libraries(test_channel logging-client)
astscf_component_install(test_channel)
astscf_component_init(console_driver)
diff --git a/src/TestEndpoint.cpp b/src/TestEndpoint.cpp
index ab8d4e6..853d729 100644
--- a/src/TestEndpoint.cpp
+++ b/src/TestEndpoint.cpp
@@ -26,12 +26,15 @@
#include <boost/thread/shared_mutex.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
+#include <AsteriskSCF/Collections/Set.h>
+
#include "Logger.h"
#include "MediaSession.h"
#include <AsteriskSCF/TestChannel/CommandsIf.h>
using namespace AsteriskSCF::TestUtil;
+using namespace AsteriskSCF::SessionCommunications::V1;
namespace
{
@@ -386,7 +389,8 @@ public:
EndpointManager(const Ice::ObjectAdapterPtr& adapter, const std::string& id) :
mAdapter(adapter),
- mId(id)
+ mId(id),
+ mDefaultListeners(adapter, "Default Session Listeners")
{
}
@@ -530,6 +534,26 @@ public:
std::cerr << "Unknown id" << std::endl;
}
+ void addDefaultSessionListener(const SessionListenerPrx& listener, const Ice::Current& current)
+ {
+ mDefaultListeners.add(listener);
+ }
+
+ void removeDefaultSessionListener(const SessionListenerPrx& listener, const Ice::Current&)
+ {
+ mDefaultListeners.remove(listener);
+ }
+
+ void addDefaultSessionCookies(const SessionCookies& cookies,
+ const Ice::Current&)
+ {
+ }
+
+ void removeDefaultSessionCookies(const SessionCookies& cookies,
+ const Ice::Current&)
+ {
+ }
+
private:
struct InternalSessionInfo
@@ -546,6 +570,7 @@ private:
AsteriskSCF::TestUtil::Logger mLogger;
Ice::ObjectAdapterPtr mAdapter;
std::string mId;
+ AsteriskSCF::Collections::ProxySet<SessionListenerPrx> mDefaultListeners;
};
class CommandImpl : public AsteriskSCF::TestChannel::V1::Commands
commit ed418af28b5f5fc9fc396b717ead9400d75d8f0a
Merge: 5482a35 36d3b0b
Author: Ken Hunt <ken.hunt at digium.com>
Date: Fri Aug 5 01:58:06 2011 -0500
Merge branch 'basecomponent'
commit 5482a35149744286c21d0ff743a9fe4fbb75cb2d
Author: Joshua Colp <jcolp at digium.com>
Date: Mon Aug 1 15:29:59 2011 -0300
Add support for SessionController and streams.
diff --git a/src/TestEndpoint.cpp b/src/TestEndpoint.cpp
index cf07e45..ab8d4e6 100644
--- a/src/TestEndpoint.cpp
+++ b/src/TestEndpoint.cpp
@@ -297,6 +297,24 @@ public:
cb->ice_response();
}
+ void getStreams_async(const AsteriskSCF::SessionCommunications::V1::AMD_Session_getStreamsPtr& cb,
+ const Ice::Current&)
+ {
+ cb->ice_response(AsteriskSCF::Media::V1::StreamInformationDict());
+ }
+
+ void setAndGetSessionController_async(const AsteriskSCF::SessionCommunications::V1::AMD_Session_setAndGetSessionControllerPtr& cb,
+ const AsteriskSCF::SessionCommunications::V1::SessionControllerPrx&, const Ice::Current&)
+ {
+ cb->ice_response(0);
+ }
+
+ void removeSessionController_async(const AsteriskSCF::SessionCommunications::V1::AMD_Session_removeSessionControllerPtr& cb,
+ const AsteriskSCF::SessionCommunications::V1::SessionControllerPrx&, const Ice::Current&)
+ {
+ cb->ice_response();
+ }
+
void echo()
{
mMediaServant->echo();
commit 36d3b0bfc94febba48958c38a70ad11c7ba54793
Author: Ken Hunt <ken.hunt at digium.com>
Date: Tue Jul 19 17:07:39 2011 -0500
Consitency in config parameters.
diff --git a/config/test_channel.conf b/config/test_channel.conf
index bead0c4..a87c7c6 100644
--- a/config/test_channel.conf
+++ b/config/test_channel.conf
@@ -14,7 +14,7 @@ LocatorService.Proxy=LocatorService:default -p 55558
ServiceLocatorManagementAdapter.Endpoints=tcp -p 55557
ServiceLocatorAdapter.Endpoints=tcp -p 55558
-ServiceLocatorManagementProxy=LocatorServiceManagement:tcp -p 55557
+LocatorServiceManagement.Proxy=LocatorServiceManagement:tcp -p 55557
TopicManager.Proxy=AsteriskSCFIceStorm/TopicManager:default -p 55555
diff --git a/src/Service.cpp b/src/Service.cpp
index 7d6169a..abd9051 100644
--- a/src/Service.cpp
+++ b/src/Service.cpp
@@ -91,7 +91,7 @@ void TestChannelDriver::start(const std::string& name, const Ice::CommunicatorPt
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::checkedCast(communicator->propertyToProxy("LocatorServiceManagement.Proxy"));
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";
commit 98f341019000a0985dc88bb8aee3ffa82eff40e1
Author: Joshua Colp <jcolp at digium.com>
Date: Sun Jul 10 11:49:27 2011 -0300
Merge revised media design implementation.
diff --git a/src/MediaEchoThread.cpp b/src/MediaEchoThread.cpp
index c9eccf1..e4f355c 100644
--- a/src/MediaEchoThread.cpp
+++ b/src/MediaEchoThread.cpp
@@ -30,17 +30,22 @@ void MediaEchoThread::run()
{
mMonitor.wait();
- if(!mDone && mFrames.size() > 0 && mSink != 0)
+ if(!mDone && mFrames.size() > 0 && !mSinks.empty())
{
- try
- {
- mSink->write(mFrames);
- mFrames.clear();
- }
- catch(const Ice::Exception&)
- {
- // TODO: log and continue
- }
+ for (AsteriskSCF::Media::V1::StreamSinkSeq::const_iterator sink = mSinks.begin();
+ sink != mSinks.end();
+ ++sink)
+ {
+ try
+ {
+ (*sink)->write(mFrames);
+ }
+ catch(const Ice::Exception&)
+ {
+ // TODO: log and continue
+ }
+ }
+ mFrames.clear();
}
}
}
@@ -62,10 +67,10 @@ void MediaEchoThread::destroy()
mMonitor.notify();
}
-void MediaEchoThread::setSink(const AsteriskSCF::Media::V1::StreamSinkPrx& prx)
+void MediaEchoThread::setSinks(const AsteriskSCF::Media::V1::StreamSinkSeq& sinks)
{
IceUtil::Monitor<IceUtil::Mutex>::Lock lock(mMonitor);
- mSink = prx;
+ mSinks = sinks;
if(!mPaused)
{
mMonitor.notify();
diff --git a/src/MediaEchoThread.h b/src/MediaEchoThread.h
index e6d0ea5..7badc8f 100644
--- a/src/MediaEchoThread.h
+++ b/src/MediaEchoThread.h
@@ -25,7 +25,7 @@ public:
void run();
void pushFrames(const AsteriskSCF::Media::V1::FrameSeq& newFrames);
void destroy();
- void setSink(const AsteriskSCF::Media::V1::StreamSinkPrx& prx);
+ void setSinks(const AsteriskSCF::Media::V1::StreamSinkSeq& sinks);
//
// Use when paused... causes the loop to run once.
@@ -35,7 +35,7 @@ public:
void resume();
private:
- AsteriskSCF::Media::V1::StreamSinkPrx mSink;
+ AsteriskSCF::Media::V1::StreamSinkSeq mSinks;
IceUtil::Monitor<IceUtil::Mutex> mMonitor;
AsteriskSCF::Media::V1::FrameSeq mFrames;
bool mDone;
diff --git a/src/MediaSession.h b/src/MediaSession.h
index 511cc22..3978944 100644
--- a/src/MediaSession.h
+++ b/src/MediaSession.h
@@ -69,9 +69,9 @@ public:
// XXX
}
- void setRelaySink(const AsteriskSCF::Media::V1::StreamSinkPrx& sink)
+ void setRelaySinks(const AsteriskSCF::Media::V1::StreamSinkSeq& sinks)
{
- mThread->setSink(sink);
+ mThread->setSinks(sinks);
}
void echo()
@@ -110,15 +110,22 @@ public:
{
}
- void setSink(const AsteriskSCF::Media::V1::StreamSinkPrx& sink, const Ice::Current&)
+ void addSink(const AsteriskSCF::Media::V1::StreamSinkPrx& sink, const Ice::Current&)
{
- mSink = sink;
- mSinkServant->setRelaySink(mSink);
+ mSinks.push_back(sink);
+ mSinkServant->setRelaySinks(mSinks);
}
- AsteriskSCF::Media::V1::StreamSinkPrx getSink(const Ice::Current&)
+ void removeSink(const AsteriskSCF::Media::V1::StreamSinkPrx& sink, const Ice::Current&)
{
- return mSink;
+ mSinks.erase(std::remove(mSinks.begin(), mSinks.end(),
+ sink), mSinks.end());
+ mSinkServant->setRelaySinks(mSinks);
+ }
+
+ AsteriskSCF::Media::V1::StreamSinkSeq getSinks(const Ice::Current&)
+ {
+ return mSinks;
}
AsteriskSCF::Media::V1::FormatSeq getFormats(const Ice::Current&)
@@ -137,7 +144,7 @@ public:
}
private:
- AsteriskSCF::Media::V1::StreamSinkPrx mSink;
+ AsteriskSCF::Media::V1::StreamSinkSeq mSinks;
AsteriskSCF::Media::V1::FormatSeq mFormats;
std::string mId;
SinkIPtr mSinkServant;
-----------------------------------------------------------------------
--
asterisk-scf/integration/test_channel.git
More information about the asterisk-scf-commits
mailing list