简体   繁体   English

如何在使用 TWILIO 拨打电话时发送数字

[英]How to send digits while making outgoing phone call with TWILIO

I am using Twilio to make outgoing call to a number that is running an IVR system and I have to supply various digits as per the required IVR menu options.我正在使用 Twilio 向运行 IVR 系统的号码拨出电话,我必须根据所需的 IVR 菜单选项提供各种数字。 Right now, I have tried almost all the sample codes and Quick Start tutorials but it didn't work for me.现在,我已经尝试了几乎所有的示例代码和快速入门教程,但它对我不起作用。

I am using ASP.Net web application to make a call using Twilio official C# helper library.我正在使用 ASP.Net web 应用程序使用 Twilio 官方 C# 帮助程序库进行调用。 I am using following code to make a call.我正在使用以下代码拨打电话。

Following is the TwiML instruction provided to Twilio after the call gets connected以下是呼叫接通后提供给 Twilio 的 TwiML 指令

        StringBuilder sb = new StringBuilder();
        sb.Append("<?xml version='1.0' encoding='UTF-8'?>");
        sb.Append("   <Response>");
        sb.Append("         <Dial callerId='+1852xxxxxxx' record='true' >");
        sb.Append("               +1475xxxxxxx ");
        sb.Append("         </Dial>");
        sb.Append("   </Response>");
        Response.Write(sb.ToString());

Please note that the 'Dial' verb doesn't support the sendDigits parameter.请注意,“拨号”动词不支持 sendDigits 参数。

Your immediate response will be highly appreciated, as I am stuck and need to fix this as earliest as possible.非常感谢您的即时回复,因为我被卡住了,需要尽快解决这个问题。

It looks like you want to pass the SendDigits optional parameter along with your outbound API call. 看起来您想要传递SendDigits可选参数以及出站API调用。

For more information, see this list of optional parameters when making a Twilio API call 有关更多信息,请在进行Twilio API调用时查看此可选参数列表

After thoroughly review the documentation, I found a <Number> noun for the <Dial> verb that allows to provide sendDigits parameter. 在彻底查看了文档后,我找到了<Dial>动词的<Number>名词,它允许提供sendDigits参数。 So my problem has been solved. 所以我的问题已经解决了。 Thanks to all of you for your support. 感谢大家的支持。

Regards, 问候,

Tahir Ahmed 塔希尔艾哈迈德

this can help you这可以帮助你

const call = Device.connect(params);
call.sendDegits("1");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM