[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
Thu Apr 21 11:45:13 CDT 2011


branch "master" has been updated
       via  2bf23eebe4d576ba355cab8b818e280267999cba (commit)
       via  6e3878b6a12ac333e817284504896984dd7bc3ee (commit)
       via  8a97cd195db2ea12f4dc30494eb4e5968063126e (commit)
       via  503795a461d068efff9a2edd3c6f8a685badb081 (commit)
      from  b3ca1721ff1e4ff3f5dab1f3e18daf95246bd9fa (commit)

Summary of changes:
 src/SessionRouter.cpp |   79 ++++++++++++++++++------------------------------
 test/MockBridge.cpp   |   32 ++++---------------
 test/MockSession.cpp  |   37 +++++++---------------
 test/MockSession.h    |    7 +----
 4 files changed, 50 insertions(+), 105 deletions(-)


- Log -----------------------------------------------------------------
commit 2bf23eebe4d576ba355cab8b818e280267999cba
Merge: b3ca172 6e3878b
Author: Joshua Colp <jcolp at digium.com>
Date:   Thu Apr 21 12:13:47 2011 -0300

    Merge branch 'indicate'
    
    Conflicts:
    	src/SessionRouter.cpp

diff --cc src/SessionRouter.cpp
index 12addb9,dfeb38c..1c14b07
--- a/src/SessionRouter.cpp
+++ b/src/SessionRouter.cpp
@@@ -122,56 -122,37 +122,37 @@@ public
  
  public: // The following operations are implementations of the SessionListener interface.
  
-     void connected(const SessionPrx&, const Ice::Current&)
-     {
-     }
- 
-     void flashed(const SessionPrx&, const Ice::Current&)
-     {
-     }
- 
-     void held(const SessionPrx&, const Ice::Current&)
-     {
-     }
- 
-     void progressing(const SessionPrx&, const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&, const Ice::Current&)
-     {
-     }
- 
-     void ringing(const SessionPrx&, const Ice::Current&)
-     {
-     }
- 
-     void stopped(const SessionPrx& session, const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& responseCode, const Ice::Current&)
-     {
-         mTerminated = true;
- 
-         SessionSeq cacheSessions;
-         {
-             boost::shared_lock<boost::shared_mutex> lock(mLock);
-             cacheSessions = mSessions;
-         }
- 
-         // Forward the stop message to all sessions other than the one that originally sent it.
-         for(SessionSeq::iterator s = cacheSessions.begin(); s != cacheSessions.end(); ++s)
-         {
-             try
-             {
-                 if (session->ice_getIdentity() != (*s)->ice_getIdentity())
-                 {
-                     (*s)->stop(responseCode);
-                 }
-             }
-             catch(const Ice::Exception &e)
-             {
-                 lg(Error) << "Session Listener unable to forward stop to session " << (*s)->ice_toString() << " due to " << e.what();
-             }
-         }
- 
-     }
- 
-     void unheld(const SessionPrx&, const Ice::Current&)
+     void indicated(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session,
+ 	const AsteriskSCF::SessionCommunications::V1::IndicationPtr& indication, const Ice::Current&)
      {
+ 	AsteriskSCF::SessionCommunications::V1::StoppedIndicationPtr stopped;
+ 
+ 	if ((stopped =  AsteriskSCF::SessionCommunications::V1::StoppedIndicationPtr::dynamicCast(indication)))
+ 	{
+ 	    mTerminated = true;
+ 
+ 	    SessionSeq cacheSessions;
+ 	    {
+ 		boost::shared_lock<boost::shared_mutex> lock(mLock);
+ 		cacheSessions = mSessions;
+ 	    }
+ 
+ 	    // Forward the stop message to all sessions other than the one that originally sent it.
+ 	    for(SessionSeq::iterator s = cacheSessions.begin(); s != cacheSessions.end(); ++s)
+ 	    {
 -            try
 -            {
 -                if (session->ice_getIdentity() != (*s)->ice_getIdentity())
 -                {
 -                    (*s)->stop(stopped->response);
 -                }
 -            }
 -            catch(const Ice::Exception &e)
 -            {
 -                lg(Error) << "Session Listener unable to forward stop to session " << (*s)->ice_toString() << " due to " << e.what();
 -            }
++		try
++		{
++		    if (session->ice_getIdentity() != (*s)->ice_getIdentity())
++		    {
++			(*s)->stop(stopped->response);
++		    }
++		}
++		catch(const Ice::Exception &e)
++		{
++		    lg(Error) << "Session Listener unable to forward stop to session " << (*s)->ice_toString() << " due to " << e.what();
++		}
+ 	    }
+ 	}
      }
  
  public: 

commit 6e3878b6a12ac333e817284504896984dd7bc3ee
Author: Joshua Colp <jcolp at digium.com>
Date:   Thu Apr 7 11:32:43 2011 -0300

    Remove old code.

diff --git a/src/SessionRouter.cpp b/src/SessionRouter.cpp
index 71146f5..dfeb38c 100644
--- a/src/SessionRouter.cpp
+++ b/src/SessionRouter.cpp
@@ -122,61 +122,37 @@ public:
 
 public: // The following operations are implementations of the SessionListener interface.
 
-    void indicated(const AsteriskSCF::SessionCommunications::V1::SessionPrx&, const AsteriskSCF::SessionCommunications::V1::IndicationPtr&, const Ice::Current&)
+    void indicated(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session,
+	const AsteriskSCF::SessionCommunications::V1::IndicationPtr& indication, const Ice::Current&)
     {
-	// We do not care about anything besides stopped, so this really is fine being blank
-    }
-
-    void connected(const SessionPrx& session, const Ice::Current&)
-    {
-    }
-
-    void flashed(const SessionPrx& session, const Ice::Current&)
-    {
-    }
-
-    void held(const SessionPrx& session, const Ice::Current&)
-    {
-    }
-
-    void progressing(const SessionPrx& session, const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&, const Ice::Current&)
-    {
-    }
+	AsteriskSCF::SessionCommunications::V1::StoppedIndicationPtr stopped;
 
-    void ringing(const SessionPrx& session, const Ice::Current&)
-    {
-    }
-
-    void stopped(const SessionPrx& session, const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& responseCode, const Ice::Current&)
-    {
-        mTerminated = true;
+	if ((stopped =  AsteriskSCF::SessionCommunications::V1::StoppedIndicationPtr::dynamicCast(indication)))
+	{
+	    mTerminated = true;
 
-        SessionSeq cacheSessions;
-        {
-            boost::shared_lock<boost::shared_mutex> lock(mLock);
-            cacheSessions = mSessions;
-        }
+	    SessionSeq cacheSessions;
+	    {
+		boost::shared_lock<boost::shared_mutex> lock(mLock);
+		cacheSessions = mSessions;
+	    }
 
-        // Forward the stop message to all sessions other than the one that originally sent it.
-        for(SessionSeq::iterator s = cacheSessions.begin(); s != cacheSessions.end(); ++s)
-        {
+	    // Forward the stop message to all sessions other than the one that originally sent it.
+	    for(SessionSeq::iterator s = cacheSessions.begin(); s != cacheSessions.end(); ++s)
+	    {
             try
             {
                 if (session->ice_getIdentity() != (*s)->ice_getIdentity())
                 {
-                    (*s)->stop(responseCode);
+                    (*s)->stop(stopped->response);
                 }
             }
             catch(const Ice::Exception &e)
             {
                 lg(Error) << "Session Listener unable to forward stop to session " << (*s)->ice_toString() << " due to " << e.what();
             }
-        }
-
-    }
-
-    void unheld(const SessionPrx& session, const Ice::Current&)
-    {
+	    }
+	}
     }
 
 public: 
diff --git a/test/MockBridge.cpp b/test/MockBridge.cpp
index 1f026a2..14f5a5d 100644
--- a/test/MockBridge.cpp
+++ b/test/MockBridge.cpp
@@ -44,35 +44,6 @@ public:
 	}
     }
 
-    virtual void connected(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session, const Ice::Current&)
-    {
-        mBridge->connected(session);
-    }
-
-    virtual void flashed(const AsteriskSCF::SessionCommunications::V1::SessionPrx&, const Ice::Current&)
-    {
-    }
-
-    virtual void held(const AsteriskSCF::SessionCommunications::V1::SessionPrx&, const Ice::Current&)
-    {
-    }
-
-    virtual void progressing(const AsteriskSCF::SessionCommunications::V1::SessionPrx&, const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&, const Ice::Current&)
-    {
-    }
-
-    virtual void ringing(const AsteriskSCF::SessionCommunications::V1::SessionPrx&, const Ice::Current&)
-    {
-    }
-
-    virtual void stopped(const AsteriskSCF::SessionCommunications::V1::SessionPrx&, const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&, const Ice::Current&)
-    {
-    }
-
-    virtual void unheld(const AsteriskSCF::SessionCommunications::V1::SessionPrx&, const Ice::Current&)
-    {
-    }
-
 private:
     MockBridge *mBridge;
 };
diff --git a/test/MockSession.cpp b/test/MockSession.cpp
index ffe3b4e..be48767 100644
--- a/test/MockSession.cpp
+++ b/test/MockSession.cpp
@@ -95,18 +95,6 @@ void MockSession::indicate(const AsteriskSCF::SessionCommunications::V1::Indicat
     }
 }
 
-void MockSession::connect(const Ice::Current&)
-{
-    for(vector<SessionListenerPrx>::iterator i = mListeners.begin(); i != mListeners.end(); ++i)
-    {
-	(*i)->indicated(mMyPrx, new AsteriskSCF::SessionCommunications::V1::ConnectedIndication());
-    }
-}
-
-void MockSession::flash(const Ice::Current&)
-{
-}
-
 SessionEndpointPrx MockSession::getEndpoint(const Ice::Current&)
 {
     return mEndpointPrx;
@@ -123,14 +111,6 @@ AsteriskSCF::Media::V1::SessionPrx MockSession::getMediaSession(const Ice::Curre
     return 0;
 }
 
-void MockSession::hold(const Ice::Current&)
-{
-}
-
-void MockSession::progress(const ResponseCodePtr&, const Ice::Current&)
-{
-}
-
 void MockSession::removeListener(const SessionListenerPrx& listener, const Ice::Current&)
 {
     for(vector<SessionListenerPrx>::iterator i = mListeners.begin(); i != mListeners.end(); ++i)
@@ -143,10 +123,6 @@ void MockSession::removeListener(const SessionListenerPrx& listener, const Ice::
     }
 }
 
-void MockSession::ring(const Ice::Current&)
-{
-}
-
 void MockSession::start(const Ice::Current&)
 {
     cout << "Session started." << endl;
@@ -165,10 +141,6 @@ void MockSession::stop(const ResponseCodePtr& response, const Ice::Current&)
     std::for_each(mListeners.begin(), mListeners.end(), SendStop(mMyPrx, response));
 }
 
-void MockSession::unhold(const Ice::Current&)
-{
-}
-
 void MockSession::setProxy(const SessionPrx& sessionPrx)
 {
     mMyPrx = sessionPrx;
diff --git a/test/MockSession.h b/test/MockSession.h
index 3038d5f..df4b5cf 100644
--- a/test/MockSession.h
+++ b/test/MockSession.h
@@ -34,18 +34,12 @@ public:
 
     AsteriskSCF::SessionCommunications::V1::SessionInfoPtr addListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current&);
     void indicate(const AsteriskSCF::SessionCommunications::V1::IndicationPtr&, const Ice::Current&);
-    void connect(const Ice::Current&);
-    void flash(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 hold(const Ice::Current&);
-    void progress(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&, const Ice::Current&);
     void removeListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx&, const Ice::Current&);
-    void ring(const Ice::Current&);
     void start(const Ice::Current&);
     void stop(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&, const Ice::Current&);
-    void unhold(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 removeBridge(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current &);

commit 8a97cd195db2ea12f4dc30494eb4e5968063126e
Author: Joshua Colp <jcolp at digium.com>
Date:   Thu Apr 7 11:20:02 2011 -0300

    Finish migration to new indicate support.

diff --git a/test/MockSession.cpp b/test/MockSession.cpp
index 8ff99c7..ffe3b4e 100644
--- a/test/MockSession.cpp
+++ b/test/MockSession.cpp
@@ -41,7 +41,9 @@ public:
 
     void operator()(const SessionListenerPrx& l)
     {
-        l->stopped(mMyProxy, mResponse);
+	AsteriskSCF::SessionCommunications::V1::StoppedIndicationPtr stopped(new  AsteriskSCF::SessionCommunications::V1::StoppedIndication());
+	stopped->response = mResponse;
+	l->indicated(mMyProxy, stopped);
     }
 
 private:
@@ -88,7 +90,7 @@ void MockSession::indicate(const AsteriskSCF::SessionCommunications::V1::Indicat
     {
 	for(vector<SessionListenerPrx>::iterator i = mListeners.begin(); i != mListeners.end(); ++i)
 	{
-	    (*i)->connected(mMyPrx);
+	    (*i)->indicated(mMyPrx, new AsteriskSCF::SessionCommunications::V1::ConnectedIndication());
 	}
     }
 }
@@ -97,7 +99,7 @@ void MockSession::connect(const Ice::Current&)
 {
     for(vector<SessionListenerPrx>::iterator i = mListeners.begin(); i != mListeners.end(); ++i)
     {
-        (*i)->connected(mMyPrx);
+	(*i)->indicated(mMyPrx, new AsteriskSCF::SessionCommunications::V1::ConnectedIndication());
     }
 }
 
@@ -152,7 +154,7 @@ void MockSession::start(const Ice::Current&)
     for(vector<SessionListenerPrx>::iterator i = mListeners.begin(); i != mListeners.end(); ++i)
     {
         // Auto-answer!
-        (*i)->connected(mMyPrx);
+	(*i)->indicated(mMyPrx, new AsteriskSCF::SessionCommunications::V1::ConnectedIndication());
     }
 }
 

commit 503795a461d068efff9a2edd3c6f8a685badb081
Author: Joshua Colp <jcolp at digium.com>
Date:   Thu Apr 7 10:17:58 2011 -0300

    Add new indicate support.

diff --git a/src/SessionRouter.cpp b/src/SessionRouter.cpp
index 30abafe..71146f5 100644
--- a/src/SessionRouter.cpp
+++ b/src/SessionRouter.cpp
@@ -122,6 +122,11 @@ public:
 
 public: // The following operations are implementations of the SessionListener interface.
 
+    void indicated(const AsteriskSCF::SessionCommunications::V1::SessionPrx&, const AsteriskSCF::SessionCommunications::V1::IndicationPtr&, const Ice::Current&)
+    {
+	// We do not care about anything besides stopped, so this really is fine being blank
+    }
+
     void connected(const SessionPrx& session, const Ice::Current&)
     {
     }
diff --git a/test/MockBridge.cpp b/test/MockBridge.cpp
index b383f61..1f026a2 100644
--- a/test/MockBridge.cpp
+++ b/test/MockBridge.cpp
@@ -33,6 +33,17 @@ public:
     }
 
     // Overrides
+    virtual void indicated(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session,
+	const AsteriskSCF::SessionCommunications::V1::IndicationPtr& indication, const Ice::Current&)
+    {
+	AsteriskSCF::SessionCommunications::V1::ConnectedIndicationPtr connected;
+
+	if ((connected = AsteriskSCF::SessionCommunications::V1::ConnectedIndicationPtr::dynamicCast(indication)))
+	{
+	    mBridge->connected(session);
+	}
+    }
+
     virtual void connected(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session, const Ice::Current&)
     {
         mBridge->connected(session);
diff --git a/test/MockSession.cpp b/test/MockSession.cpp
index 31f6ea8..8ff99c7 100644
--- a/test/MockSession.cpp
+++ b/test/MockSession.cpp
@@ -80,6 +80,19 @@ SessionInfoPtr MockSession::addListener(const SessionListenerPrx& listener, cons
     return mSessionInfo;
 }
 
+void MockSession::indicate(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)->connected(mMyPrx);
+	}
+    }
+}
+
 void MockSession::connect(const Ice::Current&)
 {
     for(vector<SessionListenerPrx>::iterator i = mListeners.begin(); i != mListeners.end(); ++i)
diff --git a/test/MockSession.h b/test/MockSession.h
index 0e59151..3038d5f 100644
--- a/test/MockSession.h
+++ b/test/MockSession.h
@@ -33,6 +33,7 @@ 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&);
     void connect(const Ice::Current&);
     void flash(const Ice::Current&);
     AsteriskSCF::SessionCommunications::V1::SessionEndpointPrx getEndpoint(const Ice::Current&);

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


-- 
asterisk-scf/release/routing.git



More information about the asterisk-scf-commits mailing list