We’ve been running a Trixbox installation with FreePBX 2.2 in a decent sized call center for a while now.
I just wanted to bring up a problem (and a possible solution) we encountered with Queues and Call Waiting.
We have about 5 queues with about 15 extensions per queue (Statically defined). All SIP phones
Each queue probably gets around 50 calls per hour.
First, we tried RingAll strategy. But that was a disaster. Imagine ringing 70 phones at once. Noise aside, it also spiked the load on the pbx to a point where things started breaking (probably due to dialparties.agi ringing all at once)
Then we switched to RoundRobin. Things were a little better (BTW Asterisk 1.2 tries to deliver 1 call at a time even when there are multiple calls in the incoming queue and there are several agents available. 1.4 fixes this. A backport patch to 1.2 is in mantis). However, we ran in to a huge problem with CallWaiting. All agents have CW enabled. After a while, most of them are already on call, but the queue still rings them in a round robin fashion due to CW. They won’t be able to answer, so the call has to go through several time-outs before being answered. You can imagine what this does to hold times.
So, I started looking at dialparties.agi. I ran across BLKVM_OVERRIDE that is already being used by queues to avoid hitting VM. So, I tried using the same variable and adding the following code that checks this variable as well as extension state before trying to ring the extension. This around line 334 in 2.2
$blkvmdata = 'FALSE';
$blkvm = get_var($AGI,'BLKVM_OVERRIDE');
$extstate = is_ext_avail($extnum);
if ($blkvm) {
$blkvm_brk = strrpos($blkvm,'/');
$blkvm_fm = substr($blkvm,0,$blkvm_brk);
$blkvm_ky = substr($blkvm,$blkvm_brk+1);
$blkvmdb = $AGI->database_get($blkvm_fm,$blkvm_ky);
$blkvmdata = $blkvmdb['data'];
}
if (($blkvmdata == 'TRUE') && ($extstate != 0) && ($extnum != '')) {
//Someone asked to block VM. We are assuming that they dont want multiple calls either
//debug("VM Blocked. Q=$nodest. Ext=$extnum. State=$extstate. Return Busy",0);
$extnum = '';
$AGI->set_variable('DIALSTATUS','BUSY');
}
Things started working a lot better. However, I ended up with several stray BLKVM_OVERRIDE in AstDB everyday. I haven’t looked further in to this, but just cleared them in a cron job.
Just thought I’d share this and see if I am missing something or if I am on the right track. Did any one else ran in to this problem? We probably should add this to svn if this is the right solution.
Thanks
Sarat.