By using the Aculab site, you agree with our use of cookies.
right  Talk To Us!

get input Action

 This action is no longer supported in Version 1 REST API. A new implementation of this action is supported using a natural language recogniser in Version 2 of the REST API.

Prompts the caller for input, either by saying a word or phrase or entering digits and waits for a response. You configure the prompt and the words to be recognised by specifying the expected grammar, using Aculab Speech Grammar Format (ASGF) and a period to wait for the words to be recognised. The caller is expected to respond by saying one or more of the words in the grammar or by pressing one or more valid digits.


The get input properties are:

PropertyRequired/OptionalDefaultDescription
prompt required - A play action. This is the prompt that requests the user to say certain words or phrases or enter digits.
speech recognition grammar required - A definition of any words and grammar that is to be recognised in ASGF syntax.
seconds speech recognition timeout optional 30 The time period in seconds that the action waits for speech recognition to complete.
wait for prompt end optional true Whether speech recognition is started after the prompt has been played. If false the speech recognition starts immediately before the prompt starts playing.
digit input enabled optional true Whether digit input is enabled in addition to speech recognition.
digit input options optional   A digit input options object that determines which digits are valid and other options associated with digit input.
on input timeout messages optional "Sorry, I did not recognise anything.",
"Please listen to the instructions and then clearly say the relevant word or phrase."
An array of play actions. This defines messages to play if valid speech is not recognised within the timeout period. Each play action in the array is played once for each successive timeout. When all messages have been played the get input action finishes.
on invalid input messages optional "Sorry, I did not recognise that.",
"Please listen to the instructions and clearly say the relevant word or phrase."
An array of play actions. This defines messages to play if speech is detected that is not part of the grammar or invalid digits are pressed. Each play action in the array is played once for each successive invalid input. When all messages have been played the get input action finishes.
help digit optional "*" A single digit that, when pressed, will result in the prompt being repeated. An emtpy string signifies no help digit. Valid digits are 0123456789ABCD#*.
next page optional null A web page request object that defines the web page to be requested once the get input action has completed successfully. The recognised words or digits entered will be sent to this page. If no page is specified then the subsequent action in the action array will be executed and the recognised words or digits entered will be lost.

digit input options defines which digits can be input, how the digit input is completed and a timeout for successive digit entry:

PropertyRequired/OptionalDefaultDescription
digit count optional 0 The number of digits to enter. 0 signifies an unlimited number of digits, in which case end digit must be set.
end digit optional "#" A single digit that, when pressed, will indicate the end of the number. An empty string signifies no end digit, in which case digit count must not be zero. Valid digits are 0123456789ABCD#*.
valid digits optional "0123456789" A string that represents the set of digits that are deemed to be valid. Note that the help digit and end digit are also valid entries in addition to those set here. Any valid Dual Tone Multi Frequency (DTMF) digit can be included in this string. Valid digits are 0123456789ABCD#*.
seconds digit timeout optional 5 An integer. The time period in seconds that the action waits for each digit to be entered.

web page request defines how a specific web page is requested:

PropertyRequired/OptionalDefaultDescription
url required - The address of the web page to request.
method optional POST "GET" or "POST". The HTTP request method to use when requesting the url.

Returns

The result of the get input action will be returned via the subsequent http request to the next page in action result as follows:

PropertyDescription
input A string containing the speech that was recognised or digits that were entered on the telephone keypad in response to the prompt. For entered digits, the end digit, if entered, is not returned in this string.
input type A string indicating how the string input was obtained. Either 'speech' or 'digits'.
 See also: Simple Get Input
  • Examples:

    • Get a single digit number using the pre-defined grammar and default settings:

      "get_input" : 
      {
          "prompt" : 
          {
              "play" :
              {
                  "play_list" :
                  [
                      {
                          "text_to_say" : "Please say a single digit from zero to nine, or press a single digit followed by the hash key."
                      }
                  ]
              }
          },
          "speech_recognition_grammar" : "//OneDigit",
          "next_page" : 
          {
              "url" : "useinputpage"
          }
      }
      

      The following may be returned when a spoken number is successfully recognised:

      "action_result" :
      {
          "action" : "get_input",
          "result" :
          {
              "input_type": "speech",
              "input" : "seven"
          }
      }
      

      The following may be returned if a digit is pressed on the telephone keypad followed by '#':

      "action_result" :
      {
          "action" : "get_input",
          "result" :
          {
              "input_type": "digits",
              "input" : "7"
          }
      }