【发布时间】:2021-12-08 01:47:56
【问题描述】:
我有 4 条长消息,播放消息时, 我想支持'#'结束消息,'*'返回选择其他消息。 所以我喜欢这样:
function gather() {
const gatherNode = twiml.gather({
numDigits: 1,
timeout: 5,
finishOnKey: ''
});
gatherNode.play('longmessage_1.mp3');
}
if(request.body.Digits == '*') { ...
}
else if (request.body.Digits == '#') { ...
}
else {
gather()
}
问题是当用户按其他键(如 1、2、3)时,会导致中断并从头开始播放消息。所以我想知道只有当用户点击'#'和'*'时才支持请求收集方法的方法。
【问题讨论】: