paviro / MMM-FRITZ-Box-Callmonitor

This an extension for the MagicMirror. It provides a callmonitor for FRITZ!Box users alerting them about incoming calls.
29 stars 24 forks source link

Make use of TR-064 API #11

Closed Jopyth closed 8 years ago

Jopyth commented 8 years ago

I am currently working on exploring the possibilities of the TR-064 API. It can be used to access Fritz.Box settings / phone books / call list. Do you think this makes sense? Depending on how far I get, I will fork the project and upload my progress. Currently when I come home and start the mirror, any calls I missed while away will not be displayed, since the mirror did not record them. Also the phone book management as a vcard file does not work for me, my contacts are in the Fritz.Box only at the moment.

There is a node library which implements the protocol, and a (little bit outdated) documentation

The correct naming of the services can be read from the device:

const tr = require("tr-064");

var tr064 = new tr.TR064();
tr064.initTR064Device("fritz.box", 49000, function (err, device) {
    if (!err) {
        console.log("=== " + device.meta.friendlyName + " ===");
        device.meta.servicesInfo.forEach(function (serviceType) {
            var service = device.services[serviceType];
            console.log("  ---> " + service.meta.serviceType + " <---");
            service.meta.actionsInfo.forEach(function (action) {
                console.log("   # " + action.name + "()");
                action.inArgs.forEach(function (arg) {
                    console.log("     IN : " + arg);
                });
                action.outArgs.forEach(function (arg) {
                    console.log("     OUT: " + arg);
                });
            });
        });
    }
});
paviro commented 8 years ago

Hey there, sorry for the delayed answer. It would be awesome if you could add this to the module and also replace the current way missed calls are handled! :) Still please leave the vcard thing there as a second option!