[asterisk-scf-commits] asterisk-scf/integration/media_rtp_pjmedia.git branch "retry_deux" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue May 1 18:02:56 CDT 2012


branch "retry_deux" has been updated
       via  42e891ae090b7a83c0da5c272059d162259cdc22 (commit)
      from  1b9df051f5e341e167d1f281f0ac7591178364c1 (commit)

Summary of changes:
 config/RTP.config                  |    2 +-
 src/RTPSession.cpp                 |   25 ++++++++++++++++++++-----
 src/RTPStateReplicatorListener.cpp |    8 ++++++++
 3 files changed, 29 insertions(+), 6 deletions(-)


- Log -----------------------------------------------------------------
commit 42e891ae090b7a83c0da5c272059d162259cdc22
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Tue May 1 18:02:53 2012 -0500

    Fixed a problem with cookie replication.

diff --git a/config/RTP.config b/config/RTP.config
index 47b975d..30e0289 100644
--- a/config/RTP.config
+++ b/config/RTP.config
@@ -12,7 +12,7 @@ endport=20000
 workerthreadcount=4
 
 # IPv4 address we should bind sessions to
-#ipv4bind=
+ipv4bind=127.0.0.1
 
 # IPv6 address we should bind sessions to
 #ipv6bind=
diff --git a/src/RTPSession.cpp b/src/RTPSession.cpp
index 41f9a3c..d3fe04c 100644
--- a/src/RTPSession.cpp
+++ b/src/RTPSession.cpp
@@ -354,6 +354,8 @@ private:
 
     TelephonyEventSourcePrx mTelephonyEventSourcePrx;
     TelephonyEventSinkPrx mTelephonyEventSinkPrx;
+
+    AsteriskSCF::Media::V1::SessionCookieDict mCookies;
 };
 
 /**
@@ -645,7 +647,12 @@ std::string RTPSessionImpl::getId(const Ice::Current&)
 void RTPSessionImpl::setCookies(const AsteriskSCF::Media::V1::SessionCookieDict& cookieMap)
 {
     boost::unique_lock<boost::shared_mutex> lock(mLock);
-    mSessionStateItem->cookies = cookieMap;
+    mCookies = cookieMap;
+
+    if (mSessionStateItem)
+    {
+        mSessionStateItem->cookies = cookieMap;
+    }
 }
 
 /**
@@ -670,12 +677,13 @@ void RTPSessionImpl::setCookies(
             for (AsteriskSCF::Media::V1::SessionCookies::const_iterator i = cookies.begin();
                  i != cookies.end();  ++i)
             {
-                mSessionStateItem->cookies[(*i)->ice_id()] = (*i);
+                mCookies[(*i)->ice_id()] = (*i);
             }
         }
 
         if (mReplicationContext->isReplicating() == true)
         {
+            mSessionStateItem->cookies = mCookies;
             replicateState(mSessionStateItem, 0, 0, 0, 0);
         }
         data->setCompleted();
@@ -707,9 +715,9 @@ void RTPSessionImpl::getCookies_async(
 	    i != cookiesToGet.end();
 	    ++i)
     {
-	AsteriskSCF::Media::V1::SessionCookieDict::const_iterator cookie = mSessionStateItem->cookies.find((*i)->ice_id());
+	AsteriskSCF::Media::V1::SessionCookieDict::const_iterator cookie = mCookies.find((*i)->ice_id());
 
-	if (cookie == mSessionStateItem->cookies.end())
+	if (cookie == mCookies.end())
 	{
 	    continue;
 	}
@@ -742,12 +750,13 @@ void RTPSessionImpl::removeCookies(
             for (AsteriskSCF::Media::V1::SessionCookies::const_iterator i = cookies.begin();
                  i != cookies.end(); ++i)
             {
-                mSessionStateItem->cookies.erase((*i)->ice_id());
+                mCookies.erase((*i)->ice_id());
             }
         }
 
         if (mReplicationContext->isReplicating() == true)
         {
+            mSessionStateItem->cookies = mCookies;
             replicateState(mSessionStateItem, 0, 0, 0, 0);
         }
         data->setCompleted();
@@ -1300,6 +1309,9 @@ private:
     RTPSessionImplPtr mImpl;
 };
 
+/**
+ * Factory method used by active component.
+ */
 RTPSessionPrx AsteriskSCF::PJMEDIARTP::RTPSession::create(const Ice::ObjectAdapterPtr& adapter,
         const std::string& id, const RTPServiceLocatorParamsPtr& params,
         const PJMEDIAEnvironmentPtr& environment,
@@ -1313,6 +1325,9 @@ RTPSessionPrx AsteriskSCF::PJMEDIARTP::RTPSession::create(const Ice::ObjectAdapt
     return servant->activate(id, options, outputs);
 }
 
+/**
+ * Factory method used by state replicator. 
+ */
 ReplicationAdapterPtr AsteriskSCF::PJMEDIARTP::RTPSession::create(const Ice::ObjectAdapterPtr& adapter,
         const PJMEDIAEnvironmentPtr& environment,
         const RTPSessionStateItemPtr& item,
diff --git a/src/RTPStateReplicatorListener.cpp b/src/RTPStateReplicatorListener.cpp
index 6b8f14a..0ce2ea5 100644
--- a/src/RTPStateReplicatorListener.cpp
+++ b/src/RTPStateReplicatorListener.cpp
@@ -22,6 +22,7 @@
 
 #include <AsteriskSCF/System/Component/ReplicaIf.h>
 #include <AsteriskSCF/Operations/OperationContextCache.h>
+#include <AsteriskSCF/System/ExceptionsIf.h>
 #include <AsteriskSCF/Logger.h>
 
 #include "RTPStateReplicator.h"
@@ -33,6 +34,7 @@ using namespace AsteriskSCF::Operations;
 using namespace AsteriskSCF::PJMEDIARTP;
 using namespace AsteriskSCF::Replication::MediaRTPPJMEDIA::V1;
 using namespace AsteriskSCF::System::Logging;
+using namespace AsteriskSCF::System::V1;
 using namespace std;
 
 namespace
@@ -139,6 +141,12 @@ public:
                             AsteriskSCF::PJMEDIARTP::RTPSession::create(mImpl->mAdapter, mImpl->mEnvironment, item,
                                 mImpl->mReplicationContext, mImpl->mConfigurationService, item->options, outputs));
                     }
+                    catch (const InternalInitializationException& e)
+                    {
+                        lg(Error) << "Exception in " << BOOST_CURRENT_FUNCTION <<  " : " << e.message;
+                        assert(false);
+                        return;
+                    }
                     catch (const std::exception& e)
                     {
                         lg(Error) << "Exception in " << BOOST_CURRENT_FUNCTION <<  " : " << e.what();

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


-- 
asterisk-scf/integration/media_rtp_pjmedia.git



More information about the asterisk-scf-commits mailing list