fbCallMute on [SWEn.NEt]  
 

fbCallMute for Moode Audio Player

[ DE | EN ]

(version 07/31/2022)

fbCallMute is a Perl script that stops/starts the audio output for incoming/outgoing calls on a FritzBox on a Raspberry with Moode Audio as soon as a call is received/terminated. The script should also work with the MPD without Moode Audio.

You can find the script in the version of 07/31/2022 here.

Incoming calls are queried via the FritzBox Call Monitor.

To enable the Call Monitor on your FritzBox you have to dial the short code ...
#96*5*
... from a phone connected to your FritzBox.

With ..
#96*4*
...you can disable the CallMonitor again.

You can test the Call Monitor via Putty or Telnet Hostname fritz.box Port 1012.
telnet fritz.box 1012
But don't get confused, there is only something when there are call activety

Installation:

Login to the Moode Audio Player using ssh or putty:
    ssh pi@<moodeip>
I'n sure you will find the default password using the search engine of your choice....

Download script:
    wget https://www.swen.net/fbcallmute/fbcallmute.pl

start the script:
    perl ./fbcallmute.pl

Install script as a service (autostart):
    sudo perl ./fbcallmute.pl --install

Parameters for the FritzBox IP address or hostname, port or commands to stop and start audio output can be customized via command line parameters or a configuration file.

Adapting the configuration:

Script parameter adjustment is possible via command line parameters and through a configuration file fbcallmute.conf. The name of the configuration file is the script name with .conf instead of the .pl as file extension. (So fbcallmute.conf with script name fpcallmute.pl). The parameters can be specified command line preceded by --. e.g.
./fbcallmute.pl --remote_host=192.168.178.1

fbCallMute Parameter:

parametervalues
--configfile<configurationfile> (default scriptpfad/sciptname.conf)
--remote_hostFritzBox IP address or hostname (default fritz.box)
--remote_portTCP-Port of the FritzBox CallMonitor (default 1012)
--reconnectreconnect Time until the connection is reestablished in seconds. (default is 4 hours (240 minutes * 60 seconds))
--mpc_cmdPath to the mpc command (default /usr/bin/mpc)
--mpcmuteparmmpc command to stop audio output (default stop)
--mpcresumeparmmpc command to start audio output again (default play)
--moodecmdpathPath to the Moode program directory (default /var/www/command)
--systemdfilesPath to the systemd configuration directory (default /etc/systemd/system)
--servicenamesystemd service name (default fbcallmute)

Other command line parameters:

    ./fbcallmute.pl --install # installs fbCallMute in the Moode Audio prorgam directory and as service in the system (autostart)
    ./fbcallmute.pl --createconfig # writes a configuration file (parameter --configfile) (all parameters will be added to the new configuration file.).

You can freely use and modify this script.
I take no responsibility for any damage that may occur through this script.



[Valid HTML 4.0 Transitional]