System information

You don’t join the queue at this point, as there are no agents in the queue to answer
calls. Because we have joinempty=no and leavewhenempty=yes configured in
queues.conf, callers will not be placed into the queue. (This would be a good opportu-
nity to experiment with the joinempty and leavewhenempty options in queues.conf to
better understand their impact on queues.)
In the next section, we’ll demonstrate how to add members to your queue (as well as
other member interactions with the queue, such as pause/unpause).
Queue Members
Queues aren’t very useful without someone to answer the calls that come into them,
so we need a method for allowing agents to be logged into the queues to answer calls.
There are various ways of going about this, and we’ll show you how to add members
to the queue both manually (as an administrator) and dynamically (as the agent). We’ll
start with the Asterisk CLI method, which allows you to easily add members to the
queue for testing and minimal dialplan changes. We’ll then expand upon that, showing
you how to add dialplan logic allowing agents to log themselves into and out of the
queues and to pause and unpause themselves in queues they are logged into.
Controlling Queue Members via the CLI
We can add queue members to any available queue through the Asterisk CLI command
queue add. The format of the queue add command is (all on one line):
*CLI> queue add member <channel> to <queue> [[[penalty <penalty>] as
<membername>] state_interface <interface>]
The <channel> is the channel we want to add to the queue, such as SIP/
0000FFFF0003, and the <queue> name will be something like support or sales—any
queue name that exists in /etc/asterisk/queues.conf. For now we’ll ignore the
<penalty> option, but we’ll discuss it in “Advanced Queues” on page 283 (penalty is
used to control the rank of a member within a queue, which can be important for agents
who are logged into multiple queues). We can define the <membername> to provide
details to the queue-logging engine. The state_interface option is something that we
should delve a bit more into at this junction. Because it is so important for all aspects
of queues and their members in Asterisk, we’ve written a little section about it, so go
ahead and read “An Introduction to Device State” on page 273. Once you’ve set that
up, come back here and continue on. Don’t worry, we’ll wait.
Now that you’ve added callcounter=yes to sip.conf (we’ll be using SIP channels
throughout the rest of our examples), let’s see how to add members to our queues from
the Asterisk CLI.
266 | Chapter 13:Automatic Call Distribution (ACD) Queues