Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

TwilioDevEd/clicktocall-csharp

Repository files navigation

Twilio

Click to Call with ASP.NET MVC and Twilio

This repository is archived and no longer maintained. Check out the Twilio Voice docs for links to other tutorials.

Set up

Requirements

Twilio Account Settings

This application should give you a ready-made starting point for writing your own application. Before we begin, we need to collect all the config values we need to run the application:

Config Value Description
Account Sid Your primary Twilio account identifier - find this in the Console.
Auth Token Used to authenticate - just like the above, you'll find this here.
Phone number A Twilio phone number in E.164 format - you can get one here

Local development

After the above requirements have been met:

  1. Clone this repository and cd into it
git clone https://github.com/TwilioDevEd/clicktocall-csharp.git
cd clicktocall-csharp
  1. Set your configuration variables
copy ClickToCall.Web/Local.config.example ClickToCall.Web/Local.config

See Twilio Account Settings to locate the necessary environment variables.

  1. Endpoints like https://<your-ngrok-subdomain>.ngrok.io/Call/Connect needs to be publicly accessible. We recommend using ngrok to solve this problem. Set up and run ngrok: ngrok http 1430 host-header="localhost:1430" (or use the ngrok Visual Studio extension)

  2. Be sure to update the "PublicUrl" AppSetting in ClickToCall.Web/Local.config to match your ngrok URL (without a trailing slash).

  3. Build the solution

  4. Run the application

  5. Navigate to https://<your-ngrok-subdomain>.ngrok.io

That's it!

Resources

  • The CodeExchange repository can be found here.

License

MIT

Disclaimer

No warranty expressed or implied. Software is as is.