Setting presence status at login/logout without Windows Client

Status
Not open for further replies.

teenet_au

Bronze Partner
Advanced Certified
Joined
Feb 26, 2021
Messages
40
Reaction score
8
Hi,

Is there a way to set the extension presence status during login/logout script when using the Web Client only?.

I currently have the Windows Client V16 installed on all workstations and I am executing "CallTriggerCmd.exe -p" during the login/logoff scripts to set presence status to "Available / Away / Working Remotely (aka Custom 1)" as appropriate. This works fine 99% of the time although on rare occasions it hiccups every now and then if for some reason the Windows Client is not running at logoff or Windows Client hasn't completed initialisation yet when command is executed during login. Regardless I am generally happy with this setup even though script is somewhat slow and error handling is clunky.

However from my reading it appears like 3CX opinion is the Windows Client is pretty much a dead product in favour of the Web Client.

Looking to the future is there a way to achieve same result without the need for the Windows Client. Setting the presence is the only reason we have Windows Client installed on workstations as we encourage and only train users on the use of the Web Client so generally users never interact with the Windows Client. If I could do presence setting without the Windows Client I would prefer not to have to install or maintain it.
 
I'm afraid there is no built-in function to automatically change an extension's profile status based on whether a user is logged into the PC or not. What will happen automatically though is the extension will become unregistered, provided of course that it is not used anywhere else and that "Ring my mobile simultaneously" is not enabled. That said, is there any specific reason you are not utilizing the Extension's Unregistered instead? What is the end result and why do you need extensions to switch to DND when they log off, perhaps there is workaround we can offer depending on the situation.
 
All extensions have IP phone handsets which is the primary call handing method. The Web Client is only used for access to 3CX features beyond basic call tasks and use Web Client to CTI with the extension IP Phone. We do not use softphone functionality, except for a couple staff when they are working remotely and they don't have smartphones with 3cx app.

We switch to "Away" when logged out and not DND. DND is only used from the handset to identify the person is in but not taking calls.

This of course means all extensions are always registered. We also need to identify when someone is logged in from the office or from home which we can detect in the login script. Basically staff need to be able to see from the presence info screen if other staff are logged in in office, logged in at home or logged out and also have extensions calls routed as appropriate for given circumstance.

What we have now works fine even though its clunky, it does what we need. Was just hoping there was a more elegant solution that does not rely on the Windows Client. e.g. some kind of API call direct to the server. The CallTriggerCmd.exe command isn't the easiest program to interact with from a script. Also read somewhere that the Windows Client was considered depreciated and going to be retired eventually.
 
We have a REST API that can do this.
 
I have a little script in my windows logon batch which sets an extenson to available. 3CX for Windows has to be installed and has to run.

Code:
rem ################ Set 3CX to available ##########################
for /f "tokens=1" %%i in ('"C:\ProgramData\3CXPhone for Windows\PhoneApp\CallTriggerCmd.exe"  -p ^|findstr Available') do set "myVar=%%i"
"C:\ProgramData\3CXPhone for Windows\PhoneApp\CallTriggerCmd.exe" --set-active-profile=%myVar%

This lists all options (text) for findstr, change argument after findstr to set different status
Code:
"C:\ProgramData\3CXPhone for Windows\PhoneApp\CallTriggerCmd.exe"  -p 

397     Away
400     Available
399     Custom 1
398     Out of office
396     Custom 2
-1      Exceptions
-2      CustomHours
 
  • Like
Reactions: VoIPTools
@autohaus

Thanks for that, my script was sending the output of ' CallTriggerCmd.exe -p | find "Available" ' to a temp file and then reading it in to a SET variable. Your way is much more elegant.

I do sometimes run in to issues where 'CallTriggerCmd.exe -p" returns an error so I test for %ERRORLEVEL%==-1 and delay 5 seconds and try again. I think this is because sometimes the Windows Client has not finished initialising when the comand is CallTriggerCmd.exe called. Do you have similar problems?
 
  • Like
Reactions: autohaus
@VoIPTools

Actually I had come across that product. Just way too expensive just for this purpose. Issue is that the site in question only has 50 staff but a 32SC licence (not many staff but a lot of concurrent calls) so over AU$2,800/yr for this is just not feasable. It's more than the actual 3CX licence.
 
All extensions have IP phone handsets which is the primary call handing method. The Web Client is only used for access to 3CX features beyond basic call tasks and use Web Client to CTI with the extension IP Phone. We do not use softphone functionality, except for a couple staff when they are working remotely and they don't have smartphones with 3cx app.

We switch to "Away" when logged out and not DND. DND is only used from the handset to identify the person is in but not taking calls.

This of course means all extensions are always registered. We also need to identify when someone is logged in from the office or from home which we can detect in the login script. Basically staff need to be able to see from the presence info screen if other staff are logged in in office, logged in at home or logged out and also have extensions calls routed as appropriate for given circumstance.

What we have now works fine even though its clunky, it does what we need. Was just hoping there was a more elegant solution that does not rely on the Windows Client. e.g. some kind of API call direct to the server. The CallTriggerCmd.exe command isn't the easiest program to interact with from a script. Also read somewhere that the Windows Client was considered depreciated and going to be retired eventually.
Why not add BLF Speed dials for status Away and available? This way they can change it themselves to Away when they leave, just as they would use for DND.
 
@Frederick Marcoux

Yeah, thought of that origionally, great in theory but I can tell you now that would never actually happen in real life. Also it doesnt identify work from home because they don't have handsets at home. Solution has to be automated and no user action required - can't trust users to remember to do something because it just won't happen reliably. Idealy would love to put sensors in their seats to set status :p
 
  • Like
Reactions: autohaus
I do sometimes run in to issues where 'CallTriggerCmd.exe -p" returns an error so I test for %ERRORLEVEL%==-1 and delay 5 seconds and try again. I think this is because sometimes the Windows Client has not finished initialising when the comand is CallTriggerCmd.exe called. Do you have similar problems?

Good point. Normally my startup script is slow enough :) , but I'm going to add a test to my script. Best would be some tests: Is windows client installed? Is windows client runing? Is a profile configured?

I have 3CX windows client only installed on computers which have a Plenom kuando busylight attached. Somtimes employes "forget" to switch back to available -> therefore automatic switch by logon script.
 
Status
Not open for further replies.

Forum statistics

Threads
111,832
Messages
589,284
Members
164,662
Latest member
DejanMDS