DavidLiu 3 mesiacov pred
rodič
commit
9fc979e683

+ 2 - 3
src/core/callcenter/cache.py

@@ -68,10 +68,9 @@ class Cache:
         self.redis_handler.set(CALL_INFO + call.call_id, call.to_json_string(), self.cacheDay * 24 * 60 * 60)
 
 
-    def get_call_info_by_device_id(self, device_id):
+    def get_call_id_by_device_id(self, device_id):
         call_id = self.deviceCall.get(device_id)
-        if not call_id:
-            return self.get_call_info(call_id)
+        return call_id
 
 
     # 获取callInfo

+ 7 - 1
src/core/callcenter/callback.py

@@ -24,8 +24,14 @@ class Callback(object):
             return
         call_id = EslEventUtil.getCallId(event)
         device_id = EslEventUtil.getDeviceId(event)
+        if not call_id and device_id:
+            call_id = self.cache.get_call_id_by_device_id(device_id)
         call_info = self.cache.get_call_info(call_id)
-        call_type = CallType.get_by_code(call_info.call_type) if call_info.call_type else None
+        if not call_info:
+            self.logger.info("liuwei::debugger::callback:return::event_name=%s, call_id=%s, device_id=%s", event_name, call_id, device_id)
+            return
+
+        call_type = CallType.get_by_code(call_info.call_type) if call_info else None
         device_info = call_info.device_info_map.get(device_id) if call_info and call_info.device_info_map else None
         self.logger.info("liuwei::debugger::callback::event_name=%s, call_type=%s, call_id=%s, device_id=%s, call_info=%s", event_name, call_type, call_id, device_id, call_info)
         if CallType.BOT_CALL == call_type: