[asterisk-dev] [Code Review]: app_queue: initialise "available agent' hint on restart, and other senarios

Alec Davis reviewboard at asterisk.org
Tue Sep 25 16:48:42 CDT 2012



> On Sept. 25, 2012, 4:22 p.m., Matt Jordan wrote:
> > trunk/apps/app_queue.c, lines 2021-2022
> > <https://reviewboard.asterisk.org/r/2129/diff/2/?file=31383#file31383line2021>
> >
> >     I'm not sure I understand this.  A state of INUSE would imply that someone was actively engaged with an agent, which isn't the case here.  At this point, there's simply no agents in the queue, which would mean that the queue is in some other state (UNAVAILBLE, INVALID, etc.)
> >     
> >     I'm confused why a device state of UNAVAILABLE was implying that some agent is available in the queue.  If anything, the opposite should be true, as both AST_DEVICE_INVALID and AST_DEVICE_UNAVAILABLE would translate to a member being unavailable - and I would expect the same to be true for a queue as well.
> >     
> >

The 'queue_avail' goal is to turn on the BLF (AST_DEVICE_INUSE) when no agents are logged in, or available.

On a reload/restart of asterisk in queue_init you need to set the devstate to INUSE, then 'if' persistant members get added and are available the queue devstate then is set to NOT_INUSE (available).
If no members are reloaded, the queue_avail devstate reflects to correct state of INUSE (unavailable).

Setting the initial queue devstate to AST_DEVICE_INVALID or AST_DEVICE_UNAVAILABLE does not light a BLF.


- Alec


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2129/#review7153
-----------------------------------------------------------


On Sept. 24, 2012, 4:15 p.m., Alec Davis wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2129/
> -----------------------------------------------------------
> 
> (Updated Sept. 24, 2012, 4:15 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> On queue initialisation set queue_avail devstate to INUSE.
>  Previously was unavailable, which indicated an agent was available.
> 
> When removing members, if there are no other members available, set queue_avail to INUSE.
>  Previously, if a member interface had become 'unavailable', they were never going to be removed, particularly when persistant queues is enabled.
> 
> When adding a member, check that they are available, if they are set queue_avail to NOT_INUSE.
>  Previously on reloaded, members may have been 'unavailable'.
> 
> When pausing or unpausing a member, set appropriate queue availability. 
> 
> 
> Diffs
> -----
> 
>   trunk/apps/app_queue.c 373274 
> 
> Diff: https://reviewboard.asterisk.org/r/2129/diff
> 
> 
> Testing
> -------
> 
> Using CLI added non connected user to queues. Queue_avail state stayed at INUSE as expected.
>  
> Using CLI added and removed connected users to queues. Queue_avail state changed to NOT_INUSE then INUSE as expected.
> 
> Removed power from the only queue member and waited for the state to go unavailable, the queue_avail then went INUSE.
> 
> 
> Thanks,
> 
> Alec
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120925/c374e1d4/attachment.htm>


More information about the asterisk-dev mailing list