Ejemplo n.º 1
0
    $model = "Yealink6751i";
}
if ($model == "Yealink53i") {
    $model = "Yealink6753i";
}
if ($model == "Yealink55i") {
    $model = "Yealink6755i";
}
if ($model == "Yealink57i") {
    $model = "Yealink6757i";
}
if ($model == "Yealink39i") {
    $model = "Yealink6739i";
}
if (!$extension) {
    $extension = get_provision_state($mac);
}
$phone = check_config_file($mac);
if ($extension) {
    $userdata = get_userdata_from_sip($extension);
}
if ($debug) {
    error_log($_SERVER['SCRIPT_NAME'] . " INFO-1: mac=" . $mac . " ext=" . $extension . " ext=" . $username . " name={$name} pass={$password} model=" . $phone['model'] . " type=" . $phone['type'] . " lang=" . $language . " ip=" . $ip . " did=" . $did . " mobilecid=" . $mobilecid . "\n", 3, "/tmp/yealink_startup.log");
}
if ($prov_mode == 'none') {
    change_language($extension);
    $output = "<YealinkIPPhoneTextScreen LockIn=\"no\" destroyOnExit=\"yes\">\n";
    $output .= "<Title>" . _("Error Mode") . "</Title>\n";
    if ($_SERVER['SCRIPT_NAME'] == "/" . $amp_conf['AMPPROVWEBPATH'] . "/yealink/logout.php") {
        $output .= "<Text>" . _("Logout disallow") . ": {$prov_mode}</Text>\n";
    } elseif ($_SERVER['SCRIPT_NAME'] == "/" . $amp_conf['AMPPROVWEBPATH'] . "/yealink/startup.php") {
Ejemplo n.º 2
0
$asterisk_conf = parse_asterisk_conf(rtrim($amp_conf["ASTETCDIR"], "/") . "/asterisk.conf");
$astman = new AGI_AsteriskManager();
if (!($res = $astman->connect("127.0.0.1", $amp_conf["AMPMGRUSER"], $amp_conf["AMPMGRPASS"]))) {
    unset($astman);
}
// Location of asterisk config files
$ASTERISK_LOCATION = "/etc/asterisk/";
// Global Variables
$Server = "http://" . $amp_conf["AMPPROVSERVER"] . $_SERVER['SCRIPT_NAME'];
// Init number of records
$index = 0;
$directory = array();
// Get header info
$header = Aastra_decode_HTTP_header();
$user = get_userdata($header[1]);
$extension = get_provision_state($header[1]);
// only registered connections allowed (macfile is there)
if (!is_file($amp_conf["AMPWEBROOT"] . "/modules/phoneprovision/aastra/" . $header[1] . ".cfg")) {
    exit;
}
$filename = "pb-" . $header[1] . ".cnt";
$mode = @file($filename);
if ($mode[0] == '') {
    $mode[0] = '0';
}
switch ($mode[0]) {
    case '1':
        $title = 'Privat';
        $numbers = phonebook_look('pb', $extension);
        if (is_array($numbers)) {
            foreach ($numbers as $number => $values) {