[Asterisk-doc] Call queues (ACD, Hunt groups)

Gene Naden gene.naden at globalteldata.com
Mon Aug 15 08:55:02 CDT 2005


This is a discussion of Asterisk call queues, aka hunt groups. Any comments
would be appreciated.

Gene Naden, MA
Programmer Analyst
GlobalTeldata II, LLC
4700 N. Ravenswood
Chicago, IL 60640
(773) 878-3161 x 223
-------------- next part --------------
CALL QUEUES
In many business situations, there is a stream of calls from customers and a 
team of agents to answer them. Asterisk supports the automatic routing of calls 
to agents using various strategies to determine whose phone or phones ring when 
the next call comes in. This functionality is referred to as call queues or 
automatic call director (ACD). 

If a call is not answered right away, Asterisk can play music-on-hold while 
the caller waits. There is a configurable dialplan option to allow a caller who 
is on hold to “escape” to voicemail or to another extension.
Agents are identified in the configuration files agents.conf and queues.conf by 
a numeric identifier called the agent id. All agents must be listed in 
agents.conf. At any given time, as agent is in one of two states: logged on or 
logged off.

A queue is basically a collection of agents. Queues are defined in the 
configuration file queues.conf. An agent can be in more than one queue. Queues 
may also be defined by dynamic realtime, which is beyond the scope of this 
discussion.

The dialplan configuration file extensions.conf determines which inbound calls 
get routed to a queue. The dialplan application command “Queue” routes a call 
to a queue. This command takes at least one argument, the name of the queue. 
The online documentation of this command may be found at

http://www.voip-info.org/tiki-index.php?page=Asterisk+cmd+Queue

For example, a “Background” command can be used to give the caller a list of 
options. When the caller dials an extension, the corresponding “Queue” statement
is executed.

AGENT LOGIN AND LOGOUT
Agent login sets up the agent to receive calls. This can be accomplished with 
either of two dialplan application commands: “AgentCallbackLogin” and 
“AgentLogin.” The difference is that “AgentLogin” places the agent permanently 
in an off-hook state, while “AgentCallbackLogin” leaves the agent on-hook until 
she actually answers a call. This discussion will focus on using 
“AgentCallbackLogin.” The arguments to “AgentCallbackLogin” include the dialplan 
context and extension. The extension might be obtained from the CALLERIDNUM 
channel variable. For example,

exten => 800,1,AgentCallbackLogin(|${CALLERIDNUM}@internal)

When Asterisk determines that it is a particular agent’s turn to take a call, 
the corresponding dialplan statement is activated. For example, this could be 
a “Dial” statement in a context such as

[internal]
exten => 223,1,Dial(Sip/1020)

If the agent login specified  the [internal] context with extension 223 then 
when a call comes in, this “Dial” command could be executed.

This scheme depends on the caller id for a particular channel corresponding to 
the dialplan extension for the channel. For example, the caller id for 
Sip/1020 would have to be 223 in this case. This one-to-one correspondence can 
be maintained by careful hand coding or by using simple software to 
automatically generate included portions of the configuration files sip.conf 
and extensions.conf.

Agent logoff is accomplished with the “AgentCallbackLogin” command where the 
extension is omitted.

AGENT SELECTION STRATEGIES
The agent selection strategies are documented in the sample files for 
queues.conf which come with Asterisk.


More information about the Asterisk-Doc mailing list