IVR on BrainyPi Using Twilio

by dhruvarora561 in Circuits > Computers

2 Views, 0 Favorites, 0 Comments

IVR on BrainyPi Using Twilio

nr-image-2.png

IVR refers to interactive voice response. Almost all companies' customer support uses this technology to automate direction of calls.

When a caller connects, they have to choose one option by dialing the corresponding number then the system will respond to them based on the choice they made.

Supplies

  1. Twilio Account
  2. BrainyPi or Raspberry pi
  3. Keyboard
  4. mouse

Setting Up

1.1 We first need to install git

sudo apt install git

1.2 We also need ngrok so that our machine is publicly accessible. Copy and paste this command to install ngrok.

curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok

Creating Ngrok Tunnel

Now, that ngrok is installed. We can start creating a tunnel.

ngrok http 8000

This will redirect all the requests coming to our ngrok tunnel to localhost:8000.

Setting Up Twilio

3.1 Sign up for twilio and login to console

3.2 At console you will find your auth token. Write it down somewhere but never share it with anybody else

3.3 From the side bar, buy a phone number.

3.4 Select your new number and scroll down to "voice and fax"

3.5 In the when a call comes in section add your ngrok tunnel address.

Running the Script

4.1 In order to start the IVR system, we need to download a script which will take care of rest of the steps.

wget https://raw.githubusercontent.com/dhruvarora561/twilio-ivr/main/automate.sh
bash automate.sh

4.2 This script will ask for a auth token, this is done to secure the access to our IVR system. Paste the auth token when asked and press enter.

Calling the Number

5.1 After the script finishes execution, our system will be up and running and you can test it by calling the number you purchased from Twilio.

5.2 If you encounter any error, you can open up a issue on my github page.