Davidliu 1 ماه پیش
والد
کامیت
b228a8ba80
2فایلهای تغییر یافته به همراه6 افزوده شده و 14 حذف شده
  1. 4 12
      src/core/callcenter/acd.py
  2. 2 2
      src/core/callcenter/esl/handler/channel_hangup_handler.py

+ 4 - 12
src/core/callcenter/acd.py

@@ -45,15 +45,11 @@ class AcdService:
         agent_number = self.agent_service.assign(AgentActionRequest(saas_id=SAAS_ID, service_id=service_id))
         if not agent_number:
             # 如果没有空闲坐席,播放等待音
-            text = "AcdService transferToAgent agentNumber is empty serviceId:%s,caller:%s,called:%s,callId:%s"%(service_id, call_info.caller, call_info.called, call_info.call_id)
-            # print(text, flush=True)
-            self.logger.info(text)
+            self.logger.info("AcdService transferToAgent agentNumber is empty serviceId:%s,caller:%s,called:%s,callId:%s"%(service_id, call_info.caller, call_info.called, call_info.call_id))
             self.add_acd_queue(call_info, service_id)
         else:
             # 有空闲坐席,直接转接
-            text = "AcdService transferToAgent agentNumber not empty %s, serviceId:%s,caller:%s,called:%s,callId:%s"%(agent_number, service_id, call_info.caller,call_info.called, call_info.call_id)
-            # print(text, flush=True)
-            self.logger.info(text)
+            self.logger.info("AcdService transferToAgent agentNumber not empty %s, serviceId:%s,caller:%s,called:%s,callId:%s"%(agent_number, service_id, call_info.caller,call_info.called, call_info.call_id))
             self.call_service.transfer(call_info, agent_number, service_id)
             # self.agent_state_service.busy(call_info.saas_id, agent_number, agent_number)
         self.cache.add_call_info(call_info)
@@ -90,15 +86,11 @@ class AcdService:
                 continue
             agent_number = self.agent_service.assign(AgentActionRequest(saas_id=SAAS_ID, service_id=task_service_id))
             if not agent_number:
-                text = "AcdService tryTransferAgent agentNumber is Empty %s %s"% (call_id, json.dumps(call_info.device_list))
-                # print(text, flush=True)
-                self.logger.info(text)
+                self.logger.info("AcdService tryTransferAgent agentNumber is Empty %s %s"% (call_id, json.dumps(call_info.device_list)))
                 tmp_arr.append(call_id)
                 continue
 
-            text = "AcdService tryTransferAgent agentNumber not Empty %s, serviceId:%s, called:%s, callId:%s"%(agent_number, task_service_id, call_info.called, call_id)
-            # print(text, flush=True)
-            self.logger.info(text)
+            self.logger.info("AcdService tryTransferAgent agentNumber not Empty %s, serviceId:%s, called:%s, callId:%s"%(agent_number, task_service_id, call_info.called, call_id))
             self.call_service.transfer(call_info, agent_number, task_service_id)
 
         for call_id in tmp_arr:

+ 2 - 2
src/core/callcenter/esl/handler/channel_hangup_handler.py

@@ -133,14 +133,14 @@ class ChannelHangupHandler(EslEventHandler):
 
             # 全部挂机以后推送挂机状态
             # self.logger.info('yushanghui::call_info.device_list %s', call_info.device_list)
+            # 判断挂机方向 && 更新缓存
+            self.hangup_dir(call_info, device_info, cause)
             if call_info.hangup_count >= call_info.answer_count:
                 # if len(call_info.device_list) == 0:
                 self.get_call_info_record(call_info)
 
             # 连续报警判断
             self.hook_serial_warn(call_info)
-            # 判断挂机方向 && 更新缓存
-            self.hangup_dir(call_info, device_info, cause)
             self.cache.add_call_info(call_info, persistent=True)
             # 释放坐席接听锁
             self.agent_state_service.handle_release_agent_lock(call_info.agent_key, SAAS_ID)