I have a usecase where in voice from a twilio call need to be passed to amazon lex and lex should respond back and twilio should respond with the response. My primary reason for using lex is because of limited amount of hints provided by twilio's <gather>
I see the <Gather> verb from twilio and it does do speech to text, but that has not been useful as the hints take only 50 options and I am looking at more than a thousand. Lex seems too complex but
Sorry new to the Voice world :)
Twilio developer evangelist here.
You can achieve this, but the experience is not likely to be as quick as using <Gather>
. To send audio to Lex you'd need to do the following things:
<Record>
TwiML verb.action
attribute on the <Record>
that points to some holding TwiML (just something, perhaps silence, for the call to do while we get the results from Lex)recordingStatusCallback
attribute on the <Record>
. Twilio will make a webhook request to this URL when the recording is available.RecordingUrl
parameter sent to the URL above to download the recording.It's not the most straightforward approach (which is why we built this into <Gather>
) but this is how people were doing so before.
Let me know if this helps.