[asterisk-dev] [Code Review] Allow a position to be specified when entering a queue.

Mark Michelson mmichelson at digium.com
Mon Apr 27 11:24:13 CDT 2009



> On 2009-04-27 07:50:16, Russell Bryant wrote:
> > I think the code here looks fine.  As you suggest in your description, some documentation is needed before commit.

I have added appropriate XML docs.


> On 2009-04-27 07:50:16, Russell Bryant wrote:
> > /trunk/apps/app_queue.c, lines 2234-2235
> > <http://reviewboard.digium.com/r/189/diff/2/?file=2973#file2973line2234>
> >
> >     It would nice to have a printf style channel setvar function, wouldn't it.  :-)

Yes it would be quite nice.


> On 2009-04-27 07:50:16, Russell Bryant wrote:
> > /trunk/apps/app_queue.c, lines 5010-5015
> > <http://reviewboard.digium.com/r/189/diff/2/?file=2973#file2973line5010>
> >
> >     Should you log an error if someone provides an invalid position argument?

Sure thing.


- Mark


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/189/#review750
-----------------------------------------------------------


On 2009-03-05 17:17:00, Mark Michelson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/189/
> -----------------------------------------------------------
> 
> (Updated 2009-03-05 17:17:00)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Today I was deleting my old developer branches when I came across the "queue-position" branch. This branch is pretty old, so I considered just deleting it. However, I found that the work appeared to be complete, so I'm posting it on review board now.
> 
> The basic idea is that when calling the Queue application, you may specify a numeric position at which you wish to enter the queue. For instance, '1' would mean to enter at the head of the queue, '3' would mean to be placed third in the queue. Similarly, when a caller leaves a queue, the QUEUEPOSITION channel variable is populated with the position that the caller was in when he left the queue. This combination allows for some interesting manipulation of queue callers. For instance, one can remove a caller from one queue and make sure that that caller is inserted into the same position he was previously in in a new queue. 
> 
> When determining where to place the caller, we take into account both the caller's position and priority. We assume that priority takes precedence over the stated position. Here's a scenario that illustrates this preference a bit more clearly. Say for instance that a caller with priority 1 is to be entered into a queue and we have specified to enter at position 2. However, currently the front two callers in the queue have priorities 3 and 2, respectively. The other four callers waiting in the queue all have priority 1. We're not going to place this new caller ahead of the higher-priority callers. Instead, we will insert him into the queue as close to the desired position as possible. In this particular case, we will insert the caller into position 3. A NOTICE message is printed to the console when this action is taken.
> 
> The only thing that's really missing from this initial code upload is any user documentation for how this option works.
> 
> 
> Diffs
> -----
> 
>   /trunk/apps/app_queue.c 180382 
> 
> Diff: http://reviewboard.digium.com/r/189/diff
> 
> 
> Testing
> -------
> 
> Back when I originally wrote this, I ran tests to be sure that callers were inserted in the position requested. I also tested to be sure that if a caller exits a queue that his position is reported accurately in the QUEUEPOSITION variable. I also tested to be sure that a caller would not be inserted before a higher-priority caller.
> 
> 
> Thanks,
> 
> Mark
> 
>




More information about the asterisk-dev mailing list