How to Connect your Bot to a phone through Interactive Voice Response
Through Bot Libre, you can now have a bot talk on the phone through Interactive Voice Response. You can use a bot to automate a voice phone call centre, create your own personal virtual receptionist, or automate phone calls. Bot Libre integrates with Twilio.com to allow SMS and IVR. This "How To" will give you a step by step process to connect your bot with Twilio to allow for Interactive Voice Response.
Step 1 - Create a Bot
First you must create a bot that you want to connect to IVR, or you can use one of your existing bots. To create a bot, follow the instructions here: How to create your own chat bot in 10 clicks
Step 2 - Create a Twilio account
Click here to go the Twilio website. To create a trial account, click on the "Sign Up" link in the top right corner of the website.
Enter your information on the following form, then click the "Start your free trial" button.
You will then need to verify your email address. Check your email and click on the link.
You will also need to verify your cell phone number. Enter your cell number and click "Verify".
Once you have received your verification code, enter it on the website and press "Submit" to complete your account creation.
Answer the questions from Twilio or click "Skip to dashboard".
Step 3 - Get a phone number from Twilio
From the menu on the left side of the Twilio website, select "Phone Numbers"
Click the "Get Started" button to begin. Next, click the "Get your first Twilio phone number".
A screen will pop up with a phone number that has been chosen for you. You can accept this phone number by clicking the "Choose this Number" button. If you want to try again for a different phone number, you can click the underlined "Search for a different number" link. Ensure the number you select has voice capabilities.
Step 4 - Connect webhook
Navigate to your bot's page on the Bot Libre website. Go to its admin console by clicking on the gear icon.
Click the "Twilio SMS & IVR" link to view your bot's Twilio settings. Copy the "Twilio Webhook URL" to your clipboard.
Now return to the Console on the Twilio website and select "Phone Numbers"
Next, select "Manage Numbers"
Select the phone number you created to edit its settings.
Scroll down to the "Messaging" section and select "Webhooks/TwiML" from the "Configure with" dropdown menu. Paste the Webhook URL from your bot's SMS admin page into the "A message comes in" Webhook field.
Your bot should now be able to answer voice calls to the phone number you set up on Twilio. Trial accounts on Twilio can only send messages to phone numbers you have verified in the phone numbers section of your account portal. To remove this restriction, you will need to upgrade your Twilio account.
Step 5 - Accessing IVR from a script
To start a voice call from a bot's script, you will need to enter your Twilio account's SID, Auth Token and phone number into your bot's Twilio admin page. You can find your Twilio Account SID and Auth Token on your Account Dashboard on the Twilio site.
Return to your bot's Twilio admin page and enter your Account SID into the Twilio SID field, the Auth Token into the Twilio Secret field and your Twilio phone number into the Twilio Phone Number field. Press "Save"
In summary, your bot should now be able to send and receive voice phone messages. If you encountered any issues, or would like help setting up your bot please email us at firstname.lastname@example.org or upgrade to our Platinum service and we can build your bot for you.