Beispiel #1
0
<?php

//
// Copyright (C) 2009-2035 FreePBX-Swiss Urs Rueedi
//
// /provisioner/prov/yealink/001577885533.cfg HTTP/1.1" 200 - "-" "Yealink SIP-T48G 35.80.0.70 00:15:77:88:33:55"
// /provisioner/prov/yealink/001577885533.cfg?mac={mac}&pass=urlpass HTTP/1.1" 200 - "-" "Yealink SIP-T48G 35.80.0.70 00:15:77:88:33:55"
if (preg_match("/yealink/i", $_SERVER["HTTP_USER_AGENT"])) {
    define('DEBUG_FUNCTION', '');
}
include "../../config.php";
$header = Yealink_decode_HTTP_header();
global $debug;
$debug['yealink/dheader'][] = "(yealink 1) " . $header[0] . "-" . $header[1] . "-" . $header[2];
$remote_ip = $_SERVER['REMOTE_ADDR'];
$file = $_SERVER['REQUEST_URI'];
if (DEBUG_FUNCTION == 'd' || DEBUG_FUNCTION == 'yealink' && ($_REQUEST['model'] && $_REQUEST['mac'] && $_REQUEST['qpass'] && $_REQUEST['firmware'])) {
    $model = $_REQUEST['model'];
    $mac = $_REQUEST['mac'];
    $firmware = $_REQUEST['firmware'];
    $qpass = $_REQUEST['qpass'];
    global $debug;
    $debug[] = array(level => 'd', status => 'info', file => __FILE__ . ":" . __LINE__, log => '(' . __FUNCTION__ . ') ' . "rem_ip={$remote_ip}, pass={$qpass}, mac={$mac}");
} else {
    $nonepass = false;
    $model = strtolower($header[0] . $header[1]);
    $mac = strtoupper(str_replace(":", "", $header[3]));
    $firmware = $header[2];
    define(DEBUG_VIEW, false);
    if ($_REQUEST['pass']) {
        $qpass = $_REQUEST['pass'];
Beispiel #2
0
}
$XML_SERVER = "http://" . $amp_conf["AMPPROVSERVER"] . $_SERVER['SCRIPT_NAME'];
$AA_PROXY_SERVER = $amp_conf["AMPPROVSERVER"];
$AA_WEB_SERVER = $amp_conf["AMPPROVSERVER"];
$AA_REGISTRAR_SERVER = $amp_conf["AMPPROVSERVER"];
$ASTERISK_LOCATION = "/etc/asterisk/";
// Retrieve parameters
$extension = $_GET["extension"];
$password = $_GET["password"];
$action = $_GET["action"];
$step = $_GET["step"];
$did = $_GET["did"];
$mobilecid = $_GET["mobilecid"];
$name = umlaut($_GET["name"]);
// get MAC address and type of phone
$value = Yealink_decode_HTTP_header();
$model = $value[0];
$mac = $value[1];
$ip = $value[3];
if ($model == "Yealink51i") {
    $model = "Yealink6751i";
}
if ($model == "Yealink53i") {
    $model = "Yealink6753i";
}
if ($model == "Yealink55i") {
    $model = "Yealink6755i";
}
if ($model == "Yealink57i") {
    $model = "Yealink6757i";
}