Search code examples
asp.net-mvctwiliovoiptwilio-twiml

What Request URL for Voice in TwiML App setup should I use when I develop on localhost?


I am creating an app in ASP.NET-MVC where I can call phone number from browser.

To do that I need to create capability token like in the sample:

 var capability = new TwilioCapability(accountSid, authToken);
    capability.AllowClientOutgoing(appSid);
    capability.AllowClientIncoming("jenny");
    string token = capability.GenerateToken();

The appSid is an identifier of TwimlApp created on my Twilio account as described here: https://www.twilio.com/help/faq/twilio-client/how-do-i-create-a-twiml-app

I have absolutely no idea what should I put in the Request URL in Voice section. I develop on locally on my computer. ASP.NET-MVC app is run on localhost.

Sample image from Twilio's website:

enter image description here


Solution

  • Developing with a web service like Twilio can be difficult when it needs to make requests from a server to your development environment. One of the best tools I've found to make this easy is called ngrok.

    ngrok allows you to create tunnels to your machine and give them a friendly name with a custom port.

    For example, you could setup ngrok locally on your machine to forward all requests from twilio to yoda.ngrok.com to your environment. This makes it really easy to develop locally with web hooks. Let me know if you have any questions on getting setup!