【问题标题】:Twilio gather Is it possible only support some keys in gatherTwilio 收集是否可能只支持收集中的某些键
【发布时间】: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)时,会导致中断并从头开始播放消息。所以我想知道只有当用户点击'#'和'*'时才支持请求收集方法的方法。

【问题讨论】:

    标签: twilio key gather


    【解决方案1】:

    这里是 Twilio 开发者宣传员。

    您不能使用<Gather> 限制用户可以按的数字。

    作为一种解决方法,我可以提出一些建议。

    • 您可以保持相同的行为,但作为指令的一部分,请说“或按任何其他键重播消息”
    • 或者,您可以让用户按* 返回或任何其他键结束消息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-03-17
      • 2010-09-29
      • 1970-01-01
      • 1970-01-01
      • 2020-11-14
      • 1970-01-01
      • 2019-01-03
      相关资源
      最近更新 更多