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

+ 15 - 9
src/core/callcenter/esl/client.py

@@ -647,15 +647,21 @@ class OutboundClient:
 
         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)
+            # 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")
+            con.sendEvent(msg)
 
     class CustomTCPServer(socketserver.TCPServer):
         def __init__(self, server_address, RequestHandlerClass, agent, app):