Skip to content

Instantly share code, notes, and snippets.

@jurasseck
Created July 24, 2017 17:55
Show Gist options
  • Save jurasseck/4d6c7fa99123fe8883851d298df5d817 to your computer and use it in GitHub Desktop.
Save jurasseck/4d6c7fa99123fe8883851d298df5d817 to your computer and use it in GitHub Desktop.
app/controller/astARI/actions.php
<?php
require_once '../../../lib/Util.php';
require_once '../../model/asterisk/ARI.php';
$ari = new \asterisk\ARI();
//extract($_POST);
$action = 'SipReload';
switch ($action) {
case 'SipReload' :
echo $ari->sipShowPeers();
break;
default:
return "";
break;
}
if ($_POST) {
$comando = base64_decode(@$value);
if ($comando == 'SipReload') {
$ari->sipReload();
}
if ($comando == 'QueueReload') {
$ari->queueReload();
}
if ($comando == 'DialplanReload') {
$ari->dialplanReload();
}
if ($comando == 'Reload') {
$ari->serverReload();
}
if ($comando == 'CoreRestartWhenConvenient') {
$ari->serverRestart('whenConvenient');
}
if ($comando == 'CoreRestartGracefully') {
$ari->serverRestart('gracefully');
}
if ($comando == 'CoreRestartNow') {
$ari->serverRestart('now');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment