Kaynağa Gözat

Добрый день. Светлана, можете добавить в оба метода - от кого был звонок

svetlana 3 yıl önce
ebeveyn
işleme
3482cc5ecd
1 değiştirilmiş dosya ile 4 ekleme ve 0 silme
  1. 4 0
      app/app.py

+ 4 - 0
app/app.py

@@ -221,6 +221,8 @@ async def celCallback(mngr: Manager, msg: Message):
   if (lid in app.cache['cel_calls']):
     firstMessage = app.cache['cel_calls'][lid]
     cid = firstMessage.CallerIDnum
+    if firstMessage.CallerIDnum in app.cache['usermap']:
+        cid = app.cache['usermap'][firstMessage.CallerIDnum]
     uid = firstMessage.LinkedID
     if ((msg.Application == 'Queue') and
         (msg.EventName == 'APP_START') and 
@@ -241,6 +243,7 @@ async def celCallback(mngr: Manager, msg: Message):
             app.cache['cel_calls'][uid]['current_channels'].pop(msg.CallerIDname, False)
           _cb = {'users': list(app.cache['cel_calls'][uid]['current_channels'].keys()),
                  'state': 'group_ringing',
+                 'callerId': cid,
                  'callId': uid}
           if ('WebCallId' in app.cache['cel_calls'][msg.linkedid]):
             _cb['WebCallId'] = app.cache['cel_calls'][msg.linkedid]['WebCallId']
@@ -254,6 +257,7 @@ async def celCallback(mngr: Manager, msg: Message):
         _cb = {'user': called,
                'users': list(app.cache['cel_calls'][uid]['all_channels'].keys()),
                'state': 'group_answer',
+               'callerId': cid,
                'callId': uid}
         if ('WebCallId' in app.cache['cel_calls'][msg.linkedid]):
           _cb['WebCallId'] = app.cache['cel_calls'][msg.linkedid]['WebCallId']