Skip to content

TwilioDevEd/task-router-csharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twilio

Task Router with ASP.NET MVC

Use Twilio to provide your user with multiple options through phone calls, so they can be assisted by an agent specialized in the chosen topic. This is basically a call center created with the Task Router API of Twilio. This example uses a SQLite database to log phone calls which were not assisted.

Local Development

This project is built using ASP.NET MVC Framework.

  1. First clone this repository and cd into it.

    git clone git@github.com:TwilioDevEd/task-router-csharp.git
    cd task-router-csharp
  2. Copy the sample configuration file and edit it to match your configuration.

    copy TaskRouter.Web\Local.config.example TaskRouter.Web\Local.config

    You can find your Account SID and Auth Token in your Twilio Account.

    Also part of the application initial config is the HostUrl it will be exposed to the wider internet. We will use ngrok for exposing our local application. To start using ngrok on our project you'll have to execute the following line in the command prompt.

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

    Now you can copy the HostUrl. It will be something like https://26419c64.ngrok.io/.

  3. Build the solution.

  4. Run the application.

  5. Check it out at http://localhost:8080.

  6. Configure Twilio to call your webhooks.

    You will also need to configure Twilio to call your application via POST when phone calls are received on your Twilio Number.

    The endpoint of Voice should look something like this:

    http://<sub-domain>.ngrok.io/call/incoming
    

    The endpoint of SMS should look something like this:

    http://<sub-domain>.ngrok.io/message/incoming
    

    Configure SMS

How To Demo?

  1. Call your Twilio Phone Number. You will get a voice response:

    For Programmable SMS, press one.
    For Voice, press any other key.
    
  2. Reply with 1.

  3. The specified phone for the Programmable SMS agent's phone will be called.

  4. If the Programmable SMS agent's phone is not answered in 30 seconds then the Programmable Voice agent's phone will be called.

  5. In case the second agent doesn't answer the call, it will be logged as a missed call. You can see all missed calls in the main page of the running server at http://localhost:8080.

  6. Repeat the process but enter any key different to 1 to choose Voice.

Meta

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

About

Task Router with ASP.NET MVC and Twilio

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published