Callr Actions: gather@v3 accepts an audio file or a text-to-speech prompt
about 1 hour ago by Florent CHAUVEAU
gather@v3 collects DTMF digits like gather@v2. The prompt can now be either a pre-uploaded audio file (sid) or a text-to-speech prompt.
# Audio file prompt
- action: gather@v3
params:
sid: '0d0f9ef6'
maxDigits: 4
timeout: 30
result: $digits
# Text-to-speech prompt
- action: gather@v3
params:
prompt:
what: Please enter your code
maxDigits: 4
result: $digits- Set at most one of
sidandprompt. With neither,gather@v3waits for digits in silence, likegather@v2. - Barge-in: the first key pressed stops the prompt (file or text-to-speech), and digit collection continues.
gather@v1andgather@v2already behaved this way. - Same parameters (
endOnKey,maxDigits,timeout,stopOnTalk) and same result asgather@v2:{ ok, timeout, input, recognized, stoppedOnKey, stoppedOnTalk }. prompt.voiceandprompt.languagenow work together: the language is inferred from the voice.timeoutalso limits how long the prompt can play, so use a larger value for long audio files.- An audio file prompt incurs no text-to-speech charge.
gather@v2 is unchanged and not deprecated for now. To migrate, rename gather@v2 to gather@v3. Our starter templates already use it.
