2017 © Pedro PelĂĄez
 

library pami

Asterisk Manager Interface (AMI) client for PHP forked from marcelog/pami

image

ryzhov/pami

Asterisk Manager Interface (AMI) client for PHP forked from marcelog/pami

  • Saturday, February 11, 2017
  • by anryzhov
  • Repository
  • 1 Watchers
  • 0 Stars
  • 191 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 155 Forks
  • 0 Open issues
  • 2 Versions
  • 2 % Grown

The README.md

Introduction

This is the fork of https://github.com/marcelog/PAMI, (*1)

PAMI means PHP Asterisk Manager Interface. As its name suggests its just a set of php classes that will let you issue commands to an ami and/or receive events, using an observer-listener pattern., (*2)

Installing

Add this library to your Composer configuration. In composer.json:, (*3)

  "require": {
    "ryzhov/pami": "dev-master"
  }

QuickStart

// Make sure you include the composer autoload.
require __DIR__ . '/vendor/autoload.php';

$options = array(
    'host' => '2.3.4.5',
    'scheme' => 'tcp://',
    'port' => 9999,
    'username' => 'asd',
    'secret' => 'asd',
    'connect_timeout' => 10,
    'read_timeout' => 10
);
$client = new \PAMI\Client\Impl\ClientImpl($options);

// Registering a closure
$client->registerEventListener(function ($event) {
});

// Register a specific method of an object for event listening
$client->registerEventListener(array($listener, 'handle'));

// Register an IEventListener:
$client->registerEventListener($listener);

Using Predicates

A second (optional) argument can be used when registering the event listener: a closure that will be evaluated before calling the callback. The callback will be called only if this predicate returns true:, (*4)

use PAMI\Message\Event\DialEvent;

$client->registerEventListener(
    array($listener, 'handleDialStart'),
    function ($event) {
        return $event instanceof DialEvent && $event->getSubEvent() == 'Begin';
    })
);

Debugging, logging

You can optionally set a PSR-3 compatible logger:, (*5)

$pami->setLogger($logger);

By default, the client will use the NullLogger., (*6)

Thanks To

  • Marcelo Gornstein marcelog@gmail.com, (*7)

  • Jason Blank for helping in the debugging of the queue functionality and some other ami inconsistencies., (*8)

  • Francesco Usseglio Gaudi, for help in debugging the Originate action., (*9)

  • MatĂ­as Barletta, for the vgms support., (*10)

  • Eli Hunter, for helping in bringing in tls compatibility., (*11)

  • Freddy dafredmail at googlemail, for his help and testing environment to add dongle support., (*12)

  • Joshua Elson for his help in trying and debugging in loaded asterisk servers., (*13)

  • Jacob Kiers for his help in bringing in and testing async agi functionality, and CEL event support., (*14)

  • Richard Baar for noticing the lack of eof support when reading from socket, the JabberEvent, and the ScreenName in JabberAction., (*15)

  • Scot Opell for helping in debugging stream_get_line() in 5.3.9 and 5.3.10, (*16)

  • Brian (wormling) for trying and fixing bugs on asyncagi, (*17)

  • Henning Bragge for helping with newstate event and queues., (*18)

  • mbonneau for ParkedCall and UnParkedCall events., (*19)

The Versions

11/02 2017

dev-master

9999999-dev https://github.com/ryzhov/PAMI

Asterisk Manager Interface (AMI) client for PHP forked from marcelog/pami

  Sources   Download

Apache-2.0

The Requires

 

by Aleksandr N. Ryzhov

voip client event action asterisk ami telephony

11/02 2017

v1.0

1.0.0.0 https://github.com/ryzhov/PAMI

Asterisk Manager Interface (AMI) client for PHP forked from marcelog/pami

  Sources   Download

Apache-2.0

The Requires

 

by Aleksandr N. Ryzhov

voip client event action asterisk ami telephony