O'Reilly logo

Twilio Cookbook by Roger Stringer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Allowing outgoing phone calls

We've given users the ability to handle incoming calls. Now let's give them the ability to call people back from their account.

In index.php, we displayed a link on each phone number that lets the user use the "Click-to-Call" feature. Now, let's build up on this recipe.

Getting ready

The complete source code for this recipe can be found in the Chapter9/Recipe6 folder in the source code for this book.

How to do it...

Once we're finished, we'll be able to click any phone number and make an outgoing call. This call will first call us and then the phone number we clicked on. Perform the following step to do so.

Update index.php again with our new routes as follows:

<?php session_start(); include 'Services/Twilio.php'; require("system/jolt.php"); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required