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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Oct 13 13:46:48 CDT 2010


branch "transfer" has been updated
       via  cddcb251e434d36849c2abf162bb78e11b0426d1 (commit)
      from  b66a5f5d150d8e632d383b06b9de9b4e772d159c (commit)

Summary of changes:
 src/BridgeImpl.cpp    |    4 ++--
 src/MediaSplicer.cpp  |    1 -
 test/TestBridging.cpp |   31 ++++++++++++++++++++++++++++++-
 test/channel_driver   |    2 +-
 4 files changed, 33 insertions(+), 5 deletions(-)


- Log -----------------------------------------------------------------
commit cddcb251e434d36849c2abf162bb78e11b0426d1
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Oct 13 16:15:51 2010 -0230

    Add some more guts to the replaceSession test and a little logging to the bridge implementation.

diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index d1da9ba..0b381a3 100644
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -564,8 +564,9 @@ void AsteriskSCF::BridgeService::BridgeImpl::removeListener(const AsteriskSCF::S
 }
 
 void AsteriskSCF::BridgeService::BridgeImpl::replaceSession(const AsteriskSCF::SessionCommunications::V1::SessionPrx& oldSession, 
-  const AsteriskSCF::SessionCommunications::V1::SessionSeq& newSessions, const Ice::Current&)
+  const AsteriskSCF::SessionCommunications::V1::SessionSeq& newSessions, const Ice::Current& current)
 {
+    lg(Debug) << __FUNCTION__ << ":" << current.adapter->getCommunicator()->identityToString(current.id) ;
     BridgeSessionPtr toRemove;
     std::vector<BridgeSessionPtr> newMembers;
 
@@ -577,7 +578,6 @@ void AsteriskSCF::BridgeService::BridgeImpl::replaceSession(const AsteriskSCF::S
         boost::unique_lock<boost::shared_mutex> lock(mLock);
         statePreCheck();
 
-
         std::vector<BridgeSessionPtr>::iterator i = find_if(mSessions.begin(), mSessions.end(), AsteriskSCF::BridgeService::FindImpl(oldSession));
 
         //
diff --git a/src/MediaSplicer.cpp b/src/MediaSplicer.cpp
index 6332bdb..2af8517 100644
--- a/src/MediaSplicer.cpp
+++ b/src/MediaSplicer.cpp
@@ -60,7 +60,6 @@ namespace BridgeService
                 mIncoming.clear();
             }
 
-
             //
             // Disconnect everybody, eating up exceptions in case things have gone away. This is a perfect spot 
             // for oneways or, at the very least, AMI.
diff --git a/test/TestBridging.cpp b/test/TestBridging.cpp
index f10ec58..982edbd 100644
--- a/test/TestBridging.cpp
+++ b/test/TestBridging.cpp
@@ -399,6 +399,14 @@ public:
         }
     };
 
+    void dumplog(const std::vector<std::string>& seq)
+    {
+        for(std::vector<std::string>::const_iterator i = seq.begin(); i != seq.end(); ++i)
+        {
+            std::cerr << *i << std::endl;
+        }
+    }
+
     void testReplaceSession()
     {
         try
@@ -414,14 +422,35 @@ public:
                 BOOST_CHECK(mgrPrx);
                 AsteriskSCF::SessionCommunications::V1::SessionSeq sessions;
                 AsteriskSCF::SessionCommunications::V1::SessionPrx a = channel.getSession("111");
+                a->start();
                 sessions.push_back(a);
+
+                AsteriskSCF::SessionCommunications::V1::SessionPrx c = channel.getSession("333");
+                sessions.push_back(c);
+                std::string idA = testEnv.communicator()->identityToString(a->ice_getIdentity());
+                std::string idC = testEnv.communicator()->identityToString(c->ice_getIdentity());
                 AsteriskSCF::SessionCommunications::V1::BridgePrx bridge(mgrPrx->createBridge(sessions, 0));
                 sessions.clear();
+                channel.commands()->answer(idA);
+                channel.commands()->answer(idC);
                 AsteriskSCF::SessionCommunications::V1::SessionPrx b = channel.getSession("222");
+                std::vector<std::string> log;
+                std::string idB = testEnv.communicator()->identityToString(b->ice_getIdentity());
                 sessions.push_back(b);
+                sleep(5);
+                channel.commands()->getlog(idA, log);
+                dumplog(log);
+                b->start();
+
                 bridge->replaceSession(a, sessions);
+                log.clear();
+                channel.commands()->answer(idB);
+                sleep(5);
+                channel.commands()->getlog(idB, log);
+                dumplog(log);
+
                 sessions = bridge->listSessions();
-                BOOST_CHECK(sessions.size() == 1);
+                BOOST_CHECK(sessions.size() == 2);
                 BOOST_CHECK(sessions.back() == b);
                 bridge->shutdown();
 
diff --git a/test/channel_driver b/test/channel_driver
index 9705e7d..732ef0f 160000
--- a/test/channel_driver
+++ b/test/channel_driver
@@ -1 +1 @@
-Subproject commit 9705e7d70b3721a3aeccd8ada97181242c7f1098
+Subproject commit 732ef0fa29bd33d0aca4835a49be919b2736b399

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


-- 
asterisk-scf/integration/bridging.git



More information about the asterisk-scf-commits mailing list