@phone::getVoice

Retrieves user input using speech recognition.

Note: This method requires either the xMatters-provided external ASR engine, or another external ASR engine.

 

Syntax:

@phone::getVoice(String recType[, String recArg[, String recPrompt[. String recPromptDomain]]])

Parameters:

The supported types are dependent on the capabilities of the ASR engine.

Returns:

String representing the recognized input.

Example:

This example uses the getVoice method to first get the digits of the User’s password, and then to retrieve confirmation that the digits were recognized correctly.

$valid = false

  $retry = 3

  WHILE( $retry > 0 )

    @phone::clearDtmf()

    @phone::play("phrase", "ENTER PASSWORD")

    $voiceAnswer = @phone::getVoice("digits", "", "", "")

    @phone::play("phrase", "I heard you say")

    @phone::play("phrase", $voiceAnswer)

    @phone::play("phrase", "Is that correct")

    $yesNo = @phone::getVoice("grammar", "yesno", "", "")

 

    IF ($yesNo == "yes")

      $valid = true

      $retry = 0

    ELSE

      $retry = $retry - 1

      @phone::clearDtmf()

      @phone::play("phrase", "bad password")

    ENDIF

  ENDWHILE

  IF ($valid)

    # Process the voice answer

  endif