PHPackages                             wormling/phparia - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. wormling/phparia

ActiveLibrary[HTTP &amp; Networking](/categories/http)

wormling/phparia
================

Asterisk REST Interface (ARI) client for PHP.

v3.1.1(8y ago)419.8k35[13 issues](https://github.com/wormling/phparia/issues)[4 PRs](https://github.com/wormling/phparia/pulls)Apache-2.0PHPPHP &gt;=5.4

Since May 2Pushed 7y ago12 watchersCompare

[ Source](https://github.com/wormling/phparia)[ Packagist](https://packagist.org/packages/wormling/phparia)[ Docs](http://wormling.github.com/phparia)[ RSS](/packages/wormling-phparia/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (7)Versions (28)Used By (0)

phparia - PHP ARI API
=====================

[](#phparia---php-ari-api)

[![Latest Stable Version](https://camo.githubusercontent.com/15b3f29ae5e3abfe70454b706061d74a06c39ebb1d5160ea82fe915fca9576da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776f726d6c696e672f706870617269612e737667)](https://packagist.org/packages/wormling/phparia) [![Build Status](https://camo.githubusercontent.com/2e65774c3f55a59da4c39d353c3c8e8ffe308629b091fd4d3dafc5b1d6bbdcde/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f776f726d6c696e672f706870617269612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/wormling/phparia) [![Code Coverage](https://camo.githubusercontent.com/7d598cfc4196f6b55feaf2922d2a7d523811c4bfc50b9c18335decd911f6f8dc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f776f726d6c696e672f706870617269612f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/wormling/phparia/?branch=master) [![Scrutinizer Quality Score](https://camo.githubusercontent.com/4429d98163116ae2a2ea04da9ccb6dbf458b6ed4c12ae7b519f090def0e62341/687474703a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f776f726d6c696e672f706870617269612e737667)](https://scrutinizer-ci.com/g/wormling/phparia/)[![License](https://camo.githubusercontent.com/7bb7ecb2022d7d5b72a94ee8edbf8c272787f62f2cc7599af46fbdc2f9f1c754/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f776f726d6c696e672f706870617269612e737667)](http://www.apache.org/licenses/LICENSE-2.0)

**Functional tests will fail until the new server is ready**

Framework for creating ARI (Asterisk REST Interface) applications. ()

Features
--------

[](#features)

- First PHP ARI client to support wss
- Full Asterisk REST Interface support (Tested with 12 and 13)
- Event system at the client and resource level
- Optional basic AMI event/action support
- Verbose for ease of use
- Partial functional tests TODO!

Available via Composer
----------------------

[](#available-via-composer)

Just add the package "wormling/phparia":

```
composer require wormling/phparia
```

Creating a stasis application
-----------------------------

[](#creating-a-stasis-application)

```
    $ariAddress = 'ws://localhost:8088/ari/events?api_key=username:password&app=stasis_app_name';

    $logger = new \Zend\Log\Logger();
    $logWriter = new \Zend\Log\Writer\Stream("php://output");
    $logger->addWriter($logWriter);
    //$filter = new \Zend\Log\Filter\SuppressFilter(true);
    $filter = new \Zend\Log\Filter\Priority(\Zend\Log\Logger::NOTICE);
    $logWriter->addFilter($filter);

    $this->client = new \phparia\Client\Phparia($logger);
    $this->client->connect($ariAddress);
    $this->client->onStasisStart(function(StasisStart $event) {
        $channel = $event->getChannel();
        $bridge = $this->client->bridges()->createBridge(uniqid(), 'dtmf_events, mixing', 'bridgename');
        $this->client->bridges()->addChannel($bridge->getId(), $channel->getId(), null);

        ...
    });

    $this->client->run();
```

Creating a stasis application and listening for AMI events
----------------------------------------------------------

[](#creating-a-stasis-application-and-listening-for-ami-events)

```
    $ariAddress = 'ws://localhost:8088/ari/events?api_key=username:password&app=stasis_app_name';
    $amiAddress = 'username:password@localhost:5038';

    $logger = new \Zend\Log\Logger();
    $logWriter = new \Zend\Log\Writer\Stream("php://output");
    $logger->addWriter($logWriter);
    //$filter = new \Zend\Log\Filter\SuppressFilter(true);
    $filter = new \Zend\Log\Filter\Priority(\Zend\Log\Logger::NOTICE);
    $logWriter->addFilter($filter);

    $this->client = new \phparia\Client\Phparia($logger);
    $this->client->connect($ariAddress, $amiAddress);
    $this->client->onStasisStart(function(StasisStart $event) {
        $channel = $event->getChannel();
        $bridge = $this->client->bridges()->createBridge(uniqid(), 'dtmf_events, mixing', 'bridgename');
        $this->client->bridges()->addChannel($bridge->getId(), $channel->getId(), null);

        $this->client->getWsClient()->on('SomeAMIEventName', function($event) {
            ...
        });

        ...
    });

    $this->client->run();
```

Documentation
-------------

[](#documentation)

You will find wrappers for () in the Api folder.

You will find wrappers for () in the Resources and Events folders.

Examples
--------

[](#examples)

()

()

Extensions
----------

[](#extensions)

[phparia-lyra](https://github.com/wormling/phparia-lyra) [Sangoma Lyra Answering Machine Detection for Asterisk.](http://www.sangoma.com/products/answering-machine-detection-for-asterisk-sangoma-lyra)

License
-------

[](#license)

Apache 2.0 ()

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 87.8% 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 ~33 days

Recently: every ~26 days

Total

27

Last Release

3218d ago

Major Versions

1.1.x-dev → v2.0-alpha2015-06-21

v2.0.10 → v3.0.02017-01-18

PHP version history (2 changes)1.0.x-devPHP &gt;=5.3.3

v1.1PHP &gt;=5.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1608160?v=4)[Brian](/maintainers/wormling)[@wormling](https://github.com/wormling)

---

Top Contributors

[![wormling](https://avatars.githubusercontent.com/u/1608160?v=4)](https://github.com/wormling "wormling (79 commits)")[![Autor69](https://avatars.githubusercontent.com/u/9990024?v=4)](https://github.com/Autor69 "Autor69 (6 commits)")[![andreybolonin](https://avatars.githubusercontent.com/u/2576509?v=4)](https://github.com/andreybolonin "andreybolonin (2 commits)")[![CountJr](https://avatars.githubusercontent.com/u/11260356?v=4)](https://github.com/CountJr "CountJr (1 commits)")[![eric2733](https://avatars.githubusercontent.com/u/25598891?v=4)](https://github.com/eric2733 "eric2733 (1 commits)")[![kitchenu](https://avatars.githubusercontent.com/u/19553191?v=4)](https://github.com/kitchenu "kitchenu (1 commits)")

---

Tags

phpclientrestasteriskamicallivrvoiptelephonyARI

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wormling-phparia/health.svg)

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

###  Alternatives

[greenfieldtech-nirs/phpari

A PHP Class Library for Asterisk ARI

9213.9k](/packages/greenfieldtech-nirs-phpari)[xeroapi/xero-php-oauth2

Xero official PHP SDK for oAuth2 generated with OpenAPI spec 3

1054.7M18](/packages/xeroapi-xero-php-oauth2)[marcelog/pagi

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

190137.8k20](/packages/marcelog-pagi)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34216.9k2](/packages/onesignal-onesignal-php-api)[opiy-org/asterisk-ari-php

An object-oriented client for the Asterisk REST Interface (ARI). Handles ARI calls and events for you.

121.2k](/packages/opiy-org-asterisk-ari-php)

PHPackages © 2026

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