Udostępnij za pośrednictwem


ConfirmUserInput (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 ConfirmUserInput sample demonstrates how to get and confirm two items of information: a user PIN and a tracking number.

The sample starts with a welcome prompt and then asks the caller to enter or say a four-digit PIN. After the sample recognizes the PIN, it asks the caller to confirm the PIN. If the caller does not confirm the PIN, the sample prompts the caller again.

If the caller confirms the PIN, the sample asks the caller to say the tracking number. The caller is again asked to confirm the tracking number that the application recognized. As before, if the caller does not confirm the tracking number, the application prompts for the tracking number again.

Running the Sample

To run the sample

  1. In the Samples\Workflow\ConfirmUserInput\ 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 PIN, speak or enter from the keypad any four-digit number.

    For example, click Start Recording and then say "one two three four."

  5. When the recognized result appears in the Keyword Values box, click Submit.

    The application repeats the PIN and then asks the user to confirm the PIN.

  6. Click Start Recording, and then say "yes."

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

  8. When prompted for a tracking number, click Start Recording, and then say any six-digit number.

    For example, click Start Recording, and then say "one two three four five six."

  9. When the recognized result appears in the Keyword Values box, click Submit.

    The application repeats the tracking number and then asks you to confirm it.

  10. Click Start Recording, and then say "yes."

  11. When the recognized value appears in the Text Input box, click Submit.

    The application says, "Your package is scheduled to be delivered today. Goodbye."

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.