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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Sun Oct 2 17:59:32 CDT 2011


branch "master" has been updated
       via  7e39c4fff270f6e75b63c6a4c016de99e2ba1673 (commit)
      from  a6641628f49f2554a7663c7d807dc4680f79519d (commit)

Summary of changes:
 src/RTPTelephonyEventSource.cpp |   33 ++++++++++++++++++++++++++++-----
 src/RTPTelephonyEventSource.h   |   11 ++++++++---
 2 files changed, 36 insertions(+), 8 deletions(-)


- Log -----------------------------------------------------------------
commit 7e39c4fff270f6e75b63c6a4c016de99e2ba1673
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Sun Oct 2 17:57:10 2011 -0500

    Adapt to API changes. The telephone addSink() operation is now addSinks(), and added support for new removeSinks() operation.

diff --git a/src/RTPTelephonyEventSource.cpp b/src/RTPTelephonyEventSource.cpp
index 5024232..9189150 100644
--- a/src/RTPTelephonyEventSource.cpp
+++ b/src/RTPTelephonyEventSource.cpp
@@ -45,15 +45,19 @@ RTPTelephonyEventSource::~RTPTelephonyEventSource()
 {
 }
 
-void RTPTelephonyEventSource::addSink_async(
-        const AMD_TelephonyEventSource_addSinkPtr& cb,
-        const TelephonyEventSinkPrx& sink,
+void RTPTelephonyEventSource::addSinks_async(
+        const AMD_TelephonyEventSource_addSinksPtr& cb,
+        const TelephonyEventSinkSeq& sinks,
         const Ice::Current&)
 {
     boost::unique_lock<boost::shared_mutex> lock(mLock);
-    if (std::find(mStateItem->sinks.begin(), mStateItem->sinks.end(), sink) == mStateItem->sinks.end())
+
+    for (TelephonyEventSinkSeq::const_iterator i; i != sinks.end(); ++i)
     {
-        mStateItem->sinks.push_back(sink);
+        if (std::find(mStateItem->sinks.begin(), mStateItem->sinks.end(), *i) == mStateItem->sinks.end())
+        {
+            mStateItem->sinks.push_back(*i);
+        }
     }
     mSessionAdapter->replicateState(mStateItem);
     cb->ice_response();
@@ -67,6 +71,25 @@ void RTPTelephonyEventSource::getSinks_async(
     cb->ice_response(mStateItem->sinks);
 }
 
+void RTPTelephonyEventSource::removeSinks_async(
+        const AMD_TelephonyEventSource_removeSinksPtr& cb,
+        const TelephonyEventSinkSeq& sinks,
+        const Ice::Current&)
+{
+    boost::unique_lock<boost::shared_mutex> lock(mLock);
+
+    for (TelephonyEventSinkSeq::const_iterator i; i != sinks.end(); ++i)
+    {
+        TelephonyEventSinkSeq::iterator found = std::find(mStateItem->sinks.begin(), mStateItem->sinks.end(), *i);
+        if (found != mStateItem->sinks.end())
+        {
+            mStateItem->sinks.erase(found);
+        }
+    }
+    mSessionAdapter->replicateState(mStateItem);
+    cb->ice_response();
+}
+
 void RTPTelephonyEventSource::read(const pjmedia_rtp_hdr* header, const Ice::Byte* payload)
 {
     //Even though this structure has "dtmf" in its name, it is used for
diff --git a/src/RTPTelephonyEventSource.h b/src/RTPTelephonyEventSource.h
index cb315a6..df88222 100644
--- a/src/RTPTelephonyEventSource.h
+++ b/src/RTPTelephonyEventSource.h
@@ -38,15 +38,20 @@ public:
     /**
      * Overrides of TelephonyEventSource interface
      */
-    void addSink_async(
-            const AsteriskSCF::SessionCommunications::V1::AMD_TelephonyEventSource_addSinkPtr& cb,
-            const AsteriskSCF::SessionCommunications::V1::TelephonyEventSinkPrx& sink,
+    void addSinks_async(
+            const AsteriskSCF::SessionCommunications::V1::AMD_TelephonyEventSource_addSinksPtr& cb,
+            const AsteriskSCF::SessionCommunications::V1::TelephonyEventSinkSeq& sinks,
             const Ice::Current&);
 
     void getSinks_async(
             const AsteriskSCF::SessionCommunications::V1::AMD_TelephonyEventSource_getSinksPtr& cb,
             const Ice::Current&);
 
+    void removeSinks_async(
+            const AsteriskSCF::SessionCommunications::V1::AMD_TelephonyEventSource_removeSinksPtr& cb,
+            const AsteriskSCF::SessionCommunications::V1::TelephonyEventSinkSeq& sinks,
+            const Ice::Current&);
+
     /**
      * Used to read a new RFC 4733 event in.
      */

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


-- 
asterisk-scf/release/media_rtp_pjmedia.git



More information about the asterisk-scf-commits mailing list