Download the PHP package tico/phpagi without Composer
On this page you can find all versions of the php package tico/phpagi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package phpagi
PHPAGI — Modern PHP 8.x Asterisk Gateway Interface
A modern, fully-typed PHP library for building Asterisk AGI applications. This is a complete overhaul of the legacy phpagi library, rewritten for PHP 8.1+ with modern OOP practices, strict typing, and PSR-4 autoloading.
Installation
Quick Start
Architecture
Full Example
Changes from the Original (2.20)
Original (phpagi.php) |
Modern (Phpagi\AgiClient) |
|---|---|
| Global functions, no namespace | PSR-4 namespaced under Phpagi\ |
var properties, no type hints |
Typed readonly DTOs, strict types everywhere |
Returns raw arrays: ['code'=>500, 'result'=>-1] |
Throws AgiException on errors |
Array access: $agi->request['agi_callerid'] |
Typed object: $agi->getRequest()->callerId |
Global constants: AST_STATE_UP |
Backed enum: ChannelState::Up |
parse_callerid() returns array |
CallerId::parse() returns typed value object |
join(), substr(), strpos() |
match, str_contains, str_starts_with, str_ends_with |
| Error codes in return values | Structured exception hierarchy |
| PHP 4 compatible syntax | PHP 8.1+ features: enums, union types, named arguments, property promotion |
PHP 8.x Features Used
- Enums —
ChannelStatebacked enum replaces global integer constants - Readonly properties —
AgiRequest,AgiResponse,CallerIdare immutable DTOs - Union types —
string|int|float,string|false,AGI|false - Named arguments — Cleaner constructor/ method calls
- Match expressions — Replaces large
switchblocks - String functions —
str_contains(),str_starts_with(),str_ends_with() - Null coalescing assignment —
$config['key'] ??= 'default' - Constructor property promotion
never/mixed/voidreturn types
Documentation
Legacy documentation for the original API is preserved in src/deprecated/ and docs/.
License
LGPL-2.1-or-later. See COPYING.
All versions of phpagi with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
The package tico/phpagi contains the following files
Loading the files please wait ...