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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Oct 20 17:13:53 CDT 2010


branch "master" has been updated
       via  13f00abc57dc4388b21d22afa310d950bdb0ba70 (commit)
      from  cecc6b5c5c9ec43a534526c6597ff5a5541171e2 (commit)

Summary of changes:
 src/BridgeImpl.cpp |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)


- Log -----------------------------------------------------------------
commit 13f00abc57dc4388b21d22afa310d950bdb0ba70
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Oct 20 19:42:34 2010 -0230

    Trying out a rudimentary retry.

diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index 40f2112..4594ecc 100644
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -450,7 +450,27 @@ void AsteriskSCF::BridgeService::BridgeImpl::addSessions(const AsteriskSCF::Sess
             AsteriskSCF::SessionCommunications::V1::SessionInfoPtr info;
             try
             {
-                info = (*i)->setBridge(mPrx, mSessionListenerPrx);
+                size_t count = 0;
+                bool done = false;
+                size_t sleepInterval = 500; // XXX Make configurable.
+                size_t numberOfRetries = 5;
+                while(!done && count < numberOfRetries)
+                {
+                    try
+                    {
+                        info = (*i)->setBridge(mPrx, mSessionListenerPrx);
+                        done = true;
+                    }
+                    catch(const Ice::ConnectionLostException& ex)
+                    {
+                        IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(sleepInterval));
+                        ++count;
+                        if(count == numberOfRetries)
+                        {
+                            throw;
+                        }
+                    }
+                }
             }
             catch(const Ice::Exception& ex)
             {

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


-- 
asterisk-scf/integration/bridging.git



More information about the asterisk-scf-commits mailing list