<?php
echo "FN#Status Voip 1-5#";
/*
+---------------------------------------------------------------------+
| |
| SensorAndSwitch Automation Pro |
| PseudoGeräte-Script |
| =============================================================== |
| -> SIP |
| Fritz!Box Rufnummern-Status |
| |
+---------------------------------------------------------------------+
*/
error_reporting(0);
include __DIR__."/../include/psg.php";
$gerarray=getGerInfo(substr(basename(__FILE__,".php"),3));
$Login=$Conf["FB"]."/login_sid.lua";
$user=$Conf["USER"];
$password=$Conf["PASSWORD"];
$url=FB."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=sip:status/sip0/connect";
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$Status1 = curl_exec($ch);
curl_close($ch);
$Login=$Conf["FB"]."/login_sid.lua";
$user=$Conf["USER"];
$password=$Conf["PASSWORD"];
$url=FB."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=sip:status/sip1/connect";
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$Status2 = curl_exec($ch);
curl_close($ch);
$Login=$Conf["FB"]."/login_sid.lua";
$user=$Conf["USER"];
$password=$Conf["PASSWORD"];
$url=FB."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=sip:status/sip2/connect";
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$Status3 = curl_exec($ch);
curl_close($ch);
$Login=$Conf["FB"]."/login_sid.lua";
$user=$Conf["USER"];
$password=$Conf["PASSWORD"];
$url=FB."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=sip:status/sip3/connect";
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$Status4 = curl_exec($ch);
curl_close($ch);
$Login=$Conf["FB"]."/login_sid.lua";
$user=$Conf["USER"];
$password=$Conf["PASSWORD"];
$url=FB."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=sip:status/sip4/connect";
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$Status5 = curl_exec($ch);
curl_close($ch);
$t1="1";
$t2="1";
$t3="1";
$t4="1";
$t5="1";
$x1=explode('"',$Status1);
if ($x1[3]=="0") { $t1="0"; }
if ($x1[3]=="3") { $t1="3"; }
$x2=explode('"',$Status2);
if ($x2[3]=="0") { $t2="0"; }
if ($x2[3]=="3") { $t2="3"; }
$x3=explode('"',$Status3);
if ($x3[3]=="0") { $t3="0"; }
if ($x3[3]=="3") { $t3="3"; }
$x4=explode('"',$Status4);
if ($x4[3]=="0") { $t4="0"; }
if ($x4[3]=="3") { $t4="3"; }
$x5=explode('"',$Status5);
if ($x5[3]=="0") { $t5="0"; }
if ($x5[3]=="3") { $t5="3"; }
echo 'P#Rufnummern-Status: <img src="'.PIC.'mled'.$t1.'.png"> <img src="'.PIC.'mled'.$t2.'.png"> <img src="'.PIC.'mled'.$t3.'.png"> <img src="'.PIC.'mled'.$t4.'.png"> <img src="'.PIC.'mled'.$t5.'.png">*HTML#';
exit;
?>