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

Tracking account usage


Tracking your call usage is important if you handle a lot of calls or if you have a site that has multiple users.

My website, theinterviewr.com, looks through hundreds of calls being made each week; this call usage tracking helps me know which users are making which calls so that I can see who's heavily using the network and who is not.

This also helps me analyze things and make sure I'm actually charging users reasonably per call.

Getting ready

The complete source code for this recipe can be found in the Chapter2/Recipe1 folder in the code bundle available at www.packtpub.com/support.

How to do it...

We're going to build a usage tracking system now to let us look at how our Twilio account is being used. Perform the following steps to do so:

  1. Download the Twilio Helper Library from 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 website and make sure the following variables are set:

    <...