Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

TwilioDevEd/call-forwarding-php

Repository files navigation

Twilio

Advanced Call Forwarding with Twilio and PHP

Build Status

Learn how to use Twilio to forward a series of phone calls to your state senators.

Local Development

This project is built using PHP v5.6, and SQLite.

  1. Clone this repository, and cd into it.

    git clone https://github.com/TwilioDevEd/call-forwarding-php.git && \
    cd call-forwarding-php
  2. Install the dependencies with Composer.

    composer install --dev
  3. Run the migrations.

    make migrate

    This will load senators.json and US zip codes into your SQLite database, in the root directory.

    Please note: Our senators dataset is likely outdated, and we've mapped senators to placeholder phone numbers that are set up with Twilio to read a message and hang up.

  4. Expose your application to the internet using ngrok. In a separate terminal session, start ngrok with:

    ngrok http 8080

    Once you have started ngrok, update your TwiML application's voice URL setting to use your ngrok hostname. It will look something like this in your Twilio console:

    https://d06f533b.ngrok.io/callcongress/welcome
    
  5. Start your development server.

    make start

    Once ngrok is running, open up your browser and go to your ngrok URL.

Run tests

To run tests first you need to populate the test db

make migrate_test

After that you can run tests by simple writing

make test

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.