Ejemplo n.º 1
0
        $output = "<YealinkIPPhoneTextScreen LockIn=\"yes\" destroyOnExit=\"yes\">\n";
        $output .= "<Title>" . _("Error") . "</Title>\n";
        $output .= "<Text>" . _("phonetype not found!") . "</Text>\n";
        $output .= "</YealinkIPPhoneTextScreen>\n";
        output($output);
        exit;
    }
    $phone = array('ip' => $ip, 'file' => $model, 'mac' => $mac, 'provmode' => 'login', 'provdate' => time(), 'type' => preg_replace("/yealink/i", "", $model), 'expm' => $expm, 'model' => 'Yealink', 'connect' => 'http://' . $ip);
    add_config_file($phone);
}
yealink_error_check(create_yealink_mac($mac, $extension, $username, $sip_array[$extension]['secret'], $callerid_name, $phone['model'] . $phone['type'], $language, $ip));
if ($debug) {
    error_log($_SERVER['SCRIPT_NAME'] . " Create MAC.cfg: ext={$extension} mac={$mac} ip={$ip} model={$model} " . $phone['model'] . "-" . $phone['type'] . "\n", 3, "/tmp/yealink_startup.log");
}
// Update config file
yealink_error_check(update_startup_file($extension, $mac, $ip, $phone['type']));
if ($debug) {
    error_log($_SERVER['SCRIPT_NAME'] . " Update-startup.cfg:  ext={$extension} mac={$mac} ip={$ip} model={$model}\n", 3, "/tmp/yealink_startup.log");
}
// Create Reboot screen
pbx_manage('login', $extension);
if ($debug) {
    error_log($_SERVER['SCRIPT_NAME'] . " Create-mac: 'login' ext={$extension}\n", 3, "/tmp/yealink_startup.log");
}
$output = "<YealinkIPPhoneTextScreen destroyOnExit=\"yes\">\n";
$output .= "<Title>" . _("{$text}") . "</Title>\n";
$output .= "<Text>" . $extension . _("{$text}") . "</Text>\n";
$output .= "</YealinkIPPhoneTextScreen>\n";
header("Refresh: 2; url=" . $XML_SERVER . "?action=factory");
output($output);
phone_logout($ip);
Ejemplo n.º 2
0
        output($output);
        exit;
    }
    $phone = array('ip' => $ip, 'file' => $model, 'mac' => $mac, 'provmode' => 'login', 'provdate' => time(), 'type' => preg_replace("/snom/i", "", $model), 'expm' => $expm, 'model' => 'Snom', 'connect' => 'http://' . $ip);
    add_config_file($phone);
}
// Create mac.cfg
if ($debug) {
    error_log($_SERVER['SCRIPT_NAME'] . " Create prov.cfg: mac={$mac} ext={$extension} pass={$password} sippass="******" model=" . $model . " lang=" . $language . " ip=" . $ip . "\n", 3, "/tmp/snom_startup.log");
}
snom_error_check(create_snom_mac($mac, $extension, $extension, $sip_array['secret'], '', $model, $language, $ip));
// Update config file startup.cfg
if ($debug) {
    error_log($_SERVER['SCRIPT_NAME'] . " Update-startup.cfg:  ext={$extension} mac={$mac} ip={$ip} model={$model}\n", 3, "/tmp/snom_startup.log");
}
update_startup_file($extension, $mac, $ip, $model);
// Create Reboot screen
if ($debug) {
    error_log($_SERVER['SCRIPT_NAME'] . " Create-mac: 'login' ext={$extension}\n", 3, "/tmp/snom_startup.log");
}
pbx_manage('login', $extension);
$output = "<SnomIPPhoneText>\n";
$output .= "<Title>" . _("logged in") . "</Title>\n";
$output .= "<Prompt>Prompt Text</Prompt>\n";
$output .= "<Text>" . _("logged in") . "</Text>\n";
$output .= "</SnomIPPhoneText>\n";
phone_provision_user($ip, $mac);
output($output);
phone_logout($ip);
if ($debug) {
    error_log($_SERVER['SCRIPT_NAME'] . " Phone: 'reboot' ext={$extension} ip={$ip}\n", 3, "/tmp/snom_startup.log");