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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Jun 2 21:21:49 CDT 2011


branch "master" has been updated
       via  bc789938cc49587975f97a60d7bcb1a681ec981c (commit)
       via  a6d7d3da25de0c72ca58fd32b389de1810e4eedf (commit)
      from  7a581b9c43a91428b9f937509b06ea7cdc9aa31a (commit)

Summary of changes:
 src/BridgeImpl.cpp     |    2 +-
 src/SessionWrapper.cpp |   37 ++++++++++++++++++++++++++-----------
 2 files changed, 27 insertions(+), 12 deletions(-)


- Log -----------------------------------------------------------------
commit bc789938cc49587975f97a60d7bcb1a681ec981c
Author: Brent Eagles <beagles at digium.com>
Date:   Thu Jun 2 23:50:40 2011 -0230

    Solution for attended transfers. Basically the removeBridge implementation was
    doing things it shouldn't to the session being removed.

diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index 29e4849..fcfab3b 100755
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -591,8 +591,8 @@ void BridgeImpl::removeSessions_async(const AMD_Bridge_removeSessionsPtr& callba
             SessionWrapperPtr session = mSessions->getSession(*i);
             if (session)
             {
-                session->shutdown(mSessionListenerPrx, new ResponseCode);
                 removed->add(session->getSession());
+                mSessions->removeSession(session->getBridgedSession());
             }
         }
         QueuedTasks tasks;

commit a6d7d3da25de0c72ca58fd32b389de1810e4eedf
Author: Brent Eagles <beagles at digium.com>
Date:   Thu Jun 2 21:37:14 2011 -0230

    Add some logging.

diff --git a/src/SessionWrapper.cpp b/src/SessionWrapper.cpp
index 2450ccd..48ccfa8 100644
--- a/src/SessionWrapper.cpp
+++ b/src/SessionWrapper.cpp
@@ -73,7 +73,6 @@ public:
             //
             // These exceptions indicate something is wrong with the request on this object. We should not expect that
             // it could ever exceed. ObjectNotExistException is included in this catch.
-            // TODO- it might be reasonable to disconnect this session for this!
             //
             mLogger(Warning) << "exception when calling connect() on " << mSession->id() << ": " << x.what();
             mSession->destroy();
@@ -181,10 +180,11 @@ class SessionStopTask : public QueuedTask
 {
 public:
     SessionStopTask(const SessionWrapperPtr& session,
-            const ResponseCodePtr& code) :
+            const ResponseCodePtr& code, const Logger& logger) :
         QueuedTask("SessionStopTask"),
         mSession(session),
-        mCode(code)
+        mCode(code),
+        mLogger(logger)
     {
     }
     
@@ -202,12 +202,26 @@ protected:
         mListener->succeeded();
     }
 
-    void failed(const Ice::Exception&)
+    void failed(const Ice::Exception& ex)
     {
-        //
-        // TODO: Log exception.
-        //
-        mListener->failed();
+        try
+        {
+            ex.ice_throw();
+        }
+        catch (const Ice::ObjectNotExistException& x)
+        {
+            mLogger(Warning) << "received an ONE for " << mSession->id() << " when calling stop(), continuing...";
+            mListener->succeeded();
+        }
+        catch (const std::exception& x)
+        {
+            mLogger(Error) << "exception when calling connect() on " << mSession->id() << " : " << x.what();
+            mListener->failed();
+        }
+        catch (...)
+        {
+            mListener->failed();
+        }
     }
     
     void failImpl()
@@ -227,6 +241,7 @@ protected:
 private:
     SessionWrapperPtr mSession;
     ResponseCodePtr mCode; 
+    Logger mLogger;
 };
 
 class SetStateTask : public QueuedTask
@@ -337,7 +352,7 @@ private:
 };
 
 QueuedTasks createShutdownTasks(const SessionWrapperPtr& session, const SessionListenerPrx& listener,
-        const ResponseCodePtr& code)
+        const ResponseCodePtr& code, const Logger& logger)
 {
     //
     // We use this task instead of changing states because it will prevent the
@@ -353,7 +368,7 @@ QueuedTasks createShutdownTasks(const SessionWrapperPtr& session, const SessionL
     {
         tasks.push_back(new RemoveBridgeTask(session, listener, true));
         tasks.push_back(new ShutdownMediaTask(session));
-        tasks.push_back(new SessionStopTask(session, code));
+        tasks.push_back(new SessionStopTask(session, code, logger));
     }
     return tasks;
 }
@@ -560,7 +575,7 @@ void SessionWrapper::setup()
 void SessionWrapper::shutdown(const SessionListenerPrx& listener, const ResponseCodePtr& code)
 {
     mLogger(Debug) << FUNLOG << ": beginning shutdown of " << mId;
-    QueuedTaskPtr shutdownRunner(new QueueableExecutor(createShutdownTasks(this, listener, code), mLogger));
+    QueuedTaskPtr shutdownRunner(new QueueableExecutor(createShutdownTasks(this, listener, code, mLogger), mLogger));
     if (!code)
     {
         //

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


-- 
asterisk-scf/release/bridging.git



More information about the asterisk-scf-commits mailing list