Posts

Showing posts from December, 2012

Dynamic Menus with VoiceModel

There is a new example in the VoiceModel project that shows how to create dynamic menus. Dynamic menus can be very useful in voice applications where you want to configure how the menus work in some persistence mechanism, allowing you to change the flow of the application without recompiling and redeploying, or if you want to tailor it to a specific user based based on their personal preferences.

Here is the code in this new example:

public override CallFlow BuildCallFlow() { CallFlow flow = new CallFlow(); flow.AddState(ViewStateBuilder.Build("greeting", "myMenu", new Say("greeting", "Welcome to the dynamic menu example.")), true); //This is a fake service that mimics getting meta-data for the menus from a web service or database DynamicMenuService service = new DynamicMenuService(); VoiceMenu myMenu = service.GetMenu("myMenu"); Prompt menuOptions = new Prompt(); //Build the prompts for the menu options for…

New Release of VoiceModel Provides Tropo Support

A new version of VoiceModel has been released that allows your voice applications to run on the Tropo Cloud IVR. Now you can develop your voice applications once and run them on any VoiceXML compatible IVR or on the Tropo Platform.  VoiceModel is an open source project and you can find examples on how to develop with VoiceModel in the source code.

Listening to a Saved Recording Using Tropo and ASP.NET MVC

In my last post I discussed how to save a recording from Tropo using ASP.NET MVC and VoiceModel. I also discussed one of the issues I had to deal with was a difference in how VoiceXML and Tropo handle recordings.  A nice feature in VoiceXML is that you can listen to the recording on the IVR before you save it. With Tropo's Web API there is no mechanism to do this.  The goal of VoiceModel is to develop your voice application once and you can run it on either a VoiceXML or Tropo platform,  therefore I had to make both behave in the same manner.  The solution was to save the recording immediately on completion and to let the user listen to the recording on the application server that VoiceModel is deployed on.

In order to grab the correct recording from the application server I needed a method to map a recording to the current session. Fortunately both VoiceXML and Tropo send a unique session ID with each request so I used the session ID as the file name for the audio file that is st…