Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: pinguin on September 27, 2015, 05:41:44 AM

Title: Work out folder path in which an Agent Login is located...
Post by: pinguin on September 27, 2015, 05:41:44 AM
Just wondering if anyone can guide me through the SQL that would return the path to the SWITCH name if I start with the Agent Login value.

So, if the Agent Login in question was in .../SWITCH1/Agent Logins/Top Floor/West Side/Front/123456 (where 123456 is the Agent Login), how would I work out the path between the Agent Login and the Switch if I was given the value 123456 to begin with?

Many thanks!
Title: Re: Work out folder path in which an Agent Login is located...
Post by: Dionysis on September 29, 2015, 01:34:42 PM
What are you trying to achieve with this?  Sounds like perhaps you should be using the PSDK for this type of function.

Accessing the database directly is normally frowned upon as Genesys can alter the schema with newer versions.
Title: Re: Work out folder path in which an Agent Login is located...
Post by: Tambo on September 29, 2015, 01:39:44 PM
use the search function in CME that will give you the folder path
Title: Re: Work out folder path in which an Agent Login is located...
Post by: cavagnaro on September 29, 2015, 01:49:31 PM
[quote author=Tambo link=topic=9125.msg41000#msg41000 date=1443533984]
use the search function in CME that will give you the folder path
[/quote]

I think he wants the SQL code...no clue why
Title: Re: Work out folder path in which an Agent Login is located...
Post by: Tambo on September 29, 2015, 01:52:53 PM
better hope no-one moves agents about then  ;D
Title: Re: Work out folder path in which an Agent Login is located...
Post by: Adam G on September 29, 2015, 09:11:20 PM
I [i]think [/i]you are asking [i]"How can I get the Switch name of an Agent, by entering their LoginID, using plsql?"[/i]

Make sure you are using this Query to [i]READ ONLY[/i] and run it against your cfg database [i]at your own risk[/i]:

[font=times new roman][color=blue]SELECT CFG_AGENT_LOGIN.LOGIN_CODE,
  CFG_PERSON.FIRST_NAME,
  CFG_PERSON.LAST_NAME,
  CFG_PERSON.EMPLOYEE_ID,
  CFG_PERSON.USER_NAME,
  CFG_SWITCH.NAME AS "SWITCH NAME"
FROM CFG_AGENT_LOGIN
INNER JOIN CFG_LOGIN_INFO
ON CFG_LOGIN_INFO.AGENT_LOGIN_DBID = CFG_AGENT_LOGIN.DBID
INNER JOIN CFG_PERSON
ON CFG_LOGIN_INFO.PERSON_DBID = CFG_PERSON.DBID
INNER JOIN CFG_SWITCH
ON CFG_AGENT_LOGIN.SWITCH_DBID  = CFG_SWITCH.DBID
WHERE CFG_AGENT_LOGIN.LOGIN_CODE = '[b]XXXXXXXXX[/b]'
ORDER BY "SWITCH NAME",
  CFG_PERSON.USER_NAME[/color][/font]
Title: Re: Work out folder path in which an Agent Login is located...
Post by: Adam G on October 02, 2015, 02:58:10 PM
bump after edit
Title: Re: Work out folder path in which an Agent Login is located...
Post by: pinguin on January 19, 2016, 07:21:33 AM
Hi adamgill (and others),

I'm mortified that this thread has languished so long without a reply from me. Apologies.

That's great code, but no, I'm not attempting to identify Agents.

I'm trying to determine the folder structure in which any given Agent Login resides.

I'd like to be able to start with any given Agent Login, and be able to work out the path of the folders between the Switch and the folder in which the Agent Login lives.

In abstract, that might look like: /SWITCH/AGENT LOGINS/FOLDER 1/FOLDER 2/FOLDER 3/123456

Where 123456 is the Agent Login.

I have an idea this information is located in some relationship between CFG_FOLDER and CFG_OBJ_FOLDER, but I haven't been able to work out the relationship, so of course I could be entirely wrong about that.

Thanks again for the code above, it will definitely prove useful to me in other situations.

pinguin