Genesys CTI User Forum
		Genesys CTI User Forum => Genesys-related Development => Topic started by: xember on November 27, 2015, 11:17:24 PM
		
			
			- 
				Hi All,
 
 I trying to get the CurrentAgentSate from an agent with PSDK. So I get a EventInfo and I am able to get the place status. The code below returns an 8. My Agent is in not ready state. My question is ... how can I get from the int 8 to a string representation like NotReadyForNextCall.... ? Thanks in advance!
 
 [code]      EventInfo eventinfo = (EventInfo)message;
 
 AgentStatus agent = (AgentStatus) eventinfo.getStateValue();
 PlaceStatus place = agent.getPlace();
 System.out.println(place.getStatus());[/code]
 
- 
				Many times the SDK return num types which you have later to map.
 For example Inbound and Outbound calls are 2 and 3 int values
 However when you use PSDK queries you can ask something like calltype.callinbound or calltype.calloutbound
 So if you want the current status probably will have to build a map of equivalents
- 
				Yep thats clear..... but how to call the type in this case?
			
- 
				As said, build a map. There is no tostring function 
			
- 
				For the definition of each possible value have a look at the API Docs:
 
 Genesyslab.Platform.Reporting.Protocols.StatServer.DnActions.
 
 Start at zero than then count down, for example
 NonMonitored = 0
 Monitored = 1
 LoggedIn=2
 ...
 NotReadyForNextCall=8
- 
				As PeteHoyle said, look at DNActions. There must be around 200 posible states, but for me the most importants:
 
 4:"Ready";
 8:"Not Ready"; In that case you can have Not Ready with reason... Normally the reason will be on  Key Value Collection ["ReasonCode"]
 9:"AfterCallWork";
 6:21:7:20:  Dialing, Interaction, Consult....
 
 Regards.
 
- 
				Clear! Thanks pitty that there is no enum :-(