Explorar el Código

USER_DEFINED header event parser

Hal De hace 3 años
padre
commit
e2df71172a
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. 7 1
      app/app.py

+ 7 - 1
app/app.py

@@ -260,10 +260,16 @@ async def celCallback(mngr: Manager, msg: Message):
                     app.logger.warning('call usrl {} values {}'.format(row['url'],values))
                     reply = await app.config['HTTP_CLIENT'].post(row['url'],
                                         json=values)
+ 
         if (msg.EventName == 'LINKEDID_END'):
            app.cache['cel_calls'].pop(msg.LinkedID,False);
            app.logger.warning('Left Calls {}'.format(','.join(app.cache['cel_calls'].keys())))
-            
+        if (msg.EventName == 'USER_DEFINED')  and  msg.AppData == 'SETVARIABLE':
+            app.logger.warning('SETVARIABLE({})'.format(msg))
+            varname =  msg.Extra.split('=')[0]
+            value = msg.Extra.split('=')[1]
+            app.logger.warning('SETVARIABLE({}={})'.format(varname,value))
+            app.cache['cel_calls'][msg.linkedid][varname]=value           
 
 async def getCDR(start=None,
                  end=None,