#!/usr/bin/php -q
<?php
set_time_limit(130);
require_once("/var/lib/asterisk/agi-bin/phpagi.php");
error_reporting(E_ALL);
$agi = new AGI();
$agi->answer();
$file = fopen("/var/www/html/custom_codes/devices.txt", "r");
$fileContent = '';
while (!feof($file)) {
$line = fgets($file);
if (!empty($line)) {
$dialstring .= "SIP/$line";
}
$dialstring=trim($dialstring);
}
$agi->verbose("Dial($dialstring)");
$agi->exec('DIAL', "$dialstring"."SIP/dummy");
fclose($file);
?>
devices.txt
6122&
6146&
5101&
5102&
[custom_ring]
exten=>_x.,1,AGI(/var/www/html/custom_codes/ring_devices.php)
same=>n,hangup()
No hay comentarios:
Publicar un comentario