Wednesday, April 27, 2011

Asterisk Queue

Asterisk queues are wealth! You can do anything with the incoming calls using the queues. Have you ever wanted to route incoming calls to another person, or to a []voicemail, without the knowledge of the customer? With the Asterisk queues you can balance incoming call workload among your employees. Have you ever wanted one person to have more priority in the calls, or a whole group of callers?


The main Asterisk configuration files are located in /etc/asterisk/. In this directory is located queues.conf - /etc/asterisk/queues.conf.


There are two possible ways to configure the settings in this file.


The first one, is the so called "static" way. For this configuration you do not need the agents.conf file.
You will say directly, which users to answer the incoming call. In our example, we have created a context with the name [simple-queue]. In this context we have written the following: member => IAX2/idefisk and member => IAX2/idefisk-rulez. This means that these agents will be responsible for the answering of the incoming calls in the queue simple-queue. In the same way you can add even more than two users, which you would like to answer in this queue. However in our case we will have only two users. The advantage of this method, is that you do not have to use the AgentLogin or the AgentCallbackLogin applications in order to log the users in the queue. It will be logged in automatically, when it turns on its phone. The disadvantage is that these users can use, only the phones, on which they are registered. That is why the method is called "static". You can see a screenshot below.


The other way is the so called "dynamic" way. For this configuration you will need the agents.conf file.
Unlike the "static" method, here we have to write not the name of the user, but the number of the agent, as written in the agents.conf file. In our example we have written the following: member => Agent/8888. This means that we want the agent with number 8888, to answer the incoming calls in the queue test. If you decide to use this method you have to add in your dialplan either the AgentLogin or the AgentCallbackLogin application. This is necessary, because unlike the "static" method, here is not enough just to turn on your phone. The user has to log in itself in the queue, manually. The advantage of this method is that the user could log in from any place and phone, which is connected with the Asterisk PBX.You can see a screenshot below.


Here you can read detaily about agents.conf.


All available settings in /etc/asterisk/queues.conf can be found here.

By default Asterisk queues are using FIFO (First In, First Out) or called in the asterisk world – first-come, first-served. The behavior is: what comes in the queue first it is handled first, what comes in the queue next waits until the first is finished, etc…

There are also two other queues by theory:
1) LIFO (Last In First Out) - what comes in first is handled first, what comes in next waits until the first is finished, etc.
2) Generalized Processor Sharing - customers are served equally. Network capacity is shared between customers and they all effectively experience the same delay.

In /etc/asterisk/extensions.conf you should use the Queue() application, by which you can put calls in the queue.


/etc/asterisk/extensions.conf:

Simple:

[idefisk]

exten => 78,1,Answer

exten => 78,n,Queue(simple-queue)

exten => 78,n,Hangup


/etc/asterisk/queues.conf:

[simple-queue]

context = idefisk

member => IAX2/idefisk

member => IAX2/idefisk2


If any in the system dial 78, the call will be put to the queue named simple-queue.

No comments:

Post a Comment