Practical] Summary of how to make a call from your browser to your cell phone using Twilio.

Medium 7865430650

photo credit: CalEvans via photopin cc

Good evening, this is Bono.

This year, we have used Twilio several times for hackathons.

Twilio is still in its infancy, but we believe that it is one of the services that will be transformed in the near future.

Developer interest is also quite high, and there are always teams using this service when they participate in hackathons.

In this issue, we leave as a reminder how to make a phone call from a browser.

What is Twilio?

IP phone calls are easy to make!


Twilio for KDDI Web Communications

Twilio is a service that makes IP telephony easy to use.

In Japan, KDDI provides this service. The core part of actually "making a call" is provided by the API, and developers can focus only on "how to use" it.

Extensive documentation available.

The service is well documented, and it is a good idea to look for the parts you don't understand there.

Again, the following pages basically follow the contents of the following pages.

Twilio Docs - HowTo Twilio Client Click To Call

First, preparation

Register your phone number

First, register your phone number according to the following site.

A Touch with Twilio | Casley Consulting Technology Blog

Upon registration, you will receive an ACCOUNT SID and AUTH TOKEN as follows


Library Installation

You cannot make a call without a library.

It is a little confusing, but the library is uploaded on GitHub, so download it.

Perform initial setup to use the application

Create a file named browsephone.php and enter the following

[crayon] php
include 'Services/Twilio/Capability.php';.


$capability = new Services_Twilio_Capability($accountSid, $authToken);
? >

Note that for X and Y, click on the dashboard and enter the number in "ACCOUNT SID" and the number in "AUTH TOKEN".


Enter the id assigned to each application in Z.

Select the application from "Tools" > "TWIML APPS" and enter the value in the "Sid" field beyond it.


Create dial section

Add the following to browsephone.php

Create a dialing section for making phone calls.

Note that this is just a copy and paste of the sample code.



Create View

Add the following to browsephone.php

Place buttons, etc. for dialing.

Here, N enters the phone number you want to call.

Note that this is the same number as an international call.



Finally, check from the browser

Now all you have to do is open your browser and press the "Start Call" button to make a call to the phone listed above.