apntalk / ami-client
High-performance, non-blocking Asterisk Manager Interface (AMI) client for PHP 8.4+
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/apntalk/ami-client
Requires
- php: >=8.4
- illuminate/console: ^12.0
- illuminate/support: ^12.0
- psr/log: ^3.0
Requires (Dev)
- phpoption/phpoption: ^1.9
- phpunit/phpunit: ^12.0
- vlucas/phpdotenv: ^5.6
README
Dialer-optimized, multi-server AMI client for PHP/Laravel.
Key Features
- Multi-server tick multiplexing with
AmiClientManager::tickAll(). - Non-blocking runtime contract (NBRC) for tick/connect/reconnect behavior.
- Strong per-node isolation across correlation, parsing, queues, and reconnect state.
- Bounded buffers/queues with backpressure controls.
- Typed actions plus
GenericActionfor arbitrary AMI actions. - Laravel 12 adapter layer (
src/Laravel) withami:listen.
Production Readiness
Point-in-time readiness: 98/100.
Audit: docs/audit/src-production-readiness-audit-014.md
NBRC compliance is the gating principle for runtime behavior and release safety.
Install
composer require apn/ami-client
Requirements:
- PHP
>=8.4
Quickstart (Laravel 12)
use Apn\AmiClient\Cluster\AmiClientManager; use Apn\AmiClient\Protocol\Ping; $manager = app(AmiClientManager::class); $manager->default()->send(new Ping());
GenericAction example:
use Apn\AmiClient\Cluster\AmiClientManager; use Apn\AmiClient\Protocol\GenericAction; app(AmiClientManager::class) ->server('node_1') ->send(new GenericAction('QueueSummary', ['Queue' => 'support']));
Start listener worker:
php artisan ami:listen --server=node_1
# or all configured servers
php artisan ami:listen --all
Quickstart (Pure PHP)
use Apn\AmiClient\Cluster\ConfigLoader; use Psr\Log\NullLogger; $config = require __DIR__ . '/config/ami-client.php'; $manager = ConfigLoader::load($config, new NullLogger()); while (true) { $manager->tickAll(25); // bounded selector wait (ms), avoids hot-spin }
Docs
- Usage guide:
docs/ami-client/usage-guide.md - NBRC:
docs/contracts/non-blocking-runtime-contract.md - Active batch pointer:
docs/ACTIVE-BATCH.md - Delta index:
docs/deltas/INDEX.md
Contributing / Governance
NBRC is authoritative for runtime behavior. Execute work by active batch/task files, and keep delta/task updates batch-scoped rather than appending to large plan files.