function get_aastra_cfg($mac) { $phone_data = get_phone_data($mac, false, true); $durl = parse_url($_SERVER['REQUEST_URI']); $search = array('{{HOST_PROVSERVER}}', '{{HOST_TIMESERVER}}', '{{PROV_PASSWORD}}', '{{NEW_LOGIN}}', '{{Phone_Reregister_Prov}}'); $replace = array($durl['host'], $durl['host'], 'provpass', _("Logout"), '360'); // make slower for security sleep(4.5); $generator = $phone_data['template']->pvt_generator; $read = $generator($phone_data['template']->cfg_base, 'settings'); if ($read) { echo preg_replace($search, $replace, $read); } }
function get_aastra_cfg($mac) { $phone_data = get_phone_data($mac, false, true); $durl = $_SERVER['HTTP_HOST']; $search = array('{{PROV_SERVER_URL}}'); $replace = array($durl); // make slower for security sleep(0.5); $generator = $phone_data['template']->pvt_generator; $read = $generator($phone_data['template']->cfg_base, 'settings'); if ($read) { echo preg_replace($search, $replace, $read); } }
$debug[] = array(level => 'd', status => 'info', file => __FILE__ . ":" . __LINE__, log => '(' . __FUNCTION__ . ') ' . "type={$phone_type} mac={$mac} pass="******":" . __LINE__, log => '(' . __FUNCTION__ . ') ' . "qpass="******"/tmp/phone-" . $mac)); if (preg_match("/^00041/i", $mac) && filemtime("/tmp/phone-" . strtoupper($mac)) < time() - 6) { if (stristr("snomm9r", $phone_type)) { $phone_type = 'snomm9'; } touch("/tmp/phone-" . strtoupper($mac)); $host = get_dbhost($hosts); $sag = new Sag($host); $myip4 = get_ip(4); $phone_data = get_phone_data($mac, $qpass); $phone_data['device'] = strtolower($phone_type); // Upgrade Firmware if customers.firmwareupgrade is on if (DEBUG_FUNCTION != 'all' && DEBUG_FUNCTION != 'snom' && $phone_data['firmwareupdate'] == '1') { check_snom_firmware($agent, $phone_type); } else { global $debug; $debug[] = array(level => 'd', status => 'problem', file => __FILE__ . ":" . __LINE__, log => '(' . __FUNCTION__ . ') ' . "firmwareupdate is not supported from phone firmwareupdate=" . $phone_data['firmwareupdate']); } if (DEBUG_FUNCTION == 'all' || DEBUG_FUNCTION == 'snom' || $phone_data['prov'][0]['mac'] == true) { get_provisioning($phone_data); global $debug; $debug[] = array(level => 'd', status => 'info', file => __FILE__ . ":" . __LINE__, log => '(' . __FUNCTION__ . ') ' . " MAC={$mac}, " . $phone_data[$i]['device'] . ", mac_count(" . $i . ")"); } else { global $debug; $debug[] = array(level => 'd', status => 'problem', file => __FILE__ . ":" . __LINE__, log => '(' . __FUNCTION__ . ') ' . "provision is not supported from phone provisioned=" . $phone_data['provisioned']);