浏览代码

rxception

Svetlana 3 年之前
父节点
当前提交
b0f965a3a0
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      app/app.py

+ 3 - 1
app/app.py

@@ -258,7 +258,9 @@ async def celCallback(mngr: Manager, msg: Message):
     if (msg.EventName == 'CHAN_START') and (lid != msg.UniqueID) and (not msg.Channel.startswith('Local/')):
     if (msg.EventName == 'CHAN_START') and (lid != msg.UniqueID) and (not msg.Channel.startswith('Local/')):
         if (msg.CallerIDnum!=''): # or (firstMessage.Context == 'from-pstn') or (firstMessage.get('groupCall',False))):#all calls 
         if (msg.CallerIDnum!=''): # or (firstMessage.Context == 'from-pstn') or (firstMessage.get('groupCall',False))):#all calls 
            device = msg.CallerIDnum
            device = msg.CallerIDnum
-           user = app.cache['usermap'][device]
+           user = device
+           if device in app.cache['usermap']:
+             user = app.cache['usermap'][device]
            did = firstMessage.Exten
            did = firstMessage.Exten
            _cb = {'user': user,
            _cb = {'user': user,
              'device': device,
              'device': device,