It is possible to solicit the login status of an agent by registering the agent id:
TRegisterAddress(hTServer,
pszAgentDN,
ModeShare,
RegisterDefault,
AddressTypeAgentID,
NULL))
and then doing a Query address on the agent id *after* you get the EventRegistered for pasAgentDN like this:
TQueryAddress(hTServer,
"",
(TDirectoryNumber) pszAgentDN,
AddressTypeAgentID,
AddressInfoAgentStatus,
NULL)
This will raise an EventAddressInfo event, and the extension that the agent is logged into can be found in:
event->OtherDN
of the event structure.
This is all fine and dandy *provided* the agent is logged *in*.
But, if the agent is *not* logged in, event->OtherDN is empty. And you won't get an EventAgentLogin event when the agent comes along and logs into their hard phone. Of course, you could put the above code into a polling type of scheme to get the extension once the agent does log into their hard phone...but I'd rather not do that.
One of my clients requires their agents to manually log into their hardphones because they don't use a softphone on the agent desktop. We get around the above limitation by employing a daemon that registers all extension DNs and sends user events to the agent id DNs upon login, blah, blah, blah, blah...too many details to get into here.
At the end of the day, I'd like to get rid of this background deamon and replace it with a scheme that would allow our cti desktop software to detect an agent login by only registering their agent id DN with TServer.
Man, it's hard to write this down...hope it makes sense.