fritzconnection documentationΒΆ

fritzconnection is a Python library to communicate with the AVM Fritz!Box by the TR-064 protocol. This allows to read status-informations from the box and to read and change configuration settings and state. Also realtime phone call monitoring is provided.

_images/fritzconnection-360x76.png

The available services are depending on the Fritz!Box model and the according system software. fritzconnection can list and access all available services and actions of a given box. Using fritzconnection is as easy as:

from fritzconnection import FritzConnection

fc = FritzConnection(address='192.168.178.1')
fc.reconnect()  # get a new external ip from the provider
print(fc)  # print router model informations

The reconnect() method wraps the call_action() method. A reconnection by means of call_action() would look like this:

fc = FritzConnection(address='192.168.178.1')
fc.call_action("WANIPConn1", "ForceTermination")

With the call_action() method every service/action combination documented by the AVM support-page (Apps/TR-064) can get executed. For more information refer to Introduction.

fritzconnection comes with a library to make some common tasks easier and to serve as examples how to use fritzconnection. The library also provides a fritzmonitor module for accessing the call-monitor interface of the Fritz!Box to get realtime informations about incoming and outgoing phone calls:

from fritzconnection import FritzMonitor

fm = FritzMonitor(address='192.168.178.1')
event_queue = fm.start()  # start monitoring
# event_queue is queue.Queue instance, do event handling here ...
fm.stop()  # stop monitoring

This is described in more detail in Call Monitoring.

Note

fritzconnection is neither related nor supported by AVM. Also AVM reserves the right to add, modify or remove features of their products at any time without notice.