[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
Thu Oct 13 18:51:24 CDT 2011


branch "party-id" has been updated
       via  3ad50958f01a2c12188dc73338e9c751d32ba183 (commit)
       via  9dc9d9fc66a8475e74e2b80c1c736ff91f823555 (commit)
      from  0de4e641e2bd3fe51617a76db5c65c1708157ca6 (commit)

Summary of changes:
 src/RouteSessionOperation.cpp |    8 ++++++--
 src/RouteSessionOperation.h   |    3 +++
 src/SessionRouter.cpp         |    2 ++
 src/SessionRouter.h           |    1 +
 test/MockBridgeManager.cpp    |    1 +
 test/MockBridgeManager.h      |    3 ++-
 test/MockSession.cpp          |   12 ++++++++----
 test/TestRouting.cpp          |   14 +++++++-------
 8 files changed, 30 insertions(+), 14 deletions(-)


- Log -----------------------------------------------------------------
commit 3ad50958f01a2c12188dc73338e9c751d32ba183
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Oct 13 18:51:15 2011 -0500

    Adjust for privacy and redirection reasons.

diff --git a/test/MockSession.cpp b/test/MockSession.cpp
index 0a79a7c..cc48d47 100644
--- a/test/MockSession.cpp
+++ b/test/MockSession.cpp
@@ -67,7 +67,8 @@ MockSession::MockSession(const string& legId,
 
     NamePtr name = new Name("bar");
     NumberPtr number = new Number("100");
-    IdPtr testId = new Id(name, number);
+    PrivacyPtr privacy = new Privacy(false);
+    IdPtr testId = new Id(name, number, privacy);
     IdSeq idSeq;
     idSeq.push_back(testId);
     mCaller = new Caller(idSeq);
@@ -76,20 +77,23 @@ MockSession::MockSession(const string& legId,
 
     NamePtr dialedName = new Name("foo");
     NumberPtr dialedNumber = new Number("104");
-    IdPtr dialedId = new Id(dialedName, dialedNumber);
+    PrivacyPtr dialedPrivacy = new Privacy(false);
+    IdPtr dialedId = new Id(dialedName, dialedNumber, dialedPrivacy);
     IdSeq dialedSeq;
     dialedSeq.push_back(dialedId);
     mDialed = new Dialed(dialedNumber);
 
     NamePtr redirName = new Name("scud");
     NumberPtr redirNumber = new Number("666");
-    IdPtr connectedId = new Id(redirName, redirNumber);
+    PrivacyPtr redirPrivacy = new Privacy(false);
+    IdPtr connectedId = new Id(redirName, redirNumber, redirPrivacy);
     IdSeq idSeq2;
     idSeq2.push_back(connectedId);
     mConnectedLine = new ConnectedLine(idSeq2);
 
     RedirectionSeq redirects;
-    RedirectionPtr redirect = new Redirection(dialedId, connectedId);
+    RedirectionReasonPtr reason(new RedirectionReason(Unknown));
+    RedirectionPtr redirect = new Redirection(dialedId, connectedId, reason);
     redirects.push_back(redirect);
     mRedirections = new Redirections(redirects);
 }

commit 9dc9d9fc66a8475e74e2b80c1c736ff91f823555
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Oct 13 13:55:06 2011 -0500

    Add redirection support to routeSession()

diff --git a/src/RouteSessionOperation.cpp b/src/RouteSessionOperation.cpp
index 42f2129..5afa4d8 100644
--- a/src/RouteSessionOperation.cpp
+++ b/src/RouteSessionOperation.cpp
@@ -217,6 +217,7 @@ RouteSessionOperation::RouteSessionOperation(const AMD_SessionRouter_routeSessio
                                              const ::std::string& destination, 
                                              const ::AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookPrx& oneShotHook,
                                              const ::AsteriskSCF::SessionCommunications::PartyIdentification::V1::CallerPtr& callerID,
+                                             const ::AsteriskSCF::SessionCommunications::PartyIdentification::V1::RedirectionsPtr& redirects,
                                              const ::Ice::Current& current,
                                              const SessionContextPtr& context,
                                              OperationsManager* const listener) 
@@ -230,7 +231,8 @@ RouteSessionOperation::RouteSessionOperation(const AMD_SessionRouter_routeSessio
            mSource(source),
            mDestination(destination),
            mHook(oneShotHook),
-           mCallerID(callerID)
+           mCallerID(callerID),
+           mRedirects(redirects)
 {
     initStateMachine();
 }
@@ -244,6 +246,7 @@ RouteSessionOperationPtr RouteSessionOperation::create(const AMD_SessionRouter_r
                               const ::std::string& destination, 
                               const ::AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookPrx& oneShotHook,
                               const ::AsteriskSCF::SessionCommunications::PartyIdentification::V1::CallerPtr& callerID,
+                              const ::AsteriskSCF::SessionCommunications::PartyIdentification::V1::RedirectionsPtr& redirects,
                               const ::Ice::Current& current,
                               const SessionContextPtr& context,
                               OperationsManager* const listener) 
@@ -255,6 +258,7 @@ RouteSessionOperationPtr RouteSessionOperation::create(const AMD_SessionRouter_r
                                                             destination,
                                                             oneShotHook,
                                                             callerID,
+                                                            redirects,
                                                             current,
                                                             context,
                                                             listener));
@@ -501,7 +505,7 @@ void RouteSessionOperation::establishBridgeState()
         bridgedSessions.insert(bridgedSessions.end(), newSessions.begin(), newSessions.end());
 
         lg(Debug) <<  BOOST_CURRENT_FUNCTION << ": Creating bridge.";
-        bridge = mSessionContext->bridgeManager->createBridge(mSource, bridgedSessions, 0, mCallerID);
+        bridge = mSessionContext->bridgeManager->createBridge(mSource, bridgedSessions, 0, mCallerID, mRedirects);
     }
     catch (const Ice::Exception &e)
     {
diff --git a/src/RouteSessionOperation.h b/src/RouteSessionOperation.h
index 882be57..6a725cb 100644
--- a/src/RouteSessionOperation.h
+++ b/src/RouteSessionOperation.h
@@ -71,6 +71,7 @@ public:
                                            const ::std::string& destination, 
                                            const ::AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookPrx& oneShotHook,
                                            const ::AsteriskSCF::SessionCommunications::PartyIdentification::V1::CallerPtr& callerID,
+                                           const ::AsteriskSCF::SessionCommunications::PartyIdentification::V1::RedirectionsPtr& redirects,
                                            const ::Ice::Current& current,
                                            const SessionContextPtr& context,
                                            OperationsManager* const listener);
@@ -107,6 +108,7 @@ protected:
                           const ::std::string& destination, 
                           const ::AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookPrx& oneShotHook,
                           const ::AsteriskSCF::SessionCommunications::PartyIdentification::V1::CallerPtr& callerID,
+                          const ::AsteriskSCF::SessionCommunications::PartyIdentification::V1::RedirectionsPtr& redirects,
                           const ::Ice::Current& current,
                           const SessionContextPtr& context,
                           OperationsManager* const listener);
@@ -179,6 +181,7 @@ private:
     std::string mDestination;
     AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookPrx mHook;
     AsteriskSCF::SessionCommunications::PartyIdentification::V1::CallerPtr mCallerID;
+    AsteriskSCF::SessionCommunications::PartyIdentification::V1::RedirectionsPtr mRedirects;
     std::vector<RouteSessionOp::OperationState> mReplicatedStates;
 
 }; // class RouteSessionOperation
diff --git a/src/SessionRouter.cpp b/src/SessionRouter.cpp
index a517b39..b11d788 100644
--- a/src/SessionRouter.cpp
+++ b/src/SessionRouter.cpp
@@ -165,6 +165,7 @@ void SessionRouter::routeSession_async(const ::AsteriskSCF::SessionCommunication
                                        const ::std::string& destination, 
                                        const ::AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookPrx& oneShotHook,
                                        const ::AsteriskSCF::SessionCommunications::PartyIdentification::V1::CallerPtr& callerID,
+                                       const ::AsteriskSCF::SessionCommunications::PartyIdentification::V1::RedirectionsPtr& redirects,
                                        const ::Ice::Current& current)
 {
     // Check the cache for a replica with this transaction Id.
@@ -184,6 +185,7 @@ void SessionRouter::routeSession_async(const ::AsteriskSCF::SessionCommunication
                                              destination, 
                                              oneShotHook,
                                              callerID,
+                                             redirects,
                                              current, 
                                              mImpl->mSessionContext,
                                              mImpl.get()));
diff --git a/src/SessionRouter.h b/src/SessionRouter.h
index daba8bb..f71aa5e 100644
--- a/src/SessionRouter.h
+++ b/src/SessionRouter.h
@@ -63,6 +63,7 @@ public:
                     const ::std::string& destination, 
                     const ::AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookPrx& oneShotHook,
                     const ::AsteriskSCF::SessionCommunications::PartyIdentification::V1::CallerPtr& callerID,
+                    const ::AsteriskSCF::SessionCommunications::PartyIdentification::V1::RedirectionsPtr& redirects,
                     const ::Ice::Current&);
 
     /**
diff --git a/test/MockBridgeManager.cpp b/test/MockBridgeManager.cpp
index 1109599..f9af4c6 100644
--- a/test/MockBridgeManager.cpp
+++ b/test/MockBridgeManager.cpp
@@ -36,6 +36,7 @@ void MockBridgeManager::createBridge_async(const AMD_BridgeManager_createBridgeP
         const SessionSeq& sessions,
         const BridgeListenerPrx& listener,
         const CallerPtr&, 
+        const RedirectionsPtr&, 
         const Ice::Current&)
 {
     try
diff --git a/test/MockBridgeManager.h b/test/MockBridgeManager.h
index 391fb2a..36b7293 100644
--- a/test/MockBridgeManager.h
+++ b/test/MockBridgeManager.h
@@ -35,7 +35,8 @@ public:
             const AsteriskSCF::SessionCommunications::V1::SessionPrx& source,
             const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions,
             const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx& listener,
-            const AsteriskSCF::SessionCommunications::PartyIdentification::V1::CallerPtr& callerID, const Ice::Current&);
+            const AsteriskSCF::SessionCommunications::PartyIdentification::V1::CallerPtr& callerID,
+            const AsteriskSCF::SessionCommunications::PartyIdentification::V1::RedirectionsPtr& redirects, const Ice::Current&);
     void removeListener(const AsteriskSCF::SessionCommunications::V1::BridgeManagerListenerPrx&, const Ice::Current&);
     void addDefaultBridgeListener(const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current&);
     void removeDefaultBridgeListener(const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current&);
diff --git a/test/TestRouting.cpp b/test/TestRouting.cpp
index a662136..357d3a9 100644
--- a/test/TestRouting.cpp
+++ b/test/TestRouting.cpp
@@ -395,7 +395,7 @@ BOOST_FIXTURE_TEST_CASE(RouteSession, PerTestFixture)
         SharedTestData::instance.mBridgeConnected = false;
 
         BOOST_TEST_MESSAGE("Routing the session...");
-        SharedTestData::instance.sessionRouter->routeSession(IceUtil::generateUUID(), session, "102", 0, session->getCaller());
+        SharedTestData::instance.sessionRouter->routeSession(IceUtil::generateUUID(), session, "102", 0, session->getCaller(), session->getRedirections());
 
         BOOST_CHECK(SharedTestData::instance.mBridgeConnected);
 
@@ -450,7 +450,7 @@ BOOST_FIXTURE_TEST_CASE(BlindTransfer, PerTestFixture)
         SharedTestData::instance.mSessionReplaced = false;
 
         BOOST_TEST_MESSAGE("Routing the session...");
-        SharedTestData::instance.sessionRouter->routeSession(IceUtil::generateUUID(), session, "102", 0, session->getCaller());
+        SharedTestData::instance.sessionRouter->routeSession(IceUtil::generateUUID(), session, "102", 0, session->getCaller(), session->getRedirections());
 
         BridgePrx bridge = session->getBridge();
         BOOST_CHECK(bridge != 0);
@@ -507,7 +507,7 @@ BOOST_FIXTURE_TEST_CASE(AttendedTransfer, PerTestFixture)
         SharedTestData::instance.mBridgeConnected = false;
 
         BOOST_TEST_MESSAGE("Routing for the first pair...");
-        SharedTestData::instance.sessionRouter->routeSession("Test_AttendedTransfer_102_" + IceUtil::generateUUID(), session101, "102", 0, session101->getCaller());
+        SharedTestData::instance.sessionRouter->routeSession("Test_AttendedTransfer_102_" + IceUtil::generateUUID(), session101, "102", 0, session101->getCaller(), session101->getRedirections());
 
         BOOST_CHECK(SharedTestData::instance.mBridgeConnected);
 
@@ -523,7 +523,7 @@ BOOST_FIXTURE_TEST_CASE(AttendedTransfer, PerTestFixture)
 
         BOOST_TEST_MESSAGE("Routing the second pair...");
 
-        SharedTestData::instance.sessionRouter->routeSession("Test_AttendedTransfer_104_" + IceUtil::generateUUID(), session103, "104", 0, session103->getCaller());
+        SharedTestData::instance.sessionRouter->routeSession("Test_AttendedTransfer_104_" + IceUtil::generateUUID(), session103, "104", 0, session103->getCaller(), session103->getRedirections());
 
         BOOST_CHECK(SharedTestData::instance.mBridgeConnected);
 
@@ -715,7 +715,7 @@ BOOST_FIXTURE_TEST_CASE(FailoverRouteSession, PerTestFixture)
 
         // Note we're routing using AMI with no callback. The callback would never come due to the
         // way the test mode shuts down the operation. Simulates failure.
-        SharedTestData::instance.sessionRouter->begin_routeSession(operationId, session, "102", 0, session->getCaller());
+        SharedTestData::instance.sessionRouter->begin_routeSession(operationId, session, "102", 0, session->getCaller(), session->getRedirections());
 
         for (int counter=0; SharedTestData::instance.endpointLocator->mLookupCalled == false; counter++)
         {
@@ -744,7 +744,7 @@ BOOST_FIXTURE_TEST_CASE(FailoverRouteSession, PerTestFixture)
         BOOST_CHECK(SharedTestData::instance.serviceReplicaMgmt->isActive() == true);
 
         // Let the backup session router try to route using same operationId.
-        SharedTestData::instance.backupSessionRouter->routeSession(operationId, session, "102", 0, session->getCaller());
+        SharedTestData::instance.backupSessionRouter->routeSession(operationId, session, "102", 0, session->getCaller(), session->getRedirections());
 
         // The lookup should not be done again. 
         BOOST_CHECK(!SharedTestData::instance.endpointLocator->mLookupCalled);
@@ -800,7 +800,7 @@ BOOST_FIXTURE_TEST_CASE(FailoverConnectBridgedSessWithDest, PerTestFixture)
         SharedTestData::instance.mSessionReplaced = false;
 
         BOOST_TEST_MESSAGE("Routing the session...");
-        SharedTestData::instance.sessionRouter->routeSession(IceUtil::generateUUID(), session, "102", 0, session->getCaller());
+        SharedTestData::instance.sessionRouter->routeSession(IceUtil::generateUUID(), session, "102", 0, session->getCaller(), session->getRedirections());
 
         BridgePrx bridge = session->getBridge();
         BOOST_CHECK(bridge != 0);

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


-- 
asterisk-scf/integration/routing.git



More information about the asterisk-scf-commits mailing list