text: How to use Twilio for voice and SMS capabilities from allows your applications to make and receive phone calls. Twilio SMS enables your applications to send and receive SMS messages. Twilio Client allows you to make VoIP calls from any phone, tablet, or browser and supports WebRTC.
  Twilio Pricing and Special Offers
  Azure customers receive a special offer: complimentary  caller's voice and returns.
  Create a Twilio Account
  When you're ready to get a Twilio account, sign up at Try Twilio. You can start with a free account, and upgrade your account later.
  When you sign up for a Twilio account, you'll.
  Create an Azure Application
  An Azure application that hosts a Twilio enabled application is no different from any other Azure application. You add the Twilio .NET library and configure the role to use the Twilio .NET libraries. For information on creating an initial Azure project, see Creating an Azure project with Visual Studio.
  Configure Your Application to use Twilio Libraries can be installed using the NuGet package manager extension available for Visual Studio 2010 up to 2015. The source code is hosted on GitHub,.
  Note
  To install the latest version of NuGet, you must first uninstall the loaded version using the Visual Studio Extension Manager. To do so, you must run Visual Studio as administrator. Otherwise, the Uninstall button is disabled.
  To add the Twilio libraries to your Visual Studio project:
  - Open your solution in Visual Studio.
  - Right-click References.
  - Click Manage NuGet Packages...
  - Click Online.
  - In the search online box, type twilio.
  - Click Install on the Twilio package.
  How to: Make an outgoing call
  The following shows how to make an outgoing call using the CallResource class. This code also uses a Twilio-provided site to return the Twilio Markup Language (TwiML) response. Substitute your values for the to and from phone numbers, and ensure that you verify the from phone number for your Twilio account before running); // Use the Twilio-provided site for the TwiML response. var url = ""; url = $"{url}?Message%5B0%5D=Hello%20World"; // Set the call From, To, and URL values to use for the call. // This sample uses the sandbox number provided by // Twilio to make the call. var call = CallResource.Create( to: new PhoneNumber("+NNNNNNNNNN"), from: new PhoneNumber("NNNNNNNNNN"), url: new Uri(url)); }
  For more information about the parameters passed in to the CallResource.Create method, see.
  As mentioned, this code uses a Twilio-provided site to return the TwiML response. You could instead use your own site to provide the TwiML response. For more information, see How to: Provide TwiML responses from your own website.
  How to: Send an SMS message
  The following screenshot shows how to send an SMS message using the MessageResource class. The from number is provided by Twilio for trial accounts to send SMS messages. The to number must be verified for your Twilio account before you run); try { // Send an SMS message. var message = MessageResource.Create( to: new PhoneNumber("+12069419717"), from: new PhoneNumber("+14155992671"), body: "This is my SMS message."); } catch (TwilioException ex) { // An exception occurred making the REST call Console.WriteLine(ex.Message); }
  How to: Provide TwiML Responses from your own website
  When your application initiates a call to the Twilio API - for example, via the CallResource.Create method - Twilio sends your request to an URL that is expected to return a TwiML response. The example in How to: Make an outgoing call uses the Twilio-provided URL to return the response.
  Note
  While TwiML is designed for use by web services, you can view the TwiML in your browser. For example, click to see an empty <Response> element; as another example, click to see a <Response> element that contains a <Say> element.
  Instead of relying on the Twilio-provided URL, you can create your own URL site that returns HTTP responses. You can create the site in any language that returns HTTP responses. This topic assumes you'll be hosting the URL from an ASP.NET generic handler.
  The following ASP.NET Handler crafts a TwiML response that says Hello World on the call.
  using System.Text; using System.Web; namespace WebRole1 { /// <summary> /// Summary description for Handler1 /// </summary> public class Handler1 : IHttpHandler { public void ProcessRequest(HttpContext context) { const string twiMLResponse = "<Response><Say>Hello World.</Say></Response>"; context.Response.Clear(); context.Response.ContentType = "text/xml"; context.Response.ContentEncoding = Encoding.UTF8; context.Response.Write(twiMLResponse); context.Response.End(); } public bool IsReusable { get { return false; } } } }
  As you can see from the example above, the TwiML response is simply an XML document. The Twilio.TwiML library contains classes that will generate TwiML for you. The example below produces the equivalent response as shown above, but uses the VoiceResponse class.
  using System.Web; using Twilio.TwiML; namespace WebRole1 { /// <summary> /// Summary description for Handler1 /// </summary> public class Handler1 : IHttpHandler { public void ProcessRequest(HttpContext context) { var twiml = new VoiceResponse(); twiml.Say("Hello World."); context.Response.Clear(); context.Response.ContentType = "text/xml"; context.Response.Write(twiml.ToString()); context.Response.End(); } public bool IsReusable { get { return false; } } } }
  For more information about TwiML, see.
  Once you have set up a way to provide TwiML responses, you can pass that URL to the CallResource.Create method. For example, if you have a web application named MyTwiML deployed to an Azure cloud service, and the name of your ASP.NET Handler is mytwiml.ashx, the URL can be passed to CallResource.Create as shown in the following code sample:
  // This sample uses the sandbox number provided by Twilio to make the call. // Place the call. var call = CallResource.Create( to: new PhoneNumber("+NNNNNNNNNN"), from: new PhoneNumber("NNNNNNNNNN"), url: new Uri("http://<your_hosted_service>.cloudapp.net/MyTwiML/mytwiml.ashx")); }
  For additional information about using Twilio on Azure with ASP.NET, see How to make a phone call using Twilio in a web role: