[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "configuration" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Apr 11 12:27:14 CDT 2011


branch "configuration" has been updated
       via  a2ce7d678f3574f6f63691dacead5e2574ded080 (commit)
      from  148efc74ad128c054300d461fb29ae8e31392bed (commit)

Summary of changes:
 src/SipConfiguration.cpp     |   25 ++++++++++++++++++++++---
 src/SipConfiguration.h       |    6 +++++-
 src/SipSessionManagerApp.cpp |    2 +-
 3 files changed, 28 insertions(+), 5 deletions(-)


- Log -----------------------------------------------------------------
commit a2ce7d678f3574f6f63691dacead5e2574ded080
Author: Joshua Colp <jcolp at digium.com>
Date:   Mon Apr 11 14:30:08 2011 -0300

    Update the routing service when endpoint configurations are pushed into the SIP component.

diff --git a/src/SipConfiguration.cpp b/src/SipConfiguration.cpp
index 89e6d63..e374891 100644
--- a/src/SipConfiguration.cpp
+++ b/src/SipConfiguration.cpp
@@ -36,6 +36,7 @@ namespace SipSessionManager
 
 using namespace AsteriskSCF::SIP::V1;
 using namespace AsteriskSCF::System::Configuration::V1;
+using namespace AsteriskSCF::Core::Routing::V1;
 
 class UDPTransportImplPriv
 {
@@ -168,7 +169,9 @@ public:
     /**
      * Constructor for this private class
      */
-    ConfigurationServiceImplPriv(PJSipManager *manager, boost::shared_ptr<SipEndpointFactory> factory) : mPJSipManager(manager), mEndpointFactory(factory) { };
+    ConfigurationServiceImplPriv(PJSipManager *manager, boost::shared_ptr<SipEndpointFactory> factory, std::string& id,
+	AsteriskSCF::SmartProxy::SmartProxy<LocatorRegistryPrx> registry) :
+	mPJSipManager(manager), mEndpointFactory(factory), mRoutingId(id), mRoutingServiceLocatorRegistry(registry) { };
     
     /**
      * Configured SIP domains
@@ -209,10 +212,21 @@ public:
      * Pointer to the endpoint factory used to create endpoints
      */
     boost::shared_ptr<SipEndpointFactory> mEndpointFactory;
+
+    /**
+     * Identifier for our endpoint locator.
+     */
+    std::string mRoutingId;
+
+    /**
+     * Proxy to endpoint locator registry
+     */
+    AsteriskSCF::SmartProxy::SmartProxy<LocatorRegistryPrx> mRoutingServiceLocatorRegistry;
 };
 
-ConfigurationServiceImpl::ConfigurationServiceImpl(PJSipManager *manager, boost::shared_ptr<SipEndpointFactory> factory) :
-    mImplPriv(new ConfigurationServiceImplPriv(manager, factory))
+ConfigurationServiceImpl::ConfigurationServiceImpl(PJSipManager *manager, boost::shared_ptr<SipEndpointFactory> factory,
+    std::string& id, AsteriskSCF::SmartProxy::SmartProxy<LocatorRegistryPrx> registry) :
+    mImplPriv(new ConfigurationServiceImplPriv(manager, factory, id, registry))
 {
 }
 
@@ -917,6 +931,11 @@ void ConfigurationServiceImpl::setConfiguration(const AsteriskSCF::System::Confi
     {
 	(*group)->visit(v);
     }
+
+    // Update endpoint locator with any new destinations that may have been pushed
+    RegExSeq destinations;
+    mImplPriv->mEndpointFactory->generateRoutingDestinations(destinations);
+    mImplPriv->mRoutingServiceLocatorRegistry->setEndpointLocatorDestinationIds(mImplPriv->mRoutingId, destinations);
 }
 
 void ConfigurationServiceImpl::removeConfigurationItems(const AsteriskSCF::System::Configuration::V1::ConfigurationGroupSeq& groups, const Ice::Current&)
diff --git a/src/SipConfiguration.h b/src/SipConfiguration.h
index 5444ddd..d658614 100644
--- a/src/SipConfiguration.h
+++ b/src/SipConfiguration.h
@@ -21,6 +21,9 @@
 #include <boost/shared_ptr.hpp>
 
 #include <AsteriskSCF/System/Component/ConfigurationIf.h>
+#include <AsteriskSCF/Core/Routing/RoutingIf.h>
+
+#include <AsteriskSCF/SmartProxy.h>
 
 #include "PJSipManager.h"
 #include "SipEndpointFactory.h"
@@ -43,7 +46,8 @@ class ConfigurationServiceImplPriv;
 class ConfigurationServiceImpl : public AsteriskSCF::System::Configuration::V1::ConfigurationService
 {
 public:
-    ConfigurationServiceImpl(PJSipManager*, boost::shared_ptr<SipEndpointFactory>);
+    ConfigurationServiceImpl(PJSipManager*, boost::shared_ptr<SipEndpointFactory>, std::string&,
+	AsteriskSCF::SmartProxy::SmartProxy<AsteriskSCF::Core::Routing::V1::LocatorRegistryPrx>);
     AsteriskSCF::System::Configuration::V1::ConfigurationGroupSeq getConfiguration(const AsteriskSCF::System::Configuration::V1::ConfigurationGroupSeq&, const Ice::Current&);
     AsteriskSCF::System::Configuration::V1::ConfigurationGroupSeq getConfigurationAll(const AsteriskSCF::System::Configuration::V1::ConfigurationGroupSeq&, const Ice::Current&);
     AsteriskSCF::System::Configuration::V1::ConfigurationGroupSeq getConfigurationGroups(const Ice::Current&);
diff --git a/src/SipSessionManagerApp.cpp b/src/SipSessionManagerApp.cpp
index 9df89d0..82738d5 100644
--- a/src/SipSessionManagerApp.cpp
+++ b/src/SipSessionManagerApp.cpp
@@ -534,7 +534,7 @@ void SipSessionManager::initialize(const std::string appName, const Ice::Communi
         lg(Debug) << "Created SIP endpoint factory";
 
         // Create and publish our Configuration interface support.
-        mConfigurationService = new ConfigurationServiceImpl(mPJSipManager, mEndpointFactory);
+        mConfigurationService = new ConfigurationServiceImpl(mPJSipManager, mEndpointFactory, mRoutingId, mRoutingServiceLocatorRegistry);
         mGlobalAdapter->add(mConfigurationService, mCommunicator->stringToIdentity(ConfigurationServiceId));
         lg(Debug) << "Created SIP Configuration Implementation";
 

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list