Re: [Asterisk-java-devel] retrieve Agents list from AsteriskQueue
Brought to you by:
srt
From: Pau T. C. <pta...@ru...> - 2008-02-18 11:58:52
|
El Monday 18 February 2008 09:19:56 Pau Tallada Crespí va escriure: > El Friday 15 February 2008 15:24:05 Stefan Reuter va escriure: > > Pau Tallada Crespí wrote: > > > If this functionality could be implemented, how would be the best route > > > to take? > > > > I would like to add a getAgent() method to the QueueMemberEntry or a > > getQueueMemberEntry() to the Agent - or both. > > Which way would be the best for a user of Asterisk-Java? > > I suppose both would be useful. > I'll start implementing it now against latest snapshot. > > Thanks! Implemented and tested. Summary of changes: - New method to AsteriskServer.java: /** * Return the agent with specified location, if exists * * @param location * @return the agent with this location, or null if not exists. */ AsteriskAgent getAgentByAgentId(String location); - Implemented getAgentByAgentId on AsteriskServerImpl.java: public AsteriskAgent getAgentByAgentId(String location) { return agentManager.getAgentByAgentId(location); } - Exported getAgentByAgentId on DefaultAsteriskServer.java: public AsteriskAgent getAgentByAgentId(String location) { return impl.getAgentByAgentId(location); } - New method to AsteriskQueueMember.java: /** * Returns the agent associated to this entry. * * @return the agent associated to this entry, * or null if is not an agent. */ AsteriskAgent getAgent(); - Implement getAgent on AsteriskQueueMemberImpl.java: public AsteriskAgent getAgent() { return getServer().getAgentByAgentId(this.getLocation()); } I'm attaching a diff. Please, comment. Thanks! -- Pau Tallada Crespí RunSolutions Open Source IT Consulting |