[asterisk-scf-commits] asterisk-scf/examples.git branch "decorator" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Fri Jul 1 09:13:59 CDT 2011
branch "decorator" has been updated
via b80ac76f409ebd0a871985396d60113eefab2079 (commit)
from df5b1e5ca8cd785a0b9daa9084ef6afdcead72ec (commit)
Summary of changes:
Session_Decorator.py | 15 ++++-----------
1 files changed, 4 insertions(+), 11 deletions(-)
- Log -----------------------------------------------------------------
commit b80ac76f409ebd0a871985396d60113eefab2079
Author: Mark Michelson <mmichelson at digium.com>
Date: Fri Jul 1 09:13:53 2011 -0500
Don't try to remove the decorator from the object adapter multiple times.
diff --git a/Session_Decorator.py b/Session_Decorator.py
index 4a09f05..a561315 100755
--- a/Session_Decorator.py
+++ b/Session_Decorator.py
@@ -36,13 +36,6 @@ class SessionDecorator(AsteriskSCF.SessionCommunications.V1.Session):
self.sessionPrxID = None
self.file = None
- def __del__(self):
- if self.sessionPrxID:
- try:
- self.adapter.remove(self.sessionPrxID)
- except:
- print "Caught exception trying to remove session decorator from object adapter"
-
def setProxy(self, sessionPrxID):
self.sessionPrxID = sessionPrxID
self.file = open(sessionPrxID.name + ".txt", "w")
@@ -157,11 +150,11 @@ class SessionDecoratorHook(AsteriskSCF.SessionCommunications.ExtensionPoints.V1.
# XXX When is it appropriate to remove the decorator from the adapter?
print "The proxy for the real session is " + realSession.ice_getIdentity().name
decorator = SessionDecorator(realSession, self.adapter)
- decoratorObjPrx = self.adapter.addWithUUID(decorator)
- decorator.setProxy(decoratorObjPrx.ice_getIdentity())
+ decoratorPrx = AsteriskSCF.SessionCommunications.V1.SessionPrx.uncheckedCast(self.adapter.addWithUUID(decorator))
+ decorator.setProxy(decoratorPrx.ice_getIdentity())
result = AsteriskSCF.System.Hook.V1.HookResult(AsteriskSCF.System.Hook.V1.HookStatus.Succeeded, "cool")
- print "The proxy we're going to send to AsteriskSCF is " + decoratorObjPrx.ice_getIdentity().name
- return (result, AsteriskSCF.SessionCommunications.V1.SessionPrx.uncheckedCast(decoratorObjPrx))
+ print "The proxy we're going to send to AsteriskSCF is " + decoratorPrx.ice_getIdentity().name
+ return (result, AsteriskSCF.SessionCommunications.V1.SessionPrx.uncheckedCast(decoratorPrx))
class DecoratorApp(Ice.Application):
def usage(self):
-----------------------------------------------------------------------
--
asterisk-scf/examples.git
More information about the asterisk-scf-commits
mailing list