December 2, 2026
What started as a small fax-sending interface has now become a full-fledged fax machine for the Linux desktop. The Python program can now receive faxes, too, and displays them as PDFs in a list. It also includes a keypad for entering the destination number and an address book that stores names and fax numbers in a JSON file. This article explains what additional software you need to install, what to add to extensions.conf, and what the complete script looks like. To be honest, this is not a plug-and-play solution. It is a project for people who already have some experience with Asterisk.
Back up the files before making any changes to your Asterisk configuration!
This article continues Sending Faxes with Asterisk on Ubuntu: Permissions, ImageMagick, and Other Pitfalls. I assume that you have already completed everything described there, so I will not repeat it here: the packages, the outgoing folder, the asterisk group, access to the Asterisk console, and the dialplan for sending faxes. If you have not done that yet, start with that article. Fax reception itself is covered in two earlier articles: with and without email forwarding as TIFF or PDF files, and with forwarding as a TIFF file attached to an email. This article covers a third option: no email. Faxes remain on the computer as PDF files and are displayed directly in the program.

A word of warning: Getting this program up and running is not exactly easy. It requires Asterisk to run on the same computer as the graphical interface. The program copies PDF files directly into the Asterisk folders, controls Asterisk through the local console, and reads the progress information there. It also works only on Linux because it uses pseudo-terminals, Linux group permissions, and the Asterisk socket. It will not run on Windows. If you have never set up Asterisk before, this article alone will not be enough to get you there. This is not a plug-and-play solution. I have tested it only with my own setup: Ubuntu MATE 24.04 and Asterisk 20. On the other hand, it is a very useful learning project, and anyone familiar with Asterisk will already have most of the required pieces in place.

And a word about security: Things get serious as soon as this Asterisk server is connected directly to the internet through SIP accounts, for example through Sipgate. SIP scanners constantly search the internet for reachable phone servers and try different phone numbers and passwords. APIBAN and Fail2Ban help protect against this. I have covered both in separate articles: APIBAN automatically protects SIP phone servers against malicious attacks from the internet and Installing and configuring Fail2Ban for Asterisk. You will also usually need port forwarding on your router so that calls and faxes can reach Asterisk. Every open port will be discovered and probed, often within just a few minutes. If you cannot manage this safely, it is better to keep Asterisk on your local network behind the router and avoid forwarding any ports.

What the program can do now: The interface has three tabs. The workflow on the “Send” tab has not changed: drag in a PDF or click to select one, enter the number, and send. What is new is a keypad below the number field, with the digits 0 through 9, plus the star and pound keys, just like a telephone. There is also a button to delete the last character and another to clear the entire number. You can still use the computer keyboard. However, input validation allows only digits and an optional plus sign at the beginning. Star and pound are rejected when you try to send.
Video above: An example of how to send a fax.
The “Receive” tab lists incoming faxes by date, size, and filename, with the newest one at the top. The program checks the incoming folder every three seconds. When a new fax arrives, a message appears in the event window and an alert sound plays. Unread faxes are shown in bold, and the tab might display “Receive (2 new).” Double-click a fax to open it in your desktop’s default PDF viewer. The buttons below the list let you open the incoming folder or delete a fax.
The “Address Book” tab is a simple list of names and fax numbers. You can manage the entries using “New,” “Edit,” and “Delete.” Double-click an entry (or click the “Send fax to …” button) to copy the number and return to the “Send” tab. The number field offers address book entries in the format “Name – Number,” followed by recently used numbers. Only the number itself is inserted. The contact’s name appears next to the “Recipient number” label and is also shown in the confirmation prompt before sending. This also works with numbers typed in manually, as long as they are listed in the address book. Only the digits are compared, so “+49 …” and “0049 …” are treated as different numbers.

Step 1: Install the additional packages: To convert received faxes from TIFF to PDF, you need the tiff2pdf program from the libtiff-tools package. ImageMagick is not a good choice for this because Ubuntu blocks PDF writing in its policy.xml file. tiff2pdf also converts a multi-page fax into a multi-page PDF.
sudo apt update
sudo apt install libtiff-tools
Use this command to check whether the installation worked. If it returns a path such as /usr/bin/tiff2pdf, everything is fine.
which tiff2pdf
If apt update gets stuck on “Waiting for headers” for several minutes, it is usually just a slow package server. Press Ctrl+C to cancel the operation. The package is available from the standard Ubuntu archive, so you can usually install it anyway with sudo apt install libtiff-tools. All the packages mentioned in Part 1 (python3-tk, imagemagick, ghostscript, and tkinterdnd2 for drag and drop) must also be installed. To open received faxes, you also need a PDF viewer and the xdg-open program. Both are normally included with an Ubuntu desktop installation.
Step 2: Prepare the incoming folder: Asterisk saves received faxes as TIFF files in /var/spool/asterisk/fax/incoming. This folder is not created automatically during installation, either. Like the outgoing folder, it must belong to the asterisk user and the asterisk group, and the group must have write access. This is necessary because the program needs to read and delete faxes, and the conversion script needs to write files there. The leading 2 in the permissions (setgid) ensures that new files are assigned to the asterisk group.
sudo mkdir -p /var/spool/asterisk/fax/incoming
sudo chown asterisk:asterisk /var/spool/asterisk/fax/incoming
sudo chmod 2775 /var/spool/asterisk/fax/incoming
As explained in Part 1, your user account must be a member of the asterisk group. After adding it to the group, log out and log back in once.
Step 3: Create the conversion script: After a fax has been received successfully, Asterisk should immediately convert the TIFF file to PDF and delete the TIFF file. For this, I use a small shell script. The following block creates the script in one go and makes it executable. The PDF file gets permission mode 664 so that the asterisk group, and therefore my program, can read it. Write permission on the folder is enough to delete the TIFF file. If conversion fails, the TIFF file is left in place and a message is written to the system log.
sudo tee /usr/local/bin/fax2pdf.sh > /dev/null <<'EOF'
#!/bin/bash
# Wandelt ein empfangenes Fax-TIFF in PDF um
tif="$1"
pdf="${tif%.tif}.pdf"
if tiff2pdf -o "$pdf" "$tif"; then
chmod 664 "$pdf"
rm -f "$tif"
else
logger -t fax2pdf "Umwandlung fehlgeschlagen: $tif"
fi
EOF
sudo chmod 755 /usr/local/bin/fax2pdf.sh
You can test this without sending an actual fax. Take an existing TIFF file from the incoming folder and run the conversion as the asterisk user. Afterward, there should be a PDF in the folder and the TIFF file should be gone. Replace FILENAME with the actual filename.
sudo -u asterisk /usr/local/bin/fax2pdf.sh /var/spool/asterisk/fax/incoming/DATEINAME.tif
If something goes wrong, this command displays the script’s error messages:
journalctl -t fax2pdf
Step 4: Edit extensions.conf: Now we need to add fax reception to the dialplan. Put this block in the extensions.conf file, in the same context that contains the dialing rules for sending faxes. In my setup, that context is [telefone].
sudo nano /etc/asterisk/extensions.conf
; +++++++++++++++++++++++++++ FAXEMPFANG 1095 ++++++++++++++++++++++++++++
; Speichert eingehende Faxe als TIFF in /var/spool/asterisk/fax/incoming
exten => 1095,1,Noop(Faxempfang 1095 von "${CALLERID(name)}" <${CALLERID(num)}>)
same => n,Answer()
same => n,Wait(3)
same => n,Set(FAXOPT(ecm)=no)
same => n,Set(FAXOPT(modem)=v27,v29)
same => n,Set(FAXOPT(minrate)=4800)
same => n,Set(FAXOPT(maxrate)=9600)
same => n,Set(FAXOPT(localstationid)=1095)
same => n,Set(FAXOPT(headerinfo)=Volker Lange-Janson SM5ZBS)
same => n,Set(TRYCOUNT=0)
same => n,Set(FAXDEST=/var/spool/asterisk/fax/incoming)
same => n,Set(tempfax=${STRFTIME(,,%C%y%m%d%H%M%S)})
same => n(faxloop),Set(TRYCOUNT=$[${TRYCOUNT} + 1])
same => n,Wait(2)
same => n,ReceiveFax(${FAXDEST}/${tempfax}_${TRYCOUNT}.tif)
same => n,NoOp(Fax: STATUS=${FAXOPT(status)} PAGES=${FAXOPT(pages)} RATE=${FAXOPT(rate)} ERROR=${FAXOPT(error)})
same => n,GotoIf($["${FAXOPT(status)}" = "SUCCESS"]?faxsuccess)
same => n,GotoIf($[${TRYCOUNT} < 5]?faxloop)
same => n,NoOp(Fax-Empfang nach ${TRYCOUNT} Versuchen fehlgeschlagen)
same => n,Goto(faxend)
same => n(faxsuccess),NoOp(Fax erfolgreich empfangen: ${FAXOPT(pages)} Seiten)
same => n,System(/usr/local/bin/fax2pdf.sh ${FAXDEST}/${tempfax}_${TRYCOUNT}.tif)
same => n(faxend),Hangup()
; +++++++++++++++++++++++++++ Ende Faxempfang 1095 ++++++++++++++++++++++
Here is what the individual lines do: Extension 1095 answers the call (Answer) and waits three seconds before listening for a fax signal. The FAXOPT settings are the conservative values I arrived at while troubleshooting: ECM is disabled, only the slower and more reliable V.27 and V.29 modems are allowed, and the speed is limited to 4,800–9,600 bits per second. The faster V.17 mode is disabled, just as it was for sending through Sipgate in Part 1. If your connections are stable, you can enable ECM and increase the speed. You will need to test what the remote fax machines support. Enter your own fax ID and name for localstationid and headerinfo.
ReceiveFax saves the fax as a TIFF file in the incoming folder. The filename consists of the call’s timestamp and the attempt number, for example 20261201143005_1.tif. The NoOp line writes the status, page count, speed, and any errors to the Asterisk console. If the status is SUCCESS, the dialplan jumps to faxsuccess and runs the conversion script. Otherwise, it makes up to five attempts. I added this retry loop while troubleshooting. I do not know whether it actually helps in practice, because the remote fax machine has often already hung up after a failed attempt. If you do not need the retry loop, you can remove it along with TRYCOUNT. However, you will also need to adjust the filenames in the dialplan.
How the call reaches extension 1095 depends on your own setup. It could come through a SIP account, an IAX2 connection from another Asterisk server, or a FritzBox. That is outside the scope of this article. The only important thing is that the call reaches the [telefone] context, or whichever context you added the block to. After that, reload the dialplan.
sudo asterisk -rx "dialplan reload"
To test the setup, send yourself a fax from another fax machine or from a second Asterisk server. When the transmission is complete, there should be a PDF in the incoming folder and the TIFF file should be gone. This command shows the contents of the folder:
ls -l /var/spool/asterisk/fax/incoming
Failed attempts may leave empty or incomplete TIFF files in the folder. The program ignores them. If you want to keep the folder tidy, delete these files manually from time to time.
Step 5: The Python script: The complete script is shown below. Save it in a file, for example fax-gui-send-receive.py. I keep mine on the desktop. Start it from a session that already has access to the asterisk group, either after logging in again or from a shell after running newgrp asterisk.
python3 fax-gui-send-receive.py
The fixed settings are at the beginning of the file. ASTERISK_CMD, OUTGOING_DIR, and INCOMING_DIR define the folders, while CONTEXT and PREFIX are used for sending. PREFIX is the 1094 prefix from the dialplan rule; the recipient’s fax number is added after it. If your dialplan uses different context names or prefixes, change these values accordingly. The color settings, such as C_BG and C_HEAD, are right below them. You can easily replace the orange and earth tones with other colors.
A conversion pitfall: The program can also convert TIFF files to PDF on its own if the script from Step 3 has not run and there is only a TIFF file in the incoming folder. This is intended as a fallback and should not be the normal procedure. My first version had a bug: it waited only 20 seconds and then converted any TIFF file that had not changed during that time. This worked fine for the first fax. With the second one, I got the message “Can’t open input file for reading,” even though the TIFF file was in the folder and could be converted manually without any problem. The most likely explanation is that the fax software writes the TIFF directory, which makes the file readable, only at the end of the page. During reception, the file may consist of just a few header bytes for quite some time, and the program probably tried to process an incomplete file. It now waits two minutes and also checks whether the file header points to a directory inside the file. This prevents it from interfering with an ongoing reception. The normal method is still to use the script in the dialplan, because that script runs only after the transmission has finished.
The address book as a JSON file: The entries are stored in ~/.config/fax-gui-adressbuch.json. JSON is a simple text format. The file contains a list of name-and-number entries and can be opened and edited with any text editor. It looks like this:
[
{"name": "Anna", "number": "+46 11 22 33"},
{"name": "Praxis Dr. Meier", "number": "06226 938166"}
]
The numbers are stored exactly as you enter them, with or without spaces. When sending a fax, the program removes spaces and hyphens. The list is displayed in alphabetical order by name. You can also simply copy the file to another computer. One warning if you edit the file manually: if it contains a syntax error, such as a missing comma, the program treats the address book as empty. If you then add a new entry, it overwrites the damaged file. So make a backup before editing the file by hand.
The Python script: Here is the complete code. It works only on the computer running Asterisk and requires the software and setup described in this article and Part 1.
#!/usr/bin/env python3
"""Fax-GUI für Asterisk (Tkinter) – Senden und Empfangen in Erdtönen/Orange
Reiter "Senden":
1. PDF in die große Fläche ziehen (oder auf die Fläche klicken)
2. Empfängernummer eintragen
3. "Fax senden"
Im Ereignisfenster sieht man den Ablauf.
Reiter "Adressbuch":
Namen und Faxnummern als Liste, gespeichert in
~/.config/fax-gui-adressbuch.json (lässt sich auch im Texteditor ändern).
Doppelklick auf einen Eintrag übernimmt die Nummer in den Reiter "Senden".
Im Nummernfeld erscheinen die Namen zur Auswahl; zu bekannten Nummern wird
der Name angezeigt.
Reiter "Empfangen":
Zeigt die vom Asterisk empfangenen Faxe (PDF) aus dem Eingangsordner.
Neue Faxe erscheinen automatisch, ungelesene sind fett markiert.
Doppelklick öffnet das Fax im Standard-PDF-Programm.
Liegt zu einem TIFF noch kein PDF vor, wandelt die GUI es selbst um
(tiff2pdf aus dem Paket libtiff-tools), das Skript fax2pdf.sh ist dann
nicht zwingend nötig.
Technik beim Senden (unverändert):
- PDF wird als a.pdf in den Ausgangsordner kopiert (Dialplan aus dem Blogartikel)
- Anruf per Asterisk-Konsole: channel originate Local/<Vorwahl><Nummer>@<Kontext>
- Fortschritt über eine einzige dauerhafte Konsolenverbindung (asterisk -rnvvv)
Drag & Drop: pip install tkinterdnd2
(ohne das Paket funktioniert ein Klick auf die Fläche zum Auswählen)
"""
import json
import os
import pty
import re
import shutil
import subprocess
import threading
import time
import tkinter as tk
from datetime import datetime
from pathlib import Path
from tkinter import filedialog, messagebox, ttk
try:
from tkinterdnd2 import DND_FILES, TkinterDnD
BaseTk = TkinterDnD.Tk
HAS_DND = True
except Exception:
BaseTk = tk.Tk
HAS_DND = False
# ----------------------------------------------------------- feste Einstellungen
ASTERISK_CMD = "asterisk"
OUTGOING_DIR = Path("/var/spool/asterisk/fax/outgoing")
INCOMING_DIR = Path("/var/spool/asterisk/fax/incoming")
CONTEXT = "telefone"
PREFIX = "1094"
REFRESH_MS = 3000 # Eingangsordner alle 3 s prüfen
TIFF_IDLE_SECONDS = 120 # TIFF erst umwandeln, wenn so lange nicht mehr geändert
CONFIG_FILE = Path.home() / ".config" / "fax-gui.json"
ADDR_FILE = Path.home() / ".config" / "fax-gui-adressbuch.json"
DEFAULTS = {"pdf_dir": str(Path.home()), "history": [], "seen": None}
# ------------------------------------------------------------------- Farben
# Sanfte, erdfarbene Orangetöne (inspiriert von Linphone / warmen Erdtönen)
C_BG = "#efe8df" # Fensterhintergrund (warmes Sand-/Creme-Grau)
C_HEAD = "#b85d19" # Kopfzeile (warmes Terrakotta / Linphone-Orange)
C_ACCENT = "#cf6d22" # Button / Akzent (sanftes Orange)
C_ACCENT_DK = "#a85212" # Button gedrückt
C_DROP = "#faf5ef" # Dropfläche / Tastenfeld
C_DROP_HI = "#f3dec6" # Dropfläche beim Darüberziehen
C_BORDER = "#c9a98a" # sanfter erdiger Rahmen
C_TEXT = "#33261d" # dunkles Espresso-Braun statt hartem Schwarz
C_MUTED = "#7a6655" # gedämpftes Braun für Hilfstexte & Zeitstempel
C_OK = "#2e7d4f"
C_ERR = "#b53838"
C_LOG_BG = "#fcf9f5"
NOOP_RE = re.compile(r'NoOp\("[^"]*", "(STATUS|PAGES|RATE|ERROR): ?([^"]*)"')
ANSI_RE = re.compile(r"\x1b\[[0-9;?]*[A-Za-z]")
def read_lines(fd):
"""Liefert Zeilen aus einem Pseudo-Terminal."""
buf = b""
while True:
try:
chunk = os.read(fd, 4096)
except OSError:
return
if not chunk:
return
buf += chunk
while b"\n" in buf:
line, buf = buf.split(b"\n", 1)
yield ANSI_RE.sub("", line.decode("utf-8", "replace")).strip()
def load_cfg():
cfg = dict(DEFAULTS)
try:
cfg.update(json.loads(CONFIG_FILE.read_text()))
except (OSError, ValueError):
pass
return cfg
def save_cfg(cfg):
try:
CONFIG_FILE.parent.mkdir(parents=True, exist_ok=True)
CONFIG_FILE.write_text(json.dumps(cfg, indent=2))
except OSError:
pass
def load_book():
"""Adressbuch laden: Liste von {"name": ..., "number": ...}, nach Name sortiert."""
try:
data = json.loads(ADDR_FILE.read_text(encoding="utf-8"))
except (OSError, ValueError):
return []
book = []
for e in data if isinstance(data, list) else []:
if isinstance(e, dict) and e.get("name") and e.get("number"):
book.append({"name": str(e["name"]), "number": str(e["number"])})
book.sort(key=lambda c: c["name"].lower())
return book
def save_book(book):
try:
ADDR_FILE.parent.mkdir(parents=True, exist_ok=True)
ADDR_FILE.write_text(json.dumps(book, indent=2, ensure_ascii=False),
encoding="utf-8")
return True
except OSError:
return False
def digits(text):
"""Nur die Ziffern einer Nummer (zum Vergleichen)."""
return re.sub(r"\D", "", text)
class ContactDialog(tk.Toplevel):
"""Kleiner Dialog zum Anlegen/Ändern eines Adressbuch-Eintrags."""
def __init__(self, master, title, name="", number=""):
super().__init__(master)
self.title(title)
self.configure(bg=C_BG)
self.transient(master)
self.resizable(False, False)
self.result = None
f = ttk.Frame(self, padding=18)
f.pack()
ttk.Label(f, text="Name").grid(row=0, column=0, sticky="w")
self.e_name = ttk.Entry(f, width=30, font=("Sans", 13))
self.e_name.grid(row=1, column=0, columnspan=2, sticky="ew", pady=(2, 10))
self.e_name.insert(0, name)
ttk.Label(f, text="Faxnummer").grid(row=2, column=0, sticky="w")
self.e_num = ttk.Entry(f, width=30, font=("Sans", 13))
self.e_num.grid(row=3, column=0, columnspan=2, sticky="ew", pady=(2, 14))
self.e_num.insert(0, number)
ttk.Button(f, text="Speichern", style="Tool.TButton",
command=self.ok).grid(row=4, column=0, sticky="ew", padx=(0, 4))
ttk.Button(f, text="Abbrechen", style="Tool.TButton",
command=self.destroy).grid(row=4, column=1, sticky="ew",
padx=(4, 0))
self.bind("<Return>", self.ok)
self.bind("<Escape>", lambda e: self.destroy())
self.grab_set()
self.e_name.focus_set()
self.wait_window(self)
def ok(self, event=None):
name = self.e_name.get().strip()
num = self.e_num.get().strip()
if not name or not re.fullmatch(r"\+?\d+", re.sub(r"[\s\-/()]", "", num)):
messagebox.showwarning(
"Adressbuch", "Bitte einen Namen und eine gültige Faxnummer "
"(nur Ziffern, ggf. mit + am Anfang) eingeben.", parent=self)
return
self.result = (name, num)
self.destroy()
def tiff_complete(path, size):
"""True, wenn der TIFF-Kopf auf ein Verzeichnis innerhalb der Datei zeigt.
spandsp schreibt das Verzeichnis erst am Seitenende; vorher ist die Datei
nur ein Kopf und tiff2pdf meldet "Can't open input file"."""
try:
with open(path, "rb") as f:
head = f.read(8)
except OSError:
return False
if len(head) < 8 or head[:2] not in (b"II", b"MM"):
return False
offset = int.from_bytes(head[4:8], "little" if head[:2] == b"II" else "big")
return 0 < offset < size
def open_external(path):
"""Öffnet Datei oder Ordner im Standardprogramm."""
subprocess.Popen(["xdg-open", str(path)], stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL)
class FaxApp(BaseTk):
def __init__(self):
super().__init__()
self.title("Fax")
self.configure(bg=C_BG)
self.minsize(560, 800)
self.geometry("620x880")
self.cfg = load_cfg()
self.book = load_book()
self.pdf = None # gewählte PDF (Path)
self.busy = False
self.known = None # beim Start vorhandene Faxe (für "neu"-Meldung)
self.tried = set() # TIFFs, für die schon eine Umwandlung lief
self.sig = None # Signatur der angezeigten Liste
self.build()
self.refresh_incoming()
# ---------------------------------------------------------------- GUI
def build(self):
style = ttk.Style(self)
try:
style.theme_use("clam")
except tk.TclError:
pass
style.configure("TFrame", background=C_BG)
style.configure("TLabel", background=C_BG, foreground=C_TEXT,
font=("Sans", 11))
style.configure("Small.TLabel", foreground=C_MUTED, font=("Sans", 10))
style.configure("TCombobox", fieldbackground="white", padding=6)
style.configure("Send.TButton", font=("Sans", 15, "bold"), padding=12,
background=C_ACCENT, foreground="white",
bordercolor=C_ACCENT_DK, focuscolor=C_ACCENT)
style.map("Send.TButton",
background=[("disabled", "#d8c3b0"), ("pressed", C_ACCENT_DK),
("active", "#dc7b30")],
foreground=[("disabled", "#f7f1ea")])
style.configure("Tool.TButton", font=("Sans", 11, "bold"), padding=(14, 8),
background=C_ACCENT, foreground="white",
bordercolor=C_ACCENT_DK, focuscolor=C_ACCENT)
style.map("Tool.TButton",
background=[("disabled", "#d8c3b0"), ("pressed", C_ACCENT_DK),
("active", "#dc7b30")],
foreground=[("disabled", "#f7f1ea")])
style.configure("Key.TButton", font=("Sans", 16, "bold"), padding=(0, 7),
background=C_DROP, foreground=C_TEXT,
bordercolor=C_BORDER, focuscolor=C_DROP)
style.map("Key.TButton",
background=[("pressed", C_DROP_HI), ("active", "#f6eadb")])
style.configure("Horizontal.TProgressbar", troughcolor="#e2d5c5",
background=C_ACCENT, bordercolor=C_BG,
lightcolor=C_ACCENT, darkcolor=C_ACCENT)
style.configure("TNotebook", background=C_BG, borderwidth=0)
style.configure("TNotebook.Tab", font=("Sans", 11, "bold"),
padding=(22, 8), background="#e2d5c5", foreground=C_TEXT)
style.map("TNotebook.Tab",
background=[("selected", C_BG)],
foreground=[("selected", C_HEAD)])
style.configure("Treeview", rowheight=28, font=("Sans", 11),
background="white", fieldbackground="white",
foreground=C_TEXT, bordercolor=C_BORDER)
style.configure("Treeview.Heading", font=("Sans", 10, "bold"),
background="#e2d5c5", foreground=C_TEXT)
style.map("Treeview", background=[("selected", C_ACCENT)],
foreground=[("selected", "white")])
# Kopfzeile
head = tk.Frame(self, bg=C_HEAD)
head.pack(fill="x")
tk.Label(head, text="Fax", bg=C_HEAD, fg="white",
font=("Sans", 18, "bold")).pack(side="left", padx=20, pady=14)
main = ttk.Frame(self, padding=(20, 14, 20, 16))
main.pack(fill="both", expand=True)
main.columnconfigure(0, weight=1)
main.rowconfigure(0, weight=1)
self.nb = ttk.Notebook(main)
self.nb.grid(row=0, column=0, sticky="nsew")
self.tab_send = ttk.Frame(self.nb, padding=(6, 16, 6, 6))
self.tab_recv = ttk.Frame(self.nb, padding=(6, 16, 6, 6))
self.nb.add(self.tab_send, text="Senden")
self.tab_book = ttk.Frame(self.nb, padding=(6, 16, 6, 6))
self.nb.add(self.tab_recv, text="Empfangen")
self.nb.add(self.tab_book, text="Adressbuch")
self.build_send(self.tab_send)
self.build_recv(self.tab_recv)
self.build_book(self.tab_book)
self.refresh_book()
# Ereignisfenster (für beide Reiter gemeinsam)
logf = ttk.Frame(main)
logf.grid(row=1, column=0, sticky="ew", pady=(14, 0))
logf.columnconfigure(0, weight=1)
ttk.Label(logf, text="Ereignisse", style="Small.TLabel").grid(
row=0, column=0, sticky="w")
self.log_box = tk.Text(logf, height=6, state="disabled", wrap="word",
font=("Monospace", 10), bg=C_LOG_BG, fg=C_TEXT,
relief="flat", highlightthickness=1,
highlightbackground=C_BORDER, padx=8, pady=6)
self.log_box.grid(row=1, column=0, sticky="ew")
sb = ttk.Scrollbar(logf, command=self.log_box.yview)
sb.grid(row=1, column=1, sticky="ns")
self.log_box.configure(yscrollcommand=sb.set)
self.log_box.tag_configure("ok", foreground=C_OK,
font=("Monospace", 10, "bold"))
self.log_box.tag_configure("err", foreground=C_ERR,
font=("Monospace", 10, "bold"))
self.log_box.tag_configure("time", foreground=C_MUTED)
if HAS_DND:
for w in (self.tab_send, self.drop):
w.drop_target_register(DND_FILES)
w.dnd_bind("<<Drop>>", self.on_drop)
self.drop.dnd_bind("<<DropEnter>>", lambda e: self.hilight(True))
self.drop.dnd_bind("<<DropLeave>>", lambda e: self.hilight(False))
else:
self.log("Hinweis: Für Drag & Drop 'pip install tkinterdnd2' "
"ausführen. Klick auf die Fläche öffnet die Dateiauswahl.")
self.bind("<Return>", self.on_return)
def build_send(self, body):
body.columnconfigure(0, weight=1)
# 1) Dropfläche
ttk.Label(body, text="1. PDF-Datei").grid(row=0, column=0, sticky="w")
self.drop = tk.Canvas(body, height=110, bg=C_DROP, highlightthickness=0,
cursor="hand2")
self.drop.grid(row=1, column=0, sticky="ew", pady=(4, 12))
self.drop.bind("<Configure>", lambda e: self.draw_drop())
self.drop.bind("<Button-1>", lambda e: self.browse())
# 2) Nummer mit Tastenblock (klassisches Telefon-Layout + Löschtasten)
self.num_label = ttk.Label(body, text="2. Empfängernummer")
self.num_label.grid(row=2, column=0, sticky="w")
self.num = ttk.Combobox(body, font=("Sans", 16),
values=self.num_values())
self.num.grid(row=3, column=0, sticky="ew", pady=(4, 8))
self.num.bind("<<ComboboxSelected>>", self.on_pick)
self.num.bind("<KeyRelease>", self.update_name)
self.num.focus_set()
pad = ttk.Frame(body)
pad.grid(row=4, column=0, pady=(0, 12))
for c in range(4):
pad.columnconfigure(c, weight=1, uniform="key", minsize=84)
digits = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
for i, d in enumerate(digits):
ttk.Button(pad, text=d, style="Key.TButton",
command=lambda d=d: self.key(d)).grid(
row=i // 3, column=i % 3, sticky="ew", padx=3, pady=3)
ttk.Button(pad, text="*", style="Key.TButton",
command=lambda: self.key("*")).grid(
row=3, column=0, sticky="ew", padx=3, pady=3)
ttk.Button(pad, text="0", style="Key.TButton",
command=lambda: self.key("0")).grid(
row=3, column=1, sticky="ew", padx=3, pady=3)
ttk.Button(pad, text="#", style="Key.TButton",
command=lambda: self.key("#")).grid(
row=3, column=2, sticky="ew", padx=3, pady=3)
ttk.Button(pad, text="⌫", style="Key.TButton",
command=lambda: self.key("back")).grid(
row=0, column=3, rowspan=2, sticky="nsew", padx=3, pady=3)
ttk.Button(pad, text="C", style="Key.TButton",
command=lambda: self.key("clear")).grid(
row=2, column=3, rowspan=2, sticky="nsew", padx=3, pady=3)
# 3) Senden
self.send_btn = ttk.Button(body, text="Fax senden", style="Send.TButton",
command=self.send)
self.send_btn.grid(row=5, column=0, sticky="ew", pady=(0, 6))
self.bar = ttk.Progressbar(body, mode="indeterminate", length=100)
self.bar.grid(row=5, column=0, sticky="sew")
self.bar.grid_remove()
def key(self, k):
"""Tastenblock: Zeichen anhängen, letztes Zeichen löschen, alles löschen."""
if self.busy:
return
text = self.num.get()
if k == "back":
text = text[:-1]
elif k == "clear":
text = ""
else:
text += k
self.num.delete(0, "end")
self.num.insert(0, text)
self.num.focus_set()
self.num.icursor("end")
self.update_name()
def build_recv(self, body):
body.columnconfigure(0, weight=1)
body.rowconfigure(1, weight=1)
tools = ttk.Frame(body)
tools.grid(row=0, column=0, columnspan=2, sticky="ew", pady=(0, 10))
ttk.Button(tools, text="Öffnen", style="Tool.TButton",
command=self.open_selected).pack(side="left")
ttk.Button(tools, text="Eingangsordner", style="Tool.TButton",
command=self.open_folder).pack(side="left", padx=8)
ttk.Button(tools, text="Löschen", style="Tool.TButton",
command=self.delete_selected).pack(side="left")
self.tree = ttk.Treeview(body, columns=("date", "size", "name"),
show="headings", selectmode="browse")
self.tree.heading("date", text="Empfangen")
self.tree.heading("size", text="Größe")
self.tree.heading("name", text="Datei")
self.tree.column("date", width=170, anchor="w", stretch=False)
self.tree.column("size", width=80, anchor="e", stretch=False)
self.tree.column("name", width=200, anchor="w")
self.tree.tag_configure("new", font=("Sans", 11, "bold"))
self.tree.grid(row=1, column=0, sticky="nsew")
sb = ttk.Scrollbar(body, command=self.tree.yview)
sb.grid(row=1, column=1, sticky="ns")
self.tree.configure(yscrollcommand=sb.set)
self.tree.bind("<Double-1>", self.open_selected)
self.tree.bind("<Return>", self.open_selected)
self.tree.bind("<Delete>", lambda e: self.delete_selected())
self.recv_info = ttk.Label(body, text="", style="Small.TLabel",
wraplength=480)
self.recv_info.grid(row=2, column=0, columnspan=2, sticky="w",
pady=(8, 0))
def draw_drop(self, hi=False):
c = self.drop
c.delete("all")
c.configure(bg=C_DROP_HI if hi else C_DROP)
w, h = c.winfo_width(), c.winfo_height()
c.create_rectangle(6, 6, w - 6, h - 6, outline=C_BORDER, width=2,
dash=(8, 5))
if self.pdf:
c.create_text(w / 2, h / 2 - 14, text=self.pdf.name, fill=C_TEXT,
font=("Sans", 14, "bold"), width=w - 40)
c.create_text(w / 2, h / 2 + 26,
text="Andere PDF hineinziehen oder klicken zum Ändern",
fill=C_MUTED, font=("Sans", 10))
else:
main = "PDF hier hineinziehen" if HAS_DND else "Hier klicken"
c.create_text(w / 2, h / 2 - 12, text=main, fill=C_TEXT,
font=("Sans", 15, "bold"))
c.create_text(w / 2, h / 2 + 18, text="oder klicken, um eine Datei "
"auszuwählen", fill=C_MUTED, font=("Sans", 10))
def hilight(self, on):
self.draw_drop(hi=on)
def log(self, msg, tag=None):
def _do():
self.log_box.configure(state="normal")
self.log_box.insert("end", f"{datetime.now():%H:%M:%S} ", "time")
self.log_box.insert("end", msg + "\n", tag or ())
self.log_box.see("end")
self.log_box.configure(state="disabled")
self.after(0, _do)
def on_return(self, event=None):
# Eingabetaste sendet nur im Reiter "Senden"
if self.nb.select() == str(self.tab_send):
self.send()
# --------------------------------------------------------------- Datei
def browse(self):
if self.busy:
return
name = filedialog.askopenfilename(
title="PDF auswählen", initialdir=self.cfg["pdf_dir"],
filetypes=[("PDF-Dateien", "*.pdf"), ("Alle Dateien", "*.*")])
if name:
self.set_pdf(Path(name))
def set_pdf(self, path):
if path.suffix.lower() != ".pdf":
messagebox.showwarning("Fax", "Bitte eine PDF-Datei wählen.")
return
self.pdf = path
self.cfg["pdf_dir"] = str(path.parent)
self.draw_drop()
self.log(f"PDF gewählt: {path.name}")
self.num.focus_set()
def on_drop(self, event):
self.hilight(False)
if self.busy:
return
self.nb.select(self.tab_send)
for name in self.tk.splitlist(event.data):
self.set_pdf(Path(name))
break
# ---------------------------------------------------------- Adressbuch
def build_book(self, body):
body.columnconfigure(0, weight=1)
body.rowconfigure(1, weight=1)
tools = ttk.Frame(body)
tools.grid(row=0, column=0, columnspan=2, sticky="ew", pady=(0, 10))
ttk.Button(tools, text="Neu", style="Tool.TButton",
command=self.add_contact).pack(side="left")
ttk.Button(tools, text="Ändern", style="Tool.TButton",
command=self.edit_contact).pack(side="left", padx=8)
ttk.Button(tools, text="Löschen", style="Tool.TButton",
command=self.delete_contact).pack(side="left")
ttk.Button(tools, text="Fax senden an …", style="Tool.TButton",
command=self.use_contact).pack(side="right")
self.book_tree = ttk.Treeview(body, columns=("name", "number"),
show="headings", selectmode="browse")
self.book_tree.heading("name", text="Name")
self.book_tree.heading("number", text="Faxnummer")
self.book_tree.column("name", width=240, anchor="w")
self.book_tree.column("number", width=200, anchor="w")
self.book_tree.grid(row=1, column=0, sticky="nsew")
sb = ttk.Scrollbar(body, command=self.book_tree.yview)
sb.grid(row=1, column=1, sticky="ns")
self.book_tree.configure(yscrollcommand=sb.set)
self.book_tree.bind("<Double-1>", self.use_contact)
self.book_tree.bind("<Return>", self.use_contact)
self.book_tree.bind("<Delete>", lambda e: self.delete_contact())
ttk.Label(body, text=f"Gespeichert in {ADDR_FILE}\n"
"Doppelklick übernimmt die Nummer in den Reiter „Senden“.",
style="Small.TLabel", wraplength=480).grid(
row=2, column=0, columnspan=2, sticky="w", pady=(8, 0))
def refresh_book(self):
self.book.sort(key=lambda c: c["name"].lower())
self.book_tree.delete(*self.book_tree.get_children())
for i, c in enumerate(self.book):
self.book_tree.insert("", "end", iid=str(i),
values=(c["name"], c["number"]))
self.num["values"] = self.num_values()
self.update_name()
def num_values(self):
"""Auswahlliste im Nummernfeld: Adressbuch zuerst, dann letzte Nummern."""
vals = [f"{c['name']} – {c['number']}" for c in self.book]
known = {digits(c["number"]) for c in self.book}
vals += [h for h in self.cfg["history"] if digits(h) not in known]
return vals
def find_name(self, text):
d = digits(text)
if d:
for c in self.book:
if digits(c["number"]) == d:
return c["name"]
return None
def on_pick(self, event=None):
v = self.num.get()
if " – " in v: # Eintrag "Name – Nummer" aus dem Adressbuch
self.num.delete(0, "end")
self.num.insert(0, v.rsplit(" – ", 1)[1])
self.update_name()
def update_name(self, event=None):
name = self.find_name(self.num.get())
self.num_label.configure(
text="2. Empfängernummer" + (f" – {name}" if name else ""))
def selected_contact(self):
sel = self.book_tree.selection()
return int(sel[0]) if sel else None
def store_book(self):
if not save_book(self.book):
messagebox.showerror("Adressbuch",
f"Speichern nicht möglich: {ADDR_FILE}")
self.refresh_book()
def add_contact(self):
dlg = ContactDialog(self, "Neuer Eintrag")
if dlg.result:
self.book.append({"name": dlg.result[0], "number": dlg.result[1]})
self.store_book()
def edit_contact(self):
i = self.selected_contact()
if i is None:
messagebox.showinfo("Adressbuch", "Bitte zuerst einen Eintrag wählen.")
return
c = self.book[i]
dlg = ContactDialog(self, "Eintrag ändern", c["name"], c["number"])
if dlg.result:
self.book[i] = {"name": dlg.result[0], "number": dlg.result[1]}
self.store_book()
def delete_contact(self):
i = self.selected_contact()
if i is None:
messagebox.showinfo("Adressbuch", "Bitte zuerst einen Eintrag wählen.")
return
c = self.book[i]
if messagebox.askyesno("Adressbuch", f"„{c['name']}“ aus dem Adressbuch "
"löschen?"):
del self.book[i]
self.store_book()
def use_contact(self, event=None):
i = self.selected_contact()
if i is None:
messagebox.showinfo("Adressbuch", "Bitte zuerst einen Eintrag wählen.")
return
self.num.delete(0, "end")
self.num.insert(0, self.book[i]["number"])
self.update_name()
self.nb.select(self.tab_send)
self.num.focus_set()
self.num.icursor("end")
# ------------------------------------------------------------- Empfang
def mark_seen(self, name):
seen = self.cfg.get("seen") or []
if name not in seen:
seen.append(name)
self.cfg["seen"] = seen[-500:]
save_cfg(self.cfg)
def refresh_incoming(self):
"""Prüft den Eingangsordner und aktualisiert die Liste."""
try:
self.scan_incoming()
except Exception as exc: # die Aktualisierung darf nie abstürzen
self.recv_info.configure(text=f"Fehler beim Lesen: {exc}")
self.after(REFRESH_MS, self.refresh_incoming)
def scan_incoming(self):
try:
entries = list(INCOMING_DIR.iterdir())
except OSError as exc:
self.recv_info.configure(
text=f"Eingangsordner {INCOMING_DIR} nicht lesbar: {exc.strerror}")
return
self.convert_pending(entries)
files = []
for p in entries:
if p.suffix.lower() != ".pdf":
continue
try:
st = p.stat()
except OSError:
continue
files.append((p.name, st.st_mtime, st.st_size))
files.sort(key=lambda f: f[1], reverse=True)
names = {f[0] for f in files}
# Erster Start: alle vorhandenen Faxe gelten als gelesen
if self.cfg.get("seen") is None:
self.cfg["seen"] = sorted(names)
save_cfg(self.cfg)
seen = set(self.cfg["seen"])
# Meldung bei neu eingetroffenen Faxen
if self.known is not None:
for name in sorted(names - self.known):
self.log(f"📠 Neues Fax empfangen: {name}", "ok")
self.bell()
self.known = names
unread = sum(1 for f in files if f[0] not in seen)
label = f"Empfangen ({unread} neu)" if unread else "Empfangen"
if self.nb.tab(self.tab_recv, "text") != label:
self.nb.tab(self.tab_recv, text=label)
sig = tuple((f[0], f[1], f[2], f[0] in seen) for f in files)
if sig != self.sig:
self.sig = sig
keep = self.tree.selection()
self.tree.delete(*self.tree.get_children())
for name, mtime, size, is_seen in ((f[0], f[1], f[2], f[0] in seen)
for f in files):
when = datetime.fromtimestamp(mtime).strftime("%d.%m.%Y %H:%M:%S")
self.tree.insert("", "end", iid=name,
values=(when, f"{max(size // 1024, 1)} kB", name),
tags=() if is_seen else ("new",))
if keep and self.tree.exists(keep[0]):
self.tree.selection_set(keep[0])
if not files:
self.recv_info.configure(text="Noch keine Faxe im Eingangsordner.")
else:
self.recv_info.configure(
text=f"{len(files)} Fax(e) in {INCOMING_DIR} – "
"Doppelklick öffnet das Fax.")
def convert_pending(self, entries):
"""Wandelt TIFFs ohne PDF um (falls fax2pdf.sh nicht läuft)."""
now = time.time()
for tif in entries:
if tif.suffix.lower() not in (".tif", ".tiff") or tif.name in self.tried:
continue
pdf = tif.with_suffix(".pdf")
try:
st = tif.stat()
except OSError:
continue
if pdf.exists() or st.st_size == 0:
continue
if now - st.st_mtime < TIFF_IDLE_SECONDS:
continue # Empfang läuft vielleicht noch
if not tiff_complete(tif, st.st_size):
continue # Datei noch unvollständig
self.tried.add(tif.name)
threading.Thread(target=self.convert_one, args=(tif, pdf),
daemon=True).start()
def convert_one(self, tif, pdf):
try:
r = subprocess.run(["tiff2pdf", "-o", str(pdf), str(tif)],
capture_output=True, text=True, timeout=120)
except FileNotFoundError:
self.log("tiff2pdf fehlt: 'sudo apt install libtiff-tools'", "err")
return
except (OSError, subprocess.SubprocessError) as exc:
self.log(f"Umwandlung {tif.name} fehlgeschlagen: {exc}", "err")
return
if r.returncode == 0:
try:
tif.unlink()
except OSError:
pass
else:
self.log(f"Umwandlung {tif.name} fehlgeschlagen: "
f"{(r.stderr or r.stdout).strip()[:150]}", "err")
try:
pdf.unlink()
except OSError:
pass
def selected_path(self):
sel = self.tree.selection()
return INCOMING_DIR / sel[0] if sel else None
def open_selected(self, event=None):
path = self.selected_path()
if not path:
messagebox.showinfo("Fax", "Bitte zuerst ein Fax in der Liste wählen.")
return
self.mark_seen(path.name)
self.sig = None # Liste neu zeichnen (Fettschrift weg)
try:
open_external(path)
except OSError as exc:
messagebox.showerror("Fax", f"Öffnen nicht möglich: {exc}")
self.after(200, self.refresh_now)
def refresh_now(self):
try:
self.scan_incoming()
except Exception:
pass
def open_folder(self):
try:
open_external(INCOMING_DIR)
except OSError as exc:
messagebox.showerror("Fax", f"Öffnen nicht möglich: {exc}")
def delete_selected(self):
path = self.selected_path()
if not path:
messagebox.showinfo("Fax", "Bitte zuerst ein Fax in der Liste wählen.")
return
if not messagebox.askyesno("Fax löschen",
f"„{path.name}“ endgültig löschen?"):
return
try:
path.unlink()
for ext in (".tif", ".tiff"):
try:
path.with_suffix(ext).unlink()
except OSError:
pass
except OSError as exc:
messagebox.showerror(
"Fax", f"Löschen nicht möglich: {exc.strerror}\n\n"
"Der Eingangsordner braucht Schreibrechte für die Gruppe "
"asterisk:\n sudo chmod g+w " + str(INCOMING_DIR))
return
self.log(f"Fax gelöscht: {path.name}")
self.sig = None
self.refresh_now()
# -------------------------------------------------------------- Senden
def send(self):
if self.busy:
return
number = re.sub(r"[\s\-/()]", "", self.num.get())
if not re.fullmatch(r"\+?\d+", number):
messagebox.showwarning("Fax", "Bitte eine gültige Empfängernummer eingeben.")
return
number = number.lstrip("+")
if not self.pdf or not self.pdf.exists():
messagebox.showwarning("Fax", "Bitte zuerst eine PDF-Datei auswählen.")
return
name = self.find_name(number)
who = f"{name} ({number})" if name else number
if not messagebox.askyesno("Fax senden",
f"„{self.pdf.name}“ an {who} faxen?"):
return
hist = [number] + [h for h in self.cfg["history"] if h != number]
self.cfg["history"] = hist[:15]
save_cfg(self.cfg)
self.num["values"] = self.num_values()
self.set_busy(True)
threading.Thread(target=self.worker, args=(self.pdf, number),
daemon=True).start()
def set_busy(self, busy):
def _do():
self.busy = busy
if busy:
self.send_btn.configure(state="disabled")
self.bar.grid()
self.bar.start(12)
else:
self.bar.stop()
self.bar.grid_remove()
self.send_btn.configure(state="normal")
self.busy = busy
self.after(0, _do)
def ast(self, command):
r = subprocess.run([ASTERISK_CMD, "-rx", command],
capture_output=True, text=True, timeout=20)
return (r.stdout + r.stderr).strip()
def worker(self, pdf, number):
con = timer = master = None
try:
self.log(f"Kopiere {pdf.name} nach {OUTGOING_DIR}/a.pdf …")
shutil.copyfile(pdf, OUTGOING_DIR / "a.pdf")
try:
(OUTGOING_DIR / "a.tif").unlink()
except OSError:
pass
# Eine dauerhafte Konsolenverbindung zum Mitlesen; Pseudo-Terminal,
# sonst puffert asterisk die Ausgabe bei einer Pipe
master, slave = pty.openpty()
con = subprocess.Popen([ASTERISK_CMD, "-rnvvv"],
stdin=slave, stdout=slave, stderr=slave,
close_fds=True)
os.close(slave)
timer = threading.Timer(900, con.terminate)
timer.start()
time.sleep(1.5)
target = f"Local/{PREFIX}{number}@{CONTEXT}"
self.log(f"Starte Anruf {target} …")
res = self.ast(f"channel originate {target} application Wait 900")
if "rror" in res or "nable" in res or "No such" in res:
self.log("Asterisk meldet: " + res, "err")
return
self.log("PDF wird in TIFF umgewandelt, Verbindung wird aufgebaut …")
self.follow(master, PREFIX + number)
except subprocess.TimeoutExpired:
self.log("Fehler: Asterisk-Konsole antwortet nicht.", "err")
except (OSError, subprocess.SubprocessError) as exc:
self.log(f"Fehler: {exc}", "err")
finally:
if timer:
timer.cancel()
if con:
con.terminate()
if master is not None:
try:
os.close(master)
except OSError:
pass
self.set_busy(False)
def follow(self, fd, key):
"""Liest die Konsolenausgabe mit und meldet den Fortschritt."""
found, called, sending = {}, False, False
for line in read_lines(fd):
if not line:
continue
if "WARNING[" in line or "ERROR[" in line:
self.log("Asterisk: " + line[:200], "err")
if not called and "Called " in line and "Local/" not in line:
called = True
self.log("Empfänger wird angerufen …")
if not sending and "Executing" in line and "SendFAX" in line:
sending = True
self.log("Fax wird übertragen …")
m = NOOP_RE.search(line)
if m:
found[m.group(1)] = m.group(2).strip()
if f"Spawn extension ({CONTEXT}, {key}" in line and "exited" in line:
break
else:
self.log("Zeitüberschreitung oder Verbindung zur Konsole verloren – "
"bitte in der Asterisk-Konsole nachsehen.", "err")
return
status = found.get("STATUS")
if status == "SUCCESS":
self.log(f"✔ Fax erfolgreich gesendet – {found.get('PAGES', '?')} "
f"Seite(n), {found.get('RATE', '?')} bit/s", "ok")
elif status:
self.log(f"✘ Fax fehlgeschlagen: {status} {found.get('ERROR', '')}", "err")
elif sending:
self.log("✘ Übertragung abgebrochen (kein Faxergebnis).", "err")
else:
self.log("✘ Empfänger nicht erreicht (besetzt, nicht erreichbar oder "
"Kanaltyp fehlt) – siehe Asterisk-Meldung oben.", "err")
if __name__ == "__main__":
FaxApp().mainloop()
The script needs the tkinterdnd2 module for drag and drop. Part 1 explains how to install it on Ubuntu 24.04. The program will still work without this module, but you will not be able to drag a PDF into the window. Clicking the area opens the file selection dialog.
Help from the AI Claude: I also developed this extension with the help of Claude AI over the course of a few evenings. Once again, I tested the program with real faxes and copied the messages and output into the conversation. Not every explanation was correct. When the TIFF file was converted too early, the first guess was that it was a permissions problem. That turned out to be wrong. Only after running tiffinfo and tiff2pdf manually did I see that the file itself was fine and that the program was probably trying to process it too soon. If you build something similar, follow the same approach: read the messages carefully, run small tests manually, and share the results.
Conclusion: The result is a fax machine without a physical fax machine or a telephone line. It runs on a Linux computer with Asterisk, receives faxes as PDFs, sends them with a mouse click, and includes an address book. It is not easy to build. Anyone who is not already familiar with Asterisk, Linux permissions, and fax settings will have quite a bit to learn. And if you connect Asterisk to the internet through SIP accounts, take care of APIBAN, Fail2Ban, and port forwarding before putting anything else into operation. This is not a solution for everyone, and if you send just one fax a year, there are easier options. But for me, it has once again been a valuable hands-on lesson in Asterisk, Linux permissions, and Python, and the knowledge can be put to good use in other projects.
Weitere Hinweise auf Reddit: https://www.reddit.com/r/Asterisk/comments/1yb87xk/my_asterisk_fax_gui_is_now_a_complete_linux_fax/
.