Udostępnij za pośrednictwem


BargeIn (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 BargeIn sample demonstrates how to use bargein to enable callers to progress more quickly through a dialog. After the sample plays a welcome message, it prompts the caller to say the name of his or her favorite color and then says a list of colors from which the caller can choose. The color names that the sample recognizes are blue, red, green, black, yellow, orange, white, purple, and brown. After the caller chooses a color, the sample plays a final prompt confirming the choice, says "goodbye," and then hangs up.

Bargein is enabled during the color query prompt. If the caller says the name of a color that the sample recognizes before the color query prompt ends, the sample immediately plays the final prompt.

  • Using bargein
  • Saving a recognition result to a SemanticItem
  • Using a saved recognition result in a text-to-speech prompt

Running the Sample

To run the sample

  1. In the Samples\Workflow\BargeIn\ 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 the name of a color, click Start Recording, and then say "blue" while the sample is still playing the color query prompt.

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

    The sample immediately plays the final prompt confirming the color choice.

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.