Book Image

Twilio Cookbook: Second Edition

By : Roger Stringer
Book Image

Twilio Cookbook: Second Edition

By: Roger Stringer

Overview of this book

Table of Contents (20 chapters)
Twilio Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Making outgoing calls from the browser


You have used your Twilio Client app to receive incoming calls directly to your browser and have a conversation. Now, let's make this application more useful by letting you make outgoing phone calls from your web browser.

Getting Started

We're going to set up our Twilio Client app to allow our user to make outgoing calls directly from the browser.

The complete code for this recipe can be found in the Recipe1 folder under Code.

How to do it…

Let's set up our client to make outgoing calls by performing the following steps:

  1. Download the Twilio Helper Library available at https://github.com/twilio/twilio-php/zipball/master and unzip it.

  2. Upload the Services/ folder to your website.

  3. . Upload config.php to your web server using the following code:

    <?php
    $accountsid = '';  //  YOUR TWILIO ACCOUNT SID
    $authtoken = '';  //  YOUR TWILIO AUTH TOKEN
    $appsid = '';  //  YOUR TWILIO APP SID
    $appname = '';  //  YOUR CLIENT NAME
    $fromNumber = ''; // YOUR TWILIO NUMBER (THIS...