DavidLiu 3 月之前
父節點
當前提交
5b7b047f71
共有 1 個文件被更改,包括 14 次插入10 次删除
  1. 14 10
      src/core/callcenter/acd.py

+ 14 - 10
src/core/callcenter/acd.py

@@ -39,20 +39,20 @@ class AcdService:
         # 1. hold住并且播放等待音
         self.call_service.hold(call_info, device_id)
         self.wait_timeout(call_id)
-        self.logger.info('transfer_to_agent, 1111111 ')
 
         # 获得空闲坐席
         agent_number = self.agent_service.assign(AgentActionRequest(saas_id=saasId, service_id=service_id))
-        self.logger.info('transfer_to_agent, 222222 %s'%agent_number)
         if not agent_number:
             # 如果没有空闲坐席,播放等待音
-            self.logger.info("AcdService transferToAgent agentNumber is empty serviceId:%s,called:%s,callId:%s"%(
-                             service_id, call_info.called, call_info.call_id))
+            text = "AcdService transferToAgent agentNumber is empty serviceId:%s,called:%s,callId:%s"%(service_id, call_info.called, call_info.call_id)
+            print(text, flush=True)
+            self.logger.info(text)
             self.add_acd_queue(call_info, service_id)
         else:
             # 有空闲坐席,直接转接
-            self.logger.info("AcdService transferToAgent agentNumber not empty %s, serviceId:%s,called:%s,callId:%s"%(
-                             agent_number, service_id, call_info.called, call_info.call_id))
+            text = "AcdService transferToAgent agentNumber not empty %s, serviceId:%s,called:%s,callId:%s"%(agent_number, service_id, call_info.called, call_info.call_id)
+            print(text, flush=True)
+            self.logger.info(text)
             self.call_service.transfer(call_info, agent_number, service_id)
         self.cache.add_call_info(call_info)
 
@@ -80,16 +80,20 @@ class AcdService:
             call_id = call_info_queue.get_nowait()
             call_info = self.cache.get_call_info(call_id)
             if not call_info or not call_info.device_list:
+                print("AcdService tryTransferAgent callInfoCache is null ", call_id)
                 self.logger.info("AcdService tryTransferAgent callInfoCache is null %s", call_id)
                 continue
             agent_number = self.agent_service.assign(AgentActionRequest(saas_id=saasId, service_id=task_service_id))
             if not agent_number:
-                self.logger.info("AcdService tryTransferAgent agentNumber is Empty %s %s"% (call_id, json.dumps(call_info.device_list)))
+                text = "AcdService tryTransferAgent agentNumber is Empty %s %s"% (call_id, json.dumps(call_info.device_list))
+                print(text, flush=True)
+                self.logger.info(text)
                 tmp_arr.append(call_id)
                 continue
-            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)
-                )
+
+            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.call_service.transfer(call_info, agent_number, task_service_id)
 
         for call_id in tmp_arr: