sayAndCapture - This action that plays a voice file (Text To Speech) into the call and captures the users DTMF input and reports back the DTMF via a webhook (Voice Call Action).

A few things to note:

  • It is mandatory to have a VCA setup on the subaccount for this action to work properly.
  • The CallFlow should not have a Hangup action right after the sayAndCapture action. (The captured DTMF will be ignored)
  • promptMessage is the text input for tts and successMessage is the text for TTS played for successful capture. failureMessage is the text for tts played in case of capture errors. Capture errors are either timeouts or the input digit count is out of the range
  • minDigits is the minimum required digits entered to be a valid input and the maxDigits is the maximum digits accepted. If completeOnHash is false, once the user entered digits reachers maxDigits , the action will end. If the completeOnHash is set to true, then any time user enters #, the entered digits will be validated and the action will end in either success or failure.
  • noOfTries define how many times the sayAndCapture will loop in case of failed inputs. digitTimeoutis the timeout in between two digit presses and the overallTimeout is the time allowed for the user to complete entering all digits.

Other parameters have same definition as in the say action

  • voiceProfile defines the characteristics of the generated speech. Choose one of the available Voice profiles to define the voice, gender and accent for the message you are sending. All available voice profiles can be found at here.
  • repetition controls how many times the speech is played back. The default value is 1.
  • speed controls the speed of the speech. (Accepted values are from 0.5 - 2, as a two-digit number. The default value is 1.
  • text The message body content to be converted to voice. Maximum voice message length is 3000 characters

Path for the new API

/POST{sub-account-id}/callflows - v1.2

Sample of a sayAndCapturerequest

  "action": "sayAndCapture",
  "params": {
      "promptMessage": "Dear customer, on a scale of 1 to 5, Please rate our voice services",
      "voiceProfile": "en-US-BenjaminRUS",
      "repetition": 1,
      "speed": 1,
      "minDigits": 1,
      "maxDigits": 1,
      "digitTimeout": 10000,
      "overallTimeout": 10000,
      "completeOnHash": false,
      "noOfTries": 1,
      "successMessage": "Your response is recorded. Thank you",
      "failureMessage": "Invalid rating input, please try again"