This app shows how to build a basic IVR (Interactive voice response) system with C# and Twilio.
The user will be offered a menu to select from.
Use this application as a starting point to build your own basic IVR phone tree using C# and Webhooks.
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:
After the above requirements have been met:
- Clone this repository and
cd
into it
git clone [email protected]:twilio-samples/basic-ivr-csharp
cd basic-ivr-csharp
- Add necessary nuget packages
dotnet add package Twilio
dotnet add package Twilio.AspNet.Core
- Build to install the dependencies
dotnet build
- Run the application
dotnet run
- Use ngrok or other tunneling service to expose your application to the internet
You will need to use ngrok or another tunneling service to allow Twilio to reach your running application. Use the following command, replacing the port number that's shown here with the port that your application is running on.
ngrock http http://localhost:5183
- Set your ngrok endpoint as a Webhook in the Twilio console. Remember to append /voice to the ngrok URL.
That's it!
- The CodeExchange repository can be found here.
This template is open source and welcomes contributions. All contributions are subject to our Code of Conduct.
No warranty expressed or implied. Software is as is.