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, 26 de noviembre de 2015

USING asterisk AGI and PHP

/* first script use to catch the  key pressed */

#!/usr/bin/php -q

<?php

echo "ANSWER";

echo "\n";

echo  "EXEC saydigits $argv[1]";

echo "\n";

echo "EXEC  read   d,demo-thanks,1";

echo "\n";

?>

/*  second script play.php*/

#!/usr/bin/php -q

<?php
if($argv[1]==4){
echo  "EXEC saydigits $argv[1]";
}
if($argv[1]==5){
echo  "EXEC saydigits $argv[1]";
}


else   {
echo "EXEC  playback im-sorry";


}
?>

[agi-script]
exten=>123,1,Noop()
same=>n,AGI(/root/agi.php,${CALLERID(num)})
same=>n,Noop(value of ${d})
same=>n,AGI(/root/play.php,${d})


NOTE PATH for PHP is different  to /usr/bin/php  on centos  use the which command to get the correct path




No hay comentarios:

Publicar un comentario