node.js - 如何在 twilio 中添加分机号码单击以使用节点 js 进行呼叫
问题描述
根据此处的文档和此处的 github 源代码,我已经克隆了该应用程序,它运行良好。
假设如果我的销售人员有一些扩展名,那么我如何在这个脚本中给出这个扩展名。通常,使用 senddigit 我可以在 twilio 中传递扩展名,但我不知道如何使用这个 salesNumber 来实现它。
twilioClient.createCall(salesNumber, phoneNumber, headersHost)
.then((result) => {
response.send({message: result});
})
.catch((error) => {
response.status(500).send(error);
});
请有人帮忙。
解决方案
我认为您在这里查看了错误的代码段。上面的代码没有直接调用 Twilio 客户端。相反,它从这个文件调用帮助函数来启动调用。
一旦用户拿起,他们将在此功能中通过 TwiML 连接到销售人员:
voiceResponse: (salesNumber, Voice = VoiceResponse) => {
let twimlResponse = new Voice();
twimlResponse.say('Thanks for contacting our sales department. Our ' +
'next available representative will take your call. ',
{ voice: 'alice' });
twimlResponse.dial(salesNumber);
return twimlResponse.toString();
}
在此功能中,您将能够按照此处所述发送数字。
推荐阅读
- swift - GIDSignInDelegate 的问题,尽管添加了符号功能,但仍无法符合它
- ios - ActionSheet 以不正确的颜色呈现
- python - 尝试使用 python 将输入与权重相乘时,张量流 lite 的输出不匹配
- django - 错误:__str__ 返回非字符串(类型 DetComponente)/
- java - 一个使用多个线程的简短 Java 程序
- windows - MSVC - 不显示编译器版本/版权信息
- android - 没有找到 id 到 webview 的视图
- wpf - 如何在 WPF 中访问 BLE Midi 设备?
- mongodb - MongoDB使用`db.TestCollection.find({}).count()`查询Collection的计数报错
- rust - 来自静态和可变 C 指针的 Rust 引用?