【发布时间】: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