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

Mark Michelson mmichelson at digium.com
Thu Mar 5 17:13:40 CST 2009



> On 2009-03-05 15:37:18, Sean Bright wrote:
> > /trunk/apps/app_queue.c, line 2217
> > <http://reviewboard.digium.com/r/189/diff/1/?file=2970#file2970line2217>
> >
> >     Is the initialization here really necessary?

I think I was being a bit paranoid about making sure that what got copied into the buffer was null-terminated. I also think you're correct; the initialization isn't really necessary.


- Mark


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


On 2009-03-05 14:01:40, Mark Michelson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/189/
> -----------------------------------------------------------
> 
> (Updated 2009-03-05 14:01:40)
> 
> 
> 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