2017 © Pedro Peláez
 

library phparia

Asterisk REST Interface (ARI) client for PHP.

image

wormling/phparia

Asterisk REST Interface (ARI) client for PHP.

  • Monday, April 9, 2018
  • by wormling
  • Repository
  • 12 Watchers
  • 32 Stars
  • 1,825 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 24 Forks
  • 14 Open issues
  • 28 Versions
  • 7 % Grown

The README.md

phparia - PHP ARI API

Latest Stable Version Build Status Code Coverage Scrutinizer Quality Score License, (*1)

Functional tests will fail until the new server is ready, (*2)

Framework for creating ARI (Asterisk REST Interface) applications. (https://wiki.asterisk.org/wiki/display/AST/Getting+Started+with+ARI), (*3)

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

Just add the package "wormling/phparia":, (*4)

composer require wormling/phparia

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

    $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

You will find wrappers for (https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+ARI) in the Api folder., (*5)

You will find wrappers for (https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+REST+Data+Models) in the Resources and Events folders., (*6)

Examples

(https://github.com/wormling/phparia/tree/master/src/wormling/phparia/Examples), (*7)

(https://github.com/wormling/phparia/tree/master/src/wormling/phparia/Tests/Functional), (*8)

Extensions

phparia-lyra Sangoma Lyra Answering Machine Detection for Asterisk., (*9)

License

Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0), (*10)

The Versions

09/04 2018

dev-master

9999999-dev http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

10/09 2017

3.1.x-dev

3.1.9999999.9999999-dev http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

10/09 2017

v3.1.1

3.1.1.0 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

04/07 2017

v3.1

3.1.0.0 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

29/05 2017

v3.0.2

3.0.2.0 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

29/05 2017

v3.0.1

3.0.1.0 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

07/02 2017

3.0.x-dev

3.0.9999999.9999999-dev http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

18/01 2017

v3.0.0

3.0.0.0 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

20/12 2016

v2.0.10

2.0.10.0 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

19/04 2016

2.0.x-dev

2.0.9999999.9999999-dev http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

11/04 2016

v2.0.9

2.0.9.0 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

28/03 2016

v2.0.8

2.0.8.0 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

15/03 2016

v2.0.7

2.0.7.0 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

09/02 2016

v2.0.6

2.0.6.0 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

23/12 2015

v2.0.5

2.0.5.0 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

27/11 2015

v2.0.4

2.0.4.0 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

23/09 2015

v2.0.3

2.0.3.0 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

18/09 2015

v2.0.2

2.0.2.0 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

18/09 2015

v2.0.1

2.0.1.0 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

28/08 2015

v2.0

2.0.0.0 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

28/08 2015

v2.0-beta2

2.0.0.0-beta2 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

13/08 2015

v2.0-beta1

2.0.0.0-beta1 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

08/07 2015

v2.0-alpha2

2.0.0.0-alpha2 http://wormling.github.com/phparia

Asterisk REST Interface (ARI) client for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

php rest voip client asterisk ivr call ami telephony ari

21/06 2015

v2.0-alpha

2.0.0.0-alpha http://wormling.github.com/phparia

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

voip client flow asterisk ivr node call telephony ari

21/06 2015

1.1.x-dev

1.1.9999999.9999999-dev http://wormling.github.com/phparia

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

voip client flow asterisk ivr node call telephony ari

21/06 2015

v1.1

1.1.0.0 http://wormling.github.com/phparia

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

voip client flow asterisk ivr node call telephony ari

02/05 2015

1.0.x-dev

1.0.9999999.9999999-dev http://wormling.github.com/phparia

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

voip client flow asterisk ivr node call telephony ari

02/05 2015

v1.0

1.0.0.0 http://wormling.github.com/phparia

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

voip client flow asterisk ivr node call telephony ari