FritzBox 7270 an IPS V2.2

Die ist eingebunden

Hier mal ein Auszug aus meiner php.ini:
Code:


max_execution_time=30
register_globals=on
error_reporting=E_ALL
extension_dir=D:\Programme\IP-Symcon\ext
extension = ixed.5.3ts.dll
extension = php_gd2.dll
extension = php_gettext.dll
extension = php_mysql.dll
extension = php_soap.dll
extension = php_sqlite.dll
extension = php_curl.dll
extension = php_http.dll
extension = php_http_ips.dll
extension = php_mbstring.dll
extension = php_xmlrpc.dll

stimmt, sorry. Aber 2 brauchst Du nicht schmeiss die http_dll raus.

Besteht die Möglichkeit per Teamviewer das einzurichten.

Ja, würde gehen. Schickst du mir bitte deine Telefonnr. per PN oder willst du meine?

Gruß computerpap

Habe nochmal eine Frage zur Fritzbox. Zur Anzeige der Anrufliste nutze ich folgendes Script:

<?
//Konfiguration
$fritzbox = '192.168.0.1';
$fritzgui = 'http://' . $fritzbox . '/cgi-bin/webcm';
$password = 'lalala';
$anzeigen = array(1, 2, 3); //1 = Kommend, 2 = Kommend (Fehler), 3 = Gehend
$anzahl = 17;                 // Anzahl der Anrufe einstellen
$namenbeschneiden = 50;       // Den Namen abschneiden nach


//Ab hier nichts mehr ändern
function TextAbschneiden($Text, $Laenge)
{
    $GekuerzterText = substr($Text, 0, strpos(wordwrap($Text, $Laenge-1, "*!U-M-B-R-U-C-H*"), "*!U-M-B-R-U-C-H*"));

    if($GekuerzterText)
    {
        return $GekuerzterText;
    }
    else
    {
        return $Text;
    }
}
function TelSuche($callerNumber) {
$url_orig="http://www.klicktel.de/inverssuche/index/search?method=searchSimple&_dvform_posted=1&phoneNumber=#TEL#";
$url=str_replace("#TEL#","$callerNumber",$url_orig);
$handle=fopen("$url", "r");
if (!$handle)
{
   // error cannot open file
   echo("ERROR : CANNOT OPEN URL : '$url'
");
}
$lineNb = 0;
$searchTag0 = 'namelink';
$searchTag01 = '<strong>';
$searchTag02 = '</strong>';
$found = 0 ;
while(!$found && !feof($handle))
{
    $lineNb++;
    $buffer = fgets($handle);

    if (strpos($buffer, $searchTag0) != false)
    {
        //echo "Name gefunden in Zeile: ".$lineNb."
";
        $found = 1 ;

        $startLN = strpos($buffer, $searchTag01);
        $endeFN = strpos($buffer, $searchTag02) ;
        $name = substr($buffer, $startLN+8, $endeFN) ;
        $foundName1 = $name;
    }
    else {$foundName1 = "Unbekannt";}
}
fclose($handle);
$foundName1 = html_entity_decode($foundName1);
return $foundName1;
}


$object = IPS_GetObject($IPS_SELF);
$parentID = $object['ParentID'];

//Installer
if ($IPS_SENDER == "Execute")
{

    IPS_SetHidden($IPS_SELF, true);
    IPS_SetName($IPS_SELF, "Auslese-Skript");

    $parentObject = IPS_GetObject($parentID);
    if ($parentObject['ObjectType'] !== 1)
    {
        $instanceID = IPS_CreateInstance("{485D0419-BE97-4548-AA9C-C083EB82E61E}");
        IPS_SetParent($instanceID, $parentID);
        $parentID = $instanceID;
        IPS_SetParent($IPS_SELF, $parentID);
        IPS_SetName($instanceID, "Anruferliste");
    }

    IPS_SetScriptTimer($IPS_SELF, 300);

}

$login = file_get_contents('http://' . $fritzbox . '/cgi-bin/webcm?getpage=../html/login_sid.xml');

$session_status_simplexml = @simplexml_load_string($login);

if($session_status_simplexml === false)
{
    die("Fehler beim einlesen der XML Daten. Wahrscheinlich ist eine zu alte Firmware installiert");
}
else if ($session_status_simplexml->iswriteaccess == 1)
{
    $SID = $session_status_simplexml->SID;
}
else
{
   $challenge = $session_status_simplexml->Challenge;
    $response = $challenge . '-' . md5(iconv("UTF-8", "UCS-2LE", $challenge . '-' . $password));
   $postdata = http_build_query(array('getpage' => '../html/de/menus/menu2.html', 'login:command/response' => $response));

    $opts = array('http' =>
                                array(
                                    'method' => 'POST',
                                 'header' => 'Content-Length: '.strlen($postdata)."
".
                                                'Content-Type: application/x-www-form-urlencoded',
                                    'content'=> $postdata
            )
    );

    $context  = stream_context_create($opts);
   $sendlogin = file_get_contents($fritzgui, false, $context);

   preg_match('@<input type="hidden" name="sid" value="([A-Fa-f0-9]{16})" id="uiPostSid">@i', $sendlogin, $matches);
   if (isset($matches[1]) && $matches[1] != '0000000000000000')
   {
      $SID = $matches[1];
   }
   else
   {
      echo "Fehler: Login fehlgeschlagen";
      return;
    }
}

//Anrufliste aktualisieren
$postdata = http_build_query(array('getpage' => '../html/de/menus/menu2.html','sid' => $SID, 'var:menu' => 'home', 'var:pagename' => 'foncalls'));

$opts = array('http' =>
                            array(
                                'method'  => 'POST',
                             'header'=> 'Content-Length: '.strlen($postdata)."
".
                                           'Content-Type: application/x-www-form-urlencoded',
                                'content' => $postdata
        )
);

$context  = stream_context_create($opts);
$getnewlist = file_get_contents($fritzgui, false, $context);

//Anrufliste abholen
$postdata = http_build_query(array('getpage' => '../html/de/FRITZ!Box_Anrufliste.csv', 'sid' => $SID));

$opts = array('http' =>
                            array(
                                'method'  => 'POST',
                             'header'=> 'Content-Length: '.strlen($postdata)."
".
                                           'Content-Type: application/x-www-form-urlencoded',
                                'content' => $postdata
        )
);

$context  = stream_context_create($opts);
$anrufliste = file_get_contents($fritzgui, false, $context);
$anrufliste = explode("
", $anrufliste);

$str = "<table width='90%' align='center'>"; // Farbe anpassen oder style entfernen
$str .= "<tr><td></td><td><b>Datum</b></td><td><b>Name</b></td><td><b>Rufnummer</b></td><td><b>Nebenstelle</b></td><td><b>Zeit</b></td></tr>";

$pos = 0;
for($i=3; $i<=sizeof($anrufliste); $i++)
{
    $eintrag = explode(";", $anrufliste[$i]);
        if($eintrag[2] == "")
      $eintrag[2] = TextAbschneiden(TelSuche($eintrag[3]), $namenbeschneiden);
        if(strlen($eintrag[4]) > 0)
      $eintrag[5] = $eintrag[4];
    if(strlen($eintrag[3]) == 0)
      $eintrag[3] = "Keine Nummer";
    unset($eintrag[4]);
    $caller = $eintrag[0];
        switch($caller) {
       case 1:
          $eintrag[0] = "<img src=/user/fritz/Callin.png>";
          break;
       case 2:
          $eintrag[0] = "<img src=/user/fritz/Callinfailed.png>";
          break;
       case 3:
          $eintrag[0] = "<img src=/user/fritz/Callout.png>";
          break;
        default:
           $eintrag[0] = "";
           break;
    }
    if(in_array($caller, $anzeigen))
    {
        $str .= "<tr>";
        foreach($eintrag as $data)
            $str .= '<td>'.$data.'</td>';
        $str .= "</tr>";

        $pos++;
    }
    if($pos >= $anzahl)
        break;
}
$str .= "</table>";

$vid = CreateVariableByName($parentID, "Content", 3);
IPS_SetIcon($vid, "speaker");
IPS_SetVariableCustomProfile($vid, "~HTMLBox");
SetValue($vid, $str);

$postdata = http_build_query(array('getpage' => '../html/de/menus/menu2.html', 'sid' => $SID, 'security:command/logout' => 'logout'));

$opts = array('http' =>
                            array(
                                'method'  => 'POST',
                             'header'=> 'Content-Length: '.strlen($postdata)."
".
                                           'Content-Type: application/x-www-form-urlencoded',
                                'content' => $postdata
        )
);

$context  = stream_context_create($opts);
$logout = file_get_contents($fritzgui, false, $context);

function CreateVariableByName($id, $name, $type)
{
    global $IPS_SELF;
    $vid = @IPS_GetVariableIDByName($name, $id);
    if($vid === false)
    {
        $vid = IPS_CreateVariable($type);
        IPS_SetParent($vid, $id);
        IPS_SetName($vid, $name);
        IPS_SetInfo($vid, "this variable was created by script #$IPS_SELF");
    }
    return $vid;
}
?>

Bei der Ausführung bekomme ich folgende Fehlermeldungen:


Notice: Undefined offset 2 in D:\Programme\IP-Symcon\scripts\35198.ips.php on line 167
Notice: Undefined offset 3 in D:\Programme\IP-Symcon\scripts\35198.ips.php on line 168
Notice: Undefined offset 4 in D:\Programme\IP-Symcon\scripts\35198.ips.php on line 169
Notice: Undefined offset 3 in D:\Programme\IP-Symcon\scripts\35198.ips.php on line 170
Notice: Undefined offset 4 in D:\Programme\IP-Symcon\scripts\35198.ips.php on line 165
Notice: Undefined offset 2 in D:\Programme\IP-Symcon\scripts\35198.ips.php on line 166
Notice: Undefined offset 3 in D:\Programme\IP-Symcon\scripts\35198.ips.php on line 167
Notice: Undefined offset 4 in D:\Programme\IP-Symcon\scripts\35198.ips.php on line 168
Notice: Undefined offset 3 in D:\Programme\IP-Symcon\scripts\35198.ips.php on line 170

Was ist denn da noch falsch?

Gruß computerpap

$fritzgui = 'http://' . $fritzbox . '/cgi-bin/webcm';

denk mal scharf nach!!!

Hallo RWN

Ich denke du meinst das so:

$fritzgui = 'http://192.168.0.2/cgi-bin/webcm';