Review Board 1.7.16

app_queue: initialise "available agent' hint on restart, and other senarios

Review Request #2129 - Created Sept. 20, 2012 and submitted

Alec Davis
11 and trunk
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. 
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.

Review request changed
Updated (Sept. 25, 2012, 12:45 p.m.)
added comment to init_queue() as follows:
        /* On restart assume no members are available.
         * The queue_avail hint is a boolean state to indicate whether a member is available or not.
         * This seems counter intuitive, but is required to light a BLF
         * AST_DEVICE_INUSE indicates no members are available.
         * AST_DEVICE_NOT_INUSE indicates a member is available.

Note: 'No members are available', includes all logged out.
Ship it!
Posted (Sept. 25, 2012, 3:43 p.m.)
Looks good!
trunk/apps/app_queue.c (Diff revision 3)
Red blob runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to