Reputation: 1
We have requirement where we ask user for description of issue, it can be long some time. So to gather it we have extended speechTimout to "6" but in some scenario it can be a short so we want to have option where user can press key "1" once he finishes to avoid unnecessary waiting time.
We have provided message to user "Please provide a brief description of your issue. press "1", once you finished"
below is the code
this.twilioService.gather(message, {
...this.getGatherAttributes(gatherAttrs),
finishOnKey: '1',
input: ['speech', 'dtmf'],
timeout: 3,
numDigits: 1,
speechTimeout: 6})
but even if user pressed "1" from keypad gather does not stop and call action, instead it wait for long time (6 sec).
Upvotes: 0
Views: 299
Reputation: 73075
Twilio developer evangelist here.
When you set <Gather>
to listen for speech or dtmf input then once one of those inputs starts Twilio will stop listening for the other. So, if you start entering key presses then finishOnKey
will work. But if you start speaking then finishOnKey
will no longer work.
The speechTimeout
attribute doesn't actually affect how long the caller speaks for, it is a buffer for pauses in speech. If you have speechTimeout
set to "6" then Twilio will wait for 6 seconds once the caller stops speaking.
You can set speechTimeout
to "auto", which means that Twilio will stop speech recognition when it detects a pause in speech and return the results.
Upvotes: 0