从ASP.NET应用程序拨打电话

时间:2009-12-31 07:28:53

标签: c# .net asp.net

我要求我们需要使用ASP.NET应用程序拨打电话。

我们的ASP.NET应用程序用于呼叫中心。目前,他们手动拨打客户电话。现在,通过单击电话号码链接从我们的应用程序进行呼叫,并开始记录代理(应用程序用户)和客户之间的对话。

  1. 上述场景的硬件要求是什么?
  2. 我们如何在asp.net应用程序中实现电话呼叫以及实现它们所需的组件是什么?

4 个答案:

答案 0 :(得分:3)

Nexmo提供一系列云通信API,包括Voice API,可让您满足此要求。

您只需要安装Nuget包:

Install-Package Nexmo.Csharp.Client

然后使用Call类:

Call.Do(new Call.CallCommand
{
 to = new[]
  {
     new Call.Endpoint 
     {
        type = "phone",
        number = NEXMO_TO_NUMBER
     }
  from = new Call.Endpoint
     {
        type = "phone",
        number = NEXMO_FROM_NUMBER
     },
 answer_url = new[]
     {
        NEXMO_CALL_ANSWER_URL
     }
});

以下是how to make a phone call with Nexmo Voice API and ASP.Net

上的详细信息

答案 1 :(得分:1)

除了Asterisk之外,您还可以考虑Twilio,这是一种基于网络的电话服务,可为您提供基于休息的api,用于拨打和接听电话。有关信息,请参阅http://www.twilio.com/docs/howto/

答案 2 :(得分:0)

如果你想使用电话线,你应该使用电脑电话板,例如Dialogic:http://www.dialogic.com/products/ip_enabled/ip_boards.htm他们应该有API,所以你可以在你的应用程序中使用它。

答案 3 :(得分:-1)

您可以使用第三方API使用Asp.net代码拨打电话。首先需要注册。这是
How To Make a Call Using Asp.net Code

上的详细信息

protected void btnCall_click(object sender,EventArgs e)

    {

         // Call porcessing happens here.



        // Use your account SID and authentication token instead of

        // the placeholders shown here.

        var accountSID = "C0d09f4042d1ff4acb55329cf8e5efb";

        var authToken = "05b278c6f3538d3a35f13b25c73dff";



        // Instantiate an instance of the Twilio client.

        TwilioClient.Init(accountSID, authToken);



        // Retrieve the account, used later to retrieve the

        var account = AccountResource.Fetch(accountSID);



       // this.varDisplay.Items.Clear();







            // Retrieve the values entered by the user.

            var To =new PhoneNumber(txtMobileNumber.Text);

        //twlio=14155992671

            var from = new PhoneNumber("+918098641075");

            var myMessage = this.txtMessage.Text;



            // Create a URL using the Twilio message and the user-entered

            // text. You must replace spaces in the user's text with '%20'

            // to make the text suitable for a URL.

            var url = @"http://twimlets.com/message?Message%5B0%5D={myMessage.Replace()}";

            var twimlUri = new Uri(url);



            // Display the endpoint, API version, and the URL for the message.

            this.varDisplay.Items.Add(@"Using Twilio endpoint { }");

            this.varDisplay.Items.Add(@"Twilioclient API Version is {apiVersion}");

            this.varDisplay.Items.Add(@"The URL is {url}");



            // Place the call.

             var Call=CallResource.Create(To,from,url:twimlUri);

           // var call = CallResource.create(to, from, url: twimlUri);

            this.varDisplay.Items.Add("Call status: " + Call.Status);





    }