This is a Flask app to link your VoiceFlow project with your Twilio phone number and create an IVR.
Go to VoiceFlow and grab your Project VERSION_ID and your API_KEY from
the Integration tab.
Add them to your Python environment variables with the names:
VF_PROJECT_VERSION_ID
VF_API_KEY
Deploy your Flask app (out of this scope) and copy your app URL.
Then go to Twilio and paste your app's URL as the webhook for the incoming calls to your phone number.
Change the following variables to your best options in app.py:
language = 'en-US'
voice = 'alice'
timeout = 5
You also need to add a VoiceFlow variable named choices. This is important for the choices mapping to phone keypad input (more details in Features below).
-
The script will handle VF choices block to let you input each choice as number options in the phone dial pad, and of course, keeping the voice input available.
Do not forget to add the choices variable to your VF project. -
To forward a call, just use the text call_forwarding: followed by the phone number to redirect the call.
For example:
- Audio support: The issue is that when you upload a file to VF using the Audio
block, the URL you get in the API is pointing to an application/octet-stream
MIME type and Twilio API does not support that kind of audio files.
A possible solution could be just place the URL to your correct encoded audio file in VF.
This project was created by:
Daian Gan
Github: daiangan
E-mail: daian@ganmedia.com
Website: https://daiangan.com