Rapid Response Kit: Building Conferencing and Broadcasting with Twilio.
An example application implementing an disaster response kit that allows an organizer to instantly communicate with volunteers.
Run the application
Clone the repository and
Install the application's dependencies with Composer
$ composer install
Copy the sample configuration file and edit it to match your configuration.
$ cp .env.example .env
You can find your
TWILIO_AUTH_TOKENunder your Twilio Account Settings. You can buy Twilio phone numbers at Twilio numbers
TWILIO_NUMBERshould be set to the phone number you purchased above.
TWILIO_RR_NUMBERshould be set to a Twilio number too.
$ php artisan key:generate
Expose the application to the wider Internet using ngrok
$ ngrok http 8000
Once you have started ngrok, update your TwiML app's voice URL setting to use your ngrok hostname, so it will look something like this:
Configure Twilio to call your webhooks You will also need to configure Twilio to call your application when calls are received.
You will need to provision at least one Twilio number with voice capabilities so the application's users can participate in conferences. You can buy a number right here. Once you have a number you need to configure your number to work with your application. Open the number management page and open a number's configuration by clicking on it.
Remember that the number where you change the voice webhooks must be the same one you set on the
For this application, you must set the voice webhook of your number to something like this:
And in this case set the
GETmethod on the configuration for this webhook.
Run the application using Artisan.
$ php artisan serve
artisan serve default behaviour to use
the application is run. This means that the ip addresses where your
app will be reachable on you local machine will vary depending on the
The most common scenario, is that your app will be reachable through
http://127.0.0.1:8000, and this is important because ngrok
creates the tunnel using only that address. So, if
is not reachable in your local machine when you run the app, you must
tell artisan to use this address, like this:
$ php artisan serve --host=127.0.0.1
This application uses this Twilio helper library:
Run the tests
Run at the top-level directory:
If you don't have phpunit installed on your system, you can follow this instructions to install it.