DavidLiu 4 mēneši atpakaļ
vecāks
revīzija
f8368f7193
2 mainītis faili ar 7 papildinājumiem un 4 dzēšanām
  1. 4 2
      src/core/callcenter/agent.py
  2. 3 2
      src/core/callcenter/callback.py

+ 4 - 2
src/core/callcenter/agent.py

@@ -78,18 +78,20 @@ class AgentEventService:
         saas_id = call_info.saas_id if call_info else None
         flow_id = call_info.cti_flow_id if call_info else None
         call_id = call_info.call_id if call_info else None
+        device_id = device_info.device_id if device_info else None
         agent_num = device_info.agent_key if device_info else None
         caller = device_info.caller if device_info else None
         called = device_info.called if device_info else None
         is_agent = (device_info and DeviceType.AGENT.code == device_info.device_type) if device_info else False
 
+        self.logger.info('liuwei:debugger::agent_event_channel, event_name=%s, call_id=%s, device_id=%s, is_agent=%s', event_name, call_id, device_id, is_agent)
         agent = self.data_handle_server.get_agent(saas_id, agent_num)
         if not agent:
-            self.logger.warn("event service channel agent is null %s %s %s %s %s", saas_id, event_name, caller, called, json.loads(event.serialize('json')))
+            # self.logger.warn("event service channel agent is null %s %s %s %s %s", saas_id, event_name, caller, called, json.loads(event.serialize('json')))
             return
         agent_monitor = self.data_handle_server.get_agent_monitor(saas_id, agent_num)
         if not agent_monitor:
-            self.logger.warn("event service channel agentMonitor is null %s %s %s %s %s", saas_id, event_name, caller, called, json.loads(event.serialize('json')))
+            # self.logger.warn("event service channel agentMonitor is null %s %s %s %s %s", saas_id, event_name, caller, called, json.loads(event.serialize('json')))
             return
 
         # 信道发起事件,触发完成发起(或桥)&& 坐席侧

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

@@ -25,9 +25,10 @@ class Callback(object):
         call_id = EslEventUtil.getCallId(event)
         device_id = EslEventUtil.getDeviceId(event)
         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
         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_id=%s, device_id=%s, call_info=%s", event_name, call_id, device_id, call_info)
-        if call_info and CallType.BOT_CALL.code == call_info.call_type:
+        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:
             threading.Thread(target=self.agent_event_service.bot_event_channel, args=(event, call_info, device_info)).start()
             # self.agent_event_service.bot_event_channel(event, call_info, device_info)
         else: