774056846 4 月之前
父節點
當前提交
a2609a671f
共有 2 個文件被更改,包括 7 次插入3 次删除
  1. 5 1
      src/core/callcenter/call.py
  2. 2 2
      src/core/callcenter/esl/handler/channel_hangup_handler.py

+ 5 - 1
src/core/callcenter/call.py

@@ -49,7 +49,11 @@ class CallService:
 
     def hold(self, call_info: CallInfo, device_id):
         devices = call_info.device_list
-        devices.remove(device_id)
+        try:
+            devices.remove(device_id)
+        except:
+            pass
+        print('debugger::hold, custom_device_id=%s'%devices.get(0))
         self.client.bridge_break(devices.get(0))
         self.client.hold_play(devices.get(0), HOLD_MUSIC_PATH)
 

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

@@ -92,13 +92,13 @@ class ChannelHangupHandler(EslEventHandler):
             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
 
             # 一般情况下,挂断其他所有设备
             if device.cdr_type <= 4 and not call.end_time:
                 call.end_time = device.end_time
-                self.call_service.hangup_all(call, CallCause.HANGUP_EVENT)
+                self.inbound_client.hangup_call(call_id, device_id, CallCause.HANGUP_EVENT)
+                # self.call_service.hangup_all(call, CallCause.HANGUP_EVENT)
 
             # 判断挂机方向 && 更新缓存
             self.hangup_dir(call, device, cause)