04-25-2017 02:39 PM
Hi,
I need to get the agent id that the supervisor selected for monitor. How can I get the agent id?
Thanks.
Danny
Solved! Go to Solution.
04-28-2017 11:05 AM
Hi Denise,
Finally, I am able to grab the agent's call variable from supervisor.
BTW: the dialog count is always 1 so that was not good. If the callType is SUPERVISOR_MONITOR then there is a getToAddress() that is the agent's extension. The _processCall function was called a few time so had to check if the user.getState() is "ALERTING" then only request agent's call variables using signalR.
Now it is working..
Thanks.
04-25-2017 02:56 PM
Hi Danny,
Since calls are related to extensions (mediaAddress) versus the agent's Id, you cannot get it from the dialog events itself. Also, there isn't an API for reverse lookup on extension to agent Id.
So, the only thing I can think of is to call the GET team list API with Supervisor credentials and parse through the response. You would need to find the user with the right extension and grab the id from that.
Thanx,
Denise
04-25-2017 03:07 PM
HI,
Thanks for the fast response.
There are so many users. Is there a way to know which user the supervisor selected for monitoring?
Thanks.
04-25-2017 03:11 PM
The gadget itself might know when it is selected, but the Team performance gadget code is not open source, so you won't be able to get that information anyways.
Thanx,
Denise
04-25-2017 03:17 PM
Hi,
But we it is not advisable to monitor the monitor gadget, right. If there a way to create a custom gadget that can capture the event in the monitor gadget so that I can find which which agent id selected?
Thanks.
04-25-2017 03:22 PM
Hi,
Here is sample codes that I found:
JsDoc Reference - finesse.restservices.Users
The API returned all the users that belongs to the supervisor. If can get the selected agent in the monitor gadget then I will loop through and find the login id.
Thanks
Danny
04-25-2017 03:33 PM
Hi Danny,
That is exactly what I had suggested earlier. To get the list of agents in the supervisor's team, then loop through to find the login Id. I just suggested the REST API versus the javascript API.
Where exactly are you trying to do this? And why do you need this?
Thanx,
Denise
04-25-2017 04:55 PM
Hi Denise,
Client moved from CTIOS agent desktop to Finesse. In CTIOS, on the supervisor side codes were added to grab the agent desktop call variables when the supervisor client on the agent in the monitor table. CTIOS + C#, a lot can be done.
Client is requesting the same features for the supervisor in Finesse. I have created a custom gadget for agent and supervisor and assigned to agent and supervisor respectively. I am using signalR (chat technology) to the gadgets. On the supervisor side, I have added a front-end that consists of read-only call variables to display requested agent's call variables, entry field and button. The entry field is for testing only so that I can enter the agent's id and click on the button. The button will send a signal request to the agent to request call variables (JSON format) be send to the supervisor. It is working as the supervisor can see the agent's call variables. Agent's custom gadget waits for the request, format the call variable in JSON format and send it back to the supervisor.
Now the only thing that is missing on custom gadget (supervisor side) is to capture the agent id when the supervisor click on the agent in the monitor gadget so that I can call the signalR and request for agent's call variables. Automation and less number of clicks like CTIOS C#.
Thanks.
Danny
04-25-2017 10:26 PM
Hi Danny,
Thank you for the detailed information.
In the custom gadget on the supervisor side:
1) You would want to listen to the dialog events and trigger when the supervisor gets a new call. Assuming your gadget is based off of the sample gadgets, this would be the handleNewDialog function.
2) In this function, you want to filter out the silent monitor calls by checking the callType. Silent monitor calls have a callType of SUPERVISOR_MONITOR.
3) Then, if it is a silent monitor dialog, grab the participants and loop through the two to find the extension that doesn't match the supervisor's extension.
4) When you find this participant, get the mediaAddress of this participant. This is the extension of the agent that is being monitored.
5) Call the list of teams that the supervisor supervises.
6) For each team, get the list of users in that team.
7) Iterate through them and find the agentId that matches the extension.
This is the only way I can think of at the moment. I hope this helps.
Thanx,
Denise
04-26-2017 11:35 AM
Hi Denise,
My colleague and I decided to make a small changed on our side instead of using the agent id to communicate between the supervisor and agent we are using extension instead. Less coding is much better.
I tried all your steps and below is what we found:
1. I can debug and see the call comes in and filter using callType SUPERVISOR_MONITOR.
2. Look through grab the participants and found 1 participant only that is the supervisor himself. Below are the codes.
// only interested in Supervisor monitor..
if ( callType === "SUPERVISOR_MONITOR")
{
logMessage(funcName, ",*********** start supervisor monitor **************.");
// force the IE browser to open up
// this is because the IE browser may be behind other programs. This should
// bring the Browser to the front.
var _participants = dialog.getParticipants();
for (var participant in _participants) {
logMessage(funcName, ",*********** participant.mediaAddress=" +
_participants[participant].mediaAddress );
}
// TODO: Replace me when done.
$("#agentExtension").val("5140001103");
gadgets.window.adjustHeight();
logMessage(funcName,"extension=" + $("#agentExtension").val());
finesse.modules.SignalRSupervisorScreenPopsGadget.ExecuteRequestCVUrl();
}
Note: any issues with the codes above.
3. list of teams - I can see all the teams that is associated with the supervisor, codes below:
var supervisorTeams = user.getSupervisedTeams();
// a supervisor can have many teams assigned to it.
for ( var supervisorTeamIdx in user.getSupervisedTeams())
{
logMessage(funcName, "teamMember.id=" + supervisorTeams[supervisorTeamIdx].id +
",teamMember.name=" + supervisorTeams[supervisorTeamIdx].name +
",teamMember.uri=" + supervisorTeams[supervisorTeamIdx].uri);
var agentID = supervisorTeams[supervisorTeamIdx].uri.split("/");
logMessage(funcName, "agentID.length=" + agentID);
logMessage(funcName," agentID=" + agentID[agentID.length-1]);
//getUsers(supervisorTeams[supervisorTeamIdx].uri);
var supervisorTeamUsers = supervisorTeams[supervisorTeamIdx].getUsers();
// so loop through each team and list the team members.
for( var teamUsers in supervisorTeams[supervisorTeamIdx].getUsers())
{
logMessage(funcName,"teamUsers.extension=" + supervisorTeamUsers[teamUsers].getExension());
logMessage(funcName,"teamUsers.lastName=" + supervisorTeamUsers[teamUsers].getLastName());
logMessage(funcName,"teamUsers.firstName=" + supervisorTeamUsers[teamUsers].getFirstName());
}
}
4. For each team, get the list of users in that team. Below is the code
var supervisorTeamUsers = supervisorTeams[supervisorTeamIdx].getUsers();
No such function exist or not available in debug mode. Not sure why as finesse.restservices.User indicates there is a getSupervisedTeams function.
Just to let you know. Since we changed the signalR communication between supervisor and agent using extension agent id is not longer important and the teams and users in the team is no longer important.
The only issues we have is the participants - always 1.
Thanks.
danny
04-26-2017 02:06 PM
Hi Danny,
Sorry, I looked at the events on my system and you are right that it only shows one participant when the call arrives. If you look at the string of events that the supervisor gets, it will eventually have 2 participants. So, instead of checking in the handleNewDialog, you need to check it when the dialog object changes. If you are using a sample, that would be in the _processCall method.
Thanx,
Denise
04-26-2017 02:27 PM
Hi Denise,
Thanks for the fast response. Yes, I am using _processCall method. So I need to loop through the dialog example:
var _dialogCollection = dialogs.getCollection();
for (var dialogId in _dialogCollection) {
}
Is that what you are referring to?
Thanks
Danny
04-26-2017 02:37 PM
Hi Danny,
No, I mean that you should ignore any dialog that only has 1 participant (with the callType of SUPERVISOR_MONITOR). When you get a dialog with 2 participants, then you grab that extension and send it off. If you want it to happen only one time, you can probably check the participant state too.
Thanx,
Denise
04-26-2017 02:48 PM
Hi,
Ok, I will try again tomorrow. But today in debug mode, when I click on Start Monitoring _processCall. As I had a break point at checking if call Type is Supervisor Monitor as shown below:
callvars = dialog.getMediaProperties(); |
var callType = callvars.callType;
var supervisorExt = dialog.getFromAddress();
// only interested in Supervisor monitor..
if ( callType === "SUPERVISOR_MONITOR")
{
}
I have try and catch on all codes in the function. If there were exception it would have show up in the exception.
04-28-2017 06:12 AM
Hi Denise,
Any idea how to get the agent's extension when supervisor is monitoring an agent?
Thanks.
Danny
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide