I am trying to connect to TServer via the Application Blocks and trying to monitor Agent State changes, i.e Agent Login, Agent Ready, Agent Not Ready and Agent Logout etc…
My Question here is, can I simply go ahead and register respective EventAgentXXXX handlers upon opening the protocol object or do I need to first get a list of DN’s and then request for events against each DN to know which agent login and logout?
So, how can i register all DN’s, which I would like to monitor?
FYI-
So far my code has snippets to create a TServerConfiguration object, registered with ProtocolManagementServiceImpl of PMAB, openes the protocol manager object to conect to TServer and then had code to register event handlers to EventBrokerService. Just like the API described.
I also have code to monitor EventAgentLogin and EventAgentLogout, trying to get agentId and associated DN.
One way is to write all by hand. The second is to use ConfigurationSDK, and get list of all dns from configserver..
If you mean, that how to register dn itself. Pick up the VoicePlatformSDK example, and find the loginbuttonhandler.
There you can find this:
..
RequestRegisterAddress requestRegisterAddress = RequestRegisterAddress.Create(thisDn, RegisterMode.ModeShare, ControlMode.RegisterDefault, AddressType.DN);
int uniqueId = GenerateUniqueId();
requestRegisterAddress.ReferenceID = uniqueId;
RequestRegisterAddress is a request telling to TServer that your application wants to be notified about operations/status related to specified DN. If TServer itself hasn’t registered that DN on the switch then it will do it. But be careful because TServer can be configured to not allow registration of DNs that are not present in Genesys configuration (CME).