Asterisk cmd Queue

Call Center Software
Provider Software Details
Vonage Business Call-Center
  • No hardware, software or up-front capital costs
  • Carrier-class architecture with built-in enhanced features
  • 100% scalable to fit your needs
Details
Call Center Software AVOXI: Cloud-based Contact Center Software
  • Inbound & Outbound Hosted Call Center Solution
  • Quality assurance tools to improve agent performance
  • Live monitoring & real time reporting
  • Starting as low as $18 per seat
Details

Synopsis

Queue a call for a call queue

Description

Asterisk 1.8:
Queue(queuename[,options[,URL[,announceoverride[,timeout[,AGI[,macro[,gosub[,rule[,position]]]]]]]]])


Asterisk 1.6.0:
Queue(queuename[,options[,URL[,announceoverride[,timeout[,AGI[,macro[,gosub[,rule]]]]]]]])


Asterisk 1.4:
Queue(queuename[|options][|URL][|announceoverride][|timeout][|AGI])


Asterisk 1.0 through 1.2:
Queue(queuename[|options][|URL][|announceoverride][|timeout])


Queues an incoming call in a particular call queue as defined in queues.conf or dynamic realtime.

The option string may contain zero or more of the following characters:
  • d — data-quality (modem) call (minimum delay).
  • h — allow callee to hang up by pressing *.
  • H — allow caller to hang up by pressing *.
  • n — no retries on the timeout; will exit this application and go to the next step.
  • r — ring instead of playing MOH.
  • R — stops moh and rings once an agent is ringing (Asterisk Trunk)
  • t — allow the called user to transfer the calling user.
  • T — allow the calling user to transfer the call.
  • w — allow the called user to write the conversation to disk via Monitor.
  • W — allow the calling user to write the conversation to disk via Monitor.
  • c — continue in the dialplan if the callee hangs up (Asterisk 1.6.0 and above).
  • i — ignore call forward requests from queue members and do nothing when they are requested (Asterisk 1.6.0 and above).
  • k — Allow the called party to enable parking of the call by sending the DTMF sequence defined for call parking in features.conf (Asterisk 1.6.0 and above).
  • K — Allow the calling party to enable parking of the call by sending the DTMF sequence defined for call parking in features.conf (Asterisk 1.6.0 and above).
  • x — allow the called user to write the conversation to disk via MixMonitor (Asterisk 1.6.0 and above).
  • X — allow the calling user to write the conversation to disk via MixMonitor (Asterisk 1.6.0 and above).

In addition to transferring the call, a call may be parked and then picked up by another user.

'URL' allows you to specify a URL that will be sent to the called party if the channel supports it. You can also use an external application like QueueMetrics or Asteria Solutions Agent Client to launch the URL if your terminal does not support it.

  • In Asterisk 1.4, the optional AGI parameter will setup an AGI script to be executed on the calling party's channel once they are connected to a queue member.

'announceoverride' allows you to override the announcement specified in queues.conf using 'announce = ...' or add one to it in the first place.

'timeout' sets the time in seconds that a call will wait in the queue before it is routed to the next priority in the dialplan. It defaults to 300 seconds (5 minutes).

Note: at least in asterisk 1.8.5 (and probably earlier) the default is for there to be no timeout, not a 300 second timeout.

The timeout will cause the queue to fail out after a specified number of seconds, checked between each queues.conf 'timeout' and 'retry' cycle.
This application sets the following channel variable upon completion:
QUEUESTATUS The status of the call as a text string, one of TIMEOUT | FULL | JOINEMPTY | LEAVEEMPTY | JOINUNAVAIL | LEAVEUNAVAIL


Note: This doesn't do what you think it should do (in 1.2.4 anyway). Once a call is inside a queue, it is only checked to see if it is timed out every so often (depending on the value of 'timeout=' for that queue in queues.conf). This means that if queues.conf says 'timeout=10' and you call the queue with 'Queue(queuename,,,,5)', it will be ten seconds before the call times out. If you call the Queue with 'Queue(queuename,,,,11)', it'll be 20 seconds. I.E. the value of 'timeout' supplied to the command DOES NOT override the value of 'timeout=' in queues.conf. Don't think about changing the value of 'timeout=' in queues.conf to, say, 1 or the calls will get offered to the members for only one second at a time.

This article attempts to explain this behavior. Note that this article states that the value of the 'timeout' parameter is absolute, which is not correct.


New in Asterisk 1.4: The MEMBERINTERFACE channel variable holds information about which queue member received the call. Variable is not available until you set 'setinterfacevar=' to 'yes' in queues.conf.
Note: This parameter must be wrote INSIDE of each queue, not in the general context because it won't work.






Return codes

This application returns -1 if the originating channel hangs up, or if the call is bridged and either of the parties in the bridge terminate the call. Returns 0 if the queue is full, nonexistent, or has no members.

This method only works when there are no members defined in queues.conf, and instead only added with AddQueueMember(). However with "Member => Agent/101" in queues.conf the Queue command always returns as if there were a member.
Update: 'leavewhenempty = yes' in queues.conf fixes this (in CVS since Sep 28, 2004)

Notes

  • If 'persistentmembers = yes' is used in queues.conf, dynamically added agents are saved in the Asterisk Berkeley database, and are preserved across restart. If not, dynamically added agents are lost upon Asterisk restart.
  • Use the 'Local' channel construct to point to an appropriate dial-out extension in the dialplan if you'd like to add remote agents using AgentCallbackLogin()
  • Transfers of calls that are answered out of a queue must be done using Asterisk '#' transfers (enabled with the 't' option above). SIP transfers result in the Agent remaining affiliated with the call until its eventual termination, preventing that agent from being offered another call.
  • The application sets the following channel variable upon completion: QUEUESTATUS. The status of the call as a text string, one of TIMEOUT, FULL, JOINEMPTY, LEAVEEMPTY, JOINUNAVAIL, or LEAVEUNAVAIL.
  • A member assigned to a queue ("member => Agent/1234" for example) can be a phone (e.g. "member => SIP/phone1").
  • Check the timeout settings of your extensions involved in the queue.
  • Snom Phones have in their web interface an "invisible" timeout of 60 seconds. The Playback command, even if an empty file is played, seems to help in avoiding a call being dropped after 60 seconds.

Examples

Example 1: Basics


exten => s,1,Answer
exten => s,2,SetMusicOnHold(default)
exten => s,3,DigitTimeout,5
exten => s,4,ResponseTimeout,10
exten => s,5,Background(welcome)
exten => s,6,Queue(tech-queue)

The s,1,Answer is important in order not to have ringing in the background of your hold music.

Example 2: Use BLF LED to show queue login status of an agent

Look at this post (in German), requires bristuff'ed Asterisk 1.2 or 1.4

Example 3

Here is a working queue-solution as example:

A call comes in over a sip channel, is routed to the extension which handles the example-queue (here extension 129) in the context example-queue in extensions.conf. The call, if not answered by an agent, should remain for 300 seconds in the queue, before it is routed to the next priority which transfers the call to voicemail.
The called and the calling user are able to transfer the call (tT as options of the queue command in extensions.conf).

Signaling the call to logged on agents should work like this:

After the first priority "Playback(some_announce)" has finished, all agents should be signalled (ringall in queues.conf) for at least 15 seconds (timeout in queues.conf). The caller should hear music on hold in the meanwhile. If the call wasn't answered by an agent, there should be some time before the call is signalled again (retry in queues.conf). The actual queue position is announced to the caller every 30 seconds (announce-frequency and announce-holdtime in queues.conf).

extensions.conf:

[queue]
exten => 129,1,Playback(some_announce) ; Important, see notes
exten => 129,2,Queue(example_queue|tT|||300) ;dont set n option until really needed
exten => 129,3,Playback(some_announce_after_leaving_queue)
exten => 129,4,Voicemail(s1234)

queues.conf:

[example_queue]
music = default
strategy = ringall
context = queue-out ; Here we go when the caller presses a single digit, while in the queue
timeout = 15
wrapuptime=10
announce-frequency = 30
announce-holdtime = yes
joinempty = yes
member => Agent/1234
member => Agent/1235

agents.conf:

[agents]
ackcall=no ; Agent does NOT have to press # to answer the call
musiconhold => default
agent => 1234,0000,Agent1_Name
agent => 1235,0000,Agent2_Name


See also


  • IPSwitchBoard BETA - Queue Log Analyzer
  • Asternic Call Center Stats - PRO 2 just released! Queue monitoring and reporting, GPL and commercial versions available.
  • OrderlyQ - Extension to Asterisk Queues that lets callers hang up, then call back without losing their place.
  • OrderlyStats - FREE Dedicated Real Time Call Centre Management and Statistics Package.
  • QueueMetrics is a software package to analyze the queue_log file and extract a wealth of aggregate statistics on queue activities. The software is available for download and public trial.
  • Queue-Tip - Opensource (GPL) Asterisk Queue Monitoring and Reporting suite using Adhearsion and Ruby on Rails.
  • Asterisk Queue Log Analyzer - AQLA - Queue Log Analyzer, Reporting Tool, Realtime monitoring for Asterisk call center. PHP & MySQL. Online Demo
  • QueueWiz is a free online simulator for Asterisk queues. Estimate wait times, congestion, revenue and more.


Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ

Synopsis

Queue a call for a call queue

Description

Asterisk 1.8:
Queue(queuename[,options[,URL[,announceoverride[,timeout[,AGI[,macro[,gosub[,rule[,position]]]]]]]]])


Asterisk 1.6.0:
Queue(queuename[,options[,URL[,announceoverride[,timeout[,AGI[,macro[,gosub[,rule]]]]]]]])


Asterisk 1.4:
Queue(queuename[|options][|URL][|announceoverride][|timeout][|AGI])


Asterisk 1.0 through 1.2:
Queue(queuename[|options][|URL][|announceoverride][|timeout])


Queues an incoming call in a particular call queue as defined in queues.conf or dynamic realtime.

The option string may contain zero or more of the following characters:
  • d — data-quality (modem) call (minimum delay).
  • h — allow callee to hang up by pressing *.
  • H — allow caller to hang up by pressing *.
  • n — no retries on the timeout; will exit this application and go to the next step.
  • r — ring instead of playing MOH.
  • R — stops moh and rings once an agent is ringing (Asterisk Trunk)
  • t — allow the called user to transfer the calling user.
  • T — allow the calling user to transfer the call.
  • w — allow the called user to write the conversation to disk via Monitor.
  • W — allow the calling user to write the conversation to disk via Monitor.
  • c — continue in the dialplan if the callee hangs up (Asterisk 1.6.0 and above).
  • i — ignore call forward requests from queue members and do nothing when they are requested (Asterisk 1.6.0 and above).
  • k — Allow the called party to enable parking of the call by sending the DTMF sequence defined for call parking in features.conf (Asterisk 1.6.0 and above).
  • K — Allow the calling party to enable parking of the call by sending the DTMF sequence defined for call parking in features.conf (Asterisk 1.6.0 and above).
  • x — allow the called user to write the conversation to disk via MixMonitor (Asterisk 1.6.0 and above).
  • X — allow the calling user to write the conversation to disk via MixMonitor (Asterisk 1.6.0 and above).

In addition to transferring the call, a call may be parked and then picked up by another user.

'URL' allows you to specify a URL that will be sent to the called party if the channel supports it. You can also use an external application like QueueMetrics or Asteria Solutions Agent Client to launch the URL if your terminal does not support it.

  • In Asterisk 1.4, the optional AGI parameter will setup an AGI script to be executed on the calling party's channel once they are connected to a queue member.

'announceoverride' allows you to override the announcement specified in queues.conf using 'announce = ...' or add one to it in the first place.

'timeout' sets the time in seconds that a call will wait in the queue before it is routed to the next priority in the dialplan. It defaults to 300 seconds (5 minutes).

Note: at least in asterisk 1.8.5 (and probably earlier) the default is for there to be no timeout, not a 300 second timeout.

The timeout will cause the queue to fail out after a specified number of seconds, checked between each queues.conf 'timeout' and 'retry' cycle.
This application sets the following channel variable upon completion:
QUEUESTATUS The status of the call as a text string, one of TIMEOUT | FULL | JOINEMPTY | LEAVEEMPTY | JOINUNAVAIL | LEAVEUNAVAIL


Note: This doesn't do what you think it should do (in 1.2.4 anyway). Once a call is inside a queue, it is only checked to see if it is timed out every so often (depending on the value of 'timeout=' for that queue in queues.conf). This means that if queues.conf says 'timeout=10' and you call the queue with 'Queue(queuename,,,,5)', it will be ten seconds before the call times out. If you call the Queue with 'Queue(queuename,,,,11)', it'll be 20 seconds. I.E. the value of 'timeout' supplied to the command DOES NOT override the value of 'timeout=' in queues.conf. Don't think about changing the value of 'timeout=' in queues.conf to, say, 1 or the calls will get offered to the members for only one second at a time.

This article attempts to explain this behavior. Note that this article states that the value of the 'timeout' parameter is absolute, which is not correct.


New in Asterisk 1.4: The MEMBERINTERFACE channel variable holds information about which queue member received the call. Variable is not available until you set 'setinterfacevar=' to 'yes' in queues.conf.
Note: This parameter must be wrote INSIDE of each queue, not in the general context because it won't work.






Return codes

This application returns -1 if the originating channel hangs up, or if the call is bridged and either of the parties in the bridge terminate the call. Returns 0 if the queue is full, nonexistent, or has no members.

This method only works when there are no members defined in queues.conf, and instead only added with AddQueueMember(). However with "Member => Agent/101" in queues.conf the Queue command always returns as if there were a member.
Update: 'leavewhenempty = yes' in queues.conf fixes this (in CVS since Sep 28, 2004)

Notes

  • If 'persistentmembers = yes' is used in queues.conf, dynamically added agents are saved in the Asterisk Berkeley database, and are preserved across restart. If not, dynamically added agents are lost upon Asterisk restart.
  • Use the 'Local' channel construct to point to an appropriate dial-out extension in the dialplan if you'd like to add remote agents using AgentCallbackLogin()
  • Transfers of calls that are answered out of a queue must be done using Asterisk '#' transfers (enabled with the 't' option above). SIP transfers result in the Agent remaining affiliated with the call until its eventual termination, preventing that agent from being offered another call.
  • The application sets the following channel variable upon completion: QUEUESTATUS. The status of the call as a text string, one of TIMEOUT, FULL, JOINEMPTY, LEAVEEMPTY, JOINUNAVAIL, or LEAVEUNAVAIL.
  • A member assigned to a queue ("member => Agent/1234" for example) can be a phone (e.g. "member => SIP/phone1").
  • Check the timeout settings of your extensions involved in the queue.
  • Snom Phones have in their web interface an "invisible" timeout of 60 seconds. The Playback command, even if an empty file is played, seems to help in avoiding a call being dropped after 60 seconds.

Examples

Example 1: Basics


exten => s,1,Answer
exten => s,2,SetMusicOnHold(default)
exten => s,3,DigitTimeout,5
exten => s,4,ResponseTimeout,10
exten => s,5,Background(welcome)
exten => s,6,Queue(tech-queue)

The s,1,Answer is important in order not to have ringing in the background of your hold music.

Example 2: Use BLF LED to show queue login status of an agent

Look at this post (in German), requires bristuff'ed Asterisk 1.2 or 1.4

Example 3

Here is a working queue-solution as example:

A call comes in over a sip channel, is routed to the extension which handles the example-queue (here extension 129) in the context example-queue in extensions.conf. The call, if not answered by an agent, should remain for 300 seconds in the queue, before it is routed to the next priority which transfers the call to voicemail.
The called and the calling user are able to transfer the call (tT as options of the queue command in extensions.conf).

Signaling the call to logged on agents should work like this:

After the first priority "Playback(some_announce)" has finished, all agents should be signalled (ringall in queues.conf) for at least 15 seconds (timeout in queues.conf). The caller should hear music on hold in the meanwhile. If the call wasn't answered by an agent, there should be some time before the call is signalled again (retry in queues.conf). The actual queue position is announced to the caller every 30 seconds (announce-frequency and announce-holdtime in queues.conf).

extensions.conf:

[queue]
exten => 129,1,Playback(some_announce) ; Important, see notes
exten => 129,2,Queue(example_queue|tT|||300) ;dont set n option until really needed
exten => 129,3,Playback(some_announce_after_leaving_queue)
exten => 129,4,Voicemail(s1234)

queues.conf:

[example_queue]
music = default
strategy = ringall
context = queue-out ; Here we go when the caller presses a single digit, while in the queue
timeout = 15
wrapuptime=10
announce-frequency = 30
announce-holdtime = yes
joinempty = yes
member => Agent/1234
member => Agent/1235

agents.conf:

[agents]
ackcall=no ; Agent does NOT have to press # to answer the call
musiconhold => default
agent => 1234,0000,Agent1_Name
agent => 1235,0000,Agent2_Name


See also


  • IPSwitchBoard BETA - Queue Log Analyzer
  • Asternic Call Center Stats - PRO 2 just released! Queue monitoring and reporting, GPL and commercial versions available.
  • OrderlyQ - Extension to Asterisk Queues that lets callers hang up, then call back without losing their place.
  • OrderlyStats - FREE Dedicated Real Time Call Centre Management and Statistics Package.
  • QueueMetrics is a software package to analyze the queue_log file and extract a wealth of aggregate statistics on queue activities. The software is available for download and public trial.
  • Queue-Tip - Opensource (GPL) Asterisk Queue Monitoring and Reporting suite using Adhearsion and Ruby on Rails.
  • Asterisk Queue Log Analyzer - AQLA - Queue Log Analyzer, Reporting Tool, Realtime monitoring for Asterisk call center. PHP & MySQL. Online Demo
  • QueueWiz is a free online simulator for Asterisk queues. Estimate wait times, congestion, revenue and more.


Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ
Created by: oej, Last modification: Thu 30 of Oct, 2014 (09:36 UTC) by festr
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+