c# - Twilio 功能读取多个语音输入
问题描述
用例是使用 twilio 中的可编程语音呼叫 IVR 系统。基于 IVR 问题,使用 twilio 函数和 TWIML 发送答案。我怎样才能做到这一点?到目前为止,我已经使用 Twilio 进行了调用,并在回调 webhook 下方进行了参考。
[HttpPost]
public TwiMLResult Index(string message)
{
var response = new VoiceResponse();
var gather = new Gather(input: new List<Gather.InputEnum>()
{
Gather.InputEnum.Speech
} ,
timeout: 5, action:new Uri("https://url-sample/GatherSample"));
gather.Say("Please press 1 or say sales for sales.");
response.Append(gather);
LogWriter.Debug($"Message : {response.ToString()}");
return new TwiMLResult(response);
}
还有 Twilio 功能代码。
exports.handler = function(context, event, callback) {
const twiml = new Twilio.twiml.VoiceResponse();
const command = event.SpeechResult.toLowerCase();
twiml.say(`You said ${command}. I'll give you a ${command} fact.`);
callback(null, twiml);
};
解决方案
推荐阅读
- azure-data-factory - 获取数据工厂中的文件名
- arrays - malloc 是否隐式定义数组中的元素数量?
- android - 如何缩小按钮以适应其文本?
- c++ - ESP32 SPI/i2c/xTask 干扰/不稳定
- oauth - 使用后端 API 集成测试 Google Signin JWT id 令牌
- python-3.x - BeautifulSoup - 如何打印属性值?
- c# - 通过 Marshal.GetFunctionPointerForDelegate 返回的指针调用导致访问冲突
- asp.net - Razor 页面路由到不同区域中的页面
- html - 如何在引导程序中使背景适合内容而不是容器的全宽
- r - 具有相似名称的列清洗的迭代