简体   繁体   English

用twilio C#打电话

[英]Making call with twilio C#

Im trying to build a site where users can click a button that will call a phone (maybe an IP phone) using a verified twilio number. 我试图建立一个站点,用户可以单击一个使用经过验证的twilio号码呼叫电话(也许是IP电话)的按钮。 Do I have to build this in MVC or can I do it in web forms using code like this? 我是否必须在MVC中构建它,还是可以使用这样的代码在Web表单中构建它?

Find your Account Sid and Auth Token at twilio.com/user/account 
        string AccountSid = "nnnnnn";
        string AuthToken = "nnnnnn";
        var twilio = new TwilioRestClient(AccountSid, AuthToken);

        // Build the parameters 
        var options = new CallOptions();
        options.To = "+00000000";
        options.From = "+0000000";
        options.ApplicationSid = "nnnnnnnn";
        options.Method = "GET";
        options.FallbackMethod = "GET";
        options.StatusCallbackMethod = "GET";
        options.Record = false;

        var call = twilio.InitiateOutboundCall(options);
        Console.WriteLine(call.Sid);

MVC is not a requirement of Twilio . MVC不是Twilio的要求。 Webforms works just as well. Webforms也可以正常工作。

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

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