[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "transfer" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Thu Oct 14 09:02:41 CDT 2010
branch "transfer" has been updated
via 4260e5faf767c539fb7c840d739a7a693488da3a (commit)
from 48e54d3c6bdb2767f3fbb02c72094e64bb287aa4 (commit)
Summary of changes:
src/SipChannelServiceApp.cpp | 29 ++++++++++++++++++++---------
1 files changed, 20 insertions(+), 9 deletions(-)
- Log -----------------------------------------------------------------
commit 4260e5faf767c539fb7c840d739a7a693488da3a
Author: Joshua Colp <jcolp at digium.com>
Date: Thu Oct 14 11:00:32 2010 -0300
Change last commit and split apart finding of the state replicator and listener initialization.
diff --git a/src/SipChannelServiceApp.cpp b/src/SipChannelServiceApp.cpp
index d5f8e26..e79d319 100644
--- a/src/SipChannelServiceApp.cpp
+++ b/src/SipChannelServiceApp.cpp
@@ -78,6 +78,7 @@ private:
void locateRoutingService();
void locateSessionRouter();
void locateStateReplicator();
+ void registerWithStateReplicator();
void locateBridgeService();
void registerWithRoutingService();
void deregisterFromRoutingService();
@@ -363,13 +364,6 @@ void SipChannelService::locateStateReplicator()
{
Ice::ObjectPrx objectPrx = mServiceLocator->locate(replicatorParams);
mStateReplicator = SIP::V1::SipStateReplicatorPrx::checkedCast(objectPrx);
-
- // Are we a listener?
- if (mCommunicator->getProperties()->getPropertyWithDefault("Sip.StateReplicatorListener", "no") == "yes")
- {
- mStateReplicator->addListener(mReplicatorListenerProxy);
- mReplicaService->standby();
- }
}
catch (...)
{
@@ -377,6 +371,20 @@ void SipChannelService::locateStateReplicator()
}
}
+void SipChannelService::registerWithStateReplicator()
+{
+ if (mStateReplicator == 0)
+ {
+ return;
+ }
+
+ if (mCommunicator->getProperties()->getPropertyWithDefault("Sip.StateReplicatorListener", "no") == "yes")
+ {
+ mStateReplicator->addListener(mReplicatorListenerProxy);
+ mReplicaService->standby();
+ }
+}
+
/**
* Get a reference to the Session Routing Service interface that we care about, and cache it in the Data Model.
* This will allow us to route sessions.
@@ -570,11 +578,14 @@ void SipChannelService::start(const string& name, const Ice::CommunicatorPtr& ic
// Locate the Session Router so we can REALLY do routing.
locateSessionRouter();
- registerPJSipModules(mPJSipManager->getEndpoint());
-
// Locate the State Replicator so we can fail over!
locateStateReplicator();
+ registerPJSipModules(mPJSipManager->getEndpoint());
+
+ // Register with the state replicator if we are a listener
+ registerWithStateReplicator();
+
// Register our Endpoint Locator so that we can provide endpoints to the
// Routing Service for the endpoints we manage.
registerWithRoutingService();
-----------------------------------------------------------------------
--
asterisk-scf/integration/sip.git
More information about the asterisk-scf-commits
mailing list