jialbanc/ami

Provide asterisk ami to laravel
5,477
Install
composer require jialbanc/ami
Latest Version:3.0.3
PHP:>=7.1.3
License:MIT
Last Updated:Mar 23, 2020
Links: GitHub  ·  Packagist
Maintainer: jialbanc

Build Status StyleCI

Jialbanc\Ami

Easy control via asterisk manager interface (AMI).

This is an update from original project enniel/ami

Installation and configuration

To install as a composer package to be used with Laravel 5, simply run:

composer require "jialbanc/ami"

Then publish assets with php artisan vendor:publish. This will add the file config/ami.php.

Usage

Connection options

You are can specify connection parameters for each command.

Option Description
--host Asterisk AMI server host
--port Asterisk AMI server port
--username Asterisk AMI server username
--secret Asterisk AMI server secret

Listen ami events

php artisan ami:listen
Artisan::call('ami:listen');

If would you like to see event log in the console use monitor option

php artisan ami:listen --monitor

Send ami action

php artisan ami:action <action> --arguments=<key>:<value> --arguments=<key>:<value> ...
Artisan::call('ami:action', [
    'action'      => <action>,
    '--arguments' => [
        <key> => <value>
        ...
    ]
]);

Send sms messages using chan dongle

php artisan ami:dongle:sms <phone> <message> <device?>
Artisan::call('ami:dongle:sms', [
    'phone'   => <phone>,
    'message' => <message>,
    'device'  => <device?>,
]);

Send ussd commands using chan dongle

php artisan ami:dongle:ussd <device> <ussd>
Artisan::call('ami:dongle:ussd', [
    'device' => <device>,
    'ussd'   => <ussd>,
]);

Send ami commands

This command started cli interface for ami. Command attribute is optional.

php artisan ami:cli [command]

Close cli interface after sending command.

php artisan ami:cli [command] --autoclose
Artisan::call('ami:cli', [
    'command'     => [command],
    '--autoclose' => true,
]);

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

641,106,524 9,700
laravel/framework

The Laravel Framework.

593,882,149 34,959
laravel/tinker

Powerful REPL for the Laravel framework.

502,645,077 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

418,291,778 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

394,964,158 4,660

Version History

Version Released PHP Laravel License
3.0.3 >=7.1.3 ^5.5 MIT
3.0.2 >=7.1.3 ^5.5 MIT
3.0.1 >=7.1.3 ^5.5 MIT
3.0.0 >=7.1.3 ^5.5 MIT
2.1.0 >=5.6.0 ~5.1 MIT
Pre-releases (1)
Version Released PHP Laravel License
0.0.5-RC1 ~5.5|~7.0 ~5.1 MIT