HandleErrors (Managed Code 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 HandleErrors sample illustrates how to implement escalating Silence and No Recognition prompts. When run, the sample plays a welcome message and prompts the user with "Would you like a mocha, latte, or cappuccino?" The sample recognizes speech or dual tone multi-frequency (DTMF) input from the caller. If the caller remains silent or makes an utterance that is not recognized, the sample plays appropriate escalating Silence or No Recognition prompts, such as "If you???re not sure what to say, you can always say help. Or you can press one for a mocha, two for a latte, or three for a cappuccino."

  • Using escalating Silence and No Recognition error prompts
  • Recognizing DTMF or speech input in the same prompt
  • Setting up and enforcing a maximum number of recognition attempts for the application
  • Using context-specific help prompts

Running the Sample

To run the sample

  1. In the Samples\Workflow\HandleErrors\ directory of the Speech Server installation directory, open the sample solution file.

  2. To start debugging, 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.

  4. When prompted for a coffee type, select Error Emulation, click No Recognition, and then click Submit.

    The application plays an appropriately escalated error message, asking you to choose a type of coffee drink.

  5. Click Start Recording, and then say one of the given choices.

  6. When the recognized drink type appears in the Keyword Values box, click Submit.

    The application plays your selection.

    As an alternative to steps 5 and 6, you can say "help" when prompted for a coffee type. When help appears in the Commands box, click Submit.

    The application plays a context-specific help message and asks you to say the type of coffee drink you want or to press 1, 2, or 3 to indicate the drink type. To enter your drink choice as DTMF, click the SIP Phone tab, and then click 1, 2, or 3 on the keypad.

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.