[asterisk-scf-commits] asterisk-scf/integration/test_channel.git branch "mediasessioncookies" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Sun Aug 28 20:51:35 CDT 2011


branch "mediasessioncookies" has been created
        at  23b52c646ef3a2c5ab9b3c56f47d52983ca04c7f (commit)

- Log -----------------------------------------------------------------
commit 23b52c646ef3a2c5ab9b3c56f47d52983ca04c7f
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Sun Aug 28 20:50:47 2011 -0500

    Support API changes 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 34678c7..fabc4a1 100644
--- a/src/TestEndpoint.cpp
+++ b/src/TestEndpoint.cpp
@@ -351,14 +351,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 41c05e52c9d7d0e08fcd919081e5fd77f8c9aabe
Merge: dc4a1ea c10e013
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Aug 18 12:37:09 2011 -0500

    Merge branch 'master' of git.asterisk.org:asterisk-scf/release/test_channel


commit dc4a1ea624446fdc72a9509969d9a5df223423a5
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Aug 18 12:36:50 2011 -0500

    Accommodate changes in oneshot-hooks changes.

diff --git a/src/TestEndpoint.cpp b/src/TestEndpoint.cpp
index d9a6fac..63cb53e 100644
--- a/src/TestEndpoint.cpp
+++ b/src/TestEndpoint.cpp
@@ -395,8 +395,9 @@ public:
     }
 
     AsteriskSCF::SessionCommunications::V1::SessionPrx createSession(
-        const std::string& destination,
+            const std::string& destination,
             const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx&,
+            const AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookPrx&,
             const Ice::Current& current)
     {
         InternalSessionInfo info;

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


-- 
asterisk-scf/integration/test_channel.git



More information about the asterisk-scf-commits mailing list