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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Sep 13 10:48:30 CDT 2010


branch "master" has been updated
       via  de0abfc9190ae4f187d6140cd799637318b6182a (commit)
      from  de322876fc27aa6e8c0dbad2512644e32c90fb14 (commit)

Summary of changes:
 src/Service.cpp |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)


- Log -----------------------------------------------------------------
commit de0abfc9190ae4f187d6140cd799637318b6182a
Author: Joshua Colp <jcolp at digium.com>
Date:   Mon Sep 13 12:54:43 2010 -0300

    Fix a bug where the bridging service may or may not have been unregistered from the service locator when shutting down.

diff --git a/src/Service.cpp b/src/Service.cpp
index 4fee3d1..83de1c1 100644
--- a/src/Service.cpp
+++ b/src/Service.cpp
@@ -16,6 +16,11 @@ protected:
     void interruptCallback(int);
 
 private:
+    /**
+     * A proxy to the service locator manager for the bridge manager service.
+     */
+    AsteriskSCF::Core::Discovery::V1::ServiceManagementPrx mServiceManagement;
+
     AsteriskSCF::BridgeService::Logger mLogger;
 };
 
@@ -27,6 +32,8 @@ static const std::string ManagerName = "BridgeManager";
 
 int BridgingApp::run(int, char*[])
 {
+   callbackOnInterrupt();
+
     mLogger.getTraceStream() << "Launching AsteriskSCF Session-Oriented Bridging Service." << std::endl;
 
     Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("AsteriskSCF.BridgeService");
@@ -35,19 +42,19 @@ int BridgingApp::run(int, char*[])
     adapter->activate();
 
     AsteriskSCF::Core::Discovery::V1::ServiceLocatorManagementPrx management = AsteriskSCF::Core::Discovery::V1::ServiceLocatorManagementPrx::checkedCast(communicator()->propertyToProxy("ServiceLocatorManagementProxy"));
-    AsteriskSCF::Core::Discovery::V1::ServiceManagementPrx service_management = AsteriskSCF::Core::Discovery::V1::ServiceManagementPrx::uncheckedCast(management->addService(s, "BridgeManagerService"));
+    mServiceManagement = AsteriskSCF::Core::Discovery::V1::ServiceManagementPrx::uncheckedCast(management->addService(s, "BridgeManagerService"));
     AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsPtr params = new AsteriskSCF::Core::Discovery::V1::ServiceLocatorParams();
     params->category = AsteriskSCF::SessionCommunications::Bridging::V1::BridgeServiceDiscoveryCategory;
-    service_management->addLocatorParams(params, "");
+    mServiceManagement->addLocatorParams(params, "");
 
     communicator()->waitForShutdown();
 
-    service_management->unregister();
     return EXIT_SUCCESS;
 }
 
 void BridgingApp::interruptCallback(int)
 {
+   mServiceManagement->unregister();
     _exit(EXIT_SUCCESS);
 }
 

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


-- 
asterisk-scf/integration/bridging.git



More information about the asterisk-scf-commits mailing list