[Info] Anzeige des Status einer Rufnummer in SensorAndSwitch

S

SF1975

Guest
Hallo,
Zuerst muss man sich die entsprechende ID (sip1, sip2, ...) der zu überwachenden Rufnummer sichen, dann kann sie so anzeigen lassen:

pseudorufnummer-nr01.php
PHP:
<?php

        /*
                +---------------------------------------------------------------------+
                |                                                                     |
                |   SensorAndSwitch Automation Pro                                    |
                |   PseudoGeräte-Script                                               |
                |   ===============================================================   |
                |   -> SIP                                                            |
                |      Fritz!Box Rufnummern-Status                                    |
                |                                                                     |
                +---------------------------------------------------------------------+
        */

        error_reporting(0);
        include "include/includefunctions.php";
        include "include/includefritzbox.php";
        include "include/includedateien.php";
        include "include/includeconf.php";
        include "include/includeconfig.php";
        include "include/includedefine.php";

        $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);
        $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/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);
        $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/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);
        $Status3 = curl_exec($ch);
        curl_close($ch);
        $t1="2";
        $t2="2";
        $t3="2";
        $x1=explode('"',$Status1);
        if ($x1[3]=="1" or $x1[3]=="2") {
            $t1=$x1[3]-1;
        }
        $x2=explode('"',$Status2);
        if ($x2[3]=="1" or $x2[3]=="2") {
            $t2=$x2[3]-1;
        }
        $x3=explode('"',$Status3);
        if ($x3[3]=="1" or $x3[3]=="2") {
            $t3=$x3[3]-1;
        }
        echo 'P#Rufnummern-Status: <img  src="'.PIC.'mled'.$t1.'.png"> <img  src="'.PIC.'mled'.$t2.'.png"> <img  src="'.PIC.'mled'.$t3.'.png">*HTML#';
        exit;
?>
 
Zuletzt bearbeitet von einem Moderator:
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.