Picture of Tomas 1082
Registered 11 years 342 days
Tomas 1082 Tuesday, 20 April 2021, 07:23 AM
Best way to monitor wq and agents
Hi, I have been testing with the RCC api to get a live overview of what is happening on a waiting queue. Including information to be able to calculate total/busy agents, amount of calls waiting on the queue, time waited etc. UserInitialize on the queue it self seemed to miss info on the agents. I tried also Initialize on the group and then I get agent calls/info but I am not sure how to find the correlation between the call to the agent and the call to the queue and how to tell the difference between a queue call and a direct call. Any idea on which elements to pull to get the right info? Or do I need to use another api? thanks, Tomas
2013
Moderator Registered 16 years 15 days
Guntram Diehl (innovaphone) Tuesday, 15 June 2021, 10:22 AM
Re: Best way to monitor wq and agents
You should do the following things: - Connect to an App Object, which is active member of the waiting object group and has RCC enabled - do Initialize - you get a list of all group members - do UserInitialize on the Waiting object and all other members - The leg2 in the call info from the operators show if this is a call thru the waiting object Find attached example Messages for this (Waiting object: Waiting300, Operator: Atlantis) with an incoming call from Endeavour and PBX config used messages.txt
Picture of Tomas 1082
Registered 11 years 342 days
Tomas 1082 Tuesday, 13 July 2021, 01:09 PM
Re: Best way to monitor wq and agents
Hi Guntram, thanks for your reply. I have tested this a little, but have a few questions. The "user id" from the UserInitialiZeResult seem to be lost at some point after some time out, resulting in no data when calls coming in through the wq. So it is no longer valid and a new UserInitialize have to be done, which will return a new "user id". What is the best way to check if the original id is still available / not timed out? Also, the UserInitializeResult does not have any link to the original request (eg cn). How can we be sure which user the response is for? Regards Tomas
Andreas Fink
Moderator Registered 13 years 52 days
Andreas Fink (innovaphone) Tuesday, 13 July 2021, 01:24 PM
Re: Best way to monitor wq and agents
Hello Thomas,

as long the WebSocket connection persists, you can rely on valid user and call ids. Probably in your case, the WebSocket connection was established again (e.g. PBX reboot), so you have to handle this case and reinitialize users.

As I know, there is no way to check the validity of the user id (Guntram plase correct me, if not so).

To match UserInitilaize and UserInitilaizeResult messages, src property should be used. The Result will contain corresponding src value, that was set in the initial request.

Best Reagards
Andreas Fink
Picture of Tomas 1082
Registered 11 years 342 days
Tomas 1082 Tuesday, 13 July 2021, 02:24 PM
Re: Best way to monitor wq and agents
Hi Andreas, thanks.

It is possible to try and call using a user id and if no response it can be considered dead. However thats not a good way of doing things.. It should have been possible to check the validity of an id or maybe fetch all the current active ids' in the current session somehow.

By the way what is the best way to check the session and keep the session open? I have seen "mt": "keepalive" or something like this before but if I remember correctly there was no response on this command.

Of course the src could be used to match the response, I should have known. Is it also true that the pbx will always respond in the same order the request were received (UserInitialize)?

Tomas
Andreas Fink
Moderator Registered 13 years 52 days
Andreas Fink (innovaphone) Tuesday, 13 July 2021, 04:37 PM
Re: Best way to monitor wq and agents
The best pattern on this issue is to make sure, in case WebSocket connection is closed, to clean up all user ids and call ids of this RCC connection.

You can send a message with {"mt":"KeepAlive"} from time to time, to make sure the TCP connection accepts data. Otherwise it will be closed and you know that all ids are invalidated at the moment.

I would not rely on the correct order of the messages here. Instead, you could send the following UserInitialize first, when result for previous one was delivered.

We could discuss it in the SDK Dialog, in case the questions are still open.
← You can define your color theme preference here