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.
<?phpuseMikoPBX\Core\Asterisk\AGI;require_once'Globals.php';$ivr_menu ='/storage/usbdisk1/mikopbx/custom_modules/your directory/file name without extension';$result = $agi->getData($ivr_menu,3000,4);$selectednum = $result['result'];$agi->exec('Dial',"Local/{$selectednum}@internal/n,30,".'TtekKHhU(dial_answer)b(dial_create_chan,s,1)');