[Home]

Summary:ASTERISK-03056: Queue does not seem to consider members's 'penalty'
Reporter:ricsearle (ricsearle)Labels:
Date Opened:2004-12-21 04:36:28.000-0600Date Closed:2008-01-15 15:23:04.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_queue
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) qpat-backported.txt
Description:I have a simple queue configured.  There are three members, which are created dynamically on the CLI, each with a different penalty.  There are no agents defined in agents.conf.

The behavior I expect is that the member with the lowest penalty would be called first, and if they are either busy, or if they don't answer, then the member with the next-lowest penalty should be tried.

What actually happens is that it only ever tries the member with the lowest penalty - if they are busy, it just keeps trying them and says "app_queue.c:932 wait_for_answer: No one is answering queue".

****** ADDITIONAL INFORMATION ******

---------------
extensions.conf
---------------

[incoming]

;Technical Support Line
exten = 8002,1,Answer
exten = 8002,2,GotoIfTime(9:00-17:30|mon-fri|*|*?techSupport,s,1)
exten = 8002,3,SetVar(QUEUE_PRIO=10)
exten = 8002,4,Queue(ConsumerComplaintsQ)
exten = 8002,5,Hangup



-----------
queues.conf
-----------

[TechSupportQ]
strategy = ringall
context = techSupportQueued
timeout = 6
retry = 0
wrapuptime=3
maxlen = 0
joinempty = yes




*CLI> show queues
TechSupportQ has 0 calls (max unlimited) in 'ringall' strategy (0s holdtime), C:0, A:0, SL:0.0% within 0s
  Members:
     SIP/402 with penalty 10 (dynamic) has taken no calls yet
     SIP/403 with penalty 2 (dynamic) has taken no calls yet
     SIP/405 with penalty 1 (dynamic) has taken no calls yet
  No Callers



   -- Executing Answer("Zap/3-1", "") in new stack
   -- Accepting call from '' to '8002' on channel 0/3, span 1
   -- Executing GotoIfTime("Zap/3-1", "9:00-17:30|mon-fri|*|*?techSupport|s|1") in new stack
   -- Goto (techSupport,s,1)
   -- Executing Queue("Zap/3-1", "TechSupportQ") in new stack
   -- Started music on hold, class 'oliver', on Zap/3-1
   -- Called SIP/405
   -- Got SIP response 480 "Temporarily Unavailable" back from 82.115.231.7
   -- SIP/405-4ae9 is circuit-busy
Dec 21 09:30:16 NOTICE[9250]: app_queue.c:932 wait_for_answer: No one is answering queue 'TechSupportQ'
   -- Called SIP/405
   -- Got SIP response 480 "Temporarily Unavailable" back from 82.115.231.7
   -- SIP/405-cd55 is circuit-busy
Dec 21 09:30:21 NOTICE[9250]: app_queue.c:932 wait_for_answer: No one is answering queue 'TechSupportQ'
   -- Called SIP/405
   -- Got SIP response 480 "Temporarily Unavailable" back from 82.115.231.7
   -- SIP/405-44c2 is circuit-busy
Comments:By: ricsearle (ricsearle) 2004-12-21 04:40:17.000-0600

Apologies,  Replace the extensions.conf above with:
------------------

[incoming]

;Technical Support Line
exten = 8002,1,Answer
exten = 8002,2,GotoIfTime(9:00-17:30|mon-fri|*|*?techSupport,s,1)
exten = 8002,3,SetVar(QUEUE_PRIO=10)
exten = 8002,4,Queue(ConsumerComplaintsQ)
exten = 8002,5,Hangup


[techSupport]

exten = s,1,Queue(TechSupportQ)
exten = s,2,Hangup


------------
The GotoIfTime clause is true :)

By: Kevin P. Fleming (kpfleming) 2004-12-22 15:31:31.000-0600

This is how the "ringall" strategy works; it will continue to ring the chosen member until such time as they are not available (busy, no longer in the queue, etc.)

If you want it to change the "chosen" member just because one member didn't answer you will have to use a different strategy; we use "rrmemory" to accomplish this.

By: Mark Spencer (markster) 2004-12-22 21:21:06.000-0600

Well normally that's true, but this is coming back circuit busy, that should force it on to the next one...

By: Mark Spencer (markster) 2004-12-22 21:25:12.000-0600

Can you add some debugging and try to figure out why numbusies + numnochan != numlines right around here:

if (numlines == (numbusies + numnochan)) {
ast_log(LOG_DEBUG, "Everyone is busy at this time\n");
} else {
ast_log(LOG_NOTICE, "No one is answering queue '%s'\n", queue);
}

Also be sure you're on latest CVS head.

By: Kevin P. Fleming (kpfleming) 2004-12-22 22:19:10.000-0600

Yeah, sorry, you're right, I missed the "circuit busy" indications in the report.

By: alric (alric) 2004-12-31 10:21:13.000-0600

ricsearle, did you try the adding the debugging things Mark wanted?

By: ricsearle (ricsearle) 2005-01-04 05:46:44.000-0600

I tried, but my C is very rusty and after a few hours playing, I realised that it was going to take me a very long time to fully understand the code.  I found myself questioning the behaviour as was originally intended by the author.  Perhaps this is intentional, and a documentation problem rather than a bug?

By: Mark Spencer (markster) 2005-01-18 10:38:00.000-0600

No, that's not the intended behavior :)  Anyway should be fixed in CVS now.  That was a tough one!  And if it's not fixed for you, feel free to reopen.

By: Russell Bryant (russell) 2005-01-23 12:14:47.000-0600

re-opening so a patch can be added for 1.0

By: florian (florian) 2005-01-23 12:18:32.000-0600

OK, so I backported the cvs change to 1.0, and it works in my setup. Please verify! Attached is qpat-backported.txt. It was not entirely trivial. For reference: Digium has my disclaimer on file.

By: Russell Bryant (russell) 2005-01-23 17:56:35.000-0600

I tested the patch and it appears to fix the problem for 1.0.  I'm sorry that I missed it before.

Thank you!!

By: ricsearle (ricsearle) 2005-01-25 05:03:54.000-0600

Sorry, maybe it's me, but I still can't make this work.  I'm now running Asterisk CVS-HEAD-01/20/05-14:12:18, which should have the bugfix in it.

queues.conf:

[general]
persistentmembers = yes

[TechSupportQ]
music = oliver
strategy = ringall
context = techSupportQueued
timeout = 10
retry = 0
maxlen = 0
joinempty = yes
member = SIP/405,1
member = SIP/403,2
member = SIP/402,3

chatter*CLI> show queues

TechSupportQ has 0 calls (max unlimited) in 'ringall' strategy (1s holdtime), W:0, C:5, A:1, SL:0.0% within 0s
  Members:
     SIP/405 with penalty 1 has taken 1 calls (last was 553 secs ago)
     SIP/403 with penalty 2 has taken no calls yet
     SIP/402 with penalty 3 has taken no calls yet
  No Callers


What happens:

   -- Executing Answer("Zap/7-1", "") in new stack
   -- Accepting call from '' to '8002' on channel 0/7, span 1
   -- Executing SetCallerID("Zap/7-1", "TS:") in new stack
   -- Executing Playback("Zap/7-1", "dialogue/thanks-for-calling-tech-support") in new stack
   -- Playing 'dialogue/thanks-for-calling-tech-support' (language 'en')
   -- Executing SetVar("Zap/7-1", "QUEUE_PRIO=10") in new stack
   -- Executing Queue("Zap/7-1", "TechSupportQ") in new stack
   -- Started music on hold, class 'oliver', on Zap/7-1
   -- Called SIP/405
   -- SIP/405-3890 is ringing
   -- SIP/405-3890 is ringing
   -- SIP/405-3890 is ringing
   -- SIP/405-3890 is ringing
   -- SIP/405-3890 answered Zap/7-1
   -- Stopped music on hold on Zap/7-1
   -- Executing Answer("Zap/2-1", "") in new stack
   -- Accepting call from '' to '8002' on channel 0/2, span 1
   -- Executing SetCallerID("Zap/2-1", "TS:") in new stack
   -- Executing Playback("Zap/2-1", "dialogue/thanks-for-calling-tech-support") in new stack
   -- Playing 'dialogue/thanks-for-calling-tech-support' (language 'en')
   -- Executing SetVar("Zap/2-1", "QUEUE_PRIO=10") in new stack
   -- Executing GotoIfTime("Zap/2-1", "17:30-09:10|mon-fri|*|*?consumer-complaints-incoming|8001|5") in new stack
   -- Executing GotoIfTime("Zap/2-1", "*|sat-sun|*|*?consumer-complaints-incoming|8001|5") in new stack
   -- Executing Queue("Zap/2-1", "TechSupportQ") in new stack
   -- Started music on hold, class 'oliver', on Zap/2-1
   -- Called SIP/405
   -- SIP/405-33f8 is ringing
   -- SIP/405-33f8 is ringing
   -- SIP/405-33f8 is ringing
   -- SIP/405-33f8 is ringing
   -- SIP/405-33f8 is ringing
   -- Nobody picked up in 10000 ms
   -- Called SIP/405
   -- SIP/405-6459 is ringing
   -- SIP/405-6459 is ringing
   -- SIP/405-6459 is ringing
   -- SIP/405-6459 is ringing
   -- SIP/405-6459 is ringing
   -- Nobody picked up in 10000 ms
   -- Called SIP/405
   -- SIP/405-4dea is ringing
   -- SIP/405-4dea is ringing
   -- SIP/405-4dea is ringing
   -- SIP/405-4dea is ringing
   -- SIP/405-4dea is ringing
   -- Nobody picked up in 10000 ms
   -- Called SIP/405
   -- SIP/405-3578 is ringing
   -- SIP/405-3578 is ringing
   -- SIP/405-3578 is ringing

... etc.

1.  I'm not really sure why it's ringing, when actually the extension is in use.  
2.  Even so, if nobody answers, shouldn't it try another queue member (one with a higher penalty)?

By: florian (florian) 2005-01-25 05:08:02.000-0600

Do you have callwaiting enabled on SIP/405 ? If so, please disable it - if the SIP device returns Busy the next member will be approached. The penalty is only for 'Busy', not for No Answer.

edited on: 01-25-05 05:08

edited on: 01-25-05 05:09

By: ricsearle (ricsearle) 2005-01-25 05:18:44.000-0600

Ah... yes, I did have.  I've turned it off now, and it looks like it's working:

-- Called SIP/405
   -- Got SIP response 486 "Busy Here" back from 82.115.231.7
   -- SIP/405-6598 is busy
   -- Called SIP/403
   -- SIP/403-43e6 is ringing
   -- SIP/403-43e6 is ringing

But, why should this only apply to 'busy'?  I think 'no answer' should behave the same, since either way the caller isn't getting any attention.

By: Kevin P. Fleming (kpfleming) 2005-01-25 09:17:50.000-0600

With the "ringall" strategy. the queue will ring all agents at the chosen penalty level, until one of them answers. It will not move to a higher penalty level unless none of the agents at the lower levels are "available". Failing to answer does not equate to "not available" in app_queue.

If you want the calls to go from agent to agent when they don't answer, you need to use the "rrmemory" strategy.

By: Kevin P. Fleming (kpfleming) 2005-01-25 09:19:01.000-0600

The original issue is corrected. Remaining issues should be opened as new bugs.

By: Digium Subversion (svnbot) 2008-01-15 15:22:23.000-0600

Repository: asterisk
Revision: 4836

U   trunk/apps/app_queue.c

------------------------------------------------------------------------
r4836 | markster | 2008-01-15 15:22:23 -0600 (Tue, 15 Jan 2008) | 2 lines

Make sure we ring queues properly and know busy vs. no answer (bug ASTERISK-3056)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=4836

By: Digium Subversion (svnbot) 2008-01-15 15:23:04.000-0600

Repository: asterisk
Revision: 4883

U   branches/v1-0/CHANGES
U   branches/v1-0/apps/app_queue.c

------------------------------------------------------------------------
r4883 | russell | 2008-01-15 15:23:03 -0600 (Tue, 15 Jan 2008) | 2 lines

fix penalty behavior, thanks florian!! (bug ASTERISK-3056)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=4883