Fritzbox-tr64 Binding Call Monitor not working

Hi,
I’m using openHAB 1.8.2 with the following config for the binding:

fritzboxtr064:url=https://192.168.254.1:49443
fritzboxtr064:refresh=30000
fritzboxtr064:user=openhab
fritzboxtr064:pass=[pass]

items:

Call fboxIncomingCall “Incoming call: [%1$s to %2$s]” { fritzboxtr064=“callmonitor_ringing” }

I can’t see any log message of the call monitor being started on starting openHAB, however. Neither can I see an open connection to the FritzBox in netstat output apart from the TR64 connection:

root@odroid:/etc/openhab/configurations# netstat -an | grep 192.168.254.1:
tcp6 0 0 192.168.254.12:59400 192.168.254.1:49443 ESTABLISHED

I would expect to see a connection to the call monitor port on the fritzbox in addition to the one above.

I already tried the binding .jar fron the latest nightly build but without any difference in behaviour.

Is there anything I’m missing?

Thanks for any help.

Ralph

You should see a log entry in your openhab log like

2016-05-13 08:20:33.033 [INFO ] [.service.AbstractActiveService] - FritzboxTr064 Refresh Service has been started

I don’t use call monitoring, but according to the wiki you have to set:

Enable TR064: In the webui goto “Heimnetz” -
“Netzwerkeinstellungen”: enable option “Zugriff für Anwendungen
zulassen” (enabled by default)

Only if you want to use the call monitor feature (items starting
with callmonitor_…), enable the interface by dialing #965 You may
disable it again by dialing #964

What is the firmwareversion of your Fritz!Box ?
AVM has completely disabled telnet for security reasons with the latest updates.

I followed all the steps documented in the wiki. I had it working with the old fritzbox binding. I also have the message you posted above in my log, I would expect to see a log message telling me that a connection to the call monitor port has been opened though. (TCP/1012)

I have version 6.51 installed on the 7490. I had the call monitor running since a few weeks ago while running the Fritzbox on version 6.50. If I recall correctly AVM removed telnet before 6.50. Furthermore the call monitor is not using telnet acess, but an officially supported service of the FritzBox using a specific port.

If I connect to the port by telnet I can see calls coming in:

Ralphs-MacBook-Pro-2:Downloads ralle$ telnet 192.168.x.y 1012
Trying 192.168.y.x…
Connected to fritzbox
Escape character is ‘^]’.
16.05.16 10:54:36;RING;0;017xxxxxxx;35xxxxxx;SIP0;

I still think the only thing missing here to make it work as it did before is openhab connecting to the call monitor port of the fritz box.

Ralph

Hi,
I encountered the same problem.
In the end I decided to write a short shell script and use the exec binding.
Works for me although I would prefer to use the “official” Fritzbox-tr64 binding.
Cheers
Björn

Would you share your script as a workaround until the binding gets fixed?

Certainly:

One Shell script called CheckCallIN.sh:

'#!/bin/bash

netcat -d 192.168.1.1 1012 | while read logline;
do
if [[ “$logline” = ;RING; ]]; then
echo “ON” > /data/FritzBox/Call.log
DATE=$( echo $logline | cut -f1 --delimiter=“;”)
echo $DATE > /data/FritzBox/DatumLetzterAnruf.log
NUMBER=$( echo $logline | cut -d’;’ -f4)
echo $NUMBER > /data/FritzBox/NummerLetzterAnruf.log
fi

done

Another one called CheckCallOUT.sh:

'#!/bin/bash

netcat -d 192.168.1.1 1012 | while read logline;
do
if [[ “$logline” = ;DISCONNECT; ]]; then
echo “OFF” > /data/FritzBox/Call.log
fi
done

Shell script in init.d Directory to autostart the client (scripts afore) - (I know it is “dirty”):

'#! /bin/sh

case “$1” in
start)
cd /data/FritzBox
nohup ./CheckCallIN.sh &
nohup ./CheckCallOUT.sh &
;;
stop)
pkill -INT ./CheckCallIN.sh
pkill -INT ./CheckCallOUT.sh
;;
restart)
echo “does not work”
;;
esac

exit 0

Both scripts write their results in the file Call.log. So far everything is Independent of OpenHAB.

A short php script (FritzBoxAuslesen.php) provides the echo of this file to OpenHAB:

<?php $out = file_get_contents('/data/FritzBox/Call.log', true); echo $out; ?>

In items file in OpenHAB (calles the FritzBoxAuslesen.php every second to check the Status):

Switch Ring “Anruf [%s]” (FritzBox) {exec=“<[php /data/FritzBox/FritzBoxAuslesen.php:1000:REGEX((.*?))]”}

Maybe “through the back in the eye”, however it works.
Cheers
Björn
PS: Any suggestions welcome.

2 Likes