[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 Aug 25 09:52:29 CDT 2010
branch "master" has been updated
via f8dc82ccc9f0838dfbdf9f06b55ebc7cbfe67fef (commit)
via da42dd6467342ac116ca5a06903d291f35fa2e65 (commit)
from d82f64e329cdef13725c7d8b4b2e484d705c601a (commit)
Summary of changes:
cmake | 2 +-
src/BridgeFactoryImpl.cpp | 2 +-
src/BridgeImpl.cpp | 259 +++++++++++++++++++++++++++++++++++++++++----
src/BridgeImpl.h | 16 +++-
test/TestBridging.cpp | 67 +++++++++---
5 files changed, 305 insertions(+), 41 deletions(-)
- Log -----------------------------------------------------------------
commit f8dc82ccc9f0838dfbdf9f06b55ebc7cbfe67fef
Merge: da42dd6 d82f64e
Author: Brent Eagles <beagles at digium.com>
Date: Wed Aug 25 12:21:27 2010 -0230
Merge branch 'master' of ssh://git.asterisk.org/asterisk-scf/integration/bridging
Conflicts:
slice
commit da42dd6467342ac116ca5a06903d291f35fa2e65
Author: Brent Eagles <beagles at digium.com>
Date: Wed Aug 25 12:18:18 2010 -0230
Added proper callup support to bridge implementation. Previously, the endpoints were
simply being added. Now the endpoints are "queued up" until the connected callback
comes back to the bridge. Once the connected() comes back, it is added to the list
of active endpoints and the media connections established.
diff --git a/cmake b/cmake
index 98cbf4a..44414a3 160000
--- a/cmake
+++ b/cmake
@@ -1 +1 @@
-Subproject commit 98cbf4a0d71e2af47068d55a7bcbabf8616aff92
+Subproject commit 44414a3af228fc551c19485018373ba997a3c7b0
diff --git a/slice b/slice
index 5d80463..d6b2777 160000
--- a/slice
+++ b/slice
@@ -1 +1 @@
-Subproject commit 5d804630eb1081d200e1408644b6af22a8a751f3
+Subproject commit d6b2777545b3b8eae7c5dc9b40a1ca3ff9e26a43
diff --git a/src/BridgeFactoryImpl.cpp b/src/BridgeFactoryImpl.cpp
index d906927..79826dc 100644
--- a/src/BridgeFactoryImpl.cpp
+++ b/src/BridgeFactoryImpl.cpp
@@ -139,7 +139,7 @@ Hydra::Core::Bridging::V1::BridgePrx Hydra::BridgeService::BridgeFactoryImpl::cr
}
reap();
- Hydra::BridgeService::BridgeImplPtr bridge = new Hydra::BridgeService::BridgeImpl(adminEp, eps, mgr, mBridgeEvents);
+ Hydra::BridgeService::BridgeImplPtr bridge = new Hydra::BridgeService::BridgeImpl(mAdapter, adminEp, eps, mgr, mBridgeEvents);
Ice::ObjectPrx obj = mAdapter->addWithUUID(bridge);
mBridges.push_back(bridge);
mLogger.getInfoStream() << current.adapter->getCommunicator()->identityToString(current.id) << ": creating new bridge " << obj->ice_toString() << "." << std::endl;
diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index fa573be..5c71bf5 100644
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -117,6 +117,121 @@ namespace BridgeService
Session::V1::ResponseCodePtr mResponseCode;
};
+ //
+ // Functor to support broadcasting ringing notifications.
+ //
+ // TODO: Replace call with AMI invocation and callback.
+ //
+ class RingingBroadcaster : public std::unary_function<BridgeImpl::BridgeEndpoint, void>
+ {
+ public:
+ RingingBroadcaster(const Core::Endpoint::V1::EndpointIdPtr& id) :
+ mId(id)
+ {
+ }
+
+ void operator()(const BridgeImpl::BridgeEndpoint& b)
+ {
+ if(b.endpoint)
+ {
+ Hydra::Session::V1::SessionEndpointPtr p(Hydra::Session::V1::SessionEndpointPtr::dynamicCast(b.endpoint));
+ assert(p != 0);
+ if(p->callback)
+ {
+ p->callback->ring(mId);
+ }
+ }
+ }
+ private:
+ Core::Endpoint::V1::EndpointIdPtr mId;
+ };
+
+ //
+ // Functor to support broadcasting busy notifications.
+ //
+ // TODO: Replace call with AMI invocation and callback.
+ //
+ class BusyBroadcaster : public std::unary_function<BridgeImpl::BridgeEndpoint, void>
+ {
+ public:
+ BusyBroadcaster(const Core::Endpoint::V1::EndpointIdPtr& id) :
+ mId(id)
+ {
+ }
+
+ void operator()(const BridgeImpl::BridgeEndpoint& b)
+ {
+ if(b.endpoint)
+ {
+ Hydra::Session::V1::SessionEndpointPtr p(Hydra::Session::V1::SessionEndpointPtr::dynamicCast(b.endpoint));
+ assert(p != 0);
+ if(p->callback)
+ {
+ p->callback->busy(mId);
+ }
+ }
+ }
+ private:
+ Core::Endpoint::V1::EndpointIdPtr mId;
+ };
+
+ class DefaultBridgeSignallingCallback : public Session::V1::SignalCallback
+ {
+ public:
+
+ DefaultBridgeSignallingCallback(const BridgeImplPtr& bridge) :
+ mBridge(bridge)
+ {
+ }
+
+ void ring(const Core::Endpoint::V1::EndpointIdPtr& p, const Ice::Current&)
+ {
+ mBridge->endpointRinging(p);
+ }
+
+ void connected(const Core::Endpoint::V1::EndpointIdPtr& p, const Ice::Current&)
+ {
+ //
+ // It's here where the actual connection of then endpoint needs to be setup.
+ //
+ mBridge->endpointConnected(p);
+ }
+
+ void terminated(const Core::Endpoint::V1::EndpointIdPtr& p, const Session::V1::ResponseCodePtr& r, const Ice::Current& current)
+ {
+ mBridge->endpointTerminated(p, r, current);
+ }
+
+ void busy(const Core::Endpoint::V1::EndpointIdPtr& p, const Ice::Current&)
+ {
+ mBridge->endpointBusy(p);
+ }
+
+ void congestion(const Core::Endpoint::V1::EndpointIdPtr& p, const Session::V1::ResponseCodePtr& r, const Ice::Current&)
+ {
+ }
+
+ void hold(const Core::Endpoint::V1::EndpointIdPtr& p, const Ice::Current&)
+ {
+ }
+
+ void unhold(const Core::Endpoint::V1::EndpointIdPtr& p, const Ice::Current&)
+ {
+ }
+
+ void flash(const Core::Endpoint::V1::EndpointIdPtr& p, const Ice::Current&)
+ {
+ }
+
+ void progress(const Core::Endpoint::V1::EndpointIdPtr& p, const Session::V1::ResponseCodePtr& r, const Ice::Current&)
+ {
+ }
+
+
+ private:
+ BridgeImplPtr mBridge;
+ };
+
} // End of namespace BridgeService
} // End of namespace Hydra
@@ -126,16 +241,18 @@ static std::string endpointIdToString(const Hydra::Core::Endpoint::V1::EndpointI
}
Hydra::BridgeService::BridgeImpl::BridgeImpl(
+ const Ice::ObjectAdapterPtr& adapter,
const Hydra::Session::V1::SessionEndpointPtr& adminEp,
const Hydra::Session::V1::SessionEndpointSeq& initialEndpoints,
const Hydra::Core::Bridging::V1::BridgeMonitorPrx& manager,
const Hydra::Core::Bridging::V1::BridgeEventsPrx& ev
-
) :
mState(Running),
mMonitor(manager),
mEvents(new Hydra::BridgeService::EventTopicWrapper(ev)),
- mAdminEndpointInList(true)
+ mAdminEndpointInList(true),
+ mBridgeId(new Hydra::Core::Endpoint::V1::EndpointId),
+ mObjAdapter(adapter)
{
if(adminEp)
{
@@ -144,7 +261,23 @@ Hydra::BridgeService::BridgeImpl::BridgeImpl(
}
for(Hydra::Session::V1::SessionEndpointSeq::const_iterator i = initialEndpoints.begin(); i != initialEndpoints.end(); ++i)
{
- mEndpoints.push_back(BridgeEndpoint(*i, mSplicer.connect(endpointIdToString((*i)->id), (*i)->mediaSession)));
+ mQueuedEndpoints.insert(std::pair<std::string, Hydra::Session::V1::SessionEndpointPtr>(endpointIdToString((*i)->id), *i));
+ }
+ mSignalling = Hydra::Session::V1::SignalCallbackPrx::uncheckedCast(mObjAdapter->addWithUUID(new DefaultBridgeSignallingCallback(this)));
+ for(Hydra::Session::V1::SessionEndpointSeq::const_iterator i = initialEndpoints.begin(); i != initialEndpoints.end(); ++i)
+ {
+ (*i)->command->call(mBridgeId, (*i)->id, mSignalling);
+ }
+}
+
+Hydra::BridgeService::BridgeImpl::~BridgeImpl()
+{
+ try
+ {
+ mObjAdapter->remove(mSignalling->ice_getIdentity());
+ }
+ catch(...)
+ {
}
}
@@ -184,10 +317,19 @@ void Hydra::BridgeService::BridgeImpl::addEndpoint(const Hydra::Core::Endpoint::
mLogger.getDebugStream() << __FUNCTION__ << "onAddEndpoint() returned " << result << std::endl;
}
+ if(newEndpoint->command)
+ {
+ newEndpoint->command->call(mBridgeId, newEndpoint->id, mSignalling);
+ mQueuedEndpoints.insert(std::pair<std::string, Hydra::Session::V1::SessionEndpointPtr>(endpointIdToString(newEndpoint->id), newEndpoint));
+ }
+ else
+ {
+ mEndpoints.push_back(BridgeEndpoint(newEndpoint, mSplicer.connect(endpointIdToString(newEndpoint->id), newEndpoint->mediaSession)));
+ }
+
//
// Connect media.
//
- mEndpoints.push_back(BridgeEndpoint(newEndpoint, mSplicer.connect(endpointIdToString(newEndpoint->id), newEndpoint->mediaSession)));
mLogger.getDebugStream() << __FUNCTION__ << ": bridge " << current.adapter->getCommunicator()->identityToString(current.id) <<
" now has " << mEndpoints.size() << " endpoints." << std::endl;
mEvents->endpointAdded(newEndpoint);
@@ -302,33 +444,108 @@ void Hydra::BridgeService::BridgeImpl::shutdown(const Ice::Current& current)
void Hydra::BridgeService::BridgeImpl::destroy(const Ice::Current& current)
{
- mLogger.getTraceStream() << __FUNCTION__ << ":" << current.adapter->getCommunicator()->identityToString(current.id) << std::endl;
+ {
+ mLogger.getTraceStream() << __FUNCTION__ << ":" << current.adapter->getCommunicator()->identityToString(current.id) << std::endl;
+ boost::unique_lock<boost::shared_mutex> lock(mLock);
+ if(mState == ShuttingDown)
+ {
+ mLogger.getDebugStream() << __FUNCTION__ << ": called when shutting down." << std::endl;
+ throw Hydra::System::Component::V1::ShuttingDown();
+ }
+ if(mState == Destroyed)
+ {
+ mLogger.getDebugStream() << __FUNCTION__ << ": called when destroyed." << std::endl;
+ throw Ice::ObjectNotExistException(__FILE__, __LINE__);
+ }
+ if(mMonitor)
+ {
+ bool result = mMonitor->onDestroy();
+ mLogger.getDebugStream() << __FUNCTION__ << "onDestroy() returned " << result << std::endl;
+ }
+ mState = Destroyed;
+ mLogger.getInfoStream() << current.adapter->getCommunicator()->identityToString(current.id) << ": is now destroyed." << std::endl;
+ mEvents->stopped();
+ }
+ //
+ // Last act is to remove the servant from the map.
+ //
+ mObjAdapter->remove(current.id);
+}
+
+bool Hydra::BridgeService::BridgeImpl::destroyed()
+{
+ boost::shared_lock<boost::shared_mutex> lock(mLock);
+ mLogger.getDebugStream() << __FUNCTION__ << ": " << (mState == Destroyed ? "yes, I am destroyed." : "no, I am not destroyed") << std::endl;
+ return mState == Destroyed;
+}
+
+void Hydra::BridgeService::BridgeImpl::endpointConnected(const Hydra::Core::Endpoint::V1::EndpointIdPtr& id)
+{
boost::unique_lock<boost::shared_mutex> lock(mLock);
- if(mState == ShuttingDown)
+ std::map<std::string, Hydra::Session::V1::SessionEndpointPtr>::iterator i = mQueuedEndpoints.find(endpointIdToString(id));
+ if(i != mQueuedEndpoints.end())
{
- mLogger.getDebugStream() << __FUNCTION__ << ": called when shutting down." << std::endl;
- throw Hydra::System::Component::V1::ShuttingDown();
+ mEndpoints.push_back(BridgeEndpoint(i->second, mSplicer.connect(endpointIdToString(id), i->second->mediaSession)));
+ mQueuedEndpoints.erase(i);
}
- if(mState == Destroyed)
+}
+
+void Hydra::BridgeService::BridgeImpl::endpointTerminated(const Hydra::Core::Endpoint::V1::EndpointIdPtr& id,
+ const Hydra::Session::V1::ResponseCodePtr& response,
+ const Ice::Current& current)
+{
{
- mLogger.getDebugStream() << __FUNCTION__ << ": called when destroyed." << std::endl;
- throw Ice::ObjectNotExistException(__FILE__, __LINE__);
+ //
+ // Check list of endpoints first.
+ //
+ boost::unique_lock<boost::shared_mutex> lock(mLock);
+ std::vector<Hydra::BridgeService::BridgeImpl::BridgeEndpoint>::iterator i = find(id);
+ if(i != mEndpoints.end())
+ {
+ i->endpoint->callback->terminated(id, response);
+ removeEndpoint(id, current);
+ return;
+ }
}
- if(mMonitor)
+ if(mAdminEndpoint.get() != 0)
+ {
+ if(id->endpointManagerId == mAdminEndpoint->endpoint->id->endpointManagerId && id->destinationId == mAdminEndpoint->endpoint->id->destinationId)
+ {
+ //
+ // Default behavior will be for the bridge to shutdown when the admin endpoint leaves.
+ //
+ shutdown(current);
+ }
+ else
+ {
+ }
+ }
+}
+
+void Hydra::BridgeService::BridgeImpl::endpointRinging(const Hydra::Core::Endpoint::V1::EndpointIdPtr& id)
+{
+ boost::unique_lock<boost::shared_mutex> lock(mLock);
+ if(mAdminEndpoint.get() != 0)
{
- bool result = mMonitor->onDestroy();
- mLogger.getDebugStream() << __FUNCTION__ << "onDestroy() returned " << result << std::endl;
+ mAdminEndpoint->endpoint->callback->ring(id);
+ }
+ else
+ {
+ std::for_each(mEndpoints.begin(), mEndpoints.end(), Hydra::BridgeService::RingingBroadcaster(id));
}
- mState = Destroyed;
- mLogger.getInfoStream() << current.adapter->getCommunicator()->identityToString(current.id) << ": is now destroyed." << std::endl;
- mEvents->stopped();
}
-bool Hydra::BridgeService::BridgeImpl::destroyed()
+void Hydra::BridgeService::BridgeImpl::endpointBusy(const Hydra::Core::Endpoint::V1::EndpointIdPtr& id)
{
- boost::shared_lock<boost::shared_mutex> lock(mLock);
- mLogger.getDebugStream() << __FUNCTION__ << ": " << (mState == Destroyed ? "yes, I am destroyed." : "no, I am not destroyed") << std::endl;
- return mState == Destroyed;
+ boost::unique_lock<boost::shared_mutex> lock(mLock);
+ if(mAdminEndpoint.get() != 0)
+ {
+ mAdminEndpoint->endpoint->callback->busy(id);
+ }
+ else
+ {
+ std::for_each(mEndpoints.begin(), mEndpoints.end(), Hydra::BridgeService::BusyBroadcaster(id));
+ }
}
void Hydra::BridgeService::BridgeImpl::statePreCheck()
diff --git a/src/BridgeImpl.h b/src/BridgeImpl.h
index 9261a9a..92a1bfc 100644
--- a/src/BridgeImpl.h
+++ b/src/BridgeImpl.h
@@ -43,9 +43,11 @@ namespace BridgeService
}
};
- BridgeImpl(const Session::V1::SessionEndpointPtr& adminEp, const Session::V1::SessionEndpointSeq& initialEndpoints,
+ BridgeImpl(const Ice::ObjectAdapterPtr& objAdapter, const Session::V1::SessionEndpointPtr& adminEp, const Session::V1::SessionEndpointSeq& initialEndpoints,
const Core::Bridging::V1::BridgeMonitorPrx& manager, const Core::Bridging::V1::BridgeEventsPrx& ev);
+ ~BridgeImpl();
+
//
// Hydra::Core::Bridging::Bridge Interface
//
@@ -60,6 +62,11 @@ namespace BridgeService
//
bool destroyed();
+ void endpointConnected(const Core::Endpoint::V1::EndpointIdPtr& id);
+ void endpointTerminated(const Core::Endpoint::V1::EndpointIdPtr& id, const Session::V1::ResponseCodePtr& response, const Ice::Current&);
+ void endpointRinging(const Core::Endpoint::V1::EndpointIdPtr& id);
+ void endpointBusy(const Core::Endpoint::V1::EndpointIdPtr& id);
+
private:
boost::shared_mutex mLock;
@@ -76,6 +83,8 @@ namespace BridgeService
Core::Bridging::V1::BridgeMonitorPrx mMonitor;
std::auto_ptr<EventTopicWrapper> mEvents;
+ std::map<std::string, Session::V1::SessionEndpointPtr> mQueuedEndpoints;
+
MediaSplicer mSplicer;
//
@@ -84,6 +93,11 @@ namespace BridgeService
bool mAdminEndpointInList;
Logger mLogger;
+ Core::Endpoint::V1::EndpointIdPtr mBridgeId;
+
+ Ice::ObjectAdapterPtr mObjAdapter;
+ Session::V1::SignalCallbackPrx mSignalling;
+
void statePreCheck();
std::vector<BridgeEndpoint>::iterator find(const Core::Endpoint::V1::EndpointIdPtr& e);
};
diff --git a/test/TestBridging.cpp b/test/TestBridging.cpp
index 79c63de..1b82333 100644
--- a/test/TestBridging.cpp
+++ b/test/TestBridging.cpp
@@ -298,7 +298,7 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointValidationAddInvalidType)
dummy.id = comm->stringToIdentity("testobject");
try
{
- Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
+ Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(adapter, 0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
try
{
Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Core::Endpoint::V1::BaseEndpoint);
@@ -333,7 +333,7 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointValidationAddInvalidValue)
dummy.id = comm->stringToIdentity("testobject");
try
{
- Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
+ Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(adapter, 0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
try
{
b->addEndpoint(0, dummy);
@@ -362,7 +362,7 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointValidationAddValidTypeNullId)
Ice::Current dummy;
dummy.adapter = adapter;
dummy.id = comm->stringToIdentity("testobject");
- Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
+ Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(adapter, 0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
try
{
try
@@ -395,7 +395,7 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointValidationAddValidTypeInvalidId)
Ice::Current dummy;
dummy.adapter = adapter;
dummy.id = comm->stringToIdentity("testobject");
- Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
+ Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(adapter, 0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
try
{
try
@@ -432,7 +432,7 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointAddValidTypeValidValue)
Ice::Current dummy;
dummy.adapter = adapter;
dummy.id = comm->stringToIdentity("testobject");
- Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
+ Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(adapter, 0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
try
{
try
@@ -468,7 +468,7 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointListEp)
Ice::Current dummy;
dummy.adapter = adapter;
dummy.id = comm->stringToIdentity("testobject");
- Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
+ Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(adapter, 0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
try
{
try
@@ -957,7 +957,7 @@ BOOST_AUTO_TEST_CASE(BridgeAddEndpoint)
p->id->endpointManagerId = "fooa";
p->id->destinationId = "bar";
Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession3");
- Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(p, eps, 0, 0));
+ Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(adapter, p, eps, 0, 0));
eps.insert(eps.begin(), p);
p = new Hydra::Session::V1::SessionEndpoint;
p->id = new Hydra::Core::Endpoint::V1::EndpointId;
@@ -1026,7 +1026,7 @@ BOOST_AUTO_TEST_CASE(BridgeAddEndpointAlreadyRegistered)
p->id->endpointManagerId = "fooa";
p->id->destinationId = "bar";
Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession3");
- Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(p, eps, 0, 0));
+ Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(adapter, p, eps, 0, 0));
eps.insert(eps.begin(), p);
p = new Hydra::Session::V1::SessionEndpoint;
p->id = new Hydra::Core::Endpoint::V1::EndpointId;
@@ -1078,7 +1078,7 @@ BOOST_AUTO_TEST_CASE(BridgeAddInvalidEndpoint)
try
{
Hydra::Session::V1::SessionEndpointSeq eps;
- Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0, 0));
+ Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(adapter, 0, eps, 0, 0));
Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Core::Endpoint::V1::BaseEndpoint);
p->id = new Hydra::Core::Endpoint::V1::EndpointId;
p->id->endpointManagerId = "foo";
@@ -1111,7 +1111,7 @@ BOOST_AUTO_TEST_CASE(BridgeAddInvalidId1)
try
{
Hydra::Session::V1::SessionEndpointSeq eps;
- Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0, 0));
+ Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(adapter, 0, eps, 0, 0));
Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Session::V1::SessionEndpoint);
p->id = new Hydra::Core::Endpoint::V1::EndpointId;
p->id->endpointManagerId = "";
@@ -1145,7 +1145,7 @@ BOOST_AUTO_TEST_CASE(BridgeAddInvalidId2)
try
{
Hydra::Session::V1::SessionEndpointSeq eps;
- Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0, 0));
+ Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(adapter, 0, eps, 0, 0));
Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Session::V1::SessionEndpoint);
Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
bridge->addEndpoint(p, dummy);
@@ -1199,7 +1199,7 @@ BOOST_AUTO_TEST_CASE(BridgeRemoveEndpoint)
p->id->endpointManagerId = "fooa";
p->id->destinationId = "bar";
Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession3");
- Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(p, eps, 0, 0));
+ Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(adapter, p, eps, 0, 0));
eps.insert(eps.begin(), p);
Hydra::Core::Endpoint::V1::EndpointIdPtr id(new Hydra::Core::Endpoint::V1::EndpointId);
id->endpointManagerId = "foo1";
@@ -1264,7 +1264,7 @@ BOOST_AUTO_TEST_CASE(BridgeRemoveEndpointUnknownEndpoint)
p->id->endpointManagerId = "fooa";
p->id->destinationId = "bar";
Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession3");
- Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(p, eps, 0, 0 ));
+ Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(adapter, p, eps, 0, 0 ));
Hydra::Core::Endpoint::V1::EndpointIdPtr id(new Hydra::Core::Endpoint::V1::EndpointId);
id->endpointManagerId = "foo1";
id->destinationId = "unknown";
@@ -1296,7 +1296,7 @@ BOOST_AUTO_TEST_CASE(BridgeRemoveEndpointNullId)
try
{
Hydra::Session::V1::SessionEndpointSeq eps;
- Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0, 0));
+ Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(adapter, 0, eps, 0, 0));
bridge->removeEndpoint(0, dummy);
BOOST_CHECK("Should not have succeeded." == 0);
}
@@ -1325,7 +1325,7 @@ BOOST_AUTO_TEST_CASE(BridgeRemoveEndpointInvalidId)
try
{
Hydra::Session::V1::SessionEndpointSeq eps;
- Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0, 0));
+ Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(adapter, 0, eps, 0, 0));
Hydra::Core::Endpoint::V1::EndpointIdPtr id(new Hydra::Core::Endpoint::V1::EndpointId);
id->endpointManagerId = "";
id->destinationId = "";
@@ -1362,7 +1362,7 @@ BOOST_AUTO_TEST_CASE(BridgeOperationsAfterShutdown)
try
{
Hydra::Session::V1::SessionEndpointSeq eps;
- Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0, 0));
+ Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(adapter, 0, eps, 0, 0));
bridge->shutdown(dummy);
//
// Calling shutdown while in the process of shutting down is permitted but is a no-op.
@@ -1468,7 +1468,8 @@ BOOST_AUTO_TEST_CASE(BridgeOperationsAfterDestroy)
try
{
Hydra::Session::V1::SessionEndpointSeq eps;
- Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0, 0));
+ Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(adapter, 0, eps, 0, 0));
+ std::cerr << "Hunh" << std::endl;
bridge->destroy(dummy);
//
// Calling shutdown while in the process of shutting down is permitted but is a no-op.
@@ -1481,6 +1482,11 @@ BOOST_AUTO_TEST_CASE(BridgeOperationsAfterDestroy)
}
catch(const Ice::ObjectNotExistException&)
{
+ BOOST_CHECK("should not have succeeded." == 0);
+ }
+ catch(const Ice::NotRegisteredException&)
+ {
+ BOOST_CHECK(true);
}
try
{
@@ -1495,6 +1501,10 @@ BOOST_AUTO_TEST_CASE(BridgeOperationsAfterDestroy)
catch(const Ice::ObjectNotExistException&)
{
}
+ catch(const Ice::NotRegisteredException&)
+ {
+ BOOST_CHECK(true);
+ }
try
{
Hydra::Session::V1::SessionEndpointPtr p(new Hydra::Session::V1::SessionEndpoint);
@@ -1506,6 +1516,11 @@ BOOST_AUTO_TEST_CASE(BridgeOperationsAfterDestroy)
}
catch(const Ice::ObjectNotExistException&)
{
+ BOOST_CHECK("should not have succeeded." == 0);
+ }
+ catch(const Ice::NotRegisteredException&)
+ {
+ BOOST_CHECK(true);
}
try
{
@@ -1514,6 +1529,11 @@ BOOST_AUTO_TEST_CASE(BridgeOperationsAfterDestroy)
}
catch(const Ice::ObjectNotExistException&)
{
+ BOOST_CHECK("should not have succeeded." == 0);
+ }
+ catch(const Ice::NotRegisteredException&)
+ {
+ BOOST_CHECK(true);
}
try
{
@@ -1532,6 +1552,10 @@ BOOST_AUTO_TEST_CASE(BridgeOperationsAfterDestroy)
{
BOOST_CHECK("but this might happen in the future" != 0);
}
+ catch(const Ice::NotRegisteredException&)
+ {
+ BOOST_CHECK(true);
+ }
try
{
Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Core::Endpoint::V1::BaseEndpoint);
@@ -1546,6 +1570,10 @@ BOOST_AUTO_TEST_CASE(BridgeOperationsAfterDestroy)
{
BOOST_CHECK("but this might happen in the future" != 0);
}
+ catch(const Ice::NotRegisteredException&)
+ {
+ BOOST_CHECK(true);
+ }
try
{
Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Core::Endpoint::V1::BaseEndpoint);
@@ -1554,6 +1582,11 @@ BOOST_AUTO_TEST_CASE(BridgeOperationsAfterDestroy)
}
catch(const Ice::ObjectNotExistException&)
{
+ BOOST_CHECK("should not have succeeded." == 0);
+ }
+ catch(const Ice::NotRegisteredException&)
+ {
+ BOOST_CHECK(true);
}
}
catch(...)
-----------------------------------------------------------------------
--
asterisk-scf/integration/bridging.git
More information about the asterisk-scf-commits
mailing list