Asterisk outbound call status page

I recently wrote this as a simple web page to show the current calls in progress on an Asterisk PBX. It was written for an A2Billing system.

It just runs a ‘core show channels concise’ and then shows lines that contain certain text. By default it shows lines that are ‘Up’ and running the ‘Dial’ application, but this could be changed. It uses twitter bootstrap to add some formatting to the table.

The div containing the table is refreshed every 3 seconds. This is what it looks like –

SysAdminMan active calls

Prerequisits

Before we get started there are a few things you need

  1. This status page was written against Asterisk 1.8 – it may work with other versions
  2. ‘/etc/asterisk/phpagi.conf’ should be configured correctly for your system. You should ensure it contains lines like this, where the asmanager settings match those in /etc/asterisk/manager.conf –
[phpagi]
tempdir=/tmp

[asmanager]
server=localhost
port=5038
username=admin
secret=password

 

Installation

First we need to decide where to install the status page. This will depend on your system but if you are running FreePBX then in the ‘admin’ folder is probably a good idea. I recommend you put it in a folder not accessible from the internet as no consideration to security has been made!

mkdir /var/www/html/admin/call-status
cd /var/www/html/admin/call-status

Now download the status page. You will also need PHPAGI, which is used to connect to Asterisk, and can be found here – http://phpagi.sourceforge.net/

wget http://sysadminman.net/misc/sysadminman-call-status.tar.gz
tar xvfz sysadminman-call-status.tar.gz

And that’s it! Just point your browser to the call-status folder.

Licensed under – http://www.gnu.org/licenses/old-licenses/gpl-2.0.html

A fork of this project for use with FreePBX can be found here – https://github.com/lgaetz/freepbx-Call_Status

8 thoughts on “Asterisk outbound call status page

  1. Stephen Vanderwarker

    Great! 1 problem. I can get the total call count but when I make a call it doesn’t show up in the table? Is this just for external numbers or could it be used for local callers. I know running “core show channels concise” lists local calls too. Just can’t figure out why they aren’t showing up :/

  2. Matt Newcombe Post author

    Hi Stephen – by default it show only answered calls, not ringing ones. Is the call definitely answered that you are looking for?

  3. Stephen Vanderwarker

    Well what great timing! I logged in with my Android, called my PC and saw it work flawlessly! Thanks for the script! 🙂

  4. Matt Newcombe Post author

    That would totally depend on your Apache setup, so it’s difficult for me to help unfortunately.

    Regards – Matt

Comments are closed.