774056846 4 months ago
parent
commit
c8372ab538

+ 10 - 7
src/core/callcenter/esl/client.py

@@ -303,13 +303,16 @@ class InboundClient:
         msg.addHeader("execute-app-name", HANGUP)
         msg.addHeader("execute-app-arg", NORMAL_CLEARING)
         msg.addHeader("async", "true")
-        print("hangup_call挂机1 hangup call: %s, device: %s, ctiCauseEnum: %s"% (call_id, device_id, case_enum), flush=True)
-        arg = ''.join([EslEventUtil.SIP_H_P_LIBRA_HANGUP_CAUSE,"=", case_enum.description])
-        print("hangup_call挂机2 hangup call: %s, device: %s, arg: %s"% (call_id, device_id, arg), flush=True)
-        self.send_args(device_id, SET,  arg)
-        print("hangup_call挂机3 hangup call: %s, device: %s, arg: %s"% (call_id, device_id, arg), flush=True)
-        self.con.sendEvent(msg)
-        print("hangup_call挂机4 hangup call: %s, device: %s, arg: %s"% (call_id, device_id, arg), flush=True)
+        try:
+            print("hangup_call挂机1 hangup call: %s, device: %s, ctiCauseEnum: %s"% (call_id, device_id, case_enum), flush=True)
+            arg = ''.join([EslEventUtil.SIP_H_P_LIBRA_HANGUP_CAUSE,"=", case_enum.description])
+            print("hangup_call挂机2 hangup call: %s, device: %s, arg: %s"% (call_id, device_id, arg), flush=True)
+            self.send_args(device_id, SET,  arg)
+            print("hangup_call挂机3 hangup call: %s, device: %s, arg: %s"% (call_id, device_id, arg), flush=True)
+            self.con.sendEvent(msg)
+            print("hangup_call挂机4 hangup call: %s, device: %s, arg: %s"% (call_id, device_id, arg), flush=True)
+        except:
+            traceback.print_exc()
 
     def broadcast(self, uuid, path, smf):
         builder = [

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

@@ -96,7 +96,7 @@ class ChannelHangupHandler(EslEventHandler):
                 return
 
             # 一般情况下,挂断其他所有设备
-            if device.cdr_type <= 4 and not call.end_time:
+            if device.cdr_type < 4 and not call.end_time:
                 call.end_time = device.end_time
                 self.inbound_client.hangup_call(call_id, device_id, CallCause.HANGUP_EVENT)
                 # self.call_service.hangup_all(call, CallCause.HANGUP_EVENT)