DavidLiu před 4 měsíci
rodič
revize
fd5a14088a
1 změnil soubory, kde provedl 2 přidání a 52 odebrání
  1. 2 52
      src/core/callcenter/esl/client.py

+ 2 - 52
src/core/callcenter/esl/client.py

@@ -543,12 +543,12 @@ class OutboundClient:
                     elif caller_number in whitelist:
                         # 检查白名单
                         _bucket_call_type = 0
-                        self.hold(con, call_id, device_id)
+                        con.execute("answer", "", device_id)
                         self.build_call_info(call_id, device_id, new_device_id, destination=None, bucket_type=_bucket_call_type, **kwargs)
                         self.server.agent.acd_service.transfer_to_agent(call_id, new_device_id)
                     else:
                         # 传统服务
-                        self.hold(con, call_id, device_id)
+                        con.execute("answer", "", device_id)
                         self.build_call_info(call_id, device_id, new_device_id, destination=None, bucket_type=_bucket_call_type,  **kwargs)
                         self.server.agent.acd_service.transfer_to_agent(call_id, new_device_id)
 
@@ -629,56 +629,6 @@ class OutboundClient:
             self.server.cache.add_call_info(call_info)
             return call_info
 
-        def hold(self, con, call_id, device_id):
-            msg = ESL.ESLevent("sendmsg", device_id)
-            msg.addHeader("call-command", EXECUTE)
-            msg.addHeader("execute-app-name", ANSWER)
-            e = con.sendMSG(msg)
-            self.server.logger.info("hold.answer::complete::e=%s", e)
-
-            # msg = ESL.ESLevent("sendmsg", device_id)
-            # msg.addHeader("call-command", EXECUTE)
-            # msg.addHeader("execute-app-name", PLAYBACK)
-            # msg.addHeader("execute-app-arg", HOLD_MUSIC_PATH)
-            # msg.addHeader("async", "true")
-            # e = con.sendMSG(msg)
-            # self.server.logger.info("hold.hold_play::complete::e=%s", e)
-
-            # self.bridge_break(con, call_id, device_id)
-            # self.server.cache.set_need_play_hold_music(call_id)
-            # self.hold_play(con, device_id, HOLD_MUSIC_PATH)
-
-        def bridge_break(self, con, call_id, device_id):
-            """拆线"""
-            builder = [
-                device_id,
-                f"  -both 'set:hangup_after_bridge=false,set:park_after_bridge=true,set:{SIP_HEADER}{sipHeaderHoldMusic}={call_id},park:' inline "
-            ]
-            arg = ''.join(builder)
-            self.server.logger.info("hold.bridge_break::arg=%s",arg)
-            e = con.execute(TRANSFER, arg)
-            self.server.logger.info("hold.bridge_break::complete::arg=%s, e=%s",arg, e.serialize('json'))
-
-        def hold_play(self, con, device_id, play):
-            """向a-leg插播tts音乐(无限播放)"""
-            # builder = [
-            #     device_id,
-            #     " playback::",
-            #     play,
-            #     " ",
-            #     SMF_ALEG
-            # ]
-            # arg = ''.join(builder)
-            # con.execute(UUID_BROADCAST, arg)
-            msg = ESL.ESLevent("sendmsg", device_id)
-            msg.addHeader("call-command", EXECUTE)
-            msg.addHeader("execute-app-name", PLAYBACK)
-            msg.addHeader("execute-app-arg", play)
-            msg.addHeader("async", "true")
-            e = con.sendMSG(msg)
-            self.server.logger.info("hold.hold_play::complete::e=%s", e)
-
-
     class CustomTCPServer(socketserver.TCPServer):
         def __init__(self, server_address, RequestHandlerClass, agent, app):
             super().__init__(server_address, RequestHandlerClass)