[Asterisk-Users] Agents and agent counts

Kevin Smith kevin.smith at mercury.net
Tue Mar 7 17:13:08 MST 2006


Hey everyone,

I have noticed a few questions close to the issue I am having but I 
haven't seen any that quite match the problem I am seeing.

I have 3 queues. Some members share one queue and some are completely 
separate. Some members have a higher penalty then others. I am using 
addqueuememeber and removequeuemember for the login and log out and I 
verify members with their password for voicemail (that all seems to work 
just fine). The problem I am having is that if a member is in a queue on 
their own, everything works fine, a call can go into the queue. However, 
if 2 members with different penalties are logged in on the same queue, 
the test for the number of members in a queue fails. Below is the code 
that is failing.

852,5,Set(Queue_Count_Switch=${IF(${QUEUEAGENTCOUNT(sales)}?7:100)})   
;Checks to see if there are active agents
exten => 
852,6,Goto(Mercury-Sales,852,${Queue_Count_Switch})                     
        ;Sends to closed if there are none
exten => 852,7,Queue(sales|tT|||) 

Here is what the CLI shows for queue members (note: NUMBER1 and NUMBER2 
represent phone numbers that are real. they are different however and 
typed in correctly)

sales        has 0 calls (max unlimited) in 'leastrecent' strategy (0s 
holdtime), W:0, C:0, A:0, SL:0.0% within 0s
   Members:
      SIP/NUMBER1queue with penalty 3 (dynamic) (Not in use) has taken 
no calls yet
      SIP/NUMBER2queue with penalty 2 (dynamic) (Not in use) has taken 
no calls yet
   No Callers

And here is the CLI output.

- Executing Answer("Zap/1-1", "") in new stack
    -- Executing Wait("Zap/1-1", "2") in new stack
    -- Executing Playback("Zap/1-1", "mercury-prompts/Sales-welcome") in 
new stack
    -- Playing 'mercury-prompts/Sales-welcome' (language 'en')
    -- Executing Wait("Zap/1-1", "1") in new stack
    -- Executing Set("Zap/1-1", "Queue_Count_Switch=100") in new stack
    -- Executing Goto("Zap/1-1", "Mercury-Sales|852|100") in new stack
    -- Goto (Mercury-Sales,852,100)
    -- Executing Wait("Zap/1-1", "2") in new stack
    -- Executing Playback("Zap/1-1", "mercury-prompts/Sales-afterhours") 
in new stack
    -- Playing 'mercury-prompts/Sales-afterhours' (language 'en')
    -- Channel 0/1, span 1 got hangup request
  == Spawn extension (Mercury-Sales, 852, 101) exited non-zeroexten =>
    -- Hungup 'Zap/1-1'

Now what really confuses me is that when only 1 member say, NUMBER1, is 
in the sales queue, it works fine. And vice-versa, but as soon as the 
other member is in, then it stops working. Now even if they are both at 
the same penalty then it still it fails saying we are closed (which is 
exten 852,100). I am at a loss as to what could be causing it. Anyone 
have any ideas or see if something that may be going wrong? Does the IF 
statement return "true" for anything but 0 and -1 or is it only 1?

Thanks,
Kevin





More information about the asterisk-users mailing list