[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
Wed Jul 13 09:48:56 CDT 2011


branch "decorator" has been updated
       via  b7a0dc30886982a44d492b6450bb9b95c0331f74 (commit)
      from  cddde515cfbbaa02fc4553f67ad0e395e7c76673 (commit)

Summary of changes:
 Session_Decorator.py |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)


- Log -----------------------------------------------------------------
commit b7a0dc30886982a44d492b6450bb9b95c0331f74
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue Jul 12 18:28:51 2011 -0500

    Initial changes for the decorator API changes.

diff --git a/Session_Decorator.py b/Session_Decorator.py
index de200cd..992dcec 100755
--- a/Session_Decorator.py
+++ b/Session_Decorator.py
@@ -143,13 +143,28 @@ class SessionDecorator(AsteriskSCF.SessionCommunications.V1.Session):
 
         cb.ice_response()
 
+class SessionListenerDecorator(AsteriskSCF.SessionCommunications.V1.SessionListener):
+    def __init__(self, listeners, adapter):
+        self.listeners = listeners
+        self.adapter = adapter
+
+    def setProxy(self, sessionListenerPrxID):
+        self.sessionPrxID = sessionListenerPrxID
+        self.file = open(sessionListenerPrxID.name + ".txt", "w")
+
+    def indicated(self, session, event, cookies):
+        pass
+
 class SessionDecoratorHook(AsteriskSCF.SessionCommunications.ExtensionPoints.V1.SessionDecoratorHook):
     def __init__(self, adapter):
         self.adapter = adapter
-    def decorateSession(self, realSession, current = None):
+    def decorateSession(self, realSession, realListeners, current = None):
         decorator = SessionDecorator(realSession, self.adapter)
         decoratorPrx = AsteriskSCF.SessionCommunications.V1.SessionPrx.uncheckedCast(self.adapter.addWithUUID(decorator))
         decorator.setProxy(decoratorPrx.ice_getIdentity())
+        decoratorListener = SessionListenerDecorator(realListeners, self.adapter)
+        decoartorListenerPrx = AsteriskSCF.SessionCommunications.V1.SessionListenerPrx.uncheckedCast(self.adapter.addWithUUID(decoratorListener))
+        decoratorListener.setProxy(decoratorListenerPrx.ice_getIdentity())
         result = AsteriskSCF.System.Hook.V1.HookResult(AsteriskSCF.System.Hook.V1.HookStatus.Succeeded, "cool")
         return (result, AsteriskSCF.SessionCommunications.V1.SessionPrx.uncheckedCast(decoratorPrx))
 

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


-- 
asterisk-scf/examples.git



More information about the asterisk-scf-commits mailing list