[asterisk-scf-commits] asterisk-scf/integration/routing.git branch "party-id" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Nov 22 15:11:59 CST 2011


branch "party-id" has been updated
       via  eb9868d45c3513f1640448b08c8a4e2c78726c8a (commit)
      from  3ad50958f01a2c12188dc73338e9c751d32ba183 (commit)

Summary of changes:
 src/ConnectBridgedSessionsOperation.cpp            |   12 +++++++++---
 src/ConnectBridgedSessionsOperation.h              |    3 +++
 ...nectBridgedSessionsWithDestinationOperation.cpp |    5 +++--
 src/SessionRouter.cpp                              |    2 ++
 src/SessionRouter.h                                |    1 +
 test/MockBridge.cpp                                |    6 +++++-
 test/MockBridge.h                                  |    2 ++
 test/TestRouting.cpp                               |    3 ++-
 8 files changed, 27 insertions(+), 7 deletions(-)


- Log -----------------------------------------------------------------
commit eb9868d45c3513f1640448b08c8a4e2c78726c8a
Author: Mark Michelson <mmichelson at digium.com>
Date:   Wed Nov 9 10:35:58 2011 -0600

    Adjust connectBridgedSessions to take connected line information so updates may be issued.

diff --git a/src/ConnectBridgedSessionsOperation.cpp b/src/ConnectBridgedSessionsOperation.cpp
index ab1dc2c..77c4a81 100644
--- a/src/ConnectBridgedSessionsOperation.cpp
+++ b/src/ConnectBridgedSessionsOperation.cpp
@@ -52,6 +52,7 @@ ConnectBridgedSessionsOperation::ConnectBridgedSessionsOperation
                             const ::AsteriskSCF::SessionCommunications::V1::SessionPrx& sessionToReplace, 
                             const ::AsteriskSCF::SessionCommunications::V1::SessionPrx& bridgedSession, 
                             bool replaceSession,
+                            const AsteriskSCF::SessionCommunications::PartyIdentification::V1::ConnectedLinePtr& connectedLine,
                             const ::Ice::Current& current,
                             const SessionContextPtr& context,
                             OperationsManager* const listener)
@@ -65,7 +66,8 @@ ConnectBridgedSessionsOperation::ConnectBridgedSessionsOperation
                                       operationId),
            mSessionToReplace(sessionToReplace),
            mBridgedSession(bridgedSession),
-           mReplaceSession(replaceSession)
+           mReplaceSession(replaceSession),
+           mConnectedLine(connectedLine)
 {
     mStateMachine.addState(ConnectBridgedSessionsOp::STATE_CONNECT, 
                            boost::bind(&ConnectBridgedSessionsOperation::connectBridgedSessionsState, this));
@@ -80,6 +82,7 @@ ConnectBridgedSessionsOperationPtr ConnectBridgedSessionsOperation::create
                     const ::AsteriskSCF::SessionCommunications::V1::SessionPrx& sessionToReplace, 
                     const ::AsteriskSCF::SessionCommunications::V1::SessionPrx& bridgedSession, 
                     bool replaceSession,
+                    const AsteriskSCF::SessionCommunications::PartyIdentification::V1::ConnectedLinePtr& connectedLine,
                     const ::Ice::Current& current,
                     const SessionContextPtr& context,
                     OperationsManager* const listener)
@@ -90,6 +93,7 @@ ConnectBridgedSessionsOperationPtr ConnectBridgedSessionsOperation::create
                                                                                sessionToReplace,
                                                                                bridgedSession,
                                                                                replaceSession,
+                                                                               connectedLine,
                                                                                current,
                                                                                context,
                                                                                listener));
@@ -169,15 +173,17 @@ void ConnectBridgedSessionsOperation::connectBridgedSessionsState()
     // Now replace the sessions.
     try
     {
+        AsteriskSCF::SessionCommunications::PartyIdentification::V1::ConnectedLineSeq connectedLines;
+        connectedLines.push_back(mConnectedLine);
         if (mReplaceSession)
         {
             lg(Debug) << BOOST_CURRENT_FUNCTION << ": Asking bridge to add sessions." ;
-            mergeBridge->replaceSession(mSessionToReplace, migratingSessions);
+            mergeBridge->replaceSession(mSessionToReplace, migratingSessions, connectedLines);
         }
         else
         {
             lg(Debug) << BOOST_CURRENT_FUNCTION << ": Asking bridge to replace sessions." ;
-            mergeBridge->addSessions(migratingSessions);
+            mergeBridge->addSessions(migratingSessions, connectedLines);
         }
     }
     catch(const Ice::Exception& e)
diff --git a/src/ConnectBridgedSessionsOperation.h b/src/ConnectBridgedSessionsOperation.h
index 3313664..c16782e 100644
--- a/src/ConnectBridgedSessionsOperation.h
+++ b/src/ConnectBridgedSessionsOperation.h
@@ -65,6 +65,7 @@ public:
                           const AsteriskSCF::SessionCommunications::V1::SessionPrx& sessionToReplace, 
                           const AsteriskSCF::SessionCommunications::V1::SessionPrx& bridgedSession, 
                           bool replaceSession,
+                          const AsteriskSCF::SessionCommunications::PartyIdentification::V1::ConnectedLinePtr& connectedLine,
                           const Ice::Current& current,
                           const SessionContextPtr& context,
                           OperationsManager* const listener);
@@ -77,6 +78,7 @@ protected:
                                     const AsteriskSCF::SessionCommunications::V1::SessionPrx& sessionToReplace, 
                                     const AsteriskSCF::SessionCommunications::V1::SessionPrx& bridgedSession, 
                                     bool replaceSession,
+                                    const AsteriskSCF::SessionCommunications::PartyIdentification::V1::ConnectedLinePtr& connectedLine,
                                     const Ice::Current& current,
                                     const SessionContextPtr& context,
                                     OperationsManager* const listener);
@@ -93,6 +95,7 @@ private:
      AsteriskSCF::SessionCommunications::V1::SessionPrx mSessionToReplace;
      AsteriskSCF::SessionCommunications::V1::SessionPrx mBridgedSession;
      bool mReplaceSession;
+     AsteriskSCF::SessionCommunications::PartyIdentification::V1::ConnectedLinePtr mConnectedLine;
 
 }; // class ConnectBridgedSessionsOperation
 
diff --git a/src/ConnectBridgedSessionsWithDestinationOperation.cpp b/src/ConnectBridgedSessionsWithDestinationOperation.cpp
index a62b309..9de97d0 100644
--- a/src/ConnectBridgedSessionsWithDestinationOperation.cpp
+++ b/src/ConnectBridgedSessionsWithDestinationOperation.cpp
@@ -24,6 +24,7 @@
 using namespace AsteriskSCF;
 using namespace AsteriskSCF::Core::Routing::V1;
 using namespace AsteriskSCF::SessionCommunications::V1;
+using namespace AsteriskSCF::SessionCommunications::PartyIdentification::V1;
 using namespace AsteriskSCF::System::Logging;
 using namespace AsteriskSCF::BasicRoutingService;
 using namespace AsteriskSCF::Replication::BasicRoutingService::V1;
@@ -486,12 +487,12 @@ void ConnectBridgedSessionsWithDestinationOperation::establishBridgeState()
         if (mReplaceSession)
         {
             lg(Debug) << BOOST_CURRENT_FUNCTION << ": Replacing session with newly routed destination " << mDestination;
-            mBridge->replaceSession(mSessionToReplace, newSessions);
+            mBridge->replaceSession(mSessionToReplace, newSessions, ConnectedLineSeq());
         }
         else
         {
             lg(Debug) << BOOST_CURRENT_FUNCTION << ": Adding newly routed destination to session's bridge " << mDestination;
-            mBridge->addSessions(newSessions);
+            mBridge->addSessions(newSessions, ConnectedLineSeq());
         }
     }
     catch (const Ice::Exception &e)
diff --git a/src/SessionRouter.cpp b/src/SessionRouter.cpp
index b11d788..cec08c7 100644
--- a/src/SessionRouter.cpp
+++ b/src/SessionRouter.cpp
@@ -243,6 +243,7 @@ void SessionRouter::connectBridgedSessions_async(const ::AsteriskSCF::SessionCom
                                                  const ::AsteriskSCF::SessionCommunications::V1::SessionPrx& sessionToReplace, 
                                                  const ::AsteriskSCF::SessionCommunications::V1::SessionPrx& bridgedSession,
                                                  bool replaceSession,
+                                                 const ::AsteriskSCF::SessionCommunications::PartyIdentification::V1::ConnectedLinePtr& connectedLine,
                                                  const ::Ice::Current& current)
 {
     WorkPtr op(ConnectBridgedSessionsOperation::create(cb, 
@@ -250,6 +251,7 @@ void SessionRouter::connectBridgedSessions_async(const ::AsteriskSCF::SessionCom
                                                        sessionToReplace, 
                                                        bridgedSession, 
                                                        replaceSession,
+                                                       connectedLine,
                                                        current, 
                                                        mImpl->mSessionContext,
                                                        mImpl.get()));
diff --git a/src/SessionRouter.h b/src/SessionRouter.h
index f71aa5e..203a6c9 100644
--- a/src/SessionRouter.h
+++ b/src/SessionRouter.h
@@ -106,6 +106,7 @@ public:
                     const ::AsteriskSCF::SessionCommunications::V1::SessionPrx& sessionToReplace, 
                     const ::AsteriskSCF::SessionCommunications::V1::SessionPrx& bridgedSession,  
                     bool replaceSession,
+                    const ::AsteriskSCF::SessionCommunications::PartyIdentification::V1::ConnectedLinePtr& connectedLine,
                     const ::Ice::Current&);
 
 private:
diff --git a/test/MockBridge.cpp b/test/MockBridge.cpp
index e0fc4f0..3b11958 100644
--- a/test/MockBridge.cpp
+++ b/test/MockBridge.cpp
@@ -19,6 +19,7 @@
 #include "SharedTestData.h"
 
 using namespace AsteriskSCF::SessionCommunications::V1;
+using namespace AsteriskSCF::SessionCommunications::PartyIdentification::V1;
 
 namespace AsteriskSCF
 {
@@ -71,7 +72,9 @@ MockBridge::~MockBridge()
     mListener = 0;
 }
 
-void MockBridge::addSessions_async(const AMD_Bridge_addSessionsPtr& callback, const SessionSeq& newSessions,
+void MockBridge::addSessions_async(const AMD_Bridge_addSessionsPtr& callback,
+        const SessionSeq& newSessions,
+        const ConnectedLineSeq&,
         const Ice::Current&)
 {
     try
@@ -147,6 +150,7 @@ void MockBridge::shutdown(const Ice::Current&)
 void MockBridge::replaceSession_async(const AsteriskSCF::SessionCommunications::V1::AMD_Bridge_replaceSessionPtr& cb,
     const AsteriskSCF::SessionCommunications::V1::SessionPrx& sessionToReplace,
     const AsteriskSCF::SessionCommunications::V1::SessionSeq& newSessions,
+    const ConnectedLineSeq&,
     const Ice::Current&)
 {
     try
diff --git a/test/MockBridge.h b/test/MockBridge.h
index 7204363..5d41a3e 100644
--- a/test/MockBridge.h
+++ b/test/MockBridge.h
@@ -36,6 +36,7 @@ public:
     // Overrides
     void addSessions_async(const AsteriskSCF::SessionCommunications::V1::AMD_Bridge_addSessionsPtr&,
             const AsteriskSCF::SessionCommunications::V1::SessionSeq& newSessions,
+            const AsteriskSCF::SessionCommunications::PartyIdentification::V1::ConnectedLineSeq& connectedLines,
             const Ice::Current& = ::Ice::Current());
     void destroy(const Ice::Current& ) ;
     void removeSessions_async(const AsteriskSCF::SessionCommunications::V1::AMD_Bridge_removeSessionsPtr&,
@@ -49,6 +50,7 @@ public:
     void replaceSession_async(const AsteriskSCF::SessionCommunications::V1::AMD_Bridge_replaceSessionPtr&,
         const AsteriskSCF::SessionCommunications::V1::SessionPrx& sessionToReplace,
         const AsteriskSCF::SessionCommunications::V1::SessionSeq& newSessions,
+        const AsteriskSCF::SessionCommunications::PartyIdentification::V1::ConnectedLineSeq& connectedLines,
         const Ice::Current&);
 
     void setCookies(const AsteriskSCF::SessionCommunications::V1::BridgeCookies& cookies, const Ice::Current&);
diff --git a/test/TestRouting.cpp b/test/TestRouting.cpp
index 357d3a9..2d3b138 100644
--- a/test/TestRouting.cpp
+++ b/test/TestRouting.cpp
@@ -39,6 +39,7 @@ using namespace std;
 using namespace AsteriskSCF::Core::Routing::V1;
 using namespace AsteriskSCF::Core::Endpoint::V1;
 using namespace AsteriskSCF::SessionCommunications::V1;
+using namespace AsteriskSCF::SessionCommunications::PartyIdentification::V1;
 using namespace AsteriskSCF::Core::Discovery::V1;
 using namespace AsteriskSCF::RoutingTest;
 using namespace AsteriskSCF::System::Component::V1;
@@ -529,7 +530,7 @@ BOOST_FIXTURE_TEST_CASE(AttendedTransfer, PerTestFixture)
 
         // Now bridge 102 and 104 into the first pair's bridge
         BridgePrx survivingBridge = session101->getBridge(); // Cache for testing.
-        SharedTestData::instance.sessionRouter->connectBridgedSessions("Test_BlindTransfer_" + IceUtil::generateUUID(), session101, session103, true);
+        SharedTestData::instance.sessionRouter->connectBridgedSessions("Test_BlindTransfer_" + IceUtil::generateUUID(), session101, session103, true, session103->getConnectedLine());
 
         BOOST_CHECK(SharedTestData::instance.mSessionReplaced);
 

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


-- 
asterisk-scf/integration/routing.git



More information about the asterisk-scf-commits mailing list