array( 'host' => '127.0.0.1', 'scheme' => 'tcp://', 'port' => 5038, 'username' => 'manage-blacklist', 'secret' => 'xxxxxxx', 'connect_timeout' => 10000, 'read_timeout' => 10000 ), 'logFile' => '/var/log/apache2/asterisk-ami.log', 'debug' => true ) ); $tree=MyAMI :: dbGetTree(); $info=false; $error=false; if (isset($_POST['name']) && isset($_POST['number'])) { if(MyAMI :: dbPut('blacklist',$_REQUEST['number'],$_REQUEST['name'])) { $tree=MyAMI :: dbGetTree(); $info="Caller ".$_REQUEST['name']." successfully blacklisted."; } else { $error="An error occured blacklisting caller ".$_REQUEST['name']."."; } } elseif (isset($_REQUEST['delete']) && isset($tree['blacklist'][urldecode($_REQUEST['delete'])])) { $number=urldecode($_REQUEST['delete']); if (MyAMI :: dbDel('blacklist',$number)) { $tree=MyAMI :: dbGetTree(); $info="Number $number successfully unblacklisted."; } else { $error="An error occured unblacklisting number $number."; } } ?>
Name | Number | Action |
---|---|---|
$name | $num |