. */ header("Access-Control-Allow-Origin: *"); header("Content-Type: application/xml; charset=UTF-8"); include_once __DIR__ . '/../misc/utilities.php'; $xml = ''; $xml = $xml . ''; $proxy_config_index = 0; $auth_info_index = 0; if (file_exists(REMOTE_PROVISIONING_DEFAULT_CONFIG)) { $rc_array = parse_ini_file(REMOTE_PROVISIONING_DEFAULT_CONFIG, true); foreach ($rc_array as $section => $values) { $xml = $xml . '
'; if (startswith($section, "proxy_config_")) { $proxy_config_index += 1; } else if (startswith($section, "auth_info_")) { $auth_info_index += 1; } foreach ($values as $key => $value) { // We need to replace any < or > by < and > or the xml won't be valid ! $value = str_replace("<", "<", $value); $value = str_replace(">", ">", $value); $xml = $xml . '' . $value . ''; } $xml = $xml . '
'; } } $username = isset($_GET['username']) ? $_GET['username'] : null; $domain = isset($_GET['domain']) ? $_GET['domain'] : SIP_DOMAIN; $transport = isset($_GET['transport']) ? $_GET['transport'] : REMOTE_PROVISIONING_DEFAULT_TRANSPORT; if (!empty($username)) { $xml = $xml . '
'; $xml = $xml . '<sip:' . $username . '@' . $domain . '>'; $xml = $xml . '<sip:' . $domain . ';transport=' . $transport . '>'; $xml = $xml . '<sip:' . $domain . ';transport=' . $transport . '>'; $xml = $xml . '
'; $ha1 = isset($_GET['ha1']) ? $_GET['ha1'] : null; $algo = isset($_GET['algorithm']) ? $_GET['algorithm'] : DEFAULT_ALGORITHM; if (!empty($ha1)) { $xml = $xml . '
'; $xml = $xml . '' . $username . ''; $xml = $xml . '' . $ha1 . ''; $xml = $xml . '' . $domain . ''; $xml = $xml . '' . $algo . ''; $xml = $xml . '
'; } } $xml = $xml . '
'; http_response_code(200); echo $xml; ?>