PHPackages                             clue/ami-react - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. clue/ami-react

ActiveLibrary[Queues &amp; Workers](/categories/queues)

clue/ami-react
==============

Streaming, event-driven access to the Asterisk Manager Interface (AMI), built on top of ReactPHP.

v1.2.0(2y ago)85113.9k↓51.8%37[1 PRs](https://github.com/clue/reactphp-ami/pulls)10MITPHPPHP &gt;=5.3CI passing

Since Jul 18Pushed 3mo ago10 watchersCompare

[ Source](https://github.com/clue/reactphp-ami)[ Packagist](https://packagist.org/packages/clue/ami-react)[ Docs](https://github.com/clue/reactphp-ami)[ Fund](https://clue.engineering/support)[ GitHub Sponsors](https://github.com/clue)[ RSS](/packages/clue-ami-react/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (9)Dependencies (6)Versions (11)Used By (10)

clue/reactphp-ami
=================

[](#cluereactphp-ami)

[![CI status](https://github.com/clue/reactphp-ami/actions/workflows/ci.yml/badge.svg)](https://github.com/clue/reactphp-ami/actions)[![installs on Packagist](https://camo.githubusercontent.com/dfb00a9eff772ac139a6046daad23aea23793ffa69ae401790890019b889f8bf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c75652f616d692d72656163743f636f6c6f723d626c7565266c6162656c3d696e7374616c6c732532306f6e2532305061636b6167697374)](https://packagist.org/packages/clue/ami-react)

Streaming, event-driven access to the Asterisk Manager Interface (AMI), built on top of [ReactPHP](https://reactphp.org).

The [Asterisk PBX](https://www.asterisk.org/) is a popular open source telephony solution that offers a wide range of telephony features. The [Asterisk Manager Interface (AMI)](https://wiki.asterisk.org/wiki/display/AST/The+Asterisk+Manager+TCP+IP+API)allows you to control and monitor the PBX. Among others, it can be used to originate a new call, execute Asterisk commands or monitor the status of subscribers, channels or queues.

- **Async execution of Actions** - Send any number of actions (commands) to the Asterisk service in parallel and process their responses as soon as results come in. The Promise-based design provides a *sane* interface to working with out of order responses.
- **Event-driven core** - Register your event handler callbacks to react to incoming events, such as an incoming call or a change in a subscriber state.
- **Lightweight, SOLID design** - Provides a thin abstraction that is [*just good enough*](https://en.wikipedia.org/wiki/Principle_of_good_enough)and does not get in your way. Future or custom actions and events require no changes to be supported.
- **Good test coverage** - Comes with an automated tests suite and is regularly tested in the *real world*against current Asterisk versions and versions as old as Asterisk 1.8.

**Table of contents**

- [Support us](#support-us)
- [Quickstart example](#quickstart-example)
- [Usage](#usage)
    - [Factory](#factory)
        - [createClient()](#createclient)
    - [Client](#client)
        - [close()](#close)
        - [end()](#end)
        - [createAction()](#createaction)
        - [request()](#request)
        - [event event](#event-event)
        - [error event](#error-event)
        - [close event](#close-event)
    - [ActionSender](#actionsender)
        - [Actions](#actions)
        - [Promises](#promises)
        - [Blocking](#blocking)
    - [Message](#message)
        - [getFieldValue()](#getfieldvalue)
        - [getFieldValues()](#getfieldvalues)
        - [getFieldVariables()](#getfieldvariables)
        - [getFields()](#getfields)
        - [getActionId()](#getactionid)
    - [Response](#response)
        - [getCommandOutput()](#getcommandoutput)
    - [Collection](#collection)
        - [getEntryEvents()](#getentryevents)
        - [getCompleteEvent()](#getcompleteevent)
    - [Action](#action)
        - [getMessageSerialized()](#getmessageserialized)
    - [Event](#event)
        - [getName()](#getname)
- [Install](#install)
- [Tests](#tests)
- [License](#license)

Support us
----------

[](#support-us)

We invest a lot of time developing, maintaining and updating our awesome open-source projects. You can help us sustain this high-quality of our work by [becoming a sponsor on GitHub](https://github.com/sponsors/clue). Sponsors get numerous benefits in return, see our [sponsoring page](https://github.com/sponsors/clue)for details.

Let's take these projects to the next level together! 🚀

Quickstart example
------------------

[](#quickstart-example)

Once [installed](#install), you can use the following code to access your local Asterisk instance and issue some simple commands via AMI:

```
