This repository uses the Twilio Video SDK under the hood to establish the audio/video connection between Pepper and a web app. In order to use the Twilio SDK, you need to create a Twilio account by registering on https://www.twilio.com/try-twilio.
Twilio provides several commercial services. You will be using Twilio Programmable Video in this app. You can find a lot of information on Programmable Video in the dedicated documentation here
To configure Twilio Video, first log in to Twilio console using your newly created account.
Then access the dedicated Video configuration page by going to the Room settings page:
Twilio uses the concept of Rooms in their Video SDK. Briefly, to establish an audio/video call between two parties, both have to join the same room. Twilio Rooms have a Type, and a maximum number of participants. You can learn more on Twilio rooms in the documentation. For our specific use case, setup the room settings as in the screenshot above:
- Chooose "Peer-to-peer" for ROOM TYPE
- Set TURN to "ENABLED"
- Set the MAXIMUM PARTICIPANTS to "2"
- Set CLIENT-SIDE ROOM CREATION to "ENABLED"
Then click on the Save button.
You will need a temporary Twilio access token if you want to quicktest the Pepper Android app and the associated Web app.
To retrieve a Twilio Access Token, go to the Testing Tools page, enter a name in the CLIENT IDENTITY field, leave the field Choose your room name empty, and click on Generate Access Token:
The Twilio Access Token you will obtain is a long JWT string that looks like this:
eyJ0eXAiOiJKV1QiLCJhbGciOiQWERTY1NiIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTSzhkOWE0Mm
E5NTllMTk5YTNlOGIyZDE3ZmEzOWZiZjBlLTE1OTY0NjA5ODAiLCJpc3MiOiJTSzhkOWE0MmE5NTllMTk5YTFDOGIyZ
DE3ZmEzOWZiZjBlIwwic3ViIjoiQUM3ZTXZNzA3ZGQ0ZDE3NmJmMzdmZsngwODM5ZmYxOGUzMiIsImV4cCI6MTU5NjQ
2NDU4MCwiZ3JhbnRzIjp7ImlkZW50aXR5IjoidG90byIsInZpZGVvIjp7fX19.vVEcRNPyoyotystFndbecjhXw6IUU
PNyAypIq4oFB5c
Beware: For the CLIENT IDENTITY, you MUST choose a different name for each of the apps where you use a Twilio token. For instance choose "Pepper" for the Access Token you will paste in the Android app, and choose "Operator" for the Twilio token you use in the Web App.
You will need Twilio configuration ids to run the web app on Firebase cloud.
You will need to gather:
- Account SID: Your primary Twilio account identifier - find this in the console here.
- API Key SID: Used to authenticate - generate one here.
- API Key Secret: Used to authenticate - just like the above, you'll get one here.
When you generate an API key pair at the URLs above, your API Key Secret will only
be shown once - make sure to save this in a secure location,
or possibly your ~/.bash_profile
.