This is a project conducted in fulfillment of the requirements for the Honours Programme at the Vrije Universiteit Amsterdam, which is an excellence annotation to the VU Bachelor of Science degree in Computer Science.
The aim of this project is to use crowdsourcing techniques to tag objects from the colonial period exhibited in Dutch museums. We created a IVR (interactive voice response) system to gather information about colonial heritage objects that are originally from Ghana, and that are now exhibited in the Wereldculturen Collectie. We are using the Twilio platform, which offers a Voice API to create a personalized voice interface.
Note: We are assuming you have a valid Twilio account.
The next two sections show step-by-step how to set up the IVR. The first option is using Python and running on a webhook connected to your local machine. The second option, is using the Twilio Service, including functions and assets, which runs on the Node.js engine.
Run the app locally following these steps:
- Clone this repository and
cd
into it. - Install a virtualenv with
pip install virtualenv
- Create the virtual environment with
virtualenv env
- Activate the virtual environement with
source env/bin/activate
- Install the dependencies with
pip install -r reqs.txt
- Execute answer_phone.py with
python3 answer_phone.py
- In a new terminal run
to create a Webhook to your locally running application. You can find more information about ngrok here
ngrok http 5000
- Copy-paste the ngrok link to your Twilio console
Now your server, and consequently your IVR, is up and running.
- Create a new Service in your Twilio Functions and Assets (documentation)
- Copy-paste the JavaScript files from the Node.js folder in function files in your Twilio Functions and Assets (documentation)
- Deploy your Service
- Copy-paste the URL to your Twilio Console
To check whether the Webhook correctly routes to your localhost, simply paste the ngrok URL in your browser of choice.
To test the voice application, simply call your Twilio number. The recordings of the call can then be found under 'Call Logs' on your Twilio console.
In order to store links to the recorded calls and the respective transcripts in a local spreadsheet, simply execute the 'retrieveCalls.py' file after the following steps:
- Save your Twilio SID and authentication token in the twilio.env file to set the environment parameters
- execute
source ./twilio.env
in the terminal