PHPackages                             opiy-org/asterisk-ari-php - 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. opiy-org/asterisk-ari-php

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

opiy-org/asterisk-ari-php
=========================

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

2.1.1(3y ago)121.2k↓83.3%13MITPHPPHP ^8.0|^8.1

Since Jan 23Pushed 3y ago2 watchersCompare

[ Source](https://github.com/opiy-org/asterisk-ari-php)[ Packagist](https://packagist.org/packages/opiy-org/asterisk-ari-php)[ Docs](https://bitbucket.org/ngvoice/asterisk-ari-client)[ RSS](/packages/opiy-org-asterisk-ari-php/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (8)Dependencies (11)Versions (17)Used By (0)

Asterisk REST Interface (ARI) Application Client
================================================

[](#asterisk-rest-interface-ari-application-client)

forked from

A client implementation of the Asterisk REST Interface and simple Stasis application development library.

The idea is to make ARI calls safe and easy. Therefore, we wanted to get rid of JSON parsing in our application code. Instead, we aim to make it as easy as possible for anyone to talk to ARI without worrying about the implementation of a client stub.

[![tests](https://github.com/opiy-org/asterisk-ari-php/actions/workflows/main.yml/badge.svg)](https://github.com/opiy-org/asterisk-ari-php/actions/workflows/main.yml/badge.svg)

[![Licence](https://camo.githubusercontent.com/84ba0b50ad44e854f0382b3a99afaef96f3d4db9e861686a3297ccd3bd397de7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e63652d4d49542d626c75652e737667)](https://camo.githubusercontent.com/84ba0b50ad44e854f0382b3a99afaef96f3d4db9e861686a3297ccd3bd397de7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e63652d4d49542d626c75652e737667)

[![Diagram of the ARI communication](image/AriClientSketch.png)](image/AriClientSketch.png)

Prerequisites
-------------

[](#prerequisites)

Download and install composer from the following link:

Installing
----------

[](#installing)

##### Composer

[](#composer)

Please run the following command to add the library to your project:

PHP 7.4 `composer require opiy-org/asterisk-ari-php`

PHP 8.0|8.1 `composer require opiy-org/asterisk-ari-php:2`

While installing, you might run into composer errors concerning missing PHP extensions. There are several ways to install them, depending on your operating system. In some very unlikely cases, you might need to install `php-dev` first and then install and enable the extension via PECL. But that is generally not required.

##### Asterisk

[](#asterisk)

You will have to start an Asterisk instance and configure it in order to use ARI. The official Asterisk documentation shows you how to do so.

Alternatively, use our Dockerfile to fire up Asterisk ([See Deployment](#deployment)).

Examples
--------

[](#examples)

#### REST Clients

[](#rest-clients)

Talk to the Asterisk REST Interface through the given REST clients. All requests and responses are objects and easy to understand.

The following example originates a call using the Channels resource:

```
