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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Aug 23 21:18:20 CDT 2010


branch "master" has been updated
       via  dcf0b5d8b4fff256a82b30fabec88d1ab9a1c0f4 (commit)
      from  95bd53d28b55060313f48abe9b995233a2509ff6 (commit)

Summary of changes:
 src/SipChannelServiceApp.cpp             |   12 +++++++++++-
 src/SipChannelServiceDataModel.h         |    2 ++
 src/SipChannelServiceEndpointLocator.cpp |   14 +++++---------
 src/SipChannelServiceEndpointLocator.h   |   14 ++++++++------
 src/SipEndpointFactory.cpp               |    8 --------
 src/SipEndpointFactory.h                 |   14 ++++++++------
 6 files changed, 34 insertions(+), 30 deletions(-)


- Log -----------------------------------------------------------------
commit dcf0b5d8b4fff256a82b30fabec88d1ab9a1c0f4
Author: Joshua Colp <jcolp at digium.com>
Date:   Mon Aug 23 23:32:44 2010 -0300

    Get the endpoint factory created and passed to the endpoint locator. Also do some cleanup and get the adapter into the endpoint factory.

diff --git a/src/SipChannelServiceApp.cpp b/src/SipChannelServiceApp.cpp
index 949f04c..504987b 100644
--- a/src/SipChannelServiceApp.cpp
+++ b/src/SipChannelServiceApp.cpp
@@ -14,6 +14,7 @@
 #include "SipChannelServiceDataModel.h"
 #include "SipChannelServiceEventPublisher.h"
 #include "SipChannelServiceEndpointLocator.h"
+#include "SipEndpointFactory.h"
 
 using namespace std;
 using namespace Hydra::SipChannelService;
@@ -61,6 +62,11 @@ public: // Overrides of the  SipChannelServiceDataModel singleton's public inter
       return mBridgeFactory;
    }
 
+   virtual boost::shared_ptr<SipEndpointFactory> getEndpointFactory() const
+   {
+      return mEndpointFactory;
+   }
+
    virtual bool IsPaused() const
    {
       return mPaused;
@@ -77,6 +83,7 @@ public: // Implementation details are visible to this file's classes.
    Routing::V1::EndpointLocatorPtr mEndpointLocator;
    Routing::V1::LocatorRegistryPrx mRoutingServiceLocatorRegistry;
    Bridging::V1::BridgeFactoryPrx mBridgeFactory;
+   boost::shared_ptr<SipEndpointFactory> mEndpointFactory;
 
    bool mPaused;
 
@@ -363,8 +370,11 @@ void SipChannelServiceApp::initialize(const std::string appName)
       // Create the adapter.
       mAdapter = communicator()->createObjectAdapter("SipChannelServiceAdapter");
 
+      boost::shared_ptr<SipEndpointFactory> endpointFactoryPtr(new SipEndpointFactory(mAdapter));
+      mDataModelInstance.mEndpointFactory = endpointFactoryPtr;
+
       // Create and configure our Endpoint Locator.
-      mDataModelInstance.mEndpointLocator = new SipChannelServiceEndpointLocator();
+      mDataModelInstance.mEndpointLocator = new SipChannelServiceEndpointLocator(endpointFactoryPtr);
       mAdapter->add(mDataModelInstance.mEndpointLocator, communicator()->stringToIdentity(EndpointLocatorObjectId));
 
       // Create and publish our ComponentService interface support.
diff --git a/src/SipChannelServiceDataModel.h b/src/SipChannelServiceDataModel.h
index 96ab2a2..b408798 100644
--- a/src/SipChannelServiceDataModel.h
+++ b/src/SipChannelServiceDataModel.h
@@ -11,6 +11,7 @@ namespace SipChannelService
 {
 class SipChannelServiceEventPublisher;
 class EndpointRegistry;
+class SipEndpointFactory;
 
 /**
  * Singleton for access to the service's data model. 
@@ -27,6 +28,7 @@ public:
    virtual Hydra::Core::Routing::V1::EndpointLocatorPtr getEndpointLocator() const = 0;
    virtual Hydra::Core::Routing::V1::LocatorRegistryPrx getRoutingService() const = 0;
    virtual Hydra::Core::Bridging::V1::BridgeFactoryPrx getBridgeFactory() const = 0;
+   virtual boost::shared_ptr<SipEndpointFactory> getEndpointFactory() const = 0;
    virtual bool IsPaused() const = 0;
 
 protected:
diff --git a/src/SipChannelServiceEndpointLocator.cpp b/src/SipChannelServiceEndpointLocator.cpp
index 3b4710c..9a588e5 100644
--- a/src/SipChannelServiceEndpointLocator.cpp
+++ b/src/SipChannelServiceEndpointLocator.cpp
@@ -1,3 +1,7 @@
+#include <boost/thread.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include "SipEndpointFactory.h"
 #include "SipChannelServiceEndpointLocator.h"
 
 namespace Hydra
@@ -5,15 +9,7 @@ namespace Hydra
 namespace SipChannelService
 {
 
-/**
- * Default constructor.
- */
-SipChannelServiceEndpointLocator::SipChannelServiceEndpointLocator()
-{
-   // TBD
-}
-
-::Hydra::Core::Endpoint::V1::EndpointSeq SipChannelServiceEndpointLocator::lookup(const ::std::string& destination, const Ice::Current&)
+Hydra::Core::Endpoint::V1::EndpointSeq SipChannelServiceEndpointLocator::lookup(const ::std::string& destination, const Ice::Current&)
 {
 	Hydra::Core::Endpoint::V1::EndpointSeq endpoints;
 	return endpoints;
diff --git a/src/SipChannelServiceEndpointLocator.h b/src/SipChannelServiceEndpointLocator.h
index 732963a..333b795 100644
--- a/src/SipChannelServiceEndpointLocator.h
+++ b/src/SipChannelServiceEndpointLocator.h
@@ -8,15 +8,15 @@ namespace SipChannelService
 {
 
 /**
- * An implementation of the Routing Service EndpointLocator interface. 
- * This class provides lookups of all the endpoints managed by this 
+ * An implementation of the Routing Service EndpointLocator interface.
+ * This class provides lookups of all the endpoints managed by this
  * Channel Service component, so that the rest of the Asterisk SCF system
- * can bridge our endpoints. 
+ * can bridge our endpoints.
  */
 class SipChannelServiceEndpointLocator : public Hydra::Core::Routing::V1::EndpointLocator
 {
 public:
-   SipChannelServiceEndpointLocator();
+SipChannelServiceEndpointLocator(boost::shared_ptr<SipEndpointFactory> factory) : mEndpointFactory(factory) { };
 
 public:  // Overrides of EndpointLocator
 
@@ -27,9 +27,11 @@ public:  // Overrides of EndpointLocator
    virtual ::Hydra::Core::Endpoint::V1::EndpointSeq lookup(const ::std::string& destination, const ::Ice::Current& = ::Ice::Current());
 
 private:
-   // TBD...
+   /**
+    * The endpoint factory used to create endpoints.
+    */
+   boost::shared_ptr<SipEndpointFactory> mEndpointFactory;
 };
 
 }; // end SipChannelService
 }; // end Hydra
-
diff --git a/src/SipEndpointFactory.cpp b/src/SipEndpointFactory.cpp
index 2161164..252e9fb 100644
--- a/src/SipEndpointFactory.cpp
+++ b/src/SipEndpointFactory.cpp
@@ -5,13 +5,5 @@ namespace Hydra
 namespace SipChannelService
 {
 
-/**
- * Default constructor. TBD...Should probably just be a singleton. 
- */
-SipEndpointFactory::SipEndpointFactory()
-{
-}
-
 }; // end SipChannelService
 }; // end Hydra
-
diff --git a/src/SipEndpointFactory.h b/src/SipEndpointFactory.h
index d37a409..2ddd947 100644
--- a/src/SipEndpointFactory.h
+++ b/src/SipEndpointFactory.h
@@ -8,19 +8,21 @@ namespace SipChannelService
 {
 
 /**
- * A factory for our own SIP Endpoints. 
- * The factory creates SipEndpoints, and insures they are added to 
- * our Data Store implementation to support replication. 
+ * A factory for our own SIP Endpoints.
+ * The factory creates SipEndpoints, and insures they are added to
+ * our Data Store implementation to support replication.
  */
 class SipEndpointFactory
 {
 public:
-   SipEndpointFactory();
+SipEndpointFactory(Ice::ObjectAdapterPtr adapter) : mAdapter(adapter) { };
 
 private:
-   // TBD...
+   /**
+    * A pointer to the object adapter that endpoints will be added to.
+    */
+   Ice::ObjectAdapterPtr mAdapter;
 };
 
 }; // end SipChannelService
 }; // end Hydra
-

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list