Udostępnij za pośrednictwem


RecognizeDTMF (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 RecognizeDTMF sample illustrates how to recognize either dual tone multi-frequency (DTMF) keypad presses or speech input in response to a prompt. When run, the sample plays a welcome message and prompts the caller to speak or enter a four-digit PIN. The sample recognizes DTMF or speech input and plays the recognized number.

  • Recognizing DTMF input
  • Enabling a prompt to recognize DTMF or speech input
  • 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\RecognizeDTMF\ 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 your PIN, enter a four-digit number using the touch-tone keypad on the SIP Phone tab.

    The application says the PIN.

  5. When the call is completed, place another call.

  6. When prompted for a four-digit PIN, click Start Recording, and then say a four-digit PIN.

  7. When the recognized result appears in the Text Input box, click Submit.

    The application recognizes speech input in response to the same prompt for which it previously recognized DTMF.

  8. When prompted for a PIN, say "help".

  9. Before you speak, click Start Recording.

  10. When the recognized value appears in the Commands box, click Submit.

    The application plays a context-specific help message.

  11. To emulate error input, select Error Emulation in the User Input pane, select Silence or No Recognition for the type of error to emulate, and then click Submit.

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.