Coder Social home page Coder Social logo

mlan / phpami Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ofbeaton/phpami

0.0 0.0 0.0 206 KB

Asterisk Manager Interface (AMI) for PHP 5.4+ supporting legacy v1.4 to v13 with no thrills.

License: GNU Lesser General Public License v2.1

PHP 100.00%

phpami's Introduction

phpami

Asterisk Manager Interface (AMI) for PHP 5.4+ supporting legacy v1.4 to v13 with no thrills.

This is a fork and update of the AMI portion of the now defunc PHPAGI PHP 4.4 project which has not been updated since 2010.

We have kept the simplicity of a single class with command methods, adding a packagist entry and namespaces. This is a breaking change as class and method names have changed to follow modern standards, however they are a 1:1 mapping so updating your code should be straight forward.

Alternatives

If you are dealing with only Asterisk v13+ servers, consider using PAMI instead, which uses modern design paterns with observer-listener pattern. It no longer supports legacy Asterisk versions like v1.4 however. It may also see less development than the NAMI library for NodeJS.

Updates

The project is considered in a usable state and feature complete.

This project is used in corporate applications. As such, the authors are unlikely to update it on a regular basis, but instead when the corporate applications that use it run into problems. You should expect updates in the 5-10yr range.

Issues and PRs will be monitored, and we will continue to work with the community to provide updates as they are contributed.

Installing via Composer

The recommended way to install PHPAMI is through Composer.

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version:

composer.phar require ofbeaton/phpami

After installing, you can now use it in your code:

   $ami = new \PHPAMI\Ami();
   if ($ami->connect('localhost:5038', 'myuser', 'mysecret', 'off') === false) {
      throw new \RuntimeException('Could not connect to Asterisk Management Interface.');
   }
   
   // // if you have a looping of command function
   // // set allowTimeout flag to true
   // $ami->allowTimeout();

   // $result contains the output from the command
   $result = $ami->command('core show channels');
   
   $ami->disconnect();

License

This software is distributed under the LGPL 2.1 License. Please see License file for more information.

This library is a fork of the now defunc PHPAGI project by Matthew Asham. See Fork release for more details.

phpami's People

Contributors

mlan avatar nicchap avatar ofbeaton avatar russelomua avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.