[asterisk-scf-commits] asterisk-scf/release/test_channel.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Sun Sep 11 22:54:25 CDT 2011


branch "master" has been updated
       via  05591f45bebec4954321dc2aa571574d7a9713ad (commit)
      from  3db0eb32fd1cdac9e8f88c33b6cf109d9746044b (commit)

Summary of changes:
 src/CMakeLists.txt   |    5 ++++
 src/MediaSession.cpp |   53 ++++++++++++++++++++++++++++++++++++++++++++++++++
 src/MediaSession.h   |    9 ++++++++
 src/TestEndpoint.cpp |   11 ++++-----
 4 files changed, 72 insertions(+), 6 deletions(-)


- Log -----------------------------------------------------------------
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)

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


-- 
asterisk-scf/release/test_channel.git



More information about the asterisk-scf-commits mailing list