[Asterisk-java-users] Newbie Question
Brought to you by:
srt
From: Yelson V. <yv...@gm...> - 2006-01-26 02:05:00
|
HI Guys I'm new in asterisk-java so sorry for the silly question. I just wanna know the agents status in my pbx, but i don't know how to get the info, the program connects fine to the pbx, but when i try to read the data y don't know how, can you give me a hand?? this is my code ---------------------------------------------------------------------------= ----------------------- class definitions -------------------------- AgentsAction agac =3D new AgentsAction(); Map datos ; Collection datosp; ---------------------------- run method ---------------------------- ManagerResponse originateResponse; managerConnection.login(); originateResponse =3D managerConnection.sendAction(agac,4000); System.out.println(originateResponse.getResponse()); System.out.println(originateResponse.getMessage()); System.out.println(originateResponse.toString()); datos =3D originateResponse.getAttributes(); datosp =3D datos.values(); Iterator iter =3D datosp.iterator(); while (iter.hasNext()){ String agente =3D (String)iter.next(); System.out.println("the data is '" + agente + "'"); } managerConnection.logoff(); ---------------------------------------------------------------------------= ----------------------- The program shows this ---------------------------------------------------------------------------= ----------------------- Jan 25, 2006 8:51:09 PM net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Connecting to 192.168.222.22 port 5038 Jan 25, 2006 8:51:09 PM net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Connected via Asterisk Call Manager/1.0 Jan 25, 2006 8:51:09 PM net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Successfully logged in Jan 25, 2006 8:51:09 PM net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Determined Asterisk version: Asterisk 1.0 Success Agents will follow net.sf.asterisk.manager.response.ManagerResponse: actionId=3D'null'; message=3D'Agents will follow'; response=3D'Success'; uniqueId=3D'null'; systemHashcode=3D1012673 the data is '12014584_3#' the data is 'Agents will follow' the data is 'Success' Jan 25, 2006 8:51:09 PM net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Reached end of stream, terminating reader. Jan 25, 2006 8:51:09 PM net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Closing socket. ---------------------------------------------------------------------------= ---------------------------- In other words how can i read the Map that should show me the agents status= ??? Thanks in advance Best Regards Yelson |