[Home]

Summary:ASTERISK-02983: [patch] queue priority (weight)
Reporter:k3v (k3v)Labels:
Date Opened:2004-12-13 18:39:02.000-0600Date Closed:2008-01-15 15:20:19.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Applications/app_queue
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) queue-weight.patch.txt
( 1) queue-weight.patch.txt
( 2) queue-weight.patch.txt
( 3) queue-weight.patch.txt
( 4) queue-weight+cvs20041222.patch.txt
Description:Gives queues a 'weight' option, to ensure calls waiting in a higher priority queue will deliver its calls first.  Only delays the lower weight queue's call if the member is also in the higher weight queue.

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

Goes beyond bug id 0000938, which I found inelegant and seemed to tie up calls in 'slave' queues, even if someone was available to take that call who was not in the 'master' queue.
Some sample output:

Dec 13 17:34:34 DEBUG[27529]: app_queue.c:734 compare_weight: Found matching member Local/139@agent-call in queue 'noc'
Dec 13 17:34:34 DEBUG[27529]: app_queue.c:736 compare_weight: Queue 'noc' (weight 10, calls 1) is preferred over 'tech' (weight 0, calls 1)
   -- Call attempt usurped by heavier weight queue.
Dec 13 17:34:34 NOTICE[27529]: app_queue.c:970 wait_for_answer: No one is answering queue 'tech'

Disclaimer on file.
Comments:By: k3v (k3v) 2004-12-14 00:48:20.000-0600

I have tested this with a few agents (members) and two queues with one call each.  It appears to function as expected.  It's a simple patch which causes a call to abort in the same way as an unexpired wrapuptime, so I don't see any reason why it would cause grief for a larger set.

The 'better' way to handle this is to completely redo the way 'calls' are picked out of a 'queue' and delivered to a 'member', whereas a selection algorithm can be performed outside of queue_exec, and avoid kludges like this.  However, I guess that is called app_icd. :)  Too bad it doesn't have enough attention from the community to make it more viable.

I'll drop another patch in tomorrow with some cosmetic changes.  I was thinking tonight it'd be better to have more info in the ast_verbose() message.

By: k3v (k3v) 2004-12-14 10:00:59.000-0600

patch sized 3658 bytes, dated 12-14-04 10:00 has a cosmetic change:

Dec 14 08:59:28 DEBUG[31102]: app_queue.c:735 compare_weight: Found matching member Local/139@agent-call in queue 'noc'
Dec 14 08:59:28 DEBUG[31102]: app_queue.c:737 compare_weight: Queue 'noc' (weight 10, calls 1) is preferred over 'tech' (weight 0, calls 1)
   -- Attempt (tech: Local/139@agent-call) delayed by higher priority queue (noc).
Dec 14 08:59:28 DEBUG[31102]: app_queue.c:735 compare_weight: Found matching member Local/104@agent-call in queue 'noc'
Dec 14 08:59:28 DEBUG[31102]: app_queue.c:737 compare_weight: Queue 'noc' (weight 10, calls 1) is preferred over 'tech' (weight 0, calls 1)
   -- Attempt (tech: Local/104@agent-call) delayed by higher priority queue (noc).

By: k3v (k3v) 2004-12-14 10:56:11.000-0600

Forgive the repeated revisions.  The 3633 byte 12-14-04 10:55 should be used.  The former was jumping a fencepost.  New features bringeth new bugs. :)

By: Mark Spencer (markster) 2004-12-14 15:51:54.000-0600

This looks really great.  Can we have a fast path so that in the case that weights are not in use it does not span all queues all the time?

By: k3v (k3v) 2004-12-14 18:01:31.000-0600

Added fast path.  If no config option 'weight' set, won't call compare_weight().  Is this what you're looking for?  Also added 'W:%d' to __queues_show() to display the defined weight of a queue.

edited on: 12-14-04 18:02

By: Olle Johansson (oej) 2004-12-19 13:14:06.000-0600

markster: Ready for cvs? Gentle reminder from housekeeping staff...

By: k3v (k3v) 2004-12-23 01:08:57.000-0600

Patch updated to apply cleanly against current CVS; app_queue has undergone many changes this week.  'Weight:' also added at end of manager 'Event: QueueParams'.

edited on: 12-23-04 01:15

By: k3v (k3v) 2004-12-28 23:01:51.000-0600

Reminder sent to markster

gentle nudge to look at ASTERISK-2983 updates

By: Mark Spencer (markster) 2005-01-06 22:00:42.000-0600

Added to CVS, nicely done!

By: Digium Subversion (svnbot) 2008-01-15 15:20:19.000-0600

Repository: asterisk
Revision: 4698

U   trunk/apps/app_queue.c
U   trunk/configs/queues.conf.sample

------------------------------------------------------------------------
r4698 | markster | 2008-01-15 15:20:19 -0600 (Tue, 15 Jan 2008) | 2 lines

Merge weight option (bug ASTERISK-2983)

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

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