[asterisk-scf-commits] asterisk-scf/release/sip.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Fri Jun 17 16:56:28 CDT 2011
branch "master" has been updated
via 09511d65f232bb4d04758c6e124a8649f20ad19b (commit)
from 842ac2916a9dacfa0151dd121763d94aba3f23b5 (commit)
Summary of changes:
src/SipEndpoint.cpp | 88 ------------------------------------------
src/SipEndpoint.h | 18 ---------
src/SipEndpointFactory.cpp | 11 -----
src/SipEndpointFactory.h | 2 -
src/SipSessionManagerApp.cpp | 16 --------
5 files changed, 0 insertions(+), 135 deletions(-)
- Log -----------------------------------------------------------------
commit 09511d65f232bb4d04758c6e124a8649f20ad19b
Author: Mark Michelson <mmichelson at digium.com>
Date: Fri Jun 17 16:55:57 2011 -0500
Get rid of the ability to configure endpoints in an Ice config file.
At this point, the dynamic configuration is easier to use and has more
options. The old code confused matters for developers.
diff --git a/src/SipEndpoint.cpp b/src/SipEndpoint.cpp
index 3ff806f..2a6af1a 100644
--- a/src/SipEndpoint.cpp
+++ b/src/SipEndpoint.cpp
@@ -98,24 +98,6 @@ public:
AsteriskSCF::System::Component::V1::ReplicaPtr mReplica;
};
-/**
- * Default constructor.
- */
-SipEndpoint::SipEndpoint(const Ice::ObjectAdapterPtr& adapter, const boost::shared_ptr<SipEndpointFactory>& factory,
- const std::string& name, const Ice::PropertyDict& props, PJSipManager *manager,
- const AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx& serviceLocator,
- const AsteriskSCF::System::Component::V1::ReplicaPtr& replica)
- : mImplPriv(new SipEndpointImplPriv(adapter, factory, name, manager, serviceLocator, replica))
-{
- lg(Debug) << "Constructing SIP endpoint " << name;
-
- mImplPriv->mEndpointProxy =
- AsteriskSCF::SessionCommunications::V1::SessionEndpointPrx::uncheckedCast(
- mImplPriv->mAdapter->addWithUUID(this));
-
- setConfiguration(props);
-}
-
SipEndpoint::SipEndpoint(Ice::ObjectAdapterPtr adapter, boost::shared_ptr<SipEndpointFactory> factory, std::string name, PJSipManager *manager,
const AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx& serviceLocator, const AsteriskSCF::System::Component::V1::ReplicaPtr replica)
: mImplPriv(new SipEndpointImplPriv(adapter, factory, name, manager, serviceLocator, replica))
@@ -159,76 +141,6 @@ void SipEndpoint::setRTPOverIPv6(bool enabled)
mImplPriv->mConfig.sessionConfig.rtpOverIPv6 = enabled;
}
-void SipEndpoint::setConfiguration(const Ice::PropertyDict& props)
-{
- setTransportConfiguration(props);
- //setAuthConfiguration(props);
- //setRegistrationConfiguration(props);
- setSessionConfiguration(props);
- //setMediaConfiguration(props);
- //setSubscriptionConfiguration(props);
-}
-
-void SipEndpoint::setTransportConfiguration(const Ice::PropertyDict& props)
-{
- std::string prefix("Sip.Endpoint.");
- prefix.append(mImplPriv->mName);
- prefix.append(".Transport.");
- // Got the basic prefix. Now get the known config options.
- Ice::PropertyDict::const_iterator IpAddress = props.find(prefix + "Address");
- if (IpAddress != props.end())
- {
- pj_str_t addr;
- pj_sockaddr sockaddr;
- pj_cstr(&addr, IpAddress->second.c_str());
- if (pj_sockaddr_parse(pj_AF_UNSPEC(), 0, &addr, &sockaddr) != PJ_SUCCESS)
- {
- lg(Error) << "Bad address specifier in transport configuration for SIP endpoint " << mImplPriv->mName;
- }
- else
- {
- mImplPriv->mConfig.transportConfig.address = IpAddress->second;
- }
- }
- Ice::PropertyDict::const_iterator direction = props.find(prefix + "SecureTransport");
- if (direction != props.end())
- {
- mImplPriv->mConfig.transportConfig.secureTransport = SipEndpointConfig::stringToDirection(direction->second);
- }
- Ice::PropertyDict::const_iterator user = props.find(prefix + "User");
- if (user != props.end())
- {
- mImplPriv->mConfig.transportConfig.user = user->second;
- }
-}
-
-void SipEndpoint::setSessionConfiguration(const Ice::PropertyDict& props)
-{
- std::string prefix("Sip.Endpoint.");
- prefix.append(mImplPriv->mName);
- prefix.append(".Session.");
- Ice::PropertyDict::const_iterator direction = props.find(prefix + "CallDirection");
- if (direction != props.end())
- {
- mImplPriv->mConfig.sessionConfig.callDirection = SipEndpointConfig::stringToDirection(direction->second);
- }
- Ice::PropertyDict::const_iterator address = props.find(prefix + "SourceAddress");
- if (address != props.end())
- {
- pj_str_t addr;
- pj_sockaddr sockaddr;
- pj_cstr(&addr, address->second.c_str());
- if (pj_sockaddr_parse(pj_AF_UNSPEC(), 0, &addr, &sockaddr) != PJ_SUCCESS)
- {
- lg(Error) << "Bad address specifier in session configuration for SIP endpoint " << mImplPriv->mName;
- }
- else
- {
- mImplPriv->mConfig.sessionConfig.sourceAddress = address->second;
- }
- }
-}
-
Direction SipEndpointConfig::stringToDirection(const std::string& directionString)
{
if (directionString == "Both")
diff --git a/src/SipEndpoint.h b/src/SipEndpoint.h
index 40a8e25..cb91a66 100644
--- a/src/SipEndpoint.h
+++ b/src/SipEndpoint.h
@@ -211,11 +211,6 @@ class SipEndpointImplPriv;
class SipEndpoint : public AsteriskSCF::SessionCommunications::V1::SessionEndpoint
{
public:
- SipEndpoint(const Ice::ObjectAdapterPtr& adapter, const boost::shared_ptr<SipEndpointFactory>& factory,
- const std::string& name, const Ice::PropertyDict& props, PJSipManager *manager,
- const AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx& serviceLocator,
- const AsteriskSCF::System::Component::V1::ReplicaPtr& replica);
-
SipEndpoint(Ice::ObjectAdapterPtr adapter, boost::shared_ptr<SipEndpointFactory> factory, std::string name, PJSipManager *manager,
const AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx& serviceLocator, const AsteriskSCF::System::Component::V1::ReplicaPtr replica);
@@ -265,19 +260,6 @@ private:
* Private implementation details.
*/
boost::shared_ptr<SipEndpointImplPriv> mImplPriv;
-
- /**
- * Set up configuration for the endpoint
- */
- void setConfiguration(const Ice::PropertyDict& props);
-
- void setTransportConfiguration(const Ice::PropertyDict& props);
-
- void setSessionConfiguration(const Ice::PropertyDict& props);
- void setRegistrationConfiguration(const Ice::PropertyDict& props);
- void setAuthConfiguration(const Ice::PropertyDict& props);
- void setMediaConfiguration(const Ice::PropertyDict& props);
- void setSubscriptionConfiguration(const Ice::PropertyDict& props);
};
/**
diff --git a/src/SipEndpointFactory.cpp b/src/SipEndpointFactory.cpp
index 09c4704..61349c9 100644
--- a/src/SipEndpointFactory.cpp
+++ b/src/SipEndpointFactory.cpp
@@ -22,17 +22,6 @@ namespace AsteriskSCF
namespace SipSessionManager
{
-SipEndpointPtr SipEndpointFactory::createEndpoint(const std::string& destination, const Ice::PropertiesPtr& props)
-{
- std::string prefix("Sip.Endpoint.");
- prefix.append(destination);
- Ice::PropertyDict endpointProps = props->getPropertiesForPrefix(prefix);
- SipEndpointPtr endpoint = new SipEndpoint(mAdapter, shared_from_this(), destination, endpointProps, mManager,
- mServiceLocator, mReplica);
- mEndpoints.push_back(endpoint);
- return endpoint;
-}
-
SipEndpointPtr SipEndpointFactory::createEndpoint(std::string endpointName)
{
SipEndpointPtr endpoint = new SipEndpoint(mAdapter, shared_from_this(), endpointName, mManager, mServiceLocator, mReplica);
diff --git a/src/SipEndpointFactory.h b/src/SipEndpointFactory.h
index 48cfd97..d16637f 100644
--- a/src/SipEndpointFactory.h
+++ b/src/SipEndpointFactory.h
@@ -40,8 +40,6 @@ public:
const AsteriskSCF::System::Component::V1::ReplicaPtr& replica) :
mAdapter(adapter), mManager(manager), mServiceLocator(serviceLocator), mReplica(replica) { };
- SipEndpointPtr createEndpoint(const std::string& destination, const Ice::PropertiesPtr& props);
-
SipEndpointPtr createEndpoint(std::string);
void remove(std::string);
diff --git a/src/SipSessionManagerApp.cpp b/src/SipSessionManagerApp.cpp
index 7e4bb4e..148efb0 100644
--- a/src/SipSessionManagerApp.cpp
+++ b/src/SipSessionManagerApp.cpp
@@ -98,7 +98,6 @@ private:
void registerWithStateReplicator();
void registerWithRoutingService();
void deregisterFromRoutingService();
- void configureEndpoints();
void registerPJSipModules();
void deregisterFromStateReplicator();
@@ -455,18 +454,6 @@ void SipSessionManager::deregisterFromServiceLocator()
}
}
-void SipSessionManager::configureEndpoints()
-{
- Ice::PropertiesPtr props = mCommunicator->getProperties();
- Ice::StringSeq endpointNames = props->getPropertyAsList("Sip.Endpoints");
- for (Ice::StringSeq::iterator i = endpointNames.begin();
- i != endpointNames.end();
- ++i)
- {
- SipEndpointPtr endpoint = mEndpointFactory->createEndpoint(*i, props);
- }
-}
-
void SipSessionManager::registerPJSipModules()
{
Ice::PropertiesPtr props = mCommunicator->getProperties();
@@ -587,9 +574,6 @@ void SipSessionManager::initialize(const string& appName, const Ice::Communicato
mGlobalAdapter->activate();
mLocalAdapter->activate();
lg(Debug) << "Activated object adapters";
-
- configureEndpoints();
- lg(Debug) << "Endpoints configured";
}
catch(...)
{
-----------------------------------------------------------------------
--
asterisk-scf/release/sip.git
More information about the asterisk-scf-commits
mailing list