Reusable Dialog Components in VoiceXML

Reusable Dialog Components (RDC) are an important part of making development of VoiceXML more productive.  There are portions of any VoiceXML application that are often repeated and therefore like any application development environment we need a modular way to reuse these components.  And often they are repeated across applications. Take for example a dialog to get a date from the user. There are certain common steps to get the date, validate it, confirm that is the date the user intended, and retry if it is invalid or not the intended date.  Rather than repeat the code in your application to get a data over an over again it is much more productive to call a component library that contains this routine.  RDC's can be as simple as getting a date from a user or more complex and build on each other.  For example, an RDC for getting credit card information could be built on smaller RDC's for getting the date (date of expiration), credit card number, and security code.

Another consideration for RDC's to be useful is that they also must be configurable to work in the various contexts that a voice application may need.  Take the date RDC example again.  For a date RDC we would want to configure whether to confirm the date with the user, or not.  We would also want to make the initial prompt configurable (ex: "Enter the expiration date of your credit card") and make it configurable on the date format for DTMF input (ex: MMDDYY, MMYY, MMYYYY) or the grammar used for speech input.

Quite a few years ago IBM created some RDC's and put them into the open source community for Java developers that are available on the Apache site.  But there are not any open source RDC's available for the ASP.NET developer.  That's why it was important to make sure the design of VoiceModel could support RDC's.  VoiceModel is an open source project on CodePlex that is using ASP.NET MVC, C# and Razor to develop a framework for easily developing VoiceXML applications.  It eliminates the need for a .NET developer to learn and understand VoiceXML and lets them focus on the technologies they are accustomed with to develop voice and speech applications.  The latest release of  VoiceModel provides support for RDC's and you can get a reference application that demonstrates this from the Source Code Repository.

The reference application solution is called ReusableComponentEx and it takes a simple RDC for getting the date using the telephone keypad for input, validates the date, and voices back what the user entered.  In later release this RDC will be expanded to be more configurable and add features like user confirmation.  The main application that uses the date RDC prompts the user for a start date and a finish date, and then voices back the difference of the two dates in days.

RDC's in VoiceModel are assemblies that are just compiled into your main voice application.  The assemblies contain their own Controller, ViewModels, and state machines to manage call flow.  In order to easily reuse Controllers and Views a technology called Portable Areas was used.  Portable Areas make it easy to reuse Controllers, Views and other resources across ASP.NET MVC applications.

In subsequent posts I will cover how to use an RDC in your voice application and how to create RDC's.  It is a goal of the VoiceModel project to create an extensive library of RDC's to make using VoiceModel even more productive.  If you would like to contribute to the VoiceModel project just join in on CodePlex and drop me a note.

Comments

Popular posts from this blog

Using Claims in ASP.NET Identity

Customizing Claims for Authorization in ASP.NET Core 2.0

Seeding & Customizing ASP.NET MVC SimpleMembership