Soporte & Consultoria

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

martes, 24 de enero de 2023

redirect based on afile

 <?php

$queues=file("/home/phpagi-2.20/info.conf");

print_r($queues);


//$queues = explode("-",$queues);


foreach($queues as $key=> $value){


$q=explode("-",$value);


echo shell_exec("php /home/phpagi-2.20/redirect.php $q[0] $q[1]");


}

?>



file content


queue did

support-106

101-201

102-202

103-203


-----------------------


<?php
$queue=$argv[1];
 $dst=$argv[2];

//$chan=shell_exec("asterisk -x \" core show channels concise\" | awk -F! '{print $1}' |awk 'NR==1'");
echo $chan=shell_exec("asterisk -x \" queue show $queue\" | grep SIP | awk '{print $2}' |awk 'NR==1'");
$chan =preg_replace('/\s+/', '',$chan);

echo  "$chan\n";
echo $redirectn=shell_exec("/usr/sbin/asterisk -x \"channel redirect $chan redirect,$dst,1\"");


?>



No hay comentarios:

Publicar un comentario