asp.net - 在 asp.net mvc 中使用来电显示作为 twilio 号码

标签 asp.net asp.net-mvc twilio

我已经开设了 twilio 试用帐户。我想在我的 asp.net 应用程序中使用经过验证的被叫 ID 号码,而不是购买新的 twilio 号码。但我不知道如何使用它。这是我的代码,

public ActionResult SendSms()
    {
        string ACC_SID = ConfigurationManager.AppSettings["ACC_SID"];
        string AUTH_TKN = ConfigurationManager.AppSettings["AUTH_TKN"];

        TwilioRestClient client = new TwilioRestClient(ACC_SID, AUTH_TKN);
        client.SendMessage("+8801941234567", "+8801671234567", string.Format("This is a test message!"));
        return RedirectToAction("SmsView");
    }

什么也没发生。如何使用我的被叫号码发送短信?

最佳答案

I faced the same scenario while I was working on Twilio first time and at that time I used below steps to make things workable.

1) 首先,我建议您在 SendSMS 函数中添加 Try{} catch{} block 。这会让您知道 SendMessage 工作正常。

2)在 twilio 中,我们需要在发送短信之前注册手机号码。

3)如果您的功能运行正常(没有发生错误),那么在 Twilio 中,有一个“日志”选项卡,您可以在其中查看您的短信是否正确发送。

关于asp.net - 在 asp.net mvc 中使用来电显示作为 twilio 号码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30093869/

相关文章:

javascript - 在 Firefox 中本地主机上的 Twilio 屏幕共享?

asp.net - 如何解码 View 状态

c# - “Illegal characters in path.” 仅当从移动浏览器查看时

c# - 在 aspx 文件中使用内联代码设置文字文本

c# - Url.Action 不适用于非标准 MVC 路由

twilio - 从 Twilio 调用 Skype ID?

c# - .NET 执行超时在 MVC Web 项目中不生效

asp.net-mvc - 模拟 Asp.net-mvc Controller 上下文

asp.net-mvc - 使用 MVC 5 进行用户身份验证,无需 EF

javascript - 在尝试为另一个应用程序设置新设备时不释放 Twilio.Device 实例