Git Product home page Git Product logo

astertrace's Introduction

Introduction
------------
This was intended as an example of use mixing Ding and PAMI. However, it might be
useful as a tool to help you monitor/debug your asterisk installation, so I'm 
making it freely available.

See this article for more information: http://marcelog.github.com/articles/php_asterisk_listener_example_using_pami_and_ding.html

AsterTrace is extendable via "listeners". Currently these listeners exist:
* dial
* event
* dtmf
* varset
* newchannel
* newstate
* newexten

So currently, AsterTrace can monitor:
* All events (event-listener)
* Call activity (CDR like) (dial-listener)
* DTMF's pressed (dtmf-listener)
* VarSet's  (varset-listener)
* Newchannel (newchannel-listener)
* Newstate (newstate-listener)
* Newexten (newexten-listener)

Each listener is autosufficient, and get called by the container (Ding) whenever an
interesting event occurs. Ding will get called by the pami helper, whenever AMI reports
an event. This event will then get dispatched to the listeners by ding.

TCP Server
----------
AsterTrace uses the Ding TCPServerHelper to start a tcp server. This server allows you
to connect and issue commands, also you can listen for events. The events and responses to
the actions sent are serialized with json :) You can try it via telnet.

REST interface
--------------
Also, a rest interface is available, so you can make it publicly available through a webserver. This
rest interface will let you get events from ami in a json format. Ideal for COMET/Long polling.

Requirements
------------
* PHP 5.3+
* Ding 0.98+ (http://marcelog.github.com/Ding)
* PAMI 1.27+ (http://marcelog.github.com/PAMI)
* mysql server
* log4php (optional)
* pdo-mysql

Configuration
-------------
Assuming you are inside the root directory of the source (thus, having ./conf and ./src)

1.- Copy/Rename the file: conf/log4php.properties.example to log4php.properties. Edit it.
2.- Copy/Rename the file: conf/log4php.properties.example to log4php-rest.properties. Edit it.
3.- Copy/Rename the file: conf/mysql.properties.example to mysql.properties. Edit it. The only
thing you need from mysql, is to have the database created (nothing else, no tables,
AsterTrace will create them on demand).
4.- Copy/Rename the file: conf/php.properties.example to php.properties. Edit it. You can have
your own php settings here.
5.- Copy/Rename the file: conf/astertrace.properties.example to astertrace.properties. Edit it.
6.- Copy/Rename the file: conf/server.properties.example to server.properties. Edit it.
7.- Run astertrace, like "php src/mg/AsterTrace/bin/astertrace.php ./conf"

Thanks to
--------
* Joshua Elson for his help in trying and debugging in loaded asterisk servers.

astertrace's People

Contributors

marcelog avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.