ich möchte mein php Script, das auf einem Windows PC läuft gerne durch ein direkt auf der CCU laufendes tcl Script abblösen. Das PHP sieht so aus:
Code: Alles auswählen
<?
Global $url;
$ch = curl_init($url);
$sCookieFile = tempnam(sys_get_temp_dir(), 'Cookie_Anzeiger');
curl_setopt($ch, CURLOPT_URL, 'https://192.168.178.XX:8443/rest/devices/scenes/scenecallers/appcaller?sceneId=0f5b2fa0-6187-450e-9a91-0f8f2fb2a374&username=administrator&hmac=xxxxxxxxxxxxxxxx');
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/32.0.1700.107 Chrome/32.0.1700.107 Safari/537.36');
//curl_setopt($ch, CURLOPT_USERAGENT,$useragent);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, $sCookieFile); //could be empty, but cause problems on some hosts
curl_setopt($ch, CURLOPT_COOKIEFILE, $sCookieFile); //could be empty, but cause problems on some hosts
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 180);
$answer = curl_exec($ch);
if (curl_error($ch)) {
echo curl_error($ch);
}
echo $answer;
?>
Danke für jeden Tipp!
Gruß, Tim