A script that reads out the answering machine of a FritzBox in the LAN and posts the messages into an encrypted private chat of the matrix network.
Go to file
Homer S. f537edc4cb Script failed when Callers Number was empty i.e. NoneType. Put a['Number'] into str() fixed this. 2021-10-08 09:22:15 +02:00
docker Some more fixes on docker build related files. 2021-07-14 21:44:11 +02:00
libs Conditional clauses: Only start script on incoming calls. 2021-07-16 21:41:49 +02:00
tests Nothing to test up to now ... 2021-07-06 23:05:04 +02:00
.dockerignore * Added docker folder to repo 2021-06-29 00:27:27 +02:00
.env.sample Added option to also notify about missed calls. 2021-07-10 13:40:19 +02:00
.gitignore gitignore emacs autosave files 2021-07-01 19:32:42 +02:00
LICENSE Initial commit 2021-06-25 14:39:45 +02:00
README.md Updated README regarding missed call feature. 2021-07-10 18:52:01 +02:00
fritzab2matrix.py Script failed when Callers Number was empty i.e. NoneType. Put a['Number'] into str() fixed this. 2021-10-08 09:22:15 +02:00
matrix-commander.py Initial commit 2021-06-27 14:01:20 +02:00
requirements.txt Further corrections on docker build related files. 2021-07-14 21:08:24 +02:00

README.md

FritzAB2Matrix

FritzAB2Matrix reads out the answering machine (TAM) of a Fritz!Box in your LAN and posts the messages into a private chat in the matrix network. While you could let your Fritz!Box send the messages by mail - unencrypted of course - the matrix chat is e2e encrypted. Which kindly acknowledges the privacy of any caller that leaves a message for you.

Uses the python based cmd-line-tool matrix-commander so the matrix-commander.py in this repo is just a copy of that file to ease testing.

Features

  • Since v0.1.1 Multitam is integrated so that you can check multiple answering machines and post the messages to different matrix rooms. (Use FRITZ_TAM variable in .env file)
  • Set FRITZ_CALL_WATCH=True if you want to receive a message everytime you miss a call.

Installation

If you like to test this repository you are recommended to use one of the following two options.

Necessary preparations for both cases

  • Create a new user (e.g. "fritzab") in your Fritz!Box. Don't use your default admin account!
    • This user needs only the privileges regarding voice messages and to read from box's storage.
    • As you only need to access the FRITZ/voicebox/rec/ path you should remove the right to read and write everything and add only this path and only with reading privilege.
      • Beware! If you use a USB device as expanded storage for your Fritz!Box and allowed the TAM to use it for storing more messages you will need another path (e.g. Storage-01/FRITZ/voicebox/rec/). You also have to add the FRITZ_VOICEBOX_PATH variable in your .env file (see below) according to that difference.
  • You have to activate Call Monitoring on your Fritz!Box by using one of the connected phones and call #96*5*.
    • Call monitoring watches the box and the FritzAB2Matrix is triggered every time a call disconnects.
    • If you cannot activate Call Monitoring the only way to use FritzAB2MAtrix will be to have a cron job call it regularly.

virtualenv

  • Create a new folder wherever you like in your home directory.
    • Make it a virtual environment by python3 -m venv <new folder> and source <new folder>/bin/activate.
    • cd <new folder>
  • Clone the repo.
  • Inside the repo run pip install --upgrade pip && pip install -r requirements.txt
  • Create an .env file with your favourite editor:
FRITZ_USERNAME="fritzab2matrix"
FRITZ_PASSWORD="S0meSecretPa5sw02d"
FRITZ_IP="192.168.178.1" 
FRITZ_TMP="/tmp" 
# FRITZ_VOICEBOX_PATH="fritz.nas/FRITZ/voicebox" 
FRITZ_TAM='{"0" : "!roomhash1:matrix.org", "1" : "!roomhash2:matrix.org"}' 
FRITZ_CALL_WATCH=False

.env

    • Adjust it according to your data.
  • For matrix-commander.py to work you need to run it manually the first time by python3 matrix-commander and follow the emerging dialog by putting in your matrix account data.
  • After all that you can finally run ./fritzab2matrix.py and your TAM messages should be posted in the chosen matrix chat.

Docker

Provided you have docker and docker-compose installed on your system:

  • Clone the repo and cd into it.
  • Create the above mentioned .env file.
  • Run docker-compose -f docker/docker-compose.yml build and watch docker work some minutes.
  • After that slightly edit the docker-compose.yml
    • and add
  
   volumes:
      - ../.:/app
  • so that your repo is used as volume for the /app folder. So everything you change in the repo's folder will affect the docker container.
  • For matrix-commander.py to work you need to run it manually the first time by python3 matrix-commander and follow the emerging dialog by putting in your matrix account data.
    • With docker that means that you need to open an interactive shell in the running container (docker-compose -f docker/docker-compose.yml exec app /bin/bash and run this command there.
    • Follow the appearing dialog and input your matrix account data.
  • After all that the running docker container should watch your box and your TAM messages should be posted in the chosen matrix chat.

Special Thx

Gratitude to all people that enabled that project by their passionate work and will to share it! Especially to