Beispiel #1
4
function reloadSip()
{
    global $locate;
    $objResponse = new xajaxResponse();
    if ($_SESSION['curuser']['usertype'] == 'reseller' || $_SESSION['curuser']['usertype'] == 'admin') {
        $myAsterisk = new Asterisk();
        $myAsterisk->execute("sip reload");
        $objResponse->addAlert($locate->Translate("sip conf reloaded"));
    }
    return $objResponse;
}
Beispiel #2
0
function getCurchannels()
{
    global $config, $locate;
    $html = '<table border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#F0F0F0" id="menu" width="650"> ';
    $myAsterisk = new Asterisk();
    $myAsterisk->config['asmanager'] = $config['asterisk'];
    $res = $myAsterisk->connect();
    if (!$res) {
        return;
    }
    $res = $myAsterisk->execute("core show channels concise");
    $channels = explode("\n", $res);
    foreach ($channels as $channel) {
        if (strstr(strtolower($channel), 'privilege') || trim($channel) == '') {
            continue;
        }
        $channel = explode('!', $channel);
        if (strtolower($channel[0]) == '') {
            continue;
        }
        $html .= '<tr bgcolor="#F7F7F7"><td  align="center" valign="center" height="30">' . $channel[0] . '</td><td  align="center" valign="center" height="30"><a href="javascript:void(null)" onclick="xajax_hangupchnnel(\'' . $channel[0] . '\')">' . $locate->Translate('hangup') . '</a></td></tr>';
    }
    $html .= '</table>';
    return $html;
}