System information
; ${UPQMSTATUS}:
; UNPAUSED
; NOTFOUND
Automatically Logging Into and Out of Multiple Queues
It is quite common for an agent to be a member of more than one queue. Rather than
having a separate extension for logging into each queue (or demanding information
from the agents about which queues they want to log into), this code uses the Asterisk
database (astdb) to store queue membership information for each agent, and then loops
through each queue the agents are a member of, logging them into each one in turn.
In order to for this code to work, an entry similar to the following will need to be added
to the AstDB via the Asterisk CLI. For example, the following would store the member
0000FFFF0001 as being in both the support and sales queues:
*CLI> database put queue_agent 0000FFFF0001/available_queues support^sales
You will need to do this once for each agent, regardless of how many queues they are
members of.
If you then query the Asterisk database, you should get a result similar to the following:
pbx*CLI> database show queue_agent
/queue_agent/0000FFFF0001/available_queues : support^sales
The following dialplan code is an example of how to allow this queue member to be
automatically added to both the support and sales queues. We’ve defined a subroutine
that is used to set up three channel variables (MemberChannel, MemberChanType,
AvailableQueues). These channel variables are then used by the login (*54), logout
(*56), pause (*72), and unpause (*87) extensions. Each of the extensions uses the
subSetupAvailableQueues subroutine to set these channel variables and to verify that
the AstDB contains a list of one or more queues for the device the queue member is
calling from:
[subSetupAvailableQueues]
;
; This subroutine is used by the various login/logout/pausing/unpausing routines
; in the [ACD] context. The purpose of the subroutine is centralize the retrieval
; of information easier.
;
exten => start,1,Verbose(2,Checking for available queues)
; Get the current channel's peer name (0000FFFF0001)
same => n,Set(MemberChannel=${CHANNEL(peername)})
; Get the current channel's technology type (SIP, IAX, etc)
same => n,Set(MemberChanType=${CHANNEL(channeltype)})
; Get the list of queues available for this agent
same => n,Set(AvailableQueues=${DB(queue_agent/${MemberChannel}/
available_queues)})
; *** This should all be on a single line
270 | Chapter 13: Automatic Call Distribution (ACD) Queues