fritzbox-1.5.3/0000755000175000017500000000000012467661105012723 5ustar tobiastobiasfritzbox-1.5.3/HISTORY0000644000175000017500000011216612467660216014020 0ustar tobiastobiasVDR Plugin 'fritzbox' Revision History -------------------------------------- 2007-04-22: Version 0.0.1 - Initial version. 2007-05-02: Version 0.0.2 - Made TCP connection handling more robust and simpler - extended the compatibility list in README - replaced vector::at in favor to vector[] to avoid possible problems with gcc-2.95 (thanks goes to Tobias [1] for testing this) - made plugin compatible to LinVDR 0.7 please apply provided patch file linvdr-0.7-fritzbox-*.diff (patch provided by Tobias [1]) - main menu entry can now be hidden (suggested by pimboli [2]) - german umlauts and other sonderzeichen are now displayed correctly (bug found by Christian [3]) - showing line numer on incoming VoIP call - showing msn on incoming ISDN call (suggested by Christian [3]) - added a hint about dialing "#96*5*" with an ISDN telephone to README (problem reported by mentox [4]) - displaying incoming calls can now be switched off in setup (suggested by Markus [5]) - fixed MuteOnCall with multiple concurrent incoming calls, i.e. VDR is unmuted, when the last incoming call ends - added russian translation (provided by neptunvasja [6]) 2007-06-03: Version 0.0.3 - fixed a typo in "Call from unknown extension" translation - added an include for better gcc-2.95 compatibility - & is now correctly displayed in telephone book - extended README to include new features - extended README to include some hints for ISDN telephones (provided by Strider [7]) - fixed handling of mute on call, such that outgoing calls can no longer interfere with this (reported by KingJerry[8]) - fixed a bug in the call list parser that caused invalid entries - fixed a bug in replaceEntities() on 64-bit systems (patch provided by Bernd [9]) - replaceEntities() now replaces multiple occurences of the same entity (reported by Bernd [9]) - calls are now repeatedly shown until the call is accepted or the caller hangs up (as suggested by Strider [7]) - pressing [OK] in the call lists now initiates a call as in the phone book menu - implemented MSN-Filter: only calls to certain MSNs are shown (suggested by Christian [3]) - added local number to call lists. This can be configured in the plugin's setup (suggested by Christian [3]) - the password of the Fritz!Box is no longer displayed in the plugin's setup page - instead all characters are replaced by an '*' - fixed a bug in auto muting, that caused possible unmuting without a prior auto mute - updated russian translations (provided by neptunvasja [6]) 2007-06-24: Version 0.0.4 - added french translation (provided by Patrice [10]) - fix for outdated call lists (suggested by Bernd [9] and many others with similar suggestions) - implemented new "pause on call" feature, that pauses a running replay during an incoming call (suggested by Reinhard [11]) - reduced syslog-verbosity when loading call-lists or phonebook - Fritz!Box now recognizes the system codepage when displaying phonebook and call lists (only with VDR >= 1.5.3) 2007-07-22: Version 0.0.5 - fixed translation of "PB" - failed logins to the Fritz!Box are now logged to syslog - support for special characters in Fritz!Box password - fixed "pause on call" - do not start a live pause on incoming call - pause only when a replay is running and not paused - do not stop a replay on hangup (reported by and suggestions from Bernd [9], Dirk [12] and Oktay [13]) 2007-09-04: Version 0.0.6 - added turkish translation (provided by Oktay [13]) - added support for gettext (VDR >= 1.5.7), plugin is still compatible with older versions - MSN filter is now also applied to all call lists (reported by Saxman2k [14]) - implemented a submenu, that shows all details of a specific call in any call list - dropped duration column in call lists (as this is available on the detail screen now) - dynamic column layout in call lists results in better usage of the osd screen - new setup option "Group call lists by date" results in even better usage of the osd screen :-) - Modified support for gettext (VDR >= 1.5.8) plugin is still compatible with older versions - rearranged targets in the makefile according to a discussion in the VDR mailing list - corrected a call to memset in fritzlistener.c (patch provided by Axel [15]) - added some missing close-calls to prevent VDR from crashing with error message "too many open files" (patch provided by Axel [15]) - reducing network load by resolving Fritz!Box's ip address only once (patch provided by Axel [15]) - switched name and number column in the phone book; width of the first column is calculated dynamically - using the new trVDR() macro for core translations plugin is still compatible with older versions 2007-09-26: Version 0.0.7 - fixed wrong display of call details when date separator is enabled or call lists are filtered (reported by Saxman2k [14]) - now using std::string::erase for compatibility with old libstdc++2.10 - added some includes for better gcc-2.95 compatibility (patch provided by Tobias [1]) 2007-11-04: Version 0.0.8 - code restructuring and cleanup, preparation for multiple phonebooks etc. - resorted includes for gcc-2.95 - in cMenuCallDetail::SetText(): std::string::npos is not a uint, using std::string::size_type instead (patch provided by Axel [15]) - cFritzListener::Action(): using -1 in memset to be compatible with its arg type (patch provided by Axel [15]) - added missing copyright notices in all sources (reported by Thomas [16]) - implemented reverse lookup phonebook via www.das-oertliche.de - new setup-page for configuring a list of used phonebooks and the order in which they are accessed while resolving numbers to names; in the phonebook view the first displayable phonebook in this list is shown - adapted README accordingly - the call list is now fetched asynchroneously at startup, avoiding the delay in the menu; to keep it up to date, it is reloaded after every call automatically - new makefile target "srcdoc" to generate source code documentation - Improved the 'i18n' target in the Makefile to avoid unnecessary work as suggested by vdr-1.5.11 2007-11-11: Version 0.0.9 - added cHttpClient for handling HTTP requests; removing end of file detection in caller classes - improved cCallList parser to work around lines starting with '#' (as found in current Fritz!Box Labor Firmware version) - call list now works with Fritz!Box Beta-Firmware 29.04.44-9163 (reported by Ryker [20]) - this may fix problems with firmware CH/A FRITZ!Box Fon WLAN 7140 Version 39.04.43 too (reported by Joe [19]) - Fritz!Box phonebook supports new Fritz!Box Beta-Firmware 29.04.44-9163 (only one number per name is supported for now) - all communication to the Fritz!Box Webinterface is now protected with a mutex to avoid conflicts of concurrent request from different threads - retry delay on communication failures is now increased up to one hour to avoid flooding the syslog - added missing translation in i18n.c to support still-popular old versions of vdr (reported by Torsten [17]) - some firmware version do not sort the telephone book, the plugin now sorts the entries itself - removing '!' prefix when displaying Fritz!Box telephonebook VIP-entries (suggested by Oliver [18]) - supporting multiple phone numbers per entry in newest Fritz!Box firmware versions > added new column in phonebook view, marking (H)ome, (M)obile and (W)ork > on incoming calls this type is shown as well > this is ignored for older firmware versions - fixed a segfault when accessing the plugins main menu with no telephonebook selected (reported by Thomas [16]) - the call details menu now issues a reverse lookup if the name of the caller is not known yet 2008-01-06: Version 0.0.10 - including patch to avoid compilation conflicts with C++ STL (suggested by Reinhard [11]) - normalizing numbers before comparison, e.g., handling +4989..., 004989..., and 089 the same. This introduces a new setup option "Country Code". (suggested by Reinhard [11]) - applied retry delay on communication failures to _all_ connection types - applied retry delay on receiving invalid data in cFritzListener to avoid log flooding (reported by Marcus [21]) - added a warning regarding call monitor activation in syslog - fixed cTcpClient to correctly detect a connection reset 2008-02-02: Version 0.0.11 - fixed the "#96*5*"-code in README.de (reported by Hans J�rgen [22]) - fixed request-URL of das-oertliche.de (patch provided by Reinhard [11]) - now always unlocking FritzBoxMutex even when an exception is thrown - fixed wrong logging messages in fritzfonbuch.c claiming to be from calllist.c - an error message is now shown, if the phonebook is not read yet - replaced gethostbyname with threadsafe function getaddrinfo in cTcpClient - improved timing cHttpClient::Read() - simplified socket read in cOertlichesFonbuch::ResolveToName() - now reading country- and regioncode from Fritz!Box; this removes the setup option "Country Code" Set up your location in the Fritz!Box (navigate to "Einstellungen -> Telefonie -> Internettelefonie -> Erweiterte Einstellungen") (thanks to Reinhard [11] for the hint to this option) - now normalizing number when doing a lookup to dasoertliche.de (reported by Reinhard [11]) 2008-03-02: Version 0.0.12 - reading country- and regioncode from Fritz!Box already at startup to avoid lookup delays on incoming calls - modified cTcpClient and cHttpClient to call "recv" non-blocking. This fixes a possible segfault when stopping vdr (reported and fix tested by Frodo [23]) - fixed handling unknown messages in cFritzListener that caused an SIGABRT - fixed reading country- and regioncode from Fritz!Box - changed normalizing numbers ("+" -> "00") This should fix das-oertliche reverse lookup without further modifications. - added italian translation (provided by Diego [24]) - removed compatibility for old VDR versions (i18n-handling, UTF8-handling) This is in preparation for a stable plugin release 1.0.0 for VDR 1.6. Please report release-critical bugs as soon as possible. Further, translation contributions (.po-files) are appreciated. 2008-03-30: Version 0.0.13 - updated french translations (provided by Patrice [10]) - fixed wrong dsyslog output in fritzlistener.c - fixed outputting the '#96*5*5'-hint - fixed an uninitialized socket variable in cTcpClient that caused closing sockets not created by the plugin (e.g., cKbdRemote socket) - updated russian translations (provided by neptunvasja [6]) - fixed translating the plugin description - moved call to cFritzTools::GetPhoneSettings() out of cPluginFritzbox::Initialize() to avoid blocking the main thread - cFritzTools::GetPhoneSettings() handles missing OKZ/LKZ settings in Fritz!Box correctly. If no LKZ is set, 49 is assumed. - extended cFritzListener to handle multiple lines in one message - corrected some dsyslog() calls missing the sourcecode filename > If no serious bugs appear with this release, it will get the stable plugin release 1.0.0 for VDR 1.6. Translation contributions (.po-files) are appreciated. 2008-04-13: Version 1.0.0 - updated italian translations (provided by Diego [24]) - made "This phonebook is not yet available..." error message non-selectable to avoid a segmentation fault when selecting it (reported by ? [25]) 2008-06-10: Version 1.0.1 - fixed a possible buffer overflow when editing MSNs in the plugins' setup - fixed a possible race condition when fetching the call list - instantiating cFritzListener only if needed for on-call events (suggested by Andreas [26]) 2008-07-17: Version 1.1.0 - started new development branch (copy from version 1.0.1) This branch is for development use and curious users only. If you like a stable and reliable environment, please use the stable branch 1.0.x. Distribution maintainers: Please take actions to prevent users from accidentially upgrading from a stable 1.0.x version to this branch. - new setup option "React on calls" allow configuration if the plugin acts on incoming, outgoing or any calls - normalizing outgoing numbers for fonbook lookups, etc. now includes * removing an appended '#' (includes displaying) * removing German call-by-call provider selection codes - implemented support for a local phone book (suggested by neptunvasja [6]) * The fonbook is a csv-file located at $vdrconfigdir/plugins/fritzbox/localfonbuch.csv using the same encoding as VDR * Each line of this file has the pattern ,, For specify 1 (home), 2 (mobile) or 3 (work). - changed function of kRed in the menu * "Reload phonebooks" was moved to the setup menu * new function "Next phonebook" ("> PB") iterates through the displayable phonebooks (the last one shown is remembered beyond vdr restarts) - new setup option "Show detailed call information" If switched to yes, the plugin opens an own OSD screen for notifications instead of using Skins.Message. This way, more information can be displayed (still to be done). - shortened message displaying an incoming call from an unknown extension (suggested by Habib [27]) - the number of missed calls is now announced via the plugins' main menu entry. Enter the "missed calls" list to reset this counter. - main menu entry is shortened to "Fritz!Box" - modifications in the phone book menu * now grouping phone book entries by name * pressing OK now opens a detail menu. Within this detail menu calls can be triggered with kRed, as in all other detail menus (suggested by apex [28]) 2008-07-29: Version 1.1.1 - fixed osd width calculation in cNotifyOsd::Show() - improved detection of unsuccessful logins to the Fritz!Box - made the plugin independent of Fritz!Box's webinterface language (thanks to Gandalf [29] for supporting and testing this) - fixed missing SetHelp() in cMenuFonbuchDetail - fixed possible segfault when pressing OK in empty fonbuch or call list menu (reported and fix tested by Gandalf [29]) - fixed password field in plugin settings to accept empty password (reported by Gandalf [29]) - if no password is set, the plugin no longer tries to login to the Fritz!Box - changed some dsyslog statements to e/isyslog - no longer displaying AVM test-entries ("Max & Moritz") in call lists - cOertlichesFonbuch no longer tries to resolve non german phone numbers - updated russian translations (provided by neptunvasja [6]) 2008-08-20: Version 1.1.2 - changed name of "Das �rtliche"-Fonbuch to "das-oertliche.de". New internet ressources should follow this naming scheme. (based on a bug report of ronnykornexl [30]) - fixed dasoertliche.de fonbuch by adding a user-agent to the http request, which is required by the webserver recently - fixed possible segfault when pressing OK in empty fonbuch menu (reported by ronnykornexl [30]) - made LKZ/OKZ parsing more robust against wrong password - added support for phone books without number-type (e.g., old Fritz!Boxes) in phone book detail screen (reported by ronnykornexl [30]) - fixed possible segfault on invalid data in fritzbox.Fonbooks setup parameter - fixed storing the password, which got lost in some cases - changed default password to an empty one - fixed wrong announcement of missed calls before call list retrieval - fixed typo in german translations (reported by ronnykornexl [30]) 2008-12-20: Version 1.1.3 - added a missing const in cTcpClient::&operator<< - fixed wrong type in comparisons to size_t in cFritzListener, cFritzTools - fixed wrong type in dsyslog output in cNotifyOsd, cLocalFonbuch, cMenuSetupFritzboxFonbooks - fixed compiler warning wrt comparison in cNotifyOsd - updated italian translations (provided by Diego [24]) - implemented reverse lookup function for +31 (Netherlands) - adapting plugin to new Fritz!Box firmware versions: * auto detecting charset encoding when retrieving phonebook entries * modified interface language detection (currently using a trial-and-error approach, because old approach is no longer supported by newest firmware) - splitted plugin into plugin application and three static libraries * libfritz++ (included all Fritz!Box specific functionality) * libtcpclient++ (providing tcp socket communication) * libpthread++ (providing pthread support, independant of VDRs implementation) With this, it is possible to use these libraries in other projects not related to VDR. - all socket communication of the plugin can now be traced into /tmp/tcpclient.trace. If this file exists at VDR startup, tracing is enabled. If not, tracing is disabled. If you experience problems with vdr-fritzbox, this trace may be helpful in debugging the issue. However, please be aware that this trace may contain password and other sensitive information. - modified logging to syslog. All log entries related to this plugin are now prefixed with "vdr-fritzbox:". - removed memory leak in cMenuSetupFritzbox::Store[MSN|Fonbooks] - fixed some compiler warnings that occur with recent compiler versions (4.3.x) - fixed missing includes which prevented compilation with recent compiler versions (4.3.x) 2008-12-31: Version 1.1.4 - adapted to changes in libfritz++: * Added type "ALL" to CallList to retrieve complete list of calls at once. * Moved callType from CallList to CallEntry. * Implemented in-library msn filtering and reverse-lookups. * Renamed various methods in FonbookManager from *Fonbuch* to *Fonbook*. * Made CallList a singleton. * Replaced string tokenizer in Listener. * Refactored MSN-filter functionality. * Added "-fPIC" to Makefiles. * A call to Config::SetupFonbookIDs now deletes a previously instantiated FonbookManager to allow multiple calls to SetupFonbookIDs in case of configuration changes. * Introduced new method CallList::DeleteCallList() to explicitly delete the singleton instance. * Made Listener a singleton. A call to Listener::CreateListener() is used to activate this feature. * Introduced new method CallList::CreateCallList() to explicitly pre-fetch the call list before calling CallList::getCallList(). * Moved Config::SetupFonbookIDs to FonbookManager::CreateFonbookManager(). * Renamed Tools::GetPhoneSettings() to Tools::GetLocationSettings(). * Added resolving of SIP[0-9] to real provider names. - configuration changes of MSN filter, selected fonbooks, hostname and password are now considered immediately without a restart - plugin classes no longer hold own references to fonbook, listener and callList. They now use the static getter methods. - fixed a possible crash when using the plugin with showNumber = pauseOnCall = muteOnCall = false. (patch provided by Andreas [26]) - using new library feature: resolving SIP provider names, instead of signalling SIP0, ... 2009-03-14: Version 1.1.5 - changes in libfritz++ * added exception catch in Tools::GetLang() and Tools::Login() - changes in libpthread++ * added missing include in PThread++.h to fix compiler issue with g++-3.3 2009-05-12: Version 1.1.6 - changes in libfritz++ * Removed the default of countryCode = "49" if Tools::GetLocationSettings() fails. This task is handed over to the caller, see next. * Added new parameters to Config::Setup() to give default values for countryCode and regionCode. The default parameters are used, when auto-detection in Tools::GetLocationSettings() fails. The new parameter locationSettingsDetected indicates whether auto-detection was successful. In this case, the given default values are overwritten to give the caller access to the new values. * Fixed naming of local phonebook. The recommended name is now localphonebook.csv, the old name localfonbuch.csv is still accepted. The directory remains $vdrconfigdir/plugins/fritzbox/. - added new setup options for country code and region code. If the plugin is unable to detect these automatically (e.g., with some older Fritz!Boxes) the values are taken from these setup options. (reported by Ronny [30]) 2009-05-28: Version 1.2.0 - updated italian translations (provided by Diego [24]) - changes in libfritz++ * Updated OertlichesFonbook to new website layout (fix provided by Matthias [31]) 2009-08-27: Version 1.3.0. - fixed naming of local phonebook. The plugin now really looks for a file called localphonebook.csv. (reported by Tobias [1]) - fixed missing translation of phonebooks in cMenuSetupFritzboxFonbooks - fixed missing translation of phonebook entries with type TYPE_NONE - first implementation to add call list entries to active phonebook. - now saving status of last known missed calls as soon as possible to avoid data loss if VDR does not shutdown cleanly (suggested by Keine_Ahnung [32]) - moved plugin initialization from cPluginFritzbox::Start() into a separated thread to speed up VDR startup when expecting slow network links - changes in libfritz++ * Implemented new login method for Fritz!Box firmware >= xx.04.74 using SIDs. This needs features from openssl library. For compiling, libssl-dev (or similar) is needed. * Fixed a warning warn_unused_result in LocalFonbook.cpp * Fixed wrong HTTP-GET header in Nummerzoeker.cpp - adapting Makefile to support new features of libfritz++: Libssl is now needed to compile and/or run the plugin. 2009-11-21: Version 1.3.1 - changes in libfritz++ * fixed detection of login failure in Tools::Login() * improved cleanup when deleting Listener, FritzFonbook, CallList * delay destructor of FritzFonbook and CallList to wait for running threads to end * improved concurrent access to Fritz!Box using new FritzClient class * fixed entity decoding in FritzFonbook.cpp (reported and fix tested by Torsten [17]) * improved detection of login type (SID or PASSWORD), which is now done only once * improved login to Fritz!Box to avoid unneccessary logins * fixed TcpClient to throw correct exceptions on connect this fixes detection of disabled call monitor, the corresponding hint "dial #96*5*" is now shown in syslog again * improved matching of phone numbers: Fritz!Box control codes *xxx# are now ignored. (suggested by koronth [34]) - added configuration option to choose default screen when calling the plugins' main menu action. - fixed a possible crash when changing the plugins setup - improved responsiveness when storing the plugins setup - both detail screens (call details and phonebook entry details) can now be closed with OK button, too (patch provided by Uwe [33]) 2010-01-02: Version 1.3.2 - changes in libfritz++ * added missing include in FritzClient.cpp (patch provided by hotzenplotz5 [35]) * fixed retry delay calculation in case of connection refused * simplified implementation of connection disconnect this possibly fixes a crash when changing the plugins setup with FB call monitor disabled (reported by Frank [36]) - updated italian translations (provided by Diego [24]) 2010-05-30: Version 1.3.3 - changes in libfritz++ and libtcpclient++ * Fixed missing initialization of HttpClientBuf::state * Improved thread safety in TcpClient: deleting TcpClient while reading from stream in another thread caused memory corruption * Improved destructor of Listener to allow proper cleanup of thread * Fixed some warnings about ununsed parameters in base-classes and empty implementations * removed FonbookEntry::getTypeName() as this is something the consumer has to take care about * introduced I18N_NOOP macro, this allows application that use libfritz++ to identify strings delivered by the library (e.g., using xgettext) they should localize * removed dependency to OpenSSL due to licensing issues, libfritz++ now needs libgcrypt's development header "gcrypt.h" to compile * modified logging to handle full path filenames cause by cmake in __FILE__. Provided new logging macros DBG, INF, ERR * Fixed a possible issue with "thread-safety" of TcpClient, a TcpClient object can now be deleted out of another thread while running - the changes in libfritz++ and libtcpclient++ should improve overall plugin stability especially at shutdown and configuration changes (thx to Torsten [17] and Marcus [21] for testing) - removed some translation hints which are now provided by libfritz++ directly - implemented cPluginFritzbox::FonbookEntryToName to adapt to changes in libfritz++ - linking to libgcrypt instead of openssl now because of licensing issues - adapted logging to libfritz++ - adapted Makefile to VDR >= 1.7.13 2010-07-04: Version 1.3.4 - changes in libfritz++ * now parsing the Fritz Box's phone book via xml export file (if available) * FritzFonbook is now writeable, if FB xml import is available (firmware >= xx.04.76 needed) * phone book entries now have the additional fields "quickdial", "vanity", "priority", "important" * Fixed decoding of entities in xml phone book parser * Modified FonbookEntry class: one FonbookEntry now holds all numbers of a person: Changed construction of FonbookEntrys accordingly, Changed interface of Fonbook::ResolveToName, Adapted FritzFonbook's parser, Adapted LocalFonbook's parser, Adapted ResolveToName in NummerzoekerFonbook and OertlichesFonbook * Adapted local phonebook to use the same xml format, new FB versions use. Existing csv phone books are converted to xml automagically, entries with TYPE_NONE are converted to TYPE_HOME * Updated OertlichesFonbook to website changes (patch provided by [38]) - adapted to changes in libfritz++ Note: not all new features of libfritz++ are currently used in the plugin - added setup option "Resume after call" Up to now the setup option "Pause on call" included both, stopping *and* resuming playback on the corresponding call events. This has been splitted now. "Pause on call" now only controls playback stopping. "Resume after call" controls, if VDR resumes a previously stopped playback after all calls have been finished. The old behaviour is preserved on upgrade. (suggested by Zimbo [37]) 2010-07-29: Version 1.3.5 - changes in libfritz++ * Fixed resolving of calls from unknown caller (reported by Honky [39] * Code cleanup in Listener, OertlichesFonbook and Nummerzoeker 2011-01-01: Version 1.3.6 - changes in libfritz++ * Added tel.local.ch phonebook (patch provided by Christian [40] * Added missing initialization of libgcrypt * Sensitive Information like passwords, phone numbers, etc. are no longer logged by default. (suggested by C-3PO [41]) * Moved from libpthread++ to libccgnu2 * First steps in migrating to socket implementation of common c++ -> To compile vdr-fritz, development header files of the gnu common c++ library are needed! * Splitted Config::Setup into Config::Setup and Config::Init * Fix reverse lookup in OertlichesFonbook (patch provided by Kurt Wanner [43]) * Add missing include to XmlFonbook (reported by Richard Bos [42]) - The new command line option --log-personal-info re-enables logging all information (Suggested by C-3PO [41]) - Migration to gnu common c++ library should fix a possible crash at plugin shutdown - Fix parsing SIP provider names 2011-01-22: Version 1.3.7 - changes in libfritz++ * Add Config::Shutdown() to gracefully shutdown the library This can be used for re-inits as well as on program exit * Improve checks when parsing result list in OertlichesFonbook Check that at most one result is returned (reported by Honky [39]) * Fix parser of OertlichesFonbook again * Keep current call list as long as possible on reload Current call list is now cleared after the new call list has been parsed (Fixes #514) * Fix XmlFonbook parser XmlFonbook Parser was not aware of empty tags (reported by Richard Bos [42] and Achim Bohnet [44]) * Fix retry delay calculation in Listener - Disable "Add to PB" green key until this feature is implemented - Adapt to new library function Config::Shutdown() * This fixes changing the configuration at runtime. The library is now shutdown before the configuration is changed and setup again afterwards - Change message on entering the plugins main menu in case initialization is still running - Fix segfault in empty call list menu Pressing ok in an uninitialized call list no longer segfaults (reported by SvenS [45]) - Improved handling situations with multiple calls If detailed call information osd is enabled, the osd shows multiple calls simultaneously. The traditional osd shows multiple calls sequentially. Calls are no longer lost. - Fixed a possible segfault on signalling incoming and outgoing calls - Showing osd messages at least Setup.OSDMessageTimeout seconds 2011-03-06: Version 1.3.8 - changes in libfritz++ * Fix FonbookManager if no phone book is configured at all * Only write phone books back if changes are pending * Added HttpClient to libfritz++ to replace remaining functionality of libtcpclient++ * Imported some files from libcommoncpp to fix different issues * Migrate reverse lookup phone books to use new HttpClient * Make Fonbook::GetFonbookSize() more robust If not initialized, always return 0 and not the current intermediate state * Fix missing initialization in CallList * Fix initialization of LocalFonbook Add setInitialized(true) in case of no local phonebook file exists * Fix possible segfault on incoming or outgoing calls Fixes #572 [VDR] * Throw exceptions in HttpClient This fixes various issues when the network connection is not available at startup, e.g. empty phone book or call list. Fixes #573, #574, possibly #551 [VDR] * Fix log information about phone book size Fixes #577 [VDR] * Remove translatable string 'unknown' from CallList - Fix pausing replays on call Pause was not reset correctly under certain circumstances. - Removed tcpclient++, fully using libcommoncpp now - Add command line option for an on-call command (parameter -c 'cmd') Implements #571 [VDR], suggested by Alexander [48]. - Updated README and README.de - Updated italian translations Provided by Diego [24] - Fix translation of 'unknown' in call list 2011-03-11: Version 1.3.9 - changes in libfritz++ * Remove translatable string 'unknown' from CallList * Fix compile error with libcommoncpp2 / IPv6 * Add some debug output regarding threading * Remove calls to exit() at end of threads * Shortened time the lock to FritzClient is held by FritzFonbook and CallList - Fix translation of 'unknown' in call list - Fix an issue with missing mutex releases at the end of CallList and FritzFonbook threads Fixes #551 [VDR] (reported by hrueger [46], Bert [47], Honky [39]) Thanks for debugging and testing support! - Speedup phone book and call list initialization 2011-04-17: Version 1.4.0 - New stable version, no changes to 1.3.9 2012-03-25: Version 1.5.0 (list also includes changes of 1.4.1 and 1.4.2) - New development branch, stable branch 1.4.x is still maintained - Changes in libfritz++ * speedup initialization * Fix resolve in OertlichesFonbook * Provide Doxyfile for documentation generation * Fix compiler warnings -Wsign-compare and -Wswitch - Save password Hex-encoded in configuration * also works around a problem if password contains '#' (reported by Fridi [49]) - Fix templates/on-call.sh * Added a missing 'in' to the case part (reported by theonlychriss [50]) - Fix set of characters possible in Fritz!Box password * Some characters were missing (e.g., !) * Some characters were not allowed (reported by Tommy.Z [51]) - Adapt to more flexible Fritz!Box phone books (e.g. containing more than one number of the same type per name) - Fix possible crash setting msn filter count to zero - Fix calling script on call events with OSD notification turned off (reported by Christian Holder [52]) - Lookup based phone books now cache lookups in memory (based on code by Christian Holder [52]) - Add option to pause live tv Fixes #506 [VDR] - Add option to mute only after connect (Requested by derdoc [53]) 2012-12-23: Version 1.5.1 - New feature: Only decrease volume on call Fixes #513 [VDR] - Fix a bug in cFritzEventHandler Weired behaviour after calls when reactOnDirection is not DIRECTION_ANY Reported by Kurt Wanner and Christian Holder - Update german translation - Improved privacy in syslog information (hide msns) - Support for new FB firmware versions xx.05.50 - Changes in libfritz++ * Fix a possible deadlock in Tools::GetSipSettings() * Move convertEntities from XmlFonbook up to Fonbook and improved it * Fix resolve in TelLocalChFonbook * Fix resolve in OertlichesFonbook * Implement new login scheme using login_sid.lua for FB firmware >= xx.05.50 * Adapt sip settings, location settings, call list and phone book requests to new uris and format * Hide msn in syslog if logPersonalInfo is disabled 2013-01-05: Version 1.5.2 - Changes in libfritz++ * Fixes login problems with old fw-versions that return 404 on login_sid.lua Fixes #312204 [KDE], reported by sofasurfer [54] Fixes #1203 [VDR], reported by wolfi * Fix encoding conversion when requesting call list * Fix MSN filter to only match if filter is equal number of postfix of number * Fix resolving test in tel.local.ch phonebook - Add support for FB phonebooks with >3 numbers per entry, fixes a sigsev on startup using such phonebooks Fixes #1202, reported by Stefan [56], fix provided by Igel - Fix decreasing/increasing volume on ring/call Fixes #1188 [VDR], reported by SvenS [45] - Update Makefile to work with VDR >= 1.7.34 For older VDR versions, use the old Makefile, available as Makefile.pre.1.7.34 in the plugin directory - Show call information during complete ringing phase Fixes #1189 [VDR], reported by speed [55] 2013-12-01: Version 1.5.3 - New dependency boost::asio, dropped dependency to commoncpp - Fix resolve in TelLocalChFonbook - Add support for username authentication: new setup option Fixes #1385 [VDR] - Fix some warning about unused parameters --- References --- Bugtracker: [VDR] -> http://projects.vdr-developer.org/issues/ [KDE] -> https://bugs.kde.org/show_bug.cgi?id=XXXXXX Contributors: [ 1] http://vdr-portal.de/board/profile.php?userid=7164 http://www.vdr-online.org/ [ 2] http://vdr-portal.de/board/profile.php?userid=4808 [ 3] http://vdr-portal.de/board/profile.php?userid=9345 [ 4] http://vdr-portal.de/board/profile.php?userid=1293 [ 5] http://vdr-portal.de/board/profile.php?userid=8180 [ 6] http://vdr-portal.de/board/profile.php?userid=11837 [ 7] http://vdr-portal.de/board/profile.php?userid=7641 [ 8] http://vdr-portal.de/board/profile.php?userid=2604 [ 9] http://vdr-portal.de/board/profile.php?userid=9009 [10] Patrice Staudt http://vdr-portal.de/board/profile.php?userid=3409 [11] http://vdr-portal.de/board/profile.php?userid=6231 http://home.vrweb.de/~rnissl/ [12] http://vdr-portal.de/board/profile.php?userid=8480 [13] Oktay Yolgecen [14] http://vdr-portal.de/board/profile.php?userid=1551 [15] Axel Naumann [16] Thomas Gnther http://vdr-portal.de/board/profile.php?userid=4452 [17] Torsten Weigelt http://vdr-portal.de/board/profile.php?userid=16817 [18] Oliver Linsenmaier [19] http://vdr-portal.de/board/profile.php?userid=99 [20] http://vdr-portal.de/board/profile.php?userid=15737 [21] http://vdr-portal.de/board/profile.php?userid=8904 [22] Hans Jrgen Meier [23] http://vdr-portal.de/board/profile.php?userid=272 [24] Diego Pierotto http://vdr-italia.phpbb24.com/portal.php [25] please contact me to get your credits [26] http://vdr-portal.de/board/profile.php?userid=2095 [27] Habib Azimi http://vdr-portal.de/board/profile.php?userid=3 [28] http://vdr-portal.de/board/profile.php?userid=1450 [29] Thorsten Pohl http://vdr-portal.de/board/profile.php?userid=8029 [30] http://vdr-portal.de/board/profile.php?userid=6793 [31] http://vdr-portal.de/board/profile.php?userid=15996 [32] http://vdr-portal.de/board/profile.php?userid=18589 [33] Uwe http://vdr-portal.de/board/profile.php?userid=862 [34] http://vdr-portal.de/board/profile.php?userid=25271 [35] http://vdr-portal.de/board/profile.php?userid=2951 [36] Frank (hummingbird_de) http://vdr-portal.de/board/profile.php?userid=715 [37] http://vdr-portal.de/board/profile.php?userid=415 [38] http://vdr-portal.de/board/profile.php?userid=12632 [39] Honky http://vdr-portal.de/board/profile.php?userid=25383 [40] Christian Richter http://vdr-portal.de/board/profile.php?userid=12424 [41] http://vdr-portal.de/board/profile.php?userid=12003 [42] Richard Bos [43] Kurt Wanner [44] Achim Bohnet [45] SvenS http://www.vdr-portal.de/user/404-svens/ [46] Hartmut http://vdr-portal.de/board/profile.php?userid=15636 [47] http://vdr-portal.de/board/profile.php?userid=2579 [48] Alexander [49] Fridi http://www.vdr-portal.de/user/5231-fridi/ [50] theonlycriss http://www.vdr-portal.de/user/3200-theonlychriss/ [51] Tommy.Z http://www.vdr-portal.de/user/165-tommy-z/ [52] Christian Holder [53] derdoc http://www.vdr-portal.de/user/28286-derdoc/ [54] sofasurfer@gmail.com [55] speed http://www.vdr-portal.de/user/10911-speed [56] Stephan fritzbox-1.5.3/po/0000755000175000017500000000000012467661105013341 5ustar tobiastobiasfritzbox-1.5.3/po/ru_RU.po0000644000175000017500000001414212467661100014732 0ustar tobiastobias# translation of ru_RU-UTF8.po to russian # VDR plugin language source file. # Copyright (C) 2007 Klaus Schmidinger # This file is distributed under the same license as the VDR package. # # Alexander Gross , 2008. msgid "" msgstr "" "Project-Id-Version: ru_RU-UTF8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-01 20:07+0100\n" "PO-Revision-Date: 2008-09-09 01:48+0200\n" "Last-Translator: Alexander Gross\n" "Language-Team: russian\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" msgid "Fritz Plugin for AVM Fritz!Box" msgstr "Fritz модуль для AVM Fritz!Box" msgid "Fritz!Box" msgstr "Fritz!Box" msgid "missed calls" msgstr "пропущенные звонки" msgid "missed call" msgstr "пропущенный звонок" #, fuzzy msgid "Data not yet available." msgstr "Телефонный справочник пока не доступен." msgid "Private" msgstr "Частный" #. TRANSLATORS: telephonebook number type: this is a one char abbreviation for "home" msgid "H" msgstr "Д" msgid "Mobile" msgstr "Мобильный" #. TRANSLATORS: telephonebook number type: this is a one char abbreviation for "mobile" msgid "M" msgstr "М" msgid "Business" msgstr "Рабочий" #. TRANSLATORS: telephonebook number type: this is a one char abbreviation for "work" msgid "W" msgstr "Р" #, c-format msgid "Calling %s [%s]" msgstr "Звонит %s [%s]" msgid "Call" msgstr "Звонок" msgid "Call from" msgstr "Вам звонит" msgid "POTS" msgstr "аналог" msgid "ISDN" msgstr "ISDN" msgid "VoIP" msgstr "VoIP" msgid "This phonebook is not yet available." msgstr "Телефонный справочник пока не доступен." msgid "You may need to wait some minutes," msgstr "Вам возможно придеться подождать несколько минут" msgid "otherwise there may be a network problem." msgstr "или возникла проблема сети" msgid "This phonebook is not displayable" msgstr "Телефонный справочник пока не доступен " msgid "> PB" msgstr "> PB" msgid "Fritz!Box call list" msgstr "Список звонков Fritz!Box" msgid "incoming" msgstr "входящие" msgid "missed" msgstr "пропущенные" msgid "outgoing" msgstr "выходящие" msgid "unknown" msgstr "неизвестный" #, fuzzy msgid "The call list is not yet available." msgstr "Телефонный справочник пока не доступен." #. TRANSLATORS: this is the short form of "phone book" msgid "PB" msgstr "PB" msgid "Call details" msgstr "Подробности звонка" msgid "Date" msgstr "Дата" msgid "Time" msgstr "Время" msgid "Duration" msgstr "Продолжительность" msgid "call was not accepted" msgstr "непринятый звонок" msgid "Extension" msgstr "MSN" msgid "Callee" msgstr "Цель" msgid "Caller" msgstr "Вам звонит " #. TRANSLATORS: these are labels for color keys in the CallDetails menu #. TRANSLATORS: this is the label for the button to initiate a call msgid "Button$Call" msgstr "Позвонить" msgid "No number to call" msgstr "Без номера звонок не возможен" msgid "Pick up your phone now" msgstr "Снять телефон сейчас" msgid "Error while initiating call" msgstr "Ошибка при соединении" msgid "Phone book details" msgstr "Подробности справочника" msgid "Name" msgstr "Имя" msgid "Numbers" msgstr "Номера" msgid "Default" msgstr "По умолчанию" msgid "Outgoing call" msgstr "Выходящий звонок" msgid "Incoming call" msgstr "Входящий звонок" msgid "any" msgstr "все" #, fuzzy msgid "only incoming" msgstr "входящие" #, fuzzy msgid "only outgoing" msgstr "выходящие" msgid "Fritz!Box URL" msgstr "Адрес Fritz!Box " msgid "Username" msgstr "" msgid "Password" msgstr "Пароль" msgid "Country code" msgstr "" msgid "Region code" msgstr "" msgid "React on calls" msgstr "Реагировать при звонке" msgid "Mute on call" msgstr "Выключить звук при звонке" msgid "Mute only after connect" msgstr "" msgid "Decrease volume by [1..100%]" msgstr "" msgid "Pause on call" msgstr "Активировать паузу при звонке" msgid "Pause live tv" msgstr "" msgid "Resume after call" msgstr "" msgid "Show calls" msgstr "Показывать звонки" msgid "Show detailed call information" msgstr "Подробности звонка" msgid "Detailed call lists" msgstr "Подробный список звонков" msgid "Group call lists by date" msgstr "Группировать списки звонков по дате" msgid "Hide main menu entry" msgstr "Скрыть в главном меню" #, fuzzy msgid "Default menu" msgstr "По умолчанию" msgid "Setup phonebooks to use..." msgstr "Выбрать телефонные справочники ..." msgid "Restrict monitor to certain extensions" msgstr "Ограничить контролируемые MSNs" msgid "Number of monitored extensions" msgstr "Количество контролируемыx MSNs" msgid "Reload" msgstr "Перезагрузить" msgid "Retrieving phone book" msgstr "Запросить телефонный справочник" msgid "Setup phonebooks to use" msgstr "Выбрать телефонные справочники" msgid "More" msgstr "Больше" msgid "Less" msgstr "Меньше" #~ msgid "Fritz!Box phone book" #~ msgstr "Телефонный справочник Fritz!Box" #~ msgid "Local phone book" #~ msgstr "Локальный справочник" #, fuzzy #~ msgid "Button$To PB" #~ msgstr "Позвонить" #~ msgid "Error fetching the call list" #~ msgstr "Ошибка при запросе списка звонков" #, fuzzy #~ msgid "No number to add" #~ msgstr "Без номера звонок не возможен" fritzbox-1.5.3/po/de_DE.po0000644000175000017500000001230612467661100014636 0ustar tobiastobias# VDR plugin language source file. # Copyright (C) 2007 Klaus Schmidinger # This file is distributed under the same license as the VDR package. # msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-01 20:07+0100\n" "PO-Revision-Date: 2007-08-12 21:40+0200\n" "Last-Translator: Matthias Becker \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" msgid "Fritz Plugin for AVM Fritz!Box" msgstr "Fritz Plugin fr die AVM Fritz!Box" msgid "Fritz!Box" msgstr "Fritz!Box" msgid "missed calls" msgstr "verpasste Anrufe" msgid "missed call" msgstr "verpasster Anruf" msgid "Data not yet available." msgstr "Daten noch nicht verfgbar." msgid "Private" msgstr "Privat" #. TRANSLATORS: telephonebook number type: this is a one char abbreviation for "home" msgid "H" msgstr "T" msgid "Mobile" msgstr "Mobil" #. TRANSLATORS: telephonebook number type: this is a one char abbreviation for "mobile" msgid "M" msgstr "H" msgid "Business" msgstr "Geschftlich" #. TRANSLATORS: telephonebook number type: this is a one char abbreviation for "work" msgid "W" msgstr "F" # c-format #, c-format msgid "Calling %s [%s]" msgstr "Rufe %s an [%s]" msgid "Call" msgstr "Anruf" msgid "Call from" msgstr "Anruf von" msgid "POTS" msgstr "analog" msgid "ISDN" msgstr "ISDN" msgid "VoIP" msgstr "VoIP" msgid "This phonebook is not yet available." msgstr "Telefonbuch noch nicht verfgbar." msgid "You may need to wait some minutes," msgstr "Der Abruf bentigt entweder noch Zeit" msgid "otherwise there may be a network problem." msgstr "oder es besteht ein Netzwerkproblem." msgid "This phonebook is not displayable" msgstr "Keine anzeigbaren Eintrge" msgid "> PB" msgstr "> TB" msgid "Fritz!Box call list" msgstr "Fritz!Box Gesprchsliste" msgid "incoming" msgstr "eingehend" msgid "missed" msgstr "verpasst" msgid "outgoing" msgstr "ausgehend" msgid "unknown" msgstr "unbekannt" msgid "The call list is not yet available." msgstr "Gesprchsliste noch nicht verfgbar." #. TRANSLATORS: this is the short form of "phone book" msgid "PB" msgstr "TB" msgid "Call details" msgstr "Anrufdetails" msgid "Date" msgstr "Datum" msgid "Time" msgstr "Uhrzeit" msgid "Duration" msgstr "Dauer" msgid "call was not accepted" msgstr "Anruf nicht angenommen" msgid "Extension" msgstr "MSN" msgid "Callee" msgstr "Ziel" msgid "Caller" msgstr "Anrufer" #. TRANSLATORS: these are labels for color keys in the CallDetails menu #. TRANSLATORS: this is the label for the button to initiate a call msgid "Button$Call" msgstr "Anrufen" msgid "No number to call" msgstr "Ohne Nummer kein Anruf mglich" msgid "Pick up your phone now" msgstr "Telefon jetzt abnehmen" msgid "Error while initiating call" msgstr "Fehler beim Verbindungsaufbau" msgid "Phone book details" msgstr "Telefonbuchdetails" msgid "Name" msgstr "Name" msgid "Numbers" msgstr "Rufnummern" msgid "Default" msgstr "Standard" msgid "Outgoing call" msgstr "Ausgehender Anruf" msgid "Incoming call" msgstr "Eingehender Anruf" msgid "any" msgstr "alle" msgid "only incoming" msgstr "nur eingehend" msgid "only outgoing" msgstr "nur ausgehend" msgid "Fritz!Box URL" msgstr "Fritz!Box URL" msgid "Username" msgstr "Benutzername" msgid "Password" msgstr "Passwort" msgid "Country code" msgstr "Internationale Vorwahl" msgid "Region code" msgstr "Ortsvorwahl" msgid "React on calls" msgstr "Auf Anruf reagieren" msgid "Mute on call" msgstr "Bei Anruf stummschalten" msgid "Mute only after connect" msgstr "Nur bei Verbindung stummschalten" msgid "Decrease volume by [1..100%]" msgstr "Lautstrke nur absenken [1..100%]" msgid "Pause on call" msgstr "Bei Anruf Wiedergabe pausieren" msgid "Pause live tv" msgstr "Auch Live TV anhalten" msgid "Resume after call" msgstr "Nach Anruf Wiedergabe fortsetzen" msgid "Show calls" msgstr "Anrufe anzeigen" msgid "Show detailed call information" msgstr "Ausfhrliche Anrufinformation" msgid "Detailed call lists" msgstr "Ausfhrliche Gesprchslisten" msgid "Group call lists by date" msgstr "Anruflisten nach Datum gruppieren" msgid "Hide main menu entry" msgstr "Hauptmeneintrag verstecken" msgid "Default menu" msgstr "Standardansicht" msgid "Setup phonebooks to use..." msgstr "Telefonbcher auswhlen..." msgid "Restrict monitor to certain extensions" msgstr "berwachte MSNs einschrnken" msgid "Number of monitored extensions" msgstr "Zahl der berwachten MSNs" msgid "Reload" msgstr "Neu laden" msgid "Retrieving phone book" msgstr "Rufe Telefonbuch ab" msgid "Setup phonebooks to use" msgstr "Telefonbcher auswhlen" msgid "More" msgstr "Mehr" msgid "Less" msgstr "Weniger" #~ msgid "Fritz!Box phone book" #~ msgstr "Fritz!Box Telefonbuch" #~ msgid "Local phone book" #~ msgstr "Lokales Telefonbuch" #~ msgid " " #~ msgstr " " #~ msgid "Button$To PB" #~ msgstr "In TB" #~ msgid "Error fetching the call list" #~ msgstr "Fehler beim Anfordern der Gesprchsliste" #~ msgid "Fritz!Box Notification" #~ msgstr "Fritz!Box Information" #~ msgid "No number to add" #~ msgstr "Keine Rufnummer zu Speichern" #~ msgid "Please wait..." #~ msgstr "Bitte warten..." fritzbox-1.5.3/po/fr_FR.po0000644000175000017500000001261412467661100014676 0ustar tobiastobias# VDR plugin language source file. # Copyright (C) 2007 Klaus Schmidinger # This file is distributed under the same license as the VDR package. # msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-01 20:07+0100\n" "PO-Revision-Date: 2007-08-12 21:40+0200\n" "Last-Translator: Patrice Staudt\n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" msgid "Fritz Plugin for AVM Fritz!Box" msgstr "" #, fuzzy msgid "Fritz!Box" msgstr "Url de la Fritz!Box" #, fuzzy msgid "missed calls" msgstr "manqu" #, fuzzy msgid "missed call" msgstr "manqu" #, fuzzy msgid "Data not yet available." msgstr "Carnet d'adresse n'est pas encore disponible" msgid "Private" msgstr "" #. TRANSLATORS: telephonebook number type: this is a one char abbreviation for "home" msgid "H" msgstr "H" #, fuzzy msgid "Mobile" msgstr "Plus" #. TRANSLATORS: telephonebook number type: this is a one char abbreviation for "mobile" msgid "M" msgstr "M" msgid "Business" msgstr "" #. TRANSLATORS: telephonebook number type: this is a one char abbreviation for "work" msgid "W" msgstr "W" #, fuzzy, c-format msgid "Calling %s [%s]" msgstr "Appelle de" #, fuzzy msgid "Call" msgstr "Appelle de" msgid "Call from" msgstr "Appelle de" msgid "POTS" msgstr "analogue" msgid "ISDN" msgstr "Numris" msgid "VoIP" msgstr "Voix sur IP" #, fuzzy msgid "This phonebook is not yet available." msgstr "Carnet d'adresse n'est pas encore disponible" msgid "You may need to wait some minutes," msgstr "Vous devrez peut-tre attendre quelques minutes," msgid "otherwise there may be a network problem." msgstr "Sinon il peut y avoir un problme de rseau" #, fuzzy msgid "This phonebook is not displayable" msgstr "Carnet d'adresse n'est pas encore disponible" #, fuzzy msgid "> PB" msgstr "CdA" msgid "Fritz!Box call list" msgstr "Liste d'appelle de la Fritz!Box" msgid "incoming" msgstr "entrant" msgid "missed" msgstr "manqu" msgid "outgoing" msgstr "sortant" msgid "unknown" msgstr "inconnu" #, fuzzy msgid "The call list is not yet available." msgstr "Carnet d'adresse n'est pas encore disponible" #. TRANSLATORS: this is the short form of "phone book" msgid "PB" msgstr "CdA" msgid "Call details" msgstr "Dtails des appels" msgid "Date" msgstr "Date" msgid "Time" msgstr "Temps" msgid "Duration" msgstr "Dure" msgid "call was not accepted" msgstr "Appel n'a pas t accept" msgid "Extension" msgstr "Extension MSN" msgid "Callee" msgstr "" #, fuzzy msgid "Caller" msgstr "Appelle de" #. TRANSLATORS: these are labels for color keys in the CallDetails menu #. TRANSLATORS: this is the label for the button to initiate a call #, fuzzy msgid "Button$Call" msgstr "Muet lors d'un appel" msgid "No number to call" msgstr "Aucun numro appeler" msgid "Pick up your phone now" msgstr "Dcrocher votre tlphone maintenant" msgid "Error while initiating call" msgstr "Erreur au lancement de l'appel" msgid "Phone book details" msgstr "" msgid "Name" msgstr "" msgid "Numbers" msgstr "" msgid "Default" msgstr "" #, fuzzy msgid "Outgoing call" msgstr "Muet lors d'un appel" #, fuzzy msgid "Incoming call" msgstr "Afficher les appels entrants" msgid "any" msgstr "" #, fuzzy msgid "only incoming" msgstr "entrant" #, fuzzy msgid "only outgoing" msgstr "sortant" msgid "Fritz!Box URL" msgstr "Url de la Fritz!Box" msgid "Username" msgstr "" msgid "Password" msgstr "Mot de passe" msgid "Country code" msgstr "" msgid "Region code" msgstr "" #, fuzzy msgid "React on calls" msgstr "Muet lors d'un appel" msgid "Mute on call" msgstr "Muet lors d'un appel" msgid "Mute only after connect" msgstr "" msgid "Decrease volume by [1..100%]" msgstr "" msgid "Pause on call" msgstr "Pause pour appel" msgid "Pause live tv" msgstr "" msgid "Resume after call" msgstr "" #, fuzzy msgid "Show calls" msgstr "Afficher les appels entrants" #, fuzzy msgid "Show detailed call information" msgstr "Listes dtailles d'appel" msgid "Detailed call lists" msgstr "Listes dtailles d'appel" msgid "Group call lists by date" msgstr "Groupe appels par jour" msgid "Hide main menu entry" msgstr "Cach dans le menu principale" msgid "Default menu" msgstr "" msgid "Setup phonebooks to use..." msgstr "Configuration de rpertoires tlphoniques utiliser..." msgid "Restrict monitor to certain extensions" msgstr "Limiter le moniteur certaines extensions MSNs" msgid "Number of monitored extensions" msgstr "Nombre d'extensions MSNs a surveillier" msgid "Reload" msgstr "Recharger" msgid "Retrieving phone book" msgstr "Recherche du carnet d'adresse" msgid "Setup phonebooks to use" msgstr "Configuration de rpertoires tlphoniques utiliser" msgid "More" msgstr "Plus" msgid "Less" msgstr "Moins" #~ msgid "Fritz!Box phone book" #~ msgstr "Carnet d'adresse de la Fritz!Box" #, fuzzy #~ msgid "Local phone book" #~ msgstr "Carnet d'adresse de la Fritz!Box" #, fuzzy #~ msgid "Button$To PB" #~ msgstr "Muet lors d'un appel" #~ msgid "Call from unknown extension" #~ msgstr "Appel d'une extension inconnue" #~ msgid "Error fetching the call list" #~ msgstr "Erreur de chargement de la liste d'appel" #, fuzzy #~ msgid "Fritz!Box Notification" #~ msgstr "Liste d'appelle de la Fritz!Box" #, fuzzy #~ msgid "No number to add" #~ msgstr "Aucun numro appeler" #~ msgid "Please wait..." #~ msgstr "Attendez SVP..." fritzbox-1.5.3/po/tr_TR.po0000644000175000017500000001172612467661100014735 0ustar tobiastobias# VDR plugin language source file. # Copyright (C) 2007 Klaus Schmidinger # This file is distributed under the same license as the VDR package. # Oktay Yolgeen , 2007 # msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-01 20:07+0100\n" "PO-Revision-Date: 2007-08-12 21:40+0200\n" "Last-Translator: Oktay Yolgeen \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-9\n" "Content-Transfer-Encoding: 8bit\n" msgid "Fritz Plugin for AVM Fritz!Box" msgstr "" #, fuzzy msgid "Fritz!Box" msgstr "Fritz!Box URL" #, fuzzy msgid "missed calls" msgstr "karlan" #, fuzzy msgid "missed call" msgstr "karlan" #, fuzzy msgid "Data not yet available." msgstr "Telefon defteri mevcut deil" msgid "Private" msgstr "" #. TRANSLATORS: telephonebook number type: this is a one char abbreviation for "home" msgid "H" msgstr "" msgid "Mobile" msgstr "" #. TRANSLATORS: telephonebook number type: this is a one char abbreviation for "mobile" msgid "M" msgstr "" msgid "Business" msgstr "" #. TRANSLATORS: telephonebook number type: this is a one char abbreviation for "work" msgid "W" msgstr "" #, fuzzy, c-format msgid "Calling %s [%s]" msgstr "Arayan numara" #, fuzzy msgid "Call" msgstr "Arayan numara" msgid "Call from" msgstr "Arayan numara" msgid "POTS" msgstr "analog" msgid "ISDN" msgstr "ISDN" msgid "VoIP" msgstr "VoIP" #, fuzzy msgid "This phonebook is not yet available." msgstr "Telefon defteri mevcut deil" msgid "You may need to wait some minutes," msgstr "" msgid "otherwise there may be a network problem." msgstr "" #, fuzzy msgid "This phonebook is not displayable" msgstr "Telefon defteri mevcut deil" #, fuzzy msgid "> PB" msgstr "TD" msgid "Fritz!Box call list" msgstr "Fritz!Box konuma listesi" msgid "incoming" msgstr "gelen" msgid "missed" msgstr "karlan" msgid "outgoing" msgstr "giden" msgid "unknown" msgstr "mechul" #, fuzzy msgid "The call list is not yet available." msgstr "Telefon defteri mevcut deil" #. TRANSLATORS: this is the short form of "phone book" msgid "PB" msgstr "TD" msgid "Call details" msgstr "" msgid "Date" msgstr "" msgid "Time" msgstr "" msgid "Duration" msgstr "" msgid "call was not accepted" msgstr "" msgid "Extension" msgstr "MSN" msgid "Callee" msgstr "" #, fuzzy msgid "Caller" msgstr "Arayan numara" #. TRANSLATORS: these are labels for color keys in the CallDetails menu #. TRANSLATORS: this is the label for the button to initiate a call #, fuzzy msgid "Button$Call" msgstr "Telefon gelince sesi kes" msgid "No number to call" msgstr "Numarasz arama imkansz" msgid "Pick up your phone now" msgstr "Telefonu imdi kaldrn" msgid "Error while initiating call" msgstr "Baglant hatas" msgid "Phone book details" msgstr "" msgid "Name" msgstr "" msgid "Numbers" msgstr "" msgid "Default" msgstr "" #, fuzzy msgid "Outgoing call" msgstr "Telefon gelince sesi kes" #, fuzzy msgid "Incoming call" msgstr "Gelen aramalar gster" msgid "any" msgstr "" #, fuzzy msgid "only incoming" msgstr "gelen" #, fuzzy msgid "only outgoing" msgstr "giden" msgid "Fritz!Box URL" msgstr "Fritz!Box URL" msgid "Username" msgstr "" msgid "Password" msgstr "ifre" msgid "Country code" msgstr "" msgid "Region code" msgstr "" #, fuzzy msgid "React on calls" msgstr "Telefon gelince sesi kes" msgid "Mute on call" msgstr "Telefon gelince sesi kes" msgid "Mute only after connect" msgstr "" msgid "Decrease volume by [1..100%]" msgstr "" msgid "Pause on call" msgstr "Telefon gelince durakla" msgid "Pause live tv" msgstr "" msgid "Resume after call" msgstr "" #, fuzzy msgid "Show calls" msgstr "Gelen aramalar gster" #, fuzzy msgid "Show detailed call information" msgstr "Detayl konuma listesi" msgid "Detailed call lists" msgstr "Detayl konuma listesi" msgid "Group call lists by date" msgstr "" msgid "Hide main menu entry" msgstr "Ana mende sakla" msgid "Default menu" msgstr "" msgid "Setup phonebooks to use..." msgstr "" msgid "Restrict monitor to certain extensions" msgstr "Gzlenen MSN'leri snrla" msgid "Number of monitored extensions" msgstr "Gzlenen MSN'lerinin says" msgid "Reload" msgstr "Tekrar ykle" msgid "Retrieving phone book" msgstr "Telefon defteri ykleniyor" msgid "Setup phonebooks to use" msgstr "" msgid "More" msgstr "" msgid "Less" msgstr "" #~ msgid "Fritz!Box phone book" #~ msgstr "Fritz!Box telefon defteri" #, fuzzy #~ msgid "Local phone book" #~ msgstr "Fritz!Box telefon defteri" #, fuzzy #~ msgid "Button$To PB" #~ msgstr "Telefon gelince sesi kes" #~ msgid "Call from unknown extension" #~ msgstr "Bilinmeyen balant aryor" #~ msgid "Error fetching the call list" #~ msgstr "Konuma listesi yklenemedi" #, fuzzy #~ msgid "Fritz!Box Notification" #~ msgstr "Fritz!Box konuma listesi" #, fuzzy #~ msgid "No number to add" #~ msgstr "Numarasz arama imkansz" #~ msgid "Please wait..." #~ msgstr "Ltfen bekleyin" fritzbox-1.5.3/po/it_IT.po0000755000175000017500000001274012467661100014713 0ustar tobiastobias# VDR plugin language source file. # Copyright (C) 2007 Klaus Schmidinger # This file is distributed under the same license as the VDR package. # msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-01 20:07+0100\n" "PO-Revision-Date: 2011-03-05 16:29+0100\n" "Last-Translator: Diego Pierotto \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Italian\n" "X-Poedit-Country: ITALY\n" "X-Poedit-SourceCharset: utf-8\n" msgid "Fritz Plugin for AVM Fritz!Box" msgstr "Plugin Fritz per AVM Fritz!Box" msgid "Fritz!Box" msgstr "Fritz!Box" msgid "missed calls" msgstr "chiamate perse" msgid "missed call" msgstr "chiamata persa" msgid "Data not yet available." msgstr "Dati non ancora disponibili." msgid "Private" msgstr "Privato" #. TRANSLATORS: telephonebook number type: this is a one char abbreviation for "home" msgid "H" msgstr "C" msgid "Mobile" msgstr "Cellulare" #. TRANSLATORS: telephonebook number type: this is a one char abbreviation for "mobile" msgid "M" msgstr "T" msgid "Business" msgstr "Affari" #. TRANSLATORS: telephonebook number type: this is a one char abbreviation for "work" msgid "W" msgstr "L" #, c-format msgid "Calling %s [%s]" msgstr "Chiamata %s [%s]" msgid "Call" msgstr "Chiama" msgid "Call from" msgstr "Chiamata da" msgid "POTS" msgstr "analogico" msgid "ISDN" msgstr "ISDN" msgid "VoIP" msgstr "VoIP" msgid "This phonebook is not yet available." msgstr "Questa rubrica non è ancora disponibile." msgid "You may need to wait some minutes," msgstr "Potresti dover aspettare alcuni minuti," msgid "otherwise there may be a network problem." msgstr "altrimenti ci potrebbe essere un problema di rete." msgid "This phonebook is not displayable" msgstr "Questa rubrica non è disponibile" msgid "> PB" msgstr "> RU" msgid "Fritz!Box call list" msgstr "Elenco chiamate Fritz!Box" msgid "incoming" msgstr "in arrivo" msgid "missed" msgstr "perse" msgid "outgoing" msgstr "in uscita" msgid "unknown" msgstr "sconosciuta" msgid "The call list is not yet available." msgstr "Elenco chiamate non ancora disponibile." #. TRANSLATORS: this is the short form of "phone book" msgid "PB" msgstr "RU" msgid "Call details" msgstr "Dettagli chiamate" msgid "Date" msgstr "Data" msgid "Time" msgstr "Ora" msgid "Duration" msgstr "Durata" msgid "call was not accepted" msgstr "chiamata non accettata" msgid "Extension" msgstr "Estensione MSN" msgid "Callee" msgstr "Chiamato" msgid "Caller" msgstr "Chiamante" #. TRANSLATORS: these are labels for color keys in the CallDetails menu #. TRANSLATORS: this is the label for the button to initiate a call msgid "Button$Call" msgstr "Chiama" msgid "No number to call" msgstr "Nessun numero da chiamare" msgid "Pick up your phone now" msgstr "Prendi ora la telefonata" msgid "Error while initiating call" msgstr "Errore avvio chiamata" msgid "Phone book details" msgstr "Dettagli rubrica" msgid "Name" msgstr "Nome" msgid "Numbers" msgstr "Numeri" msgid "Default" msgstr "Predefinito" msgid "Outgoing call" msgstr "Chiamata in uscita" msgid "Incoming call" msgstr "Chiamata in arrivo" msgid "any" msgstr "qualsiasi" msgid "only incoming" msgstr "solo in arrivo" msgid "only outgoing" msgstr "solo in uscita" msgid "Fritz!Box URL" msgstr "Indirizzo Fritz!Box" msgid "Username" msgstr "" msgid "Password" msgstr "Password" msgid "Country code" msgstr "Codice internazionale" msgid "Region code" msgstr "Codice area" msgid "React on calls" msgstr "Azione alla chiamata" msgid "Mute on call" msgstr "Metti in muto la chiamata" msgid "Mute only after connect" msgstr "" msgid "Decrease volume by [1..100%]" msgstr "" msgid "Pause on call" msgstr "Metti in pausa la chiamata" msgid "Pause live tv" msgstr "" msgid "Resume after call" msgstr "Riprendi dopo chiamata" msgid "Show calls" msgstr "Mostra chiamate" msgid "Show detailed call information" msgstr "Mostra info dettagliate chiamata" msgid "Detailed call lists" msgstr "Dettagli elenco chiamate" msgid "Group call lists by date" msgstr "Raggruppa chiamate per data" msgid "Hide main menu entry" msgstr "Nascondi voce menu principale" msgid "Default menu" msgstr "Menu predefinito" msgid "Setup phonebooks to use..." msgstr "Imposta rubriche da utilizzare..." msgid "Restrict monitor to certain extensions" msgstr "Restringi controllo estensioni MSN" msgid "Number of monitored extensions" msgstr "Num. estens. MSN controllate" msgid "Reload" msgstr "Ricarica" msgid "Retrieving phone book" msgstr "Recupero rubrica" msgid "Setup phonebooks to use" msgstr "Imposta rubriche da utilizzare" msgid "More" msgstr "Aggiungi" msgid "Less" msgstr "Elimina" #~ msgid "Fritz!Box phone book" #~ msgstr "Rubrica Fritz!Box" #~ msgid "Local phone book" #~ msgstr "Rubrica locale" #~ msgid "das-oertliche.de" #~ msgstr "das-oertliche.de" #~ msgid "nummerzoeker.com" #~ msgstr "nummerzoeker.com" #~ msgid "tel.local.ch" #~ msgstr "tel.local.ch" #~ msgid " " #~ msgstr " " #~ msgid "Button$To PB" #~ msgstr "A PB" #~ msgid "Call from unknown extension" #~ msgstr "Chiamata da estensione sconosciuta" #~ msgid "Error fetching the call list" #~ msgstr "Errore recupero elenco chiamate" #, fuzzy #~ msgid "Fritz!Box Notification" #~ msgstr "Elenco chiamate Fritz!Box" #~ msgid "No number to add" #~ msgstr "Nessun numero da aggiungere" #~ msgid "Please wait..." #~ msgstr "Attendere prego..." fritzbox-1.5.3/menu.h0000644000175000017500000000356612467660216014054 0ustar tobiastobias/* * Fritz!Box plugin for VDR * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef MENU_H_ #define MENU_H_ #include #include "fritzbox.h" class cMenuFritzbox : public cOsdMenu { public: enum mode { FONBUCH= 0, IN = 1, MISSED = 2, OUT = 3, }; private: mode currentMode; cPluginFritzbox *plugin; public: cMenuFritzbox(cPluginFritzbox *plugin); virtual ~cMenuFritzbox(); virtual eOSState ProcessKey (eKeys Key); void DisplayFonbuch(); void DisplayCalls(fritz::CallEntry::eCallType ct); }; class cMenuCallDetail : public cOsdMenu { private: fritz::CallEntry *ce; void SetText(std::string text); public: cMenuCallDetail(fritz::CallEntry *ce, cMenuFritzbox::mode mode, fritz::Fonbook *fonbuch); virtual eOSState ProcessKey (eKeys Key); }; class cMenuFonbuchDetail : public cOsdMenu { private: const fritz::FonbookEntry *fe; public: cMenuFonbuchDetail(const fritz::FonbookEntry *fe); virtual eOSState ProcessKey (eKeys Key); }; class cKeyOsdItem : public cOsdItem { public: unsigned int key; cKeyOsdItem(const char * text, enum eOSState state, bool selectable, unsigned int key); }; #endif /*MENU_H_*/ fritzbox-1.5.3/COPYING0000644000175000017500000004310612467660216013764 0ustar tobiastobias GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. fritzbox-1.5.3/Makefile0000644000175000017500000001007012467660216014363 0ustar tobiastobias# # Makefile for a Video Disk Recorder plugin # # $Id$ # The official name of this plugin. # This name will be used in the '-P...' option of VDR to load the plugin. # By default the main source file also carries this name. PLUGIN = fritzbox ### The version number of this plugin (taken from the main source file): VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).cpp | awk '{ print $$6 }' | sed -e 's/[";]//g') ### The directory environment: # Use package data if installed...otherwise assume we're under the VDR source directory: PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc)) LIBDIR = $(call PKGCFG,libdir) LOCDIR = $(call PKGCFG,locdir) PLGCFG = $(call PKGCFG,plgcfg) # TMPDIR ?= /tmp ### The compiler options: export CFLAGS = $(call PKGCFG,cflags) export CXXFLAGS = $(call PKGCFG,cxxflags) ### The version number of VDR's plugin API: APIVERSION = $(call PKGCFG,apiversion) ### Allow user defined options to overwrite defaults: -include $(PLGCFG) ### The name of the distribution archive: ARCHIVE = $(PLUGIN)-$(VERSION) PACKAGE = vdr-$(ARCHIVE) ### The name of the shared object file: SOFILE = libvdr-$(PLUGIN).so ### Includes and Defines (add further entries here): INCLUDES += DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' ### The object files (add further files here): OBJS = $(patsubst %.cpp,%.o,$(wildcard *.cpp)) ### Static libraries LIBS = libfritz++/libfritz++.a libnet++/libnet++.a liblog++/liblog++.a libconv++/libconv++.a STATIC_LIB_DIRS = $(dir $(LIBS)) STATIC_LIBS = $(LIBS:%=$(CURDIR)/%) CXXFLAGS += -I$(CURDIR) -std=c++11 LDFLAGS += -lboost_system -lboost_thread -lboost_regex -lpthread -lgcrypt export STATIC_LIBS CXXFLAGS LDFLAGS ### Tests TEST_DIRS = $(wildcard $(addsuffix test,$(dir $(LIBS)))) $(wildcard test) ### Internationalization (I18N): PODIR = po I18Npo = $(wildcard $(PODIR)/*.po) I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) I18Npot = $(PODIR)/$(PLUGIN).pot ### Phony targets .PHONY: all install i18n clean test $(STATIC_LIB_DIRS) $(TEST_DIRS) ### Targets: all: $(SOFILE) i18n $(SOFILE): $(OBJS) $(LIBS) $(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) $(LDFLAGS) -o $@ %.a: $(STATIC_LIB_DIRS) @ $(STATIC_LIB_DIRS): @$(MAKE) -C $@ $(@:/=).a %.o: %.cpp $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $< install-lib: $(SOFILE) install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION) install: install-lib install-i18n test: $(STATIC_LIB_DIRS) $(TEST_DIRS) $(TEST_DIRS): @$(MAKE) -C $@ dist: $(I18Npo) clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @mkdir $(TMPDIR)/$(ARCHIVE) @cp -a * $(TMPDIR)/$(ARCHIVE) @rm -rf $(TMPDIR)/$(ARCHIVE)/lib*/.git @rm -rf $(TMPDIR)/$(ARCHIVE)/test @rm -rf $(TMPDIR)/$(ARCHIVE)/lib*/test @tar czf $(PACKAGE).tgz --exclude=.* --exclude=test --exclude=test.old --exclude=*.launch -C $(TMPDIR) $(ARCHIVE) @-rm -rf $(TMPDIR)/$(ARCHIVE) @echo Distribution package created as $(PACKAGE).tgz clean: @$(foreach LIB,$(STATIC_LIB_DIRS),$(MAKE) -C $(LIB) clean;) @$(foreach DIR,$(TEST_DIRS),$(MAKE) -C $(DIR) clean;) @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ ### I18n targets %.mo: %.po msgfmt -c -o $@ $< $(I18Npot): $(wildcard *.cpp) mkdir -p $(PODIR) xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='' -o $@ `ls $^` %.po: $(I18Npot) msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $< @touch $@ $(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo install -D -m644 $< $@ i18n: $(I18Nmo) $(I18Npot) install-i18n: $(I18Nmsgs) ### Dependencies: MAKEDEP = $(CXX) -MM -MG DEPFILE = .dependencies $(DEPFILE): Makefile @$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.cpp) > $@ -include $(DEPFILE) fritzbox-1.5.3/Makefile.pre.1.7.340000644000175000017500000000753612467660216015716 0ustar tobiastobias# # Makefile for a Video Disk Recorder plugin # This Makefile version is for VDR < 1.7.34 and is no longer supported. # # $Id$ # The official name of this plugin. # This name will be used in the '-P...' option of VDR to load the plugin. # By default the main source file also carries this name. # IPORTANT: the presence of this macro is important for the Make.config # file. So it must be defined, even if it is not used here! # PLUGIN = fritzbox ### The version number of this plugin (taken from the main source file): VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') ### The C++ compiler and options: CXX ?= g++ CXXFLAGS ?= -g -ggdb -O2 -Wall -Woverloaded-virtual ### Make sure that necessary options are included: ifeq ($(strip $(wildcard $(VDRDIR)/Make.global)),) CXXFLAGS += -fPIC else include $(VDRDIR)/Make.global endif ### The directory environment: VDRDIR ?= ../../.. LIBDIR = $(VDRDIR)/PLUGINS/lib TMPDIR = /tmp ### Allow user defined options to overwrite defaults: -include $(VDRDIR)/Make.config ### The version number of VDR's plugin API (taken from VDR's "config.h"): APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h) VDRVERSNUM = $(shell grep 'define VDRVERSNUM ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g') DOXYFILE = Doxyfile DOXYGEN = doxygen ### The name of the distribution archive: ARCHIVE = $(PLUGIN)-$(VERSION) PACKAGE = vdr-$(ARCHIVE) ### Includes and Defines (add further entries here): INCLUDES += -I$(VDRDIR)/include DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' ### libfritz++ LIBFRITZ = libfritz++ INCLUDES += -I$(LIBFRITZ) LIBS += $(LIBFRITZ)/$(LIBFRITZ).a -lgcrypt -lccgnu2 ### The object files (add further files here): OBJS = $(PLUGIN).o fritzeventhandler.o log.o menu.o notifyosd.o setup.o ### Targets: all: libvdr-$(PLUGIN).so i18n test $(LIBFRITZ) @-cp --remove-destination libvdr-$(PLUGIN).so $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION) ## TODO: Prevent so file from beeing build every time libvdr-$(PLUGIN).so: $(OBJS) $(LIBFRITZ) $(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@ ar ru libvdr-$(PLUGIN).a $(OBJS) $(LIBFRITZ): @$(MAKE) -C $(LIBFRITZ) %.o: %.c $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< dist: clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @mkdir $(TMPDIR)/$(ARCHIVE) @cp -a * $(TMPDIR)/$(ARCHIVE) @tar czf $(PACKAGE).tgz --exclude=.* --exclude=test --exclude=test.old -C $(TMPDIR) $(ARCHIVE) @-rm -rf $(TMPDIR)/$(ARCHIVE) @echo Distribution package created as $(PACKAGE).tgz clean: @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot @-rm -f $(OBJS) $(DEPFILE) *.so *.a *.tgz core* *~ @-make -C $(LIBFRITZ) clean @-make -C test clean ### Internationalization (I18N): PODIR = po LOCALEDIR = $(VDRDIR)/locale I18Npo = $(wildcard $(PODIR)/*.po) I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) I18Npot = $(PODIR)/$(PLUGIN).pot %.mo: %.po msgfmt -c -o $@ $< $(I18Npot): $(wildcard *.c) $(wildcard libfritz++/*.cpp) xgettext -C -cTRANSLATORS --no-wrap -s --no-location -k -ktr -ktrNOOP -kI18N_NOOP \ --msgid-bugs-address='' -o $@ $^ grep -v POT-Creation $(I18Npot) > $(I18Npot)~ mv $(I18Npot)~ $(I18Npot) %.po: $(I18Npot) msgmerge -U --no-wrap -s --backup=none -q $@ $< @touch $@ $(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo @mkdir -p $(dir $@) cp $< $@ .PHONY: i18n test $(LIBFRITZ) i18n: $(I18Nmsgs) test: @-make -C test srcdoc: @cp $(DOXYFILE) $(DOXYFILE).tmp @echo PROJECT_NUMBER = $(VERSION) >> $(DOXYFILE).tmp $(DOXYGEN) $(DOXYFILE).tmp @rm $(DOXYFILE).tmp # Dependencies: MAKEDEP = $(CXX) -MM -MG DEPFILE = .dependencies $(DEPFILE): Makefile @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ -include $(DEPFILE) fritzbox-1.5.3/templates/0000755000175000017500000000000012467660216014723 5ustar tobiastobiasfritzbox-1.5.3/templates/on-call.sh0000644000175000017500000000062312467660216016605 0ustar tobiastobias#!/bin/bash case "$1" in CALL) # handle incoming or outgoing calls ;; CONNECT) # handle call connects ;; DISCONNECT) # handle call disconnects ;; FINISHED) # all ongoing calls have been finished # if only one call has been handled, this is called directly after DISCONNECT ;; *) echo "This script should not be called directly." exit 1 ;; esac exit 0 fritzbox-1.5.3/Doxyfile0000644000175000017500000010556212467660216014444 0ustar tobiastobias# Doxyfile 1.2.13.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # General configuration options #--------------------------------------------------------------------------- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = vdr-fritzbox # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = srcdoc # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Brazilian, Chinese, Croatian, Czech, Danish, Dutch, Finnish, French, # German, Greek, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, # Portuguese, Romanian, Russian, Slovak, Slovene, Spanish and Swedish. OUTPUT_LANGUAGE = English # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = YES # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these class will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = NO # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited # members of a class in the documentation of that class as if those members were # ordinary class members. Constructors, destructors and assignment operators of # the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. It is allowed to use relative paths in the argument list. STRIP_FROM_PATH = # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower case letters. If set to YES upper case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # users are adviced to set this option to NO. CASE_SENSE_NAMES = YES # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like the Qt-style comments (thus requiring an # explict @brief command for a brief description. JAVADOC_AUTOBRIEF = YES # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # reimplements. INHERIT_DOCS = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consist of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. # For instance some of the names that are used will be different. The list # of all members will be omitted, etc. ##kls OPTIMIZE_OUTPUT_FOR_C = NO # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. WARN_FORMAT = # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = . # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp # *.h++ *.idl FILE_PATTERNS = *.c *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. EXCLUDE_PATTERNS = */RCS/* */OLD/* # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. INPUT_FILTER = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse. FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = c #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the Html help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript and frames is required (for instance Mozilla, Netscape 4.0+, # or Internet explorer 4.0+). Note that for large projects the tree generation # can take a very long time. In such cases it is better to disable this feature. # Windows users are probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimised for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assigments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_XML = NO #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_PREDEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line and do not end with a semicolon. Such function macros are typically # used for boiler-plate code, and will confuse the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::addtions related to external references #--------------------------------------------------------------------------- # The TAGFILES tag can be used to specify one or more tagfiles. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or # super classes. Setting the tag to NO turns the diagrams off. Note that this # option is superceded by the HAVE_DOT option below. This is only a fallback. It is # recommended to install and use dot, since it yield more powerful graphs. CLASS_DIAGRAMS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = YES # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = YES # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found on the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_WIDTH = 1024 # The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_HEIGHT = 1024 # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermedate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::addtions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO # The CGI_NAME tag should be the name of the CGI script that # starts the search engine (doxysearch) with the correct parameters. # A script with this name will be generated by doxygen. CGI_NAME = # The CGI_URL tag should be the absolute URL to the directory where the # cgi binaries are located. See the documentation of your http daemon for # details. CGI_URL = # The DOC_URL tag should be the absolute URL to the directory where the # documentation is located. If left blank the absolute path to the # documentation, with file:// prepended to it, will be used. DOC_URL = # The DOC_ABSPATH tag should be the absolute path to the directory where the # documentation is located. If left blank the directory on the local machine # will be used. DOC_ABSPATH = # The BIN_ABSPATH tag must point to the directory where the doxysearch binary # is installed. BIN_ABSPATH = # The EXT_DOC_PATHS tag can be used to specify one or more paths to # documentation generated for other projects. This allows doxysearch to search # the documentation for these projects as well. EXT_DOC_PATHS = fritzbox-1.5.3/fritzbox.cpp0000644000175000017500000002056212467660216015305 0ustar tobiastobias/* * Fritz!Box plugin for VDR * * Copyright (C) 2007-2012 Joachim Wilke * * 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 #include "libfritz++/FonbookManager.h" #include "libfritz++/Listener.h" #include "libfritz++/Config.h" #include "liblog++/Log.h" #include "fritzbox.h" #include "setup.h" #include "notifyosd.h" #include "menu.h" static const char *VERSION = "1.5.3"; static const char *DESCRIPTION = trNOOP("Fritz Plugin for AVM Fritz!Box"); static const char *MAINMENUENTRY = trNOOP("Fritz!Box"); cPluginFritzbox::cPluginFritzbox(void) : cThread("Fritz Plugin Initialization") { // Initialize any member variables here. // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT! event = NULL; logPersonalInfo = false; migratePassword = false; logger::Log::setPrefix("fritzbox"); logger::Log::setCustomLogger( [](const std::string &message) { esyslog(message.c_str()); }, [](const std::string &message) { isyslog(message.c_str()); }, [](const std::string &message) { dsyslog(message.c_str()); } ); } cPluginFritzbox::~cPluginFritzbox() { // Clean up after yourself! } const char *cPluginFritzbox::Version(void) { return VERSION; } const char *cPluginFritzbox::Description(void) { return tr(DESCRIPTION); } const char *cPluginFritzbox::CommandLineHelp(void) { // Return a string that describes all known command line options. return " -p, --log-personal-info log personal information (e.g. passwords, phone numbers, ...)\n" " -c cmd, --on-call=cmd call cmd on incoming or outgoing call events (see README)\n"; } bool cPluginFritzbox::ProcessArgs(int argc, char *argv[]) { // Implement command line argument processing here if applicable. static struct option long_options[] = { { "log-personal-info", no_argument, NULL, 'p' }, { "on-call", required_argument, NULL, 'c' }, { NULL } }; int c; while ((c = getopt_long(argc, argv, "pc:", long_options, NULL)) != -1) { switch (c) { case 'p': logPersonalInfo = true; DBG("Logging personal information requested"); break; case 'c': onCallCmd = optarg; DBG("User defined command " << onCallCmd << " registered"); break; default: ERR("unknown command line option" << (char)c); return false; } } return true; } bool cPluginFritzbox::Initialize(void) { fritzboxConfig.configDir = ConfigDirectory(Name()); fritzboxConfig.pluginName = Name(); return true; } bool cPluginFritzbox::Start(void) { event = new cFritzEventHandler(onCallCmd); // start new thread for plugin initialization (may take some time) cThread::Start(); return true; } void cPluginFritzbox::Stop(void) { // Store implicit setup parameters not visible / auto-detected in setup menu SetupStore("ActiveFonbook", fritzboxConfig.activeFonbookID.c_str()); SetupStore("CountryCode", fritzboxConfig.countryCode.c_str()); SetupStore("RegionCode", fritzboxConfig.regionCode.c_str()); // Migrate old setup parameters if (migratePassword) { SetupStore("EncodedPassword", fritzboxConfig.string2hex(fritzboxConfig.password).c_str()); SetupStore("Password", ""); } // Stop any background activities the plugin shall perform. fritz::Config::Shutdown(); if (event) delete event; // if (dlog) // delete dlog; // if (ilog) // delete ilog; // if (elog) // delete elog; } void cPluginFritzbox::Housekeeping(void) { // Perform any cleanup or other regular tasks. } void cPluginFritzbox::MainThreadHook(void) { if (!fritzboxConfig.useNotifyOsd && event) { std::vector ids = event->GetPendingCallIds(); for (std::vector::iterator it = ids.begin(); it < ids.end(); it++) { fritz::sCallInfo callInfo = event->GetCallInfo(*it); if (callInfo.localNumber.length() > 0) { Skins.Message(mtInfo, event->ComposeCallMessage(*it).c_str()); event->NotificationDone(*it); } } } } cString cPluginFritzbox::Active(void) { // Return a message string if shutdown should be postponed return NULL; } time_t cPluginFritzbox::WakeupTime(void) { // Return custom wakeup time for shutdown script return 0; } const char *cPluginFritzbox::MainMenuEntry(void) { std::ostringstream ssMainMenuEntry; ssMainMenuEntry << tr(MAINMENUENTRY); fritz::CallList *callList = fritz::CallList::GetCallList(false); if (callList && callList->missedCalls(fritzboxConfig.lastKnownMissedCall) > 0) { std::string buffer = (callList->missedCalls(fritzboxConfig.lastKnownMissedCall) > 1) ? tr("missed calls") : tr("missed call"); ssMainMenuEntry << " (" << callList->missedCalls(fritzboxConfig.lastKnownMissedCall) << " " << buffer << ")"; } mainMenuEntry = ssMainMenuEntry.str(); return fritzboxConfig.hideMainMenu ? NULL : mainMenuEntry.c_str(); } cOsdObject *cPluginFritzbox::MainMenuAction(void) { if (event && event->GetPendingCallIds().size() && !cNotifyOsd::isOpen()) { // called by cRemote::CallPlugin return new cNotifyOsd(event); } else // called by the user if (this->Running()) { Skins.Message(mtError, tr("Data not yet available.")); return NULL; } else return new cMenuFritzbox(this); } cMenuSetupPage *cPluginFritzbox::SetupMenu(void) { // Return a setup menu in case the plugin supports one. return new cMenuSetupFritzbox(this); } bool cPluginFritzbox::SetupParse(const char *Name, const char *Value) { // Parse your own setup parameters and store their values. if (!strcasecmp(Name, "Password")) { if (fritzboxConfig.password.size() > 0) { migratePassword = true; return true; } if (strlen(Value) > 0) { migratePassword = true; } } return fritzboxConfig.SetupParse(Name, Value); } bool cPluginFritzbox::Service(const char *Id, void *Data) { // Handle custom service requests from other plugins return false; } const char **cPluginFritzbox::SVDRPHelpPages(void) { // Return help text for SVDRP commands this plugin implements return NULL; } cString cPluginFritzbox::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode) { // Process SVDRP commands this plugin implements return NULL; } void cPluginFritzbox::Action() { // init libfritz++ fritz::Config::Setup(fritzboxConfig.url, fritzboxConfig.username, fritzboxConfig.password, logPersonalInfo); fritz::Config::Init(&fritzboxConfig.locationSettingsDetected, &fritzboxConfig.countryCode, &fritzboxConfig.regionCode); fritz::Config::SetupConfigDir(fritzboxConfig.configDir); fritz::Config::SetupMsnFilter(fritzboxConfig.msn); fritz::FonbookManager::CreateFonbookManager(fritzboxConfig.selectedFonbookIDs, fritzboxConfig.activeFonbookID); fritz::CallList::CreateCallList(); // Create FritzListener only if needed if (fritzboxConfig.showNumber || fritzboxConfig.pauseOnCall || fritzboxConfig.muteOnCall || onCallCmd.size()) fritz::Listener::CreateListener(event); } std::string cPluginFritzbox::FonbookEntryTypeToName(const fritz::FonbookEntry::eType type, bool longName) { switch (type) { case fritz::FonbookEntry::TYPE_HOME: return longName ? tr("Private") : //TRANSLATORS: telephonebook number type: this is a one char abbreviation for "home" tr("H"); case fritz::FonbookEntry::TYPE_MOBILE: return longName ? tr("Mobile") : //TRANSLATORS: telephonebook number type: this is a one char abbreviation for "mobile" tr("M"); case fritz::FonbookEntry::TYPE_WORK: return longName ? tr("Business") : //TRANSLATORS: telephonebook number type: this is a one char abbreviation for "work" tr("W"); default: return ""; } } VDRPLUGINCREATOR(cPluginFritzbox); // Don't touch this! fritzbox-1.5.3/README.de0000644000175000017500000001114212467660216014173 0ustar tobiastobiasEin Plugin fr den Video Disc Recorder (VDR). Autoren: Joachim Wilke Matthias Becker Projektseite: https://github.com/jowi24/vdr-fritz Download unter: https://github.com/jowi24/vdr-fritz/releases Lizenzinformationen sind in der Datei COPYING enthalten. ** Hinweis: Die englischsprachige HISTORY Datei kann ggf. Informationen ber neue Funktionen beinhalten, die in dieser Dokumentation noch nicht eingepflegt sind. ** --<---------------------------------------------------------------------------- Installation: Das Fritz Plugin unterscheidet sich nicht wesentlich von anderen Plugins fr den VDR. Das meiste der VDR-Dokumentation zu Plugins gilt auch hier. Zustzlich sind lediglich die folgende Bibliotheks-Abhngigkeiten zu beachten: - GCrypt Bibliothek (libgcrypt) - Gnu Common CPP Bibliothek (libccgnu2, libccext2) --<---------------------------------------------------------------------------- Beschreibung: * Anrufsignalisierung Das Fritz!Box Plugin verbindet sich mit der Fritz!Box um ber eingehende oder ausgehende Anrufe zu informieren. Dabei kann das Plugin VDR stummschalten und die Wiedergabe anhalten. Um diese Funktion zu nutzen, muss die Fritz!Box einmalig aktiviert werden, indem von einem der angeschlossenen Telefone "#96*5*" gewhlt wird. Dies funktioniert mit allen Firmwareversionen >= xx.03.99. In Verbindung mit ISDN Telefonen kann es beim Whlen von "#96*5*" Probleme geben. In diesem Fall hilft es am Telefon "auto keypad", "dial * and #" oder hnliches zu aktivieren. Um nicht bei jedem Anruf benachrichtigt zu werden, lsst sich eine Liste von MSNs anlegen bei denen man benachrichtigt werden mchte. Max. 22 solcher MSNs sind mglich. Alle Einstellungen bezglich der Anrufsignalisierung knnen im Einstellungsmenu des Plugins direkt im VDR durchgefhrt werden. * Telefonbcher Das Plugin untersttzt verschiedene Telefonbcher. Im Setup Men des Plugins lsst sich einstellen, welche Telefonbcher verwendet werden. Im Falle eines Anrufes wird versucht die Telefonnummer in einem dieser Telefonbcher zu finden. Dabei wird in der eingestellten Reihenfolge vorgegangen. Im Hauptmenu des Plugins wird das erste Telefonbuch angezeigt, das Eintrge enthlt. Mit der [OK]-Taste knnen Kontakte direkt angerufen werden. Diese Funktion nutzt dabei das Telefon, welches unter Telefonie > Anrufliste > Whlhilfe ausgewhlt ist. -> Fritz!Box Telefonbuch Dieses Telefonbuch greift auf die Eintrge der Fritz!Box zu. -> das-oertliche.de Telefonbuch Dieses Telefonbuch versucht eine Rckwrtsauflsung ber die Webseite das-oertliche.de. Da dieses Telefonbuch keine eigentlichen Eintrge besitzt, kann es nicht im Hauptmenu des Plugins angezeigt werden. -> nummerzoeker phone book / tel.local.ch phone book Wie das-oertliche.de, jedoch fr Telefonnummern aus den Niederlanden und der Schweiz. * Fritz!Box Anrufliste ber die Farbtasten lassen sich die drei Anruflisten der Fritz!Box [Grn] liefert die Liste der eingegangenen Anrufe, [Gelb] die Liste der verpassten Anrufe und [Blau] die Liste der ausgehenden Anrufe. Mit [OK] ffnet sich ein Menu mit den Details. Mit [Rot] kann der Anrufer zurckgerufen werden. --<---------------------------------------------------------------------------- Kommandozeilenoptionen: -> Anonymisierung der Log-Dateien Das Plugin protokolliert Statusinformationen in das System Log (syslog). Normalerweise werden dabei sensitive Informationen, wie Telefonnummern, anonymisiert dargestellt. ber den Parameter '-p' kann diese Anonymisierung abgeschaltet werden. -> Benutzerdefinierte Befehle bei Anrufen ausfhren Mit Hilfe des Parameters '-c cmd' kann ein Befehl oder Skript festgelegt werden, welches bei ein- und ausgehenden Anrufen ausgefhrt wird. Das Plugin ruft 'cmd' abhngig von der Art des Anrufs mit zustzlichen Parametern auf: * Bei ein- und ausgehenden Anrufen: - cmd CALL [OUT|IN] * Nach Aufbau der Verbindung: - cmd CONNECT * Bei Gesprchsende: - cmd DISCONNECT * Sobald alle laufenden Gesprche beendet sind: - cmd FINISHED Ein Beispiel-Skript befindet sich in template/on-call.sh. --<---------------------------------------------------------------------------- Hinweis: Dieses Plugin wurde ursprnglich mit der Fritz!Box Fon WLAN 7170 FW 29.04.29 getestet. Eine ausfhrliche Liste findet sich auf der Projektseite. Wir freuen uns ber Rckmeldung zu (Miss)-Erfolg mit anderen Firmware-Versionen und Gerten. fritzbox-1.5.3/libnet++/0000755000175000017500000000000012467661105014326 5ustar tobiastobiasfritzbox-1.5.3/libnet++/SoapClient.h0000644000175000017500000000226512467660543016552 0ustar tobiastobias/* * libnet++ * * Copyright (C) 2007-2013 Joachim Wilke * * 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. * */ #ifndef SOAPCLIENT_H #define SOAPCLIENT_H #include "HttpClient.h" namespace network { class SoapClient : public HttpClient { private: std::string soapAction; public: explicit SoapClient(const std::string &host, int port = 80); virtual ~SoapClient(); std::string post(const std::string &request, const std::string &action, const std::string &body); }; } #endif /* SOAPCLIENT_H_ */ fritzbox-1.5.3/libnet++/SoapClient.cpp0000644000175000017500000000237312467660543017105 0ustar tobiastobias/* * libnet++ * * Copyright (C) 2007-2013 Joachim Wilke * * 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 "SoapClient.h" namespace network { SoapClient::SoapClient(const std::string &host, int port) : HttpClient{host, port} { } SoapClient::~SoapClient() { } std::string SoapClient::post(const std::string &request, const std::string &action, const std::string &body) { header_t header = { { "Content-Type", "text/xml; charset=utf-8" }, { "SOAPAction", action }, }; return sendRequest(request, std::stringstream().flush() << body, header); } } fritzbox-1.5.3/libnet++/Makefile0000644000175000017500000000070112467660543015771 0ustar tobiastobiasAFILE = $(notdir $(subst /.a,.a,$(addsuffix .a,$(CURDIR)))) OBJS = $(patsubst %.cpp,%.o,$(wildcard *.cpp)) .PHONY: all clean all: $(AFILE) %.o: %.cpp $(CXX) $(CXXFLAGS) -o $@ -c $< $(AFILE): $(OBJS) @ar ru $(AFILE) $(OBJS) clean: @-rm -f $(AFILE) $(OBJS) $(DEPFILE) ### # Dependencies: MAKEDEP = $(CXX) -MM -MG DEPFILE = .dependencies $(DEPFILE): Makefile @$(MAKEDEP) $(DEFINES) $(CXXFLAGS) $(OBJS:%.o=%.cpp) > $@ -include $(DEPFILE)fritzbox-1.5.3/libnet++/TcpClient.h0000644000175000017500000000241612467660543016374 0ustar tobiastobias/* * libnet++ * * Copyright (C) 2007-2013 Joachim Wilke * * 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. * */ #ifndef TCPCLIENT_H #define TCPCLIENT_H #include namespace network { class TcpClient { protected: std::string host; int port; bool connected; boost::asio::ip::tcp::iostream *stream; void connectStream(); public: void disconnectStream(); TcpClient(const std::string &host, int port); virtual ~TcpClient(); std::string readLine(bool removeNewline = true); void expireStreamNow(); void write(const std::string &data); }; } #endif /* TCPCLIENT_H_ */ fritzbox-1.5.3/libnet++/TcpClient.cpp0000644000175000017500000000375212467660543016733 0ustar tobiastobias/* * libnet++ * * Copyright (C) 2007-2013 Joachim Wilke * * 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 "TcpClient.h" #include namespace network { void TcpClient::connectStream() { DBG("Connecting to " << host << ":" << port); std::string sPort = static_cast(std::stringstream().flush() << port).str(); stream = new boost::asio::ip::tcp::iostream(host, sPort); if (!(*stream)) throw std::runtime_error(stream->error().message()); connected = true; } TcpClient::TcpClient(const std::string &host, int port) : host{host}, port{port}, connected{false}, stream{nullptr} { } TcpClient::~TcpClient() { disconnectStream(); } std::string TcpClient::readLine(bool removeNewline) { if (!connected) connectStream(); std::string line; std::getline(*stream, line); if (line.length() > 0 && removeNewline) line.erase(line.end()-1, line.end()); return line; } void TcpClient::expireStreamNow() { if (stream) stream->expires_from_now(boost::posix_time::seconds(0)); } void TcpClient::disconnectStream() { if (stream && connected) { DBG("Disconnecting from " << host << ":" << port); stream->close(); delete stream; } connected = false; } void TcpClient::write(const std::string &data) { if (!connected) connectStream(); *stream << data; } } fritzbox-1.5.3/libnet++/HttpClient.h0000644000175000017500000000402512467660543016563 0ustar tobiastobias/* * libnet++ * * Copyright (C) 2007-2013 Joachim Wilke * * 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. * */ #ifndef HTTPCLIENT_H #define HTTPCLIENT_H #include #include "TcpClient.h" namespace network { class HttpClient : public TcpClient { public: typedef std::vector> param_t; typedef std::map header_t; typedef std::string body_t; typedef std::pair response_t; private: const header_t defaultHeader = { {"User-Agent", "Lynx/2.8.6" }, {"Connection", "Close" }, {"Host", host }, }; protected: std::string sendRequest(const std::string &request, const std::ostream &postdata = std::ostringstream(), const header_t &header = header_t()); response_t parseResponse(); public: HttpClient(const std::string &host, int port = 80); virtual ~HttpClient(); static std::string getURL(const std::string &url, const header_t &header = header_t()); std::string get (const std::string &request, const param_t ¶ms = param_t(), const header_t &header = header_t()); std::string post (const std::string &request, const param_t &postdata, const header_t &header = header_t()); std::string postMIME(const std::string &request, const param_t &postdata, const header_t &header = header_t()); }; } #endif /* HTTPCLIENT_H_ */ fritzbox-1.5.3/libnet++/HttpClient.cpp0000644000175000017500000001410512467660543017116 0ustar tobiastobias/* * libnet++ * * Copyright (C) 2007-2013 Joachim Wilke * * 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 "HttpClient.h" #include #include #include #include namespace network { HttpClient::HttpClient(const std::string &host, int port) : TcpClient{host, port} { } HttpClient::~HttpClient() { } HttpClient::response_t HttpClient::parseResponse() { header_t header; body_t body; std::string http_version; *stream >> http_version; unsigned int status_code; *stream >> status_code; std::string status_message; std::getline(*stream, status_message); if (!(*stream) || http_version.substr(0, 5) != "HTTP/") throw std::runtime_error("Invalid response"); DBG("HTTP status code " << status_code); // Process the response headers, which are terminated by a blank line std::string headerline; while (std::getline(*stream, headerline) && headerline != "\r") { size_t separator = headerline.find(':'); if (separator == std::string::npos) throw std::runtime_error("Invalid header format detected in HTTP response."); std::string key = headerline.substr(0, separator); std::string value = headerline.substr(separator+2); header.insert(std::pair(key, value)); DBG("Found header: " << key << ": " << value); } // The remaining data is the body std::stringstream bodystream; bodystream << stream->rdbuf(); body = bodystream.str(); DBG("Body size " << body.length() << " Bytes."); // check encoding and convert const std::string charsetToken = "charset="; const std::string& contentType = header["Content-Type"]; if (contentType.length()) { size_t start = contentType.find(charsetToken); if (start != std::string::npos) { start += charsetToken.length(); size_t stop = contentType.find('\r', start); if (stop == std::string::npos) stop = contentType.find('\n', start); std::string charset = std::string(contentType, start, stop-start); DBG("Converting response from charset " << charset << " to local encoding."); body = convert::CharsetConverter::ConvertToLocalEncoding(body, charset); } } return response_t(header, body); } std::string HttpClient::sendRequest(const std::string &request, const std::ostream &postdata, const header_t &header) { if (!connected) connectStream(); std::stringstream post; post << postdata.rdbuf(); int postContentLength = post.str().length(); std::string method = postContentLength ? "POST" : "GET"; DBG("Requesting HTTP " << method << " on " << request); *stream << method << " " << request << " HTTP/1.0\r\n"; for (auto entry : defaultHeader) { *stream << entry.first << ": " << entry.second << "\r\n"; } for (auto entry : header) { *stream << entry.first << ": " << entry.second << "\r\n"; } if (postContentLength) *stream << "Content-Length: " << postContentLength << "\r\n" << "\r\n" << post.str() << "\r\n" << std::flush; else *stream << "\r\n" << std::flush; response_t response = parseResponse(); disconnectStream(); // check for redirection header_t responseHeader = response.first; if (responseHeader["Location"].length() > 0) { DBG("Redirect requested to " << responseHeader["Location"]); return getURL(responseHeader["Location"]); } return response.second; } std::string HttpClient::get(const std::string& url, const param_t ¶ms, const header_t &header) { std::stringstream ss; if (url.find('?') == std::string::npos) ss << url << "?"; else ss << url << "&"; for (auto parameter: params) ss << parameter.first << "=" << parameter.second << "&"; return sendRequest(ss.str(), std::ostringstream(), header); } std::string HttpClient::post(const std::string &request, const param_t &postdata, const header_t &header) { header_t fullheader = { { "Content-Type", "application/x-www-form-urlencoded" } }; fullheader.insert(begin(header), end(header)); std::stringstream ss; for (auto parameter : postdata) ss << parameter.first << "=" << parameter.second << "&"; return sendRequest(request, ss, fullheader); } std::string HttpClient::getURL(const std::string &url, const header_t &header) { //TODO support other port //TODO support HTTPS size_t protoMarker = url.find("://"); size_t hostMarker = url.find("/", protoMarker+4); if (protoMarker == std::string::npos || hostMarker == std::string::npos) throw std::runtime_error("Invalid url."); std::string proto = url.substr(0, protoMarker); std::string host = url.substr(protoMarker+3, hostMarker-protoMarker-3); std::string request = url.substr(hostMarker); if (proto.compare("http") != 0) throw std::runtime_error("Invalid protocol in url."); HttpClient client(host); return client.get(request, param_t(), header); } std::string HttpClient::postMIME(const std::string &request, const param_t &postdata, const header_t &header) { const std::string boundary = "----FormBoundaryZMsGfL5JxTz5LuAW"; header_t fullheader = { { "Content-Type", "multipart/form-data; boundary=" + boundary } }; fullheader.insert(begin(header), end(header)); std::stringstream ss; for (auto parameter : postdata) { ss << "--" << boundary << "\r\n" << "Content-Disposition: form-data; name=\""+parameter.first+"\"\r\n" << "\r\n" << parameter.second << "\r\n"; } ss << "--" << boundary << "--\r\n"; return sendRequest(request, ss, fullheader); } } fritzbox-1.5.3/libconv++/0000755000175000017500000000000012467661105014505 5ustar tobiastobiasfritzbox-1.5.3/libconv++/CharsetConverter.h0000644000175000017500000000240612467660536020150 0ustar tobiastobias/* * libiconv++ * * Copyright (C) 2012-2013 Joachim Wilke * * 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 namespace convert { class CharsetConverter { private: iconv_t conv; bool ignoreError; std::string getDefaultCharset(); public: CharsetConverter(const std::string& fromEncoding, const std::string& toEncoding = "", bool ignoreError = true); ~CharsetConverter(); std::string convert(const std::string& input) const; static std::string ConvertToLocalEncoding(const std::string &input, const std::string &encoding); }; } fritzbox-1.5.3/libconv++/Makefile0000644000175000017500000000070112467660536016152 0ustar tobiastobiasAFILE = $(notdir $(subst /.a,.a,$(addsuffix .a,$(CURDIR)))) OBJS = $(patsubst %.cpp,%.o,$(wildcard *.cpp)) .PHONY: all clean all: $(AFILE) %.o: %.cpp $(CXX) $(CXXFLAGS) -o $@ -c $< $(AFILE): $(OBJS) @ar ru $(AFILE) $(OBJS) clean: @-rm -f $(AFILE) $(OBJS) $(DEPFILE) ### # Dependencies: MAKEDEP = $(CXX) -MM -MG DEPFILE = .dependencies $(DEPFILE): Makefile @$(MAKEDEP) $(DEFINES) $(CXXFLAGS) $(OBJS:%.o=%.cpp) > $@ -include $(DEPFILE)fritzbox-1.5.3/libconv++/EntityConverter.h0000644000175000017500000000205312467660536020031 0ustar tobiastobias/* * libiconv++ * * Copyright (C) 2012-2013 Joachim Wilke * * 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. * */ #ifndef ENTITYCONVERTER_H_ #define ENTITYCONVERTER_H_ #include namespace convert { class EntityConverter { public: static std::string DecodeEntities(const std::string &s); }; } /* namespace convert */ #endif /* ENTITYCONVERTER_H_ */ fritzbox-1.5.3/libconv++/EntityConverter.cpp0000644000175000017500000001045512467660536020371 0ustar tobiastobias/* * libiconv++ * * Copyright (C) 2012-2013 Joachim Wilke * * 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 "EntityConverter.h" #include #include #include #include "CharsetConverter.h" namespace convert { const std::map Entities = { {" ", " "}, {"¡", "¡"}, {"¢", "¢"}, {"£", "£"}, {"¤","€"}, //krazy:exclude=spelling {"¥", "¥"}, {"¦","Š"}, {"§", "§"}, {"¨", "š"}, {"©", "©"}, {"ª", "ª"}, {"«", "«"}, {"¬", "¬"}, {"­", "­"}, {"®", "®"}, {"¯", "¯"}, {"°", "°"}, {"±","±"}, {"²", "²"}, {"³", "³"}, {"´", "Ž"}, {"µ", "µ"}, {"¶", "¶"}, {"·","·"}, {"¸", "ž"}, {"¹", "¹"}, {"º", "º"}, {"»", "»"}, {"¼","Œ"}, {"½","œ"}, {"¾","Ÿ"}, {"¿","¿"}, {"À","À"}, {"Á","Á"}, {"Â", "Â"}, {"Ã","Ã"}, {"Ä", "Ä"}, {"Å", "Å"}, {"Æ", "Æ"}, {"Ç","Ç"}, {"È","È"}, {"É","É"}, {"Ê", "Ê"}, {"Ë", "Ë"}, {"Ì","Ì"}, {"Í","Í"}, {"Î", "Î"}, {"Ï", "Ï"}, {"Ð", "Ð"}, {"Ñ","Ñ"}, {"Ò","Ò"}, {"Ó","Ó"}, {"Ô", "Ô"}, {"Õ","Õ"}, {"Ö", "Ö"}, {"×", "×"}, {"Ø","Ø"}, {"Ù","Ù"}, {"Ú","Ú"}, {"Û", "Û"}, {"Ü", "Ü"}, {"Ý","Ý"}, {"Þ", "Þ"}, {"ß", "ß"}, {"à","à"}, {"á","á"}, {"â", "â"}, {"ã","ã"}, {"ä", "ä"}, {"å", "å"}, {"æ", "æ"}, {"ç","ç"}, {"è","è"}, {"é","é"}, {"ê", "ê"}, {"ë", "ë"}, {"ì","ì"}, {"í","í"}, {"î", "î"}, {"ï", "ï"}, {"ð", "ð"}, {"ñ","ñ"}, {"ò","ò"}, {"ó","ó"}, {"ô", "ô"}, {"õ","õ"}, {"ö", "ö"}, {"÷","÷"}, {"ø","ø"}, {"ù","ù"}, {"ú","ú"}, {"û", "û"}, {"ü", "ü"}, {"ý","ý"}, {"þ", "þ"}, {"ÿ", "ÿ"}, {"&", "&"}, }; std::string EntityConverter::DecodeEntities(const std::string &input) { std::string output = input; if (output.find("&") != std::string::npos) { // convert the entities from UTF-8 to current system character table CharsetConverter conv("UTF-8"); // convert entities of format ÿ (unicode) while (output.find("&#x") != std::string::npos) { size_t pos = output.find("&#x"); size_t end = output.find(";", pos); // get hex code std::string unicode = output.substr(pos+3, end - pos - 3); // convert to int std::stringstream ss; ss << std::hex << unicode; int codepoint; ss >> codepoint; // get corresponding char char out_buffer[8]; memset(out_buffer, 0, 8); char *out = &(out_buffer[0]); wchar_t in_buffer = codepoint; char *in = (char *)&(in_buffer); size_t inlen = sizeof(in_buffer), outlen = sizeof(out_buffer); iconv_t cd; cd = iconv_open("utf-8", "ucs-2"); iconv(cd, &in, &inlen, &out, &outlen); iconv_close(cd); // replace it output.replace(pos, end-pos+1, std::string(out_buffer)); } // convert other entities with table for (auto entity : Entities) { std::string::size_type pos = output.find(entity.first); while (pos != std::string::npos) { output.replace(pos, entity.first.length(), conv.convert(entity.second)); pos = output.find(entity.first, pos-1); } } } return output; } } /* namespace convert */ fritzbox-1.5.3/libconv++/CharsetConverter.cpp0000644000175000017500000000547612467660536020515 0ustar tobiastobias/* * libiconv++ * * Copyright (C) 2012-2013 Joachim Wilke * * 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 "CharsetConverter.h" #include #include #include #include namespace convert { CharsetConverter::CharsetConverter(const std::string& fromEncoding, const std::string& toEncoding, bool ignoreError) : ignoreError{ignoreError} { conv = iconv_open(toEncoding.length() ? toEncoding.c_str() : getDefaultCharset().c_str(), fromEncoding.c_str()); if (conv == (iconv_t)-1) { if (errno == EINVAL) throw std::runtime_error("Unsupported conversion from " + toEncoding + " to " + fromEncoding); else throw std::runtime_error("Unknown error initializing converter."); } } CharsetConverter::~CharsetConverter() { iconv_close(conv); } std::string CharsetConverter::convert(const std::string& input) const { std::vector inputBuffer(input.begin(), input.end()); char* srcPtr = &inputBuffer[0]; size_t srcSize = input.size(); std::vector buf(2048); std::string output; while (0 < srcSize) { char* dstPtr = &buf[0]; size_t dstSize = buf.size(); size_t res = iconv(conv, &srcPtr, &srcSize, &dstPtr, &dstSize); if (res == (size_t)-1) { if (errno == E2BIG) { // ignore this error } else if (ignoreError) { // skip character ++srcPtr; --srcSize; } else { switch (errno) { case EILSEQ: case EINVAL: throw std::runtime_error("Invalid multibyte chars."); default: throw std::runtime_error("Unknown error initializing converter."); } } } output.append(&buf[0], buf.size() - dstSize); } return output; } std::string CharsetConverter::ConvertToLocalEncoding(const std::string &input, const std::string &encoding) { CharsetConverter c(encoding); return c.convert(input); } std::string CharsetConverter::getDefaultCharset() { if (setlocale(LC_CTYPE, "")) return nl_langinfo(CODESET); char *langPtr = getenv("LANG"); if (langPtr) { std::string lang(langPtr); size_t pos = lang.find('.'); if (pos == std::string::npos) return lang; return lang.substr(pos+1); } return "UTF-8"; } } /* namespace logger */ fritzbox-1.5.3/fritzeventhandler.h0000644000175000017500000000420212467660216016632 0ustar tobiastobias/* * Fritz!Box plugin for VDR * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef FRITZEVENTHANDLER_H_ #define FRITZEVENTHANDLER_H_ #include #include #include #include #include "libfritz++/Listener.h" class cFritzEventHandler : public fritz::EventHandler { private: bool muted; int volumeLevel; bool paused; bool getCallInfoCalled; std::string onCallCmd; struct sConnection { enum eConnState { IDLE, RINGING, ACTIVE } state; fritz::sCallInfo *callInfo; bool displayed; }; // connId -> sConnection std::map connections; cMutex mutex; void Exec(const std::ostream & url) const; bool CareForCall(bool outgoing); void DoMute(); void DoUnmute(); public: cFritzEventHandler(std::string onCallCmd = ""); virtual ~cFritzEventHandler(); size_t GetConnectionCount() { return connections.size(); } std::vector GetPendingCallIds(); fritz::sCallInfo GetCallInfo(int connId); void NotificationDone(int connId); std::string ComposeCallMessage(int connId); virtual void handleCall(bool outgoing, int connId, std::string remoteNumber, std::string remoteName, fritz::FonbookEntry::eType remoteType, std::string localParty, std::string medium, std::string mediumName) override; virtual void handleConnect(int connId) override; virtual void handleDisconnect(int connId, std::string duration) override; }; #endif /* FRITZEVENTHANDLER_H_ */ fritzbox-1.5.3/notifyosd.h0000644000175000017500000000253712467660216015123 0ustar tobiastobias/* * Fritz!Box plugin for VDR * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef NOTIFYOSD_H_ #define NOTIFYOSD_H_ #include #include #include #include "fritzeventhandler.h" class cNotifyOsd : public cOsdObject { private: cOsd *osd; const cFont *font; cFritzEventHandler *event; static bool open; std::vector lines; time_t lastUpdate; public: cNotifyOsd(cFritzEventHandler *event); virtual ~cNotifyOsd(); bool GenerateOsdText(); virtual void Show(void); virtual eOSState ProcessKey(eKeys Key); static bool isOpen() { return open; } }; #endif /*NOTIFYOSD_H_*/ fritzbox-1.5.3/libfritz++/0000755000175000017500000000000012467661105014676 5ustar tobiastobiasfritzbox-1.5.3/libfritz++/Config.h0000644000175000017500000001634412467660540016266 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef CONFIG_H #define CONFIG_H #include #include #include #include #include "FritzClient.h" namespace fritz { const std::string HIDDEN = ""; constexpr size_t RETRY_DELAY = 60; /** * Global config class for libfritz++. * This class maintains all configuration information needed by classes part of libfritz++. * It is instantiated once automatically, a pointer gConfig is globally available. */ class Config { public: enum eLoginType { UNKNOWN, PASSWORD, SID, LUA }; private: struct sConfig { std::string configDir; // path to libraries' config files (e.g., local phone book) std::string lang; // webinterface language std::string url; // fritz!box url int uiPort; // the port of the fritz box web interface int upnpPort; // the port of the UPNP server of the fritz box int listenerPort; // the port of the fritz box call monitor std::string username; // fritz!box web interface username, if applicable std::string password; // fritz!box web interface password time_t lastRequestTime; // with eLoginType::SID: time of last request sent to fritz box eLoginType loginType; // type of login procedure std::string sid; // SID to access boxes with firmware >= xx.04.74 std::string countryCode; // fritz!box country-code std::string regionCode; // fritz!box region-code std::vector sipNames; // the SIP provider names std::vector sipMsns; // the SIP provider msn numbers std::vector msn; // msn's we are interesed in std::vector selectedFonbookIDs; // active phone books std::string activeFonbook; // currently selected Fonbook bool logPersonalInfo; // log sensitive information like passwords, phone numbers, ... } mConfig; Config( std::string url, std::string username, std::string password ); public: /** * Sets up the libfritz++ library. * This has to be the first call to libfritz++. * @param the hostname of the Fritz!Box device, defaults to fritz.box * @param the password of the Fritz!Box device, defaults to an empty one * @param allows personal information to be logged */ void static Setup(std::string hostname="fritz.box", std::string username="", std::string password="", bool logPersonalInfo = false ); /** * Sets arbitrary ports for connections to the Fritz!Box's listener and webinterface. * @param the port to connect to the listener * @param the port to connect to the webinterface * @param the port to connect to the UPNP server */ void static SetupPorts( int listener, int ui, int upnp ); /** * Establishes MSN filtering. * An MsnFilter enables the library to only notify the application on * events which occur on one of the MSNs specified. A call to this method is only * needed if filtering is wanted. Default is no filtering. * @param the list of MSNs to filter on */ void static SetupMsnFilter( std::vector vMsn ); /** * Sets up a directory for arbitrary data storage. * This is currently used by local fonbook to persist the fonbook entries to a file. * @param full path to the writable directory */ void static SetupConfigDir( std::string dir); /** * Initiates the libfritz++ library. * @param indicates, whether auto-detection of location settings was successful * @param Sets the default value for countryCode. If locationSettingsDetected == true, this returns the detected countryCode. * @param Sets the default value for regionCode. If locationSettingsDetected == true, this returns the detected regionCode. */ bool static Init( bool *locationSettingsDetected = nullptr, std::string *countryCode = nullptr, std::string *regionCode = nullptr ); /** * Closes all pending connections and objects held by libfritz++. * Stores unsaved data. */ bool static Shutdown(); std::string &getConfigDir( ) { return mConfig.configDir; } std::string &getLang( ) { return mConfig.lang; } void setLang( std::string l ) { mConfig.lang = l; } std::string &getUrl( ) { return mConfig.url; } int getUiPort( ) { return mConfig.uiPort; } int getListenerPort( ) { return mConfig.listenerPort; } int getUpnpPort( ) { return mConfig.upnpPort; } std::string &getPassword( ) { return mConfig.password; } std::string &getUsername( ) { return mConfig.username; } eLoginType getLoginType( ) { return mConfig.loginType; } void setLoginType(eLoginType type) { mConfig.loginType = type; } time_t getLastRequestTime() { return mConfig.lastRequestTime; } void updateLastRequestTime() { mConfig.lastRequestTime = time(nullptr); } std::string &getSid( ) { return mConfig.sid; } void setSid(std::string sid) { mConfig.sid = sid; } std::string &getCountryCode( ) { return mConfig.countryCode; } void setCountryCode( std::string cc ) { mConfig.countryCode = cc; } std::string &getRegionCode( ) { return mConfig.regionCode; } void setRegionCode( std::string rc ) { mConfig.regionCode = rc; } std::vector &getSipNames( ) { return mConfig.sipNames; } void setSipNames( std::vector names) { mConfig.sipNames = names; } std::vector &getSipMsns( ) { return mConfig.sipMsns; } void setSipMsns( std::vector msns) { mConfig.sipMsns = msns; } std::vector getMsnFilter( ) { return mConfig.msn; } std::vector getFonbookIDs( ) { return mConfig.selectedFonbookIDs; } void setFonbookIDs(std::vector v) { mConfig.selectedFonbookIDs = v; } std::string &getActiveFonbook( ) { return mConfig.activeFonbook; } void setActiveFonbook( std::string f ) { mConfig.activeFonbook = f; } bool logPersonalInfo( ) { return mConfig.logPersonalInfo; }; virtual ~Config(); FritzClientFactory *fritzClientFactory; }; extern Config* gConfig; } #endif /* CONFIG_H_ */ fritzbox-1.5.3/libfritz++/HISTORY0000644000175000017500000003227712467660540015777 0ustar tobiastobias2008-12: - Added type "ALL" to CallList to retrieve complete list of calls at once. - Moved callType from CallList to CallEntry. - Implemented in-library msn filtering and reverse-lookups. - Renamed various methods in FonbookManager from *Fonbuch* to *Fonbook*. - Made CallList a singleton. - Replaced string tokenizer in Listener. - Refactored MSN-filter functionality. - Added "-fPIC" to Makefiles. - A call to Config::SetupFonbookIDs now deletes a previously instantiated FonbookManager to allow multiple calls to SetupFonbookIDs in case of configuration changes. - Introduced new method CallList::DeleteCallList() to explicitly delete the singleton instance. - Made Listener a singleton. A call to Listener::CreateListener() is used to activate this feature. - Introduced new method CallList::CreateCallList() to explicitly pre-fetch the call list before calling CallList::getCallList(). - Moved Config::SetupFonbookIDs to FonbookManager::CreateFonbookManager(). - Renamed Tools::GetPhoneSettings() to Tools::GetLocationSettings(). - Added resolving of SIP[0-9] to real provider names. - removed the port defines and replaced them by two new fields in class Config to allow easier unit testing - default LKZ to 49 (Germany) if an error occurs 2009-02: - added exception catch in Tools::GetLang() and Tools::Login() 2009-03: - Removed the default of countryCode = "49" if Tools::GetLocationSettings() fails. This task is handed over to the caller, see next. - Added new parameters to Config::Setup() to give default values for countryCode and regionCode. The default parameters are used, when auto-detection in Tools::GetLocationSettings() fails. The new parameter locationSettingsDetected indicates whether auto-detection was successful. In this case, the given default values are overwritten to give the caller access to the new values. 2009-04: - Fixed naming of local phonebook. The recommended name is now localphonebook.csv, the old name localfonbuch.csv is still accepted. The directory remains $vdrconfigdir/plugins/fritzbox/. 2009-05: - Updated OertlichesFonbook to new website layout - Fixed naming of local phonebook. The plugin now really looks for a file called localphonebook.csv. 2009-06: - Provided Interface to add entries to phone books. By default, existing implementations do not support this feature. - Implemented adding of entries in local phone book. 2009-08: - Implemented new login method for Fritz!Box firmware >= xx.04.74 using SIDs. This needs features from openssl library. For compiling, libssl-dev (or similar) is needed. - Adapted to new tcpclient++ - Fixed a warning warn_unused_result in LocalFonbook.cpp - Fixed wrong HTTP-GET header in Nummerzoeker.cpp - Fixed detection of login failure in Tools::Login() - Improved cleanup when deleting Listener, FritzFonbook, CallList - Delay destructor of FritzFonbook and CallList to wait for running threads to end - Improved concurrent access to Fritz!Box using Tools::GetFritzBoxMutex() 2009-09: - Improved detection of login type (SID or PASSWORD), which is now done only once - Improved Tools::Login() to avoid unneccessary logins - Created FritzClient to act as an facade to the FB which uses tcpclient::HttpClient. FritzClient handles all communication to the FB including login. The consumer just uses one of the following methods to get information from the FB * RequestCallList() * RequestLocationSettings() * RequestSipSettings() * RequestFonbook() This class uses a mutex to automatically serialize multiple instances of itself. The lock is aquired at creation and released at destruction of the class instance. Removed mutex in Tools. - Login() and GetLang() moved as private methods to FritzClient - Code cleanup and introduction of RETRY_* macros for easy retry handling when communicating with the FB - Fixed entity decoding in FritzFonbook.cpp - Added sort routines in CallList and Fonbook 2009-11: - Adapted to changes in tcpclient++ * fixed TcpClient to throw correct exceptions on connect. This fixes detection of disabled call monitor, the corresponding hint "dial #96*5*" is now shown in syslog again - Improved matching of phone numbers: Fritz!Box control codes *xxx# are now ignored. - Added missing include in FritzClient.cpp 2009-12: - Fixed retry delay calculation in case of connection refused 2010-01: - Fixed a possible segfault when sorting calllists and fonbooks - Added Config::SetupPorts() to provide non-standard ports - Fixed some warnings about ununsed parameters in base-classes and empty implementations - Removed useless check in CallList::RetrieveEntry() - FritzClient::Login() now returns a bool wether login was successful - FritzClient::hasValidPassword() can now be used to determine the result of the last Login() - Tools::GetLocationSettings() now returns a bool wether the password used to access the FB was valid - Fixed two bugs in sorting call lists by date / time - Improved destructor of Listener to allow proper cleanup of thread - Added CallList::LastCall() - removed FonbookEntry::getTypeName() as this is something the consumer has to take care about 2010-02: - introduced I18N_NOOP macro, this allows application that use libfritz++ to identify strings delivered by the library (e.g., using xgettext) they should localize - fixed sorting issue in calllist by putting remoteNumber / "unknown" into the remoteName field - "unknown" call list entries are now always sorted to beginning of the list - addes a missing redefinition of GetTechId() in class FonbookManager - modified logging to handle full path filenames cause by cmake in __FILE__. Provided new logging macros DBG, INF, ERR - Removed dependency to OpenSSL due to licensing issues, using copy of MD5 implementation from GNU coreutils 5.93 - Removed md5.[h,c] in favor of libgcrypt, libfritz++ now needs libgcrypt's development header "gcrypt.h" to compile - Added a missing call to Login() in FritzClient::InitCall() - Do not initiate a call if no number is given in FritzClient::InitCall() - Fixed LOCATOR macro to support cmake and make - Implemented FritzClient::getCurrentIP and FritzClient::reconnectISP - Fixed bug in FritzClient::reconnectISP - added config option for setting the UPNP port - now parsing the Fritz Box's phone book via xml export file (if available) - phone book entries now have the additional fields "quickdial", "vanity", "priority", "important" - Fixed decoding of entities in xml phone book parser 2010-03: - Modified FonbookEntry class: one FonbookEntry now holds all numbers of a person * Changed construction of FonbookEntrys accordingly * Changed interface of Fonbook::ResolveToName * Adapted FritzFonbook's parser * Adapted LocalFonbook's parser * Adapted ResolveToName in NummerzoekerFonbook and OertlichesFonbook - Adapted local phonebook to use the same xml format, new FB versions use. Existing csv phone books are converted to xml automagically, entries with TYPE_NONE are converted to TYPE_HOME - FritzFonbook is now writeable, if FB xml import is available (firmware >= xx.04.76 needed) - Added various set methods to FonbookEntry 2010-07: - Updated OertlichesFonbook to website changes - Added XmlFonbook.cpp to Makefile - Fixed resolving of calls from unknown caller - Code cleanup in Listener, OertlichesFonbook and Nummerzoeker - Added tel.local.ch phonebook 2010-08: - Added missing initialization of libgcrypt 2010-11: - Sensitive Information like passwords, phone numbers, etc. are no longer logged by default. Logging this information can be enabled via Config::Setup() - Fixed parser in Tools::GetSipSettings() - Fixed serializing XML phone books in XmlFonbook::SerializeToXml() -> this fixes uploading an xml phone book to the FB - Include TelLocalChFonbook.cpp in CMakeLists.txt - Moved from libpthread++ to libccgnu2 2010-12: - First steps in migrating to socket implementation of common c++ - Splitted Config::Setup into Config::Setup and Config::Init - Fix reverse lookup in OertlichesFonbook - Add missing include to XmlFonbook 2011-01: - Add Config::Shutdown() to gracefully shutdown the library This can be used for re-inits as well as on program exit - Improve checks when parsing result list in OertlichesFonbook Check that at most one result is returned - Fix parser of OertlichesFonbook again Looking for the onclick=... as a last attribute does not always work New method looks for the first element containing the onclick attribute and then moves to the end of the element - Keep current call list as long as possible on reload Current call list is now cleared after the new call list has been parsed (Fixes #514) - Fix XmlFonbook parser XmlFonbook Parser was not aware of empty tags - Fix retry delay calculation in Listener - Fix FonbookManager if no phone book is configured at all - Add several consts to Fonbook, FonbookEntry and Reverse Lookup Fonbooks - Add copy constructor to FonbookEntry - Add Fonbook::ChangeFonbookEntry, Fonbook::SetDefaultType - Add methods for adding and deleting fonbook entries Fonbook::AddFonbookEntry and ::DeleteFonbookEntry - Make Fonbook::fonbookList private, add a Clear() method to erase it - Only write phone books back if changes are pending - Fixed setInitialized in LocalFonbook - Added HttpClient to libfritz++ to replace remaining functionality of libtcpclient++ - Adapted Makefile / CMakeLists.txt to add HttpClient - Adapted FritzClient's get and post calls - Adapted CallList, because new implementation doesn't return the header lines - Imported some files from libcommoncpp to fix issues * remove newline after HTTP POST data An unnecessary \r\n was added to data in HTTP POST requests, with certain webservers this causes errors * boundary spelling error In MIME multipart requests, boundary is spelled boundry * HTTP POST multipart consider form data in content length, send from data together with HTTP header * Extend MIMEFormData support for filename and content-type is added * SOAPStream Flexibilize URLStream with regard to content type in http posts Add SOAPStream class - Improve HttpClient to use default HTTP port - Migrate reverse lookup phone books to use new HttpClient - Provide PostMIME method in HttpClient - Make Fonbook::GetFonbookSize() more robust If not initialized, always return 0 and not the current intermediate state - Fix missing initialization in CallList 2011-02: - Extend Fonbook::AddFonbookEntry() to allow arbitrary position for new entry - Fix initialization of LocalFonbook Add setInitialized(true) in case of no local phonebook file exists 2011-03: - Add parsing of sipMsns - Fix logging into Fritz!Box without password - Fix krazy issues - Remove translatable string 'unknown' - Fix catching exceptions in FritzClient - Fix compile error with libcommoncpp2 / IPv6 - Add some debug output regarding threading - Remove unnecessary calls to exit() at end of threads - Initialization speedup - Add mutex to access syslog 2011-04: - Add new parameter 'saveOnShutdown' to CreateFonbookManager() - Add Fonbook::isModified() - Add missing FonbookManager::Save() to forward calls to Fonbook::Save() 2011-06: - Adapt to more flexible Fritz!Box phone books 2011-07: - Fix resolve in OertlichesFonbook - Add MatchesRemoteNumber to CallEntry - Fix fonbook ResolveToName - Get rid of TYPES_COUNT in FonbookEntry 2012-03: - Fix resolve in OertlichesFonbook - Add missing const in Fonbook / FonbookManager - Fix compiler warnings -Wsign-compare and -Wswitch - Improve constructor Fonbook() to ask for title, techid, writeable * Removes direct access to these members * Adds setWriteable() if a fonbook is determined to be writeable later - Add LookupFonbook class * Lookup-only foonbooks now inherit this class * Simplifies OertlichesFonbook, Nummerzoeker, TelLocalChFonbook significantly * Caches lookups in memory * Add successful field to sResolveResult * Removed const qualifier from Fonbook::ResolveToName - Add constructor to sResolveResult * Adapt users of sResolveResult - Reorganized some includes - Provide Doxyfile - Add missing documentation in Fonbook class 2012-04: - Fix resolve in OertlichesFonbook - Fix a possible deadlock in Tools::GetSipSettings() - Move convertEntities from XmlFonbook up to Fonbook and improved it - Fix resolve in TelLocalChFonbook 2012-12: - Implement new login scheme using login_sid.lua for FB firmware >= xx.05.50 - Adapt sip settings, location settings, call list and phone book requests to new uris and format - Hide msn in syslog if logPersonalInfo is disabled - Fixes login problems with old fw-versions that return 404 on login_sid.lua https://bugs.kde.org/show_bug.cgi?id=312204 - Fix encoding conversion when requesting call list - Further fixes to allow access to older FB firmwares https://bugs.kde.org/show_bug.cgi?id=312204 2013-01: - Fix MSN filter to only match if filter is equal number of postfix of number - Fix resolving test in tel.local.ch phonebook - Add support for FB phonebooks with >3 numbers per entry, fixes a sigsev on startup using such phonebooks - Various refactoring to split loggin, networking and char conversion in separate libraries - New dependency boost::asio, dropped dependency to commoncpp 2013-05: - Fix resolve in TelLocalChFonbook 2013-06: - Add support for username authentication - Fix some warning about unused parameters fritzbox-1.5.3/libfritz++/Listener.h0000644000175000017500000000521512467660540016641 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef FRITZLISTENER_H #define FRITZLISTENER_H #include #include #include #include #include "Fonbook.h" namespace fritz{ class sCallInfo{ public: bool isOutgoing; std::string remoteNumber; std::string remoteName; std::string localNumber; std::string medium; }; class EventHandler { public: EventHandler() { } virtual ~EventHandler() { } virtual void handleCall(bool outgoing, int connId, std::string remoteNumber, std::string remoteName, fritz::FonbookEntry::eType remoteType, std::string localParty, std::string medium, std::string mediumName) = 0; virtual void handleConnect(int connId) = 0; virtual void handleDisconnect(int connId, std::string duration) = 0; }; class Listener { private: bool cancelRequested = false; static Listener *me; EventHandler *event; std::vector activeConnections; std::thread *thread; network::TcpClient *tcpClientPtr = nullptr; Listener(EventHandler *event); void handleNewCall(bool outgoing, int connId, std::string remoteNumber, std::string localParty, std::string medium); void handleConnect(int connId); void handleDisconnect(int connId, std::string duration); void cancelThread(); public: /** * Activate listener support. * This method instantiates a Listener object, which takes care of call events from the * Fritz!Box. The application has to provide an EventHandler object, which has to inherit * fritz::EventHandler. The listener notifies the application about call events using this object. * @param A pointer to the eventHandler. Subsequent calls to CreateListener, e.g., in case of * configuration changes, can omit this parameter. Then, the existing EventHandler is used. */ static void CreateListener(EventHandler *event = nullptr); static void DeleteListener(); virtual ~Listener(); void run(); }; } #endif /*FRITZLISTENER_H_*/ fritzbox-1.5.3/libfritz++/LookupFonbook.cpp0000644000175000017500000000331312467660540020173 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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 "LookupFonbook.h" #include "Config.h" namespace fritz { LookupFonbook::LookupFonbook(std::string title, std::string techId, bool writeable) :Fonbook(title, techId, writeable) { displayable = false; } LookupFonbook::~LookupFonbook() {} bool LookupFonbook::initialize() { setInitialized(true); return true; } Fonbook::sResolveResult LookupFonbook::resolveToName(std::string number) { // First, try to get a cached result sResolveResult resolve = Fonbook::resolveToName(number); // Second, to lookup (e.g., via HTTP) if (! resolve.successful) { resolve = lookup(number); // cache result despite it was successful FonbookEntry fe(resolve.name, false); fe.addNumber(number, resolve.type, "", "", 0); addFonbookEntry(fe); } return resolve; } Fonbook::sResolveResult LookupFonbook::lookup(std::string number) const { sResolveResult result(number); return result; } } /* namespace fritz */ fritzbox-1.5.3/libfritz++/CallList.h0000644000175000017500000000550012467660540016560 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef CALLLIST_H #define CALLLIST_H #include #include #include namespace fritz{ class CallList; class CallEntry { public: enum eCallType { ALL = 0, INCOMING = 1, MISSED = 2, OUTGOING = 3 }; enum eElements { ELEM_TYPE, ELEM_DATE, ELEM_REMOTENAME, ELEM_REMOTENUMBER, ELEM_LOCALNAME, ELEM_LOCALNUMBER, ELEM_DURATION, }; eCallType type; std::string date; std::string time; std::string remoteName; std::string remoteNumber; std::string localName; std::string localNumber; std::string duration; time_t timestamp; bool matchesFilter(); bool matchesRemoteNumber(std::string number); }; class CallList { private: std::thread *thread; std::vector callListIn; std::vector callListMissed; std::vector callListOut; std::vector callListAll; time_t lastCall; time_t lastMissedCall; bool valid; static CallList *me; CallList(); public: static CallList *GetCallList(bool create = true); /** * Activate call list support. * This method fetches the call list from the fritz box. Following calls to * CallList::getCallList() return a reference to this call list object. * If CreateCallList is not called before a call to getCallList() this triggers fetching * the call list in a separate thread (which is possibly not wanted). */ static void CreateCallList(); static void DeleteCallList(); virtual ~CallList(); void run(); void reload(); bool isValid() { return valid; } CallEntry *retrieveEntry(CallEntry::eCallType type, size_t id); size_t getSize(CallEntry::eCallType type); size_t missedCalls(time_t since); time_t getLastCall() { return lastCall; } time_t getLastMissedCall() { return lastMissedCall; } /** * Sorts the calllist's entries by the given element and in given order. * @param the element used for sorting * @param true if sort order is ascending, false otherwise */ void sort(CallEntry::eElements element = CallEntry::ELEM_DATE, bool ascending = true); }; } #endif /*CALLLIST_H_*/ fritzbox-1.5.3/libfritz++/XmlFonbook.h0000644000175000017500000000253312467660540017132 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2010 Joachim Wilke * * 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. * */ #ifndef XMLFONBOOK_H #define XMLFONBOOK_H #include "Fonbook.h" namespace fritz { class XmlFonbook: public Fonbook { private: std::string extractXmlAttributeValue(std::string element, std::string attribute, std::string xml); std::string extractXmlElementValue(std::string element, std::string xml); std::string charset = "UTF-8"; protected: void parseXmlFonbook(std::string *msg); std::string serializeToXml(); public: XmlFonbook(std::string title, std::string techId, bool writeable); virtual ~XmlFonbook(); }; } #endif /* XMLFONBOOK_H_ */ fritzbox-1.5.3/libfritz++/COPYING0000644000175000017500000004310312467660540015734 0ustar tobiastobias GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. fritzbox-1.5.3/libfritz++/CMakeModules/0000755000175000017500000000000012467660540017211 5ustar tobiastobiasfritzbox-1.5.3/libfritz++/CMakeModules/FindGcryptConfig.cmake0000644000175000017500000002260112467660540023413 0ustar tobiastobias# - a gcrypt-config module for CMake # # Usage: # gcrypt_check( [REQUIRED] ) # checks if gcrypt is avialable # # When the 'REQUIRED' argument was set, macros will fail with an error # when gcrypt could not be found. # # It sets the following variables: # GCRYPT_CONFIG_FOUND ... true if libgcrypt-config works on the system # GCRYPT_CONFIG_EXECUTABLE ... pathname of the libgcrypt-config program # _FOUND ... set to 1 if libgcrypt exist # _LIBRARIES ... the libraries # _CFLAGS ... all required cflags # _ALGORITHMS ... the algorithms that this libgcrypt supports # _VERSION ... gcrypt's version # # Examples: # gcrypt_check (GCRYPT gcrypt) # Check if a version of gcrypt is available, issues a warning # if not. # # gcrypt_check (GCRYPT REQUIRED gcrypt) # Check if a version of gcrypt is available and fails # if not. # # gcrypt_check (GCRYPT gcrypt>=1.4) # requires at least version 1.4 of gcrypt and defines e.g. # GCRYPT_VERSION=1.4.4. Issues a warning if a lower version # is available only. # # gcrypt_check (GCRYPT REQUIRED gcrypt>=1.4.4) # requires at least version 1.4.4 of gcrypt and fails if # only gcrypt 1.4.3 or lower is available only. # # Copyright (C) 2010 Werner Dittmann # # Redistribution and use, with or without modification, are permitted # provided that the following conditions are met: # # 1. Redistributions must retain the above copyright notice, this # list of conditions and the following disclaimer. # 2. The name of the author may not be used to endorse or promote # products derived from this software without specific prior # written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This is a much edited and simplified variant of the original UsePkgConfig.cmake # from Enrico Scholz # Copyright (C) 2006 Enrico Scholz # ### Common stuff #### set(GCR_CONFIG_VERSION 1) set(GCR_CONFIG_FOUND 0) find_program(GCR_CONFIG_EXECUTABLE NAMES libgcrypt-config --version DOC "libgcrypt-config executable") mark_as_advanced(GCR_CONFIG_EXECUTABLE) if(GCR_CONFIG_EXECUTABLE) set(GCR_CONFIG_FOUND 1) endif(GCR_CONFIG_EXECUTABLE) # Unsets the given variables macro(_gcrconfig_unset var) set(${var} "" CACHE INTERNAL "") endmacro(_gcrconfig_unset) macro(_gcrconfig_set var value) set(${var} ${value} CACHE INTERNAL "") endmacro(_gcrconfig_set) # Invokes libgcrypt-config, cleans up the result and sets variables macro(_gcrconfig_invoke _gcrlist _prefix _varname _regexp) set(_gcrconfig_invoke_result) execute_process( COMMAND ${GCR_CONFIG_EXECUTABLE} ${ARGN} OUTPUT_VARIABLE _gcrconfig_invoke_result RESULT_VARIABLE _gcrconfig_failed) if (_gcrconfig_failed) set(_gcrconfig_${_varname} "") _gcrconfig_unset(${_prefix}_${_varname}) else(_gcrconfig_failed) string(REGEX REPLACE "[\r\n]" " " _gcrconfig_invoke_result "${_gcrconfig_invoke_result}") string(REGEX REPLACE " +$" "" _gcrconfig_invoke_result "${_gcrconfig_invoke_result}") if (NOT ${_regexp} STREQUAL "") string(REGEX REPLACE "${_regexp}" " " _gcrconfig_invoke_result "${_gcrconfig_invoke_result}") endif(NOT ${_regexp} STREQUAL "") separate_arguments(_gcrconfig_invoke_result) #message(STATUS " ${_varname} ... ${_gcrconfig_invoke_result}") set(_gcrconfig_${_varname} ${_gcrconfig_invoke_result}) _gcrconfig_set(${_prefix}_${_varname} "${_gcrconfig_invoke_result}") endif(_gcrconfig_failed) endmacro(_gcrconfig_invoke) macro(_gcrconfig_invoke_dyn _gcrlist _prefix _varname cleanup_regexp) _gcrconfig_invoke("${_gcrlist}" ${_prefix} ${_varname} "${cleanup_regexp}" ${ARGN}) endmacro(_gcrconfig_invoke_dyn) # Splits given arguments into options and a package list macro(_gcrconfig_parse_options _result _is_req) set(${_is_req} 0) foreach(_gcr ${ARGN}) if (_gcr STREQUAL "REQUIRED") set(${_is_req} 1) endif (_gcr STREQUAL "REQUIRED") endforeach(_gcr ${ARGN}) set(${_result} ${ARGN}) list(REMOVE_ITEM ${_result} "REQUIRED") endmacro(_gcrconfig_parse_options) ### macro(_gcr_check_modules_internal _is_required _is_silent _prefix) _gcrconfig_unset(${_prefix}_FOUND) _gcrconfig_unset(${_prefix}_VERSION) _gcrconfig_unset(${_prefix}_PREFIX) _gcrconfig_unset(${_prefix}_LIBDIR) _gcrconfig_unset(${_prefix}_LIBRARIES) _gcrconfig_unset(${_prefix}_CFLAGS) _gcrconfig_unset(${_prefix}_ALGORITHMS) # create a better addressable variable of the modules and calculate its size set(_gcr_check_modules_list ${ARGN}) list(LENGTH _gcr_check_modules_list _gcr_check_modules_cnt) if(GCR_CONFIG_EXECUTABLE) # give out status message telling checked module if (NOT ${_is_silent}) message(STATUS "checking for module '${_gcr_check_modules_list}'") endif(NOT ${_is_silent}) # iterate through module list and check whether they exist and match the required version foreach (_gcr_check_modules_gcr ${_gcr_check_modules_list}) # check whether version is given if (_gcr_check_modules_gcr MATCHES ".*(>=|=|<=).*") string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\1" _gcr_check_modules_gcr_name "${_gcr_check_modules_gcr}") string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\2" _gcr_check_modules_gcr_op "${_gcr_check_modules_gcr}") string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\3" _gcr_check_modules_gcr_ver "${_gcr_check_modules_gcr}") else(_gcr_check_modules_gcr MATCHES ".*(>=|=|<=).*") set(_gcr_check_modules_gcr_name "${_gcr_check_modules_gcr}") set(_gcr_check_modules_gcr_op) set(_gcr_check_modules_gcr_ver) endif(_gcr_check_modules_gcr MATCHES ".*(>=|=|<=).*") set(_gcr_check_prefix "${_prefix}") _gcrconfig_invoke(${_gcr_check_modules_gcr_name} "${_gcr_check_prefix}" VERSION "" --version ) # _gcrconfig_invoke(${_gcr_check_modules_gcr_name} "${_gcr_check_prefix}" PREFIX "" --prefix ) _gcrconfig_invoke(${_gcr_check_modules_gcr_name} "${_gcr_check_prefix}" LIBRARIES "" --libs ) _gcrconfig_invoke(${_gcr_check_modules_gcr_name} "${_gcr_check_prefix}" CFLAGS "" --cflags ) _gcrconfig_invoke(${_gcr_check_modules_gcr_name} "${_gcr_check_prefix}" ALGORITHMS "" --algorithms ) message(STATUS " found ${_gcr_check_modules_gcr}, version ${_gcrconfig_VERSION}") # handle the operands set(_gcr_wrong_version 0) if (_gcr_check_modules_gcr_op STREQUAL ">=") if((_gcr_check_modules_gcr_ver VERSION_EQUAL _gcrconfig_VERSION) OR (_gcrconfig_VERSION VERSION_LESS _gcr_check_modules_gcr_ver )) message(STATUS " gcrypt wrong version: required: ${_gcr_check_modules_gcr_op}${_gcr_check_modules_gcr_ver}, found: ${_gcrconfig_VERSION}") set(_gcr_wrong_version 1) endif() endif(_gcr_check_modules_gcr_op STREQUAL ">=") if (_gcr_check_modules_gcr_op STREQUAL "=") if(_gcr_check_modules_gcr_ver VERSION_EQUAL _gcrconfig_VERSION) message(STATUS " gcrypt wrong version: required: ${_gcr_check_modules_gcr_op}${_gcr_check_modules_gcr_ver}, found: ${_gcrconfig_VERSION}") set(_gcr_wrong_version 1) endif() endif(_gcr_check_modules_gcr_op STREQUAL "=") if (_gcr_check_modules_gcr_op STREQUAL "<=") if((_gcr_check_modules_gcr_ver VERSION_EQUAL _gcrconfig_VERSION) OR (_gcrconfig_VERSION VERSION_GREATER _gcr_check_modules_gcr_ver)) message(STATUS " gcrypt wrong version: required: ${_gcr_check_modules_gcr_op}${_gcr_check_modules_gcr_ver}, found: ${_gcrconfig_VERSION}") set(_gcr_wrong_version 1) endif() endif(_gcr_check_modules_gcr_op STREQUAL "<=") if (${_is_required} AND _gcr_wrong_version) message(FATAL_ERROR "") endif() endforeach(_gcr_check_modules_gcr) _gcrconfig_set(${_prefix}_FOUND 1) else(GCR_CONFIG_EXECUTABLE) if (${_is_required}) message(FATAL_ERROR "libgcrypt-config tool not found") endif (${_is_required}) endif(GCR_CONFIG_EXECUTABLE) endmacro(_gcr_check_modules_internal) ### ### User visible macro starts here ### ### macro(gcrypt_check _prefix _module0) # check cached value if (NOT DEFINED __gcr_config_checked_${_prefix} OR __gcr_config_checked_${_prefix} LESS ${GCR_CONFIG_VERSION} OR NOT ${_prefix}_FOUND) _gcrconfig_parse_options (_gcr_modules _gcr_is_required "${_module0}" ${ARGN}) _gcr_check_modules_internal("${_gcr_is_required}" 0 "${_prefix}" ${_gcr_modules}) _gcrconfig_set(__gcr_config_checked_${_prefix} ${GCR_CONFIG_VERSION}) endif(NOT DEFINED __gcr_config_checked_${_prefix} OR __gcr_config_checked_${_prefix} LESS ${GCR_CONFIG_VERSION} OR NOT ${_prefix}_FOUND) endmacro(gcrypt_check) ### ### Local Variables: ### mode: cmake ### End: fritzbox-1.5.3/libfritz++/XmlFonbook.cpp0000644000175000017500000001356312467660540017472 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2010 Joachim Wilke * * 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 "XmlFonbook.h" #include #include #include #include "Config.h" #include "Tools.h" #include #include #include namespace fritz { XmlFonbook::XmlFonbook(std::string title, std::string techId, bool writeable) : Fonbook{title, techId, writeable} { } XmlFonbook::~XmlFonbook() { } std::string XmlFonbook::extractXmlAttributeValue(std::string element, std::string attribute, std::string xml) { size_t posStart = xml.find('<'+element); if (posStart != std::string::npos) { posStart = xml.find(attribute+"=\"", posStart); if (posStart != std::string::npos) { size_t posEnd = xml.find("\"", posStart + attribute.length() + 2); if (posEnd != std::string::npos) return xml.substr(posStart + attribute.length() + 2, posEnd - posStart - attribute.length() - 2); } } return ""; } std::string XmlFonbook::extractXmlElementValue(std::string element, std::string xml) { size_t posStart = xml.find('<'+element); if (posStart != std::string::npos) { posStart = xml.find(">", posStart); if (xml[posStart-1] == '/') return ""; size_t posEnd = xml.find("'); if (posEnd != std::string::npos) return xml.substr(posStart + 1, posEnd - posStart - 1); } return ""; } void XmlFonbook::parseXmlFonbook(std::string *msg) { DBG("Parsing fonbook using xml parser.") // determine charset size_t pos, posStart, posEnd; posStart = msg->find("encoding=\""); if (posStart != std::string::npos) { posEnd = msg->find("\"", posStart + 10); if (posEnd != std::string::npos) charset = msg->substr(posStart + 10, posEnd - posStart - 10); } DBG("using charset " << charset); std::string msgConv = convert::CharsetConverter::ConvertToLocalEncoding(*msg, charset); pos = msgConv.find(""); while (pos != std::string::npos) { std::string msgPart = msgConv.substr(pos, msgConv.find("", pos) - pos + 10); std::string category = extractXmlElementValue("category", msgPart); std::string name = convert::EntityConverter::DecodeEntities(extractXmlElementValue("realName", msgPart)); FonbookEntry fe(name, category == "1"); size_t posNumber = msgPart.find("", posNumber) - posNumber + 9); std::string number = extractXmlElementValue ("number", msgPartofPart); std::string typeStr = extractXmlAttributeValue("number", "type", msgPartofPart); std::string quickdial = extractXmlAttributeValue("number", "quickdial", msgPartofPart); std::string vanity = extractXmlAttributeValue("number", "vanity", msgPartofPart); std::string prio = extractXmlAttributeValue("number", "prio", msgPartofPart); if (number.size()) { // the xml may contain entries without a number! FonbookEntry::eType type = FonbookEntry::TYPE_NONE; if (typeStr == "home") type = FonbookEntry::TYPE_HOME; if (typeStr == "mobile") type = FonbookEntry::TYPE_MOBILE; if (typeStr == "work") type = FonbookEntry::TYPE_WORK; fe.addNumber(number, type, quickdial, vanity, atoi(prio.c_str())); } posNumber = msgPart.find("", pos+1); } } std::string XmlFonbook::serializeToXml() { std::stringstream result; result << "" "" ""; for (auto fe : getFonbookList()) { result << "" << "" << (fe.isImportant() ? "1" : "0") << "" << "" << "" << fe.getName() << "" << "" << ""; for (size_t numberPos = 0; numberPos < fe.getSize(); numberPos++) if (fe.getNumber(numberPos).length() > 0) { //just iterate over all numbers std::string typeName = ""; switch (fe.getType(numberPos)) { case FonbookEntry::TYPE_NONE: case FonbookEntry::TYPE_HOME: typeName="home"; break; case FonbookEntry::TYPE_MOBILE: typeName="mobile"; break; case FonbookEntry::TYPE_WORK: typeName="work"; break; default: // should not happen break; } result << "" << fe.getNumber(numberPos) << ""; } //TODO: add 1306951031 result << "" << "" << "" << ""; } result << "" ""; convert::CharsetConverter conv("", charset); std::string xmlData = conv.convert(result.str()); // replace '&' with '&' std::string::size_type pos = 0; while ((pos = xmlData.find('&', pos)) != std::string::npos) { xmlData.replace(pos, 1, "&"); pos += 5; } return xmlData; } } fritzbox-1.5.3/libfritz++/Makefile0000644000175000017500000000070112467660540016336 0ustar tobiastobiasAFILE = $(notdir $(subst /.a,.a,$(addsuffix .a,$(CURDIR)))) OBJS = $(patsubst %.cpp,%.o,$(wildcard *.cpp)) .PHONY: all clean all: $(AFILE) %.o: %.cpp $(CXX) $(CXXFLAGS) -o $@ -c $< $(AFILE): $(OBJS) @ar ru $(AFILE) $(OBJS) clean: @-rm -f $(AFILE) $(OBJS) $(DEPFILE) ### # Dependencies: MAKEDEP = $(CXX) -MM -MG DEPFILE = .dependencies $(DEPFILE): Makefile @$(MAKEDEP) $(DEFINES) $(CXXFLAGS) $(OBJS:%.o=%.cpp) > $@ -include $(DEPFILE)fritzbox-1.5.3/libfritz++/LocalFonbook.cpp0000644000175000017500000001216312467660540017757 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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 "LocalFonbook.h" #include #include #include #include #include "Config.h" #include "Tools.h" #include namespace fritz { class ReadLine { private: size_t size; char *buffer; public: ReadLine(void); ~ReadLine(); char *Read(FILE *f); }; ReadLine::ReadLine(void) { size = 0; buffer = nullptr; } ReadLine::~ReadLine() { free(buffer); } char *ReadLine::Read(FILE *f) { int n = getline(&buffer, &size, f); if (n > 0) { n--; if (buffer[n] == '\n') { buffer[n] = 0; if (n > 0) { n--; if (buffer[n] == '\r') buffer[n] = 0; } } return buffer; } return nullptr; } LocalFonbook::LocalFonbook() : XmlFonbook(I18N_NOOP("Local phone book"), "LOCL", true) { filePath = nullptr; } bool LocalFonbook::initialize() { setInitialized(false); clear(); // first, try xml phonebook int ret = asprintf(&filePath, "%s/localphonebook.xml", gConfig->getConfigDir().c_str()); if (ret <= 0) return false; if (access(filePath, F_OK) == 0) { INF("loading " << filePath); std::ifstream file(filePath); if (!file.good()) return false; std::string xmlData((std::istreambuf_iterator(file)),std::istreambuf_iterator()); parseXmlFonbook(&xmlData); setInitialized(true); return true; } else DBG("XML phonebook not found, trying old csv based ones."); // try deprecated filenames free(filePath); filePath = nullptr; char fileNames[3][20] = {"localphonebook.csv", "localfonbook.csv", "localfonbuch.csv"}; for (size_t pos = 0; pos < 3; pos++) { int ret = asprintf(&filePath, "%s/%s", gConfig->getConfigDir().c_str(), fileNames[pos]); if (ret <= 0) return false; if (access(filePath, F_OK) == 0) { if (pos > 0) INF("warning, using deprecated file " << filePath << ", please rename to " << fileNames[0] << "."); break; } free(filePath); filePath = nullptr; } if (filePath) { parseCsvFonbook(filePath); free(filePath); setInitialized(true); // convert to xml when saving int res = asprintf(&filePath, "%s/localphonebook.xml", gConfig->getConfigDir().c_str()); if (res <= 0) return false; return true; } else { // file not available -> log preferred filename and location ERR("file " << gConfig->getConfigDir().c_str() << "/" << fileNames[0] << " not found."); // if no file exists, put the preferred name into filepath (for later usage) // convert to xml when saving int res = asprintf(&filePath, "%s/localphonebook.xml", gConfig->getConfigDir().c_str()); if (res <= 0) return false; setInitialized(true); return false; } return false; } void LocalFonbook::reload() { initialize(); } void LocalFonbook::parseCsvFonbook(std::string filePath) { INF("loading " << filePath); FILE *f = fopen(filePath.c_str(), "r"); if (f) { char *s; ReadLine ReadLine; while ((s = ReadLine.Read(f)) != nullptr) { if (s[0] == '#') continue; char* name_buffer = strtok(s, ",;"); char* type_buffer = strtok(nullptr, ",;"); char* number_buffer = strtok(nullptr, ",;"); if (name_buffer && type_buffer && number_buffer) { std::string name = name_buffer; FonbookEntry::eType type = (FonbookEntry::eType) atoi(type_buffer); std::string number = number_buffer; // search for existing fe bool feExists = false; for (size_t feNr = 0; feNr < getFonbookSize(); feNr++) if (retrieveFonbookEntry(feNr)->getName() == name) { FonbookEntry fe(retrieveFonbookEntry(feNr)); fe.addNumber(number, type); //TODO: quickdial, vanity and priority not supported here changeFonbookEntry(feNr, fe); feExists = true; } // add to new fe if (!feExists) { FonbookEntry fe(name, false); //TODO: important not supported here fe.addNumber(number, type); addFonbookEntry(fe); } } else { ERR("parse error at " << s); } } sort(FonbookEntry::ELEM_NAME, true); fclose(f); } } void LocalFonbook::write() { DBG("Saving to " << filePath << "."); // filePath should always contain a valid content, this is just to be sure if (!filePath) return; // open file std::ofstream file(filePath, std::ios_base::trunc); if (file.fail()) return; // write all entries to the file file << serializeToXml(); // close file file.close(); DBG("Saving successful."); } } fritzbox-1.5.3/libfritz++/Fonbook.cpp0000644000175000017500000001552112467660540017005 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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 "Fonbook.h" #include #include "Config.h" #include "Tools.h" #include #include namespace fritz { FonbookEntry::FonbookEntry(std::string name, bool important) { this->name = name; this->important = important; } void FonbookEntry::addNumber(std::string number, eType type, std::string quickdial, std::string vanity, int priority) { sNumber sn; sn.number = number; sn.type = type; sn.quickdial = quickdial; sn.vanity = vanity; sn.priority = priority; numbers.push_back(sn); } size_t FonbookEntry::getDefault() const { size_t t = 0; while (t < numbers.size()) { if (getPriority(t) == 1) return t; t++; } return 0; } void FonbookEntry::setDefault(size_t pos) { size_t oldPos = getDefault(); if (pos != oldPos) { setPrioriy(0, oldPos); setPrioriy(1, pos); setQuickdial(getQuickdial(oldPos), pos); setVanity(getVanity(oldPos), pos); setQuickdial("", oldPos); setVanity("", oldPos); } } std::string FonbookEntry::getQuickdialFormatted(size_t pos) const { switch (getQuickdial(pos).length()) { case 1: return "**70" + getQuickdial(pos); case 2: return "**7" + getQuickdial(pos); default: return ""; } } std::string FonbookEntry::getQuickdial(size_t pos) const { // if no special type is given, the default "TYPES_COUNT" indicates, // that the correct type has to be determined first, i.e., priority == 1 return numbers[pos == std::string::npos ? getDefault() : pos].quickdial; } void FonbookEntry::setQuickdial(std::string quickdial, size_t pos) { //TODO: sanity check numbers[pos == std::string::npos ? getDefault() : pos].quickdial = quickdial; } std::string FonbookEntry::getVanity(size_t pos) const { return numbers[pos == std::string::npos ? getDefault() : pos].vanity; } std::string FonbookEntry::getVanityFormatted(size_t pos) const { return getVanity(pos).length() ? "**8"+getVanity(pos) : ""; } void FonbookEntry::setVanity(std::string vanity, size_t pos) { //TODO: sanity check numbers[pos == std::string::npos ? getDefault() : pos].vanity = vanity; } bool FonbookEntry::operator<(const FonbookEntry &fe) const { int cresult = this->name.compare(fe.name); if (cresult == 0) return false; return (cresult < 0); } size_t FonbookEntry::getSize() const { size_t size = 0; // ignore TYPE_NONE for (sNumber n : numbers) if (n.number.length()) size++; return size; } class FonbookEntrySort { private: bool ascending; FonbookEntry::eElements element; public: FonbookEntrySort(FonbookEntry::eElements element = FonbookEntry::ELEM_NAME, bool ascending = true) { this->element = element; this->ascending = ascending; } bool operator() (FonbookEntry fe1, FonbookEntry fe2){ switch(element) { case FonbookEntry::ELEM_NAME: return (ascending ? (fe1.getName() < fe2.getName()) : (fe1.getName() > fe2.getName())); break; // case FonbookEntry::ELEM_TYPE: // return (ascending ? (fe1.getType() < fe2.getType()) : (fe1.getType() > fe2.getType())); // break; // case FonbookEntry::ELEM_NUMBER: // return (ascending ? (fe1.getNumber() < fe2.getNumber()) : (fe1.getNumber() > fe2.getNumber())); // break; case FonbookEntry::ELEM_IMPORTANT: return (ascending ? (fe1.isImportant() < fe2.isImportant()) : (fe1.isImportant() > fe2.isImportant())); break; case FonbookEntry::ELEM_QUICKDIAL: { int qd1 = atoi(fe1.getQuickdial().c_str()); int qd2 = atoi(fe2.getQuickdial().c_str()); return (ascending ? (qd1 < qd2) : (qd1 > qd2)); } break; case FonbookEntry::ELEM_VANITY: { int vt1 = atoi(fe1.getVanity().c_str()); int vt2 = atoi(fe2.getVanity().c_str()); return (ascending ? (vt1 < vt2) : (vt1 > vt2)); } // break; // case FonbookEntry::ELEM_PRIORITY: // return (ascending ? (fe1.getPriority() < fe2.getPriority()) : (fe1.getPriority() > fe2.getPriority())); // break; default: ERR("invalid element given for sorting."); return false; } } }; Fonbook::Fonbook(std::string title, std::string techId, bool writeable) : title(title), techId(techId), writeable(writeable) { displayable = true; initialized = false; dirty = false; } void Fonbook::SetDirty() { if (initialized) dirty = true; } Fonbook::sResolveResult Fonbook::resolveToName(std::string number) { sResolveResult result(number); if (number.length() > 0) for (auto fbe : fonbookList) for (auto fonbookNumber : fbe.getNumbers()) { if (fonbookNumber.number.length() > 0 && Tools::CompareNormalized(number, fonbookNumber.number) == 0) { result.name = fbe.getName(); result.type = fonbookNumber.type; result.successful = true; return result; } } return result; } const FonbookEntry *Fonbook::retrieveFonbookEntry(size_t id) const { if (id >= getFonbookSize()) return nullptr; return &fonbookList[id]; } bool Fonbook::changeFonbookEntry(size_t id, FonbookEntry &fe) { if (id < getFonbookSize()) { fonbookList[id] = fe; SetDirty(); return true; } else { return false; } } bool Fonbook::setDefault(size_t id, size_t pos) { if (id < getFonbookSize()) { fonbookList[id].setDefault(pos); SetDirty(); return true; } else { return false; } } void Fonbook::addFonbookEntry(FonbookEntry &fe, size_t position) { if (position == std::string::npos || position > fonbookList.size()) fonbookList.push_back(fe); else fonbookList.insert(fonbookList.begin() + position, fe); SetDirty(); } bool Fonbook::deleteFonbookEntry(size_t id) { if (id < getFonbookSize()) { fonbookList.erase(fonbookList.begin() + id); SetDirty(); return true; } else { return false; } } void Fonbook::save() { if (dirty && writeable) { write(); dirty = false; } } void Fonbook::setInitialized(bool isInitialized) { initialized = isInitialized; if (displayable && isInitialized) INF(title << " initialized (" << getFonbookSize() << " entries)."); } size_t Fonbook::getFonbookSize() const { if (initialized) return fonbookList.size(); else return 0; } void Fonbook::sort(FonbookEntry::eElements element, bool ascending) { FonbookEntrySort fes(element, ascending); std::sort(fonbookList.begin(), fonbookList.end(), fes); } } fritzbox-1.5.3/libfritz++/Config.cpp0000644000175000017500000000610512467660540016613 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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 "Config.h" #include "CallList.h" #include "FonbookManager.h" #include "Listener.h" #include #include "Tools.h" namespace fritz { Config* gConfig = nullptr; void Config::Setup(std::string hostname, std::string username, std::string password, bool logPersonalInfo) { if (gConfig) delete gConfig; gConfig = new Config( hostname, username, password); gConfig->mConfig.logPersonalInfo = logPersonalInfo; } bool Config::Init(bool *locationSettingsDetected, std::string *countryCode, std::string *regionCode){ // preload phone settings from Fritz!Box bool validPassword = Tools::GetLocationSettings(); if (gConfig->getCountryCode().empty() || gConfig->getRegionCode().empty()) { if (locationSettingsDetected) *locationSettingsDetected = false; if (countryCode) gConfig->setCountryCode(*countryCode); if (regionCode) gConfig->setRegionCode(*regionCode); } else { if (locationSettingsDetected) *locationSettingsDetected = true; if (countryCode) *countryCode = gConfig->getCountryCode(); if (regionCode) *regionCode = gConfig->getRegionCode(); } // fetch SIP provider names Tools::GetSipSettings(); return validPassword; } bool Config::Shutdown() { fritz::Listener::DeleteListener(); fritz::FonbookManager::DeleteFonbookManager(); fritz::CallList::DeleteCallList(); if (gConfig) { delete gConfig; gConfig = nullptr; } INF("Shutdown of libfritz++ completed."); return true; } void Config::SetupPorts ( int listener, int ui, int upnp ) { if (gConfig) { gConfig->mConfig.listenerPort = listener; gConfig->mConfig.uiPort = ui; gConfig->mConfig.upnpPort = upnp; } } void Config::SetupMsnFilter( std::vector vMsn) { if (gConfig) gConfig->mConfig.msn = vMsn; } void Config::SetupConfigDir(std::string dir) { if (gConfig) gConfig->mConfig.configDir = dir; } Config::Config( std::string url, std::string username, std::string password) { mConfig.url = url; mConfig.username = username; mConfig.password = password; mConfig.uiPort = 80; mConfig.listenerPort = 1012; mConfig.upnpPort = 49000; mConfig.loginType = UNKNOWN; mConfig.lastRequestTime = 0; mConfig.logPersonalInfo = false; fritzClientFactory = new FritzClientFactory(); } Config::~Config() { } } fritzbox-1.5.3/libfritz++/CallList.cpp0000644000175000017500000002072612467660540017122 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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 "CallList.h" #include #include #include #include "Tools.h" #include "Config.h" #include #include "FritzClient.h" namespace fritz{ class CallEntrySort { private: bool ascending; CallEntry::eElements element; public: CallEntrySort(CallEntry::eElements element = CallEntry::ELEM_DATE, bool ascending = true) { this->element = element; this->ascending = ascending; } bool operator() (CallEntry ce1, CallEntry ce2){ switch(element) { case CallEntry::ELEM_DATE: return (ascending ? (ce1.timestamp < ce2.timestamp) : (ce1.timestamp > ce2.timestamp)); break; case CallEntry::ELEM_DURATION: if (ce1.duration.size() < ce2.duration.size()) return (ascending ? true : false); if (ce1.duration.size() > ce2.duration.size()) return (ascending ? false : true); return (ascending ? (ce1.duration < ce2.duration) : (ce1.duration > ce2.duration)); break; case CallEntry::ELEM_LOCALNAME: return (ascending ? (ce1.localName < ce2.localName) : (ce1.localName > ce2.localName)); break; case CallEntry::ELEM_LOCALNUMBER: return (ascending ? (ce1.localNumber < ce2.localNumber) : (ce1.localNumber > ce2.localNumber)); break; case CallEntry::ELEM_REMOTENAME: if (ce1.remoteName == "unknown" && ce2.remoteName == "unknown") return false; if (ce1.remoteName == "unknown") return (ascending ? true : false); if (ce2.remoteName == "unknown") return (ascending ? false : true); return (ascending ? (ce1.remoteName < ce2.remoteName) : (ce1.remoteName > ce2.remoteName)); break; case CallEntry::ELEM_REMOTENUMBER: return (ascending ? (ce1.remoteNumber < ce2.remoteNumber) : (ce1.remoteNumber > ce2.remoteNumber)); break; case CallEntry::ELEM_TYPE: return (ascending ? (ce1.type < ce2.type) : (ce1.type > ce2.type)); break; default: ERR("invalid element given for sorting."); return false; } } }; CallList *CallList::me = nullptr; CallList::CallList() : thread{nullptr}, lastCall{0}, lastMissedCall{0}, valid{false} { reload(); } CallList *CallList::GetCallList(bool create){ if(!me && create){ me = new CallList(); } return me; } void CallList::CreateCallList() { DeleteCallList(); me = new CallList(); } void CallList::DeleteCallList() { if (me) { DBG("deleting call list"); delete me; me = nullptr; } } CallList::~CallList() { thread->join(); //TODO cancellation? delete thread; DBG("deleted call list"); } void CallList::run() { DBG("CallList thread started"); FritzClient *fc = gConfig->fritzClientFactory->create(); std::string msg = fc->requestCallList(); delete fc; std::vector callList; // parse answer size_t pos = 2; // parse body int count = 0; while ((pos = msg.find("\n", pos)) != std::string::npos /*&& msg[pos+1] != '\n'*/) { pos++; int type = pos; if (msg[type] < '0' || msg[type] > '9') { // ignore lines not starting with a number (headers, comments, etc.) { DBG("parser skipped line in calllist"); continue; } int dateStart = msg.find(';', type) +1; int timeStart = msg.find(' ', dateStart) +1; int nameStart = msg.find(';', timeStart) +1; int numberStart = msg.find(';', nameStart) +1; int lNameStart = msg.find(';', numberStart) +1; int lNumberStart = msg.find(';', lNameStart) +1; int durationStart = msg.find(';', lNumberStart) +1; int durationStop = msg.find("\n", durationStart)-1; if (msg[durationStop] == '\r') // fix for new Fritz!Box Firmwares that use "\r\n" on linebreak durationStop--; CallEntry ce; // FB developers introduce new numbering in call type column: '4' is the new '3' type = atoi(&msg[type]); ce.type = (CallEntry::eCallType) (type == 4 ? 3: type); ce.date = msg.substr(dateStart, timeStart - dateStart -1); ce.time = msg.substr(timeStart, nameStart - timeStart -1); ce.remoteName = msg.substr(nameStart, numberStart - nameStart -1); ce.remoteNumber = msg.substr(numberStart, lNameStart - numberStart -1); ce.localName = msg.substr(lNameStart, lNumberStart - lNameStart -1); ce.localNumber = msg.substr(lNumberStart, durationStart - lNumberStart -1); ce.duration = msg.substr(durationStart, durationStop - durationStart +1); // put the number into the name field if name is not available if (ce.remoteName.size() == 0) ce.remoteName = ce.remoteNumber; // 01234567 01234 // date: dd.mm.yy, time: hh:mm tm tmCallTime; tmCallTime.tm_mday = atoi(ce.date.substr(0, 2).c_str()); tmCallTime.tm_mon = atoi(ce.date.substr(3, 2).c_str()) - 1; tmCallTime.tm_year = atoi(ce.date.substr(6, 2).c_str()) + 100; tmCallTime.tm_hour = atoi(ce.time.substr(0, 2).c_str()); tmCallTime.tm_min = atoi(ce.time.substr(3, 2).c_str()); tmCallTime.tm_sec = 0; tmCallTime.tm_isdst = 0; ce.timestamp = mktime(&tmCallTime); // workaround for AVM debugging entries in CVS list if (ce.remoteNumber.compare("1234567") == 0 && ce.date.compare("12.03.2005") == 0) continue; callList.push_back(ce); count++; } INF("CallList -> read " << count << " entries."); valid = false; callListAll = callList; callListIn.clear(); callListOut.clear(); callListMissed.clear(); lastCall = 0; lastMissedCall = 0; for(auto ce : callListAll) { if (lastCall < ce.timestamp) lastCall = ce.timestamp; switch (ce.type) { case CallEntry::INCOMING: callListIn.push_back(ce); break; case CallEntry::OUTGOING: callListOut.push_back(ce); break; case CallEntry::MISSED: if (lastMissedCall < ce.timestamp) lastMissedCall = ce.timestamp; callListMissed.push_back(ce); break; default: DBG("parser skipped unknown call type"); continue; } } valid = true; DBG("CallList thread ended"); } void CallList::reload() { if (thread) { thread->join(); delete thread; } // runs operator() in threaded context thread = new std::thread(&CallList::run, this); } CallEntry *CallList::retrieveEntry(CallEntry::eCallType type, size_t id) { switch (type) { case CallEntry::ALL: return &callListAll[id]; case CallEntry::INCOMING: return &callListIn[id]; case CallEntry::OUTGOING: return &callListOut[id]; case CallEntry::MISSED: return &callListMissed[id]; default: return nullptr; } } size_t CallList::getSize(CallEntry::eCallType type) { switch (type) { case CallEntry::ALL: return callListAll.size(); case CallEntry::INCOMING: return callListIn.size(); case CallEntry::OUTGOING: return callListOut.size(); case CallEntry::MISSED: return callListMissed.size(); default: return 0; } } size_t CallList::missedCalls(time_t since) { size_t missedCalls = 0; for (auto ce : callListMissed) { // track number of new missed calls if (ce.timestamp > since) { if (ce.matchesFilter()) missedCalls++; } else { break; // no older calls will match the missed-calls condition } } return missedCalls; } void CallList::sort(CallEntry::eElements element, bool ascending) { CallEntrySort ces(element, ascending); std::sort(begin(callListAll), end(callListAll), ces); //TODO: other lists? } bool CallEntry::matchesFilter() { // entries are filtered according to the MSN filter) if ( Tools::MatchesMsnFilter(localNumber)) return true; else{ // if local number does not contain any of the MSNs in MSN filter, we test // if it does contain any number (if POTS is used fritzbox reports "Festnetz" // instead of the local number) for (auto ch : localNumber) { if (ch >= '0' && ch <= '9') return false; } return true; } } bool CallEntry::matchesRemoteNumber(std::string number) { return (Tools::NormalizeNumber(number).compare(Tools::NormalizeNumber(remoteNumber)) == 0); } } fritzbox-1.5.3/libfritz++/Tools.h0000644000175000017500000000253512467660540016156 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2010 Joachim Wilke * * 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. * */ #ifndef FRITZTOOLS_H #define FRITZTOOLS_H #include #include #define I18N_NOOP(x) x namespace fritz{ class Tools { public: Tools(); virtual ~Tools(); static bool MatchesMsnFilter(const std::string &number); static std::string NormalizeNumber(std::string number); static int CompareNormalized(std::string number1, std::string number2); static bool GetLocationSettings(); static void GetSipSettings(); static std::string Tokenize(const std::string &buffer, const char delimiter, size_t pos); }; } #endif /*FRITZTOOLS_H_*/ fritzbox-1.5.3/libfritz++/OertlichesFonbook.cpp0000644000175000017500000000502512467660540021025 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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 "OertlichesFonbook.h" #include #include "Config.h" #include #include "Tools.h" #include namespace fritz{ OertlichesFonbook::OertlichesFonbook() :LookupFonbook(I18N_NOOP("das-oertliche.de"), "OERT") {} Fonbook::sResolveResult OertlichesFonbook::lookup(std::string number) const { Fonbook::sResolveResult result(number); // resolve only (german) phone numbers if (number.length() == 0 || Tools::NormalizeNumber(number).find("0049") != 0) return result; std::string msg; std::string name; try { DBG("sending reverse lookup request for " << (gConfig->logPersonalInfo()? Tools::NormalizeNumber(number) : HIDDEN) << " to www.dasoertliche.de"); network::HttpClient::param_t params = { { "form_name", "search_inv"}, { "ph", Tools::NormalizeNumber(number)}, }; network::HttpClient tc("www.dasoertliche.de"); msg = tc.get("/Controller", params); } catch (std::runtime_error &re) { ERR("Exception - " << re.what()); return result; } // check that at most one result is returned size_t second_result = msg.find("id=\"entry_1\""); if (second_result != std::string::npos) { INF("multiple entries found, not returning any."); return result; } // parse answer size_t start = msg.find("getItemData("); if (start == std::string::npos) { INF("no entry found."); return result; } // add the length of the last search pattern start += 12; size_t stop = msg.find(");", start); std::string dataset = msg.substr(start, stop - start); name = Tools::Tokenize(dataset, ',', 5); name = name.substr(2, name.length()-3); INF("resolves to " << (gConfig->logPersonalInfo() ? name.c_str() : HIDDEN)); result.name = name; result.successful = true; return result; } } fritzbox-1.5.3/libfritz++/Fonbooks.cpp0000644000175000017500000000223212467660540017163 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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 "Fonbooks.h" namespace fritz{ Fonbooks::Fonbooks() { } Fonbooks::~Fonbooks() { } Fonbook *Fonbooks::operator[](std::string key) const { for (auto fonbook : *this) { if (fonbook->getTechId() == key) return fonbook; } return nullptr; } Fonbook *Fonbooks::operator[](size_t i) const { return (*((std::vector*) this))[i]; } } fritzbox-1.5.3/libfritz++/FritzClient.h0000644000175000017500000000354212467660540017312 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef FRITZCLIENT_H #define FRITZCLIENT_H #include #include #include #include namespace fritz { class FritzClient { private: static std::mutex *mutex; std::string calculateLoginResponse(std::string challenge); std::string urlEncode(const std::string &s); bool login(); std::string getLang(); bool validPassword; network::HttpClient httpClient; network::SoapClient *soapClient; public: FritzClient (); virtual ~FritzClient(); virtual bool initCall(std::string &number); virtual std::string requestLocationSettings(); virtual std::string requestSipSettings(); virtual std::string requestCallList(); virtual std::string requestFonbook(); virtual void writeFonbook(std::string xmlData); virtual bool hasValidPassword() { return validPassword; } virtual bool reconnectISP(); virtual std::string getCurrentIP(); }; class FritzClientFactory { public: virtual ~FritzClientFactory() {} virtual FritzClient *create() { return new FritzClient; } }; } #endif /* FRITZCLIENT_H_ */ fritzbox-1.5.3/libfritz++/LocalFonbook.h0000644000175000017500000000224512467660540017424 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef LOCALFONBOOK_H #define LOCALFONBOOK_H #include "XmlFonbook.h" namespace fritz { class LocalFonbook : public XmlFonbook { friend class FonbookManager; private: char* filePath; LocalFonbook(); void parseCsvFonbook(std::string filePath); void write() override; public: bool initialize() override; void reload() override; }; } #endif /*LOCALFONBOOK_H_*/ fritzbox-1.5.3/libfritz++/Fonbook.h0000644000175000017500000002234712467660540016456 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef FONBOOK_H #define FONBOOK_H #include #include namespace fritz { /** * General telephonebook entry. * This defines the class, to be used by every phone book implementation. */ class FonbookEntry { public: enum eType { TYPE_NONE, TYPE_HOME, TYPE_MOBILE, TYPE_WORK, TYPES_COUNT }; enum eElements { ELEM_NAME = 0, ELEM_TYPE = 1, ELEM_NUMBER = 2, ELEM_IMPORTANT, ELEM_QUICKDIAL, ELEM_VANITY, ELEM_PRIORITY, ELEMS_COUNT }; struct sNumber { std::string number; eType type; std::string quickdial; std::string vanity; int priority; }; private: std::string name; bool important; std::vector numbers; public: /* * Constructs a new FonbookEntry object * @param name Full name of contact * @param important Whether contact is flagged as important */ explicit FonbookEntry(std::string name, bool important = false); /* * Copy constructor * @param the fonbook entry to be copied */ FonbookEntry(const FonbookEntry *fe) { *this = *fe; } /** * Adds new number to this contact * @param number The number to be added * @param type The number type * @param quickdial The quickdial extension * @param vanity The vanity extension * @param prority '1' marks the default number of this contact, otherwise 0 */ void addNumber(std::string number, eType type = TYPE_NONE, std::string quickdial = "", std::string vanity = "", int priority = 0); std::string getName() const { return name; } void setName(std::string name) { this->name = name; } #define CHECK(x) if (numbers.size() <= pos) return x; std::string getNumber(size_t pos) const { CHECK(""); return numbers[pos].number; } const std::vector &getNumbers() const { return numbers; } void setNumber(std::string number,size_t pos) { CHECK(); numbers[pos].number = number; } eType getType(size_t pos) const { CHECK(FonbookEntry::TYPE_NONE); return numbers[pos].type; } void setType(eType type, size_t pos) { numbers[pos].type = type; } bool isImportant() const { return important; } void setImportant(bool important) { this->important = important; } size_t getDefault() const; void setDefault(size_t pos); std::string getQuickdialFormatted( size_t pos = std::string::npos) const; std::string getQuickdial(size_t pos = std::string::npos) const; void setQuickdial(std::string quickdial, size_t pos = std::string::npos); std::string getVanity(size_t pos = std::string::npos) const; std::string getVanityFormatted(size_t pos = std::string::npos) const; void setVanity(std::string vanity, size_t pos = std::string::npos); int getPriority(size_t pos) const { CHECK(0); return numbers[pos].priority; } void setPrioriy(int priority, size_t pos) { numbers[pos].priority = priority; } bool operator<(const FonbookEntry & fe) const; /* * Get number of typed numbers (TYPE_NONE is ignored) * @return count of different numbers available */ size_t getSize() const; }; inline FonbookEntry::eType& operator++(FonbookEntry::eType& t) { return t = static_cast(static_cast(t) + 1); } inline FonbookEntry::eType operator++(FonbookEntry::eType& t, int) { FonbookEntry::eType tmp(t); ++t; return tmp; } /** * General telephonebook base class. * All specific telephonebooks have to inherit from this class. */ class Fonbook { private: /** * True, if this phonebook is ready to use. */ bool initialized; /** * True, if changes are pending that are not yet saved */ bool dirty; /** * Sets dirty member if applicable */ void SetDirty(); /** * The descriptive title of this phonebook. */ std::string title; /** * The technical id of this phonebook (should be a short letter code). */ std::string techId; /** * True, if this phonebook is writeable */ bool writeable; /** * Data structure for storing the phonebook. */ std::vector fonbookList; protected: /** * The constructor may only be used by cFonbookManager. * Subclasses must make their constructor private, too. */ Fonbook(std::string title, std::string techId, bool writeable = false); /** * Method to persist contents of the phone book (if writeable) */ virtual void write() { } /** * True, if this phonebook has displayable entries. */ bool displayable; /** * */ const std::vector &getFonbookList() const { return fonbookList; } public: struct sResolveResult { sResolveResult(std::string name, FonbookEntry::eType type = FonbookEntry::TYPE_NONE, bool successful = false) : name(name), type(type), successful(successful) {} std::string name; FonbookEntry::eType type; bool successful; }; virtual ~Fonbook() { } /** * Take action to fill phonebook with content. * Initialize() may be called more than once per session. * @return if initialization was successful */ virtual bool initialize(void) { return true; } /** * Resolves the number given to the corresponding name. * @param number to resolve * @return resolved name and type or the number, if unsuccessful */ virtual sResolveResult resolveToName(std::string number); /** * Returns a specific telephonebook entry. * @param id unique identifier of the requested entry * @return the entry with key id or nullptr, if unsuccessful */ virtual const FonbookEntry *retrieveFonbookEntry(size_t id) const; /** * Changes the Fonbook entry with the given id * @param id unique identifier to the entry to be changed * @param fe FonbookEntry with the new content * @return true, if successful */ virtual bool changeFonbookEntry(size_t id, FonbookEntry &fe); /** * Sets the default number for a Fonbook entry with the given id * @param id unique identifier to the entry to be changed * @param pos the new default number * @return true, if successful */ virtual bool setDefault(size_t id, size_t pos); /** * Adds a new entry to the phonebook. * @param fe a new phonebook entry * @param position position at which fe is added (at the end of the list per default) */ virtual void addFonbookEntry(FonbookEntry &fe, size_t position = std::string::npos); /** * Adds a new entry to the phonebook. * @param id unique id to the entry to be deleted * @return true, if deletion was successful */ virtual bool deleteFonbookEntry(size_t id); /** * Clears all entries from phonebook. */ virtual void clear() { SetDirty(); fonbookList.clear(); } /** * Save pending changes. * Can be called periodically to assert pending changes in a phone book are written. */ virtual void save(); /** * Returns if it is possible to display the entries of this phonebook. * @return true, if this phonebook has displayable entries. "Reverse lookup only" phonebooks must return false here. */ virtual bool isDisplayable() const { return displayable; } /** * Returns if this phonebook is ready to use. * @return true, if this phonebook is ready to use */ virtual bool isInitialized() const { return initialized; } /** * Returns if this phonebook is writeable, e.g. entries can be added or modified. * @return true, if this phonebook is writeable */ virtual bool isWriteable() const { return writeable; } /** * Returns if this phonebook has changes that are not yet written. * @return true, if changes are pending */ virtual bool isModified() const { return dirty; } /** * Sets the initialized-status. * @param isInititalized the value initialized is set to */ virtual void setInitialized(bool isInitialized); /** * Sets writeable to true */ virtual void setWriteable() { writeable = true; } /** * Returns the number of entries in the telephonebook. * @return the number of entries */ virtual size_t getFonbookSize() const; /** * Reloads the telephonebook's content */ virtual void reload() { } /** * Returns a string that should be displayed as title in the menu when the telephonebook is displayed. * @return the long title of this phonebook */ virtual std::string getTitle() const { return title; } /** * Returns the technical id of this phonebook. This id has to be unique among all phonebooks and is used when storing * the plugin's setup. * @return the technical id */ virtual std::string getTechId() const { return techId; } /** * Sorts the phonebook's entries by the given element and in given order. * @param the element used for sorting * @param true if sort order is ascending, false otherwise */ virtual void sort(FonbookEntry::eElements element = FonbookEntry::ELEM_NAME, bool ascending = true); }; } #endif /*FONBOOK_H_*/ fritzbox-1.5.3/libfritz++/FonbookManager.cpp0000644000175000017500000001644012467660540020301 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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 "FonbookManager.h" #include #include "Config.h" #include "FritzFonbook.h" #include "LocalFonbook.h" #include "Nummerzoeker.h" #include "OertlichesFonbook.h" #include "TelLocalChFonbook.h" #include namespace fritz{ FonbookManager* FonbookManager::me = nullptr; FonbookManager::FonbookManager(bool saveOnShutdown) :Fonbook("Manager", "MNGR") { this->saveOnShutdown = saveOnShutdown; // create all fonbooks fonbooks.push_back(new FritzFonbook()); fonbooks.push_back(new OertlichesFonbook()); fonbooks.push_back(new TelLocalChFonbook()); fonbooks.push_back(new NummerzoekerFonbook()); fonbooks.push_back(new LocalFonbook()); // initialize the fonbooks that are used for (int i=gConfig->getFonbookIDs().size()-1; i>=0; i--) { Fonbook *fb = fonbooks[gConfig->getFonbookIDs()[i]]; if (fb) fb->initialize(); else gConfig->getFonbookIDs().erase(gConfig->getFonbookIDs().begin()+i); } // track the currently active (=shown) fonbook activeFonbookPos = std::string::npos; // set activeFonbookPos to the last displayed fonbook (if this is still valid and displayable) size_t pos = 0; while (pos < gConfig->getFonbookIDs().size() && gConfig->getFonbookIDs()[pos] != gConfig->getActiveFonbook() ) pos++; if (pos < gConfig->getFonbookIDs().size()) { if (fonbooks[gConfig->getFonbookIDs()[pos]]->isDisplayable()) activeFonbookPos = pos; } // if no valid phone book is selected, advance to the next valid one if (!getActiveFonbook()) nextFonbook(); } FonbookManager::~FonbookManager() { for (auto fonbook : fonbooks) { DBG("deleting fonbook with ID: " << fonbook->getTechId()); // save pending changes if (saveOnShutdown) fonbook->save(); delete(fonbook); } } void FonbookManager::CreateFonbookManager(std::vector vFonbookID, std::string activeFonbook, bool saveOnShutdown) { if (gConfig) { // if there is already a FonbookManager, delete it, so it can adapt to configuration changes DeleteFonbookManager(); // save new list of fonbook ids gConfig->setFonbookIDs(vFonbookID); // check if activeFonbook is valid if (activeFonbook.size() > 0) { bool activeFonbookValid = false; for (auto id : vFonbookID) if (id.compare(activeFonbook) == 0) { activeFonbookValid = true; break; } if (activeFonbookValid) gConfig->setActiveFonbook(activeFonbook); else ERR("Invalid call parameter. ActiveFonbook '" << activeFonbook << "' is not enabled or unknown"); } // create fonbookmanger (was deleted above) so that it can initialize all fonbooks me = new FonbookManager(saveOnShutdown); } else { ERR("Wrong call sequence. Configuration does not exist when trying to create FonbookManager." ); } } Fonbook* FonbookManager::GetFonbook() { return (Fonbook*) me; } FonbookManager* FonbookManager::GetFonbookManager() { return me; } void FonbookManager::DeleteFonbookManager() { if (me) { DBG("deleting Fonbook Manager"); delete me; me = nullptr; } } void FonbookManager::nextFonbook() { size_t pos = activeFonbookPos + 1; // no phonebooks -> no switching if ( gConfig->getFonbookIDs().size() == 0) return; while (pos < gConfig->getFonbookIDs().size() && fonbooks[gConfig->getFonbookIDs()[pos]]->isDisplayable() == false) pos++; // if no displayable fonbook found -> start from beginning if (pos == gConfig->getFonbookIDs().size()) { pos = 0; while (pos < gConfig->getFonbookIDs().size() && fonbooks[gConfig->getFonbookIDs()[pos]]->isDisplayable() == false) pos++; // if this fails, too, just return npos if (pos == gConfig->getFonbookIDs().size()) { pos = std::string::npos; } } activeFonbookPos = pos; if (activeFonbookPos != std::string::npos) { // save the tech-id of the active fonbook in setup gConfig->setActiveFonbook( gConfig->getFonbookIDs()[pos] ); } } Fonbook::sResolveResult FonbookManager::resolveToName(std::string number) { sResolveResult result(number); for (auto id : gConfig->getFonbookIDs()) { result = fonbooks[id]->resolveToName(number); DBG("ResolveToName: " << id << " " << (gConfig->logPersonalInfo() ? result.name : HIDDEN)); if (result.successful) return result; } return result; } Fonbook *FonbookManager::getActiveFonbook() const { if (activeFonbookPos == std::string::npos) { return nullptr; } return fonbooks[gConfig->getFonbookIDs()[activeFonbookPos]]; } const FonbookEntry *FonbookManager::retrieveFonbookEntry(size_t id) const { return getActiveFonbook() ? getActiveFonbook()->retrieveFonbookEntry(id) : nullptr; } bool FonbookManager::changeFonbookEntry(size_t id, FonbookEntry &fe) { return getActiveFonbook() ? getActiveFonbook()->changeFonbookEntry(id, fe) : false; } bool FonbookManager::setDefault(size_t id, size_t pos) { return getActiveFonbook() ? getActiveFonbook()->setDefault(id, pos) : false; } void FonbookManager::addFonbookEntry(FonbookEntry &fe, size_t position) { if (getActiveFonbook()) getActiveFonbook()->addFonbookEntry(fe, position); } bool FonbookManager::deleteFonbookEntry(size_t id) { return getActiveFonbook() ? getActiveFonbook()->deleteFonbookEntry(id) : false; } void FonbookManager::clear() { if (getActiveFonbook()) getActiveFonbook()->clear(); } void FonbookManager::save() { if (getActiveFonbook()) getActiveFonbook()->save(); } bool FonbookManager::isDisplayable() const { return getActiveFonbook() ? getActiveFonbook()->isDisplayable() : false; } bool FonbookManager::isInitialized() const { return getActiveFonbook() ? getActiveFonbook()->isInitialized() : false; } bool FonbookManager::isWriteable() const { return getActiveFonbook() ? getActiveFonbook()->isWriteable() : false; } bool FonbookManager::isModified() const { return getActiveFonbook() ? getActiveFonbook()->isModified() : false; } void FonbookManager::setInitialized(bool isInitialized) { if (getActiveFonbook()) getActiveFonbook()->setInitialized(isInitialized); } void FonbookManager::sort(FonbookEntry::eElements element, bool ascending){ if (getActiveFonbook()) getActiveFonbook()->sort(element, ascending); } size_t FonbookManager::getFonbookSize() const { return getActiveFonbook() ? getActiveFonbook()->getFonbookSize() : 0; } std::string FonbookManager::getTitle() const { return getActiveFonbook() ? getActiveFonbook()->getTitle() : ""; } std::string FonbookManager::getTechId() const { return getActiveFonbook() ? getActiveFonbook()->getTechId() : ""; } void FonbookManager::reload() { for (auto id : gConfig->getFonbookIDs()) { fonbooks[id]->reload(); } } Fonbooks *FonbookManager::getFonbooks() { return &fonbooks; } } fritzbox-1.5.3/libfritz++/Doxyfile0000644000175000017500000021514712467660540016420 0ustar tobiastobias# Doxyfile 1.7.4 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" "). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = libfritz++ # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer # a quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify an logo or icon that is # included in the documentation. The maximum height of the logo should not # exceed 55 pixels and the maximum width should not exceed 200 pixels. # Doxygen will copy the logo to the output directory. PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = doc # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful if your file system # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this # tag. The format is ext=language, where ext is a file extension, and language # is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, # C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make # doxygen treat .inc files as Fortran files (default is PHP), and .f files as C # (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions # you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. EXTENSION_MAPPING = # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also makes the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = YES # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and # unions are shown inside the group in which they are included (e.g. using # @ingroup) instead of on a separate page (for HTML and Man pages) or # section (for LaTeX and RTF). INLINE_GROUPED_CLASSES = NO # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penalty. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will roughly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols SYMBOL_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespaces are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen # will list include files with double quotes in the documentation # rather than with sharp brackets. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen # will sort the (brief and detailed) documentation of class members so that # constructors and destructors are listed first. If set to NO (the default) # the constructors will appear in the respective orders defined by # SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. # This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO # and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to # do proper type resolution of all parameters of a function it will reject a # match between the prototype and the implementation of a member function even # if there is only one candidate or it is obvious which candidate to choose # by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen # will still accept a match between prototype and implementation in such cases. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or macro consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and macros in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. The create the layout file # that represents doxygen's defaults, run doxygen with the -l option. # You can optionally specify a file name after the option, if omitted # DoxygenLayout.xml will be used as the name of the layout file. LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # The WARN_NO_PARAMDOC option can be enabled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh # *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py # *.f90 *.f *.for *.vhd *.vhdl FILE_PATTERNS = # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty or if # non of the patterns match the file name, INPUT_FILTER is applied. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) # and it is also possible to disable source filtering for a specific pattern # using *.ext= (so without naming a filter). This option only has effect when # FILTER_SOURCE_FILES is enabled. FILTER_SOURCE_PATTERNS = #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. Note that when using a custom header you are responsible # for the proper inclusion of any scripts and style sheets that doxygen # needs, which is dependent on the configuration options used. # It is adviced to generate a default header using "doxygen -w html # header.html footer.html stylesheet.css YourConfigFile" and then modify # that header. Note that the header is subject to change so you typically # have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW! HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that # the files will be copied as-is; there are no commands or markers available. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. # Doxygen will adjust the colors in the stylesheet and background images # according to this color. Hue is specified as an angle on a colorwheel, # see http://en.wikipedia.org/wiki/Hue for more information. # For instance the value 0 represents red, 60 is yellow, 120 is green, # 180 is cyan, 240 is blue, 300 purple, and 360 is red again. # The allowed range is 0 to 359. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of # the colors in the HTML output. For a value of 0 the output will use # grayscales only. A value of 255 will produce the most vivid colors. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to # the luminance component of the colors in the HTML output. Values below # 100 gradually make the output lighter, whereas values above 100 make # the output darker. The value divided by 100 is the actual gamma applied, # so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, # and 100 does not change the gamma. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting # this to NO can help when comparing the output of multiple runs. HTML_TIMESTAMP = YES # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated # that can be used as input for Qt's qhelpgenerator to generate a # Qt Compressed Help (.qch) of the generated HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to # add. For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see # # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's # filter section matches. # # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files # will be generated, which together with the HTML files, form an Eclipse help # plugin. To install this plugin and make it available under the help contents # menu in Eclipse, the contents of the directory containing the HTML and XML # files needs to be copied into the plugins directory of eclipse. The name of # the directory within the plugins directory should be the same as # the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before # the help appears. GENERATE_ECLIPSEHELP = NO # A unique identifier for the eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have # this name. ECLIPSE_DOC_ID = org.doxygen.Project # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values # (range [0,1..20]) that doxygen will group on one line in the generated HTML # documentation. Note that a value of 0 will completely suppress the enum # values from appearing in the overview section. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to YES, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, # and Class Hierarchy pages using a tree view instead of an ordered list. USE_INLINE_TREES = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open # links to external symbols imported via tag files in a separate window. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are # not supported properly for IE 6.0, but are supported on all modern browsers. # Note that when changing this option you need to delete any form_*.png files # in the HTML output before the changes have effect. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax # (see http://www.mathjax.org) which uses client side Javascript for the # rendering instead of using prerendered bitmaps. Use this if you do not # have LaTeX installed or if you want to formulas look prettier in the HTML # output. When enabled you also need to install MathJax separately and # configure the path to it using the MATHJAX_RELPATH option. USE_MATHJAX = NO # When MathJax is enabled you need to specify the location relative to the # HTML output directory using the MATHJAX_RELPATH option. The destination # directory should contain the MathJax.js script. For instance, if the mathjax # directory is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the # mathjax.org site, so you can quickly see the result without installing # MathJax, but it is strongly recommended to install a local copy of MathJax # before deployment. MATHJAX_RELPATH = http://www.mathjax.org/mathjax # When the SEARCHENGINE tag is enabled doxygen will generate a search box # for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using # HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets # (GENERATE_DOCSET) there is already a search function so this one should # typically be disabled. For large projects the javascript based search engine # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be # implemented using a PHP enabled web server instead of at the web client # using Javascript. Doxygen will generate the search PHP script and index # file to put on the web server. The advantage of the server # based approach is that it scales better to large projects and allows # full text search. The disadvantages are that it is more difficult to setup # and does not have live searching capabilities. SERVER_BASED_SEARCH = NO #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. # Note that when enabling USE_PDFLATEX this option is only used for # generating bitmaps for formulas in the HTML output, but not in the # Makefile that is written to the output directory. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4 # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for # the generated latex document. The footer should contain everything after # the last chapter. If it is left blank doxygen will generate a # standard footer. Notice: only use this tag if you know what you are doing! LATEX_FOOTER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include # source code with syntax highlighting in the LaTeX output. # Note that which sources are shown also depends on other settings # such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # pointed to by INCLUDE_PATH will be searched when a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition that # overrules the definition found in the source code. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all references to function-like macros # that are alone on a line, have an all uppercase name, and do not end with a # semicolon, because these will confuse the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option also works with HAVE_DOT disabled, but it is recommended to # install and use dot, since it yields more powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = YES # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is # allowed to run in parallel. When set to 0 (the default) doxygen will # base this on the number of processors available in the system. You can set it # explicitly to a value larger than 0 to get control over the balance # between CPU load and processing speed. DOT_NUM_THREADS = 0 # By default doxygen will write a font called Helvetica to the output # directory and reference it in all dot files that doxygen generates. # When you want a differently looking font you can specify the font name # using DOT_FONTNAME. You need to make sure dot is able to find the font, # which can be done by putting it in a standard location or by setting the # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = Helvetica # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will generate a graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are svg, png, jpg, or gif. # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the # \mscfile command). MSCFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = YES # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES fritzbox-1.5.3/libfritz++/AUTHORS0000644000175000017500000000014412467660540015747 0ustar tobiastobiasDevelopers: * Joachim Wilke * Matthias Becker fritzbox-1.5.3/libfritz++/Tools.cpp0000644000175000017500000002353112467660540016510 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2010 Joachim Wilke * * 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 "Tools.h" #include #include #include #include #include #include #include #include "Config.h" #include "FritzClient.h" #include namespace fritz{ Tools::Tools() { } Tools::~Tools() { } bool Tools::MatchesMsnFilter(const std::string &number){ // if no MSN filter is set, true is returned if (gConfig->getMsnFilter().size() == 0) return true; // if number does contain a MSN out of the MSN filter, true is returned for (size_t pos=0; pos < gConfig->getMsnFilter().size(); pos++) { std::string msn = gConfig->getMsnFilter()[pos]; size_t index = number.find(msn); if ( index != std::string::npos && index + msn.length() == number.length()) { //matched return true; } } // no match return false; } std::string Tools::NormalizeNumber(std::string number) { // Remove Fritz!Box control codes *xyz# if used if (number[0] == '*') { size_t hashPos = number.find('#'); if (hashPos != std::string::npos) number.erase(0, hashPos + 1); } // Only for Germany: Remove Call-By-Call Provider Selection Codes 010(0)xx if ( gConfig->getCountryCode() == "49") { if (number[0] == '0' && number[1] == '1' && number[2] == '0') { if (number[3] == '0') number.erase(0, 6); else number.erase(0, 5); } } // Modifies 'number' to the following format // '00' + countryCode + regionCode + phoneNumber if (number[0] == '+') { //international prefix given in form +49 -> 0049 number.replace(0, 1, "00"); } else if (number[0] == '0' && number[1] != '0') { //national prefix given 089 -> 004989 number.replace(0, 1, gConfig->getCountryCode().c_str()); number = "00" + number; } else if (number[0] != '0') { // number without country or region code, 1234 -> +49891234 number = "00" + gConfig->getCountryCode() + gConfig->getRegionCode() + number; } // else: number starts with '00', do not change return number; } int Tools::CompareNormalized(std::string number1, std::string number2) { return NormalizeNumber(number1).compare(NormalizeNumber(number2)); } bool Tools::GetLocationSettings() { // get settings from Fritz!Box. FritzClient *fc = gConfig->fritzClientFactory->create(); std::string msg = fc->requestLocationSettings(); size_t lkzStart = msg.find("telcfg:settings/Location/LKZ"); if (lkzStart == std::string::npos) { ERR("Parser error in GetLocationSettings(). Could not find LKZ."); ERR("LKZ/OKZ not set! Resolving phone numbers may not always work."); bool returnValue = fc->hasValidPassword(); delete fc; return returnValue; } lkzStart += 30; lkzStart = msg.find("\"", lkzStart) +1; size_t lkzStop = msg.find("\"", lkzStart); size_t okzStart = msg.find("telcfg:settings/Location/OKZ"); if (okzStart == std::string::npos) { ERR("Parser error in GetLocationSettings(). Could not find OKZ."); ERR("OKZ not set! Resolving phone numbers may not always work."); bool returnValue = fc->hasValidPassword(); delete fc; return returnValue; } okzStart += 30; okzStart = msg.find("\"", okzStart) +1; size_t okzStop = msg.find("\"", okzStart); gConfig->setCountryCode( msg.substr(lkzStart, lkzStop - lkzStart) ); gConfig->setRegionCode( msg.substr(okzStart, okzStop - okzStart) ); if (gConfig->getCountryCode().size() > 0) { DBG("Found LKZ " << (gConfig->logPersonalInfo() ? gConfig->getCountryCode() : HIDDEN)); } else { ERR("LKZ not set! Resolving phone numbers may not always work."); } if (gConfig->getRegionCode().size() > 0) { DBG("Found OKZ " << (gConfig->logPersonalInfo() ? gConfig->getRegionCode() : HIDDEN)); } else { ERR("OKZ not set! Resolving phone numbers may not always work."); } bool returnValue = fc->hasValidPassword(); delete fc; return returnValue; } void Tools::GetSipSettings() { // if SIP settings are already set, exit here... if ( gConfig->getSipNames().size() > 0 ) return; // ...otherwise get settings from Fritz!Box. FritzClient *fc = gConfig->fritzClientFactory->create(); std::string msg = fc->requestSipSettings(); delete fc; std::vector sipNames; std::vector sipMsns; // new parser for lua page if (msg.find("") != std::string::npos) { std::string name, msn; for (size_t i = 0; i < 10; i++) { std::stringstream msnTag, nameTag; msnTag << "telcfg:settings/SIP" << i << "/MSN"; nameTag << "telcfg:settings/SIP" << i << "/Name"; size_t msnPos = msg.find(msnTag.str()); size_t namePos = msg.find(nameTag.str()); if (msnPos == std::string::npos) { sipNames.push_back(""); sipMsns.push_back(""); continue; } msnPos = msg.find("\"", msnPos + msnTag.str().length() + 1); namePos = msg.find("\"", namePos + nameTag.str().length() + 1); msn = msg.substr(msnPos + 1, msg.find("\"", msnPos + 1) - msnPos -1); name = msg.substr(namePos + 1, msg.find("\"", namePos + 1) - namePos -1); sipNames.push_back(name); sipMsns.push_back(msn); DBG("Found SIP" << i << " provider name " << name << " / MSN " << (gConfig->logPersonalInfo() ? msn : HIDDEN)); } gConfig->setSipNames(sipNames); gConfig->setSipMsns(sipMsns); return; } // old parser // check if the structure of the HTML page matches our search pattern if (msg.find("function AuswahlDisplay") == std::string::npos){ ERR("Parser error in GetSipSettings(). Could not find SIP list."); ERR("SIP provider names not set! Usage of SIP provider names not possible."); return; } size_t sipStart = 0; for(size_t i=0; i < 10; i++){ sipStart = msg.find("AuswahlDisplay(\"", sipStart +1); if (sipStart == std::string::npos) { // end of list reached break; } size_t msnStart = msg.rfind("", sipStart); if (msnStart == std::string::npos) { // something is wrong with the structure of the HTML page ERR("Parser error in GetSipSettings(). Could not find SIP provider name."); ERR("SIP provider names not set! Usage of SIP provider names not possible."); return; } msnStart += 15; size_t msnStop = msg.find("", msnStart); std::string msn = msg.substr(msnStart, msnStop - msnStart); size_t hostStart = msg.rfind("ProviderDisplay(\"",sipStart); if (hostStart == std::string::npos) { // something is wrong with the structure of the HTML page ERR("Parser error in GetSipSettings(). Could not find SIP provider name."); ERR("SIP provider names not set! Usage of SIP provider names not possible."); return; } hostStart += 17; size_t hostStop = msg.find("\"", hostStart); std::string hostName = msg.substr(hostStart, hostStop - hostStart); std::string sipName = hostName; // now translate hostname into real provider name according to internal translation table of fritzbox size_t tableStart = msg.find("function ProviderDisplay"); size_t tableStop = msg.find("}", tableStart); size_t tableHostStart = msg.find("case \"", tableStart); if (tableStart == std::string::npos || tableStop == std::string::npos || tableHostStart == std::string::npos) { // something is wrong with the structure of the HTML page ERR("Parser error in GetSipSettings(). Could not find SIP provider name."); ERR("SIP provider names not set! Usage of SIP provider names not possible."); return; } while (tableHostStart <= tableStop && tableHostStart != std::string::npos) { size_t tableHostStop = msg.find("\"", tableHostStart + 6); size_t tableNameStart = msg.find("return \"", tableHostStop); size_t tableNameStop = msg.find("\"", tableNameStart + 8); if (tableHostStart == std::string::npos || tableHostStop == std::string::npos || tableNameStart == std::string::npos || tableNameStop == std::string::npos) { // something is wrong with the structure of the HTML page ERR("Parser error in GetSipSettings(). Could not find SIP provider name."); ERR("SIP provider names not set! Usage of SIP provider names not possible."); return; } tableHostStart += 6; std::string tableHost = msg.substr(tableHostStart, tableHostStop - tableHostStart); tableNameStart += 8; std::string tableName = msg.substr(tableNameStart, tableNameStop - tableNameStart); if (hostName.find(tableHost) != std::string::npos) { // we found a match in the table sipName = tableName; break; } // search the next table line tableHostStart = msg.find("case \"", tableNameStop); } sipNames.push_back(sipName); sipMsns.push_back(msn); DBG("Found SIP" << i << " (" << hostName << ") provider name " << sipName << " / MSN " << (gConfig->logPersonalInfo() ? msn : HIDDEN)); } gConfig->setSipNames(sipNames); gConfig->setSipMsns(sipMsns); } std::string Tools::Tokenize(const std::string &buffer, const char delimiter, size_t pos) { size_t tokenStart = 0; for (size_t i=0; i 0) tokenStart++; size_t tokenStop = buffer.find(delimiter, tokenStart); if (tokenStop == std::string::npos) tokenStop = buffer.size(); std::string token = buffer.substr(tokenStart, tokenStop - tokenStart); return token; } } fritzbox-1.5.3/libfritz++/FritzClient.cpp0000644000175000017500000004014212467660540017642 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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 "FritzClient.h" #include #include #include #include "Config.h" #include "Tools.h" #include #include #define RETRY_BEGIN \ unsigned int retry_delay = RETRY_DELAY / 2; \ bool dataRead = false; \ do { \ try { \ validPassword = login(); \ retry_delay = retry_delay > 1800 ? 3600 : retry_delay * 2; #define RETRY_END \ dataRead = true; \ } catch (std::runtime_error &re) { \ ERR("Exception in connection to " << gConfig->getUrl() << " - " << re.what()); \ ERR("waiting " << retry_delay << " seconds before retrying"); \ sleep(retry_delay); /* delay a possible retry */ \ } \ } while (!dataRead); namespace fritz { std::mutex* FritzClient::mutex = new std::mutex(); FritzClient::FritzClient() : httpClient{gConfig->getUrl(), gConfig->getUiPort()} { validPassword = false; mutex->lock(); // init libgcrypt gcry_check_version (nullptr); // disable secure memory gcry_control (GCRYCTL_DISABLE_SECMEM, 0); gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); // init HttpClient soapClient = new network::SoapClient(gConfig->getUrl(), gConfig->getUpnpPort()); } FritzClient::~FritzClient() { mutex->unlock(); } std::string FritzClient::calculateLoginResponse(std::string challenge) { std::string challengePwd = challenge + '-' + gConfig->getPassword(); // the box needs an md5 sum of the string "challenge-password" // to make things worse, it needs this in UTF-16LE character set // last but not least, for "compatibility" reasons (*LOL*) we have to replace // every char > "0xFF 0x00" with "0x2e 0x00" convert::CharsetConverter conv("", "UTF-16LE"); char challengePwdConv[challengePwd.length()*2]; memcpy(challengePwdConv, conv.convert(challengePwd).c_str(), challengePwd.length()*2); for (size_t pos=1; pos < challengePwd.length()*2; pos+= 2) if (challengePwdConv[pos] != 0x00) { challengePwdConv[pos] = 0x00; challengePwdConv[pos-1] = 0x2e; } unsigned char hash[16]; gcry_md_hash_buffer(GCRY_MD_MD5, hash, (const char*)challengePwdConv, challengePwd.length()*2); std::stringstream response; response << challenge << '-'; for (size_t pos=0; pos < 16; pos++) response << std::hex << std::setfill('0') << std::setw(2) << (unsigned int)hash[pos]; return response.str(); } std::string FritzClient::urlEncode(const std::string &s_input) { std::string result; std::string s; std::string hex = "0123456789abcdef"; convert::CharsetConverter conv("", "ISO-8859-15"); s = conv.convert(s_input); for (unsigned int i=0; i> 4]; result += hex[(unsigned char) s[i] & 0x0f]; } } return result; } bool FritzClient::login() { // when using SIDs, a new login is only needed if the last request was more than 5 minutes ago if ((gConfig->getLoginType() == Config::SID || gConfig->getLoginType() == Config::LUA) && (time(nullptr) - gConfig->getLastRequestTime() < 300)) { return true; } // detect type of login once std::string sXml; // sXml is used twice! if (gConfig->getLoginType() == Config::UNKNOWN || gConfig->getLoginType() == Config::SID || gConfig->getLoginType() == Config::LUA) { // detect if this Fritz!Box uses SIDs DBG("requesting login_sid.lua from Fritz!Box."); // might return 404 with older fw-versions, our httpClient throws a SockeException for this, catched here try { sXml = httpClient.get("/login_sid.lua", {{"sid", gConfig->getSid()}}); } catch (std::runtime_error &re) {} if (sXml.find("setLoginType(Config::LUA); else { DBG("requesting login_sid.xml from Fritz!Box."); sXml = httpClient.get("/cgi-bin/webcm", {{"getpage", "../html/login_sid.xml"}}); if (sXml.find("") != std::string::npos) gConfig->setLoginType(Config::SID); else gConfig->setLoginType(Config::PASSWORD); } } if (gConfig->getLoginType() == Config::SID || gConfig->getLoginType() == Config::LUA) { std::stringstream loginPath; if (gConfig->getLoginType() == Config::LUA) { loginPath << "/login_sid.lua"; } else { loginPath << "/cgi-bin/webcm"; } // check if no password is needed (SID is directly available) size_t sidStart = sXml.find(""); if (sidStart == std::string::npos) { ERR("Error - Expected field not found in login_sid.xml or login_sid.lua."); return false; } sidStart += 5; std::string sid = sXml.substr(sidStart, 16); if (sid.compare("0000000000000000") != 0) { // save SID DBG("SID is still valid - all ok."); gConfig->setSid(sid); gConfig->updateLastRequestTime(); return true; } else { DBG("We need to log in."); // generate response out of challenge and password size_t challengeStart = sXml.find(""); if (challengeStart == std::string::npos) { ERR("Error - Expected not found in login_sid.xml or login_sid.lua."); return false; } challengeStart += 11; size_t challengeStop = sXml.find("<", challengeStart); std::string challenge = sXml.substr(challengeStart, challengeStop - challengeStart); std::string response = calculateLoginResponse(challenge); // send response to box std::string sMsg; network::HttpClient::param_t postdata; if (gConfig->getLoginType() == Config::SID) postdata = {{"login:command/response", response}, {"getpage", "../html/de/menus/menu2.html"}}; else postdata = {{"username", gConfig->getUsername()}, {"response", response }}; DBG("Sending login request " << ( gConfig->getUsername().size() ? "for user " : "" ) << gConfig->getUsername() << "..."); sMsg = httpClient.post(loginPath.str(), postdata); size_t sidStart, sidStop; if (gConfig->getLoginType() == Config::SID) { sidStart = sMsg.find("name=\"sid\""); if (sidStart == std::string::npos) { ERR("Error - Expected sid field not found."); return false; } sidStart = sMsg.find("value=\"", sidStart + 10) + 7; sidStop = sMsg.find("\"", sidStart); } else { sidStart = sMsg.find(""); if (sidStart == std::string::npos) { ERR("Error - Expected sid field not found."); return false; } sidStart += 5; sidStop = sMsg.find(""); } // save SID gConfig->setSid(sMsg.substr(sidStart, sidStop-sidStart)); if (gConfig->getSid().compare("0000000000000000") != 0) { DBG("login successful."); gConfig->updateLastRequestTime(); return true; } else { ERR("login failed, check your password settings!."); return false; } } } if (gConfig->getLoginType() == Config::PASSWORD) { DBG("logging into fritz box using old scheme without SIDs."); // no password, no login if ( gConfig->getPassword().length() == 0) return true; //TODO: check if box really doesn't need a password std::string sMsg; sMsg = httpClient.post("/cgi-bin/webcm", {{"login:command/password", urlEncode(gConfig->getPassword())}}); // determine if login was successful if (sMsg.find("class=\"errorMessage\"") != std::string::npos) { ERR("login failed, check your password settings."); return false; } DBG("login successful."); return true; } return false; } std::string FritzClient::getLang() { if ( gConfig && gConfig->getLang().size() == 0) { std::vector langs; langs.push_back("en"); langs.push_back("de"); langs.push_back("fr"); for (auto lang : langs) { std::string sMsg; sMsg = httpClient.get("/cgi-bin/webcm", { {"getpage", "../html/" + lang + "/menus/menu2.html"}, {"sid", gConfig->getSid() } }); if (sMsg.find("") != std::string::npos) { gConfig->setLang(lang); DBG("interface language is " << gConfig->getLang().c_str()); return gConfig->getLang(); } } DBG("error parsing interface language, assuming 'de'"); gConfig->setLang("de"); } return gConfig->getLang(); } bool FritzClient::initCall(std::string &number) { std::string msg; if (number.length() == 0) return false; if (!login()) return false; try { INF("sending call init request " << (gConfig->logPersonalInfo() ? number.c_str() : HIDDEN)); network::HttpClient::param_t params = { { "getpage", "../html/" + getLang() + "/menus/menu2.html" }, { "var%3Apagename", "fonbuch" }, { "var%3Amenu", "home" }, { "telcfg%3Acommand/Dial", number }, { "sid", gConfig->getSid() } }; msg = httpClient.post("/cgi-bin/webcm", params); INF("call initiated."); } catch (std::runtime_error &re) { ERR("Exception - " << re.what()); return false; } return true; } std::string FritzClient::requestLocationSettings() { std::string msg; RETRY_BEGIN { if (gConfig->getSid().size()) { DBG("Looking up Phone Settings (using lua)..."); try { msg = httpClient.get("/fon_num/sip_option.lua", {{"sid", gConfig->getSid()}}); } catch (std::runtime_error &re) {} if (msg.find("") != std::string::npos) return msg; DBG("failed."); } DBG("Looking up Phone Settings (using webcm)..."); msg = httpClient.get("/cgi-bin/webcm", { { "getpage", "../html/" + getLang() + "/menus/menu2.html" }, { "var%3Alang", getLang() }, { "var%3Apagename", "sipoptionen" }, { "var%3Amenu", "fon" }, { "sid", gConfig->getSid() }, }); } RETRY_END return msg; } std::string FritzClient::requestSipSettings() { std::string msg; RETRY_BEGIN { if (gConfig->getSid().size()) { DBG("Looking up SIP Settings (using lua)..."); try { msg = httpClient.get("/fon_num/fon_num_list.lua", {{"sid", gConfig->getSid()}}); } catch (std::runtime_error &re) {} if (msg.find("") != std::string::npos) return msg; DBG("failed."); } DBG("Looking up SIP Settings (using webcm)..."); msg = httpClient.get("/cgi-bin/webcm", { { "getpage", "../html/" + getLang() + "/menus/menu2.html" }, { "var%3Alang", getLang() }, { "var%3Apagename", "siplist" }, { "var%3Amenu", "fon" }, { "sid", gConfig->getSid() }, }); } RETRY_END return msg; } std::string FritzClient::requestCallList () { std::string msg = ""; std::string csv = ""; RETRY_BEGIN { // now, process call list DBG("sending callList update request."); // force an update of the fritz!box csv list and wait until all data is received msg = httpClient.get("/cgi-bin/webcm", { { "getpage", "../html/" + getLang() + "/menus/menu2.html" }, { "var%3Alang", getLang() }, { "var%3Apagename", "foncall" }, { "var%3Amenu", "fon" }, { "sid", gConfig->getSid() }, }); // new method to request call list (FW >= xx.05.50?) try { DBG("sending callList request (using lua)..."); csv = httpClient.get("/fon_num/foncalls_list.lua", { { "csv", "" }, { "sid", gConfig->getSid() }, }); if (csv.find("Typ;Datum;Name;") != std::string::npos) { return csv; } } catch (std::runtime_error &re) {} // old method, parsing url to csv from page above // get the URL of the CSV-File-Export unsigned int urlPos = msg.find(".csv"); unsigned int urlStop = msg.find('"', urlPos); unsigned int urlStart = msg.rfind('"', urlPos) + 1; std::string csvUrl = msg.substr(urlStart, urlStop-urlStart); // retrieve csv list DBG("sending callList request (using webcm)..."); csv = httpClient.get("/cgi-bin/webcm", { { "getpage", csvUrl }, { "sid", gConfig->getSid() }, }); // convert answer to current SystemCodeSet (we assume, Fritz!Box sends its answer in latin15) convert::CharsetConverter conv("ISO-8859-15"); csv = conv.convert(csv); } RETRY_END return csv; } std::string FritzClient::requestFonbook () { std::string msg; // new method, returns an XML RETRY_BEGIN { if (gConfig->getSid().length()) { network::HttpClient::param_t postdata = { { "sid", gConfig->getSid() }, { "PhonebookId", "0" }, { "PhonebookExportName", "Telefonbuch" }, { "PhonebookExport", "" } }; DBG("sending fonbook XML request."); try { msg = httpClient.postMIME("/cgi-bin/firmwarecfg", postdata); } catch (std::runtime_error &re) {} if (msg.find("") != std::string::npos) { return msg; } } // use old fashioned website (for old FW versions) DBG("sending fonbook HTML request."); msg = httpClient.get("/cgi-bin/webcm", { { "getpage", "../html/" + getLang() + "/menus/menu2.html" }, { "var%3Alang", getLang() }, { "var%3Apagename", "fonbuch" }, { "var%3Amenu", "fon" }, { "sid", gConfig->getSid() }, }); } RETRY_END return msg; } void FritzClient::writeFonbook(std::string xmlData) { std::string msg; DBG("Saving XML Fonbook to FB..."); RETRY_BEGIN { network::HttpClient::param_t postdata = { { "sid", gConfig->getSid() }, { "PhonebookId", "0" }, { "PhonebookImportFile\"; filename=\"FRITZ.Box_Telefonbuch.xml", xmlData } }; msg = httpClient.postMIME("/cgi-bin/firmwarecfg", postdata); } RETRY_END } bool FritzClient::reconnectISP() { std::string msg; DBG("Sending reconnect request to FB."); try { msg = soapClient->post( "/upnp/control/WANIPConn1", "urn:schemas-upnp-org:service:WANIPConnection:1#ForceTermination", "" "" "" "" "" ""); } catch (std::runtime_error &re) { ERR("Exception in connection to " << gConfig->getUrl() << " - " << re.what()); return false; } if (msg.find("ForceTerminationResponse") == std::string::npos) return false; else return true; } std::string FritzClient::getCurrentIP() { std::string msg; DBG("Sending reconnect request to FB."); try { msg = soapClient->post( "/upnp/control/WANIPConn1", "urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress", "" "" "" "" "" ""); } catch (std::runtime_error &re) { ERR("Exception in connection to " << gConfig->getUrl() << " - " << re.what()); return ""; } DBG("Parsing reply..."); std::string::size_type start = msg.find(""); std::string::size_type stop = msg.find(""); if (start != std::string::npos && stop != std::string::npos) { std::string ip = msg.substr(start + 22, stop - start - 22); DBG("Current ip is: " << ip); return ip; } else { ERR("Error parsing response in getCurrentIP()."); } return ""; } //TODO: update lastRequestTime with any request } fritzbox-1.5.3/libfritz++/FonbookManager.h0000644000175000017500000001407712467660540017752 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef FONBOOKMANAGER_H #define FONBOOKMANAGER_H #include "Fonbooks.h" namespace fritz{ class FonbookManager : public Fonbook { private: static FonbookManager* me; Fonbooks fonbooks; FonbookManager(bool saveOnShutdown); Fonbook *getActiveFonbook() const; size_t activeFonbookPos; bool saveOnShutdown; public: virtual ~FonbookManager(); /** * Creates the central FonbookManager and activates certain fonbooks. * This method instantiates the fonbookmanager. Following calls to * getFonbookManager() return a reference to this object. * CreateFonbookManager should be called before any call to getFonbookManager() to allow * the configured fonbooks to initialize and fetch data which may be done in separate threads. * If some of the fonbooks provided by libfritz++ shall be used, they need to be * activated by this method. These fonbooks are used for reverse lookup on call events. * The order of the fonbooks determines the priority regarding these lookups. * Regarding queries to the fonbooks, a pointer is maintained which points to the currently * "active" fonbook. This pointer can be moved, using FonbookManager::NextFonbook(). * @param the list of enabled fonbooks * @param the currently "active" fonbook * @param wether changes to fonbooks are saved on FonbookManager deletion */ static void CreateFonbookManager( std::vector vFonbookID, std::string activeFonbook, bool saveOnShutdown = true); /** * Returns the instance object of the FonbookManager casted to Fonbook. */ static Fonbook *GetFonbook(); /** * Returns the instance object of the FonbookManager */ static FonbookManager *GetFonbookManager(); /* * Deletes the FonbookManager instance. */ static void DeleteFonbookManager(); /** * Switch to next displayable phonebook. * @return void */ void nextFonbook(); /** * Resolves the number given to the corresponding name. * @param number to resolve * @return resolved name and type or the number, if unsuccessful */ sResolveResult resolveToName(std::string number) override; /** * Returns a specific telephonebook entry. * @param id unique identifier of the requested entry * @return the entry with key id or nullptr, if unsuccessful */ const FonbookEntry *retrieveFonbookEntry(size_t id) const override; /** * Changes the Fonbook entry with the given id * @param id unique identifier to the entry to be changed * @param fe FonbookEntry with the new content * @return true, if successful */ bool changeFonbookEntry(size_t id, FonbookEntry &fe) override; /** * Sets the default number for a Fonbook entry with the given id * @param id unique identifier to the entry to be changed * @param type the new default * @return true, if successful */ virtual bool setDefault(size_t id, size_t pos); /** * Adds a new entry to the phonebook. * @param fe a new phonebook entry * @return true, if add was successful */ void addFonbookEntry(FonbookEntry &fe, size_t position = std::string::npos) override; /** * Adds a new entry to the phonebook. * @param id unique id to the entry to be deleted * @return true, if deletion was successful */ bool deleteFonbookEntry(size_t id) override; /** * Clears all entries from phonebook. */ void clear() override; /** * Save pending changes. * Can be called periodically to assert pending changes in a phone book are written. */ void save() override; /** * Returns if it is possible to display the entries of this phonebook. * @return true, if this phonebook has displayable entries. "Reverse lookup only" phonebooks must return false here. */ bool isDisplayable() const override; /** * Returns if this phonebook is ready to use. * @return true, if this phonebook is ready to use */ bool isInitialized() const override; /** * Returns if this phonebook is writeable, e.g. entries can be added or modified. * @return true, if this phonebook is writeable */ bool isWriteable() const override; /** * Returns if this phonebook has changes that are not yet written. * @return true, if changes are pending */ bool isModified() const override; /** * Sets the initialized-status. * @param isInititalized the value initialized is set to */ void setInitialized(bool isInitialized) override; /** * Sorts the phonebook's entries by the given element and in given order. * @param the element used for sorting * @param true if sort order is ascending, false otherwise */ void sort(FonbookEntry::eElements element = FonbookEntry::ELEM_NAME, bool ascending = true) override; /** * Returns the number of entries in the telephonebook. * @return the number of entries or cFonbook::npos, if requesting specific telephonebook entries is not possible for this telephonebook */ size_t getFonbookSize() const override; /** * Reloads the telephonebook's content */ void reload() override; /** * Returns a string that should be displayed as title in the menu when the telephonebook is displayed. */ std::string getTitle() const override; /** * Returns the technical id of this phonebook. This id has to be unique among all phonebooks and is used when storing * the plugin's setup. * @return the technical id */ virtual std::string getTechId() const override; /** * */ Fonbooks *getFonbooks(); }; } #endif /*FONBOOKMANAGER_H_*/ fritzbox-1.5.3/libfritz++/Nummerzoeker.h0000644000175000017500000000215012467660540017532 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef NUMMERZOEKER_H #define NUMMERZOEKER_H #include "LookupFonbook.h" namespace fritz { class NummerzoekerFonbook : public LookupFonbook { friend class FonbookManager; private: NummerzoekerFonbook(); public: sResolveResult lookup(std::string number) const override; }; } #endif /*NUMMERZOEKER_H_*/ fritzbox-1.5.3/libfritz++/Nummerzoeker.cpp0000644000175000017500000000541012467660540020067 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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 "Nummerzoeker.h" #include #include "Config.h" #include #include "Tools.h" #include namespace fritz{ NummerzoekerFonbook::NummerzoekerFonbook() : LookupFonbook(I18N_NOOP("nummerzoeker.com"), "ZOEK") {} Fonbook::sResolveResult NummerzoekerFonbook::lookup(std::string number) const { Fonbook::sResolveResult result(number); // resolve only NL phone numbers std::string normNumber = Tools::NormalizeNumber(number); if (number.length() == 0 || normNumber.find("0031") != 0) return result; // __FILE__om works only with national number: remove 0031 prefix, add 0 normNumber = '0' + normNumber.substr(4); std::string msg; try { DBG("sending reverse lookup request for " << (gConfig->logPersonalInfo() ? normNumber : HIDDEN) << " to www.nummerzoeker.com"); network::HttpClient tc("www.nummerzoeker.com"); network::HttpClient::param_t params = { { "search", "Zoeken" }, { "phonenumber", normNumber }, { "export", "csv" }, }; msg = tc.get("/index.php", params); } catch (std::runtime_error &re) { ERR("Exception - " << re.what()); return result; } if (msg.find("Content-Type: text/html") != std::string::npos) { INF("no entry found."); return result; } // parse answer, format is "number",name,surname,street,zip,city size_t lineStart = 0; std::string name, surname; while ((lineStart = msg.find("\n", lineStart)) != std::string::npos) { lineStart++; if (msg[lineStart] == '"') { size_t nameStart = msg.find(",", lineStart); size_t surnameStart = msg.find(",", nameStart+1); size_t streetStart = msg.find(",", surnameStart+1); name = msg.substr(nameStart, surnameStart-nameStart-1); surname = msg.substr(surnameStart, streetStart-surnameStart-1); name = surname + ' ' + name; break; } } INF("resolves to " << (gConfig->logPersonalInfo() ? name.c_str() : HIDDEN)); result.name = name; result.successful = true; return result; } } fritzbox-1.5.3/libfritz++/OertlichesFonbook.h0000644000175000017500000000216312467660540020472 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef OERTLICHESFONBOOK_H #define OERTLICHESFONBOOK_H #include "LookupFonbook.h" namespace fritz { class OertlichesFonbook : public LookupFonbook { friend class FonbookManager; private: OertlichesFonbook(); public: sResolveResult lookup(std::string number) const override; }; } #endif /*OERTLICHESFONBOOK_H_*/ fritzbox-1.5.3/libfritz++/CMakeLists.txt0000644000175000017500000000405712467660540017446 0ustar tobiastobias# --- general setup ----------------------------------------------------------- cmake_minimum_required(VERSION 2.6) project (libfritz++) #set(CMAKE_VERBOSE_MAKEFILE true) # <-- enable for debugging #set(CMAKE_BUILD_TYPE "Debug") # <-- enable for debugging set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${libfritz++_SOURCE_DIR}/CMakeModules") find_package(PkgConfig REQUIRED) find_package(Threads REQUIRED) # --- libgcrypt includes ------------------------------------------------------ include("FindGcryptConfig") gcrypt_check(GCRYPT REQUIRED gcrypt) # --- boost ------------------------------------------------------------------- find_package(Boost COMPONENTS system date_time thread regex REQUIRED) # --- threading --------------------------------------------------------------- find_package(Threads) # --- compile and link -------------------------------------------------------- include_directories(${libfritz++_SOURCE_DIR}) include_directories(${libfritz++_SOURCE_DIR}/..) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCRYPT_CFLAGS} -std=gnu++11") set(SRCS CallList.cpp Config.cpp Fonbooks.cpp Fonbook.cpp FonbookManager.cpp FritzClient.cpp FritzFonbook.cpp Listener.cpp LocalFonbook.cpp LookupFonbook.cpp Nummerzoeker.cpp OertlichesFonbook.cpp TelLocalChFonbook.cpp Tools.cpp XmlFonbook.cpp) add_library(fritz++ STATIC ${SRCS}) # --- tests ------------------------------------------------------------------- if (EXISTS ${libfritz++_SOURCE_DIR}/test) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-undef -DSOURCE_DIR=\\\"${libfritz++_SOURCE_DIR}\\\"") include_directories(${libfritz++_SOURCE_DIR}/test) AUX_SOURCE_DIRECTORY(test LIBTESTFILES) add_executable(libfritztest ${LIBTESTFILES} test/gtest/gtest-all.cc test/gtest/gtest_main.cc) target_link_libraries(libfritztest fritz++ log++ net++ conv++ ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_REGEX_LIBRARY} ${GCRYPT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ) endif (EXISTS ${libfritz++_SOURCE_DIR}/test) fritzbox-1.5.3/libfritz++/Listener.cpp0000644000175000017500000001527712467660540017205 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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 "Listener.h" #include #include #include #include #include "CallList.h" #include "Config.h" #include "FonbookManager.h" #include "Tools.h" #include #include namespace fritz{ Listener *Listener::me = nullptr; Listener::Listener(EventHandler *event) { this->event = event; thread = new std::thread(&Listener::run, this); } Listener::~Listener() { if (thread) { cancelThread(); thread->join(); delete thread; } } void Listener::cancelThread() { cancelRequested = true; if (tcpClientPtr) tcpClientPtr->expireStreamNow(); } void Listener::CreateListener(EventHandler *event) { EventHandler *oldEvent = me ? me->event : nullptr; DeleteListener(); if (event || oldEvent) me = new Listener(event ? event : oldEvent); else ERR("Invalid call parameter. First call to CreateListener needs event handler object."); } void Listener::DeleteListener() { if (me) { DBG("deleting listener"); delete me; me = nullptr; } } void Listener::handleNewCall(bool outgoing, int connId, std::string remoteNumber, std::string localParty, std::string medium) { if ( Tools::MatchesMsnFilter(localParty) ) { // do reverse lookup Fonbook::sResolveResult result = FonbookManager::GetFonbook()->resolveToName(remoteNumber); // resolve SIP names std::string mediumName; if (medium.find("SIP") != std::string::npos && gConfig->getSipNames().size() > (size_t)atoi(&medium[3])) mediumName = gConfig->getSipNames()[atoi(&medium[3])]; else mediumName = medium; // notify application if (event) event->handleCall(outgoing, connId, remoteNumber, result.name, result.type, localParty, medium, mediumName); activeConnections.push_back(connId); } } void Listener::handleConnect(int connId) { // only notify application if this connection is part of activeConnections bool notify = false; for (std::vector::iterator it = activeConnections.begin(); it < activeConnections.end(); ++it) { if (*it == connId) { notify = true; break; } } if (notify) if (event) event->handleConnect(connId); } void Listener::handleDisconnect(int connId, std::string duration) { // only notify application if this connection is part of activeConnections bool notify = false; for (std::vector::iterator it = activeConnections.begin(); it < activeConnections.end(); ++it) { if (*it == connId) { activeConnections.erase(it); notify = true; break; } } if (notify) { if (event) event->handleDisconnect(connId, duration); // force reload of callList CallList *callList = CallList::GetCallList(false); if (callList) callList->reload(); } } void Listener::run() { DBG("Listener thread started"); unsigned int retry_delay = RETRY_DELAY / 2; while (!cancelRequested) { try { retry_delay = retry_delay > 1800 ? 3600 : retry_delay * 2; network::TcpClient tcpClient(gConfig->getUrl(), gConfig->getListenerPort()); tcpClientPtr = &tcpClient; while (!cancelRequested) { DBG("Waiting for a message."); std::string line = tcpClient.readLine(); if (cancelRequested) break; if (gConfig->logPersonalInfo()) DBG("Got message " << line); // split line into tokens std::string date = Tools::Tokenize(line, ';', 0); std::string type = Tools::Tokenize(line, ';', 1); int connId = atoi(Tools::Tokenize(line, ';', 2).c_str()); std::string partA = Tools::Tokenize(line, ';', 3); std::string partB = Tools::Tokenize(line, ';', 4); std::string partC = Tools::Tokenize(line, ';', 5); std::string partD = Tools::Tokenize(line, ';', 6); #if 0 // some strings sent from the FB, made available to xgettext I18N_NOOP("POTS"); I18N_NOOP("ISDN"); #endif if (type.compare("CALL") == 0) { // partA => box port // partB => caller Id (local) // partC => called Id (remote) // partD => medium (POTS, SIP[1-9], ISDN, ...) DBG("CALL " << ", " << partA << ", " << (gConfig->logPersonalInfo() ? partB : HIDDEN) << ", " << (gConfig->logPersonalInfo() ? partC : HIDDEN) << ", " << partD); // an '#' can be appended to outgoing calls by the phone, so delete it if (partC[partC.length()-1] == '#') partC = partC.substr(0, partC.length()-1); handleNewCall(true, connId, partC, partB, partD); } else if (type.compare("RING") == 0) { // partA => caller Id (remote) // partB => called Id (local) // partC => medium (POTS, SIP[1-9], ISDN, ...) DBG("RING " << ", " << (gConfig->logPersonalInfo() ? partA : HIDDEN) << ", " << (gConfig->logPersonalInfo() ? partB : HIDDEN) << ", " << partC); handleNewCall(false, connId, partA, partB, partC); } else if (type.compare("CONNECT") == 0) { // partA => box port // partB => local/remote Id DBG("CONNECT " << ", " << partA << ", " << (gConfig->logPersonalInfo() ? partB : HIDDEN)); handleConnect(connId); } else if (type.compare("DISCONNECT") == 0) { // partA => call duration DBG("DISCONNECT " << ", " << partA ); handleDisconnect(connId, partA); } else { DBG("Got unknown message " << line); throw this; } retry_delay = RETRY_DELAY; } } catch(std::runtime_error &re) { ERR("Exception - " << re.what()); // TODO: Detect reason for exception //if (se.getSocketError() == ost::Socket::errConnectRefused) ERR("Make sure to enable the Fritz!Box call monitor by dialing #96*5* once."); } catch (Listener *listener) { ERR("Exception unknown data received."); } tcpClientPtr = nullptr; if (cancelRequested) break; ERR("waiting " << retry_delay << " seconds before retrying"); unsigned int retry_delay_counter = retry_delay; while (--retry_delay_counter && !cancelRequested) // delay the retry std::this_thread::sleep_for(std::chrono::seconds(1)); } DBG("Listener thread ended"); } } fritzbox-1.5.3/libfritz++/TelLocalChFonbook.h0000644000175000017500000000226712467660540020350 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * TelLocalChFonbook created by Christian Richter * * 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. * */ #ifndef TelLocalChFonbook_H #define TelLocalChFonbook_H #include "LookupFonbook.h" namespace fritz { class TelLocalChFonbook : public LookupFonbook { friend class FonbookManager; private: TelLocalChFonbook(); public: sResolveResult lookup(std::string number) const override; }; } #endif /*TelLocalChFonbook_H_*/ fritzbox-1.5.3/libfritz++/FritzFonbook.h0000644000175000017500000000236412467660540017472 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef FRITZFONBOOK_H #define FRITZFONBOOK_H #include #include #include "XmlFonbook.h" namespace fritz{ class FritzFonbook : public XmlFonbook { friend class FonbookManager; private: std::thread *thread; FritzFonbook(); void parseHtmlFonbook(std::string *msg); void write() override; public: virtual ~FritzFonbook(); bool initialize() override; void run(); void reload() override; }; } #endif /*FRITZFONBUCH_H_*/ fritzbox-1.5.3/libfritz++/LookupFonbook.h0000644000175000017500000000420112467660540017635 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef LOOKUPFONBOOK_H_ #define LOOKUPFONBOOK_H_ #include "Fonbook.h" namespace fritz { class LookupFonbook: public Fonbook { public: LookupFonbook(std::string title, std::string techId, bool writeable = false); virtual ~LookupFonbook(); /** * Take action to fill phonebook with content. * Initialize() may be called more than once per session. * @return if initialization was successful */ bool initialize() override; /** * Resolves the number given to the corresponding name. * @param number to resolve * @return resolved name and type or the number, if unsuccessful */ sResolveResult resolveToName(std::string number) override; /** * Resolves number doing a (costly) lookup * @param number to resolve * @return resolved name and type or number, if not successful */ virtual sResolveResult lookup(std::string number) const; /** * Returns the number of entries in the telephonebook. * @return the number of entries */ size_t getFonbookSize() const override { return 0; } /** * Returns a specific telephonebook entry. * @param id unique identifier of the requested entry * @return the entry with key id or nullptr, if unsuccessful */ const FonbookEntry *retrieveFonbookEntry(size_t id __attribute__((unused))) const override { return nullptr; } }; } /* namespace fritz */ #endif /* LOOKUPFONBOOK_H_ */ fritzbox-1.5.3/libfritz++/TelLocalChFonbook.cpp0000644000175000017500000000434212467660540020677 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * TelLocalChFonbook created by Christian Richter * * 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 "TelLocalChFonbook.h" #include #include "Config.h" #include #include "Tools.h" #include #include #include namespace fritz{ TelLocalChFonbook::TelLocalChFonbook() : LookupFonbook(I18N_NOOP("tel.local.ch"), "LOCCH") {} TelLocalChFonbook::sResolveResult TelLocalChFonbook::lookup(std::string number) const { TelLocalChFonbook::sResolveResult result(number); // resolve only (swiss) phone numbers if (number.length() == 0 || Tools::NormalizeNumber(number).find("0041") != 0) return result; std::string msg; std::string name; try { DBG("sending reverse lookup request for " << Tools::NormalizeNumber(number) << " to tel.local.ch"); network::HttpClient tc("mobile.tel.local.ch"); std::stringstream ss; ss << "/de/q/" << Tools::NormalizeNumber(number) << ".html"; msg = tc.get(ss.str()); } catch (std::runtime_error &se) { ERR("Exception - " << se.what()); return result; } // parse answer boost::regex expression("

]+>]+>(.+)

"); boost::smatch what; if (boost::regex_search(msg, what, expression)) { name = what[1]; name = convert::EntityConverter::DecodeEntities(name); INF("resolves to " << name.c_str()); result.name = name; result.successful = true; } else INF("no entry found."); return result; } } fritzbox-1.5.3/libfritz++/FritzFonbook.cpp0000644000175000017500000001264412467660540020027 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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 "FritzFonbook.h" #include #include #include "Config.h" #include "FritzClient.h" #include "Tools.h" #include #include #include namespace fritz { FritzFonbook::FritzFonbook() :XmlFonbook(I18N_NOOP("Fritz!Box phone book"), "FRITZ", true), thread{nullptr} { setInitialized(false); } FritzFonbook::~FritzFonbook() { if (thread) { thread->join(); delete thread; } } bool FritzFonbook::initialize() { reload(); return true; } void FritzFonbook::run() { DBG("FritzFonbook thread started"); setInitialized(false); clear(); FritzClient *fc = gConfig->fritzClientFactory->create(); std::string msg = fc->requestFonbook(); delete fc; if (msg.find("find("find("charset=", pos); if (pos != std::string::npos) charset = msg->substr(pos+8, msg->find('"', pos)-pos-8); } DBG("using charset " << charset); std::string msgConv = convert::CharsetConverter::ConvertToLocalEncoding(*msg, charset); // parse answer pos = 0; int count = 0; // parser for old format const std::string tag("(TrFon("); while ((pos = msgConv.find(tag, pos)) != std::string::npos) { pos += 7; // points to the first " int nameStart = msgConv.find(',', pos) +3; int nameStop = msgConv.find('"', nameStart) -1; int numberStart = msgConv.find(',', nameStop) +3; int numberStop = msgConv.find('"', numberStart) -1; if (msgConv[nameStart] == '!') // skip '!' char, older firmware versions use to mark important nameStart++; std::string namePart = msgConv.substr(nameStart, nameStop - nameStart+1); std::string namePart2 = convert::EntityConverter::DecodeEntities(namePart); std::string numberPart = msgConv.substr(numberStart, numberStop - numberStart+1); if (namePart2.length() && numberPart.length()) { FonbookEntry fe(namePart2, false); // TODO: important is not parsed here fe.addNumber(numberPart, FonbookEntry::TYPE_NONE); addFonbookEntry(fe); //DBG("(%s / %s)", fe.number.c_str(), fe.name.c_str()); } pos += 10; count++; } // parser for new format pos = 0; const std::string tagName("TrFonName("); const std::string tagNumber("TrFonNr(" ); // iterate over all tagNames while ((pos = msgConv.find(tagName, ++pos)) != std::string::npos) { int nameStart = msgConv.find(',', pos+7) +3; int nameStop = msgConv.find('"', nameStart) -1; std::string namePart = msgConv.substr(nameStart, nameStop - nameStart+1); std::string namePartConv = convert::EntityConverter::DecodeEntities(namePart); FonbookEntry fe(namePartConv, false); // TODO: important is not parsed here size_t posInner = pos; // iterate over all tagNumbers between two tagNames while ((posInner = msgConv.find(tagNumber, ++posInner)) != std::string::npos && posInner < msgConv.find(tagName, pos+1)) { int typeStart = posInner + 9; int numberStart = msgConv.find(',', posInner) +3; int typeStop = numberStart - 5; int numberStop = msgConv.find('"', numberStart) -1; std::string numberPart = msgConv.substr(numberStart, numberStop - numberStart+1); std::string typePart = msgConv.substr(typeStart, typeStop - typeStart+1); FonbookEntry::eType type = FonbookEntry::TYPE_NONE; if (typePart.compare("home") == 0) type = FonbookEntry::TYPE_HOME; else if (typePart.compare("mobile") == 0) type = FonbookEntry::TYPE_MOBILE; else if (typePart.compare("work") == 0) type = FonbookEntry::TYPE_WORK; if (namePartConv.length() && numberPart.length()) { fe.addNumber(numberPart, type); // TODO: quickdial, vanity and priority not parsed here //DBG("(%s / %s / %i)", fe.number.c_str(), fe.name.c_str(), fe.type); } count++; } addFonbookEntry(fe); } } void FritzFonbook::reload() { if (thread) { thread->join(); delete thread; } thread = new std::thread(&FritzFonbook::run, this); } void FritzFonbook::write() { if (isWriteable()) { INF("Uploading phonebook to Fritz!Box."); FritzClient *fc = gConfig->fritzClientFactory->create(); fc->writeFonbook(serializeToXml()); delete fc; } } } fritzbox-1.5.3/libfritz++/Fonbooks.h0000644000175000017500000000211712467660540016632 0ustar tobiastobias/* * libfritz++ * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef FONBOOKS_H #define FONBOOKS_H #include "Fonbook.h" namespace fritz{ class Fonbooks : public std::vector { public: Fonbooks(); virtual ~Fonbooks(); Fonbook *operator[](std::string key) const; Fonbook *operator[](size_t i) const; }; } #endif /*FONBOOKS_H_*/ fritzbox-1.5.3/notifyosd.cpp0000644000175000017500000001377512467660216015464 0ustar tobiastobias /* * Fritz!Box plugin for VDR * * Copyright (C) 2007-2012 Joachim Wilke * * 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 "liblog++/Log.h" #include "notifyosd.h" #include "setup.h" bool cNotifyOsd::open = false; cNotifyOsd::cNotifyOsd(cFritzEventHandler *event) { font = cFont::GetFont(fontOsd); this->event = event; open = true; osd = NULL; GenerateOsdText(); lastUpdate = time(NULL); } cNotifyOsd::~cNotifyOsd() { DBG("closing OSD"); cStatus::MsgOsdStatusMessage(NULL); open = false; delete osd; } bool cNotifyOsd::GenerateOsdText() { std::vector lines; std::vector ids = event->GetPendingCallIds(); for (std::vector::iterator it = ids.begin(); it < ids.end(); it++) { fritz::sCallInfo callInfo = event->GetCallInfo(*it); if (callInfo.localNumber.length() == 0) continue; cStatus::MsgOsdStatusMessage(event->ComposeCallMessage(*it).c_str()); event->NotificationDone(*it); // 0: separation betwenn multiple calls if (it != ids.begin()) lines.push_back(""); // 1: In- or Outgoing call? + [medium] std::string tmpLine = callInfo.isOutgoing ? tr("Outgoing call") : tr("Incoming call"); tmpLine += " [" + callInfo.medium; if (callInfo.medium.find("ISDN") != std::string::npos) tmpLine += " " + callInfo.localNumber; tmpLine += "]"; lines.push_back(tmpLine); // 2: remote party (only if information available) tmpLine = callInfo.remoteName; if (tmpLine.size() > 0) lines.push_back(tmpLine); } if (lines != this->lines) { DBG("showing OSD with call information, " << (int) lines.size() << " lines"); this->lines = lines; return true; } else return false; } void cNotifyOsd::Show(void) { // osd parameters /* whole screen: (OsdLeft, OsdTop) - (OsdLeft+OsdWidth, OsdTop+OsdHeight) * ------------------------------------------------------ * | | * | | * | | border: * | -(border)------------------------------- | => (zoomed in) noOsd * | | ^ | | ---------------------------- * | | ^ (2) | | | ^ clrBackground * | | <(3)> Incoming call [VoIP 0] <(3)> | | | ^ (1) * | | ^ | | | ----------------------- ... * | | ^ (2) | | | | ^ clrForeground * | | +491234567890 | | | | ^ (1) * | | ^ | | | | ------------------ * | | ^ (2) | | | | | clrBackground * | ---------------------------------------- | | | | * | ^ | ... * | ^ (4) | * ------------------------------------------------------ */ const tColor clrBackground = clrGray50; const tColor clrForeground = clrWhite; const size_t colorDepth = 4; const size_t borderWidth = 2; // (1) const size_t lineBuffer = 10; // (2) const size_t cellspacing = 20; // (3) const size_t verticalOffset = 40; // (4) const size_t numLines = lines.size(); // osd dimensions unsigned int left, top, width, height; // determine osd width width = 0; for (size_t i=0; i < numLines; i++) if (font->Width(lines[i].c_str()) + 2*cellspacing > width) width = font->Width(lines[i].c_str()) + 2*cellspacing; if (width > ((unsigned int) cOsd::OsdWidth())) width = cOsd::OsdWidth(); height = (font->Height() + lineBuffer) * numLines + 4*borderWidth + lineBuffer; // assert alignment while (width % (8/colorDepth) > 0) width++; while (height % (8/colorDepth) > 0) height++; // center osd left = cOsd::OsdLeft() + (cOsd::OsdWidth() - width) / 2; top = cOsd::OsdTop() + cOsd::OsdHeight() - height - verticalOffset; // defines upper left corner of osd if (osd) delete osd; osd = cOsdProvider::NewOsd(left, top); // defines drawing area and color depth tArea Area = { 0, 0, width-1, height-1, colorDepth }; osd->SetAreas(&Area, 1); // draw osd frame, 2px thick osd->DrawRectangle(0, 0, width-1, height-1, clrBackground); osd->DrawRectangle(borderWidth, borderWidth, width-borderWidth-1, height-borderWidth-1, clrForeground); osd->DrawRectangle(2*borderWidth, 2*borderWidth, width-2*borderWidth-1, height-2*borderWidth-1, clrBackground); // draw text lines for (size_t i=0; i < numLines; i++) osd->DrawText(cellspacing, 2*borderWidth + lineBuffer + i*(font->Height() + lineBuffer), lines[i].c_str(), clrForeground, clrBackground, font); osd->Flush(); } eOSState cNotifyOsd::ProcessKey(eKeys Key) { eOSState state = cOsdObject::ProcessKey(Key); if (state == osUnknown) switch (Key) { case kBack: state = osBack; break; case kNone: if (time(NULL) - lastUpdate > Setup.OSDMessageTime) { if (event->GetPendingCallIds().size() == 0) state = osBack; else { if (GenerateOsdText()) { lastUpdate = time(NULL); Show(); } } } default: break; } return state; } fritzbox-1.5.3/README0000644000175000017500000001143012467660216013604 0ustar tobiastobiasThis is a "plugin" for the Video Disk Recorder (VDR). Written by: Joachim Wilke Matthias Becker Project's homepage: https://github.com/jowi24/vdr-fritz Latest version available at: https://github.com/jowi24/vdr-fritz/releases See the file COPYING for license information. ** Note: The HISTORY file may contain information on new features, which are not yet documented in this READE. For up to date information also have a look in that file. ** --<---------------------------------------------------------------------------- Installation: The Fritz plugin is not very different from other plugins for VDR, most of the common installation procedure for plugins, documented in VDR's core documentation applies. However, the following build dependecies are required: - GCrypt library (libgcrypt) - Gnu Common CPP library (libccgnu2, libccext2) --<---------------------------------------------------------------------------- Description: * Call notification The Fritz!Box Plugin connects to the Fritz!Box to inform you about incoming and outgoing calls. As an option, the plugin can automatically mute VDR and pause replays when a call comes in or goes out. To enable this feature you have to dial "#96*5*" once with a telephone connected to the Fritz!Box. This works for all firmware versions >= xx.03.99 You may experience problems when trying to dial "#96*5*" with an ISDN telephone. In such a case try to activate "auto keypad", "dial * and #" or some similar setting in your ISDN telephone. If your ISDN telephone contains no keypad support simply use an analogue telephone instead. If you do not want to be notified by every call, you can specify a list of MSNs you are interested on in the plugin's setup. Max. 22 monitored MSNs are supported. Configuration regarding call notification, muting and pausing is done in the plugin setup menu in VDR. * Phone book support The plugin supports multiple phonebooks. In the plugin's setup, you can choose which phonebooks are used. The order matters with respect to number lookup. When a call comes in, the plugin tries to resolve the number using the first configured phonebook. If that fails, it tries the second one, and so on. Only one phonebook can be shown in the plugin's main menu. It is the first configured phonebook, that has displayable entries. Via VDR's main menu you can browse this phone book and initiate calls out of it via the [OK]-button. This function uses the telephone you have configures in Fritz!Box web interface for this purpose. (In German the menu path is: Telefonie > Anrufliste > Whlhilfe) -> Fritz!Box phone book This accesses the Fritz!Box phonebook stored on the box itself. -> das-oertliche.de phone book This tries to resolve any number via the german website das-oertliche.de. As this is a lookup-only phonebook, it's entries cannot be displayed in the main menu... ;-) -> nummerzoeker phone book / tel.local.ch phone book Same as das-oertliche.de, but for numbers from the Netherlands and Switzerland. * Fritz!Box call list Via the colour buttons you can access three different call lists. Press [Green] to see the history of incoming calls. Use [Yellow] for the list of missed calls. Finally [Blue] gives you an overview on whom you called yourself. Pressing [OK] shows a separate page with details to the selected call. In this menu you can initiate calls, as in the phone book menu, by pressing [Red]. --<---------------------------------------------------------------------------- Command line options: -> Privacy This plugin logs status and debug information to system log (syslog). By default, no sensitive information, like phone numbers or similar are logged. However, for debugging purposes, this can be enabled, by the '-p' parameter. -> Running custom commands on call events Using the '-c cmd' parameter, a command or script 'cmd' can be specified, that is called when an incoming or outgoing call is initiated or finished. The plugin calls cmd with additional parameters depending on the type of event. * On incoming or outgoing calls: - cmd CALL [OUT|IN] * On call connect: - cmd CONNECT * On call disconnect: - cmd DISCONNECT * When all ongoing calls have been finished: - cmd FINISHED A sample script is provided in template/on-call.sh. --<---------------------------------------------------------------------------- Note: This Plugin has been tested with Fritz!Box Fon WLAN 7170 FW 29.04.29. However it may also work for other models or firmware versions. For a detailed list see the plugin's homepage. If you have another model, either positive or negative feedback is appreciated. fritzbox-1.5.3/fritzbox.h0000644000175000017500000000436012467660216014750 0ustar tobiastobias/* * Fritz!Box plugin for VDR * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef FRITZBOX_H_ #define FRITZBOX_H_ #include #include #include "libfritz++/Fonbook.h" #include "libfritz++/Listener.h" #include "libfritz++/CallList.h" #include "fritzeventhandler.h" class cPluginFritzbox : public cPlugin, cThread { friend class cMenuSetupFritzbox; private: cFritzEventHandler *event; std::string mainMenuEntry; bool logPersonalInfo; std::string onCallCmd; bool migratePassword; public: cPluginFritzbox(void); virtual ~cPluginFritzbox(); virtual const char *Version(void); virtual const char *Description(void); virtual const char *CommandLineHelp(void); virtual bool ProcessArgs(int argc, char *argv[]); virtual bool Initialize(void); virtual bool Start(void); virtual void Stop(void); virtual void Housekeeping(void); virtual void MainThreadHook(void); virtual cString Active(void); virtual time_t WakeupTime(void); virtual const char *MainMenuEntry(void); virtual cOsdObject *MainMenuAction(void); virtual cMenuSetupPage *SetupMenu(void); virtual bool SetupParse(const char *Name, const char *Value); virtual bool Service(const char *Id, void *Data = NULL); virtual const char **SVDRPHelpPages(void); virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode); // from cThread: virtual void Action(); // various things static std::string FonbookEntryTypeToName(const fritz::FonbookEntry::eType type, bool longName = false); }; #endif /*FRITZBOX_H_*/ fritzbox-1.5.3/setup.cpp0000644000175000017500000004637612467660216014611 0ustar tobiastobias/* * Fritz!Box plugin for VDR * * Copyright (C) 2007-2012 Joachim Wilke * * 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 "setup.h" #include "menu.h" #include "libfritz++/FonbookManager.h" #include "libfritz++/CallList.h" #include "libfritz++/Listener.h" #include "libfritz++/Config.h" #include "liblog++/Log.h" #include #include #if VDRVERSNUM < 10509 #define trVDR(s) tr(s) #endif sFritzboxConfig fritzboxConfig; // possible characters for Fritz!Box password, according to web interface const char *PasswordChars = "abcdefghijklmnopqrstuvwxyz0123456789 !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; std::string cMenuSetupFritzbox::StoreMsn(){ std::vector::iterator it; std::string msnLine; for (it = fritzboxConfig.msn.begin(); it < fritzboxConfig.msn.end(); it++){ msnLine += *it; msnLine += ' '; } return msnLine; } std::string cMenuSetupFritzbox::StoreFonbooks() { std::vector::iterator it; std::string fbLine; for (it = fritzboxConfig.selectedFonbookIDs.begin(); it < fritzboxConfig.selectedFonbookIDs.end(); it++){ fbLine += *it; fbLine += ' '; } return fbLine; } void cMenuSetupFritzbox::Setup(void) { // save current position int current = Current(); // clear entries, if any Clear(); int ret; //possible values for "React on calls" ret = asprintf(&directions[fritzboxConfig.DIRECTION_ANY], tr("any")); if (ret <= 0) { ERR("Error allocating linebuffer for cOsdItem."); return; } ret = asprintf(&directions[fritzboxConfig.DIRECTION_IN], tr("only incoming")); if (ret <= 0) { ERR("Error allocating linebuffer for cOsdItem."); return; } ret = asprintf(&directions[fritzboxConfig.DIRECTION_OUT], tr("only outgoing")); if (ret <= 0) { ERR("Error allocating linebuffer for cOsdItem."); return; } //possible values for "Default Menu" ret = asprintf(&menus[cMenuFritzbox::FONBUCH], tr("PB")); if (ret <= 0) { ERR("Error allocating linebuffer for cOsdItem."); return; } ret = asprintf(&menus[cMenuFritzbox::IN], tr("incoming")); if (ret <= 0) { ERR("Error allocating linebuffer for cOsdItem."); return; } ret = asprintf(&menus[cMenuFritzbox::OUT], tr("outgoing")); if (ret <= 0) { ERR("Error allocating linebuffer for cOsdItem."); return; } ret = asprintf(&menus[cMenuFritzbox::MISSED], tr("missed")); if (ret <= 0) { ERR("Error allocating linebuffer for cOsdItem."); return; } // build up setup menu Add(new cMenuEditStrItem (tr("Fritz!Box URL"), url, MaxFileName, tr(FileNameChars))); Add(new cMenuEditStrItem (tr("Username"), username, MaxFileName, tr(FileNameChars))); Add(new cMenuEditStrItem (tr("Password"), password, MaxFileName, PasswordChars)); Add(new cMenuEditStrItem (tr("Country code"), countryCode, 5, "0123456789")); Add(new cMenuEditStrItem (tr("Region code"), regionCode, 10, "0123456789")); Add(new cMenuEditStraItem(tr("React on calls"), &reactOnDirection, 3, directions )); Add(new cMenuEditBoolItem(tr("Mute on call"), &muteOnCall, trVDR("no"), trVDR("yes"))); if (muteOnCall) { Add(new cMenuEditBoolItem(tr("Mute only after connect"), &muteAfterConnect, trVDR("no"), trVDR("yes"))); Add(new cMenuEditIntItem(tr("Decrease volume by [1..100%]"), &muteVolumeLevel, 1, 100)); } Add(new cMenuEditBoolItem(tr("Pause on call"), &pauseOnCall, trVDR("no"), trVDR("yes"))); if (pauseOnCall) { Add(new cMenuEditBoolItem(tr("Pause live tv"), &pauseLive, trVDR("no"), trVDR("yes"))); Add(new cMenuEditBoolItem(tr("Resume after call"), &resumeAfterCall, trVDR("no"), trVDR("yes"))); } Add(new cMenuEditBoolItem(tr("Show calls"), &showNumber, trVDR("no"), trVDR("yes"))); Add(new cMenuEditBoolItem(tr("Show detailed call information"), &useNotifyOsd, trVDR("no"), trVDR("yes"))); Add(new cMenuEditBoolItem(tr("Detailed call lists"), &showNumberInCallList, trVDR("no"), trVDR("yes"))); Add(new cMenuEditBoolItem(tr("Group call lists by date"), &showDaySeparator, trVDR("no"), trVDR("yes"))); Add(new cMenuEditBoolItem(tr("Hide main menu entry"), &hideMainMenu, trVDR("no"), trVDR("yes"))); Add(new cMenuEditStraItem(tr("Default menu"), &defaultMenu, 4, menus )); Add(new cOsdItem (tr("Setup phonebooks to use..."), osUser1 )); Add(new cMenuEditBoolItem(tr("Restrict monitor to certain extensions"), &msnFilter, trVDR("no"), trVDR("yes"))); if (msnFilter) { Add(new cMenuEditIntItem (tr("Number of monitored extensions"), &msnCount, 0, MAX_MSN_COUNT)); for (int p = 0; p < msnCount; p++) Add(new cMenuEditStrItem(tr("Extension"), msn[p], MaxFileName, "1234567890")); } SetHelp(tr("Reload")); // restore current position SetCurrent(Get(current)); // refresh display Display(); } eOSState cMenuSetupFritzbox::ProcessKey(eKeys Key) { eOSState state = cMenuSetupPage::ProcessKey(Key); if (state == osUser1) { return AddSubMenu(new cMenuSetupFritzboxFonbooks(&selectedFonbookIDs)); } if (Key != kNone) { if (msnFilter != msnFilterBefore) { // deactivate MSN Filter if (msnFilter == 0) { msnCount = 0; } else { msnCount = 1; } msnFilterBefore = msnFilter; } if (msnCount != msnCountBefore) { // add new MSN elements if (msnCount > msnCountBefore) { for (int i=msnCountBefore; imsnCount; i--) free(msn[i-1]); } Setup(); msnCountBefore = msnCount; } if (pauseOnCall != pauseOnCallBefore) { Setup(); pauseOnCallBefore = pauseOnCall; } if (muteOnCall != muteOnCallBefore) { Setup(); muteOnCallBefore = muteOnCall; } } if (state == osUnknown) { switch (Key) { case kRed: fritz::FonbookManager::GetFonbook()->reload(); Skins.QueueMessage(mtInfo, tr("Retrieving phone book")); state = osContinue; break; default: break; } } return state; } void cMenuSetupFritzbox::Store(void) { fritzbox->Cancel(); // stop any pending initialization fritz::Config::Shutdown(); // clean up before changing the configuration fritzboxConfig.url = url; fritzboxConfig.username = username; int i = 0; // only store the password if it was changed while (password[i]) { if (password[i] != '*') { fritzboxConfig.password = password; break; } i++; } // accept empty password if (password[0] == 0) fritzboxConfig.password = ""; // fritzboxConfig.reactOnDirection = reactOnDirection; fritzboxConfig.muteOnCall = muteOnCall; fritzboxConfig.muteAfterConnect = muteAfterConnect; fritzboxConfig.muteVolumeLevel = muteVolumeLevel; fritzboxConfig.pauseOnCall = pauseOnCall; fritzboxConfig.pauseLive = pauseLive; fritzboxConfig.resumeAfterCall = resumeAfterCall; fritzboxConfig.showNumber = showNumber; fritzboxConfig.useNotifyOsd = useNotifyOsd; fritzboxConfig.showNumberInCallList = showNumberInCallList; fritzboxConfig.showDaySeparator = showDaySeparator; fritzboxConfig.hideMainMenu = hideMainMenu; fritzboxConfig.defaultMenu = defaultMenu; fritzboxConfig.msn.clear(); for (int i=0; i < msnCount; i++) { std::string s = msn[i]; fritzboxConfig.msn.push_back(s); } fritzboxConfig.selectedFonbookIDs = selectedFonbookIDs; fritzboxConfig.countryCode = countryCode; fritzboxConfig.regionCode = regionCode; // remove any leading zeros from countryCode and regionCode, while (!fritzboxConfig.countryCode.empty() && fritzboxConfig.countryCode[0] == '0') fritzboxConfig.countryCode = fritzboxConfig.countryCode.substr(1); while (!fritzboxConfig.regionCode.empty() && fritzboxConfig.regionCode[0] == '0') fritzboxConfig.regionCode = fritzboxConfig.regionCode.substr(1); ((cThread *)fritzbox)->Start(); // re-read configuration, notify libfritz++ about changes SetupStore("Url", url); SetupStore("Username", username); SetupStore("Password", ""); // has been migrated to EncodedPassword SetupStore("EncodedPassword", fritzboxConfig.string2hex(fritzboxConfig.password).c_str()); SetupStore("ReactOnDirection", reactOnDirection); SetupStore("MuteOnCall", muteOnCall); SetupStore("MuteAfterConnect", muteAfterConnect); SetupStore("MuteVolumeLevel", muteVolumeLevel); SetupStore("PauseOnCall", pauseOnCall); SetupStore("PauseLive", pauseLive); SetupStore("ResumeAfterCall", resumeAfterCall); SetupStore("ShowNumber", showNumber); SetupStore("UseNotifyOsd", useNotifyOsd); SetupStore("ShowNumberInCallList", showNumberInCallList); SetupStore("ShowDaySeparator", showDaySeparator); SetupStore("HideMainMenu", hideMainMenu); SetupStore("DefaultMenu", defaultMenu); SetupStore("MsnList", StoreMsn().c_str()); SetupStore("Fonbooks", StoreFonbooks().c_str()); SetupStore("CountryCode", fritzboxConfig.countryCode.c_str()); SetupStore("RegionCode", fritzboxConfig.regionCode.c_str()); } cMenuSetupFritzbox::cMenuSetupFritzbox(cPluginFritzbox *fritzbox) { this->fritzbox = fritzbox; // copy setup to temporary parameters msn = (char **) malloc(MAX_MSN_COUNT * sizeof(char *)); url = strdup(fritzboxConfig.url.c_str()); username = strdup(fritzboxConfig.username.c_str()); password = strdup(fritzboxConfig.password.c_str()); // the original password is not visible in the setup page // every single character of the password is displayed as "*" for (unsigned int i = 0; i < fritzboxConfig.password.length(); i++) { password[i] = '*'; } reactOnDirection = fritzboxConfig.reactOnDirection; muteOnCall = fritzboxConfig.muteOnCall; muteOnCallBefore = muteOnCall; muteAfterConnect = fritzboxConfig.muteAfterConnect; muteVolumeLevel = fritzboxConfig.muteVolumeLevel; pauseOnCall = fritzboxConfig.pauseOnCall; pauseOnCallBefore = pauseOnCall; pauseLive = fritzboxConfig.pauseLive; resumeAfterCall = fritzboxConfig.resumeAfterCall; showNumber = fritzboxConfig.showNumber; useNotifyOsd = fritzboxConfig.useNotifyOsd; showNumberInCallList = fritzboxConfig.showNumberInCallList; showDaySeparator = fritzboxConfig.showDaySeparator; hideMainMenu = fritzboxConfig.hideMainMenu; defaultMenu = fritzboxConfig.defaultMenu; msnCount = fritzboxConfig.msn.size(); msnCountBefore = msnCount; // needed for menu refresh msnFilter = fritzboxConfig.msn.empty() ? 0 : 1; msnFilterBefore = msnFilter; selectedFonbookIDs = fritzboxConfig.selectedFonbookIDs; countryCode = strdup(fritzboxConfig.countryCode.c_str()); regionCode = strdup(fritzboxConfig.regionCode.c_str()); size_t p = 0; for(std::vector::iterator itStr = fritzboxConfig.msn.begin(); itStr < fritzboxConfig.msn.end(); itStr++) { msn[p] = (char *) malloc(MaxFileName * sizeof(char)); snprintf(msn[p], MaxFileName, "%s", itStr->c_str()); p++; } // build up menu entries Setup(); } cMenuSetupFritzbox::~cMenuSetupFritzbox() { // free up malloced space from constructor free(url); free(username); free(password); for (int i=0; i *selectedFonbookIDs) :cOsdMenu(tr("Setup phonebooks to use"), 4) { fonbooks = fritz::FonbookManager::GetFonbookManager()->getFonbooks(); this->selectedFonbookIDs = selectedFonbookIDs; // copy setup to temporary parameters numberOfSelectedFonbooks = selectedFonbookIDs->size(); selectedFonbookPos = (int **) malloc(fonbooks->size() * sizeof(int *)); fonbookTitles = (char **) malloc(fonbooks->size() * sizeof(char *)); for (size_t i=0; isize(); i++) { int ret = asprintf(&fonbookTitles[i], "%s", tr((*fonbooks)[i]->getTitle().c_str())); if (ret <= 0) { ERR("Error allocating linebuffer for cOsdItem."); } selectedFonbookPos[i] = (int *) malloc(sizeof(int)); } // build up menu entries SetHelp(tr("More"), tr("Less"), NULL, NULL); Setup(); } cMenuSetupFritzboxFonbooks::~cMenuSetupFritzboxFonbooks() { // free up malloced space from constructor for (size_t i=0; isize(); i++) { free(fonbookTitles[i]); free(selectedFonbookPos[i]); } free(fonbookTitles); free(selectedFonbookPos); } void cMenuSetupFritzboxFonbooks::Setup(void) { size_t fbCount = fonbooks->size(); // save current position int current = Current(); // clear entries, if any Clear(); // build up setup menu for (size_t i=0; isize()) while (pos < fbCount && (*fonbooks)[pos]->getTechId().compare((*selectedFonbookIDs)[i]) != 0) pos++; *(selectedFonbookPos[i]) = (int) pos; Add(new cMenuEditStraItem(numberStr, selectedFonbookPos[i], fbCount, fonbookTitles)); } // restore current position SetCurrent(Get(current)); // refresh display Display(); } eOSState cMenuSetupFritzboxFonbooks::ProcessKey(eKeys Key) { eOSState state = cOsdMenu::ProcessKey(Key); if (Key != kNone) { switch (Key) { case kRed: if (numberOfSelectedFonbooks < fonbooks->size()) { numberOfSelectedFonbooks++; Setup(); } state = osContinue; break; case kGreen: if (numberOfSelectedFonbooks > 0) { numberOfSelectedFonbooks--; Setup(); } state = osContinue; break; case kOk: selectedFonbookIDs->clear(); for (size_t i=0; igetTechId(); selectedFonbookIDs->push_back(s); } state = osBack; default: break; } } return state; } sFritzboxConfig::sFritzboxConfig() { configDir = ""; pluginName = ""; lang = ""; url = "fritz.box"; username = ""; password = ""; countryCode = "49"; regionCode = ""; reactOnDirection = DIRECTION_IN; muteOnCall = 0; muteAfterConnect = 0; muteVolumeLevel = 100; pauseOnCall = 0; pauseLive = 0; resumeAfterCall = 1; showNumber = 1; useNotifyOsd = 0; showNumberInCallList = 0; lastKnownMissedCall = 0; showDaySeparator = 1; hideMainMenu = 0; defaultMenu = cMenuFritzbox::FONBUCH; selectedFonbookIDs.push_back("FRITZ"); activeFonbookID = "FRITZ"; } bool sFritzboxConfig::SetupParseMsn(const char *value){ std::string currentMsn; unsigned int pos = 0; // walk through the complete value-line while (value[pos] != 0) { currentMsn.erase(); // stop at each or EOL while (value[pos] != ' ' && value[pos] != 0) { currentMsn += value[pos]; pos++; } msn.push_back(currentMsn); // at a we have to advance to the next MSN if (value[pos] != 0) pos++; } return true; } bool sFritzboxConfig::SetupParseFonbooks(const char *value){ std::string currentFb; unsigned int pos = 0; selectedFonbookIDs.clear(); // walk through the complete value-line while (value[pos] != 0) { currentFb.erase(); // stop at each or EOL while (value[pos] != ' ' && value[pos] != 0) { currentFb += value[pos]; pos++; } selectedFonbookIDs.push_back(currentFb); // at a we have to advance to the next MSN if (value[pos] != 0) pos++; } return true; } bool sFritzboxConfig::SetupParse(const char *name, const char *value) { if (!strcasecmp(name, "Url")) url = value; else if (!strcasecmp(name, "Username")) username = value; else if (!strcasecmp(name, "Password")) password = value; else if (!strcasecmp(name, "EncodedPassword")) password = hex2string(value); else if (!strcasecmp(name, "ReactOnDirection")) reactOnDirection = atoi(value); else if (!strcasecmp(name, "MuteOnCall")) muteOnCall = atoi(value); else if (!strcasecmp(name, "MuteAfterConnect")) muteAfterConnect = atoi(value); else if (!strcasecmp(name, "MuteVolumeLevel")) muteVolumeLevel = atoi(value); else if (!strcasecmp(name, "PauseOnCall")) pauseOnCall = atoi(value); else if (!strcasecmp(name, "PauseLive")) pauseLive = atoi(value); else if (!strcasecmp(name, "ResumeAfterCall")) resumeAfterCall = atoi(value); else if (!strcasecmp(name, "ShowNumber")) showNumber = atoi(value); else if (!strcasecmp(name, "UseNotifyOsd")) useNotifyOsd = atoi(value); else if (!strcasecmp(name, "ShowNumberInCallList")) showNumberInCallList = atoi(value); else if (!strcasecmp(name, "LastKnownMissedCall")) lastKnownMissedCall = atoi(value); else if (!strcasecmp(name, "ShowDaySeparator")) showDaySeparator = atoi(value); else if (!strcasecmp(name, "HideMainMenu")) hideMainMenu = atoi(value); else if (!strcasecmp(name, "DefaultMenu")) defaultMenu = atoi(value); else if (!strcasecmp(name, "ActiveFonbook")) activeFonbookID = value; else if (!strcasecmp(name, "MsnList")) return SetupParseMsn(value); else if (!strcasecmp(name, "Fonbooks")) return SetupParseFonbooks(value); else if (!strcasecmp(name, "CountryCode")) countryCode = value; else if (!strcasecmp(name, "RegionCode")) regionCode = value; else return false; return true; } std::string sFritzboxConfig::string2hex(std::string input) { std::stringstream output; for (std::string::iterator it = input.begin(); it < input.end(); it++) output << std::hex << static_cast(*it); return output.str(); } std::string sFritzboxConfig::hex2string(std::string input) { std::stringstream output; for (std::string::iterator it = input.begin(); it < input.end(); it += 2) { std::stringstream buffer; int value; buffer << it[0] << it[1] ; buffer >> std::hex >> value; output << static_cast(value); } return output.str(); } fritzbox-1.5.3/fritzeventhandler.cpp0000644000175000017500000002257612467660216017203 0ustar tobiastobias/* * Fritz!Box plugin for VDR * * Copyright (C) 2007-2012 Joachim Wilke * * 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 #include #include "libfritz++/Fonbook.h" #include "liblog++/Log.h" #include "setup.h" #include "fritzeventhandler.h" #include "notifyosd.h" cFritzEventHandler::cFritzEventHandler(std::string onCallCmd) { muted = false; volumeLevel = 0; paused = false; getCallInfoCalled = false; this->onCallCmd = onCallCmd; } cFritzEventHandler::~cFritzEventHandler() { } fritz::sCallInfo cFritzEventHandler::GetCallInfo(int connId) { getCallInfoCalled = true; fritz::sCallInfo callInfo; mutex.Lock(); if (connections.find(connId) != connections.end()) { sConnection &connection = connections[connId]; if (connection.callInfo) callInfo = *(connection.callInfo); } mutex.Unlock(); return callInfo; } // returns a vector of call ids of calls pending for display std::vector cFritzEventHandler::GetPendingCallIds() { std::vector ids; mutex.Lock(); for (std::map::iterator it = connections.begin(); it != connections.end(); it++) { if ((static_cast((*it).second).displayed == false) || (static_cast((*it).second).state == sConnection::RINGING )) { ids.push_back((*it).first); } } mutex.Unlock(); return ids; } void cFritzEventHandler::NotificationDone(int connId) { mutex.Lock(); sConnection &connection = connections[connId]; connection.displayed = true; if (connection.state == sConnection::IDLE) { delete connection.callInfo; connection.callInfo = NULL; connections.erase(connId); } mutex.Unlock(); } std::string cFritzEventHandler::ComposeCallMessage(int connId) { std::string rMsg; int ret; // medium gets MSN appended if ISDN is used mutex.Lock(); fritz::sCallInfo *callInfo = connections[connId].callInfo; std::string medium = callInfo->medium; if (callInfo->medium.find("ISDN") != std::string::npos) medium += " " + callInfo->localNumber; char *msg; // compose the message to be displayed if (callInfo->isOutgoing == true) { ret = asprintf(&msg, tr("Calling %s [%s]"), callInfo->remoteName.c_str(), medium.c_str()); if (ret <= 0) { mutex.Unlock(); return rMsg; } } else { if (callInfo->remoteNumber.size() == 0) { // unknown caller ret = asprintf(&msg, "%s [%s]", tr("Call"), medium.c_str()); if (ret <= 0) { mutex.Unlock(); return rMsg; } } else { // known caller ret = asprintf(&msg, "%s %s [%s]", tr("Call from"), callInfo->remoteName.c_str(), medium.c_str()); if (ret <= 0) { mutex.Unlock(); return rMsg; } } } mutex.Unlock(); rMsg = msg; free(msg); return rMsg; } bool cFritzEventHandler::CareForCall(bool outgoing) { if (fritzboxConfig.reactOnDirection != fritzboxConfig.DIRECTION_ANY) { if (outgoing && fritzboxConfig.reactOnDirection != fritzboxConfig.DIRECTION_OUT) return false; if (!outgoing && fritzboxConfig.reactOnDirection != fritzboxConfig.DIRECTION_IN) return false; } return true; } void cFritzEventHandler::handleCall(bool outgoing, int connId, std::string remoteNumber, std::string remoteName, fritz::FonbookEntry::eType remoteType, std::string localParty, std::string medium, std::string mediumName) { if (!CareForCall(outgoing)) return; bool currPlay, currForw; int currSpeed; cControl *control = cControl::Control(); if (control) { control->GetReplayMode(currPlay, currForw, currSpeed); } // check for muting if (fritzboxConfig.muteOnCall && !fritzboxConfig.muteAfterConnect && !cDevice::PrimaryDevice()->IsMute()) { INF((outgoing ? "outgoing": "incoming") << " call, muting."); DoMute(); } // check for pausing replay or live tv if (fritzboxConfig.pauseOnCall && !paused && ((control && currPlay) || (fritzboxConfig.pauseLive && !ShutdownHandler.IsUserInactive()))) { INF((outgoing ? "outgoing": "incoming") << " call, pressing kPause."); cRemote::Put(kPause); paused = true; } if (medium.compare(mediumName) == 0) { if (mediumName.find("SIP") != std::string::npos) mediumName.replace(0, 3, "VoIP "); if (mediumName.find("POTS") != std::string::npos) mediumName = tr("POTS"); } if (fritzboxConfig.showNumber) { // save the message into "message", MainThreadHook or MainMenuAction will take care of it // displayedConnId = connId; #ifdef DO_NOT_SET // trigger translation of string coming from the Fritz!Box - do not compile! trNOOP("ISDN") trNOOP("VoIP") #endif fritz::sCallInfo *callInfo = new fritz::sCallInfo(); callInfo->isOutgoing = outgoing; callInfo->remoteNumber = remoteNumber; callInfo->remoteName = remoteName; if (cPluginFritzbox::FonbookEntryTypeToName(remoteType).size() > 0) { callInfo->remoteName += " "; callInfo->remoteName += cPluginFritzbox::FonbookEntryTypeToName( remoteType); } callInfo->localNumber = localParty; callInfo->medium = mediumName; sConnection connection; connection.displayed = false; connection.state = sConnection::RINGING; connection.callInfo = callInfo; mutex.Lock(); connections.insert(std::pair(connId, connection)); mutex.Unlock(); // trigger notification using own osd if (fritzboxConfig.useNotifyOsd && !cNotifyOsd::isOpen()) { DBG("triggering NotifyOsd"); cRemote::CallPlugin(fritzboxConfig.pluginName.c_str()); } } if (onCallCmd.size()) Exec(std::stringstream().flush() << onCallCmd << " CALL " << (outgoing ? "OUT " : "IN ") << connId << " " << remoteNumber << " \"" << remoteName << "\" " << localParty << " " << medium << " \"" << mediumName << "\""); } void cFritzEventHandler::handleConnect(int connId) { if (connections.find(connId) == connections.end()) return; bool outgoing = connections[connId].callInfo->isOutgoing; if (!CareForCall(outgoing)) return; if (fritzboxConfig.muteOnCall && fritzboxConfig.muteAfterConnect && !cDevice::PrimaryDevice()->IsMute()) { INF("muting connected call"); DoMute(); } mutex.Lock(); sConnection &connection = connections[connId]; connection.state = sConnection::ACTIVE; mutex.Unlock(); if (onCallCmd.size()) Exec(std::stringstream().flush() << onCallCmd << " CONNECT " << connId); } void cFritzEventHandler::handleDisconnect(int connId, std::string duration) { if (connections.find(connId) == connections.end()) return; bool outgoing = connections[connId].callInfo->isOutgoing; if (!CareForCall(outgoing)) return; bool currPlay, currForw; int currSpeed; cControl *control = cControl::Control(); if (control) { control->GetReplayMode(currPlay, currForw, currSpeed); } // stop call notification mutex.Lock(); sConnection &connection = connections[connId]; connection.state = sConnection::IDLE; if (connection.displayed) { if (connection.callInfo) { delete connection.callInfo; connection.callInfo = NULL; } // remove current connection from list connections.erase(connId); } bool activeCallsPending = false; for (std::map::iterator it = connections.begin(); it != connections.end(); it++) { if (static_cast((*it).second).state != sConnection::IDLE) activeCallsPending = true; } mutex.Unlock(); // unmute, if applicable if (!activeCallsPending && muted) { INF("Finished all calls, unmuting."); DoUnmute(); } // resume, if applicable if (!activeCallsPending && paused) { if (fritzboxConfig.resumeAfterCall && control && currPlay == false) { INF("Finished all calls, pressing kPlay."); cRemote::Put(kPlay); // this is an ugly workaround, but it should work cRemote::Put(kPlay); } paused = false; } if (onCallCmd.size()) { Exec(std::stringstream().flush() << onCallCmd << " DISCONNECT " << connId << " " << duration); if (!activeCallsPending) Exec(std::stringstream().flush() << onCallCmd << " FINISHED"); } } void cFritzEventHandler::Exec(const std::ostream & cmd) const { const std::stringstream &sCmd = static_cast(cmd); SystemExec(sCmd.str().c_str(), false); } void cFritzEventHandler::DoMute() { if (fritzboxConfig.muteVolumeLevel < 100) { volumeLevel = cDevice::PrimaryDevice()->CurrentVolume(); cDevice::PrimaryDevice()->SetVolume(volumeLevel * (100 - fritzboxConfig.muteVolumeLevel) / 100, true); } else if (!cDevice::PrimaryDevice()->IsMute()) cDevice::PrimaryDevice()->ToggleMute(); muted = true; } void cFritzEventHandler::DoUnmute() { if (fritzboxConfig.muteVolumeLevel < 100) { cDevice::PrimaryDevice()->SetVolume(volumeLevel, true); } else if (cDevice::PrimaryDevice()->IsMute()) cDevice::PrimaryDevice()->ToggleMute(); muted = false; } fritzbox-1.5.3/menu.cpp0000644000175000017500000003072712467660216014406 0ustar tobiastobias/* * Fritz!Box plugin for VDR * * Copyright (C) 2007-2012 Joachim Wilke * * 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 "liblog++/Log.h" #include "libfritz++/FonbookManager.h" #include "libfritz++/FritzClient.h" #include "menu.h" #include "setup.h" cMenuFritzbox::cMenuFritzbox(cPluginFritzbox *plugin) :cOsdMenu("Fritz!Box", 1) // just dummy values { this->plugin = plugin; switch(fritzboxConfig.defaultMenu) { case FONBUCH: DisplayFonbuch(); break; case IN: case OUT: case MISSED: DisplayCalls((fritz::CallEntry::eCallType)(fritzboxConfig.defaultMenu)); break; } } cMenuFritzbox::~cMenuFritzbox() { } eOSState cMenuFritzbox::ProcessKey (eKeys Key) { fritz::Fonbook *fonbook = fritz::FonbookManager::GetFonbook(); fritz::CallList *callList = fritz::CallList::GetCallList(); eOSState state = cOsdMenu::ProcessKey(Key); fritz::CallEntry *ce = NULL; cKeyOsdItem* currentKeyItem = dynamic_cast(this->Get(Current())); if (state == osUnknown) { switch (Key) { case kOk: switch (currentMode) { case FONBUCH: if (currentKeyItem && fonbook->isDisplayable() && fonbook->isInitialized()) state = AddSubMenu(new cMenuFonbuchDetail(fonbook->retrieveFonbookEntry(currentKeyItem->key))); break; case IN: if (currentKeyItem) ce = callList->retrieveEntry(fritz::CallEntry::INCOMING, currentKeyItem->key); if (ce) state = AddSubMenu(new cMenuCallDetail(ce, currentMode, fonbook)); break; case OUT: if (currentKeyItem) ce = callList->retrieveEntry(fritz::CallEntry::OUTGOING, currentKeyItem->key); if (ce) state = AddSubMenu(new cMenuCallDetail(ce, currentMode, fonbook)); break; case MISSED: if (currentKeyItem) ce = callList->retrieveEntry(fritz::CallEntry::MISSED, currentKeyItem->key); if (ce) state = AddSubMenu(new cMenuCallDetail(ce, currentMode, fonbook)); break; } break; case kRed: if (currentMode == FONBUCH) { fritz::FonbookManager::GetFonbookManager()->nextFonbook(); } DisplayFonbuch(); state = osContinue; break; case kGreen: case kYellow: case kBlue: DisplayCalls((fritz::CallEntry::eCallType)(Key - kRed)); state = osContinue; break; default: break; } } return state; } void cMenuFritzbox::DisplayFonbuch() { unsigned int nameWidth = 0; fritz::Fonbook *fonbook = fritz::FonbookManager::GetFonbook(); currentMode = FONBUCH; SetTitle(tr(fonbook->getTitle().c_str())); Clear(); if (fonbook->isInitialized() == false) { Add(new cOsdItem(tr("This phonebook is not yet available."), osUnknown, false)); Add(new cOsdItem(tr("You may need to wait some minutes,"), osUnknown, false)); Add(new cOsdItem(tr("otherwise there may be a network problem."), osUnknown, false)); } else if (fonbook->isDisplayable() == false) { Add(new cOsdItem(tr("This phonebook is not displayable"), osUnknown, false)); } else { for (size_t pos=0; pos < fonbook->getFonbookSize(); pos++) { const fritz::FonbookEntry *fe = fonbook->retrieveFonbookEntry(pos); if (fe) { bool firstEntry = true; for (size_t numberPos = 0; numberPos < fe->getSize(); numberPos++) { if (fe->getNumber(numberPos).empty()) continue; // build the menu entries char *line; int ret = asprintf(&line,"%s\t%s\t%s", !firstEntry ? "" : fe->getName().c_str(), cPluginFritzbox::FonbookEntryTypeToName(fe->getType(numberPos)).c_str(), fe->getNumber(numberPos).c_str()); if (ret <= 0) { ERR("Error allocating line buffer for cOsdItem."); continue; } if (fe->getName().length() > nameWidth) nameWidth = fe->getName().length(); Add(new cKeyOsdItem(line, osUnknown, true, pos)); firstEntry = false; } } } } SetCols(nameWidth+1, 2); SetHelp(tr("> PB"), "|<-", "?|<-", "|->"); Display(); } void cMenuFritzbox::DisplayCalls(fritz::CallEntry::eCallType ct) { currentMode = (mode) ct; std::string title=tr("Fritz!Box call list"); fritz::CallList *callList = fritz::CallList::GetCallList(); Clear(); title += " ("; switch(ct) { case fritz::CallEntry::INCOMING: title += tr("incoming"); break; case fritz::CallEntry::MISSED: title += tr("missed"); if (fritzboxConfig.lastKnownMissedCall != callList->getLastMissedCall()) { fritzboxConfig.lastKnownMissedCall = callList->getLastMissedCall(); // save this change as soon as possible, that it is not lost if VDR crashes later on plugin->SetupStore("LastKnownMissedCall", fritzboxConfig.lastKnownMissedCall); Setup.Save(); } break; case fritz::CallEntry::OUTGOING: title += tr("outgoing"); break; case fritz::CallEntry::ALL: // just a "meta-value", the plugin does not use it break; } title += ")"; unsigned int destWidth = 0; std::string oldDate; if (callList->isValid()) { for (unsigned int pos=0; pos < callList->getSize(ct); pos++) { fritz::CallEntry *ce = callList->retrieveEntry(ct, pos); // build the menu entries if ( !ce->matchesFilter()) continue; // show remote name, remote number or "unknown" std::string sLine = ce->remoteName.length() > 0 ? ce->remoteName : ce->remoteNumber.length() > 0 ? ce->remoteNumber : tr("unknown"); // determine destWidth if (destWidth < sLine.length()) destWidth = sLine.length(); // show local number if enabled if (fritzboxConfig.showNumberInCallList == true) { sLine += "\t" + ce->localNumber; } sLine = ce->time + "\t" + sLine; if (fritzboxConfig.showDaySeparator == false) { sLine = ce->date + " " + sLine; } else { if (ce->date.compare(oldDate) != 0) { oldDate = ce->date; Add(new cKeyOsdItem(ce->date.c_str(), osUnknown, false, pos)); } } Add(new cKeyOsdItem(sLine.c_str(), osUnknown, true, pos)); } // dynamic column layout // ugly dirty hack for maybe better column setup, // VDR shouldn't set width in chars when using a proportional font :-( destWidth++; if (fritzboxConfig.showDaySeparator == false) SetCols(14, destWidth); else SetCols(6, destWidth); } else { Add(new cOsdItem(tr("The call list is not yet available."), osUnknown, false)); Add(new cOsdItem(tr("You may need to wait some minutes,"), osUnknown, false)); Add(new cOsdItem(tr("otherwise there may be a network problem."), osUnknown, false)); } SetTitle(title.c_str()); //TRANSLATORS: this is the short form of "phone book" SetHelp(tr("PB"), "|<-", "?|<-", "|->"); Display(); } // cMenuCallDetail ************************************************************ cMenuCallDetail::cMenuCallDetail(fritz::CallEntry *ce, cMenuFritzbox::mode mode, fritz::Fonbook *fonbook) :cOsdMenu(tr("Call details"), 15) { this->ce = ce; if (ce->remoteNumber.size() > 0 && ce->remoteName.compare(ce->remoteNumber) == 0) { fritz::Fonbook::sResolveResult rr = fonbook->resolveToName(ce->remoteNumber); ce->remoteName = rr.name; if (cPluginFritzbox::FonbookEntryTypeToName(rr.type).size() > 0) { ce->remoteName += " "; ce->remoteName += tr(cPluginFritzbox::FonbookEntryTypeToName(rr.type).c_str()); } } std::ostringstream text; text << tr("Date") << "\t" << ce->date << "\n" << tr("Time") << "\t" << ce->time << "\n" << tr("Duration") << "\t" << (mode == cMenuFritzbox::MISSED ? tr("call was not accepted") : ce->duration) << "\n" << tr("Extension") << "\t" << ce->localName << (ce->localName.size() > 0 ? " (" : "") << ce->localNumber << (ce->localName.size() > 0 ? ")" : "") << "\n" << (mode == cMenuFritzbox::OUT ? tr("Callee") : tr("Caller")) << "\t" << ((ce->remoteName.compare(ce->remoteNumber) != 0) ? (ce->remoteName + "\n\t") : "" ) << (ce->remoteNumber.size() > 0 ? ce->remoteNumber : tr("unknown")) << "\n"; //TRANSLATORS: these are labels for color keys in the CallDetails menu SetHelp(tr("Button$Call")/*, tr("Button$To PB")*/); // TODO: implement feature SetText(text.str()); Display(); } void cMenuCallDetail::SetText(std::string text) { std::string::size_type pos = 0; std::string::size_type npos = text.find('\n', pos); do { Add(new cOsdItem(text.substr(pos, npos-pos).c_str(), osUnknown, false)); pos = npos +1; npos = text.find('\n', pos); } while (npos != std::string::npos); } eOSState cMenuCallDetail::ProcessKey (eKeys Key) { eOSState state = cOsdMenu::ProcessKey(Key); if (state == osUnknown) { switch (Key) { case kRed: // initiate a call if (ce->remoteNumber.empty()) { Skins.Message(mtError, tr("No number to call")); } else { fritz::FritzClient fc; if (fc.initCall(ce->remoteNumber)) Skins.Message(mtInfo, tr("Pick up your phone now")); else Skins.Message(mtError, tr("Error while initiating call")); } state = osContinue; break; // case kGreen: // // add to active phonebook // if (ce->remoteNumber.empty()) // Skins.Message(mtError, tr("No number to add")); // else // { // fritz::FonbookEntry fe(ce->remoteName); // fe.AddNumber(ce->remoteNumber); // fritz::FonbookManager::GetFonbookManager()->AddFonbookEntry(fe); // Skins.Message(mtInfo, "Added new entry to phone book"); // } // state = osContinue; // break; case kOk: state = osBack; break; default: break; } } return state; } // cMenuFonbuchDetail ********************************************************* cMenuFonbuchDetail::cMenuFonbuchDetail(const fritz::FonbookEntry *fe) :cOsdMenu(tr("Phone book details"), 15) { this->fe = fe; std::ostringstream sText; // if a number of TYPE_NONE is given, a simple version of the details screen is shown // this type is set, e.g., with old Fritz!Boxes if (fe->getType(0) == fritz::FonbookEntry::TYPE_NONE) { sText << tr("Name") << "\t" << fe->getName() << "\n" << tr("Numbers") << "\t\n" << tr("Default") << "\t" << fe->getNumber(0) << "\n"; } else { sText << tr("Name") << "\t" << fe->getName() << "\n" << tr("Numbers") << "\t\n"; for (size_t pos = 0; pos < fe->getSize(); pos++) sText << cPluginFritzbox::FonbookEntryTypeToName(fe->getType(pos), true) << "\t" << fe->getNumber(pos) << "\n"; } std::string text = sText.str(); std::string::size_type pos = 0; std::string::size_type npos = text.find('\n', pos); size_t line = 0; do { Add(new cOsdItem(text.substr(pos, npos-pos).c_str(), osUnknown, line < 2 ? false : true)); pos = npos +1; npos = text.find('\n', pos); line++; } while (npos != std::string::npos); // if (numbers[fritz::FonbookEntry::TYPE_NONE].length() > 0) // SetCurrent(Get(2)); // else // SetCurrent(Get(1 + fe->getType())); //TRANSLATORS: this is the label for the button to initiate a call SetHelp(tr("Button$Call")); Display(); } eOSState cMenuFonbuchDetail::ProcessKey (eKeys Key) { eOSState state = cOsdMenu::ProcessKey(Key); if (state == osUnknown) { std::string numberToCall; switch (Key) { case kRed: // determine which number to call if (fe->getType(0) == fritz::FonbookEntry::TYPE_NONE){ numberToCall = fe->getNumber(0); } else { numberToCall = fe->getNumber(Current() - 2); } // initiate a call if (numberToCall.empty()) { Skins.Message(mtError, tr("No number to call")); } else { fritz::FritzClient fc; if (fc.initCall(numberToCall)) Skins.Message(mtInfo, tr("Pick up your phone now")); else Skins.Message(mtError, tr("Error while initiating call")); } state = osContinue; break; case kOk: state = osBack; break; default: break; } } return state; } // cKeyOsdItem **************************************************************** cKeyOsdItem::cKeyOsdItem(const char * text, enum eOSState state, bool selectable, unsigned int key) :cOsdItem(text, state, selectable) { this->key = key; } fritzbox-1.5.3/setup.h0000644000175000017500000001126312467660216014241 0ustar tobiastobias/* * Fritz!Box plugin for VDR * * Copyright (C) 2007-2012 Joachim Wilke * * 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. * */ #ifndef SETUP_H_ #define SETUP_H_ #include #include #include #include "libfritz++/Fonbooks.h" #include #include "fritzeventhandler.h" #include "fritzbox.h" #define MAX_MSN_COUNT 22 class cMenuSetupFritzbox : public cMenuSetupPage { private: cPluginFritzbox *fritzbox; char *url; char *username; char *password; char *directions[3]; char *menus[4]; int reactOnDirection; int muteOnCall; int muteOnCallBefore; int muteAfterConnect; int muteVolumeLevel; int pauseOnCall; int pauseOnCallBefore; int pauseLive; int resumeAfterCall; int showNumber; int useNotifyOsd; int hideMainMenu; int defaultMenu; int showNumberInCallList; int showDaySeparator; std::string StoreMsn(void); std::string StoreFonbooks(void); bool locationSettingsDetected; char *countryCode; char *regionCode; int msnFilter; int msnFilterBefore; int msnCount; int msnCountBefore; char **msn; std::vector selectedFonbookIDs; void Setup(void); eOSState ProcessKey(eKeys Key); protected: virtual void Store(void); public: cMenuSetupFritzbox(cPluginFritzbox *fritzbox); virtual ~cMenuSetupFritzbox(); }; class cMenuSetupFritzboxFonbooks : public cOsdMenu { private: fritz::Fonbooks *fonbooks; int **selectedFonbookPos; char **fonbookTitles; size_t numberOfSelectedFonbooks; std::vector *selectedFonbookIDs; void Setup(void); eOSState ProcessKey(eKeys Key); public: cMenuSetupFritzboxFonbooks(std::vector *selectedFonbookIDs); virtual ~cMenuSetupFritzboxFonbooks(); }; struct sFritzboxConfig { public: enum eDirection { DIRECTION_IN, DIRECTION_OUT, DIRECTION_ANY, }; sFritzboxConfig(void); bool SetupParseMsn(const char *value); bool SetupParseFonbooks(const char *value); bool SetupParse(const char *Name, const char *Value); std::string string2hex(std::string input); std::string hex2string(std::string input); std::string configDir; // path to plugins' config files (e.g., local phone book) std::string pluginName; // name of this plugin (e.g., for cRemote::CallPlugin) std::string lang; // webinterface language std::string url; // fritz!box url std::string username; // fritz!box web interface username std::string password; // fritz!box web interface password bool locationSettingsDetected; // if true, location settings were autodetected by libfritz std::string countryCode; // fritz!box country-code std::string regionCode; // fritz!box region-code int reactOnDirection; // what type of calls are we interested in (eDirection)? int muteOnCall; // mute audio on calls int muteAfterConnect; // mute only after call connects int muteVolumeLevel; // on mute, decrease volume by muteVolumeLevel % int pauseOnCall; // pause playback on calls int pauseLive; // pause livetv on calls, too int resumeAfterCall; // resume playback after all calls have finished int showNumber; // show notification on osd on calls int useNotifyOsd; // use the extended notification osd and not Skins.Message int showNumberInCallList; // simple or extended details in call lists time_t lastKnownMissedCall; // the time of the last missed call the user is aware of int showDaySeparator; // separate call lists by day int hideMainMenu; // hide plugins' main menu entry int defaultMenu; // the menu that is displayed first when selecting the main menu entry std::string activeFonbookID; // last shown phone book std::vector msn; // msn's we are interesed in std::vector selectedFonbookIDs; // active phone books }; extern sFritzboxConfig fritzboxConfig; #endif /*SETUP_H_*/ fritzbox-1.5.3/README.md0000644000175000017500000001262012467660216014205 0ustar tobiastobias# Overview This is a "plugin" for the Video Disk Recorder (VDR). Written by: * Joachim Wilke [vdr (at) joachim (minus) wilke (dot) de] * Matthias Becker [becker (dot) matthias (at) gmail (dot) com] Project's homepage: https://github.com/jowi24/vdr-fritz Latest version available at: https://github.com/jowi24/vdr-fritz/releases See the file COPYING for license information. ** Note: The HISTORY file may contain information on new features, which are not yet documented in this README. For up to date information also have a look in that file. ** --- # Installation The Fritz plugin is not very different from other plugins for VDR, most of the common installation procedure for plugins, documented in VDR's core documentation applies. However, the following build dependecies are required: - GCrypt library (libgcrypt) --- # Description ## Call notification The Fritz!Box Plugin connects to the Fritz!Box to inform you about incoming and outgoing calls. As an option, the plugin can automatically mute VDR and pause replays when a call comes in or goes out. To enable this feature you have to dial `#96*5*` once with a telephone connected to the Fritz!Box. This works for all firmware versions >= xx.03.99 You may experience problems when trying to dial `#96*5*` with an ISDN telephone. In such a case try to activate "auto keypad", "dial * and #" or some similar setting in your ISDN telephone. If your ISDN telephone contains no keypad support simply use an analogue telephone instead. If you do not want to be notified by every call, you can specify a list of MSNs you are interested on in the plugin's setup. Max. 22 monitored MSNs are supported. Configuration regarding call notification, muting and pausing is done in the plugin setup menu in VDR. ## Phone book support The plugin supports multiple phonebooks. In the plugin's setup, you can choose which phonebooks are used. The order matters with respect to number lookup. When a call comes in, the plugin tries to resolve the number using the first configured phonebook. If that fails, it tries the second one, and so on. Only one phonebook can be shown in the plugin's main menu. It is the first configured phonebook, that has displayable entries. Via VDR's main menu you can browse this phone book and initiate calls out of it via the [OK]-button. This function uses the telephone you have configures in Fritz!Box web interface for this purpose. (In German the menu path is: Telefonie > Anrufliste > Whlhilfe) ### Fritz!Box phone book This accesses the Fritz!Box phonebook stored on the box itself. ### das-oertliche.de phone book This tries to resolve any number via the german website das-oertliche.de. As this is a lookup-only phonebook, it's entries cannot be displayed in the main menu... ;-) ### nummerzoeker phone book / tel.local.ch phone book Same as das-oertliche.de, but for numbers from the Netherlands and Switzerland. ## Fritz!Box call list Via the colour buttons you can access three different call lists. Press `[Green]` to see the history of incoming calls. Use `[Yellow]` for the list of missed calls. Finally `[Blue]` gives you an overview on whom you called yourself. Pressing `[OK]` shows a separate page with details to the selected call. In this menu you can initiate calls, as in the phone book menu, by pressing `[Red]`. --- # Command line options ## Privacy This plugin logs status and debug information to system log (syslog). By default, no sensitive information, like phone numbers or similar are logged. However, for debugging purposes, this can be enabled, by the `-p` parameter. ### Running custom commands on call events Using the `-c cmd` parameter, a command or script 'cmd' can be specified, that is called when an incoming or outgoing call is initiated or finished. The plugin calls cmd with additional parameters depending on the type of event. * On incoming or outgoing calls: - `cmd CALL [OUT|IN] ` * On call connect: - `cmd CONNECT ` * On call disconnect: - `cmd DISCONNECT ` * When all ongoing calls have been finished: - `cmd FINISHED` A sample script is provided in template/on-call.sh. --- # Screenshots [![Screenshot 1](https://jowi24.github.io/vdr-fritz/screenshot-fritz1.jpg)](https://jowi24.github.io/vdr-fritz/screenshot-fritz1.jpg) [![Screenshot 2](https://jowi24.github.io/vdr-fritz/screenshot-fritz2.jpg)](https://jowi24.github.io/vdr-fritz/screenshot-fritz2.jpg) [![Screenshot 1](https://jowi24.github.io/vdr-fritz/screenshot-fritz3.jpg)](https://jowi24.github.io/vdr-fritz/screenshot-fritz3.jpg) [![Screenshot 2](https://jowi24.github.io/vdr-fritz/screenshot-fritz4.jpg)](https://jowi24.github.io/vdr-fritz/screenshot-fritz4.jpg) [![Screenshot 1](https://jowi24.github.io/vdr-fritz/screenshot-fritz5.jpg)](https://jowi24.github.io/vdr-fritz/screenshot-fritz5.jpg) [![Screenshot 2](https://jowi24.github.io/vdr-fritz/screenshot-fritz6.jpg)](https://jowi24.github.io/vdr-fritz/screenshot-fritz6.jpg) [![Screenshot 1](https://jowi24.github.io/vdr-fritz/screenshot-fritz7.jpg)](https://jowi24.github.io/vdr-fritz/screenshot-fritz7.jpg) --- Note: This Plugin has been tested with Fritz!Box Fon WLAN 7390 FW 06.20 However it may also work for other models or firmware versions. For a detailed list see the plugin's homepage. If you have another model, either positive or negative feedback is appreciated. fritzbox-1.5.3/liblog++/0000755000175000017500000000000012467661105014321 5ustar tobiastobiasfritzbox-1.5.3/liblog++/CustomLogStream.cpp0000644000175000017500000000331412467660541020121 0ustar tobiastobias/* * liblog++ * * Copyright (C) 2007-2013 Joachim Wilke * * 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 "CustomLogStream.h" #include namespace logger { CustomLogBuf::CustomLogBuf(customLogFunction loggerFunction) : loggerFunction{loggerFunction} { const unsigned int BUFFER_SIZE = 1024; char *ptr = new char[BUFFER_SIZE]; setp(ptr, ptr + BUFFER_SIZE); setg(0, 0, 0); } void CustomLogBuf::putBuffer(void) { if (pbase() != pptr()) { int len = (pptr() - pbase()); char *buffer = new char[len + 1]; strncpy(buffer, pbase(), len); buffer[len] = 0; loggerFunction(buffer); setp(pbase(), epptr()); delete [] buffer; } } int CustomLogBuf::overflow(int c) { putBuffer(); if (c != EOF) { sputc(c); } return 0; } int CustomLogBuf::sync() { putBuffer(); return 0; } CustomLogBuf::~CustomLogBuf() { sync(); delete[] pbase(); } CustomLogStream::CustomLogStream(customLogFunction loggerFunction) :std::ostream(new CustomLogBuf(loggerFunction)) {} } /* namespace logger */ fritzbox-1.5.3/liblog++/Makefile0000644000175000017500000000070112467660541015762 0ustar tobiastobiasAFILE = $(notdir $(subst /.a,.a,$(addsuffix .a,$(CURDIR)))) OBJS = $(patsubst %.cpp,%.o,$(wildcard *.cpp)) .PHONY: all clean all: $(AFILE) %.o: %.cpp $(CXX) $(CXXFLAGS) -o $@ -c $< $(AFILE): $(OBJS) @ar ru $(AFILE) $(OBJS) clean: @-rm -f $(AFILE) $(OBJS) $(DEPFILE) ### # Dependencies: MAKEDEP = $(CXX) -MM -MG DEPFILE = .dependencies $(DEPFILE): Makefile @$(MAKEDEP) $(DEFINES) $(CXXFLAGS) $(OBJS:%.o=%.cpp) > $@ -include $(DEPFILE)fritzbox-1.5.3/liblog++/Log.h0000644000175000017500000000425612467660541015225 0ustar tobiastobias/* * liblog++ * * Copyright (C) 2007-2013 Joachim Wilke * * 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. * */ #ifndef LOG_H_ #define LOG_H_ #include #include #include #include #include "CustomLogStream.h" namespace logger { class Log { private: typedef std::unique_ptr ostreamPtr; static std::mutex mutex; static std::string prefix; static ostreamPtr dstream; static ostreamPtr estream; static ostreamPtr istream; static std::string getLocator(std::string file, int line); static void putLogMessage(const std::ostream &message, std::ostream &stream, std::string file, int line); public: static void debug(const std::ostream &message, std::string file, int line); static void error(const std::ostream &message, std::string file, int line); static void info(const std::ostream &message, std::string file, int line); static void setLogStreams(ostreamPtr &&elog, ostreamPtr &&ilog, ostreamPtr &&dlog); static void setPrefix(const std::string &prefix) { Log::prefix = prefix + " - "; } static void setCustomLogger(customLogFunction logError, customLogFunction logInfo, customLogFunction logDebug); }; #define DBG(x) {logger::Log::debug(std::stringstream().flush() << x, std::string(__FILE__), __LINE__);} #define INF(x) {logger::Log::info (std::stringstream().flush() << x, std::string(__FILE__), __LINE__);} #define ERR(x) {logger::Log::error(std::stringstream().flush() << x, std::string(__FILE__), __LINE__);} } #endif /* LOG_H_ */ fritzbox-1.5.3/liblog++/CustomLogStream.h0000644000175000017500000000265612467660541017576 0ustar tobiastobias/* * liblog++ * * Copyright (C) 2007-2013 Joachim Wilke * * 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. * */ #ifndef CUSTOMLOGSTREAM_H_ #define CUSTOMLOGSTREAM_H_ #include #include namespace logger { typedef std::function customLogFunction; class CustomLogBuf : public std::streambuf { private: void putBuffer(void); void putChar(char c); customLogFunction loggerFunction; protected: int overflow(int) override; int sync() override; public: CustomLogBuf(customLogFunction loggerFunction); virtual ~CustomLogBuf(); }; class CustomLogStream : public std::ostream { public: CustomLogStream(customLogFunction loggerFunction); }; } /* namespace logger */ #endif /* CUSTOMLOGSTREAM_H_ */ fritzbox-1.5.3/liblog++/Log.cpp0000644000175000017500000000520612467660541015554 0ustar tobiastobias/* * liblog++ * * Copyright (C) 2007-2013 Joachim Wilke * * 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 "Log.h" #include "CustomLogStream.h" #include namespace logger { std::mutex Log::mutex; std::string Log::prefix; Log::ostreamPtr Log::dstream = nullptr; Log::ostreamPtr Log::estream = nullptr; Log::ostreamPtr Log::istream = nullptr; std::string Log::getLocator(std::string file, int line) { std::stringstream ss; size_t start = file.rfind('/') == std::string::npos ? 0 : file.rfind('/') + 1; ss << "[" << prefix << std::string(file, start, std::string::npos) << ":" << line << "] "; return ss.str(); } void Log::putLogMessage(const std::ostream &message, std::ostream &stream, std::string file, int line) { mutex.lock(); stream << getLocator(file, line) << message.rdbuf() << std::endl; mutex.unlock(); } void Log::debug(const std::ostream &message, std::string file, int line) { if (dstream) putLogMessage(message, *dstream, file, line); else putLogMessage(message, std::clog, file, line); } void Log::error(const std::ostream &message, std::string file, int line) { if (estream) putLogMessage(message, *estream, file, line); else putLogMessage(message, std::cerr, file, line); } void Log::info(const std::ostream &message, std::string file, int line) { if (istream) putLogMessage(message, *istream, file, line); else putLogMessage(message, std::cout, file, line); } void Log::setLogStreams(Log::ostreamPtr &&elog, Log::ostreamPtr &&dlog, Log::ostreamPtr &&ilog) { estream = std::move(elog); istream = std::move(ilog); dstream = std::move(dlog); } void Log::setCustomLogger(customLogFunction logError, customLogFunction logInfo, customLogFunction logDebug) { setLogStreams(std::unique_ptr(new CustomLogStream(logError)), std::unique_ptr(new CustomLogStream(logInfo)), std::unique_ptr(new CustomLogStream(logDebug))); } } /* namespace fritz */