bolt githublinkedinPage 1Created with Sketch. spots swoosh target triangle-icon twilio twitterweave

Setting up a Support Hotline with Twilio

Richard and JasonOctober 03, 2016

Twilio Signal London

On September 20th the London DVELP team joined a full house in a converted 18th century brewery for a 21st century conference. With fresh insights on the Twilio stack and success stories of Twilio customers it was an engaging day. Most exciting was connecting with some of the team behind Twilio's innovative communication APIs.

Twilio Signal

Twilio Hackathon

Twilio Signal inspired us to run our own Hackathon. We got together a team to master Twilio's Radical Skills and hit the decks for a few days, developing a custom solution for the DVELP Support Desk.

DVELP Hotline

Using Twilio with our own api we were easily able to set up a DVELP support line. Our own app does the following:

  • Keeps track of who is available to take support calls
  • Support users can set themselves to active or inactive by day of the week and time of day
  • Formulates the TwiML responses based on user availability and whether the caller wants to speak to someone or just leave a message
  • Creates Trello support cards with transcriptions of any messages

When someone calls our hotline, Twilio makes an api call to our own server. The server checks which users are currently set up to receive calls and returns a TwiML response, for example:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say>Welcome to DVELP, Jason and Richard are online, would you like to speak to them? Or create a support request directly by dialling any number.</Say>
  <Gather action="/api/no-answer' numDigits='1' />
  <Dial timeout="9" callerId='xxxxxxxxxx'>
    <Number>+44xxxxxxx</Number>
  </Dial>
  <Dial timeout="9" action="/api/no-answer" callerId='xxxxxxxxxx'>
    <Number>+44xxxxxxx</Number>
  </Dial>
</Response>
  • Twilio converts the contents of the <Say> element into speech which is spoken to the caller.
  • <Gather> tells Twilio to listen for keypad presses.
  • action is the url that the user will be sent to if they enter digits.
  • numDigits instructs Twilio how many digits to listen for.
  • <Dial> informs Twilio to put a call out to the <Number> specified
  • After timeout seconds without answer, Twilio either goes to the action url or proceeds to the next instruction.

With the example above, the no-answer endpoint returns the following TwiML:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say>Please leave a voice message</Say>
  <Record action='/api/recordings' transcribe='true' transcribeCallback='api/transcriptions' />
</Record>
  • <Record> tells Twilio to record a message.
  • action tells Twilio where to make the api call to send us the recording
  • Using transcribe we can decided if we want a transcription
  • transcribeCallback tells Twilio where to call to send us the transcription - this service is asynchronous from recording creation

On receipt of a callback from Twilio to the transcriptions endpoint we create a new Trello card with the following details:

  • Subject a truncation of the transcription
  • From the number of the caller
  • Description the full transcription of the call
  • Record Url the location of the original message

Go ahead and give it a try: +44 (0) 20 31 37 63 39

Final Thoughts

The functionality rolled out in our Hackathon is just the tip of the Twilio iceberg... We are now looking into extending our support line to respond to a variety of inbound methods such as voice, sms or even social media.

THINK

out loud

We think out loud on our blog. We share our views on coding, remote work and post regular insights into the freshest tech industry news.

Want more? Join our mailing list.

    So, how can we help you?

    Live chat