[asterisk-scf-commits] asterisk-scf/integration/bridging.git branch "replacement" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Aug 29 14:13:11 CDT 2011


branch "replacement" has been updated
       via  5bf2f056642763f935850aa371f437f3608b90a1 (commit)
      from  44588bb71cc75ad4b1e9f3292f34cf60b22c743f (commit)

Summary of changes:
 src/BridgeImpl.cpp |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)


- Log -----------------------------------------------------------------
commit 5bf2f056642763f935850aa371f437f3608b90a1
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Aug 29 14:13:45 2011 -0500

    Undo changes to replaceSession().
    
    With the previous changes, the replaceSession() operation is really no different than
    addSession(). Now, if sessions are to be added, then the caller must decide whether to
    add or replace.

diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index 03d4b97..6b720b6 100755
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -804,6 +804,20 @@ void BridgeImpl::replaceSession_async(const AMD_Bridge_replaceSessionPtr& callba
             throw SessionNotFound(sessionToReplace);
         }
 
+        //
+        // Shutdown is inheritently asynchronous (see SessionWrapper::shutdown())
+        //
+        SessionsTrackerPtr removeTracker(new SessionsTracker);
+        removeTracker->add(session->getSession());
+        session->shutdown(mSessionListenerPrx, new ResponseCode);
+
+        //
+        // Since the shutdown of the session is inherently asynchronous, the
+        // rest of this is going to happen anyways, so lets remove it from the
+        // list of known sessions now so it doesn't get in the way.
+        //
+        mSessions->removeSession(session->getBridgedSession());
+
         SessionsTrackerPtr tracker(new SessionsTracker);
         QueuedTasks tasks;
         BridgeCookies cookies;
@@ -811,6 +825,7 @@ void BridgeImpl::replaceSession_async(const AMD_Bridge_replaceSessionPtr& callba
             boost::shared_lock<boost::shared_mutex> lock(mLock);
             cookies = getCookies();
         }
+        tasks.push_back(new RemoveSessionsNotify(mListeners, removeTracker, cookies));
         tasks.push_back(new SetBridgeTask(mSessions, mPrx, mSessionListenerPrx, newSessions, tracker));
         tasks.push_back(new AddToListeners(mListeners, tracker, cookies));
         tasks.push_back(new GenericAMDCallback<AMD_Bridge_replaceSessionPtr>(callback, tracker));

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


-- 
asterisk-scf/integration/bridging.git



More information about the asterisk-scf-commits mailing list