iswriteaccess == 1) { $SID = $session_status_simplexml->SID; } else { $challenge = $session_status_simplexml->Challenge; $response = $challenge . '-' . md5(mb_convert_encoding($challenge . '-' . $password, "UCS-2LE", "UTF-8")); curl_setopt($ch, CURLOPT_POSTFIELDS, "login:command/response={$response}&getpage=../html/de/menus/menu2.html"); preg_match('/name="sid" value="([0-9a-f]*)"/', curl_exec($ch), $matches); if(isset($matches[1]) && $matches[1] != '0000000000000000') { $SID = $matches[1]; } else { echo "Fehler: Login fehlgeschlagen"; return; } curl_setopt($ch, CURLOPT_POSTFIELDS, "sid={$SID}&telcfg:settings/DialPort=60"); // Nebenstellennummer eintragen! curl_exec($ch); curl_setopt($ch, CURLOPT_POSTFIELDS, "sid={$SID}&telcfg:command/Dial=**612"); // Rufnummer eintragen! curl_exec($ch); curl_close($ch); } } ?>