Kapitel 6. Queues

Many customers detest queues. Sadly, there is scarcely a business around these days that does not make use of them; perhaps they are better than the alternative, which is not take the call at all because all the lines are busy. Whatever your stance on them, the are part of communications reality, so we will describe the configuration and operation of queues in Asterisk here.[28]
Four files are important for queues:
Defines the queues.
Defines agents; these are the staff who take calls.
Defines the hold music.
The dialplan. Calls are directed to the queue using Queue() and agents are added using AgentLogin() or AgentCallbackLogin().
A common cause of misunderstanding is the confusion of "queue members" with callers. Queue members are always and only agents or queue devices, never callers.


For simplicity's sake, we use the term "agents" primarily. Markus Bönke notes the following:
You call queue members "agents". For someone who comes from the call center business, that's a bit confusing, since queue members can also be normal SIP extensions.
This is, of course, absolutely right. You are not required to use Agent-Channel (which functions like a proxy ); instead, you can simply assign specific SIP devices to the queue. You do this by writing member => SIP/1001 to queues.conf, for example; alternatively, you can assign the interface dynamically in the dialplan with the command AddQueueMember().[29]
Agents may belong to more than one queue, and we want our agents to be able to log in at any station (also called "hot-desking"). The basic format of agent definitions looks like this:
;    agent_number,password,name
agent => 1001,1234,Ron Popeil
agent => 1002,1234,Don Dinglehopper
member => Agent/1001   ; Add agent 1001 to the support-queue
member => Agent/1002   ;   ... 1002 ...
exten => 20,1,Queue(support-queue)   ; => queue
exten => 25,1,AgentLogin()              ; login after call
And this is how it works: agents log in by dialing extension 25, hear pleasant music and await callers. Calls to extension 20 are passed into the queue and are answered on a first-in, first-out basis. The agent hears a tone, and the first caller is connected.

An example queue setup using AEL (Asterisk Extension Language) is described in doc/queues-with-callback-members.txt in Asterisk 1.4.