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

TwilioDevEd/automated-survey-csharp

Repository files navigation

Twilio

Automated Surveys using ASP.NET MVC

This application demonstrates how to use Twilio and TwiML to perform automated phone surveys.

Read the full tutorial here!

Running locally

This application requires Visual Studio and SQLServer Express 2019 with LocalDB enabled.

  1. Clone the repository and cd into it.

  2. Open the solution file in Visual Studio.

    Open the solution file

  3. Build the solution.

    Build the solution

  4. Run Update-Database to execute the migrations.

    (Be sure to check that your database server name matches the one from the connection string on Web.config. For reference, default values where used upon SQLServer installation)

    Run Update-Database

    Running the command Update-Database will run the migrations and run the Seed method, if you want to inspect this you can inspect SQL Server Object Explorer.

That's it!

Configuring Twilio to call your application

Exposing the application using ngrok

For this demo it's necessary that your local application instance is accessible from the Internet. The easiest way to accomplish this during development is using ngrok. The installer and the installation instructions are available here.

Once you have the application running you can expose it to the wider internet by running the following command (port 1153 is the default port for this application).

ngrok http 1153 -host-header="localhost:1153"

Configuring Twilio Webhooks

In order to receive incoming calls we need to first configure our Twilio phone number.

Configure Twilio Phone

Click on the red number, and then set the Voice Request URL. Don’t forget to save the changes.

Set Voice Request URL

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.