Skip to content
Monitor dynamic state of Asterisk PBXes using AMI.
Python Makefile HTML
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.


Say Thanks!

Copyright 2014 Digital Aggregates Corporation, Colorado, USA.


This application and its framework are free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Alternative commercial licensing terms may be available from the copyright holder. Contact the copyright holder for more information.


This is the Digital Aggregates Corporation Hackamore package. Hackamore is a framework and application written in Python that maintains a dynamic model of the call states of one or more Asterisk PBXes using the Asterisk Management Interface (AMI). It was inspired by prior work done in C by Mark Jackson at Aircell Business Aviation Services LLC. Hackamore is a work in progress. This software is an original work of its author.

If you want to run any of the main programs that execute against a live Asterisk server, those programs need to know your server(s) hostname or IP address, AMI port (if not 5038), and the username and secret that you administered in your


file(s). You can either define these as the following environmental variables


(where "n" begins at "1" and increments for each additional Asterisk server). Or you can define them with the same names in a dotfile in your home directory called


from the main programs below will extract them. For example, the dotfile could contains lines


to process AMI messages from two different Asterisk PBXes. The two main programs can be run using the command lines

python src/com/diag/hackamore/


python src/com/diag/hackamore/

in which Main is single threaded, multiplexes the AMI sockets using the select(2) system call, and updates a common model, and Mains is multi-threaded, processes each AMI socket from a different thread, and updates a common model by serializing access to it. Either should work, but the latter can leverage multi-core servers to keep up with higher transaction rates. Run either main program from a W I D E terminal window that supports ANSI control sequences (an xterm works just fine).


Chip Overclock
Digital Aggregates Corporation
3440 Youngfield Street, Suite 209
Wheat Ridge CO 80033 USA
You can’t perform that action at this time.