[asterisk-scf-commits] asterisk-scf/integration/bridging.git branch "async-bridging" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Thu Mar 3 14:41:04 CST 2011
branch "async-bridging" has been updated
via 14ba2849cb6bfb07c77d2d32512ea242fc9da87c (commit)
via 4825f1e1855c0f3e6cceafac67ca693faedb4423 (commit)
via 007048196f9c9f1f19f35126961804a9928e4312 (commit)
via d44c4a263724b7ce6900103bf24dcc0b89a0bd8f (commit)
via 381d74f1d554b08eaa22db45062fd709b35a4ce5 (commit)
via 5f3eac5c37e27f7d0aaf3b8ee19eae4410c124d7 (commit)
via 648a2edcda7992f8e4e7e72eb5c9f8ce4d0f4d20 (commit)
via 86832b8c359690a79b152dc657aea9c969379f44 (commit)
via a2b836e84227da376985070f22f8a6cc31ec459f (commit)
via 3a967cb0590297d35cf9fa290512d32bf2423799 (commit)
from a8b20b2310bc2e8a33089671ff94e4574445576e (commit)
Summary of changes:
config/test_bridging.conf.in | 41 +-
src/BridgeImpl.cpp | 1032 +++++++------------
src/BridgeImpl.h | 25 +-
src/BridgeManagerImpl.cpp | 29 +-
src/BridgeManagerImpl.h | 2 +
src/BridgeReplicatorIf.ice | 88 ++-
src/BridgeReplicatorStateListenerI.cpp | 189 ++++-
src/CMakeLists.txt | 8 +
src/DebugUtil.h | 37 +-
src/ListenerManager.h | 34 +-
src/MediaSplicer.cpp | 253 ++++-
src/MediaSplicer.h | 19 +-
src/Service.cpp | 2 +-
src/ServiceUtil.h | 3 +
src/SessionCollection.cpp | 211 ++++
src/SessionCollection.h | 138 +++
src/SessionListener.cpp | 141 +++
...eplicatorStateListenerI.h => SessionListener.h} | 22 +-
src/SessionOperations.cpp | 122 +++
src/SessionOperations.h | 206 ++++
src/SessionWrapper.cpp | 222 +++++
src/SessionWrapper.h | 142 +++
test/BridgeManagerListenerI.cpp | 1 -
test/CMakeLists.txt | 56 +-
test/TestBridging.cpp | 23 +-
test/UnitTests.cpp | 390 ++++++++
26 files changed, 2605 insertions(+), 831 deletions(-)
create mode 100644 src/SessionCollection.cpp
create mode 100644 src/SessionCollection.h
create mode 100644 src/SessionListener.cpp
copy src/{BridgeReplicatorStateListenerI.h => SessionListener.h} (65%)
create mode 100644 src/SessionOperations.cpp
create mode 100644 src/SessionOperations.h
create mode 100644 src/SessionWrapper.cpp
create mode 100644 src/SessionWrapper.h
create mode 100644 test/UnitTests.cpp
- Log -----------------------------------------------------------------
commit 14ba2849cb6bfb07c77d2d32512ea242fc9da87c
Author: Brent Eagles <beagles at digium.com>
Date: Thu Mar 3 17:10:30 2011 -0330
Fix some compile errors caused by the merge.
diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index c06e794..7b45558 100644
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -239,8 +239,7 @@ void BridgeImpl::addSessions(const SessionSeq& sessions)
}
checkSessions(sessions);
statePreCheck();
- mLogger(Debug) << FUNLOG << ": adding " << sessions.size() << " sessions to "
- << current.adapter->getCommunicator()->identityToString(current.id);
+ mLogger(Debug) << FUNLOG << ": adding " << sessions.size() << " sessions";
SessionSeq addedSessions;
for (SessionSeq::const_iterator i = sessions.begin(); i != sessions.end(); ++i)
diff --git a/src/BridgeImpl.h b/src/BridgeImpl.h
index a87acd6..1276482 100644
--- a/src/BridgeImpl.h
+++ b/src/BridgeImpl.h
@@ -96,6 +96,8 @@ public:
**/
virtual void activate(const AsteriskSCF::SessionCommunications::V1::BridgePrx& proxy) = 0;
+ virtual void addSessions(const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions) = 0;
+
/**
*
* Replication helper methods
commit 4825f1e1855c0f3e6cceafac67ca693faedb4423
Merge: a8b20b2 0070481
Author: Brent Eagles <beagles at digium.com>
Date: Thu Mar 3 16:43:36 2011 -0330
Merging updates for changes to bridge service.
diff --cc src/BridgeImpl.cpp
index d21e94e,4dd7969..c06e794
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@@ -572,29 -297,15 +302,33 @@@ void BridgeImpl::addSessions(const Sess
if (addedSessions.size())
{
mListeners->sessionsAdded(addedSessions);
+ {
+ boost::unique_lock<boost::shared_mutex> lock(mLock);
+ update = createUpdate();
+ }
}
+ pushUpdate(update);
}
+void BridgeImpl::addSessions_async(const AMD_Bridge_addSessionsPtr& callback, const SessionSeq& sessions,
+ const Ice::Current& current)
+{
+ try
+ {
+ addSessions(sessions);
+ callback->ice_response();
+ }
+ catch (const std::exception& ex)
+ {
+ callback->ice_exception(ex);
+ }
+ catch (...)
+ {
+ callback->ice_exception();
+ }
+}
+
- void BridgeImpl::removeSessions(
- const SessionSeq& sessions, const Ice::Current& current)
+ void BridgeImpl::removeSessions(const SessionSeq& sessions, const Ice::Current& current)
{
if (sessions.size() == 0)
{
@@@ -650,39 -346,14 +369,32 @@@
{
spawnShutdown();
}
+ mSessions->reap();
}
+void BridgeImpl::removeSessions_async(const AMD_Bridge_removeSessionsPtr& callback, const SessionSeq& sessions,
+ const Ice::Current& current)
+{
+ try
+ {
+ removeSessions(sessions, current);
+ callback->ice_response();
+ }
+ catch (const std::exception& ex)
+ {
+ callback->ice_exception(ex);
+ }
+ catch (...)
+ {
+ callback->ice_exception();
+ }
+}
+
SessionSeq BridgeImpl::listSessions(const Ice::Current& current)
{
- mLogger(Debug) << FUNLOG << ":" << objectIdFromCurrent(current);
- boost::shared_lock<boost::shared_mutex> lock(mLock);
+ mLogger(Debug) << FUNLOG << ":" << objectIdFromCurrent(current);
statePreCheck();
- mLogger(Debug) << FUNLOG << ": working with " << mState->bridgedSessions.size() << " sessions." ;
- SessionSeq result;
- for (vector<BridgedSessionPtr>::const_iterator i = mState->bridgedSessions.begin(); i != mState->bridgedSessions.end();
- ++i)
- {
- result.push_back((*i)->session);
- }
- return result;
+ return mSessions->getSessionSeq();
}
void BridgeImpl::shutdown(const Ice::Current& current)
@@@ -900,34 -577,9 +618,27 @@@ void BridgeImpl::replaceSession(const S
//
// Now update the listeners.
//
- SessionSeq sessions(newSessions);
- mListeners->sessionsAdded(sessions);
- if (toRemove)
- {
- sessions.clear();
- sessions.push_back(oldSession);
- mListeners->sessionsRemoved(sessions);
- }
+ mListeners->sessionsAdded(added);
}
+void BridgeImpl::replaceSession_async(const AMD_Bridge_replaceSessionPtr& callback, const SessionPrx& sessionToReplace,
+ const SessionSeq& newSessions, const Ice::Current& current)
+{
+ try
+ {
+ replaceSession(sessionToReplace, newSessions, current);
+ callback->ice_response();
+ }
+ catch (const std::exception& ex)
+ {
+ callback->ice_exception(ex);
+ }
+ catch (...)
+ {
+ callback->ice_exception();
+ }
+}
+
bool BridgeImpl::destroyed()
{
boost::shared_lock<boost::shared_mutex> lock(mLock);
-----------------------------------------------------------------------
--
asterisk-scf/integration/bridging.git
More information about the asterisk-scf-commits
mailing list