Page tree

TrackMyCalls is a web application written in PHP that keeps a record of all successful calls made to a list of contacts.


This tool is useful for any developer of PHP applications as it contains basic examples of how to integrate third-party applications with VoipNow via the Call Events feature.

Let us assume that you are an insurance company that uses VoipNow as a Unified Communication system and you want to track down the calls made to customers. You have an internal application and a database containing all the customers. These are not related in any way with VoipNow.

You want to record a note in the internal application every time an employee calls an existing customer. This way, you will have a record for every customer that has received the company's latest offer. You want to know which calls are successful and which are not and also track down if the customer received the offer from the company.

This example illustrates how you can accomplish this.

How to Install It

System Requirements

In order to be able to use the TrackMyCalls plug-in, you need a webserver with PHP 5.2.14 or higher installed. Also, please note that the MySQLi PHP extension is necessary to make the TrackMyCalls setup work.

STEP 1: Clone the files from our GitHub repository into a folder which can be accessed by your web server.

git clone /var/www/html/app-trackmycalls


STEP 2: Allow permissions and ownership rights. You need to give proper permissions and ownership rights to the files of the plugin - the plugin needs to be owned by the web server user and group.

For example, if we use httpd as a webserver:

chwon -R apache:apache <PATH_TO_TRACKMYCALLS>

STEP 3: In order to use the tool, you must first set up the database by running the SQL script located at /sql/callevents.sql.

You should have your DB admin setup a database for you: e.g. trackmycallsdb.

Now, use those values to run the supplied SQL script:

mysql -u<db_user> -p<db_pass> <db_name> < sql/callevents.sql

STEP 4: Configure the tool. As soon as the database is set up, you must configure it by opening the file config.conf in the <PATH_TO_TRACKMYCALLS>/config/ and changing the following settings:

  • Set the db_host variable to the IP of your web server;
  • Set the db_username variable to the username used for accessing the database;
  • Set the db_password variable to the password used by the user;
  • Set the db_databaseName variable to the database you have set up.

How It Works

As soon as calls are placed, the information about the callers involved will be recorded in the database. Calls made to phone numbers that do not exist in the database are ignored. That is why, in order to make this work, you have to insert some contacts in the database (along with their phone numbers).

How to Use It

In order to make this script usable, you need to follow these steps:

STEP 1: Register an extension using a real phone or a softphone.

STEP 2: In the extension manager of your VoipNow administration page, select the extension you wish to monitor and click Call Events.

STEP 3: Configure a 'Hangup' event by clicking on the corresponding link.

STEP 4: Select POST as request method and fill in the Make request to text area with the URL which points to your script.

STEP 5: Click OK to confirm your settings.

STEP 6: Make a call to a number from the contacts list. If the called party answers, a note is written in the database:

| customerId | notes                                                                                                           |
|          2 | Client John Doe with phone # '0003*003' has been called by Employee with ID '002'. Time: 13:33:41 21 Sep 2012   |
|          1 | Client Alan John with phone # '0003*004' has been called by Employee with ID '002'. Time: 13:39:46 21 Sep 2012  |


You register extension 002, which in our case could be the employee, and then you call extension 003 which would be the client. A note will be inserted only if number 003 answers the call. The client's extension can, of course, be an external number.

Further Reading

Call Events Developers Guide

OAuth Protocol

URI/URL Schemes

XML Information

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels

Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.