Phonebook synchronisation between Carddav and fritzbox

The Fritzbox has no builtin sync functionality to a gereric Carddav service

Problem

It would be nice to snc the fritzbox phone books autoimatically with a generic Webdav provide. Unfortunately this connection exist only for google gmx and dome other providers.

Some months ago I raised a feature request for this functionality but I don’t hold my breath

For the time I see only an offline synchronization as workable. This can be implemented with several existing scripts.

Solution

I chose https://github.com/pamapa/python-fritzbox to implement a manual workflow to fetch the phone books from a cremote CARDDAV-Server (nextcloud) .

Then I replaced the phonebooks in the fritztbox manually with the downloaded data

I chose The WLS subsystem of windows 10 due to pragmatic reasons and prepared it with

sudo apt update
sudo apt upgrade
sudo api install git
sudo apt install python3-pip
sudo pip3  install requests

Then I followed the README of python-fritzbox for the installation, but substituted python3 for python

Because I planned to manually load the phonebooks anyway I did not bother with the certificates.

I copied the URLs of the CALDAV adressbook from the Settigs panel in my nextcloud instance and prepared a special app password for the synchronization. Then I created statements similar to the following an pasted them in a script:

fritzboxphonebook.py --country-code +49 \
               --webdav-username <myuser> --webdav-password <mypassword>     \
               --webdav-url https://xxx.de/remote.php/dav/addressbooks/users/<myuser>/<bookname>/ --save bookname.xml

Note the parameter country-code . It amends incomplete telephone numbers and should be your home country.

I prefer to have sevral phonebooks in the fritzbox and assign them to the different phones.

I open the fritzbox web console, create a new phonebook and restore ist content from the file which I produced.