PHPackages                             cristianovalenca/pami - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. cristianovalenca/pami

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cristianovalenca/pami
=====================

Asterisk Manager Interface (AMI) client for PHP, event driven, object oriented

v2.0.4(1mo ago)04291Apache-2.0PHPPHP &gt;=7.1CI passing

Since Aug 30Pushed 1mo agoCompare

[ Source](https://github.com/cristianovalenca/PAMI)[ Packagist](https://packagist.org/packages/cristianovalenca/pami)[ Docs](http://marcelog.github.com/PAMI)[ RSS](/packages/cristianovalenca-pami/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (16)Versions (13)Used By (0)

[![Tests](https://github.com/cristianovalenca/PAMI/actions/workflows/tests.yml/badge.svg)](https://github.com/cristianovalenca/PAMI/actions/workflows/tests.yml)[![Latest Stable Version](https://camo.githubusercontent.com/1b313b32b7240fe88d23d2588632798264c4913d07359d745e521facb9b8e6ed/68747470733a2f2f706f7365722e707567782e6f72672f637269737469616e6f76616c656e63612f70616d692f762f737461626c65)](https://packagist.org/packages/cristianovalenca/pami)[![Total Downloads](https://camo.githubusercontent.com/119e3090f087b04f0bdce0e0e918d17e21395603e7564e132a7383f2057db719/68747470733a2f2f706f7365722e707567782e6f72672f637269737469616e6f76616c656e63612f70616d692f646f776e6c6f616473)](https://packagist.org/packages/cristianovalenca/pami)[![PHP Version Require](https://camo.githubusercontent.com/61126cc13a6fb502765780c282eb534f6261b9c84c95602b3f8a7e6192edc3b3/68747470733a2f2f706f7365722e707567782e6f72672f637269737469616e6f76616c656e63612f70616d692f726571756972652f706870)](https://packagist.org/packages/cristianovalenca/pami)[![License](https://camo.githubusercontent.com/f61413771dad3f1878ac25d9fd2af1bd860703a0e69b283c13c9524dbc1f04b7/68747470733a2f2f706f7365722e707567782e6f72672f637269737469616e6f76616c656e63612f70616d692f6c6963656e7365)](https://packagist.org/packages/cristianovalenca/pami)

PAMI — PHP Asterisk Manager Interface
=====================================

[](#pami--php-asterisk-manager-interface)

PAMI is a set of PHP classes that let you issue commands to an Asterisk Manager Interface (AMI) and/or receive its events, using an observer/listener pattern. It is useful for building operator consoles, call monitors, dashboards and other telephony integrations.

> **Fork.** This is a PHP 8.x–maintained fork of the original [`marcelog/PAMI`](https://github.com/marcelog/PAMI) by [Marcelo Gornstein](https://github.com/marcelog). It keeps the same API while fixing PHP 8 compatibility, adding new actions/events and a full test suite.

Requirements
------------

[](#requirements)

- PHP **7.1+** (developed and tested against **8.1 – 8.4**)
- [`psr/log`](https://packagist.org/packages/psr/log) `^1 || ^2 || ^3`

Installing
----------

[](#installing)

Install via [Composer](https://getcomposer.org/):

```
composer require cristianovalenca/pami
```

Or add it to your `composer.json`:

```
{
  "require": {
    "cristianovalenca/pami": "^2.0"
  }
}
```

Quick start
-----------

[](#quick-start)

```
require __DIR__ . '/vendor/autoload.php';

use PAMI\Client\Impl\ClientImpl as PamiClient;

$options = array(
    'host'            => '127.0.0.1',
    'scheme'          => 'tcp://',
    'port'            => 5038,
    'username'        => 'admin',
    'secret'          => 'secret',
    'connect_timeout' => 10,
    'read_timeout'    => 10,
);

$client = new PamiClient($options);
$client->open();

// Register a listener (a Closure, an [object, method] pair, or an IEventListener):
$client->registerEventListener(function ($event) {
    echo get_class($event), PHP_EOL;
});

// Send an action and read the response.
use PAMI\Message\Action\PingAction;
$response = $client->send(new PingAction());

// Keep processing events (e.g. inside your own loop):
$client->process();

$client->close();
```

### Filtering with predicates

[](#filtering-with-predicates)

`registerEventListener()` accepts an optional second argument: a predicate that is evaluated before the callback runs. The callback fires only when it returns `true`:

```
use PAMI\Message\Event\DialEvent;

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

### Logging

[](#logging)

The client accepts any [PSR-3](https://www.php-fig.org/psr/psr-3/) logger and defaults to a `NullLogger`:

```
$client->setLogger($logger);
```

Supported actions
-----------------

[](#supported-actions)

120 actions are available under `PAMI\Message\Action` (append `Action`, e.g. `OriginateAction`).

```
AbsoluteTimeout, AGI, AgentLogoff, Agents, AttendedTransfer, BlindTransfer, Bridge,
BridgeInfo, Challenge, ChangeMonitor, Command, ConfbridgeList, ConfbridgeMute,
ConfbridgeUnmute, CoreSettings, CoreShowChannel, CoreShowChannels, CoreStatus,
CreateConfig, DAHDIDialOffHook, DAHDIDNDOff, DAHDIDNDOn, DAHDIHangup, DAHDIRestart,
DAHDIShowChannels, DAHDITransfer, DBDel, DBDelTree, DBGet, DBPut, DongleReload,
DongleReset, DongleRestart, DongleSendPDU, DongleSendSMS, DongleSendUSSD,
DongleShowDevices, DongleStart, DongleStop, Events, ExtensionState, GetConfig,
GetConfigJSON, GetVar, Hangup, IAXnetstats, IAXPeerList, IAXpeers, IAXregistry,
JabberSend, ListCategories, ListCommands, LocalOptimizeAway, Login, Logoff,
MailboxCount, MailboxStatus, MeetmeList, MeetmeMute, MeetmeUnmute, MixMonitor,
MixMonitorMute, ModuleCheck, ModuleLoad, ModuleReload, ModuleUnload, Monitor,
Originate, Park, ParkedCalls, PauseMonitor, Ping, PJSIPNotify, PJSIPQualify,
PJSIPRegister, PJSIPShowAors, PJSIPShowAuths, PJSIPShowContacts, PJSIPShowEndpoint,
PJSIPShowEndpoints, PJSIPShowRegistrationInboundContactStatuses,
PJSIPShowRegistrationsInbound, PJSIPShowRegistrationsOutbound, PJSIPShowResourceLists,
PJSIPShowSubscriptionsInbound, PJSIPShowSubscriptionsOutbound, PJSIPUnregister,
PlayDTMF, QueueAdd, QueueLog, QueuePause, QueuePenalty, QueueReload, QueueRemove,
QueueReset, QueueRule, Queues, QueueStatus, QueueSummary, QueueUnpause, Redirect,
Reload, SendText, SetVar, ShowDialPlan, SIPNotify, SIPPeers, SIPQualifyPeer,
SIPShowPeer, SIPShowPeerStatus, SIPShowRegistry, Status, StopMixMonitor, StopMonitor,
UnpauseMonitor, UpdateConfig, UserEvent, VGSMSMSTx, VoicemailUsersList, WaitEvent

```

Supported events
----------------

[](#supported-events)

133 events are available under `PAMI\Message\Event` (append `Event`, e.g. `HangupEvent`). Any event not implemented is delivered as an `UnknownEvent`, so you can still catch it — please report those you find.

```
AgentCalled, AgentComplete, AgentConnect, AgentDump, Agentlogin, Agentlogoff,
AgentRingNoAnswer, Agents, AgentsComplete, AGIExec, AGIExecEnd, AGIExecStart,
AsyncAGI, AsyncAGIEnd, AsyncAGIExec, AsyncAGIStart, AttendedTransfer, BlindTransfer,
Bridge, BridgeCreate, BridgeDestroy, BridgeEnter, BridgeInfoChannel,
BridgeInfoComplete, BridgeLeave, CallAnswered, CallForward, Cdr, CEL, ChannelUpdate,
ConfbridgeEnd, ConfbridgeJoin, ConfbridgeLeave, ConfbridgeList, ConfbridgeListComplete,
ConfbridgeMute, ConfbridgeStart, ConfbridgeTalking, ConfbridgeUnmute, CoreShowChannel,
CoreShowChannelsComplete, DAHDIShowChannels, DAHDIShowChannelsComplete, DBGetResponse,
DeviceStateChange, DeviceStateListComplete, DeviceStatus, Dial, DialBegin, DialEnd,
DNDState, DongleDeviceEntry, DongleNewCUSD, DongleNewUSSD, DongleNewUSSDBase64,
DongleShowDevicesComplete, DongleSMSStatus, DongleStatus, DongleUSSDStatus, DTMF,
DTMFBegin, DTMFEnd, EndpointDetail, EndpointDetailComplete, EndpointList,
EndpointListComplete, ExtensionStatus, FullyBooted, Hangup, Hold, JabberEvent, Join,
Leave, Link, ListDialplan, Masquerade, MessageWaiting, MusicOnHold, MusicOnHoldStart,
MusicOnHoldStop, NewAccountCode, NewCallerid, Newchannel, Newexten, Newstate,
OriginateResponse, ParkedCall, ParkedCallGiveUp, ParkedCallsComplete, ParkedCallTimeOut,
PeerEntry, PeerlistComplete, PeerStatus, Pickup, QueueCallerAbandon, QueueCallerJoin,
QueueCallerLeave, QueueEntry, QueueMember, QueueMemberAdded, QueueMemberPause,
QueueMemberPaused, QueueMemberPenalty, QueueMemberRemoved, QueueMemberRinginuse,
QueueMemberStatus, QueueParams, QueueStatusComplete, QueueSummary, QueueSummaryComplete,
RegistrationsComplete, Registry, Rename, RTCPReceived, RTCPReceiverStat, RTCPSent,
RTPReceiverStat, RTPSenderStat, ShowDialPlanComplete, Shutdown, Status, StatusComplete,
Transfer, Unlink, UnParkedCall, UserEvent, VarSet, VgsmMeState, VgsmNetState, VgsmSmsRx,
VoicemailUserEntry, VoicemailUserEntryComplete

```

Development
-----------

[](#development)

```
composer install       # install dev dependencies
composer test          # run the PHPUnit suite
composer test-coverage # coverage report (requires pcov/xdebug)
composer cs            # PSR-12 code style check (PHP_CodeSniffer)
```

Tests run on PHP 8.1–8.4 in [CI](.github/workflows/tests.yml) on every push and pull request, including a data-driven pass that guards against PHP 8 deprecations across every action and event.

Contributing
------------

[](#contributing)

Contributions are welcome — please read [CONTRIBUTING.md](CONTRIBUTING.md). For security issues, see [SECURITY.md](SECURITY.md). Notable changes are recorded in [CHANGELOG.md](CHANGELOG.md).

License
-------

[](#license)

Apache License 2.0. This fork preserves the original license of [`marcelog/PAMI`](https://github.com/marcelog/PAMI).

Copyright 2016 Marcelo Gornstein &lt;&gt;. Fork maintained by Cristiano Valença.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See [LICENSE](LICENSE) for the full text.

Credits
-------

[](#credits)

Original library and its contributors by Marcelo Gornstein and the PAMI community — see the [upstream repository](https://github.com/marcelog/PAMI) for the full list of acknowledgements.

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance91

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 82% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~460 days

Recently: every ~957 days

Total

12

Last Release

42d ago

Major Versions

1.72 → v2.0.02016-01-09

PHP version history (2 changes)1.62.1PHP &gt;=5.3.3

v2.0.3PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/73e9163390fbec8ac2a41a16a661ed7d952a29fcad58a75326a9329918d59b3c?d=identicon)[cristianovalenca](/maintainers/cristianovalenca)

---

Top Contributors

[![marcelog](https://avatars.githubusercontent.com/u/527356?v=4)](https://github.com/marcelog "marcelog (332 commits)")[![thomasvargiu](https://avatars.githubusercontent.com/u/732012?v=4)](https://github.com/thomasvargiu "thomasvargiu (22 commits)")[![cristianovalenca](https://avatars.githubusercontent.com/u/30990097?v=4)](https://github.com/cristianovalenca "cristianovalenca (15 commits)")[![drakhar-mike](https://avatars.githubusercontent.com/u/3764278?v=4)](https://github.com/drakhar-mike "drakhar-mike (6 commits)")[![shinomontaz](https://avatars.githubusercontent.com/u/9953247?v=4)](https://github.com/shinomontaz "shinomontaz (6 commits)")[![mstyles](https://avatars.githubusercontent.com/u/1187931?v=4)](https://github.com/mstyles "mstyles (5 commits)")[![cch99](https://avatars.githubusercontent.com/u/2806775?v=4)](https://github.com/cch99 "cch99 (5 commits)")[![jacobkiers](https://avatars.githubusercontent.com/u/402504?v=4)](https://github.com/jacobkiers "jacobkiers (4 commits)")[![AlmogBaku](https://avatars.githubusercontent.com/u/98982?v=4)](https://github.com/AlmogBaku "AlmogBaku (3 commits)")[![StrikeForceZero](https://avatars.githubusercontent.com/u/983413?v=4)](https://github.com/StrikeForceZero "StrikeForceZero (2 commits)")[![wormling](https://avatars.githubusercontent.com/u/1608160?v=4)](https://github.com/wormling "wormling (1 commits)")[![pkirk](https://avatars.githubusercontent.com/u/417485?v=4)](https://github.com/pkirk "pkirk (1 commits)")[![Quosimadu](https://avatars.githubusercontent.com/u/10835161?v=4)](https://github.com/Quosimadu "Quosimadu (1 commits)")[![richardfullmer](https://avatars.githubusercontent.com/u/384602?v=4)](https://github.com/richardfullmer "richardfullmer (1 commits)")[![tomcastleman](https://avatars.githubusercontent.com/u/1532660?v=4)](https://github.com/tomcastleman "tomcastleman (1 commits)")

---

Tags

eventclientmanagermonitorasteriskamiactionvoiptelephony

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/cristianovalenca-pami/health.svg)

```
[![Health](https://phpackages.com/badges/cristianovalenca-pami/health.svg)](https://phpackages.com/packages/cristianovalenca-pami)
```

###  Alternatives

[marcelog/pami

Asterisk Manager Interface (AMI) client for PHP, event driven, object oriented

414780.7k1](/packages/marcelog-pami)[chan-sccp/pami

Asterisk Manager Interface (AMI) client for PHP, event driven, object oriented (Fork)

2955.3k](/packages/chan-sccp-pami)[marcelog/pagi

Asterisk Gateway Interface (AGI) client for PHP, suitable to make telephony applications using call flow nodes

192138.9k21](/packages/marcelog-pagi)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
