MikoPBX describes its own implementation of the PHP-AGI library.
The source code is described by the link. To start using, be sure to connect 'Globals.php'
It is better to place all files related to your project in the directory /storage/usbdisk1/mikopbx/custom_modules/your directory, this directory will be added to the backup when using the Backup module.
Example of a simple PHP script:
<?php
use MikoPBX\Core\Asterisk\AGI;
require_once 'Globals.php';
$agi = new AGI();
$agi->Answer();
$agi->exec_goto('internal', '2001', '1');
Get extension state
Example of getting the extension status. In some cases, it is necessary to understand whether an internal number exists and what its state is.