I have a use case where I would like to start with a person, determine what Place the person is currently logged into, then determine what DN(s) are in that place.
There are many useful PSDK methods such as CfgQueryPerson, CfgQueryPlace, CfgQueryDN, CfgPerson, CfgPlace, CfgDN.
However upon looking at the API docs, I can’t seem to find the bits of information I would need to relate the three types of objects.
For example, CfgPerson:
There is a nice AgentInfo reference on a CfgPerson
AgentInfo does have a Place property, however the description of the property notes, “…identifier of the CfgPlace assigned to the agent by default”. Well, in my particular use case the agents dont have default places… They type their places in on their own. This property is always null unless I have a default place assigned.
CfgPlaceQuery:
Looks like I can query a place by its dbid, a dn dbid (dn that is assigned to this particular place), PersonDbid (however PersonDbid is only populated if there is a default place assigned to the person).
CfgDNQuery:
I can plug in a PlaceDbid in the query, cool - I can finally start with an extension and get the places the extension is added to
So, it appears I can relate a DN to a Place. However I have not been able to locate a way to associate a Person with either a Place or DN unless there is a default place associated with the person.
Unless the person has a default Place assigned in CME there is no link in CME between a Person and and Place or DN.
There are two options, you could connect to TServer and monitor every Extension DN on TServer to determine when an Agent logs onto a DN or the preferred way would be to to use the reporting SDK to get the stat that will give you the status of an Agent.
The stat should be configured similar to:
Category: CurrentState
MainMask: *
Objects:Agent
Subject: DNStatus
Which will provide an EventInfo event that looks like below, from that you can get the Place and DN the Agent is logged onto: