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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon May 23 16:16:22 CDT 2011


branch "master" has been updated
       via  363404bce906ac4860b75065a3e597c2b7737f20 (commit)
       via  e1cda44f3a5e9c7d24d198a2d4958e3ad92d36e8 (commit)
       via  b6b172267d19c0dae2ea8df258ac01e7ae60b367 (commit)
      from  973f8ef1950d29e82853abf9a74cd3b60cfb2ded (commit)

Summary of changes:
 test/MockSession.cpp |   72 ++++++++++++++++++++++++++++++++++---------------
 test/MockSession.h   |   43 ++++++++++++++++++++++++-----
 2 files changed, 85 insertions(+), 30 deletions(-)


- Log -----------------------------------------------------------------
commit 363404bce906ac4860b75065a3e597c2b7737f20
Merge: e1cda44 973f8ef
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue May 17 10:44:45 2011 -0500

    Merge branch 'master' into sip-threading


commit e1cda44f3a5e9c7d24d198a2d4958e3ad92d36e8
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue May 10 17:28:24 2011 -0500

    Adjust for changes in SessionCommunicationsIf.ice

diff --git a/test/MockSession.cpp b/test/MockSession.cpp
index 59fee4a..358e87a 100644
--- a/test/MockSession.cpp
+++ b/test/MockSession.cpp
@@ -70,7 +70,7 @@ MockSession::~MockSession()
     BOOST_TEST_MESSAGE("Session " + mLegId + " deleted.");
 }
 
-SessionInfoPtr MockSession::addListener(const SessionListenerPrx& listener, const Ice::Current&)
+void MockSession::internalAddListener(const SessionListenerPrx& listener)
 {
     mListeners.push_back(listener);
 
@@ -78,37 +78,54 @@ SessionInfoPtr MockSession::addListener(const SessionListenerPrx& listener, cons
     {
         BOOST_TEST_MESSAGE("Session " + mId + " has more than one listener.");
     }
+}
 
-    return mSessionInfo;
+void MockSession::addListener_async(
+        const AsteriskSCF::SessionCommunications::V1::AMD_Session_addListenerPtr& cb,
+        const SessionListenerPrx& listener,
+        const Ice::Current&)
+{
+    internalAddListener(listener);
+    cb->ice_response(mSessionInfo);
 }
 
-void MockSession::indicate(const AsteriskSCF::SessionCommunications::V1::IndicationPtr& indication, const Ice::Current&)
+void MockSession::indicate_async(
+        const AsteriskSCF::SessionCommunications::V1::AMD_Session_indicatePtr& cb,
+        const AsteriskSCF::SessionCommunications::V1::IndicationPtr& indication,
+        const Ice::Current&)
 {
     AsteriskSCF::SessionCommunications::V1::ConnectIndicationPtr connect;
 
     if ((connect = AsteriskSCF::SessionCommunications::V1::ConnectIndicationPtr::dynamicCast(indication)))
     {
-	for(vector<SessionListenerPrx>::iterator i = mListeners.begin(); i != mListeners.end(); ++i)
-	{
-	    (*i)->indicated(mMyPrx, new AsteriskSCF::SessionCommunications::V1::ConnectedIndication());
-	}
+        for(vector<SessionListenerPrx>::iterator i = mListeners.begin(); i != mListeners.end(); ++i)
+        {
+            (*i)->indicated(mMyPrx, new AsteriskSCF::SessionCommunications::V1::ConnectedIndication());
+        }
     }
+    cb->ice_response();
 }
 
-SessionEndpointPrx MockSession::getEndpoint(const Ice::Current&)
+void MockSession::getEndpoint_async(
+        const AsteriskSCF::SessionCommunications::V1::AMD_Session_getEndpointPtr& cb,
+        const Ice::Current&)
 {
-    return mEndpointPrx;
+    cb->ice_response(mEndpointPrx);
 }
 
-SessionInfoPtr MockSession::getInfo(const Ice::Current&)
+void MockSession::getInfo_async(
+        const AsteriskSCF::SessionCommunications::V1::AMD_Session_getInfoPtr& cb,
+        const Ice::Current&)
 {
     mSessionInfo->connectedTime = mListeners.size();
-    return mSessionInfo;
+    cb->ice_response(mSessionInfo);
 }
 
-AsteriskSCF::Media::V1::SessionPrx MockSession::getMediaSession(const Ice::Current&)
+void MockSession::getMediaSession_async(
+        const AsteriskSCF::SessionCommunications::V1::AMD_Session_getMediaSessionPtr& cb,
+        const Ice::Current&)
 {
-    return 0;
+    cb->ice_response(0);
 }
 
 void MockSession::removeListener(const SessionListenerPrx& listener, const Ice::Current&)
@@ -146,9 +163,11 @@ void MockSession::setProxy(const SessionPrx& sessionPrx)
     mMyPrx = sessionPrx;
 }
 
-BridgePrx MockSession::getBridge(const Ice::Current &)
+void MockSession::getBridge_async(
+        const AsteriskSCF::SessionCommunications::V1::AMD_Session_getBridgePtr& cb,
+        const Ice::Current &)
 {
-    return mBridgePrx;
+    cb->ice_response(mBridgePrx);
 }
 
 /**
@@ -156,26 +175,29 @@ BridgePrx MockSession::getBridge(const Ice::Current &)
  * method in this test code.
  */
 void MockSession::setBridge_async(
-    const AMD_Session_setBridgePtr& cb,
-    const BridgePrx& bridge,
-    const SessionListenerPrx& listener,
-    const Ice::Current &current)
+        const AMD_Session_setBridgePtr& cb,
+        const BridgePrx& bridge,
+        const SessionListenerPrx& listener,
+        const Ice::Current&)
 {
     mBridgePrx = bridge;
     mBridgeSet = true;
 
-    addListener(listener, current);
+    internalAddListener(listener);
 
     cb->ice_response(mSessionInfo);
 }
 
-void MockSession::removeBridge(const SessionListenerPrx& listener,
-    const Ice::Current &current)
+void MockSession::removeBridge_async(
+        const AsteriskSCF::SessionCommunications::V1::AMD_Session_removeBridgePtr& cb,
+        const SessionListenerPrx& listener,
+        const Ice::Current &current)
 {
     mBridgePrx = 0;
     mBridgeSet = false;
 
     removeListener(listener, current);
+    cb->ice_response();
 }
 
 }; // RoutingTest
diff --git a/test/MockSession.h b/test/MockSession.h
index 2cc4573..68b56cd 100644
--- a/test/MockSession.h
+++ b/test/MockSession.h
@@ -32,21 +32,38 @@ public:
 public:
     // Overrides
 
-    AsteriskSCF::SessionCommunications::V1::SessionInfoPtr addListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current&);
-    void indicate(const AsteriskSCF::SessionCommunications::V1::IndicationPtr&, const Ice::Current&);
-    AsteriskSCF::SessionCommunications::V1::SessionEndpointPrx getEndpoint(const Ice::Current&);
-    AsteriskSCF::SessionCommunications::V1::SessionInfoPtr getInfo(const Ice::Current&);
-    AsteriskSCF::Media::V1::SessionPrx getMediaSession(const Ice::Current&);
+    void addListener_async(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_addListenerPtr& cb,
+            const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
+            const Ice::Current&);
+    void indicate_async(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_indicatePtr& cb,
+            const AsteriskSCF::SessionCommunications::V1::IndicationPtr&,
+            const Ice::Current&);
+    void getEndpoint_async(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_getEndpointPtr& cb,
+            const Ice::Current&);
+    void getInfo_async(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_getInfoPtr& cb,
+            const Ice::Current&);
+    void getMediaSession_async(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_getMediaSessionPtr& cb,
+            const Ice::Current&);
     void removeListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx&, const Ice::Current&);
     void start(const Ice::Current&);
     void stop(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&, const Ice::Current&);
-    AsteriskSCF::SessionCommunications::V1::BridgePrx getBridge(const Ice::Current &);
+    void getBridge_async(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_getBridgePtr& cb,
+            const Ice::Current &);
     void setBridge_async(
             const AsteriskSCF::SessionCommunications::V1::AMD_Session_setBridgePtr& cb,
             const AsteriskSCF::SessionCommunications::V1::BridgePrx& bridge,
             const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
             const Ice::Current &);
-    void removeBridge(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current &);
+    void removeBridge_async(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_removeBridgePtr& cb,
+            const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
+            const Ice::Current &);
 
 public:
     void setProxy(const AsteriskSCF::SessionCommunications::V1::SessionPrx& sessionPrx);
@@ -54,6 +71,12 @@ public:
     void destroy();
 
 private:
+    /**
+     * Method that encapsulates the logic of adding a listener to a session
+     * without using AMD.
+     */
+    void internalAddListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx&);
+
     std::string mLegId;
     std::string mId;
     AsteriskSCF::SessionCommunications::V1::SessionPrx mMyPrx;

commit b6b172267d19c0dae2ea8df258ac01e7ae60b367
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon May 9 16:33:25 2011 -0500

    Adjust for AMD change to Session::setBridge

diff --git a/test/MockSession.cpp b/test/MockSession.cpp
index be48767..59fee4a 100644
--- a/test/MockSession.cpp
+++ b/test/MockSession.cpp
@@ -151,7 +151,13 @@ BridgePrx MockSession::getBridge(const Ice::Current &)
     return mBridgePrx;
 }
 
-SessionInfoPtr MockSession::setBridge(const BridgePrx& bridge,
+/**
+ * We're not actually dispatching this AMD
+ * method in this test code.
+ */
+void MockSession::setBridge_async(
+    const AMD_Session_setBridgePtr& cb,
+    const BridgePrx& bridge,
     const SessionListenerPrx& listener,
     const Ice::Current &current)
 {
@@ -160,7 +166,7 @@ SessionInfoPtr MockSession::setBridge(const BridgePrx& bridge,
 
     addListener(listener, current);
 
-    return mSessionInfo;
+    cb->ice_response(mSessionInfo);
 }
 
 void MockSession::removeBridge(const SessionListenerPrx& listener,
diff --git a/test/MockSession.h b/test/MockSession.h
index df4b5cf..2cc4573 100644
--- a/test/MockSession.h
+++ b/test/MockSession.h
@@ -41,7 +41,11 @@ public:
     void start(const Ice::Current&);
     void stop(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&, const Ice::Current&);
     AsteriskSCF::SessionCommunications::V1::BridgePrx getBridge(const Ice::Current &);
-    AsteriskSCF::SessionCommunications::V1::SessionInfoPtr setBridge(const AsteriskSCF::SessionCommunications::V1::BridgePrx& bridge, const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current &);
+    void setBridge_async(
+            const AsteriskSCF::SessionCommunications::V1::AMD_Session_setBridgePtr& cb,
+            const AsteriskSCF::SessionCommunications::V1::BridgePrx& bridge,
+            const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
+            const Ice::Current &);
     void removeBridge(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current &);
 
 public:

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


-- 
asterisk-scf/release/routing.git



More information about the asterisk-scf-commits mailing list