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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Oct 18 17:29:15 CDT 2010


branch "master" has been updated
       via  fc5dec3e7064a11b236c85779f00a25689f47ecb (commit)
      from  3987f8eb28c21e48dc72c423ac31c48c18e66eb7 (commit)

Summary of changes:
 src/EndpointRegistry.cpp |    7 +++++++
 test/MockSession.cpp     |    1 +
 test/TestRouting.cpp     |   21 +++++++++++++++++++++
 3 files changed, 29 insertions(+), 0 deletions(-)


- Log -----------------------------------------------------------------
commit fc5dec3e7064a11b236c85779f00a25689f47ecb
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Mon Oct 18 17:26:49 2010 -0500

    Added more debug output on lookup (routing) process, and tests to insure
    that the routing sessions are removed from the Sessions at the end of
    routing.

diff --git a/src/EndpointRegistry.cpp b/src/EndpointRegistry.cpp
index 62ab599..0af39ab 100644
--- a/src/EndpointRegistry.cpp
+++ b/src/EndpointRegistry.cpp
@@ -89,6 +89,7 @@ void EndpointRegistry::addEndpointLocator(const std::string& locatorId, const Re
 {
     try
     {
+        lg(Debug) << "EndpointRegistry::addEndpointLocator() adding locator " << locatorId;
         EndpointLocatorMapIterator existing = mImpl->mEndpointLocatorMap.find(locatorId);
         if (existing != mImpl->mEndpointLocatorMap.end())
         {
@@ -118,6 +119,8 @@ void EndpointRegistry::removeEndpointLocator(const std::string& locatorId, const
 {
     try
     {
+        lg(Debug) << "EndpointRegistry::removeEndpointLocator() removing locator " << locatorId;
+
         EndpointLocatorMapIterator existing = mImpl->mEndpointLocatorMap.find(locatorId);
         if (existing == mImpl->mEndpointLocatorMap.end())
         {
@@ -180,6 +183,8 @@ AsteriskSCF::Core::Endpoint::V1::EndpointSeq EndpointRegistry::lookup(const std:
 {
     AsteriskSCF::Core::Endpoint::V1::EndpointSeq endpoints;
 
+    lg(Debug) << "EndpointRegistry::lookup() called for destination " << destination;
+
     string modifiedDestination(destination);
     if (mImpl->mScriptProcessor.get() != 0)
     {
@@ -199,6 +204,8 @@ AsteriskSCF::Core::Endpoint::V1::EndpointSeq EndpointRegistry::lookup(const std:
         {
             if (boost::regex_match(modifiedDestination, *reg))
             {
+                lg(Debug) << "EndpointRegistry::lookup() found an EndpointLocator for " << destination << ". Calling remote lookup()";
+
                 try
                 {
                     endpoints = entry->second.locator->lookup(modifiedDestination);
diff --git a/test/MockSession.cpp b/test/MockSession.cpp
index fc7df4c..a40424d 100644
--- a/test/MockSession.cpp
+++ b/test/MockSession.cpp
@@ -93,6 +93,7 @@ SessionEndpointPrx MockSession::getEndpoint(const Ice::Current&)
 
 SessionInfoPtr MockSession::getInfo(const Ice::Current&)
 {
+    mSessionInfo->connectedTime = mListeners.size();
     return mSessionInfo;
 }
 
diff --git a/test/TestRouting.cpp b/test/TestRouting.cpp
index 9a85488..8546272 100644
--- a/test/TestRouting.cpp
+++ b/test/TestRouting.cpp
@@ -452,6 +452,21 @@ BOOST_FIXTURE_TEST_CASE(BlindTransfer, PerTestFixture)
         SharedTestData::instance.sessionRouter->connectBridgedSessionsWithDestination(session, "103");
 
         BOOST_CHECK(SharedTestData::instance.mSessionReplaced);
+
+        SessionSeq sessions = bridge->listSessions();
+        BOOST_CHECK(sessions.size() == 2);
+        
+        for(SessionSeq::iterator s = sessions.begin(); s != sessions.end(); ++s)
+        {
+            SessionInfoPtr sessionInfo = (*s)->getInfo();
+
+            // For testing we put the leg id in the role field. 
+            BOOST_CHECK(sessionInfo->role == "102" || sessionInfo->role == "103");
+
+            // For testing, we put the number of listeners in the connectedTime field.
+            // Only the bridge should still be listening.
+            BOOST_CHECK(sessionInfo->connectedTime == 1);
+        }
     }
     catch(const IceUtil::Exception &ie)
     {
@@ -519,7 +534,13 @@ BOOST_FIXTURE_TEST_CASE(AttendedTransfer, PerTestFixture)
         for(SessionSeq::iterator s = sessions.begin(); s != sessions.end(); ++s)
         {
             SessionInfoPtr sessionInfo = (*s)->getInfo();
+
+            // For testing we put the leg id in the role field. 
             BOOST_CHECK(sessionInfo->role == "102" || sessionInfo->role == "104");
+
+            // For testing, we put the number of listeners in the connectedTime field.
+            // Only the bridge should still be listening.
+            BOOST_CHECK(sessionInfo->connectedTime == 1);
         }
     }
     catch(const IceUtil::Exception &ie)

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


-- 
asterisk-scf/integration/routing.git



More information about the asterisk-scf-commits mailing list