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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed May 18 20:48:18 CDT 2011


branch "master" has been updated
       via  54bdc8b0e63f47f9d85d7807a38688bf97ef083e (commit)
      from  860c8d2ca3fff73f2044dc742970bf5cd9c33d11 (commit)

Summary of changes:
 src/MediaSplicer.cpp   |   21 +++++++++++++--------
 src/MediaSplicer.h     |    2 +-
 src/SessionWrapper.cpp |    2 +-
 src/SessionWrapper.h   |    2 +-
 4 files changed, 16 insertions(+), 11 deletions(-)


- Log -----------------------------------------------------------------
commit 54bdc8b0e63f47f9d85d7807a38688bf97ef083e
Author: Brent Eagles <beagles at digium.com>
Date:   Wed May 18 23:16:32 2011 -0230

    Remove callback on SessionWrapper in the MediaSplicer that was causing a deadlock.
    Passing in the required proxy along with the wrapper. A little awkward perhaps...
    a memento with all the required data might be more appropriate, but in this case
    all the required data == the proxy.

diff --git a/src/MediaSplicer.cpp b/src/MediaSplicer.cpp
index 154027e..de7b7c8 100755
--- a/src/MediaSplicer.cpp
+++ b/src/MediaSplicer.cpp
@@ -62,6 +62,7 @@ typedef vector<IncomingPairing> IncomingPairings;
 // 
 struct MediaConnectorBuilder : public IceUtil::Shared
 {
+    AsteriskSCF::SessionCommunications::V1::SessionPrx sessionPrx;
     AsteriskSCF::Media::V1::SessionPrx mediaSession;
     AsteriskSCF::Media::V1::StreamSourceSeq sources;
     AsteriskSCF::Media::V1::StreamSinkSeq sinks;
@@ -425,8 +426,9 @@ private:
     Logger mLogger;
 };
 
-QueuedTasks createMediaConnectTasks(const SessionWrapperPtr& session,
-        const MediaConnectorIPtr& peer, const MediaSplicerIPtr& splicer);
+QueuedTasks createMediaConnectTasks(const SessionWrapperPtr& session, 
+    const AsteriskSCF::SessionCommunications::V1::SessionPrx& sessionPrx,
+    const MediaConnectorIPtr& peer, const MediaSplicerIPtr& splicer);
 //
 // TODO: This needs to register the streams with an active threaded mixing element.
 //
@@ -461,7 +463,7 @@ public:
     // Called through the external MediaSplicer interface, this initiates a series of operations to establish the media
     // interconnections so a session can communicate on the bridge.
     //
-    void connect(const SessionWrapperPtr& session)
+    void connect(const SessionWrapperPtr& session, const AsteriskSCF::SessionCommunications::V1::SessionPrx& sessionPrx)
     {
         boost::unique_lock<boost::shared_mutex> lock(mLock);
         //
@@ -494,7 +496,7 @@ public:
         // We do not bother tracking the executor for now. A tidy shutdown would probably want to clean this up.
         // An alternative is to pass back the queued tasks to the caller and let them start and stop the process.
         //
-        ExecutorPtr taskExecutor(new Executor(createMediaConnectTasks(session, existing, this), mLogger));
+        ExecutorPtr taskExecutor(new Executor(createMediaConnectTasks(session, sessionPrx, existing, this), mLogger));
         taskExecutor->start();
     }
 
@@ -684,7 +686,7 @@ public:
 protected:
     bool executeImpl()
     {
-        mSession->getSession()->begin_getMediaSession(
+        mMaterials->sessionPrx->begin_getMediaSession(
             AsteriskSCF::SessionCommunications::V1::newCallback_Session_getMediaSession(this,
                         &GetMediaSession::done, &GetMediaSession::failed));
         return false;
@@ -999,11 +1001,14 @@ private:
     MediaConnectorBuilderPtr mMaterials;
 };
 
-QueuedTasks createMediaConnectTasks(const SessionWrapperPtr& session, const MediaConnectorIPtr& peer, const MediaSplicerIPtr& splicer)
+QueuedTasks createMediaConnectTasks(const SessionWrapperPtr& session, 
+    const AsteriskSCF::SessionCommunications::V1::SessionPrx& sessionPrx, 
+    const MediaConnectorIPtr& peer, const MediaSplicerIPtr& splicer)
 {
     QueuedTasks tasks;
     MediaConnectorBuilderPtr materials(new MediaConnectorBuilder);
     materials->peer = peer;
+    materials->sessionPrx = sessionPrx;
     tasks.push_back(new GetMediaSession(session, materials));
     tasks.push_back(new GetSinks(materials));
     tasks.push_back(new GetSources(materials));
@@ -1024,9 +1029,9 @@ MediaSplicer::MediaSplicer(const Ice::CommunicatorPtr& comm, const std::string&
 {
 }
 
-void MediaSplicer::connect(const SessionWrapperPtr& session)
+void MediaSplicer::connect(const SessionWrapperPtr& session, const AsteriskSCF::SessionCommunications::V1::SessionPrx& sessionPrx)
 {
-    return mImpl->connect(session);
+    return mImpl->connect(session, sessionPrx);
 }
 
 MediaConnectorPtr MediaSplicer::createReplica(const SessionPairingPtr& pairings)
diff --git a/src/MediaSplicer.h b/src/MediaSplicer.h
index de4ab23..6440d34 100644
--- a/src/MediaSplicer.h
+++ b/src/MediaSplicer.h
@@ -81,7 +81,7 @@ public:
     MediaSplicer(const Ice::CommunicatorPtr& comm, const std::string& bridgeId, const ReplicatorSmartPrx& replicator,
             const AsteriskSCF::System::Logging::Logger& logger);
     
-    void connect(const SessionWrapperPtr& session);
+    void connect(const SessionWrapperPtr& session, const AsteriskSCF::SessionCommunications::V1::SessionPrx& sessionPrx);
     MediaConnectorPtr createReplica(const AsteriskSCF::Bridge::V1::SessionPairingPtr& pairings);
 
 private:
diff --git a/src/SessionWrapper.cpp b/src/SessionWrapper.cpp
index 4693d61..06e0434 100644
--- a/src/SessionWrapper.cpp
+++ b/src/SessionWrapper.cpp
@@ -399,7 +399,7 @@ void SessionWrapper::setupMedia()
         boost::unique_lock<boost::shared_mutex> lock(mLock);
         if (mSession->currentState == Added)
         {
-            mSplicer->connect(this);
+            mSplicer->connect(this, mSession->session);
             mSession->currentState = Connected;
             stateUpdate = createUpdate();
         }
diff --git a/src/SessionWrapper.h b/src/SessionWrapper.h
index d396d01..e0f507b 100644
--- a/src/SessionWrapper.h
+++ b/src/SessionWrapper.h
@@ -145,7 +145,7 @@ private:
     std::string mId;
     MediaSplicerPtr mSplicer;
     ExecutorPtr mActivities;
-    
+
     /**
      * Sends changes to the replication service. This should never occur
      * unless the host service is active.

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


-- 
asterisk-scf/release/bridging.git



More information about the asterisk-scf-commits mailing list