[asterisk-scf-commits] asterisk-scf/integration/test_channel.git branch "partyidhook" created.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Thu Sep 29 17:46:29 CDT 2011
branch "partyidhook" has been created
at b9c0239cd4e69949ba4a8a6c93cc199a9856edbd (commit)
- Log -----------------------------------------------------------------
commit b9c0239cd4e69949ba4a8a6c93cc199a9856edbd
Author: Ken Hunt <ken.hunt at digium.com>
Date: Thu Sep 29 17:37:19 2011 -0500
Incorporate review feedback.
diff --git a/src/TestEndpoint.cpp b/src/TestEndpoint.cpp
index 1dec56f..18fd07c 100644
--- a/src/TestEndpoint.cpp
+++ b/src/TestEndpoint.cpp
@@ -171,7 +171,10 @@ public:
idSeq2.push_back(connectedId);
mConnectedLine = new ConnectedLine(idSeq2);
- mRedirecting = new Redirecting(dialedId, connectedId, 1);
+ RedirectionSeq redirects;
+ RedirectionPtr redirect = new Redirection(dialedId, connectedId);
+ redirects.push_back(redirect);
+ mRedirections = new Redirections(redirects);
}
void addListener_async(
@@ -411,9 +414,9 @@ public:
cb->ice_response(mConnectedLine);
}
- void getRedirecting_async(const AMD_Session_getRedirectingPtr& cb, const Ice::Current& )
+ void getRedirections_async(const AMD_Session_getRedirectionsPtr& cb, const Ice::Current& )
{
- cb->ice_response(mRedirecting);
+ cb->ice_response(mRedirections);
}
private:
@@ -430,7 +433,7 @@ private:
CallerPtr mCaller;
DialedPtr mDialed;
ConnectedLinePtr mConnectedLine;
- RedirectingPtr mRedirecting;
+ RedirectionsPtr mRedirections;
};
typedef IceUtil::Handle<SessionI> SessionIPtr;
commit 05591f45bebec4954321dc2aa571574d7a9713ad
Author: Ken Hunt <ken.hunt at digium.com>
Date: Sun Sep 11 22:53:49 2011 -0500
Support changes to API made for Media Session cookies.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e7ceaf0..d0b4800 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -6,9 +6,14 @@ astscf_slice_include_collection(TEST_CHANNEL)
astscf_component_init(test_channel)
astscf_component_add_files(test_channel Service.cpp)
astscf_component_add_files(test_channel MediaEchoThread.cpp)
+astscf_component_add_files(test_channel MediaEchoThread.h)
astscf_component_add_files(test_channel MediaSession.cpp)
+astscf_component_add_files(test_channel MediaSession.h)
astscf_component_add_files(test_channel TestEndpoint.cpp)
astscf_component_add_files(test_channel TestEndpoint.h)
+astscf_component_add_files(test_channel Logger.h)
+astscf_component_add_files(test_channel ListenerManager.h)
+astscf_component_add_files(test_channel InternalExceptions.h)
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)
diff --git a/src/MediaSession.cpp b/src/MediaSession.cpp
index b9e3d3d..a245f68 100644
--- a/src/MediaSession.cpp
+++ b/src/MediaSession.cpp
@@ -77,3 +77,56 @@ void MediaSessionI::echo()
{
mSink->echo();
}
+
+/**
+ * Implementation of the corresponding API call.
+ */
+void MediaSessionI::setCookies(const AsteriskSCF::Media::V1::SessionCookies& cookies,
+ const Ice::Current&)
+{
+ for (AsteriskSCF::Media::V1::SessionCookies::const_iterator i = cookies.begin();
+ i != cookies.end(); ++i)
+ {
+ mCookies[(*i)->ice_id()] = (*i);
+ }
+}
+
+/**
+ * Implementation of the corresponding API call.
+ */
+void MediaSessionI::getCookies_async(
+ const AsteriskSCF::Media::V1::AMD_Session_getCookiesPtr& cb,
+ const AsteriskSCF::Media::V1::SessionCookies& cookiesToGet,
+ const Ice::Current&)
+{
+ AsteriskSCF::Media::V1::SessionCookies results;
+
+ for (AsteriskSCF::Media::V1::SessionCookies::const_iterator i = cookiesToGet.begin();
+ i != cookiesToGet.end();
+ ++i)
+ {
+ AsteriskSCF::Media::V1::SessionCookieDict::const_iterator cookie = mCookies.find((*i)->ice_id());
+
+ if (cookie == mCookies.end())
+ {
+ continue;
+ }
+
+ results.push_back(cookie->second);
+ }
+
+ cb->ice_response(results);
+}
+
+/**
+ * Implementation of the corresponding API call.
+ */
+void MediaSessionI::removeCookies(const AsteriskSCF::Media::V1::SessionCookies& cookies,
+ const Ice::Current&)
+{
+ for (AsteriskSCF::Media::V1::SessionCookies::const_iterator i = cookies.begin();
+ i != cookies.end(); ++i)
+ {
+ mCookies.erase((*i)->ice_id());
+ }
+}
diff --git a/src/MediaSession.h b/src/MediaSession.h
index 3978944..d33a65b 100644
--- a/src/MediaSession.h
+++ b/src/MediaSession.h
@@ -161,6 +161,14 @@ public:
AsteriskSCF::Media::V1::StreamSourceSeq getSources(const Ice::Current&);
AsteriskSCF::Media::V1::StreamSinkSeq getSinks(const Ice::Current&);
std::string getId(const Ice::Current&);
+ void setCookies(const AsteriskSCF::Media::V1::SessionCookies& cookies,
+ const Ice::Current&);
+ void getCookies_async(
+ const AsteriskSCF::Media::V1::AMD_Session_getCookiesPtr& cb,
+ const AsteriskSCF::Media::V1::SessionCookies& cookiesToGet,
+ const Ice::Current&);
+ void removeCookies(const AsteriskSCF::Media::V1::SessionCookies& cookies,
+ const Ice::Current&);
//
// internal test methods.
@@ -179,6 +187,7 @@ private:
AsteriskSCF::Media::V1::StreamSourceSeq mSources;
AsteriskSCF::Media::V1::StreamSinkSeq mSinks;
+ AsteriskSCF::Media::V1::SessionCookieDict mCookies;
};
typedef IceUtil::Handle<MediaSessionI> MediaSessionIPtr;
diff --git a/src/TestEndpoint.cpp b/src/TestEndpoint.cpp
index 8406b1c..1dec56f 100644
--- a/src/TestEndpoint.cpp
+++ b/src/TestEndpoint.cpp
@@ -377,14 +377,13 @@ public:
{
}
- AsteriskSCF::SessionCommunications::V1::SessionCookies getCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies&, const Ice::Current&)
+ void getCookies_async(
+ const AsteriskSCF::SessionCommunications::V1::AMD_Session_getCookiesPtr &cb,
+ const AsteriskSCF::SessionCommunications::V1::SessionCookies&,
+ const Ice::Current&)
{
AsteriskSCF::SessionCommunications::V1::SessionCookies cookies;
- return cookies;
- }
-
- void die()
- {
+ cb->ice_response(cookies);
}
void setProxy(const AsteriskSCF::SessionCommunications::V1::SessionPrx& prx)
commit 3db0eb32fd1cdac9e8f88c33b6cf109d9746044b
Author: Ken Hunt <ken.hunt at digium.com>
Date: Sun Sep 11 21:42:34 2011 -0500
Support changes made to API for Party Identification.
diff --git a/src/TestEndpoint.cpp b/src/TestEndpoint.cpp
index 34678c7..8406b1c 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;
-----------------------------------------------------------------------
--
asterisk-scf/integration/test_channel.git
More information about the asterisk-scf-commits
mailing list