在工作室中为 </Gather> 动词使用增强的语音结果

时间:2021-04-05 13:18:09

标签: twilio speech-recognition twilio-studio gather

在 Studio 小部件中没有为语音识别结果打开增强选项的选项。

在那种情况下,我想我们必须使用 twiml 重定向到另一个 twiml 或运行功能小部件。

但是,如果我们使用它,我们将如何返回工作室? 使用 twiml.redirect 和 ?FlowEvent=return,以这种方式? 但是我们应该在哪里使用这个 url 回到工作室?

twiml.gather({action:'webhook.twil.io/AC..../FW...xx?FlowEvent=return'
enhanced:true} ,'Hi say your query');

但是,这实际上并没有回到工作室。 或者我们应该将另一个函数的 url 放在操作中并从该函数重定向到工作室?

2 个答案:

答案 0 :(得分:1)

这里是 Twilio 开发者布道者。

当您从 Studio 流重定向到使用原始 TwiML 时,您应该使用 TwiML Redirect widget 这样做。

要处理将控制权返回给 Studio,您需要为 Studio Webhook URL 指定 <Redirect> 并附加 ?FlowEvent=return。返回 URL 中指定的任何其他参数都将注入 Studio 上下文并通过 Liquid 模板变量进行寻址。

示例:

<Response>
  <Say>Returning you back to the Studio Flow.</Say>
  <Redirect>https://webhooks.twilio.com/v1/Accounts/{AccountSid}/Flows/{FlowSid}?FlowEvent=return&foo=bar</Redirect>
</Response>

答案 1 :(得分:0)

您缺少 input 属性:

试试:

    twiml.gather({
       enhanced: 'true',
       action: 'https://webhooks.twilio.com/v1/Accounts/AC.../Flows/FW...?FlowEvent=return', 
       input: 'speech'
    }).say('Please say something so enhanced gather can collect and return to Studio');