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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Aug 12 10:10:32 CDT 2011


branch "bridge_creation_extension_points" has been updated
       via  ee693b45f59ee8f80bcab96ed09b41bbab236d84 (commit)
      from  fea2dfd0fbe4cb77b2a210dca6ffa55d01f48a30 (commit)

Summary of changes:
 .../BridgeService/BridgeReplicatorIf.ice           |    3 +-
 src/BridgeCreationExtensionPointImpl.cpp           |  140 ++++++++++++++++++++
 src/BridgeCreationExtensionPointImpl.h             |   54 ++++++++
 src/BridgeImpl.cpp                                 |  135 +++++++++++++++++--
 src/BridgeImpl.h                                   |    5 +
 src/BridgeManagerImpl.cpp                          |   20 ++--
 src/BridgeManagerImpl.h                            |    2 +-
 src/Component.cpp                                  |    4 +-
 8 files changed, 333 insertions(+), 30 deletions(-)
 create mode 100755 src/BridgeCreationExtensionPointImpl.cpp
 create mode 100755 src/BridgeCreationExtensionPointImpl.h


- Log -----------------------------------------------------------------
commit ee693b45f59ee8f80bcab96ed09b41bbab236d84
Author: Brent Eagles <beagles at digium.com>
Date:   Fri Aug 12 12:40:44 2011 -0230

    Missing files/changes(?). The previous commit did not appear to actually commit
    the changes.

diff --git a/slice/AsteriskSCF/Replication/BridgeService/BridgeReplicatorIf.ice b/slice/AsteriskSCF/Replication/BridgeService/BridgeReplicatorIf.ice
index a9a1e5b..14acc6f 100644
--- a/slice/AsteriskSCF/Replication/BridgeService/BridgeReplicatorIf.ice
+++ b/slice/AsteriskSCF/Replication/BridgeService/BridgeReplicatorIf.ice
@@ -163,7 +163,6 @@ enum ServiceState
     Destroyed
 };
 sequence<AsteriskSCF::SessionCommunications::V1::BridgeManagerListener*> BridgeManagerListenerSeq;
-sequence<AsteriskSCF::SessionCommunications::V1::BridgeListener*> BridgeListenerSeq;
     
 /**
  * The bridge manager state.
@@ -171,7 +170,7 @@ sequence<AsteriskSCF::SessionCommunications::V1::BridgeListener*> BridgeListener
 class BridgeManagerStateItem extends ReplicatedStateItem
 {
     ServiceState runningState;
-    BridgeListenerSeq defaultBridgeListeners;
+    AsteriskSCF::SessionCommunications::V1::BridgeListenerSeq defaultBridgeListeners;
     BridgeManagerListenerSeq listeners;
 };
 
diff --git a/src/BridgeCreationExtensionPointImpl.cpp b/src/BridgeCreationExtensionPointImpl.cpp
new file mode 100755
index 0000000..084c48c
--- /dev/null
+++ b/src/BridgeCreationExtensionPointImpl.cpp
@@ -0,0 +1,140 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2011, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#include "BridgeCreationExtensionPointImpl.h"
+#include <boost/thread/shared_mutex.hpp>
+#include "BridgeServiceConfig.h"
+
+using namespace AsteriskSCF::BridgeService;
+using namespace AsteriskSCF::SessionCommunications::V1;
+using namespace AsteriskSCF::SessionCommunications::ExtensionPoints::V1;
+using namespace AsteriskSCF::System::Logging;
+using namespace AsteriskSCF::System::Hook::V1;
+
+namespace 
+{
+    class BridgeExtPtImpl : public BridgeCreationExtensionPointImpl 
+    {
+    public:
+        BridgeExtPtImpl(const Logger& logger) :
+            mLogger(logger)
+        {
+        }
+
+        void addHook(const BridgeCreationHookPrx& newHook, const Ice::Current& current)
+        {
+            UniqueLock lock(mLock);
+            BridgeCreationHookSeq::iterator i = 
+                find_if(mHooks.begin(), mHooks.end(), IdentityComparePredicate<BridgeCreationHookPrx>(newHook));
+            if (i != mHooks.end())
+            {
+                mLogger(Debug) << "refreshing creation hook " << newHook << " on " 
+                    << objectIdFromCurrent(current);
+                //
+                // Refresh the proxy if it is already in the vector.
+                // 
+                *i = newHook;
+            }
+            else
+            {
+                mLogger(Debug) << "adding creation hook " << newHook << " on " 
+                    << objectIdFromCurrent(current);
+                mHooks.push_back(newHook);
+            }
+        }
+
+        void removeHook(const BridgeCreationHookPrx& hookToRemove, const Ice::Current& current)
+        {
+            UniqueLock lock(mLock);
+            mLogger(Debug) << "removing creation hook " << hookToRemove << " on " 
+                << objectIdFromCurrent(current);
+            mHooks.erase(remove_if(mHooks.begin(), mHooks.end(), 
+                    IdentityComparePredicate<BridgeCreationHookPrx>(hookToRemove)), mHooks.end());
+        }
+
+        void clearHooks(const Ice::Current& current)
+        {
+            UniqueLock lock(mLock);
+            mLogger(Debug) << "clearing hooks from " << objectIdFromCurrent(current);
+            mHooks.clear();
+        }
+
+        BridgeCreationHookDataPtr runHooks(const BridgeCreationHookDataPtr& originalData)
+        {
+            BridgeCreationHookSeq hooks = getHooks();
+            BridgeCreationHookSeq deadHooks;
+            BridgeCreationHookDataPtr tokenData = BridgeCreationHookDataPtr::dynamicCast(originalData->ice_clone());
+            for (BridgeCreationHookSeq::const_iterator i = hooks.begin(); i != hooks.end(); ++i)
+            {
+                try
+                {
+                    BridgeCreationHookDataPtr resultData; 
+                    HookResult result = (*i)->execute(tokenData, resultData);
+                    if (result.status = AsteriskSCF::System::Hook::V1::Succeeded)
+                    {
+                        tokenData = resultData;
+                    }
+                }
+                catch (const Ice::ObjectNotExistException&)
+                {
+                    mLogger(Debug) << "received ONE when running hook " << (*i) << ", removing from list";
+                    deadHooks.push_back(*i);
+                }
+                catch (const std::exception& ex)
+                {
+                    mLogger(Debug) << ex.what() << " thrown when executing bridge creation hook " << (*i) << ", skipping";
+                }
+            }
+            removeHooks(deadHooks);
+            return tokenData;
+        }
+
+    private:
+        typedef boost::shared_lock<boost::shared_mutex> SharedLock;
+        typedef boost::unique_lock<boost::shared_mutex> UniqueLock;
+        boost::shared_mutex mLock;
+
+        Logger mLogger;
+        BridgeCreationHookSeq mHooks;
+
+        void removeHooks(const BridgeCreationHookSeq& hooks)
+        {
+            if (hooks.empty())
+            {
+                return;
+            }
+
+            UniqueLock lock(mLock);
+            for (BridgeCreationHookSeq::const_iterator i = hooks.begin(); i != hooks.end(); ++i)
+            {
+                mHooks.erase(remove_if(mHooks.begin(), mHooks.end(), 
+                        IdentityComparePredicate<BridgeCreationHookPrx>(*i)), mHooks.end());
+            }
+        }
+
+        BridgeCreationHookSeq getHooks()
+        {
+            SharedLock lock(mLock);
+            return mHooks;
+        }
+    };
+};
+
+AsteriskSCF::BridgeService::BridgeCreationExtensionPointImplPtr 
+AsteriskSCF::BridgeService::BridgeCreationExtensionPointImpl::create(const Logger& logger)
+{
+    return new BridgeExtPtImpl(logger);
+}
diff --git a/src/BridgeCreationExtensionPointImpl.h b/src/BridgeCreationExtensionPointImpl.h
new file mode 100755
index 0000000..5cc6c6a
--- /dev/null
+++ b/src/BridgeCreationExtensionPointImpl.h
@@ -0,0 +1,54 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2011, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+#pragma once
+
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.h>
+
+namespace AsteriskSCF
+{
+
+//
+// Forward declarations.
+//
+namespace System
+{
+namespace Logging
+{
+
+class Logger;
+
+} /* End of namespace Logging */
+} /* End of namespace System */
+
+namespace BridgeService
+{
+    /**
+     * Base class for internal methods.
+     */
+    class BridgeCreationExtensionPointImpl : public AsteriskSCF::SessionCommunications::ExtensionPoints::V1::BridgeCreationExtensionPoint
+    {
+    public:
+
+        virtual AsteriskSCF::SessionCommunications::ExtensionPoints::V1::BridgeCreationHookDataPtr runHooks(
+            const AsteriskSCF::SessionCommunications::ExtensionPoints::V1::BridgeCreationHookDataPtr& originalData) = 0;
+
+        static IceUtil::Handle<BridgeCreationExtensionPointImpl> 
+            create(const AsteriskSCF::System::Logging::Logger&);
+    };
+    typedef IceUtil::Handle<BridgeCreationExtensionPointImpl> BridgeCreationExtensionPointImplPtr;
+
+} // End of namespace Bridging.
+} // End of namespace AsteriskSCF.
diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index 8916ea6..ed88cec 100755
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -92,13 +92,22 @@ public:
     void replaceSession_async(const AMD_Bridge_replaceSessionPtr& callbac, const SessionPrx& sessionToReplace,
             const SessionSeq& newSessions, const Ice::Current& current);
 
+    void setCookies(const BridgeCookies& cookies, const Ice::Current&);
+    void removeCookies(const BridgeCookies& cookies, const Ice::Current&);
+    BridgeCookies getCookies(const BridgeCookies& cookies, const Ice::Current&);
+
+    //
+    // Internal use variant of setCookies.
+    //
+    void setCookiesImpl(const BridgeCookies& cookies);
+
     //
     // BridgeServant methods
     //
     bool destroyed();
     void destroyImpl();
     void shutdownImpl(const Ice::Current& current);
-    void activate(const BridgePrx& proxy);
+    void activate(const BridgePrx& proxy, const std::string& id);
 
     void updateState(const BridgeStateItemPtr& state);
     void addListener(const BridgeListenerStateItemPtr& update);
@@ -112,6 +121,16 @@ public:
 
     void getAddSessionsTasks(QueuedTasks& tasks, const SessionSeq& sessions);
 
+    BridgeCookies getCookies()
+    {
+        BridgeCookies result;
+        for (BridgeCookieDict::const_iterator i = mState->cookies.begin(); i != mState->cookies.end(); ++i)
+        {
+            result.push_back(i->second);
+        }
+        return result;
+    }
+
 private:
 
     boost::shared_mutex mLock;
@@ -246,10 +265,11 @@ class RemoveSessionsNotify : public QueuedTask
 {
 public:
     RemoveSessionsNotify(const BridgeListenerMgrPtr& bridgeListeners,
-            const SessionsTrackerPtr& tracker) :
+            const SessionsTrackerPtr& tracker, const BridgeCookies& cookies) :
         QueuedTask("RemoveSessionsNotify"),
         mBridgeListeners(bridgeListeners),
-        mTracker(tracker)
+        mTracker(tracker),
+        mCookies(cookies)
     {
     }
     
@@ -259,7 +279,7 @@ protected:
         SessionSeq sessions = mTracker->getSessions();
         if (!sessions.empty())
         {
-            mBridgeListeners->sessionsRemoved(sessions);
+            mBridgeListeners->sessionsRemoved(sessions, mCookies);
         }
         return true;
     }
@@ -267,6 +287,7 @@ protected:
 private:
     BridgeListenerMgrPtr mBridgeListeners;
     SessionsTrackerPtr mTracker;
+    BridgeCookies mCookies;
 };
 
 class SetBridgeTask : public QueuedTask
@@ -368,23 +389,26 @@ private:
 class AddToListeners : public QueuedTask
 {
 public:
-    AddToListeners(const BridgeListenerMgrPtr& listeners, const SessionsTrackerPtr& tracker) :
+    AddToListeners(const BridgeListenerMgrPtr& listeners, const SessionsTrackerPtr& tracker,
+        const BridgeCookies& cookies) :
         QueuedTask("AddToListeners"),
         mListeners(listeners),
-        mTracker(tracker)
+        mTracker(tracker),
+        mCookies(cookies)
     {
     }
     
 protected:
     bool executeImpl()
     {
-        mListeners->sessionsAdded(mTracker->getSessions());
+        mListeners->sessionsAdded(mTracker->getSessions(), mCookies);
         return true;
     }
     
 private:
     BridgeListenerMgrPtr mListeners;
     SessionsTrackerPtr mTracker;
+    BridgeCookies mCookies;
 };
 
 class CheckShutdown : public QueuedTask
@@ -543,7 +567,7 @@ void BridgeImpl::addSessions_async(const AMD_Bridge_addSessionsPtr& callback, co
         SessionsTrackerPtr tracker(new SessionsTracker);
         QueuedTasks tasks;
         tasks.push_back(new SetBridgeTask(mSessions, mPrx, mSessionListenerPrx, sessions, tracker));
-        tasks.push_back(new AddToListeners(mListeners, tracker));
+        tasks.push_back(new AddToListeners(mListeners, tracker, getCookies()));
         tasks.push_back(new GenericAMDCallback<AMD_Bridge_addSessionsPtr>(callback, tracker));
         tasks.push_back(new UpdateTask(this));
         ExecutorPtr executor(new Executor(tasks, mLogger));
@@ -596,7 +620,13 @@ void BridgeImpl::removeSessions_async(const AMD_Bridge_removeSessionsPtr& callba
             }
         }
         QueuedTasks tasks;
-        tasks.push_back(new RemoveSessionsNotify(mListeners, removed));
+
+        BridgeCookies cookies;
+        {
+            boost::shared_lock<boost::shared_mutex> lock(mLock);
+            cookies = getCookies();
+        }
+        tasks.push_back(new RemoveSessionsNotify(mListeners, removed, cookies));
         tasks.push_back(new GenericAMDCallback<AMD_Bridge_removeSessionsPtr>(callback, removed));
         tasks.push_back(new CheckShutdown(this, mPrx));
         ExecutorPtr runner(new Executor(tasks, mLogger));
@@ -648,7 +678,7 @@ void BridgeImpl::shutdown(const Ice::Current& current)
         }
         mState->runningState = ShuttingDown;
 
-        mListeners->stopping();
+        mListeners->stopping(getCookies());
         update = createUpdate();
     }
     pushUpdate(update);
@@ -661,8 +691,8 @@ void BridgeImpl::shutdown(const Ice::Current& current)
         ResponseCodePtr responseCode = new ResponseCode;
         ShutdownSessionOperation shutdownOp(mSessionListenerPrx, responseCode, mLogger);
         mSessions->visitSessions(shutdownOp);
-        mListeners->stopped();
         boost::unique_lock<boost::shared_mutex> lock(mLock);
+        mListeners->stopped(getCookies());
         mLogger(Info) << objectIdFromCurrent(current) << ": is shutdown." ;
         mState->runningState = Destroyed;
         //
@@ -694,7 +724,7 @@ void BridgeImpl::destroy(const Ice::Current& current)
         }
         mState->runningState = Destroyed;
         mLogger(Info) << objectIdFromCurrent(current) << ": is now destroyed." ;
-        mListeners->stopped();
+        mListeners->stopped(getCookies());
         mSessionListener = 0;
         update = createUpdate();
     }
@@ -794,9 +824,14 @@ void BridgeImpl::replaceSession_async(const AMD_Bridge_replaceSessionPtr& callba
         
         SessionsTrackerPtr tracker(new SessionsTracker);
         QueuedTasks tasks;
-        tasks.push_back(new RemoveSessionsNotify(mListeners, removeTracker));
+        BridgeCookies cookies;
+        {
+            boost::shared_lock<boost::shared_mutex> lock(mLock);
+            cookies = getCookies();
+        }
+        tasks.push_back(new RemoveSessionsNotify(mListeners, removeTracker, cookies));
         tasks.push_back(new SetBridgeTask(mSessions, mPrx, mSessionListenerPrx, newSessions, tracker));
-        tasks.push_back(new AddToListeners(mListeners, tracker));
+        tasks.push_back(new AddToListeners(mListeners, tracker, cookies));
         tasks.push_back(new GenericAMDCallback<AMD_Bridge_replaceSessionPtr>(callback, tracker));
         tasks.push_back(new UpdateTask(this));
         ExecutorPtr executor(new Executor(tasks, mLogger));
@@ -812,6 +847,76 @@ void BridgeImpl::replaceSession_async(const AMD_Bridge_replaceSessionPtr& callba
     }
 }
 
+void BridgeImpl::setCookies(const BridgeCookies& cookies, const Ice::Current& current)
+{
+    mLogger(Debug) << FUNLOG << ":" << objectIdFromCurrent(current);
+    BridgeStateItemPtr update;
+    {
+        boost::unique_lock<boost::shared_mutex> lock(mLock);
+        setCookiesImpl(cookies);
+        if (!cookies.empty())
+        {
+            update = createUpdate();
+        }
+    }
+    pushUpdate(update);
+}
+
+void BridgeImpl::removeCookies(const BridgeCookies& cookies, const Ice::Current& current)
+{
+    mLogger(Debug) << FUNLOG << ":" << objectIdFromCurrent(current);
+    BridgeStateItemPtr update;
+    {
+        boost::unique_lock<boost::shared_mutex> lock(mLock);
+        bool dirty = false;
+        for (BridgeCookies::const_iterator i = cookies.begin(); i != cookies.end(); ++i)
+        {
+            BridgeCookieDict::iterator v = mState->cookies.find((*i)->ice_id());
+            if (v != mState->cookies.end())
+            {
+                dirty = true;
+                mState->cookies.erase(v);
+            }
+        }
+
+        if (dirty)
+        {
+            update = createUpdate();
+        }
+    }
+    pushUpdate(update);
+}
+
+BridgeCookies BridgeImpl::getCookies(const BridgeCookies& cookies, const Ice::Current& current)
+{
+    BridgeCookies result;
+    mLogger(Debug) << FUNLOG << ":" << objectIdFromCurrent(current);
+    boost::shared_lock<boost::shared_mutex> lock(mLock);
+    for (BridgeCookies::const_iterator i = cookies.begin(); i != cookies.end(); ++i)
+    {
+        BridgeCookieDict::const_iterator v = mState->cookies.find((*i)->ice_id());
+        if (v != mState->cookies.end())
+        {
+            result.push_back(v->second);
+        }
+    }
+    return result;
+}
+
+void BridgeImpl::setCookiesImpl(const BridgeCookies& cookies)
+{
+    // 
+    // This is only used for initial setting of cookies and will not be used after the object has been activated.
+    //
+    for (BridgeCookies::const_iterator i = cookies.begin(); i != cookies.end(); ++i)
+    {
+        if ((*i))
+        {
+            mState->cookies[(*i)->ice_id()] = (*i);
+        }
+    }
+}
+
 bool BridgeImpl::destroyed()
 {
     boost::shared_lock<boost::shared_mutex> lock(mLock);
@@ -950,7 +1055,7 @@ void BridgeImpl::getAddSessionsTasks(QueuedTasks& tasks,
 {
     SessionsTrackerPtr tracker(new SessionsTracker);
     tasks.push_back(new SetBridgeTask(mSessions, mPrx, mSessionListenerPrx, sessions, tracker));
-    tasks.push_back(new AddToListeners(mListeners, tracker));
+    tasks.push_back(new AddToListeners(mListeners, tracker, getCookies()));
     tasks.push_back(new UpdateTask(this));
 }
 
diff --git a/src/BridgeImpl.h b/src/BridgeImpl.h
index 048ca77..35b311f 100644
--- a/src/BridgeImpl.h
+++ b/src/BridgeImpl.h
@@ -116,6 +116,11 @@ public:
     virtual void forceUpdate() = 0;
 
     /**
+     * Internal method for setting the cookies on a this servant.
+     */
+    virtual void setCookiesImpl(const AsteriskSCF::SessionCommunications::V1::BridgeCookies& cookies) =0;
+
+    /**
      *
      * For the BridgeManager or any object managing a bridge object! Gets a list of initialized tasks that will add the
      * provided sessions to the bridge object in a manner consistent with "Bridge::addSessions()".
diff --git a/src/BridgeManagerImpl.cpp b/src/BridgeManagerImpl.cpp
index f0df313..b86241a 100644
--- a/src/BridgeManagerImpl.cpp
+++ b/src/BridgeManagerImpl.cpp
@@ -36,6 +36,7 @@ using namespace AsteriskSCF::SessionCommunications::V1;
 using namespace AsteriskSCF::Core::Discovery::V1;
 using namespace AsteriskSCF::BridgeService;
 using namespace AsteriskSCF::Replication::BridgeService::V1;
+using namespace AsteriskSCF::SessionCommunications::ExtensionPoints::V1;
 using namespace std;
 
 namespace 
@@ -79,7 +80,7 @@ public:
 
     vector<BridgeServantPtr> getBridges();
     
-    void activate();
+    void activate(const ServiceLocatorManagementPrx& locator);
 
     string getID()
     {
@@ -103,7 +104,7 @@ private:
 
     BridgeCreationExtensionPointImplPtr mCreationExtension;
     BridgeCreationExtensionPointPrx mCreationExtensionPrx;
-    ServiceLocatorManagerServicePrx mCreationExtensionPointServicePrx;
+    ServiceManagementPrx mCreationExtensionPointServicePrx;
 
     BridgeManagerStateItemPtr mState;
 
@@ -189,7 +190,7 @@ void BridgeManagerImpl::createBridge_async(const AMD_BridgeManager_createBridgeP
         string stringId = string("bridge.") + IceUtil::generateUUID();
         Ice::Identity id(mAdapter->getCommunicator()->stringToIdentity(stringId));
         BridgePrx prx(BridgePrx::uncheckedCast(mAdapter->createProxy(id)));
-        vector<BridgeListenerPrx> listeners(mState->defaultBridgeListeners);
+        AsteriskSCF::SessionCommunications::V1::BridgeListenerSeq listeners(mState->defaultBridgeListeners);
         if (listener)
         {
             listeners.push_back(listener);
@@ -207,11 +208,10 @@ void BridgeManagerImpl::createBridge_async(const AMD_BridgeManager_createBridgeP
             originalData->initialSessions = sessions;
             originalData = mCreationExtension->runHooks(originalData);
             listeners = originalData->listeners;
-            initialSessions = originalData->sessions;
-            cookies = originalData->cookies;
-            info.externalPrx = originalData->bridge;
+            initialSessions = originalData->initialSessions;
+            info.decoratingPrx = originalData->bridge;
         }
-        BridgeListenerMgrPtr mgr(new BridgeListenerMgr(mAdapter->getCommunicator(), stringId, info.externalPrx));
+        BridgeListenerMgrPtr mgr(new BridgeListenerMgr(mAdapter->getCommunicator(), stringId, info.decoratingPrx));
 
         BridgeServantPtr bridge = BridgeServant::create(stringId, mAdapter, listeners, mgr, mReplicationContext->getReplicator(), mLogger);
         Ice::ObjectPrx obj = mAdapter->add(bridge, id);
@@ -226,7 +226,7 @@ void BridgeManagerImpl::createBridge_async(const AMD_BridgeManager_createBridgeP
         //
         // It's very important to note that the bridge servant will not have it's own proxy!
         // 
-        bridge->activate(info.externalPrx, stringId);
+        bridge->activate(info.decoratingPrx, stringId);
         mBridges.push_back(info);
 
         if (originalData)
@@ -240,7 +240,7 @@ void BridgeManagerImpl::createBridge_async(const AMD_BridgeManager_createBridgeP
             bridge->getAddSessionsTasks(tasks, initialSessions);
         }
 
-        tasks.push_back(new FinishUp(callback, mListeners, info.externalPrx));
+        tasks.push_back(new FinishUp(callback, mListeners, info.decoratingPrx));
         ExecutorPtr runner(new Executor(tasks, mLogger));
         runner->start();
     }
@@ -417,7 +417,7 @@ vector<BridgeServantPtr> BridgeManagerImpl::getBridges()
     return result;
 }
 
-void BridgeManagerImpl::activate(const AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx& locator)
+void BridgeManagerImpl::activate(const AsteriskSCF::Core::Discovery::V1::ServiceLocatorManagementPrx& locator)
 {
     {
         boost::unique_lock<boost::shared_mutex> lock(mLock);
diff --git a/src/BridgeManagerImpl.h b/src/BridgeManagerImpl.h
index da4578a..163d5df 100644
--- a/src/BridgeManagerImpl.h
+++ b/src/BridgeManagerImpl.h
@@ -50,7 +50,7 @@ public:
 
     virtual std::vector<BridgeServantPtr> getBridges() = 0;
 
-    virtual void activate(const AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx&) = 0;
+    virtual void activate(const AsteriskSCF::Core::Discovery::V1::ServiceLocatorManagementPrx&) = 0;
 
     virtual std::string getID() = 0;
 
diff --git a/src/Component.cpp b/src/Component.cpp
index 6af9d0c..5aead5b 100644
--- a/src/Component.cpp
+++ b/src/Component.cpp
@@ -116,13 +116,13 @@ void Component::onPostInitialize()
 {
     if (getReplicationContext()->isActive())
     {
-       mBridgeManager->activate(getServiceLocator()); 
+        mBridgeManager->activate(getServiceLocatorManagement()); 
     }
 }
 
 void Component::onActivated()
 {
-    mBridgeManager->activate(getServiceLocator()); // TBD...Is this really needed? Is there really no standby() correlary?
+    mBridgeManager->activate(getServiceLocatorManagement()); // TBD...Is this really needed? Is there really no standby() correlary?
     // 
     // Response to TBD. None of the AsteriskSCF components support moving from active to standby.. the presumption
     // being that if you are active, the only way you are going to be moved to standby is if you are restarted.

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


-- 
asterisk-scf/integration/bridging.git



More information about the asterisk-scf-commits mailing list