PHPackages                             fperdomo/php-agi - 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. [API Development](/categories/api)
4. /
5. fperdomo/php-agi

ActiveLibrary[API Development](/categories/api)

fperdomo/php-agi
================

Modern PHP 8.3+ fork of PHPAGI for building Asterisk AGI, FastAGI, and AMI integrations.

1.0.3(2mo ago)121[1 PRs](https://github.com/masterfermin02/php-agi/pulls)MITPHPPHP &gt;=8.3

Since Jan 2Pushed 2mo agoCompare

[ Source](https://github.com/masterfermin02/php-agi)[ Packagist](https://packagist.org/packages/fperdomo/php-agi)[ Docs](https://fperdomo.dev)[ RSS](/packages/fperdomo-php-agi/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (6)Used By (0)

PHPAGI
======

[](#phpagi)

PHPAGI is a PHP library that simplifies building Asterisk AGI (Asterisk Gateway Interface), AMI (Asterisk Manager Interface), and FastAGI applications. This repository is a modernized fork of the original welltime/phpagi project and is updated to be compatible with PHP 8.3+ while maintaining a familiar API for easier migration.

Table of Contents

- Features
- Requirements
- Installation
- Usage
    - AGI script
    - FastAGI
    - Asterisk Manager (AMI)
- Examples
- Directory layout
- Contributing
- License

Features
--------

[](#features)

- AGI class for interactive call control
- FastAGI server support
- Asterisk Manager Interface (AMI) integration
- Updated for PHP 8.3+ compatibility
- Maintains the original API design to simplify migration
- Extensions: ext-sockets

Requirements
------------

[](#requirements)

- PHP 8.3 or higher
- Asterisk PBX (with AGI / FastAGI support)
- Composer for dependency management

Why this fork?
--------------

[](#why-this-fork)

The original `welltime/phpagi` project is now archived, and many deployments still rely on the classic API. This package modernizes PHPAGI for PHP 8.3+ while keeping a familiar developer experience to simplify migration.

Installation
------------

[](#installation)

Install the package via Composer (replace with your vendor if you publish under a different name):

```
composer require fperdomo/php-agi

```

Usage
-----

[](#usage)

Below are minimal examples to get started with AGI, FastAGI, and AMI usage.

### AGI script

[](#agi-script)

AGI scripts are executed by Asterisk from the dialplan. Place executable PHP scripts in the location Asterisk can call.

Example: simple AGI script

```
#!/usr/bin/env php
