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

Building a call log plugin


This is a basic plugin that is a good starting point for you.

We're going to build a call log that will add a menu option to the side menu and, when clicked, will show us recent calls.

Getting ready

The complete source code for this recipe can be found in Chapter10/Recipe1 in the source code for this book.

How to do it…

We're going to build a basic call logging system. This will give us a call log on the menu of our OpenVBX install, which we can then use to view account usage. The following are the steps you will need to perform:

  1. Create a folder in your plugins folder, and name it calllog.

  2. Create a file named plugin.json and write in the following code:

    { 
      "name" : "Call Log",
      "description" : "This displays a list of all the calls and sms that have been made or received.",
      "links" : [{
        "menu" : "Call Log",
        "url" : "call_log",
        "script" : "call_log.php",
        "label" : "Call Log"
      }]
    }
  3. Create a file named call_log.php and write in the following code:

    &lt...