Soporte & Consultoria

Soporte Remoto y Consultoria skype : ambiorixg12.
Nota no se brinda ningun tipo de consulta o soporte fuera del blog de forma gratuita

jueves, 2 de noviembre de 2023

custom ring group

 #!/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()