[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
Sun Mar 6 16:49:22 CST 2011


branch "configuration" has been updated
       via  01940e42606ff1b41b53778a2b5148021be8d80b (commit)
      from  053aefa444ff4d34070d67d6f45809005c9c7c57 (commit)

Summary of changes:
 src/SipEndpoint.cpp        |    7 ++-----
 src/SipEndpoint.h          |    4 ++--
 src/SipEndpointFactory.cpp |    1 +
 3 files changed, 5 insertions(+), 7 deletions(-)


- Log -----------------------------------------------------------------
commit 01940e42606ff1b41b53778a2b5148021be8d80b
Author: Joshua Colp <jcolp at digium.com>
Date:   Sun Mar 6 18:50:07 2011 -0400

    Destroy the SIP endpoint completely when told to.

diff --git a/src/SipEndpoint.cpp b/src/SipEndpoint.cpp
index b06cf62..9410622 100644
--- a/src/SipEndpoint.cpp
+++ b/src/SipEndpoint.cpp
@@ -117,12 +117,9 @@ SipEndpoint::SipEndpoint(Ice::ObjectAdapterPtr adapter, boost::shared_ptr<SipEnd
     mImplPriv->mEndpointProxy = AsteriskSCF::SessionCommunications::V1::SessionEndpointPrx::uncheckedCast(mImplPriv->mAdapter->addWithUUID(this));
 }
 
-/**
- * Default destructor.
- */
-SipEndpoint::~SipEndpoint()
+void SipEndpoint::removeFromAdapter()
 {
-    lg(Debug) << "Deconstructing SIP endpoint " << mImplPriv->mName;
+    mImplPriv->mAdapter->remove(mImplPriv->mEndpointProxy->ice_getIdentity());
 }
 
 void SipEndpoint::setSourceAddress(std::string address, int port)
diff --git a/src/SipEndpoint.h b/src/SipEndpoint.h
index 9c1e636..3704e28 100644
--- a/src/SipEndpoint.h
+++ b/src/SipEndpoint.h
@@ -213,8 +213,6 @@ public:
     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);
 
-    ~SipEndpoint();
-
     bool operator==(const std::string &name) const;
 
     /**
@@ -241,6 +239,8 @@ public:
 
     void removeSession(AsteriskSCF::SessionCommunications::V1::SessionPtr);
 
+    void removeFromAdapter();
+
     /**
      * Configuration related operations
      */
diff --git a/src/SipEndpointFactory.cpp b/src/SipEndpointFactory.cpp
index 942b732..c6ffc46 100644
--- a/src/SipEndpointFactory.cpp
+++ b/src/SipEndpointFactory.cpp
@@ -44,6 +44,7 @@ void SipEndpointFactory::remove(std::string endpointName)
     SipEndpointPtr endpoint = findByName(endpointName);
     if (endpoint != 0)
     {
+	endpoint->removeFromAdapter();
 	mEndpoints.erase(std::remove(mEndpoints.begin(), mEndpoints.end(), endpoint), mEndpoints.end());
     }
 }

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list