我目前正在使用Twilio Flex进行工作,并且按照以下说明设置了自定义的保留音乐:https://support.twilio.com/hc/en-us/articles/360024055153-Change-the-Hold-Music-with-Twilio-Flex#h_031b6c4b-32cd-4c15-a50b-cc6e9685b3ae
当用户初始呼叫时,它工作正常,但是当业务代表将其设置为保留时,它将播放默认音乐。我试图编写一个插件来替换HoldCall上的音乐,但它根本无法正常工作。救命?想法?
init(flex, manager) {
this.registerReducers(manager);
flex.Actions.replaceAction(
"HoldCall",
(payload, original) => {
return new Promise((resolve, reject) => {
resolve();
}).then(() => original(payload));
},
"https://handler.twilio.com/twiml/EH994450acfdcfea4b1f097ed2367d4e94"
);}
答案 0 :(得分:0)
你可以像下面这样让它工作 确保首先创建 twimil 并使用该 url
You twimil will contain your hold music...
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Play>http://demo.twilio.com/docs/classic.mp3</Play>
</Response>
flex.Actions.replaceAction("HoldCall", (payload, original) => {
alert("ON HOLD");
return new Promise((resolve, reject) => {
resolve();
}).then(() => {
original({
...payload,
holdMusicUrl: "https://handler.twilio.com/twiml/EH68cc31b0a9c96616cb877ee471169c60", // your twimil url
holdMusicMethod: "POST",
});
});
});