I have been using Twilio to receive incoming calls.I am able to gather incoming prompts, send DTMF , or play speech prompts.
Occasionally the incoming prompts is very large, and I like Twilio to stop collecting prompt after a given timeout and provide me with partial gather, so I can bargein with a DTMF digit. I have this but it looks like it hangs
resp.gather(input='speech dtmf', timeout=3, speech_timeout=3, action='/gather', method='POST')
When I check the documentation I see:
timeout - allows you to set the limit (in seconds) that Twilio will wait for the caller to press another digit or say another word before it sends data to your action url.
speechTimeout- sets the limit (in seconds) that Twilio will wait before it stops its speech recognition.
If you use both timeout and speechTimeout in your , timeout will take precedence for DTMF input and speechTimeout will take precedence for speech.
Somehow in cases of very large prompt I never get to
@app.route("/gather", methods=['GET', 'POST'])
def gather():
print("--> gather")
resp = VoiceResponse()