【问题标题】:How to get the output from twilio twiml voice <gather>如何从 twilio twiml voice <gather> 获取输出
【发布时间】:2020-12-16 09:30:42
【问题描述】:

这是节点 js 脚本

const accountSid = 'xxxxxxxxxxxxxxxxxx';
const authToken = 'xxxxxxxxxxxxxxxxxx';
const client = require('twilio')(accountSid, authToken);
client.calls
      .create({
         method: 'GET',
         record: true,
         url: 'https://2f3b18f01640.ngrok.io/voice/callUHC.xml',
         to: '+1xxxxxxxxxxxxx',
         from: '+1xxxxxxxxxxxxx'
       })
      .then(call => console.log(call.sid));

这是 TwiML

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Calling Established...</Say>
<Pause length="30"/>
<Say>Claim Status</Say>
<Pause length="10"/>
<Gather input="speech"></Gather>
</Response>

现在我如何获得收集输入并且取决于输入,它会说出相应的单词。假设如果收集输入是“医疗”,那么它会说医疗 ID,或者如果收集输入是“牙科”,那么它会说牙科 ID 号。

我是 Node JS 的新手,请帮帮我。

【问题讨论】:

    标签: node.js twilio twilio-twiml twilio-programmable-voice


    【解决方案1】:

    你可以看看这个教程。 &lt;Gather&gt; 动词有一个操作 URL,它将 Digits(如果使用 DTMF)或 SpeechResult(如果使用语音收集)发送到该 URL,以便您的代码确定下一步。

    IVR: Phone Tree with Node.js and Express

    【讨论】:

      猜你喜欢
      • 2018-02-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-09
      • 1970-01-01
      • 2019-01-19
      相关资源
      最近更新 更多