VoiceXmlInterpreter (VoiceXML Sample)

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The VoiceXmlInterpreter sample demonstrates how to use VoiceXML in voice response applications.

Initial Setup

The VoiceXmlInterpreter sample consists of two projects: VXMLStreamProvider and VoiceXMLInterpreter. The VXMLStreamProvider project includes Default.aspx, which contains the VoiceXML code for the sample and VoiceXML_success.wav, a recorded message. The VoiceXMLInterpreter project contains the workflow code whose job it is to access and interpret the VoiceXML code. The StartPage property on the VoiceXmlInterpreterActivity defined in VoiceXMLInterpreterWorkflow.designer.cs is initialized with the URI for Default.aspx.

To set up the stream provider

  1. in the Samples\VoiceXML\VoiceXMLInterpreter\VXMLStreamProvider directory of the Speech Server installation directory, open the first sample solution file.

  2. In Solution Explorer, right-click Default.aspx, and then click Set As Start Page.

  3. In Visual Studio 2005, click Start Options on the Website menu.

  4. In the Start action pane, click Don't open a page. Wait for a request from an external application, and then click OK.

Running the Sample

To run the sample

  1. In the Samples\VoiceXML\VoiceXMLInterpreter\VoiceXMLInterpreter directory of the Speech Server installation directory, open the second sample solution file.

  2. Press F5.

  3. In the Voice Response Debugging Window dialog box, click the SIP Phone tab, enter any numbers in the Called Party and Calling Party boxes, and then click Call.

    The application says "Welcome to Speech Server. We're now gonna make a call to retrieve a VoiceXML stream and interpret it." The application then plays the VoiceXML_success.wav, whose contents are "The VoiceXML stream was successful." The application then says "Goodbye."

    If you look carefully at the prompt markup on the Call History tab of the Voice Response Debugging Window dialog box, you see the code that identifies the audio file to be played within the <audio> </audio> pair of elements. Within the audio element, you can also see text that plays if the audio file cannot be found: "You have successfully retrieved a VXML stream."

Remarks

This code sample is intended to demonstrate specific Speech Server features. It does not necessarily reflect best practices with respect to security and privacy. You should carefully review any code that you deploy in production for potential security risks and privacy issues.