Browse Source

CallerNumber

svetlana 3 years ago
parent
commit
a4ae94efcf
1 changed files with 8 additions and 0 deletions
  1. 8 0
      app/app.py

+ 8 - 0
app/app.py

@@ -211,6 +211,8 @@ async def newchannelCallback(mngr: Manager, msg: Message):
              'callId': uid}
       if (msg.linkedid in  app.cache['cel_calls']) and ('WebCallId' in app.cache['cel_calls'][msg.linkedid]):
         _cb['WebCallId'] = app.cache['cel_calls'][msg.linkedid]['WebCallId']
+      if (msg.linkedid in  app.cache['cel_calls']) and ('CallerNumber' in app.cache['cel_calls'][msg.linkedid]):
+        _cb['CallerNumber'] = app.cache['cel_calls'][msg.linkedid]['CallerNumber']
       #reply = await doCallback(device, _cb)
 
 @manager.register_event('CEL')
@@ -260,6 +262,8 @@ async def celCallback(mngr: Manager, msg: Message):
              'callId': uid} 
            if ('WebCallId' in app.cache['cel_calls'][msg.linkedid]):
              _cb['WebCallId'] = app.cache['cel_calls'][msg.linkedid]['WebCallId']
+           if ('CallerNumber' in app.cache['cel_calls'][msg.linkedid]):
+             _cb['CallerNumber'] = app.cache['cel_calls'][msg.linkedid]['CallerNumber']
            reply = await doCallback(device, _cb)
     if ((msg.Application == 'Queue') and
         (msg.EventName == 'APP_START') and 
@@ -295,6 +299,8 @@ async def celCallback(mngr: Manager, msg: Message):
 
           if ('WebCallId' in app.cache['cel_calls'][msg.linkedid]):
               _cb['WebCallId'] = app.cache['cel_calls'][msg.linkedid]['WebCallId']
+          if ('CallerNumber' in app.cache['cel_calls'][msg.linkedid]):
+             _cb['CallerNumber'] = app.cache['cel_calls'][msg.linkedid]['CallerNumber']
           reply = await doCallback('groupRinging', _cb)
         if ((msg.EventName == 'ANSWER') and
           (msg.Application == 'AppDial') and
@@ -308,6 +314,8 @@ async def celCallback(mngr: Manager, msg: Message):
                'callId': msg.UniqueID}
           if ('WebCallId' in app.cache['cel_calls'][msg.linkedid]):
             _cb['WebCallId'] = app.cache['cel_calls'][msg.linkedid]['WebCallId']
+          if ('CallerNumber' in app.cache['cel_calls'][msg.linkedid]):
+             _cb['CallerNumber'] = app.cache['cel_calls'][msg.linkedid]['CallerNumber']
           reply = await doCallback('groupAnswered', _cb)
           
     if ((msg.Application == 'Queue') and