diff --git a/archive-sources/FritzCallMonitor/AHA-HTTP-Interface.pdf b/archive-sources/FritzCallMonitor/AHA-HTTP-Interface.pdf deleted file mode 100644 index 46697ab9..00000000 Binary files a/archive-sources/FritzCallMonitor/AHA-HTTP-Interface.pdf and /dev/null differ diff --git a/archive-sources/FritzCallMonitor/FritzCallMonitor.addr b/archive-sources/FritzCallMonitor/FritzCallMonitor.addr deleted file mode 100644 index 8769e9c7..00000000 --- a/archive-sources/FritzCallMonitor/FritzCallMonitor.addr +++ /dev/null @@ -1 +0,0 @@ -012345|zu hause|Meinestr. 12|12345|Meinestadt| diff --git a/archive-sources/FritzCallMonitor/FritzCallMonitor.cfg b/archive-sources/FritzCallMonitor/FritzCallMonitor.cfg deleted file mode 100644 index 5bdc5007..00000000 --- a/archive-sources/FritzCallMonitor/FritzCallMonitor.cfg +++ /dev/null @@ -1,184 +0,0 @@ -# Der Port 1012 der FRITZBox muss einmalig per Telefon (analog!) aktiviert werden: -# Telefoncode zum öffnen des TCP-Ports: #96*5* -# Telefoncode zum schließen des TCP-Ports: #96*4* -# Diese Funktion wir ab der Firmware Version xx.03.99 von AVM unterstützt. - -# IP von deiner Fritzbox und port -FRITZBOXIP=fritz.box -PORT=1012 - -# Adressbuch Datei -ADDRESSBOOK=/var/tuxbox/config/FritzCallMonitor.addr - -# Pfadangabe für den Aufruf eines Scripts. -# Nach eingehendem Anruf, kann ein Script ausgeführt werden, -# durch die z.B. die Lautstärke den Box herunter geregelt wird. -# Als Parameter wird der Inhalt der Nachricht, die auch über -# die Box ausgegeben wird, übergeben. -# Dieses Script muss natürlich vorhanden und ausführbar sein. -# Es wird per default kein Script mitgeliefert. -EXEC= - -# Rückwärtssuche über das Internet -BACKWARDSEARCH=1 - -# Debug Ausgaben -DEBUG=0 - -# Neutrino Nachrichtentyp Popup (popup) oder Message (nmsg) -MSGTYPE=nmsg - -# Maximale Anzeigedauer der Nachricht auf dem Bildschirm, bevor sie automatisch gelöscht wird. -# Ist hier kein Wert eingetragen, wird der Neutrino default genommen (ab Revision 1782). -MSGTIMEOUT= - -# MSN Rufnummern, die überwacht werden sollen. Wenn "MSN_1" frei bleibt, werden alle Rufnummern überwacht. -# Optional kann auch der Name angegeben werden. Die Eingabe erfolgt dann |. -MSN_1= -#MSN_2= -#MSN_3= -#MSN_4= -#MSN_5= -#MSN_6= - -# IP Adresse der Box. Die erste Adresse sollte 127.0.0.1 sein (die Box auf dem der FritzCallMonitor läuft). -# Optional kann auch der Port angegeben werden. Die Eingabe erfolgt dann :. Der Standardport ist 80 -BOXIP_1=127.0.0.1 -#BOXIP_2= -#BOXIP_3= -#BOXIP_4= - -# Name und Passwort (Name:Passwort) für das yWeb der entsprechenden Box -LOGON_1=root:coolstream -#LOGON_2= -#LOGON_3= -#LOGON_4= - -# Wenn der CallMonitor in Verbindung mit einer Eeasybox eingesetzt wird "1" sonst immer "0" -EASYMODE=0 - -# Passwort für die !FritzBox (Achtung - nur neues Loginverfahren mit SID) -PASSWD= - -# Bei der Übernahme der !FritzBox-Telefonbücher mit den FritzInfolMonitor (FIM), -# kann eine fehlende Vorwahl automatisch mit der hier eingetragenen Ortsvorwahl ergänzt werden. -CITYPREFIX= - -# Wenn die Wählhilfe verwendet wird (FIM), kann hier die Wählprefix verwendet werden. -# Das Beispiel DIALPREFIX=*111# stellt eine Verbindung ins Festnetz her. -DIALPREFIX= - -# Wählhilfe Ports, werden in der Auswahl des Menüs "Wählhilfe" (FIM) ausgegeben -# Name Port Intern -# ------------------------------ -# "Fon 1", 1, "**1" -# "Fon 2", 2, "**2" -# "Fon 3", 3, "**3" -# "ISDN & DECT", 50, "**50" -# "ISDN 1", 51, "**51" -# "ISDN 2", 52, "**52" -# "ISDN 3", 53, "**53" -# "ISDN 4", 54, "**54" -# "ISDN 5", 55, "**55" -# "DECT 1", 610, "**610" -# "DECT 2", 611, "**611" -# "DECT 3", 612, "**612" -# "DECT 4", 613, "**613" -# "DECT 5", 614, "**614" -# "SIP 1", 620, "**620" -# "SIP 2", 621, "**621" -# "SIP 3", 622, "**622" -# "SIP 4", 623, "**623" -# "SIP 5", 624, "**624" -# -# Maximal sind 8 Einträge möglich. -# Dabei ist folgender Syntax einzuhalten: -# PORT_x=Name,Port -PORT_1=Fon 1, 1 -PORT_2=Fon 2, 2 -PORT_3=Fon 3, 3 -PORT_4=ISDN & DECT, 50 -PORT_5=ISDN 1, 51 -PORT_6=ISDN 2, 52 -PORT_7=DECT 1, 610 -PORT_8=DECT 2, 611 - -# Strings zum senden an die !FritzBox, Die Quelle hierfür ist: -# http://www.wehavemorefun.de/fritzbox/index.php/Anrufliste_von_der_Box_holen - -# Anrufliste (CSV) herunterladen -CALLERLIST_STR=getpage=..%2Fhtml%2Fde%2FFRITZ%21Box_Anrufliste.csv - -# Speicherort für die Anrufliste auf der Coolstream -CALLERLIST_FILE=/tmp/FRITZ!Box_Anrufliste.csv - -# 0 = AUS [default] -# 1 = An die FRITZ!Box wird eine Query-Abfrage gesendet -SEARCH_MODE=0 - -# Querystring für die Abfrage der FRITZ!Box. -# Die Abfrage, ob neue Nachrichten vorhanden sind, wurde mit der Firmware Version 29.04.87 getestet. -# In älteren Versionen scheint die FB keine Information darüber bereit zu stellen. -# -# Liefert der Query "0" zurück, wird das Flagfile (AD_FLAGFILE) gelöscht. -# Ist das Ergebnis ungleich "0", wird das Flagfile (AD_FLAGFILE) erzeugt. -# default SEARCH_QUERY=&var=tam:settings/TAM0/NumNewMessages -SEARCH_QUERY=&var=tam:settings/TAM0/NumNewMessages - -# Intervall in Sekunden, für die Suchabfrage in der Startseite der FRITZ!Box -# default SEARCH_INT=300 -SEARCH_INT=300 - -# Standard im NI-Image ist /var/etc/.call -# default AD_FLAGFILE=/var/etc/.call -AD_FLAGFILE=/var/etc/.call - - -####################### -## FRITZ! Smart Home ## -####################### -# -# IP und Passwort der Fritzbox, an der die SmartHome Geräte angeschlossen sind, -# Diese Adresse wird im Intervall (SEARCH_INT) abgefragt. -DECTBOXIP= -DECTPASSWD= - -# DECT Tagesplan -# Schaltpunkt und Temperatur wird hier angegeben. -# In der FRITZ!Box kann für die Comet DECT Regler nur 2 Temperaturen hinterlegt werden. -# Zusätzliche Schaltpunkte und deren Temperatur können in einem Tagesplan (DP) eingetragen werden. -# Im DECT Wochenplan (WP) wird dann die Nr.x eingetragen (DPx). -# Diese Funktionsweise ist auch für die FRITZ!Dect Steckdosen anwendbar. -# So lassen sich z.B. Infrarot Heizkörper ein/abschalten wenn der Temperaturbereich stimmt. -# -# Der Wert wird in 0,5 Grad Schritten unterteilt. -# 21,5 Grad werden also als 215 eingetragen. -# Es gibt einige "besondere" Temperaturen: -# -1 es wird kein Kommando an den Aktor gesendet -# 0 schaltet den Aktor "aus" -# 1 schaltet den Aktor "ein" -# -# Die Eingabe erfolgt nach diesem Muster: -# DP[NR]=SS:MM,Temperatur; SS:MM,Temperatur; usw. -# -# DP[1]=00:00,0; 05:00,210; 08:00,190; 15:00,210; 20:00,0; -# -# -# 21° +---------+ +---------+ -# : : : : -# 19° : +--------------+ : -# : : : : -# : : : : -# aus -----+ : : +-------- -# 05:00 08:00 15:00 20:00 -# -# -DP[11]=00:00,0; 05:00,210; 08:00,190; 15:00,210; 20:00,0; -DP[10]=00:00,-1; - -# DECT Wochenplan -# Jeder Wochentag enthält den Zeitplan eines Tages DP[Nr.]. -# Die DP Nummer wird im Wochenplan einem Wochentag zugewiesen. -# -# So;Mo;Di;Mi;Do;Fr;Sa; -#WP[AIN-IDs]=10;11;11:11:11;11;10; diff --git a/archive-sources/FritzCallMonitor/FritzCallMonitor.cpp b/archive-sources/FritzCallMonitor/FritzCallMonitor.cpp deleted file mode 100644 index 0b2594a9..00000000 --- a/archive-sources/FritzCallMonitor/FritzCallMonitor.cpp +++ /dev/null @@ -1,893 +0,0 @@ - -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include "FritzCallMonitor.h" -#include "connect.h" - - -CFCM* CFCM::getInstance() -{ - static CFCM* instance = NULL; - if(!instance) - instance = new CFCM(); - return instance; -} - -CFCM::CFCM() -{ - cconnect = CConnect::getInstance(); - - //default parameters - FritzPort = 1012; - msgtimeout =-1; - BackwardSearch = 1; - debug = 1; - easymode = 0; - phonebooks = 1; - SearchPort = 80; - searchmode = 0; - searchint = 300; - - strcpy(FritzAdr, "fritz.box"); - strcpy(FritzPW, "pwd"); - strcpy(msgtype, "nmsg"); - strcpy(addressbook, "/var/tuxbox/config/FritzCallMonitor.addr"); - strcpy(adflag, "/var/etc/.call"); - strcpy(SearchAdr, "www.goyellow.de"); - strcpy(searchquery, "&var=tam:settings/TAM0/NumNewMessages"); - - ReadConfig((char *)CONFIGFILE); - - //FIXME enable this function for all config values - read_conf(CONFIGFILE); - - //reinit after reading configfile - cconnect->setDebug(debug); - cconnect->setFritzAdr(FritzAdr); - cconnect->setFritzPort(80); -} - -CFCM::~CFCM() -{ - // -} - -void CFCM::FritzCall() -{ - char Buff1[BUFFERSIZE]; - int sockfd = 0; - int loop = 0; - int len = 0; - - int i; - char* item[MAXITEM]; - - while(!loop) - { - sockfd = cconnect->connect2Host(FritzAdr, FritzPort); - - if (sockfd > 0) { - printf("[%s] - Socked (%i) connected to %s\n", BASENAME, sockfd, easymode?"EasyBox":"FritzBox"); - loop=1; - } - else - sleep(5); - } - - if(!easymode) - { - do { - bzero(Buff1, sizeof(Buff1)); - if((len = recv(sockfd, Buff1, sizeof(Buff1), 0)) <= 0) { - printf("[%s] - recv error\n", BASENAME); - break; - } -#if 0 - /* - * Ankommender Anruf - * 28.08.10 10:21:37;RING;2;040xxx;123x;ISDN; - * Verbunden - * 28.08.10 10:25:40;CONNECT;0;4;040xxx; - * - * Ankommender Anruf / Nummer unterdrückt - * 28.08.10 10:22:07;RING;0;;123x;ISDN; - * Verbunden - * 28.08.10 10:24:37;CONNECT;0;4;; - * - * Abgehender Anruf - * 28.08.10 10:28:48;CALL;1;4;123x;040xxx;ISDN; - * - * Getrennt - * 28.08.10 10:28:51;DISCONNECT;1;0; - */ -#endif - printf("[%s] - %s",BASENAME, Buff1); - - i=0; - //item[0]="not used"; - char* token = strtok(Buff1, ";"); - while (token != NULL) - { - item[i+1] = token; - token = strtok(NULL, ";"); - if (debug) { - if ( i != 0 ) - printf("%i - %s\n", i, item[i]); - } - if (i >= MAXITEM) break; - i++; - } - - if (strcmp(item[2], "RING") == 0) //incomming call - { - if ( i == 5+1) //hidden number - { - strcpy(CallFrom, "Unbekannt"); - strcpy(CallTo, item[4]); - } - else - { - strcpy(CallFrom, item[4]); - strcpy(CallTo, item[5]); - } - printf("[%s] - Eingehender Anruf von %s an %s\n", BASENAME, CallFrom, CallTo); - - for (i=0; i < (int)(sizeof(msnnum)/sizeof(msnnum[0])); i++) - { - if ((i==0 && strcmp(msnnum[i].msn, "") == 0) || strcmp(msnnum[i].msn, CallTo) == 0) - { - if(strlen(msnnum[i].msnName) != 0) - strcpy(CallToName,msnnum[i].msnName); - - if (BackwardSearch && strcmp(CallFrom, "Unbekannt") != 0) - { - search(CallFrom); - } - else - sendMSG(0); - } - } - } - } while (loop); - } - else //EasyBox mode - { - do { - bzero(Buff1, sizeof(Buff1)); - if((len = recv(sockfd, Buff1, sizeof(Buff1), 0)) <= 0) { - printf("[%s] - recv error\n",BASENAME ); - break; - } -#if 0 - //strcpy(Buff1,"CID: *DATE*06072011*TIME*1929*LINE**NMBR*092XXXXXXX*MESG*NONE*NAME*NO NAME*\n"); - - /* - * EasyBox Caller ID - * - * Ankommender Anruf - * CID: *DATE*06072011*TIME*1929*LINE**NMBR*092XXXXXXX*MESG*NONE*NAME*NO NAME* - * - * Ankommender Anruf / Nummer unterdrückt - * CID: *DATE*01072011*TIME*2007*LINE**NMBR*Privat*MESG*NONE*NAME*NO NAME* - */ -#endif - printf("[%s] - %s",BASENAME, Buff1); - - char* ptr; - strcpy(CallFrom,"Unbekannt"); - strcpy(CallTo,"EasyBox"); - - if ((ptr = strstr(Buff1, "CID:"))) //incomming call - { - if ((ptr = strstr(Buff1, "NMBR*"))) - sscanf(ptr + 5, "%63[^*]", (char *) &CallFrom); - else if ((ptr = strstr(Buff1, "LINE*"))) - sscanf(ptr + 5, "%63[^*]", (char *) &CallTo); - - printf("[%s] - Eingehender Anruf von %s an %s\n", BASENAME, CallFrom, CallTo); - - for (i=0; i < (int)(sizeof(msnnum)/sizeof(msnnum[0])); i++) - { - if ((i==0 && strcmp(msnnum[i].msn, "") == 0) || strcmp(msnnum[i].msn, CallTo) == 0) - { - if(strlen(msnnum[i].msnName) != 0) - strcpy(CallToName,msnnum[i].msnName); - - if (BackwardSearch && strcmp(CallFrom, "Privat") != 0 && strcmp(CallFrom, "Unbekannt") != 0) - { - search(CallFrom); - } - else - sendMSG(0); - } - } - } - } while (loop); - } - close(sockfd); - //loop if socked lost - FritzCall(); -} - -int CFCM::search(const char *searchNO) -{ - char *found; - char *line; - ssize_t read; - size_t len; - ostringstream url; - string output ="/tmp/fim.out"; - FILE* fd; - - url << SearchAdr << "/suche/" << searchNO << "/-"; - - memset(&address, 0, sizeof(address)); - - if(search_AddrBook(CallFrom)) { - sendMSG(1); - return 0; - } - - string s = cconnect->post2fritz(url.str().c_str(),80 ,"", output); - - line=NULL; - if((fd = fopen(output.c_str(), "r"))) - { - while ((read = getline(&line, &len, fd)) != -1) - { - if ((found = strstr(line, "target=\"_self\" title=\"Zur Detailseite von "))) - { - sscanf(found + 47, "%255[^\"]", (char *) &address.name); - } - else if ((found = strstr(line, "\"postalCode\" content=\""))) - { - sscanf(found + 22, "%5[^\"]", (char *) &address.code); - } - else if((found = strstr(line, "\"addressLocality\" content=\""))) - { - sscanf(found + 27, "%127[^\"]", (char *) &address.locality); - } - else if((found = strstr(line, "\"streetAddress\" content=\""))) - { - sscanf(found + 25, "%127[^\"]", (char *) &address.street); - } - } - fclose(fd); - } - if(line) - free(line); - - if(strlen(address.name)!=0) { - if (debug){printf("[%s] - (%s) = %s, %s, %s %s\n",BASENAME, searchNO, address.name, address.street, address.code, address.locality);} - - sendMSG(strlen(address.name)); - - // Save address to addressbook - add_AddrBook(CallFrom); - } - else { - printf("[%s] - no results for %s\n",BASENAME, searchNO); - } - - sendMSG(0); - - return 0; -} - -void CFCM::sendMSG(int caller_address) -{ - ostringstream msg; - ostringstream txt; - int i,j; - const char *newline="%0A"; - const char *space="%20%20"; - - if (caller_address) - { - msg << "Anrufer : " << CallFrom << (strlen(address.name)!=0 ? newline : "") - << space << address.name << (strlen(address.street)!=0 ? newline : "") - << space << address.street << (strlen(address.code)!=0 ? newline : "") - << space << address.code << address.locality << newline - << "Leitung : " << (strlen(CallToName)!=0 ? CallToName : CallTo); - } - else - { - msg << "Anrufer : " << CallFrom << newline - << "Leitung : " << (strlen(CallToName)!=0 ? CallToName : CallTo); - } - - if(strcmp(execute,"") != 0) - { - pid_t pid; - signal(SIGCHLD, SIG_IGN); - switch (pid = vfork()) - { - case -1: - perror("vfork"); - break; - case 0: - printf("[%s] - Execute -> %s\n",BASENAME,execute); - if(execl("/bin/sh", "sh", execute, msg.str().c_str(), NULL)) - { - perror("execl"); - } - _exit (0); // terminate c h i l d proces s only - default: - break; - } - } - - for (i=0; i < (int)(sizeof(msnnum)/sizeof(msnnum[0])); i++) - { - if ( (i==0 && strcmp(msnnum[0].msn, "") == 0) || strcmp(msnnum[i].msn, CallTo) == 0) - { - for (j=0; j < (int)(sizeof(boxnum)/sizeof(boxnum[0])); j++) - { - if ((strcmp(boxnum[j].BoxIP, "") != 0)) { - txt.str(""); - txt << msg.str() << ' '; - - char * ptr; - char ip[20]; - int port = 80; - - if ((ptr = strstr(boxnum[j].BoxIP, ":"))) { - sscanf(boxnum[j].BoxIP, "%19[^:]", ip); - sscanf(ptr + 1, "%i", &port); - } - else { - strcpy(ip,boxnum[j].BoxIP); - } - cconnect->get2box(ip, port, txt.str().c_str(), boxnum[j].logon, msgtype, msgtimeout); - } - } - } - } -} - -int CFCM::search_AddrBook(const char *caller) -{ - FILE *fd; - char *line_buffer; - string search_str; - ssize_t ptr; - size_t len; - int i=0; - - if(strlen(caller)!=0){ - search_str = (string) caller + "|"; - } else { - return(0); - } - - if(!(fd = fopen(addressbook, "r"))) { - perror(addressbook); - return(0); - } - else - { - line_buffer=NULL; - while ((ptr = getline(&line_buffer, &len, fd)) != -1) - { - i++; - if (strstr(line_buffer, search_str.c_str())) - { - sscanf(line_buffer,"%*[^|]|%255[^|]|%127[^|]|%5[^|]|%127[^|]", - (char *) &address.name, - (char *) &address.street, - (char *) &address.code, - (char *) &address.locality); - if (debug) - printf("[%s] - \"%s\" found in %s[%d]\n", BASENAME, caller, addressbook, i); - fclose(fd); - if(line_buffer) - free(line_buffer); - return(1); - } - } - if (debug) - printf("[%s] - \"%s\" not found in %s\n", BASENAME, caller, addressbook); - - fclose(fd); - if(line_buffer) - free(line_buffer); - } - return(0); -} - -int CFCM::add_AddrBook(const char *caller) -{ - ofstream os(addressbook, ios::out | ios::app); - - if (os.is_open()) - { - os << caller << '|' - << address.name << '|' - << address.street << '|' - << address.code << '|' - << address.locality << '|' << endl; - os.close(); - } - else - { - return(0); - } - - return(1); -} - -vector CFCM::split(stringstream& str,const char& delim) -{ - string line, cell; - vector result; - - while(getline(str,cell,delim)) - { - result.push_back(cell); - //printf("cell=%s\n",cell.c_str()); - } - return result; -} - -string CFCM::create_map(string& k, const string& t, string& v, map >& m) -{ - // cleanup keys with no values - if(v.empty()) - { - k.clear(); - return(""); - } - - string key; - string::size_type begin = k.find(t); - - if(begin != string::npos) - { - key = k.substr(t.size()); - k.erase(t.size()); - - // modify value - cconnect->StringReplace(v,":;,",";"); - cconnect->StringReplace(v," ;\t",""); - - // create tmp vector - stringstream is(v); - vector tmp = split(is,';'); - - // copy tmp vector into map - m[key].swap(tmp); - - //debug - if(debug) cout << k << '[' << key << ']' << "=" << v << endl; - } - - return(key); -} - -string CFCM::create_map(string& k, const string& t, const string& v, map& m) -{ - if(v.empty()) - { - k.clear(); - return(""); - } - - string key; - string::size_type begin = k.find(t); - if(begin != string::npos) - { - key = k.substr(t.size()); - k.erase(t.size()); - - m[key] = v; - - //debug - cout << k << '[' << key << ']' << "=" << v << endl; - } - - return(key); -} - -void* CFCM::proxy_loop(void* arg) -{ - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,0); - pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS,0); - - static_cast(arg)->query_loop(); - return 0; -} - -int CFCM::query_loop() -{ - sleep(10); - - while(1) - { - if(searchmode) - { - printf("[%s] - %s send query\n", BASENAME, cconnect->timestamp().c_str()); - if(cconnect->get_login(FritzPW)) - { - cconnect->send_TAMquery(adflag,cconnect->getSid(),searchquery); - } - } - - if(!c["DECTBOXIP"].empty()) - { - cconnect->setFritzAdr(c["DECTBOXIP"].c_str()); - printf("[%s] - %s getdevicelistinfos %s\n", BASENAME, cconnect->timestamp().c_str(),c["DECTBOXIP"].c_str()); - - if(cconnect->get_login(c["DECTPASSWD"].c_str())) - { - cconnect->smartHome(cconnect->getSid(),"getdevicelistinfos"); - cconnect->checkdevice(wp,dp); - cconnect->cleardevice(); - } - cconnect->setFritzAdr(FritzAdr); - } - - sleep(searchint); - } - return 0; -} - -void CFCM::start_loop() -{ - if (searchmode || !c["DECTBOXIP"].empty()) { - if(!thrTimer) { - printf("[%s] - %s Start Thread for checking FRITZ!Box (reload %i seconds)\n",BASENAME, cconnect->timestamp().c_str(), searchint); - pthread_create (&thrTimer, NULL, proxy_loop, this) ; - pthread_detach(thrTimer); - } - } -} - -void CFCM::stop_loop() -{ - if(thrTimer) { - printf("[%s] - %s Stop Thread for checking FRITZ!Box\n", BASENAME, cconnect->timestamp().c_str()); - pthread_cancel(thrTimer); - thrTimer = 0; - } -} - -int CFCM::ReadConfig(const char *fname) -{ - FILE *fd_conf; - char *ptr; - char *line_buffer; - ssize_t read; - size_t len; - - line_buffer=NULL; - if((fd_conf = fopen(fname, "r"))) - { - while ((read = getline(&line_buffer, &len, fd_conf)) != -1) - { - char buffer[128]=""; - - if (line_buffer[0] == '#') - continue; - else if ((ptr = strstr(line_buffer, "DECTBOXIP="))) { - sscanf(ptr + 10, "%127s",buffer); -// FritzDectAdr=buffer; - } - else if ((ptr = strstr(line_buffer, "DECTPASSWD="))) { - sscanf(ptr + 11, "%63s", buffer); -// FritzDectPW=buffer; - } - else if ((ptr = strstr(line_buffer, "FRITZBOXIP="))) - sscanf(ptr + 11, "%63s", (char *) &FritzAdr); - else if ((ptr = strstr(line_buffer, "PORT="))) - sscanf(ptr + 5, "%i", &FritzPort); - else if ((ptr = strstr(line_buffer, "BACKWARDSEARCH="))) - sscanf(ptr + 15, "%i", &BackwardSearch); - else if ((ptr = strstr(line_buffer, "DEBUG="))) - sscanf(ptr + 6, "%i", &debug); - else if ((ptr = strstr(line_buffer, "MSGTYPE="))) - sscanf(ptr + 8, "%5s", (char *) &msgtype); - else if ((ptr = strstr(line_buffer, "MSGTIMEOUT="))) - sscanf(ptr + 11, "%i", &msgtimeout); - else if ((ptr = strstr(line_buffer, "MSN_1="))) { - sscanf(ptr + 6, "%31[^|\n]", msnnum[0].msn); - if((ptr = strstr(line_buffer, "|"))) - sscanf(ptr + 1, "%63[^\n]", msnnum[0].msnName); - } - else if ((ptr = strstr(line_buffer, "MSN_2="))) { - sscanf(ptr + 6, "%31[^|\n]", msnnum[1].msn); - if((ptr = strstr(line_buffer, "|"))) - sscanf(ptr + 1, "%63[^\n]", msnnum[1].msnName); - } - else if ((ptr = strstr(line_buffer, "MSN_3="))) { - sscanf(ptr + 6, "%31[^|\n]", msnnum[2].msn); - if((ptr = strstr(line_buffer, "|"))) - sscanf(ptr + 1, "%63[^\n]", msnnum[2].msnName); - } - else if ((ptr = strstr(line_buffer, "MSN_4="))) { - sscanf(ptr + 6, "%31[^|\n]", msnnum[3].msn); - if((ptr = strstr(line_buffer, "|"))) - sscanf(ptr + 1, "%63[^\n]", msnnum[3].msnName); - } - else if ((ptr = strstr(line_buffer, "MSN_5="))) { - sscanf(ptr + 6, "%31[^|\n]", msnnum[4].msn); - if((ptr = strstr(line_buffer, "|"))) - sscanf(ptr + 1, "%63[^\n]", msnnum[4].msnName); - } - else if ((ptr = strstr(line_buffer, "MSN_6="))) { - sscanf(ptr + 6, "%31[^|\n]", msnnum[5].msn); - if((ptr = strstr(line_buffer, "|"))) - sscanf(ptr + 1, "%63[^\n]", msnnum[5].msnName); - } - else if ((ptr = strstr(line_buffer, "BOXIP_1="))) - sscanf(ptr + 8, "%24s", boxnum[0].BoxIP); - else if ((ptr = strstr(line_buffer, "BOXIP_2="))) - sscanf(ptr + 8, "%24s", boxnum[1].BoxIP); - else if ((ptr = strstr(line_buffer, "BOXIP_3="))) - sscanf(ptr + 8, "%24s", boxnum[2].BoxIP); - else if ((ptr = strstr(line_buffer, "BOXIP_4="))) - sscanf(ptr + 8, "%24s", boxnum[3].BoxIP); - else if ((ptr = strstr(line_buffer, "LOGON_1="))) - sscanf(ptr + 8, "%63s", boxnum[0].logon); - else if ((ptr = strstr(line_buffer, "LOGON_2="))) - sscanf(ptr + 8, "%63s", boxnum[1].logon); - else if ((ptr = strstr(line_buffer, "LOGON_3="))) - sscanf(ptr + 8, "%63s", boxnum[2].logon); - else if ((ptr = strstr(line_buffer, "LOGON_4="))) - sscanf(ptr + 8, "%63s", boxnum[3].logon); - else if ((ptr = strstr(line_buffer, "ADDRESSBOOK="))) - sscanf(ptr + 12, "%127s", (char *) &addressbook); - else if ((ptr = strstr(line_buffer, "EASYMODE="))) - sscanf(ptr + 9, "%i", &easymode); - else if ((ptr = strstr(line_buffer, "PASSWD="))) - sscanf(ptr + 7, "%63s", (char *) &FritzPW); - else if ((ptr = strstr(line_buffer, "AD_FLAGFILE="))) - sscanf(ptr + 12, "%127s", (char *) &adflag); - else if ((ptr = strstr(line_buffer, "SEARCH_MODE="))) - sscanf(ptr + 12, "%i", &searchmode); - else if ((ptr = strstr(line_buffer, "SEARCH_QUERY="))) - sscanf(ptr + 13, "%99s", (char *) &searchquery); - else if ((ptr = strstr(line_buffer, "SEARCH_INT="))) - sscanf(ptr + 11, "%i", &searchint); - else if ((ptr = strstr(line_buffer, "CITYPREFIX="))) - sscanf(ptr + 11, "%9s", (char *) &cityprefix); - else if ((ptr = strstr(line_buffer, "EXEC="))) - sscanf(ptr + 5, "%127s", (char *) &execute); - else if ((ptr = strstr(line_buffer, "CALLERLIST_FILE="))) - sscanf(ptr + 16, "%127s", (char *) &listfile); - } - fclose(fd_conf); - } - else - { - printf("[%s] - ERROR open %s\n", BASENAME,fname); - } - if(line_buffer) - free(line_buffer); - - return(0); -} - -int CFCM::read_conf(const string& file) -{ - fstream fh; - string s, key, value, inx; - - // clean table for reload - c.clear(); - wp.clear(); - dp.clear(); - - fh.open(file.c_str(), ios::in); - - if(!fh.is_open()) - { - cout << "Error reading configfile \"" << file << "\"" << endl; - return 1; - } - - while (getline(fh, s)) - { - string::size_type begin = s.find_first_not_of(" \f\t\v"); - - // skip blank lines - if (begin == string::npos) - continue; - - // skip commentary - if (string("#;").find(s[begin]) != string::npos) - continue; - - // extract the key value - string::size_type end = s.find('=', begin); - // skip lines without "=" - if (end == string::npos) - continue; - key = s.substr(begin, end - begin); - - // trim key - //key.erase(key.find_last_not_of(" \f\t\v") + 1); - cconnect->StringReplace(key," ;[;];\f;\t;\v", ""); - - // skip blank keys - if (key.empty()) - continue; - - // extract and trim value - begin = s.find_first_not_of(" \f\n\r\t\v", end); - end = s.find_last_not_of(" \f\n\r\t\v") + 1; - value = s.substr(begin + 1, end - begin); - cconnect->StringReplace(value," ;[;];\f;\t;\v", ""); - - // *** special maps *** - - // create map for Comet temp - inx = create_map(key, "DP", value, dp); - if(!inx.empty()) - continue; - - // create map for Comet week - inx = create_map(key, "WP", value, wp); - if(!inx.empty()) - continue; - - // *** config map *** - - // create map for config - if(!key.empty()) { - c[key] = value; - //debug - //cout << key << "=" << value << endl; - } - } - fh.close(); - - return 0; -} - -void Usage() -{ - printf("[%s] - FritzBox-Anrufmonitor %s %s\n\n", BASENAME, VERSION, COPYR);; - printf("\t\tUSAGE:\t%s\n", BASENAME); - printf("\t\t\t-c\t\t\tget callerlist (FRITZ!Box_Anrufliste.csv)\n"); - printf("\t\t\t-h\t\t\tshow help\n"); - printf("\t\t\t-q\t\t\tsend query to FRITZ!Box\n"); - printf("\t\t\t-m\t\t\tsend message to BOXIP_1\n"); - printf("\t\t\t-s\t\t\tget smart Home infos\n"); - printf("\t\t\t-t [phonenumber] [MSN]\ttest backward search\n"); -} - -int main(int argc, char *argv[]) -{ - CFCM * cfcm = CFCM::getInstance(); - cfcm->run(argc,argv); -} - -int CFCM::run(int argc, char *argv[]) -{ - printf("\n[%s] - NI FRITZ!Box-Anrufmonitor %s - %s\n", BASENAME, VERSION, COPYR); - - if(strlen(msnnum[0].msn)==0) - printf("[%s] - Listening to all MSN's\n", BASENAME); - else { - for (int i=0; i < (int)(sizeof(msnnum)/sizeof(msnnum[0])); i++) { - if(strlen(msnnum[i].msn)!=0) { - cout << '[' << BASENAME << "] - Listening to MSN " << msnnum[i].msn << - (strlen(msnnum[i].msnName)!=0 ? " (" : "") << - (strlen(msnnum[i].msnName)!=0 ? msnnum[i].msnName : "") << - (strlen(msnnum[i].msnName)!=0 ? ")" : "") << endl; - } - } - } - - switch (argc) - { - case 1: - if(searchmode || !c["DECTBOXIP"].empty()) - start_loop(); - FritzCall(); - return 0; - case 2: - if (strstr(argv[1], "-h")) - { - Usage(); - break; - } - else if (strstr(argv[1], "-b")) - { - switch(fork()) - { - case 0: - if(searchmode || !c["DECTBOXIP"].empty()) - start_loop(); - FritzCall(); - break; - - case -1: - printf("[%s] - Aborted!\n", BASENAME); - return -1; - default: - exit(0); - } - } - else if (strstr(argv[1], "-c")) - { - printf("[%s] - get FRITZ!Box_Anrufliste.csv from FritzBox\n", BASENAME); - - if(!cconnect->get_login(FritzPW)) { - exit(1); - } - - //cconnect->send_refresh(cconnect->sid); - cconnect->get_callerlist(cconnect->getSid(),listfile); - cconnect->send_logout(cconnect->getSid()); - exit(0); - } - else if (strstr(argv[1], "-q")) - { - printf("[%s] - %s send query 2 FritzBox\n", BASENAME, cconnect->timestamp().c_str()); - - if(!cconnect->get_login(FritzPW)) { - exit(1); - } - - cconnect->send_TAMquery(adflag,cconnect->getSid(),searchquery); - - exit(0); - } - else if (strstr(argv[1], "-m")) - { - cconnect->get2box(boxnum[0].BoxIP, 80, "FritzCallMonitor Testmessage", boxnum[0].logon, msgtype, msgtimeout); - return 0; - } - else if (strstr(argv[1], "-s")) - { - printf("[%s] - get smart Home infos from FritzBox\n", BASENAME); - - cconnect->setFritzAdr(c["DECTBOXIP"].c_str()); - - if(!cconnect->get_login(c["DECTPASSWD"].c_str())) { - cconnect->setFritzAdr(FritzAdr); - exit(1); - } - - // fill vector with device infos - cconnect->smartHome(cconnect->getSid(),"getdevicelistinfos"); - - cconnect->checkdevice(wp,dp); - // delete device vector - cconnect->cleardevice(); - - cconnect->setFritzAdr(FritzAdr); - exit(0); - } - else - { - Usage(); - exit(1); - } - case 4: - if (strstr(argv[1], "-t")) - { - printf("[%s] - serarch for %s\n", BASENAME, argv[2]); - strcpy(CallFrom, argv[2]); - strcpy(CallTo, argv[3]); - search(CallFrom); - return 0; - } - default: - Usage(); - exit(1); - } - return(0); -} - - diff --git a/archive-sources/FritzCallMonitor/FritzCallMonitor.h b/archive-sources/FritzCallMonitor/FritzCallMonitor.h deleted file mode 100755 index f40cde92..00000000 --- a/archive-sources/FritzCallMonitor/FritzCallMonitor.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * FritzCallMonitor.h - */ -#ifndef __FritzCallMonitor_h__ -#define __FritzCallMonitor_h__ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -#include "connect.h" - -#define BASENAME "FCM" -#define VERSION "V5.1" -#define COPYR "2010, 2017 (c) FlatTV" -#define BUFFERSIZE 1024 - -#define MAXITEM 10 -#define CONFIGFILE "/var/tuxbox/config/FritzCallMonitor.cfg" - -using namespace std; - -class CFCM -{ - public: - CFCM(); - ~CFCM(); - static CFCM* getInstance(); - - int run(int argc, char *argv[]); - - private: - CConnect * cconnect; - pthread_t thrTimer; - - vector dect; - map c; // config pair - map > dp; // DECT time and temperatur - map > wp; // DECT week - - typedef struct { - char name[256]; - char street[128]; - char code[6]; - char locality[128]; - } S_ADDRESS; - S_ADDRESS address; - - typedef struct { - char BoxIP[25]; - char logon[64]; - } S_BOXNUM; - S_BOXNUM boxnum[4]; - - typedef struct { - char msn[32]; - char msnName[64]; - } S_MSNNUM; - S_MSNNUM msnnum[6]; - -// string FritzDectAdr; -// string FritzDectPW; - char FritzAdr[64]; - char FritzPW[64]; - char msgtype[6]; - char addressbook[128]; - char execute[128]; - char cityprefix[10]; - char adflag[128]; - char CallFrom[64]; - char CallTo[64]; - char CallToName[64]; - char SearchAdr[20]; - char searchquery[100]; - char listfile[128]; - int debug, BackwardSearch, msgtimeout,easymode, phonebooks; - int FritzPort, SearchPort, searchmode, searchint; - - //global functions - void FritzCall(); - void sendMSG(int caller_address); - int search(const char *searchNO); - int ReadConfig(const char *fname); - int read_conf(const string& file); //FIXME enable this function for all values - int add_AddrBook(const char *caller); - int search_AddrBook(const char *caller); - string create_map(string& k, const string& t, string& v, map >& m); - string create_map(string& k, const string& t, const string& v, map& m); - - //query thread - static void* proxy_loop(void *arg); - void start_loop(); - void stop_loop(); - int query_loop(); - - vector split(stringstream& str, const char& delim); -}; - -#endif// __FritzCallMonitor_h__ diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/FritzInfoMonitor.cfg b/archive-sources/FritzCallMonitor/FritzInfoMonitor/FritzInfoMonitor.cfg deleted file mode 100644 index 9c625597..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/FritzInfoMonitor.cfg +++ /dev/null @@ -1,7 +0,0 @@ -type=2 -name=NI-FRITZ! Info Monitor -desc=FRITZ!Box Informationen -needfb=1 -needlcd=0 -needrc=1 -needoffsets=1 diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/FritzInfoMonitor.cpp b/archive-sources/FritzCallMonitor/FritzInfoMonitor/FritzInfoMonitor.cpp deleted file mode 100644 index eb6fdbb3..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/FritzInfoMonitor.cpp +++ /dev/null @@ -1,591 +0,0 @@ - -#include -#include -#include - -#include "parser.h" -#include "connect.h" -#include "framebuffer.h" -#include "rc.h" -#include "icons.h" -#include "submenu.h" -#include "phonebook.h" -#include "globals.h" - -#include "FritzInfoMonitor.h" - -CFIM* CFIM::getInstance() -{ - static CFIM* instance = NULL; - if(!instance) - instance = new CFIM(); - return instance; -} - -CFIM::CFIM() -{ - cpars = CParser::getInstance(); - cconnect = CConnect::getInstance(); - cfb = Cfb::getInstance(); - crc = Crc::getInstance(); - cicons = CIcons::getInstance(); - - startitem=0, perpage=MAXCALLER, repaint=1, callsel=0, rs_result=0, dialtest=1; - - cfb->init(); - - cfb->getDimensions(&ex, &sx, &ey, &sy); - cfb->getStartDimensions(&startx, &starty); -}; - -CFIM::~CFIM() -{ - Cleanup(); -} - -/****************************************************************************** - * Mainmenu - ******************************************************************************/ -void CFIM::Mainmenu(int init) -{ - printf("[%s] - %s(%d)\n",BASENAME, __FUNCTION__, init); - int bspace = 40; - int lrspace = 30; - int vsx = bspace + lrspace; - int vsy = 80; - int breite = ex-sx - bspace; - int tiefe = ey-sy - bspace; - int zeilenabstand = cfb->getYScreeninfo() < 600 ? 25 : 28; - std::ostringstream txt; - - int sp1 = vsx+30; - int le1 = 140; //Datum - int sp2 = sp1+le1+18; - int le2 = 180; //Name - int sp3 = sp2+le2+18; - int le3 = 180; //Rufnummer - int sp4 = sp3+le3+18; - int le4 = 180; //Telefoniegert - int sp5 = sp4+le4+18; - int le5 = 140; //Eigene Nummer - int sp6 = sp5+le5+18; - int le6 = 60; //Dauer - - // Grafikausgabe - cfb->RenderBox(bspace, 0, breite, tiefe, FILL, CMC); - cfb->RenderBox(bspace, 0, breite, 40, FILL, CMH); - - cfb->PaintIcon(cicons->getIcon_ni(),((breite+bspace)/2)-(120/2)-35,8); - cfb->RenderString("FRITZ! Info", ((breite+bspace)/2)-(120/2) ,30, 120, CENTER, BIG, CMHT); - - // Footer - cfb->RenderBox(bspace, tiefe, breite, tiefe+30, FILL, CMH); - - cfb->RenderCircle( vsx, tiefe+6, RED); - cfb->RenderString("Men", sp1, tiefe+20, 100, LEFT, SMALL, GREY); - - cfb->PaintIcon(cicons->getIcon_right(), sp2, tiefe); - if(startitem > 0) - cfb->PaintIcon(cicons->getIcon_left(), sp2+20, tiefe); - cfb->RenderString("Anrufliste", startitem > 0 ? sp2+20+30 : sp2+30, tiefe+20, 150, LEFT, SMALL, GREY); - - cfb->PaintIcon(cicons->getIcon_help(), sp3, tiefe); - cfb->RenderString("Info", sp3+30, tiefe+20, 100, LEFT, SMALL, GREY); - - if(init == LOGIN) - { - vsy += zeilenabstand; - cfb->RenderString("Sende Login ...", vsx, vsy, 200, LEFT, NORMAL, CMCT); - } - else if(!init || init == CINFO) - { - txt.str(""); - txt << "Firmware: " << cpars->getNspver(); - cfb->RenderString(txt.str().c_str(), breite-200-lrspace, vsy-7, 200, RIGHT, SMALL, GREY); - - vsy += zeilenabstand; - cfb->RenderString("Komfortinfo", vsx ,vsy, 200, LEFT, NORMAL, CMHT); - vsy += zeilenabstand+7; - - txt.str(""); - txt << "Anrufbeantworter: " << (atoi(cpars->getTam0_active().c_str())?"Aktiv, ":"Inaktiv, ") << (atoi(cpars->getTam0_NumNewMessages().c_str())) << " neue Nachrichten"; - cfb->RenderString(txt.str().c_str(), vsx, vsy, breite-vsx-lrspace, LEFT, NORMAL, CMCT); - vsy += zeilenabstand; - - char str[30]; - switch(atoi(cpars->getDdns_state().c_str())) - { - case 0: strcpy(str,"Fehler") ;break; - case 3: strcpy(str,"Anmeldung") ;break; - case 5: strcpy(str,"Angemeldet") ;break;//Erfolgreich angemeldet - case 97: strcpy(str,"Account deaktiviert") ;break; - case 98: strcpy(str,"Internet nicht verbunden") ;break; - case 99: strcpy(str,"Unbekannt") ;break; - default: strcpy(str,"Anmeldung luf") ;break; - } - - string ddns_domain = cpars->getDdns_domain(); - int ddns_state = atoi(cpars->getDdns_state().c_str()); - - txt.str(""); - txt << "Dynamic DNS: " << str << (ddns_domain.empty() ? " " : ", ") << (ddns_state ==0 ? cpars->getPppoe_ip() : ddns_domain); - cfb->RenderString(txt.str().c_str(), vsx, vsy, breite-vsx-lrspace, LEFT, NORMAL, CMCT); - vsy += zeilenabstand; - } - - if(!init) - { - int i=0; - vsy += zeilenabstand; - int csy = vsy; - - if(breite > (sp4+le4)) cfb->RenderString("Telefoniegert", sp4, vsy, le4, LEFT, NORMAL, CMHT); - if(breite > (sp5+le5)) cfb->RenderString("Eigene Nummer", sp5, vsy, le5, LEFT, NORMAL, CMHT); - if(breite > (sp6+le6)) cfb->RenderString("Dauer", sp6, vsy, le6, LEFT, NORMAL, CMHT); - - vsy += 7; - - if(callsel > perpage-1) - callsel=0; - else if(callsel < 0) - callsel=perpage-1; - - unsigned mystart = vsy+zeilenabstand; - unsigned vsi = zeilenabstand; - for (i=0; i < MAXCALLER; i++) - { - vsy += zeilenabstand; - - //selected; - if(callsel==i) - cfb->RenderBox(bspace, mystart+((callsel-1)*vsi+2), breite, mystart+(callsel*vsi+5), FILL, CMHT); - - cfb->PaintIcon(atoi(cpars->caller[i].call_type)==1?cicons->getIcon_phone1():atoi(cpars->caller[i].call_type)==2?cicons->getIcon_phone2():cicons->getIcon_phone3(),vsx,vsy-23); - - cfb->RenderString(cpars->caller[i].call_date, sp1, vsy, le1, LEFT, NORMAL, callsel==i?CMC:CMCT); - - if(strlen(cpars->caller[i].call_name)==0 && strlen(cpars->caller[i].call_numr)!=0) { - if(cpars->search_AddrBook(cpars->caller[i].call_numr)) { - strcpy(cpars->caller[i].call_name,cpars->address.name); - cpars->init_address(); - } - else - strcpy(cpars->caller[i].call_name,"nicht gefunden"); - } - if(strlen(cpars->caller[i].call_numr)==0) - strcpy(cpars->caller[i].call_name,"unbekannt"); - - cfb->RenderString(cconnect->UTF8toISO(cpars->caller[i].call_name)/*txt*/, sp2, vsy, le2, LEFT, NORMAL, callsel==i?CMC:CMCT); - cfb->RenderString((strlen(cpars->caller[i].call_numr)==0 ? "keine Rufnummer" : cpars->caller[i].call_numr), sp3, vsy, le3, LEFT, NORMAL, callsel==i?CMC:CMCT); - - if(breite > (sp4+le4)) - { - cfb->RenderString(cpars->caller[i].port_name, sp4, vsy, le4, LEFT, NORMAL, callsel==i?CMC:CMCT); - } - if(breite > (sp5+le5)) - { - cfb->RenderString(cpars->caller[i].port_rout, sp5, vsy, le5, LEFT, NORMAL, callsel==i?CMC:CMCT); - } - if(breite > (sp6+le6)) - { - cfb->RenderString(cpars->caller[i].call_time, sp6, vsy, le6, LEFT, NORMAL, callsel==i?CMC:CMCT); - } - - if(vsy >= tiefe-50) - { - // RenderString("----", sp1, vsy, le1, LEFT, NORMAL, CMHT); - perpage = i+1; - break; - } - } - - txt.str(""); - txt << "Anrufe " << startitem+1 << " bis " << startitem+perpage; - cfb->RenderString(txt.str().c_str(), vsx, csy, 300, LEFT, NORMAL, CMHT); - - } - else if (init==2) - { - vsy += zeilenabstand; - cfb->RenderString("Anrufe", vsx, vsy, 700, LEFT, NORMAL, CMHT); - vsy += 7; - vsy += zeilenabstand; - cfb->RenderString("Hole Daten von der FRITZ!Box ...", vsx, vsy, 306, LEFT, NORMAL, CMCT); - } - - cfb->FBPaint(); -} - -/****************************************************************************** - * ShowMessage - ******************************************************************************/ -void CFIM::ShowMessage(int message, int popup) -{ - - CSubMenu::getInstance()->ShowMessage(message, popup); - - if(!popup) - { - unsigned short rccode; - while(((rccode=crc->getrc())!=RC_HOME) && (rccode!=RC_OK)); - - if(message == INFO) { - Mainmenu(REPAINT); - } - else if(message == INFO_DIALTEST) { - Mainmenu(REPAINT); - } - else { - Cleanup(); - exit(1); - } - } -} - -/****************************************************************************** - * ShowMenu (submenu) - ******************************************************************************/ -void CFIM::ShowMenu(int menu) -{ - printf("[%s] - %s(%d)\n",BASENAME, __FUNCTION__, menu); - //show menu - switch(menu) - { - case MENU: - case PHONEBOOK: - CSubMenu::getInstance()->ShowSubMenu(menu); - break; - case DIAL: - CSubMenu::getInstance()->DialMenu(dialtest); - break; - case CALLER_DETAILS: - CSubMenu::getInstance()->CallerMenu(rs_result, callsel); - break; - } - - //get rc code - unsigned short rccode; - do - { - switch((rccode = crc->getrc())) - { - case RC_UP: - CSubMenu::getInstance()->subMenu[menu].sel--; - ShowMenu(menu); - rccode=RC_HOME; - break; - case RC_DOWN: - CSubMenu::getInstance()->subMenu[menu].sel++; - ShowMenu(menu); - rccode=RC_HOME; - break; - case RC_OK: - DoExec(menu); - break; - case RC_HOME: - switch(menu) - { - case MENU: - Mainmenu(REPAINT); - break; - case DIAL: - case PHONEBOOK: - cfb->FBClear(); - ShowMenu(MENU); - break; - } - break; - case RC_RED: - switch(menu) - { - case MENU: - cfb->FBClear(); - ShowMenu(PHONEBOOK); - break; - case CALLER_DETAILS: - dialtest=0; - ShowMenu(DIAL); - break; - } - rccode=RC_HOME; - break; - case RC_GREEN: - cfb->FBClear(); - ShowMenu(DIAL); - rccode=RC_HOME; - break; - case RC_YELLOW: - switch(menu) - { - case CALLER_DETAILS: - if(rs_result) - DoExec(ADDADR); - break; - case MENU: - DoExec(RECONNECT); - break; - } - rccode=RC_HOME; - break; - case RC_BLUE: - switch(menu) - { - case MENU: - DoExec(REFRESHCALL); - break; - case CALLER_DETAILS: - DoExec(RSEARCH); - break; - } - rccode=RC_HOME; - break; - case RC_1: - DoExec(ADDRESSBOOK); - rccode=RC_HOME; - break; - } - } - while(rccode!=RC_HOME && rccode!=RC_OK); -} - -/****************************************************************************** - * DoExec - ******************************************************************************/ -void CFIM::DoExec(int function) -{ - printf("[%s] - %s(%d)\n",BASENAME, __FUNCTION__, function); - std::ostringstream txt; - int queryLogic = cconnect->getQueryLogic(); - const char* sid = cconnect->getSid(); - - switch(function) - { - /*0*/ - case MENU: - switch(CSubMenu::getInstance()->subMenu[MENU].sel) - { - //select from submenu - case 0: - cfb->FBClear(); - ShowMenu(PHONEBOOK); - break; - case 1: - cfb->FBClear(); - ShowMenu(DIAL); - break; - case 2: - DoExec(RECONNECT); - break; - case 3: - DoExec(REFRESHCALL); - break; - case 4: - DoExec(ADDRESSBOOK); - break; - } - break; - /*1*/ - case PHONEBOOK: - ShowMessage(INFO_PHONEBOOK,1); - cconnect->get_login(cpars->getFritzPW()); - cconnect->get_phonebooks(sid,CSubMenu::getInstance()->subMenu[PHONEBOOK].sel); - if(queryLogic==1) - cconnect->send_logout(sid); - cfb->FBClear(); - ShowMenu(PHONEBOOK); - break; - /*2*/ - case CALLER_DETAILS: - // nothing to do, SubMenu only - break; - /*3*/ - case DIAL: - cconnect->get_login(cpars->getFritzPW()); - if(dialtest) { - txt.str(""); - txt << "**" << cpars->dialport[CSubMenu::getInstance()->subMenu[DIAL].sel].port; - cconnect->dial(sid,50,txt.str().c_str()); - ShowMessage(INFO_DIALTEST,0); - cconnect->hangup(sid, cpars->dialport[CSubMenu::getInstance()->subMenu[DIAL].sel].port); - } - else { - cfb->FBClear(); - ShowMessage(INFO_DIAL,1); - txt.str(""); - txt << cpars->getDialprefix() << cpars->caller[callsel].call_numr; - cconnect->dial(sid,cpars->dialport[CSubMenu::getInstance()->subMenu[DIAL].sel].port, txt.str().c_str()); - sleep(3); - dialtest=1; - } - if(queryLogic==1) - cconnect->send_logout(sid); - break; - /*4*/ - case RECONNECT: - cconnect->get_login(cpars->getFritzPW()); - cconnect->reconnect(sid); - ShowMessage(INFO_RECONNECT,0); - if(queryLogic==1) - cconnect->send_logout(sid); - break; - /*5*/ - case REFRESHCALL: - startitem = 0; - perpage = MAXCALLER; - ShowMessage(LOAD,1); - cconnect->get_login(cpars->getFritzPW()); - cconnect->send_query_info(sid); - Mainmenu(CINFO); - cconnect->send_refresh(sid); - cconnect->send_query_caller(sid, startitem, MAXCALLER); - Mainmenu(REPAINT); - if(queryLogic==1) - cconnect->send_logout(sid); - break; - /*6*/ - case ADDADR: - cpars->add_AddrBook(cpars->caller[callsel].call_numr); - ShowMessage(INFO_ADDADR,1); - sleep(3); - break; - /*7*/ - case RSEARCH: - if((rs_result = cconnect->rsearch(cpars->caller[callsel].call_numr))) { - ShowMenu(CALLER_DETAILS); - strcpy(cpars->caller[callsel].call_name,cpars->address.name); - cpars->init_address(); - rs_result=0; - } - else { - ShowMessage(INFO_RSEARCH,1); - sleep(3); - } - Mainmenu(REPAINT); - break; - /*8*/ - case ADDRESSBOOK: - CPhoneBook::getInstance()->run(); - Mainmenu(REPAINT); - break; - } -} - - /****************************************************************************** - * Cleanup - ******************************************************************************/ -void CFIM::Cleanup (void) -{ - cfb->Cleanup(); - crc->Cleanup(); - - unlink(cpars->getListfile()); - - printf("[%s] - bye\n",BASENAME); -} - -/****************************************************************************** - * plugin_exec - ******************************************************************************/ -int main(int argc, char *argv[]) -{ - return CFIM::getInstance()->run(argc, argv); -} - -//void plugin_exec(PluginParam *par) -int CFIM::run(int argc, char *argv[]) -{ - printf("[%s] - Version %s\n", BASENAME, VERSION); - if(cpars->ReadConfig(CONFIGFILE)) { - Cleanup(); - exit(1); - } - - //reinit after reading configfile - cconnect->setDebug(cpars->getDebug()); - - cpars->ReadColors(NEUTRINOCONF); - - // lock keyboard-conversions, this is done by the plugin itself - //fclose(fopen(KBLCKFILE,"w")); - - Mainmenu(LOGIN); - int query = cconnect->get_login(cpars->getFritzPW()); - if(!query) { - printf("[%s] - ERROR get_login\n", BASENAME); - ShowMessage(ERR_LOGIN,0); - Cleanup(); - exit(1); - } - - const char* sid = cconnect->getSid(); - int queryLogic = cconnect->getQueryLogic(); - - cconnect->send_query_info(sid); - - Mainmenu(CINFO); - - cconnect->send_refresh(sid); - - cconnect->send_query_caller(sid, 0, MAXCALLER); - - Mainmenu(REPAINT); - - if(query==1) - cconnect->send_logout(sid); - - unsigned short rccode; - do - { - switch((rccode = crc->getrc())) - { - case RC_HELP: - ShowMessage(INFO,0); - break; - case RC_RED: - cfb->FBClear(); - ShowMenu(MENU); - break; - case RC_LEFT: - if(startitem == 0) - break; - startitem -= perpage; - if(startitem<0) - startitem=0; - callsel=0; - ShowMessage(LOAD,1); - cconnect->get_login(cpars->getFritzPW()); - cconnect->send_query_caller(sid, startitem, perpage); - Mainmenu(REPAINT); - if(queryLogic==1) - cconnect->send_logout(sid); - break; - case RC_RIGHT: - startitem += perpage; - callsel=0; - ShowMessage(LOAD,1); - cconnect->get_login(cpars->getFritzPW()); - cconnect->send_query_caller(sid, startitem,perpage); - Mainmenu(REPAINT); - if(queryLogic==1) - cconnect->send_logout(sid); - break; - case RC_DOWN: - callsel++; - Mainmenu(REPAINT); - break; - case RC_UP: - callsel--; - Mainmenu(REPAINT); - break; - case RC_OK: - cpars->search_AddrBook(cpars->caller[callsel].call_numr); - ShowMenu(CALLER_DETAILS); - cpars->init_address(); - Mainmenu(REPAINT); - break; - } - } - while(rccode != RC_HOME); - Cleanup(); - return 0; -} diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/FritzInfoMonitor.h b/archive-sources/FritzCallMonitor/FritzInfoMonitor/FritzInfoMonitor.h deleted file mode 100644 index a18b2a39..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/FritzInfoMonitor.h +++ /dev/null @@ -1,45 +0,0 @@ - -#ifndef __FritzInfoMonitor_h__ -#define __FritzInfoMonitor_h__ - -#ifdef HAVE_CONFIG_H -#include -#endif - -class CFIM -{ - public: - CFIM(); - ~CFIM(); - static CFIM* getInstance(); - - int run(int argc, char *argv[]); - - private: - CConnect * cconnect; - CParser * cpars; - Cfb * cfb; - Crc * crc; - CIcons * cicons; - - enum MAINMENU_INIT - { - REPAINT, - LOGIN, - CINFO, - }; - - int startx, starty, sx, ex, sy, ey; - - void Cleanup(void); - void DoExec(int function); - - // grafische Funktionen - void Mainmenu(int init); - void ShowMessage(int message, int popup); - void ShowMenu(int menu); - - int startitem, perpage, repaint, callsel, rs_result, dialtest; -}; - -#endif// __FritzInfoMonitor_h__ diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/FritzInfoMonitor_hint.png b/archive-sources/FritzCallMonitor/FritzInfoMonitor/FritzInfoMonitor_hint.png deleted file mode 100644 index 4ec3e8fc..00000000 Binary files a/archive-sources/FritzCallMonitor/FritzInfoMonitor/FritzInfoMonitor_hint.png and /dev/null differ diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/connect.cpp b/archive-sources/FritzCallMonitor/FritzInfoMonitor/connect.cpp deleted file mode 100644 index e4128e21..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/connect.cpp +++ /dev/null @@ -1,1522 +0,0 @@ - -#include -#include - -#include -#include -#include - -//#include "md5.h" -#include -#include -#include - -#include "parser.h" -#include "globals.h" - -#include "connect.h" - -using namespace std; - -class CurledClass -{ - public: - - static int writer(char *data, size_t size, size_t nmemb, std::string *buffer_in) - { - - // Is there anything in the buffer? - if (buffer_in != NULL) - { - // Append the data to the buffer - buffer_in->append(data, size * nmemb); - - // How much did we write? - return size * nmemb; - } - return 0; - } -}; - -CConnect* CConnect::getInstance() -{ - static CConnect* instance = NULL; - if(!instance) - instance = new CConnect(); - return instance; -} - -CConnect::CConnect() -{ - cpars = CParser::getInstance(); - - //sockfb = 0; - query_logic = 0; - loginLUA = 0; - debug = 1; -} - -CConnect::~CConnect() -{ - // -} - -#if 0 -/****************************************************************************** - * functions - ******************************************************************************/ -#endif -std::string CConnect::post2fritz(const char* url, const std::string data, const std::string curlOutFile) -{ - CURL *curl; - CURLcode result; - - // multipart post - struct curl_httppost *formpost=NULL; - struct curl_httppost *lastptr=NULL; - struct curl_slist *headerlist=NULL; - static const char buf[] = "Expect:"; - - if(!multipart.empty()) - { - curl_global_init(CURL_GLOBAL_ALL); - - // add all map values - for (vector::iterator it = multipart.begin(); it != multipart.end(); ++it) - { - // extract the name value - string::size_type begin = (*it).find_first_not_of(" \f\t\v"); - string::size_type end = (*it).find('='); - string key = (*it).substr(begin, end - begin); - - // extract the contents value - begin = (*it).find_first_not_of(" \f\n\r\t\v", end); - end = (*it).find_last_not_of(" \f\n\r\t\v"); - string value = (*it).substr(begin + 1, end - begin); - - //cout << key << "='" << value << "'" << endl; - - curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, key.c_str(), - CURLFORM_COPYCONTENTS, value.c_str(), - CURLFORM_END); - } - } - - // Create our curl handle - curl = curl_easy_init(); - - if(!multipart.empty()) { - // initialize custom header list (stating that Expect: 100-continue is not wanted - headerlist = curl_slist_append(headerlist, buf); - } - - //errors - char errorBuffer[CURL_ERROR_SIZE]; - - // Write all expected data in here - std::string buffer; - - if(!curl){ - std::cerr << "Error init Curl!" << std::endl; - return std::string(); - } - - curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorBuffer); - curl_easy_setopt(curl, CURLOPT_URL, url); - curl_easy_setopt(curl, CURLOPT_HEADER, 0); - curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/5.0"); - curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); - curl_easy_setopt(curl, CURLOPT_VERBOSE, debug?1:0); - curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0); - - if(!multipart.empty()) - curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); - - if(!data.empty()) - { - curl_easy_setopt(curl, CURLOPT_POST, 1); - curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data.c_str()); - // print CURLOPT_POSTFIELDS - if(debug > 1 && !data.empty()) {cout << '[' << BASENAME << "] - CURLOPT_POSTFIELDS: " << data << endl;} - } - - FILE *tmpFile = fopen(curlOutFile.c_str(), "w"); - if (tmpFile) { - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, NULL); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, tmpFile); - } else { - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurledClass::writer); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer); - } - - // Attempt to retrieve the remote page - result = curl_easy_perform(curl); - - // Always cleanup - curl_easy_cleanup(curl); - if (tmpFile) - fclose(tmpFile); - if(!multipart.empty()) - multipart.clear(); - - if(debug > 1){ - if(curlOutFile.empty()) - cout << "DEBUG-OUT" << ">>" << buffer << "<<" << "DEBUG-OUT END" << endl; - else - cout << "DEBUG-OUT" << ">>" << curlOutFile << "<<" << "DEBUG-OUT END" << endl; - } - - if(result == CURLE_OK) - return(buffer); - - return std::string(); -} - -int CConnect::get_challenge(bool lua) -{ - ostringstream url; - - log(1,"%s(%s)\n", __FUNCTION__, lua?"lua":"xml"); - - //if(mysockfb <= 0){ - // printf("[%s] - CConnect::get_challenge(): ERR connect2Host\n", BASENAME); - // return 0; - //} - - if(lua){ - url << cpars->getFritzAdr() << "/login_sid.lua"; // OS 5.50 - } else { - url << cpars->getFritzAdr() << "/cgi-bin/webcm?getpage=../html/login_sid.xml"; // Firmwareversion xx.04.74 - } - - string s = post2fritz(url.str().c_str(), ""); - - //search - string s1 = ""; - string s2 = ""; - string token; - size_t pos = 0; - - if((pos = s.find(s1)) != string::npos) - { - s.erase(0, pos + s1.length()); - - pos = 0; - if((pos = s.find(s2)) != string::npos) - { - s.erase(pos, s.length()); - if(!s.empty()) - { - strncpy(challenge,s.c_str(),sizeof(challenge)); - if(debug) {printf("[%s] - CHALLENGE %s \n", BASENAME, challenge);} - return 1; - } - } - } - - if(lua) - { - log(0,"%s(%s) - NO CHALLENGE found\n", __FUNCTION__, lua?"lua":"xml"); - return(get_challenge(false/*xml*/)); - } - else - { - log(0,"%s(%s) - failed to get CHALLENGE\n", __FUNCTION__, lua?"lua":"xml"); - } - - return 0; -} - -int CConnect::get_md5(const char *challenge, char *fritzPW) -{ - //convert to utf16 - //http://www.avm.de/de/Extern/Technical_Note_Session_ID.pdf - unsigned int i; - int y = 0; - - std::string utf8_str = (std::string) challenge + "-" + (std::string) UTF8toISO(fritzPW); - std::string utf16_str = (""); - - log(2,"Challenge-Password = \"%s-%s\"\n",challenge, UTF8toISO(fritzPW)); - - log(1,"Binary for hash = "); - - for (i=0; i < utf8_str.length(); i++) - { - y = i*2; - // change UNICODE > 255 in 46 (".") - if (utf8_str[i] > 0xAD) - { - utf16_str += '\x2E'; - utf16_str += '\x00'; - } - else - { - utf16_str += utf8_str[i]; - utf16_str += '\x00'; - } - if (debug) - printf("%02x%02x",utf16_str[y],utf16_str[y+1]); - } - if (debug) - printf("\n"); - - //get md5sum from utf16 binary hash - MD5_CTX ctx; - //struct MD5Context ctx; /*md5.h"*/ - - MD5_Init(&ctx); - MD5_Update(&ctx, utf16_str.c_str(), strlen(utf8_str.c_str())*2)/*size*/; - MD5_Final(digest, &ctx); - - strcpy((char *)md5sum,""); - - for (i = 0; i < 16; i++) { - char fdigest[5]; - sprintf(fdigest,"%02x", digest[i]); - strcat((char *)md5sum, fdigest); - } - - log(2,"MD5 hash = %s (%d)\n",md5sum, strlen((char *)md5sum)); - - return(strlen((char *)md5sum)); -} - -int CConnect::get_sid(const char *challenge, const unsigned char *md5) -{ - ostringstream url,command; - - url << cpars->getFritzAdr() << "/cgi-bin/webcm"; - command << "login:command/response=" - << challenge << '-' << md5 - << "&getpage=../html/login_sid.xml"; - - if(debug) {cout << '[' << BASENAME << "] - " << __FUNCTION__ << "()" << endl;} - - string s = post2fritz(url.str().c_str(), command.str()); - - //search - string s1 = ""; - string s2 = ""; - string token; - size_t pos = 0; - - if((pos = s.find(s1)) != string::npos) - { - s.erase(0, pos + s1.length()); - - pos = 0; - if((pos = s.find(s2)) != string::npos) - { - s.erase(pos, s.length()); - if(s != "0000000000000000" && !s.empty()) - { - strncpy(sid,s.c_str(),sizeof(sid)); - if(debug) {printf("[%s] - SID %s \n", BASENAME, sid);} - return 1; - } - } - } - - printf("[%s] - failed to get SID\n", BASENAME); - return(0); -} - -int CConnect::get_sid_LUA(const char *challenge, const unsigned char *md5) -{ - ostringstream url, command; - - url << cpars->getFritzAdr() << "/login_sid.lua"; - - command << "response=" - << challenge << '-' << md5; - - if(debug) {cout << '[' << BASENAME << "] - " << __FUNCTION__ << "()" << endl;} - - string s = post2fritz(url.str().c_str(), command.str()); - - //search - string s1 = ""; - string s2 = ""; - string token; - size_t pos = 0; - - if((pos = s.find(s1)) != string::npos) - { - s.erase(0, pos + s1.length()); - - pos = 0; - if((pos = s.find(s2)) != string::npos) - { - s.erase(pos, s.length()); - if(s != "0000000000000000" && !s.empty()) - { - strncpy(sid,s.c_str(),sizeof(sid)); - if(debug) {printf("[%s] - SID %s \n", BASENAME, sid);} - return 1; - } - } - } - -/* //split into line - string delimiter = "\n"; - string token; - size_t pos = 0; - - while ((pos = s.find(delimiter)) != string::npos) { - i++; - token = s.substr(0, pos); - if(debug) {cout << "rec[" << i << "]" << token << endl;} - s.erase(0, pos + delimiter.length()); - } -*/ - - printf("[%s] - failed to get SID\n", BASENAME); - return(0); -} -#if 0 -/****************************************************************************** - * tools - ******************************************************************************/ -#endif -char *CConnect::trim(char *txt) -{ - register int l; - register char *p1, *p2; - - if (*txt==' ') - { - for (p1=p2=txt; - (*p1==' ') || (*p1=='\t') || (*p1=='\n') || (*p1=='\r'); - p1++); - while (*p1) - *p2++=*p1++; - *p2='\0'; - } - if ((l=strlen(txt))>0) - for (p1=txt+l-1; - (*p1==' ') || (*p1=='\t') || (*p1=='\n') || (*p1=='\r'); - *p1--='\0'); - return(txt); -} - -char *CConnect::UTF8toISO(char *txt) -{ - //http://www.lingua-systems.de/knowledge/unicode-mappings/iso-8859-1-to-unicode.html - //'ä','ö','ü','Ä','Ö','Ü','ß','é' - const unsigned iso[]={'\xe4','\xf6','\xfc','\xc4','\xd6','\xdc','\xdf','\xe9'}, //ISO-8859-1 ö = 0xf6 - utf[]={'\xa4','\xb6','\xbc','\x84','\x96','\x9c','\x9f','\xa9'}; //UTF-8 ö = 0xc3 0xb6 - - int i,found,quota=0; - char *rptr=txt,*tptr=txt; - - while(*rptr != '\0') - { - if(*rptr=='\'') - { - quota^=1; - } - if (!quota && *rptr=='\xc3' && *(rptr+1)) - { - found=0; - for(i=0; i<(int)sizeof(utf) && !found; i++) - { - if(*(rptr+1)==utf[i]) - { - found=1; - *tptr=iso[i]; - ++rptr; - } - } - if(!found) - { - *tptr=*rptr; - } - } - else if (!quota && *rptr=='\xc2' && *(rptr+1)) - { - *tptr=*(rptr+1); - ++rptr; - } - else - { - *tptr=*rptr; - } - tptr++; - rptr++; - } - *tptr=0; - return(txt); -} - -void CConnect::log(const int& dlevel, const char *ftxt,...) -{ - if(debug >= dlevel) - { - va_list params; - va_start(params, ftxt); - printf("[%s] - ", BASENAME); - vprintf(ftxt, params); - fflush(stdout); - va_end(params); - } -} - -#if 0 -/****************************************************************************** - * get login to Fritz!Box - ******************************************************************************/ -#endif -int CConnect::get_login(const char* fritzPW) -{ - log(1,"%s()\n", __FUNCTION__); - - int ret=get_challenge(); - - if (ret < 0) - return 0; - - if(!ret) - { - if(!send_old_login(fritzPW)) { - log(0,"ERROR send_old_login\n"); - return 0; - } - } - else - { - get_md5(challenge,(char*)fritzPW); - - if(!get_sid_LUA(challenge,md5sum)) - { - log(0,"login_sid.lua not found\n"); - if(!get_sid(challenge,md5sum)) - { - log(0,"ERROR get SID\n"); - return 0; - } - } - else - loginLUA = 1; - } - - query_logic = get_query_logic(sid,0); - - if(!query_logic) { - if(get_OLDquery_logic(sid,1)) { - query_logic=2; //old logic - } - else { - log(0,"ERROR get query logic\n"); - return 0; - } - } - - log(1,"query_logic = %i\n", query_logic); - return(query_logic); -} -#if 0 -/****************************************************************************** - * send logout to Fritz!Box - ******************************************************************************/ -#endif -int CConnect::send_logout(const char *sid) -{ - ostringstream url, command; - - url << cpars->getFritzAdr() << "/cgi-bin/webcm"; - command << "sid=" << sid - << "&security:command/logout=&getpage=../html/confirm_logout.htlm"; - - if(debug) {cout << '[' << BASENAME << "] - " << __FUNCTION__ << "()" << endl;} - - //(w_fritz, "GET /home/home.lua?sid=%s&logout=1 HTTP/1.1\r\nHost: 192.168.99.254\r\n\r\n", sid); - - post2fritz(url.str().c_str(), command.str().c_str()); - - return(1); -} -#if 0 -/****************************************************************************** - * send old logic password to Fritz!Box - ******************************************************************************/ -#endif -int CConnect::send_old_login(const char *fritzPW) -{ - ostringstream url, command; - size_t pos = 0; - - url << cpars->getFritzAdr() << "/cgi-bin/webcm"; - command << "getpage=../html/de/menus/menu2.html&var%3Alang=de&var%3Amenu=home&var%3Apagename=home&login%3Acommand%2Fpassword=" - << fritzPW << "&sid=" << sid; - - if(debug) {cout << '[' << BASENAME << "] - " << __FUNCTION__ << "()" << endl;} - - string s = post2fritz(url.str().c_str(), command.str().c_str()); - - if((pos= s.find("class=\"errorMessage\"")) != std::string::npos) - { - log(0,"failed to get old login\n"); - return 0; - } - - return 1; -} -#if 0 -/****************************************************************************** - * send query's to Fritz!Box - ******************************************************************************/ -#endif -int CConnect::get_query_logic(const char *sid, int logic) -{ - if(!loginLUA) { - return (get_OLDquery_logic(sid, logic)); - } - - size_t pos; - std::ostringstream url; - - log(1,"%s()\n", __FUNCTION__); - - url << cpars->getFritzAdr() << "/query.lua?sid=" << sid - << "&ver=uimodlogic:status/nspver"; //Firmware > 06.9 - - string s = post2fritz(url.str().c_str(), ""); - string res = cpars->parseString("ver", s); - - if(!res.empty() && (pos = res.find('.')) != string::npos) - { - log(0,"Firmwareversion (%s)\n", res.c_str()); - cpars->setNspver(res); - query_logic = 3; - return (query_logic); - } - else - { - url.str(""); - url << cpars->getFritzAdr() << "/query.lua?sid=" << sid - << "&ver=logic:status/nspver"; //Firmware < 06.9 - - s = post2fritz(url.str().c_str(), ""); - res = cpars->parseString("ver", s); - - if(!res.empty() && (pos = res.find('.')) != string::npos) - { - log(0,"Firmwareversion (%s)\n", res.c_str()); - cpars->setNspver(res); - query_logic = 3; - return (query_logic); - } - } - - return (get_OLDquery_logic(sid, logic)); -} - -int CConnect::get_OLDquery_logic(const char *sid, int logic) -{ - ostringstream url, command; - std::string output ="/tmp/fim.out"; - char *line; - ssize_t read; - size_t len; - FILE* fd; - int i = 0; - int res = 0; - - url << cpars->getFritzAdr() << "/cgi-bin/webcm"; - - if(logic) - { - command << "getpage=../html/query.txt&var:cnt=1&var:n0=logic:status/nspver" //old - << "&sid=" << sid; - } - else - { - command << "getpage=../html/query.txt&var:n[0]=logic:status/nspver" //new - << "&sid=" << sid; - } - - log(1,"%s()\n", __FUNCTION__); - - post2fritz(url.str().c_str(), command.str().c_str(),output); - - line=NULL; - if((fd = fopen(output.c_str(), "r"))) - { - while ((read = getline(&line, &len, fd)) != -1) - { - i++; - if(debug){cout << "rec " << '[' << i << ']' << line;} - - if(i==1) - { - if(strlen(trim(line))!=0 && strlen(trim(line))<35) { - log(0,"Firmwareversion (%s)\n", (trim(line))); - cpars->setNspver(trim(line)); - res=1; - } - } - } - fclose(fd); - } - if(line) - free(line); - - return (res); -} - -int CConnect::send_refresh(const char *sid) -{ - if(query_logic == 3) { - return(0); - } - - std::ostringstream url, command; - - url << cpars->getFritzAdr() << "/cgi-bin/webcm"; - - command << "getpage=../html/query.txt" - << (query_logic==2 /*old logic*/ ? "&var:cnt=2" : "") - << "&var:n" - << (query_logic==1 ? "[" : "") << 0 << (query_logic==1 ? "]" : "") - << "=telcfg:settings/RefreshJournal&var:n" - << (query_logic==1 ? "]" : "") << 1 << (query_logic==1 ? "]" : "") - << "=telcfg:settings/Journal/count" - << "&sid=" << sid; - - log(1,"%s()\n", __FUNCTION__); - - post2fritz(url.str().c_str(), command.str().c_str()); - return 0; -} - -/****************************************************************************** - * FritzInfoMonitor - ******************************************************************************/ -#if 0 -void send_query(char *sid, char *searchquery) -{ -/* - -- query.lua - -- - -- Liest Werte von Control-Manager Variablen aus und gibt diese in einer JSON Struktur zur├╝ck. - -- - -- Jeder GET Parameter wird als = gedeutet. kann dabei relativ frei gew├ñhlt werden. - -- ist der Querystring f├╝r eine Control-Manager Variable. - -- - -- Beispiel: http://fritz.box/query.lua?fw=logic:status/nspver&ld=landevice:settings/landevice/list(name,ip,mac) - -- - -- Ja, normale Queries k├Ânnen mit Multiqueries gemischt werden. - -- - -- Multiqueries werden am Vorhandensein von "list(...)" in der Query erkannt. Da alte emu-Module dieses Kommando - -- nicht kennen, kann alternativ der Pr├ñfix "mq_" vor den Namen der Query gesetzt werden. Beispiel: - -- http://fritz.box/query.lua?mq_log=logger:status/log - -- Nur bei einer "mq_" Liste wird der Knotennamen ("landevice0") mit ausgegeben. - -- - -- Und nicht die Session-ID vergessen! Wenn die Box mit einem Passwort gesichert ist, sieht ein Request in - -- Wahrheit so aus: - -- http://fritz.box/query.lua?sid=bc0c3998a520f93c&fw=logic:status/nspver - -- - -- Wenn auf der Box kein Passwort gesetzt ist, kann die Session-ID entfallen. Das Skript sorgt dann selbst f├╝r - -- eine g├╝ltige Session-ID. - -- -*/ - - int i; - int y=0; - int inx=-1; - char *ptr; - char line[BUFFERSIZE]; - - connect2fritz(); - - if(debug) - printf("GET /query.lua?sid=%s&mq_result=%s HTTP/1.1\n", sid, searchquery); - - fprintf(w_fritz, "GET /query.lua?sid=%s&mq_result=%s HTTP/1.1\r\n\r\n", sid, searchquery); - - fflush(w_fritz); - - for (i=1; 1; i+=1) { - - char *s=fgets(line, sizeof(line), r_fritz); - - if(debug) - printf("Line %d/[%d]%d: %s",i,inx,y,line); - - if (s==NULL) - { - break; - } - else if (strstr(line, "Journal")) - { - y=0; - inx++; - } - else if(inx >= 0) - { -/* - Line 1/[-1]0: HTTP/1.0 200 OK - Line 2/[-1]1: Content-type: application/json - Line 3/[-1]2: Expires: -1 - Line 4/[-1]3: - Line 5/[-1]4: { - Line 6/[-1]5: "mq_result" : [ - Line 7/[-1]6: { - Line 8/[-1]7: "_node" : "Journal0", - Line 9/[0]1: "0" : "3", - Line 10/[0]2: "5" : "07.09.11 20:48", - Line 11/[0]3: "Type" : "caller number", - Line 12/[0]4: "Date" : "4", - Line 13/[0]5: "Number" : "0:03", - Line 14/[0]6: "Port" : "my number", - Line 15/[0]7: "Duration" : "0", - Line 16/[0]8: "Route" : "Name", - Line 17/[0]9: "RouteType" : "my home", - Line 18/[0]10: "Name" : "" - Line 19/[0]11: }, - Line 20/[0]12: { - Line 21/[0]13: "_node" : "Journal1", -*/ - switch (y) - { - case 1: sscanf(line + 8, "%[^\"]", (char *) &caller[inx].call_type); - case 2: sscanf(line + 8, "%[^\"]", (char *) &caller[inx].call_date); - case 3: sscanf(line +11, "%[^\"]", (char *) &caller[inx].call_numr); - if(strlen(caller[inx].call_numr) == 0) { - // strcpy(caller[inx].call_numr, "keine Rufnummer"); - } - case 8: sscanf(line +12, "%[^\"]", (char *) &caller[inx].call_name); - if(strlen(caller[inx].call_name) == 0) { - // strcpy(caller[inx].call_name, "unbekannt"); - } - } - } - y++; - } - - if(debug) { - for (i=0; i < MAXCALLER; i++) - printf("inx[%i] %s %s %s %s\n",i,caller[i].call_type, caller[i].call_date, caller[i].call_numr, caller[i].call_name); - } - - // When finished send all lingering transmissions and close the connection - quitfritz(); -} -#endif - -int CConnect::send_query_info(const char *sid) -{ - if(query_logic == 3) { - return(get_QueryInfos(sid)); - } - - char *line; - ssize_t read; - size_t len; - string output ="/tmp/fim.out"; - FILE* fd; - int i = 0; - - ostringstream url, command; - - url << cpars->getFritzAdr() << "/cgi-bin/webcm"; - - if(query_logic==2) - { - command << "getpage=../html/query.txt" - << "&var:cnt=6" - << "&var:n0=ddns:settings/account0/state" - << "&var:n1=ddns:settings/account0/domain" - << "&var:n2=tam:settings/TAM0/Active" - << "&var:n3=tam:settings/TAM0/NumNewMessages" - << "&var:n4=sip:settings/sip0/displayname" - << "&var:n5=sip:settings/sip1/displayname" - << "&var:n6=connection0:pppoe:status/ip" - << "&sid=" << sid; - } - else - { - command << "getpage=../html/query.txt" - << "&var:n[0]=ddns:settings/account0/state" - << "&var:n[1]=ddns:settings/account0/domain" - << "&var:n[2]=tam:settings/TAM0/Active" - << "&var:n[3]=tam:settings/TAM0/NumNewMessages" - << "&var:n[4]=sip:settings/sip0/displayname" - << "&var:n[5]=sip:settings/sip1/displayname" - << "&var:n[6]=connection0:pppoe:status/ip" - << "&sid=" << sid; - } - - log(1,"%s()\n", __FUNCTION__); - - post2fritz(url.str().c_str(), command.str().c_str(),output); - - line=NULL; - if((fd = fopen(output.c_str(), "r"))) - { - while ((read = getline(&line, &len, fd)) != -1) - { - i++; - if(debug>1){cout << "rec " << '[' << i << ']' << line;} - - switch(i) - { - case 1: cpars->setDdns_state(trim(line));break; - case 2: cpars->setDdns_domain(trim(line)); break; - case 3: cpars->setTam0_active(trim(line));break; - case 4: cpars->setTam0_NumNewMessages(trim(line));break; - case 5: cpars->setSip0Nr(trim(line));break; - case 6: cpars->setSip1Nr(trim(line));break; - case 7: cpars->setPppoe_ip(trim(line));break; - } - } - fclose(fd); - log(1,"ddns_state=%i ddns_domain=%s tam0_active=%i tam0_NumNewMessages=%i sip0nr=%s sip1nr=%s pppoe_ip=%s\n", - atoi(cpars->getDdns_state().c_str()), - cpars->getDdns_domain().c_str(), - atoi(cpars->getTam0_active().c_str()), - atoi(cpars->getTam0_NumNewMessages().c_str()), - cpars->getSip0Nr().c_str(),cpars->getSip1Nr().c_str(), - cpars->getPppoe_ip().c_str()); - } - if(line) - free(line); - - return 0; -} - -int CConnect::get_QueryInfos(const char *sid) -{ - ostringstream url,command; - int i = 0; - - url << cpars->getFritzAdr() << "/query.lua?sid=" << sid - << "&var0=ddns:settings/account0/state" - << "&var1=ddns:settings/account0/domain" - << "&var2=tam:settings/TAM0/Active" - << "&var3=tam:settings/TAM0/NumNewMessages" - << "&var4=sip:settings/sip0/displayname" - << "&var5=sip:settings/sip1/displayname" - << "&var6=connection0:pppoe:status/ip"; - - log(1,"%s()\n", __FUNCTION__); - - string s = post2fritz(url.str().c_str(), ""); - StringReplace(s," ",""); - - for (i=0; i <= 6; i++) - { - stringstream ss; - ss << "var" << i; - - string res = cpars->parseString(ss.str().c_str(), s); - - switch(i) - { - case 0: cpars->setDdns_state(res);break; - case 1: cpars->setDdns_domain(res); break; - case 2: cpars->setTam0_active(res);break; - case 3: cpars->setTam0_NumNewMessages(res);break; - case 4: cpars->setSip0Nr(res);break; - case 5: cpars->setSip1Nr(res);break; - case 6: cpars->setPppoe_ip(res);break; - } - } - return 0; -} - -int CConnect::send_query_caller(const char *sid, int s, int max) -{ - if(loginLUA) { - return (get_caller_LUA(sid, s, max)); - } - - std::ostringstream url, command; - int i=0; - char *line; - ssize_t read; - size_t len; - int inx=0; - int inxx=0; - int items=9; - char c1[2] = "["; - char c2[2] = "]"; - string output ="/tmp/fim.out"; - FILE* fd; - - log(1,"%s()\n", __FUNCTION__); - - cpars->init_caller(); - - url << cpars->getFritzAdr() << "/cgi-bin/webcm"; - command << "getpage=../html/query.txt"; - - if(query_logic==2) //old logic - { - strcpy(c1,""); - strcpy(c2,""); - items=7; - command << "&var:cnt=" << items * max; - } - - inx=0; - log(0,"hole Eintrag %d bis %d\n",s+1,s+max); - for (i=s; i <= s+max; i++) - { - command << "&var:n" << c1 << inx << c2 << "=telcfg:settings/Journal" << i << "/Type"; - inx++; - command << "&var:n" << c1 << inx << c2 << "=telcfg:settings/Journal" << i << "/Date"; - inx++; - command << "&var:n" << c1 << inx << c2 << "=telcfg:settings/Journal" << i << "/Number"; - inx++; - command << "&var:n" << c1 << inx << c2 << "=telcfg:settings/Journal" << i << "/Port"; - inx++; - command << "&var:n" << c1 << inx << c2 << "=telcfg:settings/Journal" << i << "/Duration"; - inx++; - command << "&var:n" << c1 << inx << c2 << "=telcfg:settings/Journal" << i << "/Route"; - inx++; - command << "&var:n" << c1 << inx << c2 << "=telcfg:settings/Journal" << i << "/Name"; - inx++; - - if(query_logic==1) - { - command << "&var:n" << c1 << inx << c2 << "=telcfg:settings/Journal" << i << "/RouteType"; - inx++; - command << "&var:n" << c1 << inx << c2 << "=telcfg:settings/Journal" << i << "/PortName"; - inx++; - } - } - command << "&sid=" << sid; - - post2fritz(url.str().c_str(), command.str().c_str(), output); - - i=0; - inx=0; - inxx=0; - - line=NULL; - if((fd = fopen(output.c_str(), "r"))) - { - while ((read = getline(&line, &len, fd)) != -1) - { - i++; - inx++; - if(debug>1){cout << "rec" << '[' << inxx << ']' << '[' << inx << ']' << '[' << i << ']' << line;} -/* - 1="Type"; - 2="Date"; - 3="Number"; - 4="Port"; - 5="Duration"; - 6="Route"; - 7="Name"; - 8="RouteType"; - 9="PortName" -*/ - - switch(inx) - { - case 1: strcpy(cpars->caller[inxx].call_type, trim(line)); break; - case 2: strcpy(cpars->caller[inxx].call_date, trim(line)); break; - case 3: strcpy(cpars->caller[inxx].call_numr, trim(line)); break; - case 5: strcpy(cpars->caller[inxx].call_time, trim(line));break; - case 6: strcpy(cpars->caller[inxx].port_rout, trim(line));break; - case 7: strcpy(cpars->caller[inxx].call_name, UTF8toISO(trim(line))); - if(query_logic != 1) - { - inx=0; - inxx++; - } - break; - case 9: - strcpy(cpars->caller[inx].port_name, UTF8toISO(trim(line))); - inx=0; - inxx++; - break; - } - - if (inxx==max) - { - break; - } - } - fclose(fd); - } - if(debug) { - for (i=0; i < max; i++) - log(1,"inxx[%i] %s(%i) %s(%i) %s(%i) %s(%i) %s(%i) %s(%i) %s(%i)\n",i, - cpars->caller[i].call_type, strlen(cpars->caller[i].call_type), - cpars->caller[i].call_date, strlen(cpars->caller[i].call_date), - cpars->caller[i].call_numr, strlen(cpars->caller[i].call_numr), - cpars->caller[i].call_name, strlen(cpars->caller[i].call_name), - cpars->caller[i].port_rout, strlen(cpars->caller[i].port_rout), - cpars->caller[i].port_name, strlen(cpars->caller[i].port_name), - cpars->caller[i].call_time, strlen(cpars->caller[i].call_time)); - } - if(line) - free(line); - - return(0); -} - -int CConnect::get_caller_LUA(const char *sid, int s, int max) -{ - ostringstream url,command; - string output = "/tmp/fim.out"; - int i = 0; - int inx = 0; - int skip = 1; - - url << cpars->getFritzAdr() << "/fon_num/foncalls_list.lua?csv="; - command << "refresh=&sid=" << sid; - - log(1,"%s()\n", __FUNCTION__); - - post2fritz(url.str().c_str(), command.str().c_str(), cpars->getListfile()); - - cpars->init_caller(); - - ifstream fh(cpars->getListfile()); - if ( fh.is_open() ) - { - string line; - - while (getline(fh,line)) - { - - string Typ; - string Datum; - string Name; - string Rufnummer; - string Nebenstelle; - string Eigene_Rufnummer; - string Dauer; - - istringstream in(line); - - // select data - if(inx <= skip+s) - { - inx++; - continue; - } - else if(inx > skip+s+max) - { - break; - } - - if( getline(in, Typ, ';') && - getline(in, Datum, ';') && - getline(in, Name, ';') && - getline(in, Rufnummer, ';') && - getline(in, Nebenstelle, ';') && - getline(in, Eigene_Rufnummer, ';') && - getline(in, Dauer, ';') ) - { - size_t found; - if((found = Eigene_Rufnummer.find("Internet")) != std::string::npos) - Eigene_Rufnummer.replace(found,8,"@"); - - //this is ugly, better use vector!!! - strcpy(cpars->caller[i].call_type, Typ.c_str()); - strcpy(cpars->caller[i].call_date, Datum.c_str()); - strcpy(cpars->caller[i].call_numr, Rufnummer.c_str()); - strcpy(cpars->caller[i].call_time, Dauer.c_str()); - strcpy(cpars->caller[i].port_rout, Eigene_Rufnummer.c_str()); - strcpy(cpars->caller[i].call_name, UTF8toISO((char*)Name.c_str())); - strcpy(cpars->caller[i].port_name, UTF8toISO((char*)Nebenstelle.c_str())); - - if(debug>1) - { - cout << " rec[" << inx << "]" << line << endl; - cout << "array[" << i << "]" - << Typ << ";" - << Datum << ";" - << Name << ";" - << Rufnummer << ";" - << Nebenstelle << ";" - << Eigene_Rufnummer << ";" - << Dauer << endl; - } - i++; - } - else { - cerr << '[' << BASENAME << "] - " << __FILE__ << " could not parse line [" << inx << "]" << line << endl; - } - inx++; - } - fh.close(); - } - else { - cerr << '[' << BASENAME << "] - " << __FILE__ << "error open file" << endl; - } - - return(0); -} - -int CConnect::get_phonebooks(const char *sid, int phonebook) -{ - char *line; - ssize_t read; - size_t len; - ostringstream url, command; - string output ="/tmp/fim.out"; - FILE* fd; - int i = 0; - - log(1,"%s()\n", __FUNCTION__); - - if(loginLUA) { - return(get_phonebooks_LUA(sid, phonebook)); - } - - cpars->init_address(); - - url << cpars->getFritzAdr() << "/cgi-bin/webcm"; - command << "telcfg:settings/Phonebook/Books/Select=" << phonebook-1 - << "&getpage=../html/de/menus/menu2.html" - << "&var:lang=de" - << "&var:pagename=fonbuch" - << "&var:menu=fon" - << "&sid=" << sid; - - - post2fritz(url.str().c_str(), command.str().c_str(), output); - - line=NULL; - if((fd = fopen(output.c_str(), "r"))) - { - while ((read = getline(&line, &len, fd)) != -1) - { - char *ptr; - char buffer[50]; - - i++; - if(debug>1){cout << "rec " << '[' << i << ']' << line;} - - if ((ptr = strstr(line, ">TrFonName("))) { - sscanf(ptr + 11, "\"%*[^\"]\", \"%[^\"]", (char *) &cpars->address.name); - } - else if ((ptr = strstr(line, ">TrFonNr("))) { - sscanf(ptr + 9, "\"%49[^\"]\", \"%[^\"]", (char *) &buffer,(char *) &cpars->address.number); - - if(!strstr(buffer,"intern")) //no "intern" type - { - if(cpars->address.number[0] != '0' && strlen(cpars->getCityprefix()) > 0) { - sprintf(buffer,"%s%s",cpars->getCityprefix(),cpars->address.number); - strcpy(cpars->address.number,buffer); - } - - if (cpars->search_AddrBook(cpars->address.number)) { - log(1,"[existing]\t%s %s\n",cpars->address.number,cpars->address.name); - } - else { - cpars->add_AddrBook(cpars->address.number); - log(1,"[add]\t\t%s %s\n",cpars->address.number,cpars->address.name); - } - } - } - else if (strstr(line, "document.write(TrFon1())")) { - cpars->init_address(); - } - } - fclose(fd); - } - if(line) - free(line); - - return(0); -} - -int CConnect::get_phonebooks_LUA(const char *sid, int phonebook) -{ - std::ostringstream url,command, vsid, bookID; - string output ="/tmp/fim.out"; - - ifstream fh; - string str, line; - size_t pos; - size_t begin = 0; - - log(1,"%s()\n", __FUNCTION__); - - // create multipart vector - vsid << "sid=" << sid; - bookID << "PhonebookId=" << phonebook; - multipart.push_back(vsid.str()); - multipart.push_back(bookID.str()); - multipart.push_back("PhonebookExportName=Telefonbuch"); - multipart.push_back("PhonebookExport="); - - //get phonebook - url.str(""); - url << cpars->getFritzAdr() << "/cgi-bin/firmwarecfg"; - post2fritz(url.str().c_str(), "", output); - - // parse output - fh.open(output.c_str(), std::ios::in); - if(fh.is_open()) - { - while (!fh.eof()) - { - getline(fh, str); - - // get the whole Data in one line - line += str; - } - fh.close(); - - // loop search - bool stop = false; - do { - str = ""; - if((pos=line.find(str, begin)) != string::npos) - { - size_t name_ende = line.find("", pos); - string tmp = line.substr(pos+str.length(), name_ende - (pos+str.length())); - strcpy(cpars->address.name, tmp.c_str()); - cout << " name - " << cpars->address.name << endl; - } - - str = "", number_start); - tmp = line.substr(number_start+str.length(), number_ende - (number_start+str.length())); - strcpy(cpars->address.number, tmp.c_str()); - cout << " number - " << cpars->address.number << endl; - } - - if(pos == string::npos) - stop = true; - else - { - //add to AddrBook - if(strlen(cpars->address.number) != 0) - { - if(cpars->address.number[0] != '0' && strlen(cpars->getCityprefix()) > 0) { - char buffer[50]; - sprintf(buffer,"%s%s",cpars->getCityprefix(),cpars->address.number); - strcpy(cpars->address.number,buffer); - } - - if(cpars->search_AddrBook(cpars->address.number)) { - cout << '[' << BASENAME << "] - [existing]\t"; - } - else { - cpars->add_AddrBook(cpars->address.number); - cout << '[' << BASENAME << "] - [add]\t"; - } - cout << cpars->address.number << ' ' << cpars->address.name << endl; - } - } - - begin = pos +1; - - } while (!stop); - } -/* - line=NULL; - if((fd = fopen(output.c_str(), "r"))) - { - while ((read = getline(&line, &len, fd)) != -1) - { - char *ptr; - - cpars->init_address(); - i++; - if(debug>1){cout << "rec " << '[' << i << ']' << line;} - - if((ptr = strstr(line, ""))) { - sscanf(ptr + 18, "%[^<]", (char *) &cpars->address.name); - cout << cpars->address.name << endl; - } - - if((ptr = strstr(line, ""))) { - sscanf(ptr + 36, "%[^<]", (char *) &cpars->address.number); - cout << cpars->address.number << endl; - - //add to AddrBook - if(strlen(cpars->address.number) != 0) - { - if(cpars->address.number[0] != '0' && strlen(cpars->getCityprefix()) > 0) { - char buffer[50]; - sprintf(buffer,"%s%s",cpars->getCityprefix(),cpars->address.number); - strcpy(cpars->address.number,buffer); - } - - if(cpars->search_AddrBook(cpars->address.number)) { - cout << '[' << BASENAME << "] - [existing]\t"; - } - else { - cpars->add_AddrBook(cpars->address.number); - cout << '[' << BASENAME << "] - [add]\t"; - } - cout << cpars->address.number << ' ' << cpars->address.name << endl; - } - } - - - } - fclose(fd); - } - if(line) - free(line); -*/ - return(0); -} - -int CConnect::dial(const char *sid, int port, const char *number) -{ - std::ostringstream url,command; - - if(query_logic == 3) { - url << cpars->getFritzAdr() << "/fon_num/fonbook_list.lua?" - << "dial=" << number - << "&orig_port=" << port - << "&sid=" << sid; - } - else { - url << cpars->getFritzAdr() << "/cgi-bin/webcm"; - command << "getpage=../html/de/menus/menu2.html" - << "&telcfg:settings/UseClickToDial=1" - << "&telcfg:settings/DialPort=" << port - << "&telcfg:command/Dial=" << number - << "&sid=" << sid; - } - - log(1,"%s()\n", __FUNCTION__); - - post2fritz(url.str().c_str(), command.str().c_str()); - - return(0); -} - -int CConnect::hangup(const char *sid, int port) -{ - std::ostringstream url,command; - - url << cpars->getFritzAdr() << "/cgi-bin/webcm"; - command << "getpage=../html/de/menus/menu2.html" - << "&telcfg:settings/UseClickToDial=1" - << "&telcfg:settings/DialPort=" << port - << "&telcfg:command/Hangup=" - << "&sid=" << sid; - - log(1,"%s()\n", __FUNCTION__); - - post2fritz(url.str().c_str(), command.str().c_str()); - - return(0); -} - -int CConnect::reconnect(const char *sid) -{ - std::ostringstream url,command; - - if(query_logic == 3) { - url << cpars->getFritzAdr() << "/internet/inetstat_monitor.lua?sid=" << sid - << "&useajax=1&action=disconnect&xhr=1"; - } - else { - url << cpars->getFritzAdr() << "/cgi-bin/webcm"; - command << "sid=" << sid - << "&connection0%3Asettings%2Fcmd_disconnect="; - } - - log(1,"%s()\n", __FUNCTION__); - - post2fritz(url.str().c_str(), command.str().c_str()); - - return(0); -} - -/****************************************************************************** - * reverse search - ******************************************************************************/ -int CConnect::rsearch(const char *searchNO) -{ - char *found; - char *line; - ssize_t read; - size_t len; - ostringstream url; - string sstr; - string output ="/tmp/fim.out"; - FILE* fd; - - log(1,"%s()\n", __FUNCTION__); - - cpars->init_address(); - - if(searchNO[0] != '0') - sstr = (std::string) (strlen(cpars->getCityprefix())>0 ? cpars->getCityprefix() : "") + (std::string) searchNO; - else - sstr = searchNO; - - url << cpars->getSearchAdr() << "/suche/" << sstr << "/-"; - - post2fritz(url.str().c_str(),"", output); - - line=NULL; - if((fd = fopen(output.c_str(), "r"))) - { - while ((read = getline(&line, &len, fd)) != -1) - { - if ((found = strstr(line, "target=\"_self\" title=\"Zur Detailseite von "))) - { - sscanf(found + 47, "%255[^\"]", (char *) &cpars->address.name); - } - else if ((found = strstr(line, "\"postalCode\" content=\""))) - { - sscanf(found + 22, "%5[^\"]", (char *) &cpars->address.code); - } - else if((found = strstr(line, "\"addressLocality\" content=\""))) - { - sscanf(found + 27, "%127[^\"]", (char *) &cpars->address.locality); - } - else if((found = strstr(line, "\"streetAddress\" content=\""))) - { - sscanf(found + 25, "%127[^\"]", (char *) &cpars->address.street); - } - } - fclose(fd); - } - if(line) - free(line); - - if(strlen(cpars->address.name)!=0) { - log(1,"(%s) = %s, %s, %s %s\n",sstr.c_str(), cpars->address.name, cpars->address.street, cpars->address.code, cpars->address.locality); - - return(1); - } - else { - log(0,"no results for %s\n", sstr.c_str()); - } - - return(0); -} - -void CConnect::StringReplace(string &str, const string search, const string rstr) -{ - stringstream f(search); // stringstream f("string1;string2;stringX"); - string s; - while (getline(f, s, ';')) - { - string::size_type ptr = 0; - string::size_type pos = 0; - - while((ptr = str.find(s,pos)) != string::npos) - { - str.replace(ptr,s.length(),rstr); - pos = ptr + rstr.length(); - } - } -} diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/connect.h b/archive-sources/FritzCallMonitor/FritzInfoMonitor/connect.h deleted file mode 100644 index e730b561..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/connect.h +++ /dev/null @@ -1,89 +0,0 @@ - -#ifndef __connect_h__ -#define __connect_h__ - -#ifdef HAVE_CONFIG_H -#include -#endif - -class CConnect -{ - public: - CConnect(); - ~CConnect(); - static CConnect* getInstance(); - - int connect2Host(const char *adr, int port); - int get2box(const char* host, int port, const char* msg, const char* upwd); - int get_login(const char* fritzPW); - int get_callerlist(const char *sid, const char *file); - int get_phonebooks(const char *sid, int phonebook); - int get_phonebooks_LUA(const char *sid, int phonebook); - int send_refresh(const char *sid); - int send_logout(const char *sid); - int send_query(const char* flag, const char *sid, const char *searchstr); - int send_query_caller(const char *sid, int s, int max); - int send_query_info(const char *sid); - int rsearch(const char *searchNO); - int dial(const char *sid, int port, const char *number); - int reconnect(const char *sid); - int hangup(const char *sid, int port); - char *trim(char *txt); - char *UTF8toISO(char *txt); - void log(const int& dlevel, const char *ftxt,...); - void StringReplace(string &str, const string search, const string rstr); - - std::string query2fritz(const char* command); - - virtual int getQueryLogic(){return query_logic;}; - virtual void setDebug(const int Debug){debug = Debug;}; - virtual const char* getSid(){return sid;}; - - private: - CParser * cpars; - - FILE *r_fritz; - FILE *w_fritz; - int sockfb; - int debug; - int query_logic; - int loginLUA; - char sid[20]; - char challenge[20]; - vector multipart; - - string timestamp(); - string basename; - unsigned char digest[16]; - unsigned char md5sum[33]; - - int connect2fritz(); - int quitfritz(); - int get_challenge(bool lua = true); - int get_md5(const char *challenge, char *fritzPW); - int get_sid(const char *challenge, const unsigned char *md5); - int get_sid_LUA(const char *challenge, const unsigned char *md5); - int get_caller_LUA(const char *sid, int s, int max); - int get_challenge(const char* host, int port,const char* fritzPW); - std::string post2fritz(const char* url, const std::string data, const std::string curlOutFile = ""); - int get_OLDquery_logic(const char *sid, int logic); - - ///get Infos from FB with query.lua - int get_QueryInfos(const char *sid); - - //FritzInfoMonitor - //Firmware < xx.04.74 without SID - int send_old_login(const char *fritzPW); - - int ExistFile(const char *fname); - int TouchFile(const char *fname); - -//FIXME void init_caller(); -//FIXME void init_address(); - - ///query syntax - int get_query_logic(const char *sid, int logic); - void get_query_version(const char *sid); -}; - -#endif //__connect_h__ diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/framebuffer.cpp b/archive-sources/FritzCallMonitor/FritzInfoMonitor/framebuffer.cpp deleted file mode 100644 index 1a9b2147..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/framebuffer.cpp +++ /dev/null @@ -1,456 +0,0 @@ - -#include -#include -#include -#include - -#include "parser.h" -#include "globals.h" - -#include "framebuffer.h" - -const char circle[]={ - 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, - 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, - 9,9,1,1,1,1,1,1,1,1,1,1,1,9,9, - 9,9,1,1,1,1,1,1,1,1,1,1,1,9,9, - 9,9,1,1,1,1,1,1,1,1,1,1,1,9,9, - 9,9,1,1,1,1,1,1,1,1,1,1,1,9,9, - 9,9,1,1,1,1,1,1,1,1,1,1,1,9,9, - 9,9,1,1,1,1,1,1,1,1,1,1,1,9,9, - 9,9,1,1,1,1,1,1,1,1,1,1,1,9,9, - 9,9,1,1,1,1,1,1,1,1,1,1,1,9,9, - 9,9,1,1,1,1,1,1,1,1,1,1,1,9,9, - 9,9,1,1,1,1,1,1,1,1,1,1,1,9,9, - 9,9,1,1,1,1,1,1,1,1,1,1,1,9,9, - 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, - 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9 -}; - -Cfb* Cfb::getInstance() -{ - static Cfb* instance = NULL; - if(!instance) - instance = new Cfb(); - return instance; -} - -Cfb::Cfb() -{ - cpars = CParser::getInstance(); - - memset(&lfb, 0, sizeof(lfb)); - memset(&lbb, 0, sizeof(lbb)); -} - -Cfb::~Cfb() -{ - Cleanup(); -} - -int Cfb::init() -{ - FT_Error error; - - fb = sx = ex = sy = ey = -1; - - // open Framebuffer - fb=open ( "/dev/fb/0", O_RDWR ); - - // init framebuffer - if(ioctl(fb, FBIOGET_FSCREENINFO, &fix_screeninfo) == -1) - { - printf("[%s] \n",BASENAME); - return(2); - } - - if(ioctl(fb, FBIOGET_VSCREENINFO, &var_screeninfo) == -1) - { - printf("[%s] \n",BASENAME); - return(2); - } - - if(!(lfb = (unsigned char*)mmap(0, fix_screeninfo.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fb, 0))) - { - printf("[%s] \n",BASENAME); - return(2); - } - - // init fontlibrary - if((error = FT_Init_FreeType(&library))) - { - printf("[%s] ",BASENAME, error); - munmap(lfb, fix_screeninfo.smem_len); - return(2); - } - - if((error = FTC_Manager_New(library, 1, 2, 0, &MyFaceRequester, this, &manager))) - { - printf("[%s] \n",BASENAME, error); - FT_Done_FreeType(library); - munmap(lfb, fix_screeninfo.smem_len); - return(2); - } - - if((error = FTC_SBitCache_New(manager, &cache))) - { - printf("[%s] \n",BASENAME, error); - FTC_Manager_Done(manager); - FT_Done_FreeType(library); - munmap(lfb, fix_screeninfo.smem_len); - return(2); - } - - if((error = FTC_Manager_Lookup_Face(manager, (char *)FONT, &face))) - { - printf("[%s] \n",BASENAME, error); - FTC_Manager_Done(manager); - FT_Done_FreeType(library); - munmap(lfb, fix_screeninfo.smem_len); - return(2); - } - - use_kerning = FT_HAS_KERNING(face); - - desc.face_id = (char *)FONT; - - desc.flags = FT_LOAD_MONOCHROME; - - - // init backbuffer - if(!(lbb = (unsigned char*)malloc(fix_screeninfo.line_length*var_screeninfo.yres))) - { - printf("[%s] \n",BASENAME); - FTC_Manager_Done(manager); - FT_Done_FreeType(library); - munmap(lfb, fix_screeninfo.smem_len); - return(2); - } - - // volle Bildschirmauflösung reservieren (Parameter: buffer, color, size in bytes) - memset(lbb, 0, fix_screeninfo.line_length*var_screeninfo.yres); - printf("[%s] - init: FB %dx%dx%d stride %d\n",BASENAME, var_screeninfo.xres, var_screeninfo.yres, var_screeninfo.bits_per_pixel, fix_screeninfo.line_length);; - - cpars->read_neutrino_osd_conf(&ex,&sx,&ey,&sy,NEUTRINOCONF); - if((ex == -1) || (sx == -1) || (ey == -1) || (sy == -1)) - { - sx = 80; - ex = var_screeninfo.xres - 80; - sy = 80; - ey = var_screeninfo.yres - 80; - } - - int mwidth = ex-sx; - int mheight = ey-sy; - - //mwidth = 620; - startx = sx + (((ex-sx) - mwidth)/2); - starty = sy + (((ey-sy) - mheight)/2); - - //vyres = var_screeninfo.yres; - - return(0); -} - -/****************************************************************************** - * MyFaceRequester - ******************************************************************************/ -FT_Error Cfb::MyFaceRequester(FTC_FaceID face_id, FT_Library library, FT_Pointer request_data, FT_Face *aface) -{ - FT_Error result; - - result = FT_New_Face(library, (char *)face_id, 0, aface); - - if(!result) - { - printf("[%s] - \n",BASENAME, (char*)face_id); - } - else - { - printf("[%s] \n",BASENAME, (char*)face_id); - } - - return result; -} - -/****************************************************************************** - * RenderChar - ******************************************************************************/ -int Cfb::RenderChar(FT_ULong currentchar, int sx, int sy, int ex, int color) -{ - int row, pitch, bit, x = 0, y = 0; - FT_Error error; - FT_UInt glyphindex; - FT_Vector kerning; - FTC_Node anode; - - //load char - if(!(glyphindex = FT_Get_Char_Index(face, currentchar))) - { - printf("[%s] \n",BASENAME, (int)currentchar); - return 0; - } - - if((error = FTC_SBitCache_Lookup(cache, &desc, glyphindex, &sbit, &anode))) - { - printf("[%s] \n",BASENAME, (int)currentchar, error); - return 0; - } - - if(use_kerning) - { - FT_Get_Kerning(face, prev_glyphindex, glyphindex, ft_kerning_default, &kerning); - - prev_glyphindex = glyphindex; - kerning.x >>= 6; - } - else - { - kerning.x = 0; - } - - // render char - if(color != -1) /* don't render char, return charwidth only */ - { - if(sx + sbit->xadvance >= ex) - { - return -1; /* limit to maxwidth */ - } - - for(row = 0; row < sbit->height; row++) - { - for(pitch = 0; pitch < sbit->pitch; pitch++) - { - for(bit = 7; bit >= 0; bit--) - { - if(pitch*8 + 7-bit >= sbit->width) - { - break; /* render needed bits only */ - } - - if((sbit->buffer[row * sbit->pitch + pitch]) & 1<left + kerning.x + x ) *4 + fix_screeninfo.line_length* ( starty + sy - sbit->top + y ),cpars->bgra[color],4 ); - } - - x++; - } - } - - x = 0; - y++; - } - } - - // return charwidth - return sbit->xadvance + kerning.x; -} - -/****************************************************************************** - * GetStringLen - ******************************************************************************/ -int Cfb::GetStringLen(const char *string) -{ - int stringlen = 0; - - // reset kerning - - prev_glyphindex = 0; - - // calc len - - while(*string != '\0') - { - stringlen += RenderChar(*string, -1, -1, -1, -1); - string++; - } - - return stringlen; -} - -/****************************************************************************** - * RenderString - ******************************************************************************/ -void Cfb::RenderString(const char *string, int sx, int sy, int maxwidth, int layout, int size, int color) -{ - int stringlen, ex, charwidth; - - // set size - - if(size == SMALL) - { - desc.width = desc.height = 26; - } - else if(size == NORMAL) - { - desc.width = desc.height = 32; - } - else - { - desc.width = desc.height = 40; - } - - // set alignment - - if(layout != LEFT) - { - stringlen = GetStringLen(string); - - switch(layout) - { - case CENTER: - if(stringlen < maxwidth) - { - sx += (maxwidth - stringlen)/2; - } - - break; - - case RIGHT: - - if(stringlen < maxwidth) - { - sx += maxwidth - stringlen; - } - } - } - - // reset kerning - - prev_glyphindex = 0; - - // render string - - ex = sx + maxwidth; - - while(*string != '\0') - { - if((charwidth = RenderChar(*string, sx, sy, ex, color)) == -1) - { - return; /* string > maxwidth */ - } - - sx += charwidth; - string++; - } -} - -/****************************************************************************** - * RenderBox - ******************************************************************************/ -void Cfb::RenderBox(int sx, int sy, int ex, int ey, int mode, int color) -{ - int loop; - - if(mode == FILL) - { - for(; sy <= ey; sy++) - { - HorLine(sx, sy, ex-sx+1, color); - } - } - else - { - // hor lines - for(loop = sx; loop <= ex; loop++) - { - SetPixel(loop, sy , color); - SetPixel(loop, sy+1, color); - SetPixel(loop, ey-1, color); - SetPixel(loop, ey , color); - } - - // ver lines - for(loop = sy; loop <= ey; loop++) - { - SetPixel(sx , loop, color); - SetPixel(sx+1, loop, color); - SetPixel(ex-1, loop, color); - SetPixel(ex , loop, color); - } - } -} - -/****************************************************************************** - * RenderCircle - ******************************************************************************/ -void Cfb::RenderCircle(int sx, int sy, int color) -{ - int x, y; - - for (y=0; y<15; y++) - for (x=0; x<15; x++) - if (circle[x+y*15]) - { - if (circle[x+y*15] == 1) - SetPixel(sx + x, sy + y, color); - else - SetPixel(sx + x, sy + y, (int)circle[x+y*15]); - } -} - -/****************************************************************************** - * HorLine / SetPixel / PaintIcon - ******************************************************************************/ -//#define SetPixel(x, y, c) memcpy(lbb + ((startx + (x))<<2) + fix_screeninfo.line_length*(starty + (y)), bgra[c], 4) -void Cfb::HorLine(int x, int y, int l, int color) -{ - for (l+=x; xbgra[c], 4); -} - -void Cfb::PaintIcon(unsigned char *icon, int sx, int sy) -{ - struct rawHeader header; - uint16_t width, height; - int x, y; - - memcpy(&header, icon, sizeof(struct rawHeader)); - width = (header.width_hi << 8) | header.width_lo; - height = (header.height_hi << 8) | header.height_lo; - icon+=sizeof(struct rawHeader); - - for (y=0; y> 4; - if (pix != header.transp) - SetPixel(sx+x, sy+y, pix+1); - pix = (*icon++ & 0x0f); - if (pix != header.transp) - SetPixel(sx+x+1, sy+y, pix+1); - } - } -} - -void Cfb::FBPaint(void) -{ - memcpy(lfb, lbb, fix_screeninfo.line_length*var_screeninfo.yres); -} - -void Cfb::FBClear(void) -{ - RenderBox(0, 0, ex-sx, ey-sy, FILL, 0); -} - -/****************************************************************************** - * Cleanup - ******************************************************************************/ -void Cfb::Cleanup (void) -{ - FTC_Manager_Done(manager); - FT_Done_FreeType(library); - - free(lbb); - munmap(lfb, fix_screeninfo.smem_len); - - close(fb); -} - diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/framebuffer.h b/archive-sources/FritzCallMonitor/FritzInfoMonitor/framebuffer.h deleted file mode 100644 index 6ae962fc..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/framebuffer.h +++ /dev/null @@ -1,84 +0,0 @@ - -#ifndef __framebuffer_h__ -#define __framebuffer_h__ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -/* freetype stuff */ -#define FONT "/share/fonts/pakenham.ttf" - -#include -#include FT_FREETYPE_H -#include FT_CACHE_H -#include FT_CACHE_SMALL_BITMAPS_H - -#if ((defined(FREETYPE_MAJOR)) && (((FREETYPE_MAJOR == 2) && (((FREETYPE_MINOR == 1) && (FREETYPE_PATCH >= 9)) || (FREETYPE_MINOR > 1))) || (FREETYPE_MAJOR > 2))) -#define FTC_Manager_Lookup_Face FTC_Manager_LookupFace -#define _FTC_SBit_Cache_Lookup(a,b,c,d) FTC_SBitCache_Lookup(a,b,c,d,NULL) -#else -#define _FTC_SBit_Cache_Lookup(a,b,c,d) FTC_SBit_Cache_Lookup(a,b,c,d) -#endif - - -class Cfb -{ - public: - Cfb(); - ~Cfb(); - static Cfb* getInstance(); - - int init(); - int RenderChar(FT_ULong currentchar, int sx, int sy, int ex, int color); - int GetStringLen(const char *string); - void RenderString(const char *string, int sx, int sy, int maxwidth, int layout, int size, int color); - void RenderBox(int sx, int sy, int ex, int ey, int mode, int color); - void RenderCircle(int sx, int sy, int color); - void HorLine(int x, int y, int l, int color); - void SetPixel(int x, int y, int c); - void PaintIcon(unsigned char *icon, int sx, int sy); - void FBPaint(void); - void FBClear(void); - void Cleanup (void); - - int GetRCCode(); - - virtual void getDimensions(int* fb_ex, int* fb_sx, int* fb_ey, int* fb_sy){*fb_ex=ex; *fb_sx=sx; *fb_ey=ey; *fb_sy=sy;}; - virtual void getStartDimensions(int* fb_startx, int* fb_starty){*fb_startx=startx; *fb_starty=starty;}; - virtual int getYScreeninfo(){return var_screeninfo.yres;}; - - private: - CParser * cpars; - - int fb, startx, starty, sx, ex, sy, ey; - - struct fb_fix_screeninfo fix_screeninfo; - struct fb_var_screeninfo var_screeninfo; - unsigned char *lfb, *lbb; - - FT_Library library; - FTC_Manager manager; - FTC_SBitCache cache; - FTC_SBit sbit; - FTC_ImageTypeRec desc; - FT_Face face; - FT_UInt prev_glyphindex; - FT_Bool use_kerning; - - static FT_Error MyFaceRequester(FTC_FaceID face_id, FT_Library library, FT_Pointer request_data, FT_Face *aface); - - struct rawHeader - { - uint8_t width_lo; - uint8_t width_hi; - uint8_t height_lo; - uint8_t height_hi; - uint8_t transp; - } __attribute__ ((packed)); -}; - -#endif //__framebuffer_h__ \ No newline at end of file diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/globals.h b/archive-sources/FritzCallMonitor/FritzInfoMonitor/globals.h deleted file mode 100644 index 354bfb59..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/globals.h +++ /dev/null @@ -1,124 +0,0 @@ - -#ifndef __globals_h__ -#define __globals_h__ - -#ifdef HAVE_CONFIG_H -#include -#endif - -//settings -#define KBLCKFILE "/tmp/keyboard.lck" -#define NEUTRINOCONF "/var/tuxbox/config/neutrino.conf" -#define CONFIGFILE "/var/tuxbox/config/FritzCallMonitor.cfg" - -#define BASENAME "FIM" -#define VERSION "V4.4" -#define COPYR "2011 (c) FlatTV" - -/* rc codes */ -#define RC_0 '0' -#define RC_1 '1' -#define RC_2 '2' -#define RC_3 '3' -#define RC_4 '4' -#define RC_5 '5' -#define RC_6 '6' -#define RC_7 '7' -#define RC_8 '8' -#define RC_9 '9' - -#define RC_RIGHT 0x0191 -#define RC_LEFT 0x0192 -#define RC_UP 0x0193 -#define RC_DOWN 0x0194 -#define RC_PLUS 0x0195 -#define RC_MINUS 0x0196 - -#define RC_OK 0x0D -#define RC_STANDBY 0x1C -#define RC_ESC RC_HOME - -#define RC_HOME 0x01B1 -#define RC_MUTE 0x01B2 -#define RC_HELP 0x01B3 -#define RC_DBOX 0x01B4 -#define RC_INFO RC_HELP - -#define RC_GREEN 0x01A1 -#define RC_YELLOW 0x01A2 -#define RC_RED 0x01A3 -#define RC_BLUE 0x01A4 - -#define RC_PAUSE RC_HELP -#define RC_ALTGR 0x12 -#define RC_BS 0x7F -#define RC_POS1 RC_HOME -#define RC_END 0x13 -#define RC_INS 0x10 -#define RC_ENTF 0x11 -#define RC_STRG 0x00 -#define RC_LSHIFT 0x0E -#define RC_RSHIFT 0x0E -#define RC_ALT 0x0F -#define RC_NUM RC_DBOX -#define RC_ROLLEN 0x00 -#define RC_F5 RC_DBOX -#define RC_F6 RC_HELP -#define RC_F7 RC_MUTE -#define RC_F8 0x01C8 -#define RC_F9 0x01C9 -#define RC_F10 0x01CA -#define RC_RET 0x0D -#define RC_RET1 0x01CC -#define RC_CAPSLOCK 0x01CD -#define RC_ON 0x01CE - -#define RC_F1 RC_RED -#define RC_F2 RC_GREEN -#define RC_F3 RC_YELLOW -#define RC_F4 RC_BLUE -#define RC_PAGEUP 104 -#define RC_PAGEDOWN 109 - -//framebuffer -enum { FILL, GRID}; -enum { LEFT, CENTER, RIGHT}; -enum { SMALL, NORMAL, BIG}; - -//parser -enum { TRANSP ,BLACK ,RED ,GREEN, - BROWN ,BLUE ,MAGENTA ,CYAN, - GREY ,B_GREY ,B_RED ,B_GREEN, - YELLOW ,B_BLUE ,B_MAGENTA ,B_CYAN, - WHITE ,CMH ,CMHT ,CMC, - CMCT ,ORANGE ,SKIN0 ,SKIN1 -}; - -enum MENU -{ - MENU, - PHONEBOOK, - CALLER_DETAILS, - DIAL, - RECONNECT, - REFRESHCALL, - ADDADR, - RSEARCH, - ADDRESSBOOK -}; - -enum MESSAGE -{ - ERR_CONNECT, - ERR_LOGIN, - INFO, - INFO_ADDADR, - INFO_DIALTEST, - INFO_DIAL, - INFO_PHONEBOOK, - INFO_RSEARCH, - INFO_RECONNECT, - LOAD -}; - -#endif //__globals_h__ diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/icons.cpp b/archive-sources/FritzCallMonitor/FritzInfoMonitor/icons.cpp deleted file mode 100644 index 40aa3ed0..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/icons.cpp +++ /dev/null @@ -1,738 +0,0 @@ - -#include - -#include "icons.h" - -CIcons* CIcons::getInstance() -{ - static CIcons* instance = NULL; - if(!instance) - instance = new CIcons(); - return instance; -} - -CIcons::CIcons() -{ - // -}; - -CIcons::~CIcons() -{ -} - -unsigned char * CIcons::getIcon_ni() -{ - static unsigned char ni[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , - 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , - 0x33 ,0x33 ,0x00 ,0x00 ,0x00 ,0x00 ,0x03 ,0x33 ,0x33 ,0x03 ,0x33 ,0x33 , - 0x03 ,0x33 ,0x30 ,0x00 ,0x00 ,0x00 ,0x00 ,0x33 ,0x33 ,0x03 ,0x33 ,0x30 , - 0x00 ,0x33 ,0x33 ,0x00 ,0x00 ,0x00 ,0x00 ,0x03 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x33 ,0x33 ,0x00 ,0x00 ,0x00 ,0x00 ,0x03 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x33 ,0x33 ,0x30 ,0x00 ,0x00 ,0x00 ,0x03 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x33 ,0x33 ,0x33 ,0x00 ,0x00 ,0x00 ,0x03 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x33 ,0x33 ,0x33 ,0x30 ,0x00 ,0x00 ,0x03 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x33 ,0x33 ,0x33 ,0x33 ,0x00 ,0x00 ,0x03 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x33 ,0x30 ,0x33 ,0x33 ,0x30 ,0x00 ,0x03 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x33 ,0x30 ,0x03 ,0x33 ,0x33 ,0x00 ,0x03 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x33 ,0x30 ,0x00 ,0x33 ,0x33 ,0x30 ,0x03 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x33 ,0x30 ,0x00 ,0x03 ,0x33 ,0x33 ,0x03 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x33 ,0x30 ,0x00 ,0x00 ,0x33 ,0x33 ,0x33 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x33 ,0x30 ,0x00 ,0x00 ,0x03 ,0x33 ,0x33 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x33 ,0x30 ,0x00 ,0x00 ,0x00 ,0x33 ,0x33 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x33 ,0x30 ,0x00 ,0x00 ,0x00 ,0x03 ,0x33 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x33 ,0x30 ,0x00 ,0x00 ,0x00 ,0x00 ,0x33 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x33 ,0x30 ,0x00 ,0x00 ,0x00 ,0x00 ,0x03 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x33 ,0x30 ,0x00 ,0x00 ,0x00 ,0x00 ,0x03 ,0x33 ,0x03 ,0x33 ,0x00 , - 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x33 ,0x00 ,0x00 ,0x00 , - 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , - 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 }; - - return(ni); -} - -unsigned char * CIcons::getIcon_phone1() -{ - /*blue*/ - static unsigned char phone1[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xcc, 0xcc, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, - 0x0c, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x0c, 0xcc, 0x00, 0x00, 0x00, - 0x0c, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0xc0, 0x00, 0x00, 0x00, - 0x0c, 0xcc, 0xcc, 0xcc, 0x00, 0x0c, 0x0c, 0xcc, 0x00, 0x00, 0x00, 0x00, - 0x0c, 0xcc, 0xcc, 0x00, 0x00, 0x0c, 0xcc, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xcc, 0xc0, 0x00, 0x00, 0x0c, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xcc, 0xcc, 0x00, 0x00, 0x0c, 0xcc, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0c, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0c, 0xcc, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0c, 0xcc, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x0c, 0xcc, 0xc0, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x0c, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xcc, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(phone1); -} - -unsigned char * CIcons::getIcon_phone2() -{ - /*red*/ - static unsigned char phone2[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x99, 0x99, 0x90, 0x00, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, 0x00, - 0x09, 0x99, 0x99, 0x99, 0x00, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, 0x00, - 0x09, 0x99, 0x99, 0x99, 0x00, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, 0x00, - 0x09, 0x99, 0x99, 0x99, 0x00, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, 0x00, - 0x09, 0x99, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x99, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x99, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x09, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x09, 0x99, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x09, 0x99, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x99, 0x99, 0x00, 0x09, 0x99, 0x90, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x09, 0x99, 0x99, 0x99, 0x99, 0x99, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x99, 0x99, 0x99, 0x99, 0x99, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0x99, 0x99, 0x99, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x99, 0x99, 0x99, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x99, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(phone2); -} - -unsigned char * CIcons::getIcon_phone3() -{ - /*green*/ - static unsigned char phone3[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xaa, 0xaa, 0xa0, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x00, - 0x0a, 0xaa, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x0a, 0xaa, 0x00, 0x00, 0x00, - 0x0a, 0xaa, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x00, - 0x0a, 0xaa, 0xaa, 0xaa, 0x00, 0x00, 0x0a, 0xaa, 0x0a, 0x00, 0x00, 0x00, - 0x0a, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xaa, 0xa0, 0x00, 0x00, 0x0a, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0a, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0a, 0xaa, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0a, 0xaa, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x0a, 0xaa, 0xa0, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x0a, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xaa, 0xaa, 0xaa, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xaa, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(phone3); -} - -#if 0 -unsigned char * CIcons::getIcon_up() -{ - static unsigned char up[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x08, 0x88, 0x88, 0x88, 0x88, 0xff, 0xff, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x8f, 0xff, 0xff, 0xf8, 0x88, 0x88, 0x88, 0x80, - 0x88, 0x88, 0x88, 0x88, 0xff, 0xff, 0xff, 0xff, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(up); -} - -unsigned char * CIcons::getIcon_down() -{ - static unsigned char down[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0xff, 0xff, 0xff, 0xff, 0x88, 0x88, 0x88, 0x88, - 0x08, 0x88, 0x88, 0x88, 0x8f, 0xff, 0xff, 0xf8, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0xff, 0xff, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(down); -} - -unsigned char * CIcons::getIcon_plus() -{ - static unsigned char plus[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0xff, 0xff, 0xff, 0xff, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0xff, 0xff, 0xff, 0xff, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(plus); -} - -unsigned char * CIcons::getIcon_minus() -{ - static unsigned char minus[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0xff, 0xff, 0xff, 0xff, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0xff, 0xff, 0xff, 0xff, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(minus); -} - -unsigned char * CIcons::getIcon_power_button() -{ - static unsigned char power_button[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x33, 0x33, 0x3f, 0xf3, 0x33, 0x33, 0x30, 0x00, 0x00, - 0x00, 0x00, 0x33, 0x33, 0x33, 0x3f, 0xf3, 0x33, 0x33, 0x33, 0x00, 0x00, - 0x00, 0x33, 0x33, 0x33, 0xf3, 0x3f, 0xf3, 0x3f, 0x33, 0x33, 0x33, 0x00, - 0x03, 0x33, 0x33, 0x3f, 0xf3, 0x3f, 0xf3, 0x3f, 0xf3, 0x33, 0x33, 0x30, - 0x03, 0x33, 0x33, 0xff, 0xf3, 0x3f, 0xf3, 0x3f, 0xff, 0x33, 0x33, 0x30, - 0x33, 0x33, 0x3f, 0xff, 0x33, 0x33, 0x33, 0x33, 0xff, 0xf3, 0x33, 0x33, - 0x33, 0x33, 0x3f, 0xf3, 0x33, 0x33, 0x33, 0x33, 0x3f, 0xf3, 0x33, 0x33, - 0x33, 0x33, 0x3f, 0xf3, 0x33, 0x33, 0x33, 0x33, 0x3f, 0xf3, 0x33, 0x33, - 0x33, 0x33, 0x3f, 0xf3, 0x33, 0x33, 0x33, 0x33, 0x3f, 0xf3, 0x33, 0x33, - 0x33, 0x33, 0x3f, 0xf3, 0x33, 0x33, 0x33, 0x33, 0x3f, 0xf3, 0x33, 0x33, - 0x33, 0x33, 0x3f, 0xff, 0x33, 0x33, 0x33, 0x33, 0xff, 0xf3, 0x33, 0x33, - 0x03, 0x33, 0x33, 0xff, 0xf3, 0x33, 0x33, 0x3f, 0xff, 0x33, 0x33, 0x30, - 0x03, 0x33, 0x33, 0x3f, 0xff, 0x33, 0x33, 0xff, 0xf3, 0x33, 0x33, 0x30, - 0x00, 0x33, 0x33, 0x33, 0xff, 0xff, 0xff, 0xff, 0x33, 0x33, 0x33, 0x00, - 0x00, 0x00, 0x33, 0x33, 0x3f, 0xff, 0xff, 0xf3, 0x33, 0x33, 0x00, 0x00, - 0x00, 0x00, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(power_button); -} -#endif - -unsigned char * CIcons::getIcon_help() -{ - static unsigned char help[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x08, 0x88, 0x88, 0x88, 0x88, 0xff, 0xff, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x80, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0xff, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(help); -} -#if 0 -unsigned char * CIcons::getIcon_info() -{ - static unsigned char info[]={ - 0x18, 0x00, 0x18, 0x00, 0x0d, - 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0x8d, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xd0, 0x08, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0x0f, 0xb0, 0x8d, 0xdd, 0xdd, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0xdd, 0xd0, 0xfb, 0xfb, 0x08, 0xdd, 0xdd, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0xdd, 0x0f, 0xbf, 0xbf, 0xb0, 0x8d, 0xdd, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0xd0, 0xfb, 0xfb, 0xfb, 0xfb, 0x08, 0xdd, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0x0f, 0xbf, 0x44, 0x44, 0xbf, 0xb0, 0x8d, 0xdd, 0xdd, - 0xdd, 0xdd, 0xd0, 0xfb, 0xfb, 0x44, 0x44, 0xfb, 0xf7, 0x08, 0xdd, 0xdd, - 0xdd, 0xdd, 0x0f, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xb0, 0x8d, 0xdd, - 0xdd, 0xd0, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0x08, 0xdd, - 0xdd, 0x0f, 0xbf, 0xbf, 0xbf, 0x44, 0x44, 0xbf, 0xbf, 0xbf, 0xb0, 0x8d, - 0xd0, 0xfb, 0xfb, 0xfb, 0xfb, 0x44, 0x44, 0xfb, 0xfb, 0xfb, 0xfb, 0x08, - 0xd8, 0x0f, 0xbf, 0xbf, 0xbf, 0x44, 0x44, 0xbf, 0xbf, 0xbf, 0xb0, 0x8d, - 0xdd, 0x80, 0xfb, 0xfb, 0xfb, 0x44, 0x44, 0xfb, 0xfb, 0xfb, 0x08, 0xdd, - 0xdd, 0xd8, 0x0f, 0xbf, 0xbf, 0x44, 0x44, 0xbf, 0xbf, 0xb0, 0x8d, 0xdd, - 0xdd, 0xdd, 0x80, 0xfb, 0xfb, 0x44, 0x44, 0xfb, 0xfb, 0x08, 0xdd, 0xdd, - 0xdd, 0xdd, 0xd8, 0x0f, 0xbf, 0x44, 0x44, 0xbf, 0xb0, 0x8d, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0x80, 0xfb, 0xfb, 0xfb, 0xfb, 0x08, 0xdd, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0xd8, 0x0f, 0xbf, 0xbf, 0xb0, 0x8d, 0xdd, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0xdd, 0x80, 0xfb, 0xfb, 0x08, 0xdd, 0xdd, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0xdd, 0xd8, 0x0f, 0xb0, 0x8d, 0xdd, 0xdd, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0x80, 0x08, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xd8, 0x8d, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd }; - - return(info); -} - -unsigned char * CIcons::getIcon_mute_small() -{ - static unsigned char mute_small[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0xf8, 0x88, 0x88, 0x88, 0x00, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0xf8, 0xf8, 0xf8, 0x88, 0xf8, 0x88, 0x80, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0x88, 0xf8, 0x8f, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0xff, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0xff, 0xf8, 0xf8, 0x8f, 0xff, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0xff, 0xf8, 0xf8, 0x88, 0xf8, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0xff, 0xf8, 0xf8, 0x8f, 0xff, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0xff, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0x88, 0x88, 0x88, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x8f, 0x88, 0xf8, 0x8f, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0xf8, 0xf8, 0xf8, 0x88, 0xf8, 0x88, 0x80, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0xf8, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(mute_small); -} -#endif - -unsigned char * CIcons::getIcon_left() -{ - static unsigned char left[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x08, 0x88, 0x88, 0x88, 0x88, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x88, 0x88, 0x88, 0x88, 0xff, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x8f, 0xff, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0xff, 0xff, 0xff, 0xff, 0xff, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0xff, 0xff, 0xff, 0xff, 0xff, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x8f, 0xff, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0xff, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x08, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(left); -} - -unsigned char * CIcons::getIcon_right() -{ - static unsigned char right[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x80, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xff, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xff, 0xf8, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0xff, 0xff, 0xff, 0xff, 0xff, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0xff, 0xff, 0xff, 0xff, 0xff, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xff, 0xf8, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xff, 0x88, 0x88, 0x88, 0x88, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(right); -} - -#if 0 -unsigned char * CIcons::getIcon_lock() -{ - static unsigned char lock[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xbb, 0xbb, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0b, 0xbb, 0xbb, 0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0b, 0xbb, 0xbb, 0xbb, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x00, - 0xbb, 0x00, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xb0, - 0xbb, 0x00, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xb0, - 0xbb, 0x00, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x00, - 0xbb, 0xbb, 0xbb, 0xbb, 0xb0, 0xbb, 0xb0, 0x00, 0xbb, 0xb0, 0xb0, 0x00, - 0x0b, 0xbb, 0xbb, 0xbb, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0b, 0xbb, 0xbb, 0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xbb, 0xbb, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(lock); -} - -unsigned char * CIcons::getIcon_dbox() -{ - static unsigned char dbox[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0xf8, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x88, 0x88, 0x88, 0xf8, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0xff, 0xf8, 0xff, 0xf8, 0x88, 0xff, 0x88, 0xf8, 0xf8, 0x88, - 0x88, 0x8f, 0x88, 0xf8, 0xf8, 0x8f, 0x8f, 0x88, 0xf8, 0x8f, 0x88, 0x88, - 0x88, 0x8f, 0x88, 0xf8, 0xf8, 0x8f, 0x8f, 0x88, 0xf8, 0x8f, 0x88, 0x88, - 0x88, 0x88, 0xff, 0xf8, 0xff, 0xf8, 0x88, 0xff, 0x88, 0xf8, 0xf8, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(dbox); -} - -unsigned char * CIcons::getIcon_lame() -{ - static unsigned char lame[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x10, 0x00, 0x00, - 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, - 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, - 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x10, - 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x10, - 0x11, 0xf1, 0x11, 0x11, 0xff, 0xf1, 0xf1, 0x11, 0xf1, 0xff, 0xff, 0x11, - 0x11, 0xf1, 0x11, 0x1f, 0x11, 0xf1, 0xff, 0x1f, 0xf1, 0xf1, 0x11, 0x11, - 0x11, 0xf1, 0x11, 0x1f, 0x11, 0xf1, 0xf1, 0xf1, 0xf1, 0xff, 0xf1, 0x11, - 0x11, 0xf1, 0x11, 0x1f, 0xff, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0x11, 0x11, - 0x11, 0xf1, 0x11, 0x1f, 0x11, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0x11, 0x11, - 0x11, 0xff, 0xff, 0x1f, 0x11, 0xf1, 0xf1, 0xf1, 0xf1, 0xff, 0xff, 0x11, - 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x10, - 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x10, - 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, - 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x10, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(lame); -} -#endif - -unsigned char * CIcons::getIcon_ok() -{ - static unsigned char ok[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0xff, 0xff, 0xf8, 0x8f, 0xf8, 0x8f, 0xf8, 0x88, 0x80, - 0x88, 0x88, 0x8f, 0xf8, 0x88, 0xff, 0x8f, 0xf8, 0xff, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x8f, 0xf8, 0x88, 0xff, 0x8f, 0xff, 0xf8, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x8f, 0xf8, 0x88, 0xff, 0x8f, 0xff, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x8f, 0xf8, 0x88, 0xff, 0x8f, 0xff, 0xf8, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x8f, 0xf8, 0x88, 0xff, 0x8f, 0xf8, 0xff, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0xff, 0xff, 0xf8, 0x8f, 0xf8, 0x8f, 0xf8, 0x88, 0x88, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(ok); -} -#if 0 -unsigned char * CIcons::getIcon_home() -{ - static unsigned char home[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x88, 0x8f, 0x88, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x8f, 0x88, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x8f, 0xff, 0xf8, 0x8f, 0xf8, 0x8f, 0xff, 0xf8, 0x88, 0xf8, 0x88, - 0x88, 0x8f, 0x88, 0xf8, 0xf8, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x88, - 0x88, 0x8f, 0x88, 0xf8, 0xf8, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x88, 0x88, - 0x88, 0x8f, 0x88, 0xf8, 0x8f, 0xf8, 0x8f, 0x8f, 0x8f, 0x88, 0xff, 0x88, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(home); -} -#endif - -unsigned char * CIcons::getIcon_1() -{ - static unsigned char nr1[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x0f, 0xf8, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0xff, 0xf8, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x0f, 0xff, 0xf8, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x0f, 0xf8, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x0f, 0xf8, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x0f, 0xf8, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x0f, 0xf8, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x0f, 0xf8, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x0f, 0xf8, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x0f, 0xf8, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(nr1); -} - -#if 0 -unsigned char * CIcons::getIcon_2() -{ - static unsigned char nr2[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x08, 0x88, 0x88, 0x88, 0x8f, 0xff, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xff, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0xff, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0xff, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0xff, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0xff, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x08, 0x88, 0x88, 0x88, 0x8f, 0xff, 0xff, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x8f, 0xff, 0xff, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(nr2); -} - -unsigned char * CIcons::getIcon_3() -{ - static unsigned char nr3[]={ - 0x18, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x08, 0x88, 0x88, 0x88, 0x88, 0xff, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x8f, 0xff, 0xff, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0xff, 0xf8, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xff, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xff, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f, 0xf8, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0xff, 0xf8, 0x88, 0x88, 0x88, 0x88, - 0x08, 0x88, 0x88, 0x88, 0x8f, 0xff, 0xff, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x08, 0x88, 0x88, 0x88, 0x88, 0xff, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x80, - 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, - 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - return(nr3); -} -#endif - - diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/icons.h b/archive-sources/FritzCallMonitor/FritzInfoMonitor/icons.h deleted file mode 100644 index 7fc569bc..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/icons.h +++ /dev/null @@ -1,41 +0,0 @@ - -#ifndef __icons_h__ -#define __icons_h__ - -#ifdef HAVE_CONFIG_H -#include -#endif - -class CIcons -{ - public: - CIcons(); - ~CIcons(); - static CIcons* getInstance(); - - unsigned char * getIcon_ni(); - unsigned char * getIcon_phone1(); - unsigned char * getIcon_phone2(); - unsigned char * getIcon_phone3(); - //unsigned char * getIcon_up(); - //unsigned char * getIcon_down(); - //unsigned char * getIcon_plus(); - //unsigned char * getIcon_minus(); - //unsigned char * getIcon_power_button(); - unsigned char * getIcon_help(); - //unsigned char * getIcon_info(); - //unsigned char * getIcon_mute_small(); - unsigned char * getIcon_left(); - unsigned char * getIcon_right(); - //unsigned char * getIcon_lock(); - //unsigned char * getIcon_dbox(); - //unsigned char * getIcon_lame(); - unsigned char * getIcon_ok(); - //unsigned char * getIcon_home(); - unsigned char * getIcon_1(); - //unsigned char * getIcon_2(); - //unsigned char * getIcon_3(); - private: -}; - -#endif// __icons_h__ diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/parser.cpp b/archive-sources/FritzCallMonitor/FritzInfoMonitor/parser.cpp deleted file mode 100644 index e16b82d0..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/parser.cpp +++ /dev/null @@ -1,379 +0,0 @@ - -#include -#include - -#include -#include -#include - -#include "globals.h" -#include "parser.h" - -CParser* CParser::getInstance() -{ - static CParser* instance = NULL; - if(!instance) - instance = new CParser(); - return instance; -} - -CParser::CParser() -{ - FritzPort = 1012; - FritzWebPort = 80; - SearchPort = 80; - debug = 1; - - strcpy(FritzAdr , "fritz.box"); - strcpy(SearchAdr , "www.goyellow.de"); - //strcpy(ddns_domain , "keine Information gefunden"); - strcpy(addressbook , "/var/tuxbox/config/FritzCallMonitor.addr"); - - struct_dialport dialport_t[MAXDAILPORTS] = - { - {"Fon 1", 1 }, - {"Fon 2", 2 }, - {"Fon 3", 3 }, - {"ISDN & DECT", 50 }, - {"ISDN 1", 51 }, - {"ISDN 2", 52 }, - {"DECT 1", 610 }, - {"DECT 2", 611 } - }; - memcpy(dialport, &dialport_t, sizeof(dialport_t)); - - ddns_domain ="keine Information gefunden"; - nspver = ""; -} - -CParser::~CParser() -{ - // -} - -int CParser::ReadConfig(const char *fname) -{ - FILE *fd_conf; - char *ptr; - char *line_buffer; - ssize_t read; - size_t len; - char tmp[6]; - - line_buffer=NULL; - if((fd_conf = fopen(fname, "r"))) - { - while ((read = getline(&line_buffer, &len, fd_conf)) != -1) - { - if (line_buffer[0] == '#') - continue; - - if ((ptr = strstr(line_buffer, "FRITZBOXIP="))) - sscanf(ptr + 11, "%63s", (char *) &FritzAdr); - else if ((ptr = strstr(line_buffer, "PORT="))) - sscanf(ptr + 5, "%i", &FritzPort); - else if ((ptr = strstr(line_buffer, "DEBUG="))) - sscanf(ptr + 6, "%i", &debug); - else if ((ptr = strstr(line_buffer, "ADDRESSBOOK="))) - sscanf(ptr + 12, "%127s", (char *) &addressbook); - else if ((ptr = strstr(line_buffer, "PASSWD="))) - sscanf(ptr + 7, "%63s", (char *) &FritzPW); - else if ((ptr = strstr(line_buffer, "CITYPREFIX="))) - sscanf(ptr + 11, "%9s", (char *) &cityprefix); - else if ((ptr = strstr(line_buffer, "DIALPREFIX="))) - sscanf(ptr + 11, "%19s", (char *) &dialprefix); - else if ((ptr = strstr(line_buffer, "PORT_1="))) { - sscanf(ptr + 7, "%[^,],%s", (char *) &dialport[0].port_name, (char *) &tmp); - dialport[0].port = atoi(tmp); - } - else if ((ptr = strstr(line_buffer, "PORT_2="))) { - sscanf(ptr + 7, "%[^,],%29s", (char *) &dialport[1].port_name, (char *) &tmp); - dialport[1].port = atoi(tmp); - } - else if ((ptr = strstr(line_buffer, "PORT_3="))) { - sscanf(ptr + 7, "%[^,],%29s", (char *) &dialport[2].port_name, (char *) &tmp); - dialport[2].port = atoi(tmp); - } - else if ((ptr = strstr(line_buffer, "PORT_4="))) { - sscanf(ptr + 7, "%[^,],%29s", (char *) &dialport[3].port_name, (char *) &tmp); - dialport[3].port = atoi(tmp); - } - else if ((ptr = strstr(line_buffer, "PORT_5="))) { - sscanf(ptr + 7, "%[^,],%s", (char *) &dialport[4].port_name, (char *) &tmp); - dialport[4].port = atoi(tmp); - } - else if ((ptr = strstr(line_buffer, "PORT_6="))) { - sscanf(ptr + 7, "%[^,],%29s", (char *) &dialport[5].port_name, (char *) &tmp); - dialport[5].port = atoi(tmp); - } - else if ((ptr = strstr(line_buffer, "PORT_7="))) { - sscanf(ptr + 7, "%[^,],%29s", (char *) &dialport[6].port_name, (char *) &tmp); - dialport[6].port = atoi(tmp); - } - else if ((ptr = strstr(line_buffer, "PORT_8="))) { - sscanf(ptr + 7, "%[^,],%29s", (char *) &dialport[7].port_name, (char *) &tmp); - dialport[7].port = atoi(tmp); - } - else if ((ptr = strstr(line_buffer, "CALLERLIST_STR="))) { - sscanf(ptr + 15, "%127s", (char *) &liststr); - } - else if ((ptr = strstr(line_buffer, "CALLERLIST_FILE="))) { - sscanf(ptr + 16, "%127s", (char *) &listfile); - } - } - fclose(fd_conf); - if(line_buffer) - free(line_buffer); - } - else - { - printf("[%s] - ERROR open %s\n", BASENAME,fname); - return 1; - } - - return 0; -} - -void CParser::read_neutrino_osd_conf(int *ex,int *sx,int *ey, int *sy, const char *filename) -{ - const char spres[][4]={"","crt","lcd"}; - char sstr[4][32]; - int pres=-1, resolution=-1, loop, *sptr[4]={ex, sx, ey, sy}; - char *buffer; - size_t len; - ssize_t read; - FILE* fd; - - fd = fopen(filename, "r"); - if(fd){ - buffer=NULL; - len = 0; - while ((read = getline(&buffer, &len, fd)) != -1){ - sscanf(buffer, "screen_preset=%d", &pres); - sscanf(buffer, "osd_resolution=%d", &resolution); - } - if(buffer) - free(buffer); - rewind(fd); - ++pres; - sprintf(sstr[0], "screen_EndX_%s_%d=%%d", spres[pres], resolution); - sprintf(sstr[1], "screen_StartX_%s_%d=%%d", spres[pres], resolution); - sprintf(sstr[2], "screen_EndY_%s_%d=%%d", spres[pres], resolution); - sprintf(sstr[3], "screen_StartY_%s_%d=%%d", spres[pres], resolution); - - buffer=NULL; - len = 0; - while ((read = getline(&buffer, &len, fd)) != -1){ - for(loop=0; loop<4; loop++) { - sscanf(buffer, sstr[loop], sptr[loop]); - } - } - fclose(fd); - if(buffer) - free(buffer); - } -} - -unsigned short CParser::Percentconverter (unsigned short percent) -{ - return(2.55*percent); -} - -int CParser::ReadColors (const char *filename) -{ - FILE *fh; - char *ptr; - char *line_buffer; - ssize_t read; - size_t len; - - - if (!(fh=fopen(filename, "r"))) - { - perror("neutrino.conf"); - return(1); - } - - line_buffer=NULL; - while ((read = getline(&line_buffer, &len, fh)) != -1) - { - if ((ptr = strstr(line_buffer, "menu_Head_alpha="))) - sscanf(ptr+16, "%hu", &cmh[mALPHA]); - else if ((ptr = strstr(line_buffer, "menu_Head_blue="))) - sscanf(ptr+15, "%hu", &cmh[mBLUE]); - else if ((ptr = strstr(line_buffer, "menu_Head_green="))) - sscanf(ptr+16, "%hu", &cmh[mGREEN]); - else if ((ptr = strstr(line_buffer, "menu_Head_red="))) - sscanf(ptr+14, "%hu", &cmh[mRED]); - else if ((ptr = strstr(line_buffer, "menu_Head_Text_alpha="))) - sscanf(ptr+21, "%hu", &cmht[mALPHA]); - else if ((ptr = strstr(line_buffer, "menu_Head_Text_blue="))) - sscanf(ptr+20, "%hu", &cmht[mBLUE]); - else if ((ptr = strstr(line_buffer, "menu_Head_Text_green="))) - sscanf(ptr+21, "%hu", &cmht[mGREEN]); - else if ((ptr = strstr(line_buffer, "menu_Head_Text_red="))) - sscanf(ptr+19, "%hu", &cmht[mRED]); - else if ((ptr = strstr(line_buffer, "menu_Content_alpha="))) - sscanf(ptr+19, "%hu", &cmc[mALPHA]); - else if ((ptr = strstr(line_buffer, "menu_Content_blue="))) - sscanf(ptr+18, "%hu", &cmc[mBLUE]); - else if ((ptr = strstr(line_buffer, "menu_Content_green="))) - sscanf(ptr+19, "%hu", &cmc[mGREEN]); - else if ((ptr = strstr(line_buffer, "menu_Content_red="))) - sscanf(ptr+17, "%hu", &cmc[mRED]); - else if ((ptr = strstr(line_buffer, "menu_Content_Text_alpha="))) - sscanf(ptr+24, "%hu", &cmct[mALPHA]); - else if ((ptr = strstr(line_buffer, "menu_Content_Text_blue="))) - sscanf(ptr+23, "%hu", &cmct[mBLUE]); - else if ((ptr = strstr(line_buffer, "menu_Content_Text_green="))) - sscanf(ptr+24, "%hu", &cmct[mGREEN]); - else if ((ptr = strstr(line_buffer, "menu_Content_Text_red="))) - sscanf(ptr+22, "%hu", &cmct[mRED]); - } - - fclose(fh); - if(line_buffer) - free(line_buffer); - - unsigned char bgra_t[][5] = { - "\x00\x00\x00\x00","\x00\x00\x00\xFF","\x00\x00\x80\xFF","\x00\x80\x00\xFF", - "\x00\x48\xA0\xFF","\x80\x00\x00\xFF","\x80\x00\x80\xFF","\x80\x80\x00\xFF", - "\xA0\xA0\xA0\xFF","\x50\x50\x50\xFF","\x00\x00\xFF\xFF","\x00\xFF\x00\xFF", - "\x00\xFF\xFF\xFF","\xFF\x00\x00\xFF","\xFF\x00\xFF\xFF","\xFF\xFF\x00\xFF", - "\xFF\xFF\xFF\xFF","\xFF\x80\x00\xF0","\x80\x00\x00\xF0","\xFF\x80\x00\xFF", - "\x40\x20\x00\xFF","\x00\xC0\xFF\xFF","\x0C\x0C\x0C\xF7","\x30\x30\x30\xF7" - }; - - bgra_t[CMH][mRED] = Percentconverter(cmh[mRED]); - bgra_t[CMH][mGREEN] = Percentconverter(cmh[mGREEN]); - bgra_t[CMH][mBLUE] = Percentconverter(cmh[mBLUE]); - bgra_t[CMH][mALPHA] = (255-Percentconverter(cmh[mALPHA])); - - bgra_t[CMHT][mRED] = Percentconverter(cmht[mRED]); - bgra_t[CMHT][mGREEN] = Percentconverter(cmht[mGREEN]); - bgra_t[CMHT][mBLUE] = Percentconverter(cmht[mBLUE]); - bgra_t[CMHT][mALPHA] = (255-Percentconverter(cmht[mALPHA])); - - bgra_t[CMC][mRED] = Percentconverter(cmc[mRED]); - bgra_t[CMC][mGREEN] = Percentconverter(cmc[mGREEN]); - bgra_t[CMC][mBLUE] = Percentconverter(cmc[mBLUE]); - bgra_t[CMC][mALPHA] = 255-Percentconverter(cmc[mALPHA]); - - bgra_t[CMCT][mRED] = Percentconverter(cmct[mRED]); - bgra_t[CMCT][mGREEN] = Percentconverter(cmct[mGREEN]); - bgra_t[CMCT][mBLUE] = Percentconverter(cmct[mBLUE]); - bgra_t[CMCT][mALPHA] = (255-Percentconverter(cmct[mALPHA])); - - const int sz = sizeof(bgra)/sizeof(**bgra); - copy(*bgra_t, (*bgra_t) + sz, *bgra); - - return(0); -} -#if 0 -/****************************************************************************** - * local addressbook functions - ******************************************************************************/ -#endif -int CParser::search_AddrBook(const char *caller) -{ - FILE *fd; - char *line_buffer; - string search_str; - ssize_t ptr; - size_t len; - int i=0; - - if(strlen(caller)!=0){ - search_str = (string) caller + "|"; - } else { - return(0); - } - - if(!(fd = fopen(addressbook, "r"))) { - perror(addressbook); - return(0); - } - else - { - line_buffer=NULL; - while ((ptr = getline(&line_buffer, &len, fd)) != -1) - { - i++; - if (strstr(line_buffer, search_str.c_str())) - { - sscanf(line_buffer,"%*[^|]|%255[^|]|%127[^|]|%5[^|]|%127[^|]", - (char *) &address.name, - (char *) &address.street, - (char *) &address.code, - (char *) &address.locality); - if (debug) - printf("[%s] - \"%s\" found [%d]\n", BASENAME, caller, i); - fclose(fd); - if(line_buffer) - free(line_buffer); - return(1); - } - } - if (debug) - printf("[%s] - \"%s\" not found in %s\n", BASENAME, caller, addressbook); - - fclose(fd); - if(line_buffer) - free(line_buffer); - } - return(0); -} - -int CParser::add_AddrBook(const char *caller) -{ - ofstream os(addressbook, ios::out | ios::app); - - if (os.is_open()) - { - os << caller << '|' - << address.name << '|' - << address.street << '|' - << address.code << '|' - << address.locality << '|' << endl; - os.close(); - } - else - { - return(0); - } - - return(1); -} - -void CParser::init_caller() -{ - memset(&caller, 0, sizeof(caller)); -} - -void CParser::init_address() -{ - memset(&address, 0, sizeof(address)); -} - -string CParser::parseString(const char* var, string& string_to_serarch) -{ - string res=""; - size_t pos1, pos2; - - if((pos1 = string_to_serarch.find(var)) != string::npos) - { - // "ver":"84.05.50" - pos1 += strlen(var)+3; - string tmp = string_to_serarch.substr(pos1); - - if((pos2 = tmp.find('"')) != string::npos) - { - res = tmp.substr(0,pos2); - //cout << " result: " << var << " = " << res << endl; - } - } - else - cout << '[' << BASENAME << "] - " << __FUNCTION__ << "(): no result for " << '"' << var << '"' << endl; - - return(res); -} diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/parser.h b/archive-sources/FritzCallMonitor/FritzInfoMonitor/parser.h deleted file mode 100644 index 507e585d..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/parser.h +++ /dev/null @@ -1,122 +0,0 @@ - -#ifndef __parser_h__ -#define __parser_h__ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -using namespace std; - -class CParser -{ - public: - CParser(); - virtual~CParser(); - static CParser* getInstance(); - - int ReadConfig(const char *fname); - unsigned short Percentconverter (unsigned short percent); - void read_neutrino_osd_conf(int *ex,int *sx,int *ey, int *sy, const char *filename); - int ReadColors (const char *filename); - int search_AddrBook(const char *caller); - int add_AddrBook(const char *caller); - void init_caller(); - void init_address(); - string parseString(const char* var, std::string& string_to_serarch); - - unsigned char bgra[24][5]; - - typedef struct { - char number[64]; - char name[256]; - char street[128]; - char code[6]; - char locality[128]; - } S_ADDRESS; - S_ADDRESS address; - -#define MAXCALLER 12 - typedef struct { - char call_type[2]; - char call_date[20]; - char call_name[256]; - char call_numr[64]; - char call_time[6]; - char port_rout[20]; - char port_name[30]; - } S_CALLER; - S_CALLER caller[MAXCALLER]; - -#define MAXDAILPORTS 8 - typedef struct s_dialport { - char port_name[30]; - int port; - } struct_dialport; - struct_dialport dialport[MAXDAILPORTS]; - - virtual void setTam0_active(const std::string& Tam0_active){tam0_active = Tam0_active;}; - virtual void setTam0_NumNewMessages(const std::string& Tam0_NumNewMessages){tam0_NumNewMessages = Tam0_NumNewMessages;}; - virtual void setDdns_state(const std::string& Ddns_state){ddns_state = Ddns_state;}; - virtual void setDdns_domain(const std::string& Ddns_domain){ddns_domain = Ddns_domain;}; - virtual void setNspver(const std::string& Nspver){nspver = Nspver;}; - virtual void setSip0Nr(const std::string& Sip0Nr){sip0nr = Sip0Nr;}; - virtual void setSip1Nr(const std::string& Sip1Nr){sip1nr = Sip1Nr;}; - virtual void setPppoe_ip(const std::string& Pppoe_ip){pppoe_ip = Pppoe_ip;}; - - virtual string getTam0_active(){return tam0_active;}; - virtual string getTam0_NumNewMessages(){return tam0_NumNewMessages;}; - virtual string getDdns_state(){return ddns_state;}; - virtual string getDdns_domain(){return ddns_domain;}; - virtual string getNspver(){return nspver;}; - virtual string getSip0Nr(){return sip0nr;}; - virtual string getSip1Nr(){return sip1nr;}; - virtual string getPppoe_ip(){return pppoe_ip;}; - - virtual int getDebug(){return debug;}; - virtual int getFritzPort(){return FritzWebPort;}; - virtual int getSearchPort(){return SearchPort;}; - virtual const char* getFritzAdr(){return FritzAdr;}; - virtual const char* getFritzPW(){return FritzPW;}; - virtual const char* getSearchAdr(){return SearchAdr;}; - virtual const char* getCityprefix(){return cityprefix;}; - virtual const char* getDialprefix(){return dialprefix;}; - virtual const char* getListfile(){return listfile;}; - virtual const char* getListstr(){return liststr;}; - virtual const char* getAddressbook(){return addressbook;}; - - //virtual void setNspver(const char* nspver); - //virtual const char* getNspver(){return nspver;}; - - protected: - string tam0_active; - string tam0_NumNewMessages; - string ddns_state; - string ddns_domain; - string nspver; - string sip0nr; - string sip1nr; - string pppoe_ip; - - int debug; - int FritzPort, FritzWebPort,SearchPort; - char FritzAdr[64]; - char FritzPW[64]; - char SearchAdr[20]; - char cityprefix[10]; - char dialprefix[20]; - char listfile[128]; - char liststr[128]; - char addressbook[128]; - - enum {mBLUE, mGREEN, mRED, mALPHA}; - unsigned short cmh[4]; // Titelzeile - menu_Head(SKIN0) - unsigned short cmht[4]; // Titeltextfarbe - menu_Head_Text(ORANGE) - unsigned short cmc[4]; // Hintergrundfarbe - menu_Content(SKIN1) - unsigned short cmct[4]; // Body Textfarbe - menu_Content_Text(WHITE) -}; - -#endif //__parser_h__ diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/phonebook.cpp b/archive-sources/FritzCallMonitor/FritzInfoMonitor/phonebook.cpp deleted file mode 100644 index 00295b09..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/phonebook.cpp +++ /dev/null @@ -1,367 +0,0 @@ - -#include -#include -#include - -#include -#include - -#include "parser.h" -#include "connect.h" -#include "framebuffer.h" -#include "rc.h" -#include "submenu.h" -#include "globals.h" - -#include "phonebook.h" - - - -const char *liste[] = {"AZ","AB","CD","EF","GH","IJK","LM","NO","PQR","STU","VWXYZ"}; - -// create outstream operator -ostream& operator<< (ostream& out, const CPhoneBook::S_ADDRESS& d) -{ - return out << d.number << ',' << d.name << ',' << d.street << ',' - << d.code << ',' << d.locality << ','; -} - -void CPhoneBook::toUpper(string& s) -{ - for(string::iterator p = s.begin(); p != s.end();++p) - *p = toupper(*p) ; -} - -bool CPhoneBook::sortByKey(const S_ADDRESS& a, const S_ADDRESS& b) -{ - string na = a.name; - string nb = b.name; - - toUpper(na) ; - toUpper(nb) ; - - return na < nb; -} - - -CPhoneBook* CPhoneBook::getInstance() -{ - static CPhoneBook* instance = NULL; - if(!instance) - instance = new CPhoneBook(); - return instance; -} - -CPhoneBook::CPhoneBook() -{ - cconnect = CConnect::getInstance(); - cpars = CParser::getInstance(); - cfb = Cfb::getInstance(); - crc = Crc::getInstance(); - - selList = 0; - selData = -1; - lastData= 0; - perpage = 0; -} - -CPhoneBook::~CPhoneBook() -{ - -} - -void CPhoneBook::run() -{ - // Get data - getData(CParser::getInstance()->getAddressbook(), liste[selList]); - - menu(); - - unsigned short rccode; - - do - { - switch((rccode = crc->getrc())) - { - case RC_RIGHT: - selList++; - if(selList > ((int)(sizeof(liste)/sizeof(liste[0])))-1) { - selList = 0; - } - selData=-1; - getData(CParser::getInstance()->getAddressbook(), liste[selList]); - menu(); - break; - case RC_LEFT: - selList--; - if(selList < 0) { - selList = ((int)(sizeof(liste)/sizeof(liste[0])))-1; - } - selData=-1; - getData(CParser::getInstance()->getAddressbook(), liste[selList]); - menu(); - break; - case RC_DOWN: - selData++; - if(selData >= (int)content.size()) { - selData = 0; - } - menu(); - break; - case RC_UP: - selData--; - if(selData < -1) { - selData = (int)content.size()-1; - } - menu(); - break; - case RC_OK: - if(selData != -1) { - dialMenu(); - rccode=RC_HOME; - } - break; - case RC_PAGEDOWN: - selData += (selData == -1 ? perpage+1 : perpage); - selData = (selData / perpage) * perpage; // select first item on the site - if(selData >= (int)content.size()) { - selData = -1; - } - menu(); - break; - case RC_PAGEUP: - selData -= perpage; - selData = (selData / perpage) * perpage; // select first item on the site - if(selData < -1) { - selData = (int)content.size()-1; - } - menu(); - break; - } - } - while(rccode != RC_HOME); -} - -void CPhoneBook::menu() -{ - int ex, sx, ey, sy; - cfb->getDimensions(&ex, &sx, &ey, &sy); - int vyres = cfb->getYScreeninfo(); - - int bspace = 40; - int lrspace = 30; - int xwidth = ex-sx-bspace; - int yheight = ey-sy-bspace; - int ld = vyres < 600 ? 25 : 28; //line distance - int slim = ex-sx < 1100 ? 1:0; - int vsx = bspace + lrspace; - int vsy = 80; - - ostringstream txt; - - int sp1 = vsx; - int le1 = slim?180:250; //name - int sp2 = sp1+le1+18; - int le2 = 180; //number - int sp3 = sp2+le2+18; - int le3 = slim?130:250; //street - int sp4 = sp3+le3+18; - int le4 = 70; //code - int sp5 = sp4+le4+18; - int le5 = 180; //locality - - int hvsp = 0; - int hle = 30; - int hitm = (int)(sizeof(liste)/sizeof(liste[0])); - int hsp = (xwidth-(2*lrspace)-(2*hle)) / (hitm-1); - - // Grafic - cfb->RenderBox(bspace, 0, xwidth, yheight, FILL, CMC); - cfb->RenderBox(bspace, 0, xwidth, 40, FILL, CMH); - //cfb->PaintIcon(icon_ng,((xwidth+bspace)/2)-(120/2)-35,8); - cfb->RenderString("Adressbuch", ((xwidth+bspace)/2)-(130/2) ,30, 130, CENTER, BIG, CMHT); - - // Body headline - for (int i=0; i < hitm; i++) - { - txt.str(""); - - if(selList == i) - cfb->RenderBox(vsx-3+hvsp, vsy-20, vsx-3+hvsp+hle, vsy+3, selData == -1?FILL:GRID, CMHT); - - txt << liste[i][0] << '-' << liste[i][strlen(liste[i])-1]; - cfb->RenderString(txt.str().c_str(), vsx+hvsp ,vsy, hle, LEFT, SMALL, (selList == i && selData == -1)?CMC:GREY); - - hvsp += hsp; - } - - // Body data - vsy += ld+10; - - int start = 0; - if(perpage) { - start = (selData / perpage) * perpage; - } - - for (int i = start; i < (int)content.size() ; i++) - { - if(i == selData) - cfb->RenderBox(bspace, vsy-ld+3, xwidth, vsy+3, FILL, CMHT); - - cfb->RenderString(cconnect->UTF8toISO((char *)content[i].name.c_str()), - sp1, vsy, le1, LEFT, NORMAL, selData==i?CMC:CMCT); - - cfb->RenderString(content[i].number.c_str(), - sp2, vsy, le2, LEFT, NORMAL, selData==i?CMC:CMCT); - - cfb->RenderString(cconnect->UTF8toISO((char *)content[i].street.c_str()), - sp3, vsy, le3, LEFT, NORMAL, selData==i?CMC:CMCT); - - if(xwidth > (sp4+le4)) - cfb->RenderString(content[i].code.c_str(), - sp4, vsy, le4, LEFT, NORMAL, selData==i?CMC:CMCT); - - if(xwidth > (sp5+le5)) - cfb->RenderString(cconnect->UTF8toISO((char *)content[i].locality.c_str()), - sp5, vsy, le5, LEFT, NORMAL, selData==i?CMC:CMCT); - vsy += ld; - - if(vsy >= yheight-ld) - { - //cfb->RenderString("----", sp1, vsy, le1, LEFT, NORMAL, CMHT); - if(perpage == 0) { - perpage = i+1; - cout << "perpage = " << perpage << endl; - } - break; - } - lastData = i; - } - - // Footer - txt.str(""); - txt << "Seite " << getSites(lastData+1) << " von " << getSites(content.size()); - cfb->RenderBox(bspace, yheight, xwidth, yheight+30, FILL, CMH); - cfb->RenderString(txt.str().c_str(), ((xwidth+bspace)/2)-(130/2) ,yheight+20, 130, CENTER, SMALL, GREY); - - - cfb->FBPaint(); -} - -void CPhoneBook::dialMenu() -{ - int dialtest = 0; - ostringstream txt; - - CSubMenu::getInstance()->DialMenu(dialtest); - - unsigned short rccode; - do - { - switch((rccode = crc->getrc())) - { - case RC_UP: - CSubMenu::getInstance()->subMenu[DIAL].sel--; - CSubMenu::getInstance()->DialMenu(dialtest); - break; - case RC_DOWN: - CSubMenu::getInstance()->subMenu[DIAL].sel++; - CSubMenu::getInstance()->DialMenu(dialtest); - break; - case RC_OK: - cconnect->get_login(cpars->getFritzPW()); - - cfb->FBClear(); - txt.str(""); - txt << cpars->getDialprefix() << content[selData].number; - CSubMenu::getInstance()->ShowMessage(INFO_DIAL,1); - cconnect->dial(cconnect->getSid(),cpars->dialport[CSubMenu::getInstance()->subMenu[DIAL].sel].port, txt.str().c_str()); - - cout << '[' << BASENAME << "] - " << __FILE__ << " dialport: " << cpars->dialport[CSubMenu::getInstance()->subMenu[DIAL].sel].port - << " number : " << content[selData].number << endl; - - if(cconnect->getQueryLogic()==1) - cconnect->send_logout(cconnect->getSid()); - break; - } - } - while(rccode!=RC_HOME); - - run(); -} - -int CPhoneBook::getData(const char *fname, const char *list) -{ - memset(&content, 0, sizeof(content)); - - ifstream fh(fname); - - if ( fh.is_open() ) - { - string line; - - while (getline(fh,line)) - { - S_ADDRESS entry; - - istringstream in(line); - - if(getline(in, entry.number, '|') && //in >> entry.number && in.get() == '|' && - getline(in, entry.name, '|') && - getline(in, entry.street, '|') && - getline(in, entry.code, '|') && - getline(in, entry.locality, '|') ) - { - if(strcmp(list,"AZ" /*all*/) == 0) - { - content.push_back(entry); - } - else - { - for(int i=0; i<(int)strlen(list); i++) - { - //printf("search for '%c' > %s (%d)\n",list[i],entry.name.c_str(),(int)strlen(list)); - if(toupper(entry.name[0]) == list[i]) { - content.push_back(entry); - break; - } - } - } - } - else { - cerr << '[' << BASENAME << "] - " << __FILE__ << " could not parse input line: " << line << endl; - } - } - - cout << '[' << BASENAME << "] - " << __FILE__ << ' ' << __FUNCTION__ << " elements: " << content.size() << endl; - - sort(content.begin(),content.end(), sortByKey); - - //copy(content.begin(), content.end(), ostream_iterator(cout, "\n")); - - fh.close(); - - } - else { - cerr << '[' << BASENAME << "] - " << __FILE__ << "could not open file." << endl; - } - - return 0; -} - -int CPhoneBook::getSites(int items) -{ - int sites = 0; - - if(perpage) { - sites = items / perpage; - - if(items % perpage) - sites++; - } - - if(!sites) - sites = 1; - - return(sites); -} diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/phonebook.h b/archive-sources/FritzCallMonitor/FritzInfoMonitor/phonebook.h deleted file mode 100644 index 51e83c1e..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/phonebook.h +++ /dev/null @@ -1,50 +0,0 @@ - -#ifndef __phonebook_h__ -#define __phonebook_h__ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -using namespace std; - -class CPhoneBook -{ - public: - CPhoneBook(); - ~CPhoneBook(); - static CPhoneBook* getInstance(); - - void run(); - - private: - CConnect * cconnect; - CParser * cpars; - Cfb * cfb; - Crc * crc; - - struct S_ADDRESS { - string number; - string name; - string street; - string code; - string locality; - }; - - vector content; - - static bool sortByKey(const S_ADDRESS& a, const S_ADDRESS& b); - static void toUpper(string& s); - - void menu(); - void dialMenu(); - int getData(const char *fname, const char *list); - int getSites(int items); - int selList, selData, lastData; - int perpage; - - friend ostream& operator<< (ostream& out, const S_ADDRESS& d); -}; - -#endif //__phonebook_h__ \ No newline at end of file diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/rc.cpp b/archive-sources/FritzCallMonitor/FritzInfoMonitor/rc.cpp deleted file mode 100644 index d06da4aa..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/rc.cpp +++ /dev/null @@ -1,113 +0,0 @@ - -#include -#include -#include -#include - -#include "globals.h" - -#include "rc.h" - -Crc* Crc::getInstance() -{ - static Crc* instance = NULL; - if(!instance) - instance = new Crc(); - return instance; -} - -Crc::Crc() -{ - rc = -1; - - /* open Remote Control */ - rc = open ( "/dev/input/nevis_ir", O_RDONLY ); - if ( rc == -1 ) - { - perror ( "" ); - exit ( 1 ); - } - - // lock keyboard-conversions, this is done by the plugin itself - fclose(fopen(KBLCKFILE,"w")); -} - -Crc::~Crc() -{ - Cleanup(); -} - - -void Crc::Cleanup (void) -{ - // enable keyboard-conversion again - unlink(KBLCKFILE); - - close(rc); -} - -long Crc::getrc() -{ - //get rc socket - fd_set fds; - FD_ZERO(&fds); - FD_SET(rc, &fds); - select(rc+1, &fds, 0, 0, 0); - if (FD_ISSET(rc, &fds)) - return(GetRCCode()); - else - return(-1); -} - -int Crc::GetRCCode() -{ - long rcc=(-1); - static __u16 rc_last_key = KEY_RESERVED; - - if (read(rc, &ev, sizeof(ev))==sizeof(ev)) - { - if (ev.value) - { - if (ev.code!=rc_last_key) - { - rc_last_key=ev.code; - switch(ev.code) - { - case KEY_UP: rcc=RC_UP; break; - case KEY_DOWN: rcc=RC_DOWN; break; - case KEY_LEFT: rcc=RC_LEFT; break; - case KEY_RIGHT: rcc=RC_RIGHT; break; - case KEY_OK: rcc=RC_OK; break; - case KEY_0: rcc=RC_0; break; - case KEY_1: rcc=RC_1; break; - case KEY_2: rcc=RC_2; break; - case KEY_3: rcc=RC_3; break; - case KEY_4: rcc=RC_4; break; - case KEY_5: rcc=RC_5; break; - case KEY_6: rcc=RC_6; break; - case KEY_7: rcc=RC_7; break; - case KEY_8: rcc=RC_8; break; - case KEY_9: rcc=RC_9; break; - case KEY_RED: rcc=RC_RED; break; - case KEY_GREEN: rcc=RC_GREEN; break; - case KEY_YELLOW: rcc=RC_YELLOW; break; - case KEY_BLUE: rcc=RC_BLUE; break; - case KEY_VOLUMEUP: rcc=RC_PLUS; break; - case KEY_VOLUMEDOWN: rcc=RC_MINUS; break; - case KEY_MUTE: rcc=RC_MUTE; break; - case KEY_HELP: rcc=RC_HELP; break; - case KEY_INFO: rcc=RC_HELP; break; - case KEY_SETUP: rcc=RC_DBOX; break; - case KEY_EXIT: rcc=RC_HOME; break; - case KEY_HOME: rcc=RC_HOME; break; - case KEY_PAGEUP: rcc=RC_PAGEUP; break; - case KEY_PAGEDOWN: rcc=RC_PAGEDOWN;break; - case KEY_POWER: rcc=RC_STANDBY; - } - } - } - else - rc_last_key=KEY_RESERVED; - } - return(rcc); -} \ No newline at end of file diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/rc.h b/archive-sources/FritzCallMonitor/FritzInfoMonitor/rc.h deleted file mode 100644 index 3e261177..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/rc.h +++ /dev/null @@ -1,27 +0,0 @@ - -#ifndef __rc_h__ -#define __rc_h__ - -#ifdef HAVE_CONFIG_H -#include -#endif - -//rc stuff -#include - -class Crc -{ - public: - Crc(); - ~Crc(); - static Crc* getInstance(); - - long int getrc(); - void Cleanup (void); - private: - int rc; - struct input_event ev; - - int GetRCCode(); -}; -#endif diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/starter.c b/archive-sources/FritzCallMonitor/FritzInfoMonitor/starter.c deleted file mode 100644 index 0276040c..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/starter.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * $Id$ - * - * shellexec - d-box2 linux project - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * -*/ - -#include -#include -#include -#include -#include -#define SCRIPT "FritzInfoMonitor" - -int main() -{ - int ret, pid, status; - pid=vfork(); - if (pid == -1) { - fprintf(stderr, "[%s.so] vfork\n", SCRIPT); - return; - } else - if (pid == 0) { - fprintf(stderr, "[%s.so] forked, executing %s\n", SCRIPT, SCRIPT); - for (ret=3 ; ret < 255; ret++) - close (ret); - ret = execlp(SCRIPT, SCRIPT, NULL); - if (ret) - fprintf(stderr, "[%s.so] script return code: %d (%m)\n", SCRIPT, ret); - else - fprintf(stderr, "[%s.so] script return code: %d\n", SCRIPT, ret); - _exit(ret); - } - fprintf(stderr, "[%s.so] parent, waiting for child with pid %d...\n", SCRIPT, pid); - waitpid(pid, &status, 0); - fprintf(stderr, "[%s.so] parent, waitpid() returned..\n", SCRIPT); - if (WIFEXITED(status)) - fprintf(stderr, "[%s.so] child returned with status %d\n", SCRIPT, WEXITSTATUS(status)); - return (status); -} diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/submenu.cpp b/archive-sources/FritzCallMonitor/FritzInfoMonitor/submenu.cpp deleted file mode 100644 index 61df44aa..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/submenu.cpp +++ /dev/null @@ -1,353 +0,0 @@ - -#include -#include -#include - -#include "parser.h" -#include "connect.h" -#include "framebuffer.h" -#include "icons.h" -#include "globals.h" - -#include "submenu.h" - -CSubMenu* CSubMenu::getInstance() -{ - static CSubMenu* instance = NULL; - if(!instance) - instance = new CSubMenu(); - return instance; -} - -CSubMenu::CSubMenu() -{ - cpars = CParser::getInstance(); - cfb = Cfb::getInstance(); - cicons = CIcons::getInstance(); - - int ex, sx, ey, sy; - cfb->getDimensions(&ex, &sx, &ey, &sy); - int vyres = cfb->getYScreeninfo(); - - bspace = 40; - lrspace = 30; - xwidth = ex-sx-bspace; - yheight = ey-sy-bspace; - xcenter = (xwidth/2)+(bspace/2); - ycenter = (yheight/2)+(bspace/2); - - ld = vyres < 600 ? 35 : 35; //line distance - so = 5; //shadow offset - - S_SUBMENU entry; - - /*MENU*/ - entry.sel = 0; - entry.mwidth = 400; - entry.mitems = 5; - subMenu.push_back(entry); - - /*PHONEBOOK*/ - entry.sel = 0; - entry.mwidth = 320; - entry.mitems = 4; - subMenu.push_back(entry); - - /*CALLER_DETAILS*/ - entry.sel = 0; - entry.mwidth = 400; - entry.mitems = 4; - subMenu.push_back(entry); - - /*DIAL*/ - entry.sel = 0; - entry.mwidth = 420; - entry.mitems = (int)(sizeof(CParser::getInstance()->dialport)/sizeof(CParser::getInstance()->dialport[0])); - subMenu.push_back(entry); -}; - -CSubMenu::~CSubMenu() -{ -} - -/****************************************************************************** - * ShowMenu (submenu) - ******************************************************************************/ -void CSubMenu::ShowSubMenu(int menu) -{ - printf("[%s] - %s %s(%d)\n",BASENAME, __FILE__, __FUNCTION__, menu); - - int mitems = subMenu[menu].mitems; - int mwidth = subMenu[menu].mwidth; - int selected = subMenu[menu].sel; - - int vsx = ycenter - ((mitems/2)*ld); - int mhw = mwidth/2; - int i = 0; - int mlrspace = 0; - std::ostringstream msg; - - // Grafic - cfb->RenderBox(xcenter+mhw, vsx-ld+so, xcenter+mhw+so, vsx+(ld*mitems)+(ld/2), FILL, BLACK); - cfb->RenderBox(xcenter-mhw+so, vsx+(ld*mitems), xcenter+mhw+so, vsx+(ld*mitems)+(ld/2)+so, FILL, BLACK); - - cfb->RenderBox(xcenter-mhw, vsx-ld, xcenter+mhw, vsx+(ld*mitems), FILL, CMH); - cfb->RenderBox(xcenter-mhw, vsx, xcenter+mhw, vsx+(ld*mitems)+(ld/2), FILL, CMC); - - switch(menu) - { - case MENU: - - cfb->RenderString("FRITZ! Info-Men", xcenter-mhw, vsx-(ld/3), (xcenter+mhw)-(xcenter-mhw), CENTER, NORMAL, CMHT); - - // selected - if(selected < 0) - selected = mitems -1; - else if (selected > (mitems -1)) - selected = 0; - - subMenu[menu].sel = selected; - cfb->RenderBox(xcenter-mhw, vsx+(ld/3)+(selected*ld), xcenter+mhw, vsx+(ld/4)+((selected+1)*ld), FILL, CMHT); - - i = 0; - mlrspace = lrspace + 10; - cfb->RenderCircle( xcenter-mhw+(mlrspace/3), vsx+((i+1)*ld)-15, RED); - cfb->RenderString("Telefonbuch der FRITZ!Box bernehmen", xcenter-mhw+mlrspace, vsx+((i+1)*ld), (xcenter+mhw)-(xcenter-mhw), LEFT, NORMAL, selected==i?CMC:CMCT); - - i++; - cfb->RenderCircle( xcenter-mhw+(mlrspace/3), vsx+((i+1)*ld)-15, GREEN); - cfb->RenderString("Whlhilfe", xcenter-mhw+mlrspace, vsx+((i+1)*ld), (xcenter+mhw)-(xcenter-mhw), LEFT, NORMAL, selected==i?CMC:CMCT); - - i++; - cfb->RenderCircle( xcenter-mhw+(mlrspace/3), vsx+((i+1)*ld)-15, YELLOW); - cfb->RenderString("Internet trennen und neu verbinden", xcenter-mhw+mlrspace, vsx+((i+1)*ld), (xcenter+mhw)-(xcenter-mhw), LEFT, NORMAL, selected==i?CMC:CMCT); - - i++; - cfb->RenderCircle( xcenter-mhw+(mlrspace/3), vsx+((i+1)*ld)-15, BLUE); - cfb->RenderString("Anrufliste aktualisieren", xcenter-mhw+mlrspace, vsx+((i+1)*ld), (xcenter+mhw)-(xcenter-mhw), LEFT, NORMAL, selected==i?CMC:CMCT); - - i++; - cfb->PaintIcon(cicons->getIcon_1(), xcenter-mhw+(mlrspace/3)-5, vsx+((i+1)*ld)-15-5); - cfb->RenderString("Adressbuch ffnen", xcenter-mhw+mlrspace, vsx+((i+1)*ld), (xcenter+mhw)-(xcenter-mhw), LEFT, NORMAL, selected==i?CMC:CMCT); - - break; - case PHONEBOOK: - cfb->RenderString("Telefonbuch Men", xcenter-mhw, vsx-(ld/3), (xcenter+mhw)-(xcenter-mhw), CENTER, NORMAL, CMHT); - - // selected - if(selected < 0) - selected = mitems -1; - else if (selected > (mitems -1)) - selected = 0; - - subMenu[menu].sel = selected; - cfb->RenderBox(xcenter-mhw, vsx+(ld/3)+(selected*ld), xcenter+mhw, vsx+(ld/4)+((selected+1)*ld), FILL, CMHT); - - for(i=0; iRenderCircle( xcenter-mhw+(lrspace/3), vsx+((i+1)*ld)-15, icon); - msg.str(""); - msg << "Telefonbuch Nr." << i+1 << " bernehmen"; - cfb->RenderString(msg.str().c_str(), xcenter-mhw+lrspace, vsx+((i+1)*ld), (xcenter+mhw)-(xcenter-mhw-lrspace), LEFT, NORMAL, selected==i?CMC:CMCT); - } - break; - } - - cfb->FBPaint(); -} - -void CSubMenu::DialMenu(int dialtest) -{ - printf("[%s] - %s %s(%d)\n",BASENAME, __FILE__, __FUNCTION__, dialtest); - - int mitems = subMenu[DIAL].mitems; - int mwidth = subMenu[DIAL].mwidth; - int selected = subMenu[DIAL].sel; - - int vsx = ycenter - ((mitems/2)*ld); - int mhw = mwidth/2; - - std::ostringstream msg; - - // Grafic - cfb->RenderBox(xcenter+mhw, vsx-ld+so, xcenter+mhw+so, vsx+(ld*mitems)+(ld/2), FILL, BLACK); - cfb->RenderBox(xcenter-mhw+so, vsx+(ld*mitems), xcenter+mhw+so, vsx+(ld*mitems)+(ld/2)+so, FILL, BLACK); - - cfb->RenderBox(xcenter-mhw, vsx-ld, xcenter+mhw, vsx+(ld*mitems), FILL, CMH); - cfb->RenderBox(xcenter-mhw, vsx, xcenter+mhw, vsx+(ld*mitems)+(ld/2), FILL, CMC); - - cfb->RenderString("Whlhilfe Men", xcenter-mhw, vsx-(ld/3), (xcenter+mhw)-(xcenter-mhw), CENTER, NORMAL, CMHT); - - // selected - if(selected < 0) - selected = mitems -1; - else if (selected > (mitems -1)) - selected = 0; - - subMenu[DIAL].sel = selected; - cfb->RenderBox(xcenter-mhw, vsx+(ld/3)+(selected*ld), xcenter+mhw, vsx+(ld/4)+((selected+1)*ld), FILL, CMHT); - - for(int i=0; iRenderString(CParser::getInstance()->dialport[i].port_name, xcenter-mhw+lrspace, vsx+(i*ld)+ld, (xcenter+mhw)-(xcenter-mhw-30), LEFT, NORMAL, selected==i?CMC:CMCT); - msg.str(""); - msg << "(Intern **" << CParser::getInstance()->dialport[i].port << ')'; - cfb->RenderString(msg.str().c_str(), xcenter-mhw+260, vsx+(i*ld)+ld, (xcenter+mhw)-(xcenter-mhw-lrspace), LEFT, NORMAL, selected==i?CMC:CMCT); - } - - //footer - if(dialtest) - { - cfb->RenderBox(xcenter-mhw+so, vsx+(ld*mitems)+(ld/2), xcenter+mhw+so, vsx+(ld*mitems)+(ld/2)+23+so, FILL, BLACK); //shadow - cfb->RenderBox(xcenter-mhw, vsx+(ld*mitems)+(ld/2), xcenter+mhw, vsx+(ld*mitems)+(ld/2)+23, FILL, CMH); - - cfb->PaintIcon(cicons->getIcon_ok(), xcenter-mhw+30, vsx+(ld*mitems)+(ld/2)); - cfb->RenderString("Testen", xcenter-mhw+60, vsx+(ld*mitems)+(ld/2)+20, (xcenter+mhw)-(xcenter-mhw-30), LEFT, SMALL, GREY); - } - - cfb->FBPaint(); -} - -void CSubMenu::CallerMenu(int rs_result, int callsel) -{ - printf("[%s] - %s %s(%d,%d)\n",BASENAME, __FILE__, __FUNCTION__, rs_result, callsel); - - int mitems = subMenu[CALLER_DETAILS].mitems; - int mwidth = subMenu[CALLER_DETAILS].mwidth; - //int selected = subMenu[CALLER_DETAILS].sel; - - int vsx = ycenter - ((mitems/2)*ld); - int mhw = mwidth/2; - - std::ostringstream msg; - - // Grafic - cfb->RenderBox(xcenter+mhw, vsx-ld+so, xcenter+mhw+so, vsx+(ld*mitems)+(ld/2), FILL, BLACK); - cfb->RenderBox(xcenter-mhw+so, vsx+(ld*mitems), xcenter+mhw+so, vsx+(ld*mitems)+(ld/2)+so, FILL, BLACK); - - cfb->RenderBox(xcenter-mhw, vsx-ld, xcenter+mhw, vsx+(ld*mitems), FILL, CMH); - cfb->RenderBox(xcenter-mhw, vsx, xcenter+mhw, vsx+(ld*mitems)+(ld/2), FILL, CMC); - - cfb->RenderString(rs_result?"GoYellow":"Details", xcenter-mhw, vsx-(ld/3), (xcenter+mhw)-(xcenter-mhw), CENTER, NORMAL, CMHT); - int i=0; - - cfb->RenderString(cpars->caller[callsel].call_numr, xcenter-mhw+lrspace, vsx+(i*ld)+ld, (xcenter+mhw)-(xcenter-mhw), LEFT, NORMAL, CMCT); - i++; - - cfb->RenderString((cpars->address.name[0]=='\0'?"Name unbekannt":cconnect->UTF8toISO(cpars->address.name)), xcenter-mhw+lrspace, vsx+(i*ld)+ld, (xcenter+mhw)-(xcenter-mhw), LEFT, NORMAL, CMCT); - i++; - - cfb->RenderString((cpars->address.street[0]=='\0'?"Strae unbekannt":cconnect->UTF8toISO(cpars->address.street)), xcenter-mhw+lrspace, vsx+(i*ld)+ld, (xcenter+mhw)-(xcenter-mhw), LEFT, NORMAL, cpars->address.street[0]=='\0'?GREY:CMCT); - i++; - - msg.str(""); - msg << (cpars->address.code[0]=='\0' ? "Ort unbekannt" : cpars->address.code) << ' ' << cconnect->UTF8toISO(cpars->address.locality); - cfb->RenderString(msg.str().c_str(), xcenter-mhw+lrspace, vsx+(i*ld)+ld, (xcenter+mhw)-(xcenter-mhw), LEFT, NORMAL, cpars->address.code[0]=='\0'?GREY:CMCT); - - //footer - if(strlen(cpars->caller[callsel].call_numr)!=0) - { - cfb->RenderBox(xcenter-mhw+so, vsx+(ld*mitems)+(ld/2), xcenter+mhw+so, vsx+(ld*mitems)+(ld/2)+23+so, FILL, BLACK); //shadow - cfb->RenderBox(xcenter-mhw, vsx+(ld*mitems)+(ld/2), xcenter+mhw, vsx+(ld*mitems)+(ld/2)+23, FILL, CMH); - - cfb->RenderCircle( xcenter-mhw+(lrspace/3), vsx+(ld*mitems)+(ld/2)+5, RED); - cfb->RenderString("Anrufen", xcenter-mhw+30, vsx+(ld*mitems)+(ld/2)+20, (xcenter+mhw)-(xcenter-mhw-30), LEFT, SMALL, GREY); - - cfb->RenderCircle( xcenter-mhw+110, vsx+(ld*mitems)+(ld/2)+5, BLUE); - cfb->RenderString("Rckwrtssuche", xcenter-mhw+30+110, vsx+(ld*mitems)+(ld/2)+20, (xcenter+mhw)-(xcenter-mhw-30), LEFT, SMALL, GREY); - - if(rs_result) - { - cfb->RenderCircle( xcenter-mhw+270, vsx+(ld*mitems)+(ld/2)+5, YELLOW); - cfb->RenderString("Speichern", xcenter-mhw+30+270, vsx+(ld*mitems)+(ld/2)+20, (xcenter+mhw)-(xcenter-mhw-30), LEFT, SMALL, GREY); - } - - } - - cfb->FBPaint(); -} - -void CSubMenu::ShowMessage(int message, int popup) -{ - printf("[%s] - %s %s(%d,%d)\n",BASENAME, __FILE__, __FUNCTION__, message, popup); - - int mitte = xcenter; - int so = 5; - std::ostringstream msg; - - //shadow - cfb->RenderBox(mitte+190, 178+so, mitte+200+so, 340, FILL, BLACK); - cfb->RenderBox(mitte-200+so, 300, mitte+200+so, 340+so, FILL, BLACK); - - cfb->RenderBox(mitte-200, 178, mitte+200, 220, FILL, CMH); - cfb->RenderBox(mitte-200, 220, mitte+200, 340, FILL, CMC); - - switch(message) - { - case INFO: - cfb->RenderString("Versionsinfo", mitte-180, 210, (mitte+180)-(mitte-180), CENTER, NORMAL, CMHT); - msg.str(""); - msg << "FritzInfoMonitor " << VERSION; - cfb->RenderString(msg.str().c_str(), mitte-180, 255, (mitte+180)-(mitte-180), CENTER, NORMAL, CMCT); - cfb->RenderString(COPYR, mitte-180, 290, (mitte+180)-(mitte-180), CENTER, NORMAL, CMCT); - break; - case INFO_ADDADR: - cfb->RenderString("Information", mitte-180, 210, (mitte+180)-(mitte-180), CENTER, NORMAL, CMHT); - cfb->RenderString("Eintrag wurde hinzugefgt", mitte-180, 270, (mitte+180)-(mitte-180), CENTER, NORMAL, CMCT); - break; - case INFO_DIAL: - cfb->RenderString("Whlhilfe", mitte-180, 210, (mitte+180)-(mitte-180), CENTER, NORMAL, CMHT); - cfb->RenderString("Bitte den Hrer abnehmen, oder warten", mitte-180, 255, (mitte+180)-(mitte-180), CENTER, NORMAL, CMCT); - cfb->RenderString("Sie, bis das Telefon klingelt.", mitte-180, 290, (mitte+180)-(mitte-180), CENTER, NORMAL, CMCT); - break; - case INFO_DIALTEST: - cfb->RenderString("Whlhilfe", mitte-180, 210, (mitte+180)-(mitte-180), CENTER, NORMAL, CMHT); - cfb->RenderString("Das Telefon sollte jetzt klingeln", mitte-180, 270, (mitte+180)-(mitte-180), CENTER, NORMAL, CMCT); - break; - case INFO_PHONEBOOK: - cfb->RenderString("Information", mitte-180, 210, (mitte+180)-(mitte-180), CENTER, NORMAL, CMHT); - msg.str(""); - msg << "Telefonbuch " << subMenu[PHONEBOOK].sel+1 << " wird bertragen"; - cfb->RenderString(msg.str().c_str(), mitte-180, 270, (mitte+180)-(mitte-180), CENTER, NORMAL, CMCT); - break; - case INFO_RSEARCH: - cfb->RenderString("GoYellow", mitte-180, 210, (mitte+180)-(mitte-180), CENTER, NORMAL, CMHT); - cfb->RenderString("Leider haben wir nichts gefunden!", mitte-180, 270, (mitte+180)-(mitte-180), CENTER, NORMAL, CMCT); - break; - case INFO_RECONNECT : - cfb->RenderString("Information", mitte-180, 210, (mitte+180)-(mitte-180), CENTER, NORMAL, CMHT); - cfb->RenderString("Neustart der Internetverbindung", mitte-180, 270, (mitte+180)-(mitte-180), CENTER, NORMAL, CMCT); - break; - case ERR_LOGIN: - cfb->RenderString("Fehler!", mitte-180, 210, (mitte+180)-(mitte-180), CENTER, NORMAL, CMHT); - cfb->RenderString("Fehler bei der Anmeldung", mitte-180, 255, (mitte+180)-(mitte-180), CENTER, NORMAL, CMCT); - cfb->RenderString("Login nicht erfolgreich", mitte-180, 290, (mitte+180)-(mitte-180), CENTER, NORMAL, CMCT); - break; - case ERR_CONNECT: - cfb->RenderString("Fehler!", mitte-180, 210, (mitte+180)-(mitte-180), CENTER, NORMAL, CMHT); - cfb->RenderString("Die Box ist nicht erreichbar", mitte-180, 255, (mitte+180)-(mitte-180), CENTER, NORMAL, CMCT); - cfb->RenderString(cpars->getFritzAdr(), mitte-180, 290, (mitte+180)-(mitte-180), CENTER, NORMAL, CMCT); - break; - case LOAD: - cfb->RenderString("Information", mitte-180, 210, (mitte+180)-(mitte-180), CENTER, NORMAL, CMHT); - cfb->RenderString("Hole Daten von der FRITZ!Box ...", mitte-180, 270, (mitte+180)-(mitte-180), CENTER, NORMAL, CMCT); - break; - } - - if(!popup) - { - cfb->RenderBox(mitte-50, 305, mitte+50, 330, FILL, CMHT); - cfb->RenderString("zurck", mitte-10, 325, 60, LEFT, SMALL, CMC); - cfb->PaintIcon(cicons->getIcon_ok(), mitte-40 ,305); - } - - cfb->FBPaint(); -} diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor/submenu.h b/archive-sources/FritzCallMonitor/FritzInfoMonitor/submenu.h deleted file mode 100644 index 399b83bd..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor/submenu.h +++ /dev/null @@ -1,45 +0,0 @@ - -#ifndef __submenu_h__ -#define __submenu_h__ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "icons.h" - -#include -using namespace std; - -class CSubMenu -{ - public: - CSubMenu(); - ~CSubMenu(); - static CSubMenu* getInstance(); - - void ShowMessage(int message, int popup); - void ShowSubMenu(int menu); - void CallerMenu(int rs_result, int callsel); - void DialMenu(int dialtest); - - struct S_SUBMENU { - int sel; - int mwidth; - int mitems; - }; - vector subMenu; - - private: - CParser * cpars; - CConnect * cconnect; - Cfb * cfb; - CIcons * cicons; - -// int callsel, rs_result, dialtest; - int bspace, lrspace, xwidth, yheight; - int xcenter, ycenter; - int ld, so; -}; - -#endif// __submenu_h__ diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor_setup.cfg b/archive-sources/FritzCallMonitor/FritzInfoMonitor_setup.cfg deleted file mode 100644 index 466752c8..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor_setup.cfg +++ /dev/null @@ -1,6 +0,0 @@ -name=NI-FRITZ! FCM/FIM Setup -desc=FritzCallMonitor.cfg Konfigurationsplugin -type=4 -needfb=1 -needrc=1 -needoffsets=1 diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor_setup.lua b/archive-sources/FritzCallMonitor/FritzInfoMonitor_setup.lua deleted file mode 100644 index 09b41646..00000000 --- a/archive-sources/FritzCallMonitor/FritzInfoMonitor_setup.lua +++ /dev/null @@ -1,548 +0,0 @@ --- Plugin to configure FritzCallMonitor.cfg --- Copyright (C) 2014 NI-Team - -function init() - caption="FritzCallMonitor Setup" - - config="/var/tuxbox/config/FritzCallMonitor.cfg" - addressbook="/var/tuxbox/config/FritzCallMonitor.addr" - - servicename="fritzcallmonitor" - flagfile=".fritzcallmonitor" - - changed = 0 - - C={} - H={} -- hints - - C["FRITZBOXIP"]="fritz.box" - H["FRITZBOXIP"]="Die IP-Adresse oder der Hostname deiner FRITZ!Box" - - C["PORT"]=1012 - H["PORT"]="Port 1012 der FRITZ!Box muss einmalig per Telefon aktiviert werden" - - C["ADDRESSBOOK"]=addressbook - H["ADDRESSBOOK"]="" - - C["EXEC"]="" - H["EXEC"]="Nach eingehendem Anruf, kann ein Script ausgeführt werden" - - C["BACKWARDSEARCH"]=1 - H["BACKWARDSEARCH"]="Rückwärtssuche über das Internet" - - C["DEBUG"]=0 - H["DEBUG"]="Startet den FCM zur Fehlersuche im Debugmodus" - - C["MSGTYPE"]="nmsg" - H["MSGTYPE"]="Neutrino Nachrichtentyp Popup oder Message" - - C["MSGTIMEOUT"]="" - H["MSGTIMEOUT"]="Maximale Anzeigedauer der Nachricht auf dem Bildschirm, bevor sie automatisch gelöscht wird. Keine Angabe = Neutrino default" - - C["MSN_1"]="" - C["MSN_2"]="" - C["MSN_3"]="" - C["MSN_4"]="" - C["MSN_5"]="" - C["MSN_6"]="" - H["MSNMENU"]="MSN Rufnummern, die überwacht werden sollen. Wenn \"MSN_1\" frei bleibt, werden alle Rufnummern überwacht." - H["MSN"]="Ist hier eine Nummer eingetragen, reagiert der FCM bei einem eingehenden Anruf nur auf diese." - - C["BOXIP_1"]="127.0.0.1" - C["BOXIP_2"]="" - C["BOXIP_3"]="" - C["BOXIP_4"]="" - H["BOXMENU"]="Einstellen der Adressen für die Neutrino-Boxen, auf denen ein eingehender Anruf angezeigt werden soll." - H["BOXIP"]=": der Box, auf der die Nachricht angezeigt werden soll. Die Eingabe des Ports ist optional." - - C["LOGON_1"]="root:coolstream" - C["LOGON_2"]="" - C["LOGON_3"]="" - C["LOGON_4"]="" - H["LOGON"]=": für das yWeb der entsprechenden Box, auf der die Nachricht angezeigt werden soll." - - C["EASYMODE"]=0 - H["EASYMODE"]="Einschalten wenn eine EasyBox statt einer Fritz!Box genutzt wird" - - C["PASSWD"]="" - H["PASSWD"]="Das auf der Fritz!Box angegebene Passwort" - - C["CITYPREFIX"]="" - H["CITYPREFIX"]="Bei Übernahme der FB Telefonbücher kann eine fehlende Vorwahl automatisch mit der hier eingetragenen Ortsvorwahl ergänzt werden." - - C["DIALPREFIX"]="" - H["DIALPREFIX"]="Wenn die Wählhilfe verwendet wird (FIM), kann hier die Wählprefix verwendet werden (*111# stellt eine Verbindung ins Festnetz her)." - - C["PORT_1"]="Fon 1, 1" - C["PORT_2"]="Fon 2, 2" - C["PORT_3"]="Fon 3, 3" - C["PORT_4"]="ISDN & DECT, 50" - C["PORT_5"]="ISDN 1, 51" - C["PORT_6"]="ISDN 2, 52" - C["PORT_7"]="DECT 1, 610" - C["PORT_8"]="DECT 2, 611" - H["DIALHELPER"]="Wählhilfe Ports, werden in der Auswahl des Menüs \"Wählhilfe\" (FIM) ausgegeben" - H["PORT"]=", des Gerätes in der FritzBox" - - H["SEARCH_MODE_MENU"]="Wenn Nachrichten auf dem FRITZ-Anrufbeantworter vorliegen, kann mit einem NI-Image eine Info eingeblendet werden (NI-Infobar)" - C["SEARCH_MODE"]=0 - H["SEARCH_MODE"]="Schaltet die Abfrage ein/aus" - - C["SEARCH_QUERY"]="&var=tam:settings/TAM0/NumNewMessages" - H["SEARCH_QUERY"]="Querystring für die Abfrage des Anrufbeantworters. Liegen gespeicherte Nachrichten vor, wird das Flagfile gesetzt." - - C["SEARCH_INT"]=300 - H["SEARCH_INT"]="Intervall für die Suchabfrage (Query)" - - C["AD_FLAGFILE"]="/var/etc/.call" - H["AD_FLAGFILE"]="Ist der Query erfolgreich, wird dieses Flagfile für die Anzeige in den NI-Infoicons gesetzt" - - -- maybe todo -- - C["CALLERLIST_STR"]="getpage=..%2Fhtml%2Fde%2FFRITZ%21Box_Anrufliste.csv" - C["CALLERLIST_FILE"]="/tmp/FRITZ!Box_Anrufliste.csv" -end -- init --- --------------------------------------------------------------------------- - -function trim(s) - return (s:gsub("^%s*(.-)%s*$", "%1")) -end - -function load() - local f = io.open(config, "r") - if f then - for line in f:lines() do - local key, val = line:match("^([^=#]+)=([^\n]*)") - if (key) then - if (val == nil) then - val="" - end - C[trim(key)]=trim(val) - end - end - f:close() - end -end - -function check_for_restart() - local f = io.open("/var/etc/"..flagfile, "r") - if f == nil then - io.open("/etc/"..flagfile, "r") - end - - if f ~= nil then - f:close() - os.execute("service "..servicename.." stop") - os.execute("sleep 1") - os.execute("service "..servicename.." start") - end -end - -function save() - if (changed == 1) then - changed = 0 - - local h = hintbox.new{caption="Einstellungen werden gespeichert", text="Bitte warten ..."} - h:paint() - - local f = io.open(config, "w") - if f then - f:write( -[[ -# Der Port 1012 der FRITZBox muss einmalig per Telefon (analog!) aktiviert werden: -# Telefoncode zum öffnen des TCP-Ports: #96*5* -# Telefoncode zum schließen des TCP-Ports: #96*4* -# Diese Funktion wir ab der Firmware Version xx.03.99 von AVM unterstützt. - -# IP von deiner Fritzbox und port -FRITZBOXIP=]].. C["FRITZBOXIP"] .. "\n" ..[[ -PORT=]].. C["PORT"] .. "\n" ..[[ - -# Addressbuch File -ADDRESSBOOK=]].. C["ADDRESSBOOK"] .. "\n" ..[[ - -# Pfadangabe für den Aufruf eines Scripts. -# Nach eingehendem Anruf, kann ein Script ausgeführt werden, -# durch die z.B. die Lautstärke den Box herunter geregelt wird. -# Als Parameter wird der Inhalt der Nachricht, die auch über -# die Box ausgegeben wird, übergeben. -# Dieses Script muss natürlich vorhanden und ausführbar sein. -# Es wird per default kein Script mitgeliefert. -EXEC=]].. C["EXEC"] .. "\n" ..[[ - -# Rückwärtssuche über das Internet -BACKWARDSEARCH=]].. C["BACKWARDSEARCH"] .. "\n" ..[[ - -# Debug Ausgaben -DEBUG=]].. C["DEBUG"] .. "\n" ..[[ - -# Neutrino Nachrichtentyp Popup (popup) oder Message (nmsg) -MSGTYPE=]].. C["MSGTYPE"] .. "\n" ..[[ - -# Maximale Anzeigedauer der Nachricht auf dem Bildschirm, bevor sie automatisch gelöscht wird. -# Ist hier kein Wert eingetragen, wird der Neutrino default genommen (ab Revision 1782). -MSGTIMEOUT=]].. C["MSGTIMEOUT"] .. "\n" ..[[ - -# MSN Rufnummern, die überwacht werden sollen. Wenn "MSN_1" frei bleibt, werden alle Rufnummern überwacht. -# Optional kann auch der Name angegeben werden. Die Eingabe erfolgt dann |. -MSN_1=]].. C["MSN_1"] .. "\n" ..[[ -MSN_2=]].. C["MSN_2"] .. "\n" ..[[ -MSN_3=]].. C["MSN_3"] .. "\n" ..[[ -MSN_4=]].. C["MSN_4"] .. "\n" ..[[ -MSN_5=]].. C["MSN_5"] .. "\n" ..[[ -MSN_6=]].. C["MSN_6"] .. "\n" ..[[ - -# IP Adresse der Box. Die erste Adresse sollte 127.0.0.1 sein (die Box auf dem der FritzCallMonitor läuft). -# Optional kann auch der Port angegeben werden. Die Eingabe erfolgt dann :. Der Standardport ist 80 -BOXIP_1=]].. C["BOXIP_1"] .. "\n" ..[[ -BOXIP_2=]].. C["BOXIP_2"] .. "\n" ..[[ -BOXIP_3=]].. C["BOXIP_3"] .. "\n" ..[[ -BOXIP_4=]].. C["BOXIP_4"] .. "\n" ..[[ - -# Name und Passwort (Name:Passwort) für das yWeb der entsprechenden Box -LOGON_1=]].. C["LOGON_1"] .. "\n" ..[[ -LOGON_2=]].. C["LOGON_2"] .. "\n" ..[[ -LOGON_3=]].. C["LOGON_3"] .. "\n" ..[[ -LOGON_4=]].. C["LOGON_4"] .. "\n" ..[[ - -# Wenn der CallMonitor in Verbindung mit einer Eeasybox eingesetzt wird "1" sonst immer "0" -EASYMODE=]].. C["EASYMODE"] .. "\n" ..[[ - -# Passwort für die !FritzBox (Achtung - nur neues Loginverfahren mit SID) -PASSWD=]].. C["PASSWD"] .. "\n" ..[[ - -# Bei der Übernahme der !FritzBox-Telefonbücher mit den FritzInfolMonitor (FIM), -# kann eine fehlende Vorwahl automatisch mit der hier eingetragenen Ortsvorwahl ergänzt werden. -CITYPREFIX=]].. C["CITYPREFIX"] .. "\n" ..[[ - -# Wenn die Wählhilfe verwendet wird (FIM), kann hier die Wählprefix verwendet werden. -# Das Beispiel DIALPREFIX=*111# stellt eine Verbindung ins Festnetz her. -DIALPREFIX=]].. C["DIALPREFIX"] .. "\n" ..[[ - -# Wählhilfe Ports, werden in der Auswahl des Menüs "Wählhilfe" (FIM) ausgegeben -# Name Port Intern -# ------------------------------ -# "Fon 1", 1, "**1" -# "Fon 2", 2, "**2" -# "Fon 3", 3, "**3" -# "ISDN & DECT", 50, "**50" -# "ISDN 1", 51, "**51" -# "ISDN 2", 52, "**52" -# "ISDN 3", 53, "**53" -# "ISDN 4", 54, "**54" -# "ISDN 5", 55, "**55" -# "DECT 1", 610, "**610" -# "DECT 2", 611, "**611" -# "DECT 3", 612, "**612" -# "DECT 4", 613, "**613" -# "DECT 5", 614, "**614" -# "SIP 1", 620, "**620" -# "SIP 2", 621, "**621" -# "SIP 3", 622, "**622" -# "SIP 4", 623, "**623" -# "SIP 5", 624, "**624" -# -# Maximal sind 8 Einträge möglich. -# Dabei ist folgender Syntax einzuhalten: -# PORT_x=Name,Port -PORT_1=]].. C["PORT_1"] .. "\n" ..[[ -PORT_2=]].. C["PORT_2"] .. "\n" ..[[ -PORT_3=]].. C["PORT_3"] .. "\n" ..[[ -PORT_4=]].. C["PORT_4"] .. "\n" ..[[ -PORT_5=]].. C["PORT_5"] .. "\n" ..[[ -PORT_6=]].. C["PORT_6"] .. "\n" ..[[ -PORT_7=]].. C["PORT_7"] .. "\n" ..[[ -PORT_8=]].. C["PORT_8"] .. "\n" ..[[ - -# Strings zum senden an die !FritzBox, Die Quelle hierfür ist: -# http://www.wehavemorefun.de/fritzbox/index.php/Anrufliste_von_der_Box_holen - -# Anrufliste (CSV) herunterladen -CALLERLIST_STR=]].. C["CALLERLIST_STR"] .. "\n" ..[[ - -# Speicherort für die Anrufliste auf der Coolstream -CALLERLIST_FILE=]].. C["CALLERLIST_FILE"] .. "\n" ..[[ - -# 0 = AUS [default] -# 1 = An die FRITZ!Box wird eine Query-Abfrage gesendet -SEARCH_MODE=]].. C["SEARCH_MODE"] .. "\n" ..[[ - -# Querystring für die Abfrage der FRITZ!Box. -# Die Abfrage, ob neue Nachrichten vorhanden sind, wurde mit der Firmware Version 29.04.87 getestet. -# In älteren Versionen scheint die FB keine Information darüber bereit zu stellen. -# -# Liefert der Query "0" zurück, wird das Flagfile (AD_FLAGFILE) gelöscht. -# Ist das Ergebnis ungleich "0", wird das Flagfile (AD_FLAGFILE) erzeugt. -# default SEARCH_QUERY=&var=tam:settings/TAM0/NumNewMessages -SEARCH_QUERY=]].. C["SEARCH_QUERY"] .. "\n" ..[[ - -# Intervall in Sekunden, für die Suchabfrage in der Startseite der FRITZ!Box -# default SEARCH_INT=300 -SEARCH_INT=]].. C["SEARCH_INT"] .. "\n" ..[[ - -# Standard im NI-Image ist /var/etc/.call -# default AD_FLAGFILE=/var/etc/.call -AD_FLAGFILE=]].. C["AD_FLAGFILE"] .. "\n" ..[[ -]] - ) - f:close() - - check_for_restart() - - local i = 0 - repeat - i = i + 1 - msg, data = n:GetInput(500) - until msg == RC.ok or msg == RC.home or i == 2 - end - - h:hide() - end -end - -function handle_key(a) - if (changed == 0) then - return MENU_RETURN["EXIT"] - end - - local res = messagebox.exec{title="Änderungen verwerfen?", text="Sollen die Änderungen verworfen werden?", buttons={ "yes", "no" } } - if (res == "yes") then - return MENU_RETURN["EXIT"] - else - return MENU_RETURN["REPAINT"] - end -end - -function reset() - local res = messagebox.exec{title="Standardeinstellungen laden", text="Sollen die Standardeinstellungen geladen werden?", buttons={ "yes", "no" } } - if (res == "yes") then - init() - changed=1 - - -- ugly but it's works -- - m:hide() - m = {} - m_menu("main") - - return MENU_RETURN["EXIT_ALL"] - end - return MENU_RETURN["REPAINT"] -end - -on="ein" -off="aus" -function num2onoff(a) - if (tonumber(a) == 0) then - return off - else - return on - end -end -function onoff2num(a) - if (a == on) then - return 1 - else - return 0 - end -end -function set_onoff(k, v) - if (C[k] ~= onoff2num(v)) then - C[k]=onoff2num(v) - changed=1 - end -end - -yes="ja" -no="nein" -function num2yesno(a) - if (tonumber(a) == 0) then - return no - else - return yes - end -end -function yesno2num(a) - if (a == yes) then - return 1 - else - return 0 - end -end -function set_yesno(k, v) - if (C[k] ~= yesno2num(v)) then - C[k]=yesno2num(v) - changed=1 - end -end - -function set_string(k, v) - if (C[k] ~= v) then - C[k]=v - changed=1 - end -end - -function get_desc_from_table(t, v) - local __d = "" - for _v, _w in ipairs(t) do - if (_w.value == v) then - __d = _w.desc - break - end - end - return __d -end - --- --------------------------------------------------------------------------- - -table_MSGTYPE = { - { value = "nmsg", desc = "Message" }, - { value = "popup", desc = "Popup" } -} - -descs_MSGTYPE = {} - -for v, w in ipairs(table_MSGTYPE) do - descs_MSGTYPE[v] = w.desc -end --- --------------------------------------------------------------------------- -table_DEBUG = { - { value = "0", desc = "aus" }, - { value = "1", desc = "Level 1" }, - { value = "2", desc = "Level 2" } -} - -descs_DEBUG = {} - -for v, w in ipairs(table_DEBUG) do - descs_DEBUG[v] = w.desc -end - --- --------------------------------------------------------------------------- - -switch_table = { - ["MSGTYPE"] = function (x) return table_MSGTYPE end, - ["DEBUG"] = function (x) return table_DEBUG end, -} - -function set_table(k, v) - local __v - for _v, _w in ipairs(switch_table[k]()) do - if (_w.desc == v) then - __v = _w.value - break - end - end - C[k]=__v - changed=1 -end - --- --------------------------------------------------------------------------- - -function msn_menu(id) - local msn = menu.new{name="MSN Einstellungen", icon="settings"} - msn:addKey{directkey=RC["home"], id="home", action="handle_key"} - msn:addKey{directkey=RC["setup"], id="setup", action="handle_key"} - msn:addItem{type="separator"} - msn:addItem{type="back"} - msn:addItem{type="separatorline"} - for i=1,6 do - msn:addItem{type="stringinput", action="set_string", id="MSN_"..i.."", value=C["MSN_"..i..""], hint=H["MSN"] ,valid_chars="0123456789 ", directkey=RC[""..i..""], name="Rufnummer "..i..""} - end - msn:exec() -end - -function box_menu(id) - local box = menu.new{name="Box Einstellungen", icon="settings"} - box:addKey{directkey=RC["home"], id="home", action="handle_key"} - box:addKey{directkey=RC["setup"], id="setup", action="handle_key"} - box:addItem{type="separator"} - box:addItem{type="back"} - box:addItem{type="separatorline"} - for i=1,4 do - box:addItem{type="stringinput", action="set_string", id="BOXIP_"..i.."", value=C["BOXIP_"..i..""], hint=H["BOXIP"], valid_chars="0123456789.: ", directkey=RC[""..i..""], name="Box "..i.." IP"} - box:addItem{type="keyboardinput", action="set_string", id="LOGON_"..i.."", value=C["LOGON_"..i..""], hint=H["LOGON"], name="Box "..i.." Login"} - if i < 4 then - box:addItem{type="separator"} - end - end - box:exec() -end - -function port_menu(id) - local msn = menu.new{name="Wählhilfe", icon="settings"} - msn:addKey{directkey=RC["home"], id="home", action="handle_key"} - msn:addKey{directkey=RC["setup"], id="setup", action="handle_key"} - msn:addItem{type="separator"} - msn:addItem{type="back"} - msn:addItem{type="separatorline"} - for i=1,8 do - msn:addItem{type="keyboardinput", action="set_string", id="PORT_"..i.."", value=C["PORT_"..i..""], hint=H["PORT"], directkey=RC[""..i..""], name="Wählhilfe "..i..""} - end - msn:exec() -end - -function query_menu(id) - local query = menu.new{name="Anrufbeantworter", icon="settings"} - query:addKey{directkey=RC["home"], id="home", action="handle_key"} - query:addKey{directkey=RC["setup"], id="setup", action="handle_key"} - query:addItem{type="separator"} - query:addItem{type="back"} - query:addItem{type="separatorline"} - query:addItem{type="chooser", action="set_yesno", options={ yes, no }, id="SEARCH_MODE", hint=H["SEARCH_MODE"], value=num2yesno(C["SEARCH_MODE"]), name="Query-Abfrage"} - query:addItem{type="keyboardinput", action="set_string", id="SEARCH_QUERY", value=C["SEARCH_QUERY"], hint=H["SEARCH_QUERY"], name="Query-String"} - query:addItem{type="stringinput", action="set_string", id="SEARCH_INT", value=C["SEARCH_INT"], hint=H["SEARCH_INT"], valid_chars="0123456789 ", name="Abfrageintervall"} - query:addItem{type="keyboardinput", action="set_string", id="AD_FLAGFILE", value=C["AD_FLAGFILE"], hint=H["AD_FLAGFILE"], name="Signaldatei"} - query:exec() -end - -function pwd_menu(id) - local pwd = menu.new{name="FRITZ!Box Passwort", icon="settings"} - pwd:addKey{directkey=RC["home"], id="home", action="handle_key"} - pwd:addKey{directkey=RC["setup"], id="setup", action="handle_key"} - pwd:addItem{type="separator"} - pwd:addItem{type="back"} - pwd:addItem{type="separatorline"} - pwd:addItem{type="keyboardinput", action="set_string", id="PASSWD", value=C["PASSWD"], name="Passwort"} - pwd:exec() -end - -function m_menu(id) - m = menu.new{name=caption, icon="settings"} - m:addKey{directkey=RC["home"], id="home", action="handle_key"} - m:addKey{directkey=RC["setup"], id="setup", action="handle_key"} - m:addItem{type="separator"} - m:addItem{type="cancel"} - m:addItem{type="separatorline"} - m:addItem{type="forwarder", name="Speichern", action="save", icon="rot", directkey=RC["red"]} - m:addItem{type="separatorline"} - m:addItem{type="keyboardinput", action="set_string", id="FRITZBOXIP", value=C["FRITZBOXIP"], hint=H["FRITZBOXIP"], name="FRITZ!Box IP/Name"} - m:addItem{type="stringinput", action="set_string", id="PORT", value=C["PORT"], hint=H["PORT"], valid_chars="0123456789 ", name="FRITZ!Box Port"} - m:addItem{type="forwarder", name="Passwort eingeben", action="pwd_menu", hint=H["PASSWD"], id="PWD"} - m:addItem{type="separator"} - m:addItem{type="chooser", action="set_yesno", options={ yes, no }, id="EASYMODE", hint=H["EASYMODE"], value=num2yesno(C["EASYMODE"]), name="EasyBox statt FRITZ!Box"} - m:addItem{type="separatorline"} - m:addItem{type="chooser", action="set_yesno", options={ yes, no }, id="BACKWARDSEARCH", hint=H["BACKWARDSEARCH"], value=num2yesno(C["BACKWARDSEARCH"]), name="Rückwärtsuche"} - m:addItem{type="chooser", directkey=RC["green"], icon="gruen", action="set_table", options=descs_DEBUG, id="DEBUG", hint=H["DEBUG"], value=get_desc_from_table(table_DEBUG, C["DEBUG"]), name="Debugmodus"} - m:addItem{type="stringinput", action="set_string", id="CITYPREFIX", value=C["CITYPREFIX"], hint=H["CITYPREFIX"], valid_chars="0123456789 ", name="Ortsvorwahl", size="7"} - m:addItem{type="stringinput", action="set_string", id="DIALPREFIX", value=C["DIALPREFIX"], hint=H["DIALPREFIX"], valid_chars="0123456789 ", name="Wählprefix", size="7"} - m:addItem{type="separator"} - m:addItem{type="filebrowser", action="set_string", id="ADDRESSBOOK", value=C["ADDRESSBOOK"], hint=H["ADDRESSBOOK"], name="Adressbuch"} - m:addItem{type="filebrowser", action="set_string", id="EXEC", value=C["EXEC"], hint=H["EXEC"], name="Script starten"} - m:addItem{type="separatorline"} - m:addItem{type="chooser", action="set_table", options=descs_MSGTYPE, id="MSGTYPE", value=get_desc_from_table(table_MSGTYPE, C["MSGTYPE"]), hint=H["MSGTYPE"], name="Benachrichtung"} - m:addItem{type="stringinput", action="set_string", id="MSGTIMEOUT", value=C["MSGTIMEOUT"], hint=H["MSGTIMEOUT"], valid_chars="0123456789 ", name="Message Timeout"} - m:addItem{type="separatorline"} - m:addItem{type="forwarder", name="MSN Einstellungen", action="msn_menu", hint=H["MSNMENU"], id="MSN"} - m:addItem{type="forwarder", name="Box Einstellungen", action="box_menu", hint=H["BOXMENU"], id="BOX"} - m:addItem{type="forwarder", name="Wählhilfen", action="port_menu", hint=H["DIALHELPER"], id="PORT"} - m:addItem{type="forwarder", name="Statusabfrage des Anrufbeantworters", action="query_menu", hint=H["SEARCH_MODE_MENU"], id="PORT"} - m:addItem{type="separatorline"} - m:addItem{type="forwarder", name="Standardeinstellungen laden", action="reset", hint="Aktuelle Einstellungen verwerfen und die Standardeinstellungen laden" } - m:exec() -end - --- MAIN ---------------------------------------------------------------------- -n = neutrino() -init() -load() -m_menu("main") diff --git a/archive-sources/FritzCallMonitor/FritzInfoMonitor_setup_hint.png b/archive-sources/FritzCallMonitor/FritzInfoMonitor_setup_hint.png deleted file mode 100644 index 9d59ea6e..00000000 Binary files a/archive-sources/FritzCallMonitor/FritzInfoMonitor_setup_hint.png and /dev/null differ diff --git a/archive-sources/FritzCallMonitor/Technical_Note_Session_ID.pdf b/archive-sources/FritzCallMonitor/Technical_Note_Session_ID.pdf deleted file mode 100755 index 7c9c9731..00000000 Binary files a/archive-sources/FritzCallMonitor/Technical_Note_Session_ID.pdf and /dev/null differ diff --git a/archive-sources/FritzCallMonitor/Technical_Note_Session_ID_ab_OS_5.5.pdf b/archive-sources/FritzCallMonitor/Technical_Note_Session_ID_ab_OS_5.5.pdf deleted file mode 100755 index c69ff26a..00000000 Binary files a/archive-sources/FritzCallMonitor/Technical_Note_Session_ID_ab_OS_5.5.pdf and /dev/null differ diff --git a/archive-sources/FritzCallMonitor/connect.cpp b/archive-sources/FritzCallMonitor/connect.cpp deleted file mode 100644 index 09a07762..00000000 --- a/archive-sources/FritzCallMonitor/connect.cpp +++ /dev/null @@ -1,1132 +0,0 @@ -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -//#include -#include - -//#include "md5.h" -#include - -#include "connect.h" -//#include "base64.h" - -#define BASENAME "FCM" - -#include - - -class CurledClass -{ - public: - - static int writer(char *data, size_t size, size_t nmemb, string *buffer_in) - { - - // Is there anything in the buffer? - if (buffer_in != NULL) - { - // Append the data to the buffer - buffer_in->append(data, size * nmemb); - - // How much did we write? - return size * nmemb; - } - return 0; - } -}; - -CConnect* CConnect::getInstance() -{ - static CConnect* instance = NULL; - if(!instance) - instance = new CConnect(); - return instance; -} - -CConnect::CConnect() -{ - //sockfb=0; -} - -CConnect::~CConnect() -{ - // -} - -#if 0 -/****************************************************************************** - * functions - ******************************************************************************/ -#endif -int CConnect::connect2Host(const char *adr, int port) -{ - //IPv4 or IPv6 - int sockfd, rv; - struct addrinfo hints, *servinfo, *p; - - ostringstream s_port; - s_port << port; - - memset(&hints, 0, sizeof hints); - hints.ai_family = AF_UNSPEC; // use AF_INET6 to force IPv6 - hints.ai_socktype = SOCK_STREAM; - - if ((rv = getaddrinfo(adr, s_port.str().c_str(), &hints, &servinfo)) != 0) { - fprintf(stderr, "[%s] - getaddrinfo: %s\n", BASENAME, gai_strerror(rv)); - return(-1); - } - - //loop through all the results and connect to the first we can - for(p = servinfo; p != NULL; p = p->ai_next) - { - if (debug) - printf("[%s] - Try to connect to %s on port %i\n", BASENAME, adr, port); - - if ((sockfd = socket(p->ai_family, p->ai_socktype,p->ai_protocol)) == -1) { - perror("socket"); - continue; - } - - if (connect(sockfd, p->ai_addr, p->ai_addrlen) == -1) { - close(sockfd); - perror("connect"); - continue; - } - - break; //if we get here, we must have connected successfully - } - - if (p == NULL) { - //looped off the end of the list with no connection - fprintf(stderr, "[%s] - failed to connect\n", BASENAME); - return(-1); - } - - freeaddrinfo(servinfo); //all done with this structure - return(sockfd); -} - -string CConnect::post2fritz(const char* url, int port, const string data, const string curlOutFile) -{ - CURL *curl; - CURLcode result; - - // Create our curl handle - curl = curl_easy_init(); - - //errors - char errorBuffer[CURL_ERROR_SIZE]; - - // Write all expected data in here - string buffer; - - if(!curl){ - cerr << "Error init Curl!" << endl; - return string(); - } - - curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorBuffer); - curl_easy_setopt(curl, CURLOPT_URL, url); - curl_easy_setopt(curl, CURLOPT_HEADER, 0); - curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/5.0"); - curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); - curl_easy_setopt(curl, CURLOPT_VERBOSE, debug?1:0); - curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0); - curl_easy_setopt(curl, CURLOPT_PORT, port); - - if(!data.empty()) - { - curl_easy_setopt(curl, CURLOPT_POST, 1); - curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data.c_str()); - // print CURLOPT_POSTFIELDS - if(debug > 1 && !data.empty()) {cout << '[' << BASENAME << "] - CURLOPT_POSTFIELDS: " << data << endl;} - } - - FILE *tmpFile = fopen(curlOutFile.c_str(), "w"); - if (tmpFile) { - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, NULL); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, tmpFile); - } else { - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurledClass::writer); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer); - } - - // Attempt to retrieve the remote page - result = curl_easy_perform(curl); - - // Always cleanup - curl_easy_cleanup(curl); - if (tmpFile) - fclose(tmpFile); - - if(debug > 1){ - if(curlOutFile.empty()) - cout << "DEBUG-OUT" << ">>" << buffer << "<<" << "DEBUG-OUT END" << endl; - else - cout << "DEBUG-OUT" << ">>" << curlOutFile << "<<" << "DEBUG-OUT END" << endl; - } - - if(result == CURLE_OK) - return(buffer); - - return string(); -} - -int CConnect::get2box(const char* host, int port, const char* msg, const char* upwd, const char* msgtype, int msgtimeout) -{ - ostringstream url; - - if(debug) {cout << '[' << BASENAME << "] - " << __FUNCTION__ << "()" << endl;} - - url << host << "/control/message?" << msgtype << "=" << msg << "&timeout=" << msgtimeout; - - string s = post2fritz(url.str().c_str(), port); - - return(1); -} - -int CConnect::get_challenge() -{ - ostringstream url; - - if(debug) {cout << '[' << BASENAME << "] - " << __FUNCTION__ << "()" << endl;} - - //if(mysockfb <= 0){ - // printf("[%s] - CConnect::get_challenge(): ERR connect2Host\n", BASENAME); - // return 0; - //} - - //url << "/cgi-bin/webcm?getpage=../html/login_sid.xml"; // Firmwareversion xx.04.74 - url << FritzAdr << "/login_sid.lua"; // OS 5.50 - - string s = post2fritz(url.str().c_str()); - - //search - string s1 = ""; - string s2 = ""; - string token; - size_t pos = 0; - - if((pos = s.find(s1)) != string::npos) - { - s.erase(0, pos + s1.length()); - - pos = 0; - if((pos = s.find(s2)) != string::npos) - { - s.erase(pos, s.length()); - if(!s.empty()) - { - strncpy(challenge,s.c_str(),sizeof(challenge)); - if(debug) {printf("[%s] - CHALLENGE %s \n", BASENAME, challenge);} - return 1; - } - } - } - - printf("[%s] - failed to get CHALLENGE\n", BASENAME); - return 0; -} - -int CConnect::get_md5(const char *challenge, char *fritzPW) -{ - //convert to utf16 - //http://www.avm.de/de/Extern/Technical_Note_Session_ID.pdf - unsigned int i; - int y = 0; - - string utf8_str = (string) challenge + "-" + (string) UTF8toISO(fritzPW); - string utf16_str = (""); - - if(debug > 1) - printf("[%s] - Challenge-Password = \"%s-%s\"\n",BASENAME, challenge, UTF8toISO(fritzPW)); - - if(debug) - printf("[%s] - Binary for hash = ", BASENAME); - - for (i=0; i < utf8_str.length(); i++) - { - y = i*2; - // change UNICODE > 255 in 46 (".") - if (utf8_str[i] > 0xAD) - { - utf16_str += '\x2E'; - utf16_str += '\x00'; - } - else - { - utf16_str += utf8_str[i]; - utf16_str += '\x00'; - } - if (debug) - printf("%02x%02x",utf16_str[y],utf16_str[y+1]); - } - if (debug) - printf("\n"); - - //get md5sum from utf16 binary hash - MD5_CTX ctx; - //struct MD5Context ctx; /*md5.h"*/ - - MD5_Init(&ctx); - MD5_Update(&ctx, utf16_str.c_str(), strlen(utf8_str.c_str())*2)/*size*/; - MD5_Final(digest, &ctx); - - strcpy((char *)md5sum,""); - - for (i = 0; i < 16; i++) { - char fdigest[5]; - sprintf(fdigest,"%02x", digest[i]); - strcat((char *)md5sum, fdigest); - } - - if(debug) - cout << '[' << BASENAME << "] - MD5 hash = " << md5sum << " (" << strlen((char *)md5sum) << ')' << endl; - - return(strlen((char *)md5sum)); -} - -int CConnect::get_sid(const char *challenge, const unsigned char *md5) -{ - ostringstream command; - - command << "login:command/response=" - << challenge << '-' << md5 - << "&getpage=../html/login_sid.xml"; - - if(debug) {cout << '[' << BASENAME << "] - " << __FUNCTION__ << "()" << endl;} - - string s = post2fritz(FritzAdr,80, command.str()); - if(debug) {cout << s << endl;} - - //search - string s1 = ""; - string s2 = ""; - string token; - size_t pos = 0; - - if((pos = s.find(s1)) != string::npos) - { - s.erase(0, pos + s1.length()); - - pos = 0; - if((pos = s.find(s2)) != string::npos) - { - s.erase(pos, s.length()); - if(s != "0000000000000000" && !s.empty()) - { - strncpy(sid,s.c_str(),sizeof(sid)); - if(debug) {printf("[%s] - SID %s \n", BASENAME, sid);} - return 1; - } - } - } - - printf("[%s] - failed to get SID\n", BASENAME); - return(0); -} - -int CConnect::get_sid_LUA(const char *challenge, const unsigned char *md5) -{ - ostringstream url, command; - - url << FritzAdr << "/login_sid.lua"; - - command << "response=" - << challenge << '-' << md5; - - if(debug) {cout << '[' << BASENAME << "] - " << __FUNCTION__ << "()" << endl;} - - string s = post2fritz(url.str().c_str(),80, command.str()); - - //search - string s1 = ""; - string s2 = ""; - string token; - size_t pos = 0; - - if((pos = s.find(s1)) != string::npos) - { - s.erase(0, pos + s1.length()); - - pos = 0; - if((pos = s.find(s2)) != string::npos) - { - s.erase(pos, s.length()); - if(s != "0000000000000000" && !s.empty()) - { - strncpy(sid,s.c_str(),sizeof(sid)); - if(debug) {printf("[%s] - SID %s \n", BASENAME, sid);} - return 1; - } - } - } - -/* //split into line - string delimiter = "\n"; - string token; - size_t pos = 0; - - while ((pos = s.find(delimiter)) != string::npos) { - i++; - token = s.substr(0, pos); - if(debug) {cout << "rec[" << i << "]" << token << endl;} - s.erase(0, pos + delimiter.length()); - } -*/ - - printf("[%s] - failed to get SID\n", BASENAME); - return(0); -} -#if 0 -/****************************************************************************** - * tools - ******************************************************************************/ -#endif -char *CConnect::trim(char *txt) -{ - register int l; - register char *p1, *p2; - - if (*txt==' ') - { - for (p1=p2=txt; - (*p1==' ') || (*p1=='\t') || (*p1=='\n') || (*p1=='\r'); - p1++); - while (*p1) - *p2++=*p1++; - *p2='\0'; - } - if ((l=strlen(txt))>0) - for (p1=txt+l-1; - (*p1==' ') || (*p1=='\t') || (*p1=='\n') || (*p1=='\r'); - *p1--='\0'); - return(txt); -} - -char *CConnect::UTF8toISO(char *txt) -{ - //'ä','ö','ü','Ä','Ö','Ü','ß' - const char iso[7]={'\xe4','\xf6','\xfc','\xc4','\xd6','\xdc','\xdf'}, //ISO-8859-1 ö = 0xf6 - utf[7]={'\xa4','\xb6','\xbc','\x84','\x96','\x9c','\x9f'}; //UTF-8 ö = 0xc3 0xb6 - - int i,found,quota=0; - char *rptr=txt,*tptr=txt; - - while(*rptr != '\0') - { - if(*rptr=='\'') - { - quota^=1; - } - if (!quota && *rptr=='\xc3' && *(rptr+1)) - { - found=0; - for(i=0; i<(int)sizeof(utf) && !found; i++) - { - if(*(rptr+1)==utf[i]) - { - found=1; - *tptr=iso[i]; - ++rptr; - } - } - if(!found) - { - *tptr=*rptr; - } - } - else - { - *tptr=*rptr; - } - tptr++; - rptr++; - } - *tptr=0; - return(txt); -} - -int CConnect::ExistFile(const char *fname) -{ -FILE *efh; - - if((efh=fopen(fname,"r"))==NULL) - { - return(0); - } - fclose(efh); - return(1); -} - -int CConnect::TouchFile(const char *fname) -{ -FILE *tfh; - - if((tfh=fopen(fname,"w"))==NULL) - { - return(0); - } - fclose(tfh); - return(1); -} - -string CConnect::timestamp() -{ - ostringstream txt; - - time_t timestamp; - tm *now; - - timestamp = time(0); - now = localtime(×tamp); - - txt << '[' - << setfill('0') << setw (2) << static_cast(now->tm_hour) - << ':' - << setfill('0') << setw (2) << static_cast(now->tm_min) - << ':' - << setfill('0') << setw (2) << static_cast(now->tm_sec) - << ']'; - - return txt.str(); -} - -void CConnect::get_time(int *wday,int *hour,int *min) -{ - time_t timestamp; - tm *now; - - timestamp = time(0); - now = localtime(×tamp); - - *wday=now->tm_wday; - *hour=now->tm_hour; - *min=now->tm_min; -} - -int CConnect::my_atoi(const string text) -{ - //atoi c++ way - int val; - stringstream s(text); - s >> val; - return(val); -} - -string CConnect::itoString (int& i) -{ - stringstream temp; - temp << i; - return temp.str(); -} - -void CConnect::StringReplace(string &str, const string search, const string rstr) -{ - stringstream f(search); // stringstream f("string1;string2;stringX"); - string s; - while (getline(f, s, ';')) - { - string::size_type ptr = 0; - string::size_type pos = 0; - - while((ptr = str.find(s,pos)) != string::npos) - { - str.replace(ptr,s.length(),rstr); - pos = ptr + rstr.length(); - } - } -} - -string CConnect::parseString(const char* var, string& string_to_serarch) -{ - string res=""; - size_t pos1, pos2; - - if((pos1 = string_to_serarch.find(var)) != string::npos) - { - // "ver":"84.05.50" - pos1 += strlen(var)+3; - string tmp = string_to_serarch.substr(pos1); - - if((pos2 = tmp.find('"')) != string::npos) - { - res = tmp.substr(0,pos2); - //cout << " result: " << var << " = " << res << endl; - } - } - else - cout << " no result for " << '"' << var << '"' << res << endl; - - return(res); -} - -string CConnect::parseString(string search1, string search2, string str) -{ - string ret, search; - size_t pos_wildcard, pos_firstline, pos_search1, pos_search2; - pos_wildcard = pos_firstline = pos_search1 = pos_search2 = string::npos; - - if((pos_wildcard = search1.find('*')) != string::npos) - { - search = search1.substr(0, pos_wildcard); - //cout << "wildcard detected" << '\t' << "= " << search << "[*]" << search1.substr(pos_wildcard+1) << endl; - } - else - search = search1; - - //cout << "search1" << "\t\t\t" << "= " << '"' << search << '"' << endl; - if((pos_search1 = str.find(search)) != string::npos) - { - //cout << "search1 found" << "\t\t" << "= " << '"' << search << '"' << " at pos "<< (int)(pos_search1) << " => " << str << endl; - - pos_search1 += search.length(); - - if(pos_wildcard != string::npos) - { - size_t pos_wildcard_ext; - string wildcard_ext = search1.substr(pos_wildcard+1); - - //cout << "wildcard_ext" << "\t\t" << "= " << '"' << wildcard_ext << '"' << endl; - if((pos_wildcard_ext = str.find(wildcard_ext,pos_wildcard+1)) != string::npos) - { - //cout << "wildcard_ext found" << "\t" << "= " << '"' << wildcard_ext << '"' << " at pos "<< (int)(pos_wildcard_ext) << " => " << str << endl; - pos_search1 = pos_wildcard_ext + wildcard_ext.length(); - } - else - { - //cout << "wildcard_ext not found in line " << acc << " - exit" << endl; - return(""); - } - } - } - else - { - //cout << "search1 not found in line " << acc << " - exit" << endl; - return(""); - } - - if(pos_search1 != string::npos) - { - //cout << "search2 " << "\t\t" << "= " << '"' << search2 << '"' << endl; - - if(search2 == "\n") - { - ret = str.substr(pos_search1, str.length() - pos_search1); - return(ret); - } - - if((pos_search2 = str.find(search2, pos_search1)) != string::npos) - { - if(search2.empty()) - pos_search2 = str.length(); - - //cout << "search2" << "\t\t\t" << "= " << '"' << search2 << '"' << " found at "<< (int)(pos_search2) << " => " << str << endl; - ret = str.substr(pos_search1, pos_search2 - pos_search1); - } - //else - //cout << "search2 not found in line " << acc << " - exit" << endl; - - } - - return(ret); -} -#if 0 -/****************************************************************************** - * get login to Fritz!Box - ******************************************************************************/ -#endif -int CConnect::get_login(const char* fritzPW) -{ - if (!get_challenge()) { - printf("[%s] - ERROR get Challenge\n", BASENAME); - return(0); - } - - get_md5(challenge,(char*)fritzPW); - - if(!get_sid_LUA(challenge,md5sum)) //after 5.5x - { - printf("[%s] - login_sid.lua not found\n", BASENAME); - if(!get_sid(challenge,md5sum)) //before 5.5x - { - printf("[%s] - ERROR get SID\n", BASENAME); - return 0; - } - } - return(1); -} -#if 0 -/****************************************************************************** - * send logout to Fritz!Box - ******************************************************************************/ -#endif -int CConnect::send_logout(const char *sid) -{ - ostringstream url, command; - - url << FritzAdr << "/cgi-bin/webcm"; - command << "sid=" << sid - << "&security:command/logout=&getpage=../html/confirm_logout.htlm"; - - if(debug) {cout << '[' << BASENAME << "] - " << __FUNCTION__ << "()" << endl;} - - //(w_fritz, "GET /home/home.lua?sid=%s&logout=1 HTTP/1.1\r\nHost: 192.168.99.254\r\n\r\n", sid); - - string s = post2fritz(url.str().c_str(),80, command.str().c_str()); - - return(1); -} -#if 0 -/****************************************************************************** - * send query's to Fritz!Box - ******************************************************************************/ -#endif -int CConnect::send_refresh(const char *sid) -{ - ostringstream url, command; - - url << FritzAdr << "/cgi-bin/webcm"; - command << "getpage=../html/query.txt" - << "&var:n[0]=telcfg:settings/RefreshJournal" - << "&var:n[1]=telcfg:settings/Journal/count" - << "&sid=" << sid; - - if(debug) {cout << '[' << BASENAME << "] - " << __FUNCTION__ << "()" << endl;} - - string s = post2fritz(url.str().c_str(),80, command.str().c_str());; - - return(0); -} - - -void CConnect::parseXML(const string text) -{ - device d; - int tag=0, val=0; - string tagname, value; - char* t= (char*) text.c_str(); - - d.tist = -1; - d.tsoll = -1; - d.absenk = -1; - d.komfort = -1; - - while (*t!=0) - { - if(*t=='<') - { - tag=1; - val=0; - if(!value.empty()) - { - if(tagname=="name") d.name = value; - if(tagname=="mode") d.mode = value; - if(tagname=="present") d.present = my_atoi(value); - if(tagname=="state") d.state = my_atoi(value); - if(tagname=="lock") d.lock = my_atoi(value); - if(tagname=="power") d.power = my_atoi(value); - if(tagname=="energy") d.energy = my_atoi(value); - if(tagname=="celsius") d.celsius = my_atoi(value); - if(tagname=="offset") d.offset = my_atoi(value); - if(tagname=="tist") d.tist = my_atoi(value); - if(tagname=="tsoll") d.tsoll = my_atoi(value); - if(tagname=="absenk") d.absenk = my_atoi(value); - if(tagname=="komfort") d.komfort = my_atoi(value); - } - value=""; - tagname=""; - } - - if(*t!='>' && *t!='<') - { - if(tag==1) - tagname += *t; - - if(val==1) - value += *t; - } - - if(*t=='>') - { - tag=0; - val=1; - if(strstr(tagname.c_str(),"identifier=")) - { - string s = parseString("identifier=\"","\"",tagname); - StringReplace(s," ",""); - d.identifier = s; - } - if(strstr(tagname.c_str(),"productname=")) - { - string s = parseString("productname=\"","\"",tagname); - StringReplace(s," ",""); - d.productname = s; - } - - if(!strcmp(tagname.c_str(),"/device") || !strcmp(tagname.c_str(),"/group")) - devices.push_back(d); - } - - t++; - } -} - -void CConnect::send2actor(const unsigned int& inx, int& t_soll) -{ - int state_soll = -1; - int temperature = 0; - - if(devices[inx].productname=="FRITZ!DECT200") - { - cout << '[' << BASENAME << "]\t\tTemperature: Plan(" << t_soll << ")/Now(" << devices[inx].celsius << "); state: " << (devices[inx].state == 1 ? "ON":"OFF") << endl; - - // convert special temperature - switch(t_soll) { - case 1: state_soll = 1; // switch on - break; - case 0: state_soll = 0; // switch off - break; - } - - if(state_soll == -1) { - if(t_soll <= devices[inx].celsius) - { //temperature okay - cout << '[' << BASENAME << "]\t\tTemperature okay"<< endl; - state_soll = 0; - } - else if(t_soll > devices[inx].celsius) - { //temperature to low - cout << '[' << BASENAME << "]\t\tTemperature to low"<< endl; - state_soll = 1; - } - } - - if(state_soll >= 0 && state_soll != devices[inx].state) - { - cout << '[' << BASENAME << "]\t\t" << "\033[0;32m" << "sending Deviceswitch "<<(state_soll == 0? "OFF":"ON") << "\033[0m" << endl; - - if(state_soll == 0) - smartHome(sid, "setswitchoff", devices[inx].identifier); - else - smartHome(sid, "setswitchon", devices[inx].identifier); - } - else - cout << '[' << BASENAME << "]\t\t" << "\033[0;31m" << "send nothing to actor, state is equal" << "\033[0m" << endl; - - // set flagfile - string flag="/var/etc/.device_" + devices[inx].identifier; - setFlag(flag.c_str(),state_soll); - } - else if(devices[inx].productname=="CometDECT" || devices[inx].productname=="FRITZ!DECT300") - { - cout << '[' << BASENAME << "]\t\tTemperature: Plan " << t_soll << " (" << (t_soll > 1 ? t_soll * 0.2 : t_soll) << "), tist(" << devices[inx].tist << "); tsoll(" << devices[inx].tsoll << ')' << endl; - - // convert temperature - switch(t_soll) { - case -1: temperature = -1; // do nothing - break; - case 0: temperature = 253; // switch off - break; - default: temperature = t_soll * 0.2; // temperature step up to 0.5°, 43 = 21,5° - break; - } - - if(devices[inx].tsoll != temperature) // check if plan temperature stored in actor - { - if(temperature == -1) - cout << '[' << BASENAME << "]\t\t" << "\033[0;31m" << "send nothing to actor while Plan value is (-1)" << "\033[0m" << endl; - else { - cout << '[' << BASENAME << "]\t\t" << "\033[0;32m" << "send new tsoll temperature (" << temperature << ") to actor" << "\033[0m" << endl; - - string command = "sethkrtsoll¶m=" + itoString(temperature); - smartHome(sid, command.c_str(), devices[inx].identifier); - } - } - else - cout << '[' << BASENAME << "]\t\t" << "\033[0;31m" << "send nothing to actor, storred tsoll temperature is equal" << "\033[0m" << endl; - } - else - cout << '[' << BASENAME << "]\t\t" << "\033[0;32m" << "productname \"" << devices[inx].productname << "\" not found" << "\033[0m" << endl; -} - -int CConnect::checkdevice(map >& w, map >& t) -{ - int wday,hour,min,ret=-1; - - get_time(&wday,&hour,&min); - - // for building device index - unsigned int dev_inx = 0; - - for(vector::iterator dev = devices.begin(); dev != devices.end(); ++dev, ++dev_inx) - { - // find cdw map key by device id - map >::iterator dev_search = w.find((*dev).identifier); - if(dev_search != w.end()) - { - // check config table syntax - if(dev_search->second.size() != 7) { - cout << "[ERROR] - " << __FUNCTION__ << "(): WP table syntax error, we must have 7 values per line\n"; - return(ret); - } - - // get map value for weekday - string w_value = dev_search->second[wday]; - cout << '[' << BASENAME << "] - " << __FUNCTION__ << "(): device[" << (*dev).identifier << "] weekday = " << wday << ", value = " << w_value << ", name = " << (*dev).name << endl; - - // find cdt map key by cdw value - map >::iterator search = t.find(w_value); - if(search != t.end()) - { - // check config table syntax - if( search->second.size() % 3 != 0 ) { // 3 because HH MM are 2 values - cout << '[' << BASENAME << "] - " << __FUNCTION__ << "(): DP table syntax error, we must have time and temperature pair (HH:MM,TTT)\n"; - return(ret); - } - - // read every time and temperature pair for cdt key - for (unsigned int i=0; i second.size(); ++i) - { - // check time and temperature after reading 3 values (1=HH, 2=MM, 3=temperature) - unsigned int delim = 3; - if( (i+1) % delim == 0) - { - int now = hour *60 + min; - int ev = my_atoi(search->second[i-2]) * 60 + my_atoi(search->second[i-1]); - int next_ev = ev; - int temperature = my_atoi(search->second[i]); - - // check for existing next time event - if( i+1 != search->second.size() ) - next_ev = my_atoi(search->second[i+1]) * 60 + my_atoi(search->second[i+2]); - - if((now >= ev && now <= next_ev) || - (i+1 == search->second.size())) // last event was earlier than now - { - // time event - cout << '[' << BASENAME << "]\t\tTime event = " << ev/60.0 << " temperature = " << temperature << endl; - - send2actor(dev_inx, temperature); - break; - } - } - } - } - else - cout << '[' << BASENAME << "]\t\tvalue not found in DP map" << endl; - } - else - cout << '[' << BASENAME << "] - " << __FUNCTION__ << ": device[" << (*dev).identifier << "] not found in table WP" << endl; - } - - return(ret); -} - -int CConnect::inTime(int index, vector >& week, vector >& day) -{ - int wday,hour,min,ret=-1; - - get_time(&wday,&hour,&min); - int pos = my_atoi(week[index][wday]); - - cout<<'['<1Fritz!Dect Rep 100200-241WZ Stehlampe0manuell004282190-271WZ Freiheitsstatue0auto002167190-170Bananen-Haus1RaspiServer1manuell0436053683210-351Wohnmobil0manuell0012620136-251Testgruppe0manuell017,21"; - parseXML(s); - - //cout <<"identifier;present;name;state;mode;lock;power;energy;celsius;offset;" <::iterator it = devices.begin(); it != devices.end(); ++it, ++x) - { - if(!ain.empty()) - { - if((*it).identifier==ain) - { - cout<<'['<1) - printf("line[%d]: %s", i, line); - - if(i==7) - { - if(strlen(line)>10) { - printf("ERROR\n"); - break; - } - else if(atoi(trim(line))==0) { - printf("res=%s =>disable flag\n",trim(line)); - remove(flag); - break; - } - else { - printf("res=%s =>enable flag\n",trim(line)); - if(!TouchFile(flag)) - printf("ERROR writing flag %s\n",flag); - break; - } - } - } - if(line) - free(line); - - quitfritz(); - return(0); -} -#endif - -int CConnect::get_callerlist(const char *sid, const char *file) -{ - ostringstream url, command; - - if(debug) {cout << '[' << BASENAME << "] - " << __FUNCTION__ << "()" << endl;} - - url << FritzAdr << "/fon_num/foncalls_list.lua?csv="; - command << "refresh=&sid=" << sid; - - string s = post2fritz(url.str().c_str(),80, command.str().c_str(), file); - - return(0); -} diff --git a/archive-sources/FritzCallMonitor/connect.h b/archive-sources/FritzCallMonitor/connect.h deleted file mode 100644 index 289ae47c..00000000 --- a/archive-sources/FritzCallMonitor/connect.h +++ /dev/null @@ -1,97 +0,0 @@ - -#ifndef __connect_h__ -#define __connect_h__ - -#ifdef HAVE_CONFIG_H -#include -#endif - -using namespace std; - -class CConnect -{ - public: - CConnect(); - ~CConnect(); - static CConnect* getInstance(); - - struct device { - string identifier; - string productname; - string name; - string mode; - int present; - int state; - int lock; - int power; - int energy; - int celsius; - int offset; - int tist; - int tsoll; - int absenk; - int komfort; - }; - - vector devices; - - int connect2Host(const char *adr, int port); - int get2box(const char* host, int port, const char* msg, const char* upwd, const char* msgtype, int msgtimeout); - int get_login(const char* fritzPW); - int send_refresh(const char *sid); - int get_callerlist(const char *sid, const char *file); - int send_logout(const char *sid); - int send_TAMquery(const char* flag, const char *sid, const char *searchstr); - int my_atoi(const std::string text); - string itoString (int& i); - int smartHome(const char *sid, const char *command, const std::string ain = ""); - void get_time(int *wday,int *hour,int *min); - void parseXML(const string text); - void StringReplace(string &str, const string search, const string rstr); - int inTime(int index, vector >& week, vector >& day); - // this is the "old" way for FRITZ!DECT - void checkdevice(vector& dectid, vector& temp, vector< vector >& week, vector< vector >& day); - // check Comet DECT device - int checkdevice(map >& w, map >& t); - virtual void cleardevice(){ devices.clear(); }; - - string timestamp(); - string query2fritz(const char* command); - string parseString(const char* var, string& string_to_serarch); - string parseString(string search1, string search2, string str); - string post2fritz(const char* url, int port = 80, const string data = "", const string curlOutFile = ""); - - virtual void setDebug(const int Debug){debug = Debug;}; - virtual const char* getSid(){return sid;}; - virtual void setFritzAdr(const char* Adr){FritzAdr = Adr;}; - virtual void setFritzPort(const int Port){FritzWebPort = Port;}; - - private: - FILE *r_fritz; - FILE *w_fritz; - //int sockfb; - int debug; - char challenge[20]; - char sid[20]; - int FritzWebPort; - const char* FritzAdr; - - unsigned char digest[16]; - unsigned char md5sum[33]; - - int get_challenge(); - int get_md5(const char *challenge, char *FritzPW); - int get_sid(const char *challenge, const unsigned char *md5); - int get_sid_LUA(const char *challenge, const unsigned char *md5); - int get_challenge(const char* host, int port,const char* fritzPW); - void setFlag(const char *flag, const int& i); - // send command to DECT actor - void send2actor(const unsigned int& inx, int& t_soll); - - char *trim(char *txt); - char *UTF8toISO(char *txt); - int ExistFile(const char *fname); - int TouchFile(const char *fname); -}; - -#endif //__connect_h__ diff --git a/archive-sources/FritzCallMonitor/fritzcallmonitor.init b/archive-sources/FritzCallMonitor/fritzcallmonitor.init deleted file mode 100755 index f6999684..00000000 --- a/archive-sources/FritzCallMonitor/fritzcallmonitor.init +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -. /etc/init.d/globals - -case $1 in - start) - if [ -e /var/etc/.fritzcallmonitor ]; then - SHOWINFO "starting ..." - /bin/FritzCallMonitor & - fi - ;; - stop) - SHOWINFO "stopping ..." - killall FritzCallMonitor - ;; - *) - echo "[${BASENAME}] Usage: $0 {start|stop}" - ;; -esac diff --git a/archive-sources/FritzCallMonitor/hint_FritzCallMonitor.png b/archive-sources/FritzCallMonitor/hint_FritzCallMonitor.png deleted file mode 100644 index 4ec3e8fc..00000000 Binary files a/archive-sources/FritzCallMonitor/hint_FritzCallMonitor.png and /dev/null differ