|
@@ -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)
|