Please change behaviour of Fritzbox

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
joshimosh
Posts: 58
Joined: Friday 29 May 2015 7:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Please change behaviour of Fritzbox

Post by joshimosh »

I am using the Fritzbox call monitor to signal incoming calls. This work pretty well, but ;-)

There are two Fritzbox devices which can be used together with a lua script: a text "device", which delivers the calling phone number and a switch device, which changes from "Off" to "On" when a call is picked up.

When the phone rings, I see in lua a device change of the text device, which triggers my script (and which I use to display the calling number). There is also an entry in the protocol of the device. When the call is picked up, the change from "Off" to "On" gives me another trigger - fine. When the call is finished, the switch related to Fritzbox changes from "On" to "Off" and triggers my script (where I turn off the display of the calling number). The protocol of the text "device" also shows an entry (Disconnect), but this does *not* trigger my lua script (no device_changed). It would - in my view - be an improvement, if a disconnect signal from Fritzbox would not only produce an entry in the device's protocol, but also would trigger a device_changed.
The reason for this suggestion is, that if it rings and the call is not picked up, I never get a trigger when the caller disconnects, because the switch mentioned above does not change (it changes only if the call is picked up) and the text "device" only fires on RING, but not on DISCONNECT.

So, may I suggest that the text "device" of Fritzbox also signals a change to the event system, when there is a DISCONNECT from the Fritzbox.

Thank you for considering my suggestion.

Josh
User avatar
gizmocuz
Posts: 2548
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Please change behaviour of Fritzbox

Post by gizmocuz »

It should update on disconnect, if possible please check the code (not large) of FritzboxTCP.cpp
Quality outlives Quantity!
joshimosh
Posts: 58
Joined: Friday 29 May 2015 7:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Please change behaviour of Fritzbox

Post by joshimosh »

OK, I will have a look at the source code (later today, gotta run now).
But I am sure that a disconnect does not trigger my lua script.
I'll be back to you later.
Thank you
Josh
joshimosh
Posts: 58
Joined: Friday 29 May 2015 7:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Please change behaviour of Fritzbox

Post by joshimosh »

I had a look at the code, but since there are only very few comments, I have not really understood what is going on there.
My best guess is that the incoming messages from the Fritzbox are parsed in ParseLine(), but I have no idea where the event system gets notified. In the general logfile I have entries when Fritz sends CALL or RING and device events (deviceChanged) are triggered. In the device specific log I also see entries when Fritz sends CONNECT or DISCONNECT, but there are no entries in the general logfile (domoticz.log) and no device event occurs.
I must admit that I am not the best C++ pgrogrammer in the world and I may perhaps not have seen omething very obvious in the code. I only can again emphasize that in my environment (V2.3608) the event system does not trigger when Fritz sends DISCONNECTs, while CALL and RING work as one should expect.

Sorry, but I am afraid that I am at the end of my possibilities.

Cheers
Josh
User avatar
gizmocuz
Posts: 2548
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Please change behaviour of Fritzbox

Post by gizmocuz »

As you can see in the code, the following is handled:

if (Cmd == "CALL")
else if (Cmd == "RING")
else if (Cmd == "CONNECT")
else if (Cmd == "DISCONNECT")

so that's all there can be handled

"CALL"
- text sensor change

"RING"
- text sensor change

"CONNECT"
Switch change

"DISCONNECT"
Switch change
Quality outlives Quantity!
joshimosh
Posts: 58
Joined: Friday 29 May 2015 7:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Please change behaviour of Fritzbox

Post by joshimosh »

Thanks a lot for the explanation - I did not see that :oops:
But it confirms what I see in my logs and in my lua script. May I ask you to review this choice (RING and CALL change text sensor, CONNECT and DISCONNECT change switch sensor) ? If you use RING to inform about an incoming call and the ID of the caller, then you can only remove this information when the call is connected, because only then you will have a switch change on DISCONNECT. If there is no CONNECT change (because the call is not taken), then (quite obviously) there is no DISCONNECT change and your lua script has no chance to remove the information about the call.
A switch change on DISCONNECT would not help, since there was no CONNECT before and thus it is not a change. My suggestion would be to have a text change *and* a switch change on DISCONNECT. I have no idea of any unwanted side effects - you are in a much better position to judge it.

Again, thank you for the background information.

Cheers
Josh
User avatar
gizmocuz
Posts: 2548
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Please change behaviour of Fritzbox

Post by gizmocuz »

Okey, i have seen in the code that i silently updated the textbox, so you could not use this in an event

Could you try beta #3617 to see if this is working for you ?
Quality outlives Quantity!
joshimosh
Posts: 58
Joined: Friday 29 May 2015 7:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Please change behaviour of Fritzbox

Post by joshimosh »

gizmocuz wrote:Okey, i have seen in the code that i silently updated the textbox, so you could not use this in an event

Could you try beta #3617 to see if this is working for you ?
Of course ! Thank you very much !

I am currently not at home, but I hope that I can give it a try this afternoon.
I'll report back asap.

Again thank you for implementing it ob short notice.
Cheers
Josh
joshimosh
Posts: 58
Joined: Friday 29 May 2015 7:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Please change behaviour of Fritzbox

Post by joshimosh »

Sorry, it took some time because of a relatively busy afternoon, but it works now as expected. I called from my mobile, got a RING and my script was triggered. I did not pick up but cancelled the call on my mobile, got a DISCONNECT and my script was trigered again with a disconnect text message.
Thank you very much !
Have a nice evening and a wonderful weekend
Josh
Bluelightcrew
Posts: 19
Joined: Thursday 02 February 2017 20:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.6708
Location: Deutschland
Contact:

Re: Please change behaviour of Fritzbox

Post by Bluelightcrew »

joshimosh wrote:Sorry, it took some time because of a relatively busy afternoon, but it works now as expected. I called from my mobile, got a RING and my script was triggered. I did not pick up but cancelled the call on my mobile, got a DISCONNECT and my script was trigered again with a disconnect text message.
Thank you very much !
Have a nice evening and a wonderful weekend
Josh
Could you share the script, I try some similar
Benneton
Posts: 114
Joined: Thursday 08 December 2016 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Please change behaviour of Fritzbox

Post by Benneton »

Hi,

Would be great indeed when you can share this.
I tried to build this with blocky but I could not get it to work.
I know that is NOT a Blocky / Domoticz problem but most likely a user error :)

Thank you,
Benneton
honselbonsel
Posts: 18
Joined: Thursday 17 August 2017 20:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Please change behaviour of Fritzbox

Post by honselbonsel »

Hi,
i would also be very happy if anybody may share the code for this :-)

Thank You
br
Jens
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest