Hello all,
I'm new on phpagi, I found below script form Openvox manual, I don't understand function WriteTheCallBackList($GSM,$SIP) and $agi = new AGI(); , can someone explain ?
<?php include("/etc/asterisk/agi-bin/phpagi.php"); function WriteTheCallBackList($GSM,$SIP) { $MyFile = fopen("/etc/asterisk/agi-bin/callbacklist.txt","a"); if(!$MyFile) { echo "Open the callbacklist.txt error\n"; return 0; } $List = $GSM."<--------->".$SIP; fwrite($MyFile,$List); fwrite($MyFile,"\n"); fclose($MyFile); } $agi = new AGI(); // WriteTheCallBackList($argv[1],$argv[2]); if($argv[1]=="NO ANSWER") { WriteTheCallBackList($argv[3],$argv[2]); } ?>
Log in to post a comment.
Hello all,
I'm new on phpagi, I found below script form Openvox manual, I don't understand function WriteTheCallBackList($GSM,$SIP) and $agi = new AGI(); , can someone explain ?
!/bin/php -q
<?php
include("/etc/asterisk/agi-bin/phpagi.php");
function WriteTheCallBackList($GSM,$SIP)
{
$MyFile = fopen("/etc/asterisk/agi-bin/callbacklist.txt","a");
if(!$MyFile)
{
echo "Open the callbacklist.txt error\n";
return 0;
}
$List = $GSM."<--------->".$SIP;
fwrite($MyFile,$List);
fwrite($MyFile,"\n");
fclose($MyFile);
}
$agi = new AGI();
// WriteTheCallBackList($argv[1],$argv[2]);
if($argv[1]=="NO ANSWER")
{
WriteTheCallBackList($argv[3],$argv[2]);
}
?>