Building an IVR system using Tropo’s Java WebApi
April 12th, 2011 by Martin PerezAs you may be aware, Tropo has a new and shiny Java WebApi implementation. In this blog post I want to show you how this WebApi Java library can be used to build a Servlets 3.0 based IVR system in just a few minutes.
The Servlets 3.0 specification is really great as it removes all the burden that was historically associated with building web applications in Java. You can have a full running web application in a couple of minutes by just annotating your regular classes. So both, Servlets 3.0 and Tropo’s Java Webapi make a great team to create voice powered applications very rapidly.
Right. But, instead of writing a large blog post with boring text and code, I thought it would be much better to record a screencast with a short demonstration. So have a look to the video below, and see how easy it is to create enterprise voice-powered applications in Java with Tropo.
All the source code for this sample application is available at GitHub. Feel free to pull it out and give it a go. I’ve kept all the libraries and Eclipse files within the project itself to make it really simple to load and run. Don’t want to watch the video now but still curious about how a Servlet would look like using Tropo? Ok. It is actually super simple:
@Override
protected void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
Tropo tropo = new Tropo();
tropo.say("Hello world");
tropo.say("http://example.com/play.mp3");
tropo.transfer("+34637710708");
tropo.render(response);
}
And that is it. I really hope you like it!
Related posts:

Please help me i want to create an ivr application through java or j2me
Shabeer: Tropo’s developer accounts are free. Sign up and then go have a look at our docs at http://tropo.com/docs/. Support’s here 24 hours a day if you get stuck.