All Projects → TwilioDevEd → client-quickstart-php

TwilioDevEd / client-quickstart-php

Licence: MIT license
Twilio Client Quickstart App

Programming Languages

javascript
184084 projects - #8 most used programming language
PHP
23972 projects - #3 most used programming language
CSS
56736 projects
HTML
75241 projects
shell
77523 projects
Dockerfile
14818 projects
Makefile
30231 projects

Projects that are alternatives of or similar to client-quickstart-php

browser-calls-laravel
A sample application which shows you how to make and receive phone calls with a browser and Twilio Client
Stars: ✭ 29 (+38.1%)
Mutual labels:  twilio-voice
react-native-twilio-phone
Twilio Voice React Native module.
Stars: ✭ 124 (+490.48%)
Mutual labels:  twilio-voice
clicktocall-node
Node.js Click To Call Demo
Stars: ✭ 34 (+61.9%)
Mutual labels:  twilio-voice
ivr-phone-tree-laravel
Create an IVR phone tree with PHP and Laravel 5
Stars: ✭ 17 (-19.05%)
Mutual labels:  twilio-voice
phone-captcha
📱 Block robocalls with captcha for phone calls
Stars: ✭ 32 (+52.38%)
Mutual labels:  twilio-voice
survey-node
Automated surveys via text and voice in Node.js with Express and MongoDB
Stars: ✭ 37 (+76.19%)
Mutual labels:  twilio-voice
browser-calls-flask
A sample application which shows you how to make and receive phone calls with a browser and Twilio Client
Stars: ✭ 14 (-33.33%)
Mutual labels:  twilio-voice
automated-survey-django
A sample app for automated phone surveys with Twilio, TwiML, Python and Django
Stars: ✭ 53 (+152.38%)
Mutual labels:  twilio-voice
human-call-filter
Captcha for phone calls
Stars: ✭ 41 (+95.24%)
Mutual labels:  twilio-voice
Twilio

Twilio Client Quickstart for PHP

We are currently in the process of updating this sample template. If you are encountering any issues with the sample, please open an issue at github.com/twilio-labs/code-exchange/issues and we'll try to help you.

About

This application should give you a ready-made starting point for writing your own voice apps with Twilio Client.

Implementations in other languages:

.NET Java Python Ruby Node
Done Done Done Done Done

Set up

Requirements

Twilio Account Settings

This application should give you a ready-made starting point for writing your own application. Before we begin, we need to collect all the config values we need to run the application:

Config Value Description
Account Sid Your primary Twilio account identifier - find this in the Console.
Phone number A Twilio phone number in E.164 format - you can get one here
App Sid The TwiML application with a voice URL configured to access your server running this app - create one in the console here. Also, you will need to configure the Voice "REQUEST URL" on the TwiML app once you've got your server up and running.
API Key / API Secret Your REST API Key information needed to create an Access Token - create one here.

Local development

After the above requirements have been met:

  1. Clone this repository and cd into it

    git clone [email protected]:TwilioDevEd/client-quickstart-php.git
    cd client-quickstart-php
  2. Install PHP dependencies

    make install
  3. Set your environment variables

    cp .env.example .env

    On production, to avoid showing errors, you should set the variable DISPLAY_ERRORS to 0. For development, it can be set to 1 on development. For more information, read this

    See Twilio Account Settings to locate the necessary environment variables.

  4. Run the application

    make serve
  5. Download and install ngrok

Learn 6 awesome reasons why to use ngrok.

  1. Run ngrok:

    ngrok http 8000
  2. When ngrok starts up, it will assign a unique URL to your tunnel. It might be something like https://asdf456.ngrok.io. Take note of this.

  3. Configure your TwiML app's Voice "REQUEST URL" to be your ngrok URL plus /voice.php. For example:

    screenshot of twiml app

Note: You must set your webhook urls to the https ngrok tunnel created.

You should now be ready to rock! Make some phone calls. Open it on another device and call yourself. Note that Twilio Client requires WebRTC enabled browsers, so Edge and Internet Explorer will not work for testing. We'd recommend Google Chrome or Mozilla Firefox instead.

screenshot of phone app

Docker

If you have Docker already installed on your machine, you can use our docker-compose.yml to setup your project.

  1. Make sure you have the project cloned.
  2. Setup the .env file as outlined in the Local Development steps.
  3. Run docker-compose up.
  4. Follow the steps in Local Development on how to expose your port to Twilio using a tool like ngrok and configure the remaining parts of your application

Unit and Integration Tests

You can run the Unit and Feature tests locally by typing:

bin/phpunit tests

Cloud deployment

Additionally to trying out this application locally, you can deploy it to a variety of host services. Here is a small selection of them.

Please be aware that some of these might charge you for the usage or might make the source code for this application visible to the public. When in doubt research the respective hosting service first.

Service
Heroku Deploy

Resources

  • The CodeExchange repository can be found here.

Contributing

This template is open source and welcomes contributions. All contributions are subject to our Code of Conduct.

Visit the project on GitHub

License

MIT

Disclaimer

No warranty expressed or implied. Software is as is.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].