tomek-o / tSIP

SIP softphone
https://tomeko.net/software/SIPclient/
157 stars 34 forks source link

Come to foreground, if BLF changes #42

Closed gcey closed 7 months ago

gcey commented 9 months ago

tSIP comes to foreground, if an incoming call arrives. But IMO it should also come to foreground, in the BLF changes (especially if one of the monitored extensions starts ringing).

tomek-o commented 9 months ago

Maybe this would work for you: http://tomeko.net/software/SIPclient/howto/blf_application_show.php. ApplicationShow() function was added today, so it requires current build: https://tomeko.net/tmp/tSIP.exe.

gcey commented 9 months ago

Many thanks for this solution. It works quite well. Just one problem: After "ApplicationShow(false)" tSIP sometimes cannot be hidden by other windows any more (just like "Window allways on top").

tomek-o commented 9 months ago

In the new executable (same link) I've added ShowWindow + HWND_NOTOPMOST call, but there is still some weirdness in bringing window to front without activating it. Perhaps using Lua ShowTrayNotifier function instead of showing main window could be better solution.

gcey commented 9 months ago

In the new executable (same link) I've added ShowWindow + HWND_NOTOPMOST call

You added it internally or I have to change my LUA call "ApplicationShow(false)"?

tomek-o commented 9 months ago

I was talking about last commit, https://github.com/tomek-o/tSIP/commit/30492536c10130e377aece70fcdf05e58d7b6079. Bringing application to front with focus (Lua ApplicationShow(1)) works in consistent way, but that would be awful for anyone that is typing at the moment.

gcey commented 9 months ago

Perhaps using Lua ShowTrayNotifier function instead of showing main window could be better solution.

What would I have to provide as "uri" parameter for "ShowTrayNotifier(description, uri, incoming)"?

tomek-o commented 9 months ago

What would I have to provide as "uri" parameter for "ShowTrayNotifier(description, uri, incoming)"?

Whatever you want, maybe number + state. Description could then contain name from phonebook returned by GetContactName(number).

gcey commented 9 months ago

Oh, I thought "uri" has some specific effect (like a clickable link). And even when I provide true als "incoming" parameter, I just get a "hangup" button, but no "Answer" button. And IMO the tray notifier should automatically disappear after some time.

tomek-o commented 9 months ago

And IMO the tray notifier should automatically disappear after some time.

There is also HideTrayNotifier() function that could be used either from "on timer" script (decrementing some counter set by the last event) or if extension state goes to terminated. I'm not sure though if this would be good enough for monitoring multiple extension, there might be other ways.

gcey commented 8 months ago

Is there also the opposite to ApplicationShow(...)? Maybe ApplicationHide()?

tomek-o commented 8 months ago

I've added ApplicationHide() (hiding to tray) in https://tomeko.net/tmp/tSIP.exe.

gcey commented 8 months ago

Many thanks!