Virtualizing Telephony Services Using Twilio

My company recently underwent a datacenter move which gave us the “opportunity” to move many of our IT and software architecture into a highly virtualized environment.  The goal of our IT director before the move was to have everything possible virtualized so that the move could be streamlined (beyond the fact that virtualization is just a good thing to do in many other senses).

One of the “servers” we had running was an old telephony server that had physical line cards installed in PCI slots.  Our IT director made a decision early on that there was no way this old junky computer was going to clutter his brand new datacenter — the services it provided would have to be re-written.  The software re-engineering fell to me, and at the suggestion of the IT director we chose to work with cloud telephony company Twilio for the telephony needs.

Okay... the telephony server wasn't that old, but we weren't about to put it in a nice new datacenter.

Twilio is a cloud-based telephony provider with a rich XML-based API that allows you to have them deal with the phone lines and telephony while you deal with the business logic.  It works like this: When a call comes in, Twilio receives it and makes a web hit to your designated web server.  Your web response should be XML (or should I say, “TwiML“) that directs Twilio on what to do.  It could be as simple as having Twilio use text to speech to say hello and hang up, like this:

<Response>
<Say>Hello World!</Say>
<Hangup />
</Response>

For our application, I presented a greeting followed by gathering of user input.  After Twilio gathered the input, it would POST the input to another web page, where I’d validate and store the input into a persistence database and tell Twilio to present the next prompt.  After receiving all of the data I needed, I’d confirm what the user input using Twilio’s text-to-speech, and then finish the call.

While Twilio’s text to speech synthesis is good, I still found it better to pre-record any stock messages and only use the text to speech when needed.

Since all we needed was a web server and a Twilio account to run the re-written application, we were able to complete our virtualization plans.  Today, we are 98% virtualized — a number we wouldn’t have been able to reach without Twilio’s help.

Note — Being 98% virtualized is pretty cool, eh? Credit to my IT director Todd Scalzott, whom you can follow on twitter.

  1. Thanks so much for using Twilio! Let us know if there’s anything you need help with in the future.

You must log in to post a comment.