Asterisk with FreePBX gui is not a scalable call center solution. The dialparties.agi php script take many resources. And when you have many queues with dozen or hundred of members, dialparties.agi is called for each member of the queues and so the load goes high and the system become unstable.
The main problem is that the asterisk queue subsystem don't know if a member is available or not when using local channels and so tries to dial all the members, always . With agents.conf and agentcallbacklogin the status is updated but this application is deprecated and in 1.6 is absent. So this is not a viable solution. But fortunately in 1.6 this deficiency was eliminated adding another variable to the queues: state_interface.
Basically with the state_interface asterisk is able to know the status of the real queue member, like chan_agent already do.
So for example the SIP/2010 softphone with extension 2010 in queue.conf would be:
member=Local/2010@from-internal/n,0,,SIP/2010
And to manually add the extension 2010 as a member of the queue 600 we call:
exten => s,1,AddQueueMember(600,Local/2010@from-internal/n,,,SIP/2010)
With state_interface when i do 'show queue memebers' and the 2010 is on the phone, (also a call that is not passed in the queue, for example an outbound call), in the console you can see:
Local/2010@from-internal/n (In use) has taken 1 calls (last was 182 secs ago)
With this simple option the entire queue system become optimized and scalable. No additional resources or scripts to launch. All is managed by Asterisk.
Perhaps this feature will be also added to asterisk 1.4.24, you can see http://reviewboard.digium.com/r/116/ for more info.
So i think would be reasonable to add this in the queue module.
Perhaps the best approach is to:
1) decide in the queue page if the agents/members of the queue are only locals or also remote phone (if are remote we cannot use the state_interface)
2) if are only locals check if asterisk is version > 1.6.0 (or we hope > 1.4.24)
3) if asterisk version is correct check in database what is the real device of the user and add the state_interface. It works only if one state_interface is defined, so with a tooltip advice that works only for the first extension.
4) if asterisk version is correct, with "Skip Busy Agents" write the more simple option "ringinuse=no" in queues_additional.conf
What do you think of this solution?