Genesys CTI User Forum

Genesys CTI User Forum => Genesys-related Development => Topic started by: fabio.meschini on January 19, 2015, 05:32:47 PM

Title: How to Read all agent of a Agent Grroup (or Group Target)
Post by: fabio.meschini on January 19, 2015, 05:32:47 PM
Hi all,

i'm using the 7.6 psdk api and i need to read on configuration server all information regarding all agent contained into a VAG or GT.

I think that i need to do 2 different requests (RequestReadObject), one for retrieving the VAG (CfgAgentGroup) and the 2nd request for filtering the agent (CfgPerson).
Can anybody suggest me a way for retrieve agents information throught a single request? I'm evaluating also a possibile upgrade of the psdk api.

Thanks a lot,

FABIO
Title: Re: How to Read all agent of a Agent Grroup (or Group Target)
Post by: Kubig on January 20, 2015, 06:26:36 AM
do not know PSDK 7.6 a lot, but within latest PSDK versions you can use CfgQuery and get/filter data at one "place". Try to read doc about it.
Title: Re: How to Read all agent of a Agent Grroup (or Group Target)
Post by: kerry.finlayson on January 21, 2015, 07:32:08 AM
Hi Fabio,

I am using a later version of the psdk but this is how we retrieve the agent username from a particular VAG:

CfgAgentGroupQuery agentGroupQuery = new CfgAgentGroupQuery(_confService);
                agentGroupQuery.Name = vagid;
                CfgAgentGroup agentGroup = _confService.RetrieveObject<CfgAgentGroup>(agentGroupQuery);
                List<string> agentList = new List<string>();
                foreach (var agent in agentGroup.Agents)
                    agentList.Add(agent.UserName);
                return agentList;

Hope that helps,
Kerry.
Title: Re: How to Read all agent of a Agent Grroup (or Group Target)
Post by: fabio.meschini on January 23, 2015, 09:15:14 AM
Thank you so much for your replies.
I've decided to upgrade psdk for using confservice and CfgQueries as you suggest me.
Thank you!
Fabio