Future Directions

Programmatic TwiML Creation

I'd like to build a similar set of binaries for the Server side that would let you programmatically build a Response XML document to tell Twilio's phone system how to process incoming and outgoing calls. Consider the following pseudocode:

CallInstructions ci = new CallInstructions();
ci.Add(new Say("This is the San Diego Public Library, with an important message."));
ci.Add(new Pause(2));
ci.Add(new Say("You have " + libraryAccount.MissingBooks.Count + " books overdue. if you would like to hear the titles, Press 1 now."));
ci.Add(new Gather());
Response.Write(ci.ToXmlString());
The underlying serializer would handle formatting the output, but you would be able to write procedural code that would handle multiple situations, in a much cleaner way than is possible with current coding conventions.

This addition is currently planned for the v1.0 release.

Last edited Jun 21, 2009 at 9:02 AM by interscape, version 1

Comments

TonyGravagno Jan 31, 2010 at 6:46 AM 
I've written the other side of this equation, as documented on this page.
See: http://twilioserver.codeplex.com/