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

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

@@ -17,7 +17,7 @@ from src.core.callcenter import BizException
 from src.core.callcenter.cache import Cache
 from src.core.callcenter.api import MakeCallContext, DelayAction, CallInfo, DeviceInfo, NextCommand
 from src.core.callcenter.callback import Callback
-from src.core.callcenter.constant import SK, EMPTY, WaitingHangupMusicPath, saasId
+from src.core.callcenter.constant import SK, EMPTY, WaitingHangupMusicPath, saasId, HOLD_MUSIC_PATH
 from src.core.callcenter.esl.constant.esl_constant import BRIDGE_VARIABLES, BRIDGE, HANGUP, NORMAL_CLEARING, SIP_HEADER, \
     SPACE, SOFIA, \
     ORIGINATE, PARK, SET, EAVESDROP, SMF_ALEG, EXECUTE, PLAYBACK, PAUSE, TRANSFER, UUID_TRANSFER, UUID_BROADCAST, \
@@ -630,7 +630,7 @@ class OutboundClient:
 
         def hold(self, con, call_id, device_id):
             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):
             """拆线"""
@@ -641,6 +641,18 @@ class OutboundClient:
             arg = ''.join(builder)
             con.execute(TRANSFER, arg)
 
+        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)
+
     class CustomTCPServer(socketserver.TCPServer):
         def __init__(self, server_address, RequestHandlerClass, agent, app):
             super().__init__(server_address, RequestHandlerClass)