[asterisk-scf-commits] asterisk-scf/integration/bridging.git branch "indicate" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Apr 7 09:17:48 CDT 2011


branch "indicate" has been created
        at  a37477a9629413987a43b8ea0d5da47d56868625 (commit)

- Log -----------------------------------------------------------------
commit a37477a9629413987a43b8ea0d5da47d56868625
Author: Joshua Colp <jcolp at digium.com>
Date:   Thu Apr 7 11:20:12 2011 -0300

    Finish migration to new indicate support.

diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index a637e5d..588fad9 100755
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -156,7 +156,9 @@ public:
     {
         try
         {
-            b->getSession()->progress(mResponse);
+	    AsteriskSCF::SessionCommunications::V1::ProgressIndicationPtr progress(new AsteriskSCF::SessionCommunications::V1::ProgressIndication());
+	    progress->response = mResponse;
+	    b->getSession()->indicate(progress);
         }
         catch(const Ice::ObjectNotExistException& ex)
         {
@@ -193,7 +195,7 @@ public:
         {
             try
             {
-                b->ring();
+		b->ring();
             }
             catch(const Ice::ObjectNotExistException& ex)
             {
@@ -224,7 +226,7 @@ public:
     {
         try
         {
-            b->getSession()->flash();
+	    b->getSession()->indicate(new AsteriskSCF::SessionCommunications::V1::FlashIndication());
         }
         catch(const Ice::ObjectNotExistException& ex)
         {
@@ -252,7 +254,7 @@ public:
     {
         try
         {
-            b->getSession()->hold();
+	    b->getSession()->indicate(new AsteriskSCF::SessionCommunications::V1::HoldIndication());
         }
         catch(const Ice::ObjectNotExistException& ex)
         {
@@ -280,7 +282,7 @@ public:
     {
         try
         {
-            b->getSession()->unhold();
+	    b->getSession()->indicate(new AsteriskSCF::SessionCommunications::V1::UnholdIndication());
         }
         catch(const Ice::ObjectNotExistException& ex)
         {
@@ -369,6 +371,36 @@ public:
     {
     }
 
+    void indicated(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source,
+	const AsteriskSCF::SessionCommunications::V1::IndicationPtr& indication, const Ice::Current&)
+    {
+	AsteriskSCF::SessionCommunications::V1::ConnectedIndicationPtr connected;
+	AsteriskSCF::SessionCommunications::V1::RingingIndicationPtr ringing;
+
+	if ((connected = AsteriskSCF::SessionCommunications::V1::ConnectedIndicationPtr::dynamicCast(indication)))
+	{
+	    try
+	    {
+		mBridge->sessionConnected(source);
+	    }
+	    catch(const Ice::Exception& ex)
+	    {
+		lg(Debug) << __FUNCTION__ << ":" << __LINE__ << ex.what();
+		throw;
+	    }
+	    std::vector<BridgeImpl::BridgeSessionPtr> sessions(mBridge->currentSessions());
+	    std::for_each(sessions.begin(), sessions.end(), ConnectImpl(source));
+	}
+	else if ((ringing = AsteriskSCF::SessionCommunications::V1::RingingIndicationPtr::dynamicCast(indication)))
+	{
+	    std::vector<BridgeImpl::BridgeSessionPtr> sessions(mBridge->currentSessions());
+	    if(sessions.size() > 0)
+	    {
+		std::for_each(sessions.begin(), sessions.end(), RingImpl(source));
+	    }
+	}
+    }
+
     void connected(const AsteriskSCF::SessionCommunications::V1::SessionPrx& source, const Ice::Current&)
     {
         try
diff --git a/src/BridgeImpl.h b/src/BridgeImpl.h
index 8b1ee88..46ea3e5 100644
--- a/src/BridgeImpl.h
+++ b/src/BridgeImpl.h
@@ -57,7 +57,7 @@ public:
             if(mConnected)
                 return;
 
-            mSession->connect();
+	    mSession->indicate(new SessionCommunications::V1::ConnectIndication());
             mConnected = true;
         }
 
@@ -69,7 +69,7 @@ public:
             IceUtil::Mutex::Lock lock(mMutex);
             if(mConnected)
                 return;
-            mSession->ring();
+	    mSession->indicate(new SessionCommunications::V1::RingIndication());
         }
 
         void setConnected()

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


-- 
asterisk-scf/integration/bridging.git



More information about the asterisk-scf-commits mailing list