[asterisk-scf-commits] asterisk-scf/integration/bridging.git branch "partyidextensionpoint" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Sep 14 23:00:19 CDT 2011


branch "partyidextensionpoint" has been created
        at  843fe4b41b446f7f42361bfb9fbf2ff0e1143a66 (commit)

- Log -----------------------------------------------------------------
commit 843fe4b41b446f7f42361bfb9fbf2ff0e1143a66
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Sun Sep 11 22:15:44 2011 -0500

    Cross-platform compilation fix... unused arguments.

diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index 450e3df..1563ec9 100755
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -410,12 +410,12 @@ public:
         cb->ice_response();
     }
 
-    void updateConnectedLine(const ConnectedLinePtr& connected, const Ice::Current&) 
+    void updateConnectedLine(const ConnectedLinePtr&, const Ice::Current&)
     {
         // TBD
     }
 
-    void updateRedirecting(const RedirectingPtr& redirecting, const ::Ice::Current&) 
+    void updateRedirecting(const RedirectingPtr&, const ::Ice::Current&) 
     {
         // TBD
     }

commit 66d6f56ab231036d1bd84c8b057473b884159eeb
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Sun Sep 11 21:37:14 2011 -0500

    Changes to support Party Identification API changes. Also some cleaup of bridge startup process.

diff --git a/config/bridging.conf b/config/bridging.conf
index 95e9796..dfc42d5 100644
--- a/config/bridging.conf
+++ b/config/bridging.conf
@@ -1,4 +1,5 @@
-# This is a configuration file used in conjunction with the ulaw media format test driver
+# This is a configuration file used in conjunction with the bridge service. 
+Ice.Warn.UnknownProperties=0
 
 # Adapter parameters for this component
 BridgeManager.BridgeService.Endpoints=default
@@ -12,3 +13,7 @@ LocatorService.Proxy=LocatorService:tcp -p 4411
 TopicManager.Proxy=AsteriskSCFIceStorm/TopicManager:default -p 10000
 IceBox.InheritProperties=1
 IceBox.Service.BridgeManager=bridgeservice:create
+
+# For testing without replication...
+BridgeManager.Standalone=true
+
diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index 42d4b18..450e3df 100755
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -32,6 +32,7 @@
 
 using namespace AsteriskSCF::System::Logging;
 using namespace AsteriskSCF::SessionCommunications::V1;
+using namespace AsteriskSCF::SessionCommunications::PartyIdentification::V1;
 using namespace AsteriskSCF::BridgeService;
 using namespace AsteriskSCF::Replication::BridgeService::V1;
 using namespace AsteriskSCF;
@@ -409,6 +410,16 @@ public:
         cb->ice_response();
     }
 
+    void updateConnectedLine(const ConnectedLinePtr& connected, const Ice::Current&) 
+    {
+        // TBD
+    }
+
+    void updateRedirecting(const RedirectingPtr& redirecting, const ::Ice::Current&) 
+    {
+        // TBD
+    }
+
 private:
     BridgeImplPtr mBridge;
     SessionWrapperPtr mSelf;
diff --git a/src/BridgeReplicationContext.h b/src/BridgeReplicationContext.h
index 8959336..5a375de 100644
--- a/src/BridgeReplicationContext.h
+++ b/src/BridgeReplicationContext.h
@@ -33,30 +33,33 @@ namespace BridgeService
 class BridgeReplicationContext : public AsteriskSCF::Replication::ReplicationContext
 {
 public:
-    BridgeReplicationContext(AsteriskSCF::Replication::ReplicationStateType state, 
-                             const ReplicatorSmartPrx& bridgeReplicator) : 
-        ReplicationContext(state),
-        mBridgeReplicator(bridgeReplicator)
+    BridgeReplicationContext(AsteriskSCF::Replication::ReplicationStateType state) : 
+        ReplicationContext(state)
     {
     }
         
     // Override
-     virtual bool isReplicating() 
-     {
-         // If the base context says we aren't replicating, we aren't. 
-         if (!ReplicationContext::isReplicating())
-         {
-             return false;
-         }
+    virtual bool isReplicating() 
+    {
+        // If the base context says we aren't replicating, we aren't. 
+        if (!ReplicationContext::isReplicating())
+        {
+            return false;
+        }
+
+        // Do we have a replicator proxy?
+        if (mBridgeReplicator.isInitialized())
+        {
+            return true;
+        }
 
-         // Do we have a replicator proxy?
-         if (mBridgeReplicator.isInitialized())
-         {
-             return true;
-         }
+        return false;
+    }
 
-         return false;
-     }
+    void setReplicator(const ReplicatorSmartPrx& bridgeReplicator)
+    {
+        mBridgeReplicator = bridgeReplicator;
+    }
 
     ReplicatorSmartPrx getReplicator() {return mBridgeReplicator;}
 
diff --git a/src/Component.cpp b/src/Component.cpp
index dbe7194..03b6484 100644
--- a/src/Component.cpp
+++ b/src/Component.cpp
@@ -70,7 +70,7 @@ private:
     virtual void createReplicationStateListeners();
     virtual void stopListeningToStateReplicators();
     virtual void listenToStateReplicators();
-    virtual void findRemoteServices() {};  // N/A
+    virtual void findRemoteServices();
 
     // Other base Component overrides
     virtual ReplicationContextPtr createReplicationContext(ReplicationStateType state);
@@ -91,24 +91,7 @@ private:
  */
 ReplicationContextPtr Component::createReplicationContext(ReplicationStateType state)
 {
-    // Find our state replicator. 
-    ServiceLocatorParamsPtr searchParams = new ServiceLocatorParams;
-    searchParams->category = StateReplicatorDiscoveryCategory;
-    searchParams->service = getCommunicator()->getProperties()->getPropertyWithDefault(
-               "Bridge.StateReplicatorService", "default");
-    searchParams->id = getCommunicator()->getProperties()->getProperty("Bridge.StateReplicatorId");
-
-    ReplicatorSmartPrx replicator;
-    try
-    {
-        replicator = ReplicatorSmartPrx(getServiceLocator(), searchParams, lg);
-    }
-    catch (const std::exception& ex)
-    {
-        lg(Error) << "Bridge state replicator lookup failed. Continuing without replication. " << ex.what();
-    }
-
-    BridgeReplicationContextPtr context(new BridgeReplicationContext(state, replicator));
+    BridgeReplicationContextPtr context(new BridgeReplicationContext(state));
     return context;
 }
 
@@ -210,6 +193,37 @@ void Component::listenToStateReplicators()
     }
 }
 
+/**
+ * Locate services we depend on. 
+ */
+void Component::findRemoteServices()
+{
+    if (getReplicationContext()->getState() == ACTIVE_STANDALONE)
+    {
+        return;
+    }
+
+    // Find our state replicator. 
+    ServiceLocatorParamsPtr searchParams = new ServiceLocatorParams;
+    searchParams->category = StateReplicatorDiscoveryCategory;
+    searchParams->service = getCommunicator()->getProperties()->getPropertyWithDefault(
+               "Bridge.StateReplicatorService", "default");
+    searchParams->id = getCommunicator()->getProperties()->getProperty("Bridge.StateReplicatorId");
+
+    try
+    {
+        BridgeReplicationContextPtr bridgingReplicationContext = 
+            boost::static_pointer_cast<BridgeReplicationContext>(getReplicationContext());
+
+        ReplicatorSmartPrx replicator = ReplicatorSmartPrx(getServiceLocator(), searchParams, lg);
+        bridgingReplicationContext->setReplicator(replicator);
+    }
+    catch (const std::exception&)
+    {
+        lg(Error) << getName() << ": StateReplicator not found. Check configuration. Continuing without replication.";
+    }
+}
+
 void Component::stopListeningToStateReplicators()
 {
     boost::unique_lock<boost::shared_mutex> lock(mReplicatorLock);

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


-- 
asterisk-scf/integration/bridging.git



More information about the asterisk-scf-commits mailing list