Пример #1
0
function handler()
{
    global $ARI_VERSION;
    // version
    $ari_version = $ARI_VERSION;
    // check error
    $error = $_SESSION['ari_error'];
    // load modules
    loadModules();
    // login to database
    $success = databaseLogon();
    if ($success) {
        // check if login is needed
        $content = loginBlock();
        if (!isset($content)) {
            list($nav_menu, $subnav_menu, $content) = handleBlock();
        }
    } else {
        $display = new Display();
        $content .= $display->displayHeaderText("ARI");
        $content .= $display->displayLine();
        $content .= checkErrorMessage();
    }
    // log off any databases needed
    databaseLogoff();
    // check for ajax request and refresh or if not build the page
    if (isset($_REQUEST['ajax_refresh'])) {
        echo "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>\n      <response>\n        <nav_menu><![CDATA[" . $nav_menu . "]]></nav_menu>\n        <subnav_menu><![CDATA[" . $subnav_menu . "]]></subnav_menu>\n        <content><![CDATA[" . $content . "]]></content>\n      </response>";
    } else {
        // build the page
        include_once "./theme/page.tpl.php";
    }
}
Пример #2
0
    switch ($pageaction) {
        case "c":
            /* Call me. */
            $call_status = callme_startcall($to, $msgFrom, $new_path);
            echo "<table class='voicemail' style='width: 100%; height: 100%; margin: 0 0 0 0; border: 0px; padding: 0px'><tr><td valign='middle' style='border: 0px'>";
            /* if successful, display hang-up button */
            if (callme_succeeded($call_status)) {
                echo "<a href='callme_page.php?action=h&callmenum=" . $to . "'>Click here to hang up.</a>";
            }
            echo "</td></tr></table>";
            echo "<script language='javascript'>parent.document.getElementById('callme_status').innerHTML = '" . _("{$call_status}") . "';</script>";
            echo "<script language='javascript'>parent.document.getElementById('pb_load_inprogress').value='false';</script>";
            echo "<script language='javascript'>parent.document.getElementById('callme_status').parentNode.style.backgroundColor = 'white';</script>";
            break;
        case "h":
            /* Hang up. */
            /* Find the channel and hang it up if it still exists. */
            callme_hangup($to);
            echo "<script language='javascript'>parent.document.getElementById('callme_status').innerHTML = '" . _("The call was terminated.") . "';</script>";
            break;
    }
} else {
    echo "Unable to connect to Asterisk Manager Interface";
}
// log off any databases needed
databaseLogoff();
?>
  </body>
</html>