示例#1
0
<?php

include_once 'includes/sio-call-mgmt.php';
include_once 'config/config.inc.php';
$sio = new sioCallMgmt();
switch ($_POST["direction"]) {
    case "in":
        if (!$sio->authenticatePhoneNumber($_POST["to"])) {
            die("Go Away\n");
        }
        break;
    case "out":
        if (!$sio->authenticatePhoneNumber($_POST["from"])) {
            die("Go Away\n");
        }
        break;
    default:
        die("This isn't going anywhere.\n");
}
Header("Content-type: application/xml");
if ($sio->getDnd()) {
    $pushMessage = "Call from " . $_POST["from"] . " blocked.";
    $sio->sendPushMessage($pushMessage);
    $dom = new DOMDocument('1.0', 'UTF-8');
    $response = $dom->createElement('Response');
    $dom->appendChild($response);
    $hangup = $dom->createElement('Reject');
    $hangupReason = $dom->createAttribute('reason');
    $hangupReason->value = 'busy';
    $hangup->appendChild($hangupReason);
    $response->appendChild($hangup);
示例#2
0
<?php

include_once 'includes/sio-call-mgmt.php';
include_once 'config/config.inc.php';
$sio = new sioCallMgmt();
switch ($_POST["method"]) {
    case "login":
        session_start();
        session_destroy();
        $sio = new sioCallMgmt();
        if ($sio->authenticateUserName($_POST["username"], hash("sha256", $_POST["password"]))) {
            session_start();
            $_SESSION["isAuthenticated"] = true;
            $_SESSION["userId"] = $sio->getUserId();
            Header("Location: index.php");
        } else {
            session_destroy();
            Header("Location: index.php?login=false");
        }
        break;
    case "settings":
        session_start();
        if (!empty($_SESSION["isAuthenticated"]) && $_SESSION["isAuthenticated"]) {
            $sio->setUserId($_SESSION["userId"]);
            switch ($_POST["dnd"]) {
                case "on":
                    $sio->setDnd(true);
                    break;
                case "off":
                    $sio->setDnd(false);
                    break;
示例#3
0
<?php

include_once 'includes/sio-call-mgmt.php';
include_once 'includes/rain.tpl.class.php';
include_once 'config/config.inc.php';
$sio = new sioCallMgmt();
raintpl::$tpl_dir = "tpl/";
raintpl::$cache_dir = "/tmp/";
raintpl::$base_url = "/sio-call-mgmt/";
raintpl::$path_replace = true;
$tpl = new raintpl();
session_start();
if (!empty($_SESSION["isAuthenticated"]) && $_SESSION["isAuthenticated"]) {
    $tpl->assign("authenticated", true);
    $sio->setUserId($_SESSION["userId"]);
    $tpl->assign("userDetails", $sio->getUserDetails());
} else {
    $tpl->assign("authenticated", false);
}
#$tpl->assign("settings",$sio->getSettings());
$tpl->draw('index');