我正在尝试用 twilio flex 中的自定义功能替换“HangupCall”和“Kickparticipant”操作。我在替换“HangupCall”操作时没有发现任何问题,但在替换“KickParticipant”操作时出现以下错误。
Uncaught (in promise) Error: Action KickParticipant cancelled by before event
at e.<anonymous> (twilio-flex.min.js:157)
at twilio-flex.min.js:157
at Object.next (twilio-flex.min.js:157)
at a (twilio-flex.min.js:157)
下面是我的代码 -
flex.Actions.replaceAction("HangupCall", (payload, original) => {
console.log(payload)
console.log("surveyoption::",payload.task.attributes.surveyoption)
console.log("language::",payload.task.attributes.language)
customhangup(payload, original)
});
flex.Actions.replaceAction("KickParticipant", (payload, original) => {
console.log(payload)
console.log("surveyoption::",payload.task.attributes.surveyoption)
console.log("language::",payload.task.attributes.language)
customhangup(payload, original)
});
任何人都可以帮我解决这个问题。
提前致谢