774056846 4 months ago
parent
commit
5ba8252f06

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

@@ -76,8 +76,8 @@ def get_call_info(call_id):
     text = None
     if call_id:
         text = redis_handler.get(CALL_INFO + call_id)
-        print('get_call_info', call_id, text)
-        sys.stdout.flush()  # 强制刷新输出缓冲区
+        # print('get_call_info', call_id, text)
+        # sys.stdout.flush()  # 强制刷新输出缓冲区
     if text:
         return CallInfo.from_json(text)
 

+ 5 - 0
src/core/callcenter/esl/handler/channel_hangup_handler.py

@@ -2,6 +2,8 @@
 # encoding:utf-8
 
 import json
+import sys
+
 import src.core.callcenter.cache as Cache
 from src.core.callcenter.acd import AcdService
 from src.core.callcenter.call import CallService
@@ -78,12 +80,14 @@ class ChannelHangupHandler(EslEventHandler):
             service_id = EslEventUtil.getLIBRAServiceId(event)
             Cache.add_call_info(call)
             self.acd_service.transfer_to_agent(call, device, service_id)
+            sys.stdout.flush()  # 强制刷新输出缓冲区
             return
 
         # 如果有下一步
         next_command = call.next_commands[0] if len(call.next_commands) > 0 else None
         if next_command:
             self.next_cmd(call, device, next_command, cause)
+            sys.stdout.flush()  # 强制刷新输出缓冲区
             return
 
         # 一般情况下,挂断其他所有设备
@@ -94,6 +98,7 @@ class ChannelHangupHandler(EslEventHandler):
         # 判断挂机方向 && 更新缓存
         self.hangup_dir(call, device, cause)
         Cache.add_call_info(call)
+        sys.stdout.flush()  # 强制刷新输出缓冲区
 
     def release(self, event):
         device_id = event.getHeader("Unique-ID")