| 1. Install Asterisk & Other Dependencies |
There are a number of things you'll need to get set up.
Asterisk
OrderlyStats
- OrderlyStats will show you what's going on as you set up your queues and route the calls through to the Agents. You'll also need OrderlyStats to follow the screen shots in the tutorial, and perform one-click Agent log in and log out. You can either download and install it yourself, or sign up for the Managed Service.
| Note: You can complete this tutorial without using OrderlyStats - but the resulting system will not be as good.
|
Once you've finished the installation/sign-up process and connected to your Asterisk, please log in and go to the Control Panel, which should look like this:
Note: If you already have queues and Agents set up on your Asterisk, these will be detected automatically when OrderlyStats connects to it for the first time.
Note: OrderlyStats will work with any Asterisk queue configuration, including AsteriskNOW, TrixBox and FreePBX - you don't have to follow the set-up described in this tutorial to use OrderlyStats.
Sox
- This is a utility for converting between different types of WAV files (a sound format). If you're using Debian, you can get it with
> apt-get install sox
If you're using other flavours of Linux, you may be able to find a pre-built package, otherwise you can download and compile the source code.
Sox is very useful; for instance you can have Asterisk play your own messages and instructions to Callers by recording spoken messages in standard WAV file format, then converting them to GSM format with the following command:
> sox inputfile.wav -r 8000 -c 1 outputfile.gsm resample -ql
or this to convert all the files in a directory:
> for i in *.wav; do sox $i -r 8000 -c 1 $(basename $i .wav).gsm resample -ql; done
If you're interested in creating your own telephony applications then you might also take a look at OrderlyCalls. In this tutorial we'll be using Sox to help us with Music On Hold.
Lame
- Typically music on hold is provided through MP3 files, which is one of the few formats not supported by Sox. Lame is an MP3 encoder/decoder which we can use for conversion. There's no Debian package, so here are the instructions for compiling from source. First, download the source code bundle. Next extract it:
> cd /usr/src
> tar -xvzf /path/to/lame-3.96.1.tar.gz
To compile and install from source:
> cd /usr/src/lame-3.96.1
> ./configure
> make
> make install
If your installation is successful, then typing lame at the command line should print out usage information.
That's it for the prerequisites.
|
| 2. Install Phones |
Create Phone Extensions
Let's make some calls! First, we need to create extensions for your phones, so that Asterisk can dial them. Add the following to the end of your extensions.conf file:
[main]
;Phone Extensions
exten => _1XXX,1,NoOp(Dialling phone ${EXTEN})
exten => _1XXX,n,Dial(SIP/${EXTEN},,rotwh)
exten => _1XXX,n,Hangup
Next do an Asterisk reload by typing reload at the Asterisk command line.
Here we have created a new context for your phone calls, called main. Calls made from your phones will arrive in the context specified in each phone's sip.conf entry (which we have already set to main).
We've also defined a pattern-matching extension, which will match any four digit number 1000 to 1999. The extension dials the corresponding SIP phone.
You should now be able to dial each phone from each of the other phones you have installed, by dialling 1001, 1002, 1003 etc. You should do this now before proceeding, to make sure everything is working correctly.
| Note: These test calls will not appear in the OrderlyStats Control Panel, as your phones have not been registered with OrderlyStats. If you are using hotdesk support (recommended), you'll do this in the next section, otherwise you can add your phones directly by going to the Agents page, and hitting Add Interface.
|
|
| 3. Create Agents |
|
So now we've created extensions to reach the phones in your Call Centre, we're also going to create a separate set of extensions for your Agents. We're going to create two Agents in this example, John Doe, who listens on extension 2001, and Jane Smith on extension 2002. Either Agent may log in to any of the three phones we have added in the previous section (Hot Desking).
Why use separate Agent extensions? Separating the Phone extensions from the Agent extensions means that Agents can Hot Desk, that is, log in to different phones on different days, or, perhaps more importantly, Share Desks, so two Agents can work from the same phone at different times.
This is particularly important for Call Centres, where John might work from 8am to 4pm, and Jane from 4pm to midnight. The ability to Hot-Desk means that John can log out of his phone at the end of his working day, and Jane can log in to receive calls from the same phone, so the callCentreCaps only needs to maintain a single work station to serve the two Agents.
Hot-Desking also allows Agents to take their Voicemail and other settings with them, wherever they happen to be working that day.
For this tutorial, we're going to set up Voicemail for each of the Agents, and then use the Voicemail password to authenticate the Agents when they log in or out of their phones and queues.
Set Up Voicemail
To set up Voicemail for our two Agents, please add the following in the [default] section of your Asterisk voicemail.conf file:
[default]
2001 => 1234,John Doe,john.doe@mycompany.com
2002 => 5678,Jane Smith,janes.smith@mycompany.com
The first number is the voice mailbox ID, which we're setting to the same as the Agent's extension. The second number is the Agent's numeric password. The email address is optional.
Modify Dialplan
To create your Agent Extensions, please add the following lines (in bold) before and after your existing [main] section in your extensions.conf:
[macro-agent-dial]
exten => s,1,NoOp(Agent ${ARG1} called - logged in: ${DB(AGENT/${ARG1}/PHONE)} vm: ${doVoicemail})
exten => s,n,Set(doVMSave=${doVoicemail})
exten => s,n,Set(_doVoicemail=yes)
exten => s,n,Set(__TRANSFER_CONTEXT=transfer)
exten => s,n,GotoIf($["${DB(AGENT/${ARG1}/PHONE)}" != ""]?dial,1:dial-CHANUNAVAIL,1)
exten => dial,1,Dial(SIP/${DB(AGENT/${ARG1}/PHONE)},30,rotwh) ; Ring the interface, 30 seconds maximum
exten => dial,n,Goto(dial-${DIALSTATUS},1)
exten => dial-NOANSWER,1,macro(agent-voicemail,${ARG1},u,${doVMSave})
exten => dial-BUSY,1,macro(agent-voicemail,${ARG1},b,${doVMSave})
exten => dial-CHANUNAVAIL,1,macro(agent-voicemail,${ARG1},u,${doVMSave})
exten => dial-CONGESTION,1,macro(agent-voicemail,${ARG1},b,${doVMSave})
[macro-agent-voicemail]
exten => s,1,GotoIf($["${ARG3}" != "no"]?vm,1:ret,1)
exten => vm,1,Answer
exten => vm,n,Voicemail(${ARG1},${ARG2})
exten => ret,1,NoOp(${ARG1} Voicemail disabled)
exten => ret,n,Set(_doVoicemail=yes)
[macro-phone-login]
exten => s,1,Set(agent=${ARG1})
exten => s,n,Set(phone=${ARG2})
exten => s,n,NoOp(Agent login ${agent} to phone ${phone});
exten => s,n,VMAuthenticate(${agent}) ;comment out this line to disable password authentication.
exten => s,n,Set(oldPhone=${DB(AGENT/${agent}/PHONE)}) ;get the phone this agent used to use, if any
exten => s,n,Set(oldAgent=${DB(PHONE/${phone}/AGENT)}) ;get the agent that used to use this phone, if any
exten => s,n,Set(DB(AGENT/${oldAgent}/PHONE)=) ;log off the old agent.
exten => s,n,Set(DB(PHONE/${oldPhone}/AGENT)=) ;log off from old phone
exten => s,n,Set(DB(AGENT/${agent}/PHONE)=${phone})
exten => s,n,Set(DB(PHONE/${phone}/AGENT)=${agent})
exten => s,n,Playback(agent-loginok)
[macro-phone-logout]
exten => s,1,Set(agent=${ARG1})
exten => s,n,Set(phone=${DB(AGENT/${agent}/PHONE)})
exten => s,n,NoOp(Agent logout ${agent} from phone ${phone});
exten => s,n,VMAuthenticate(${agent}@default) ;comment out this line to disable password authentication.
exten => s,n,Set(DB(AGENT/${agent}/PHONE)=)
exten => s,n,Set(DB(PHONE/${phone}/AGENT)=)
exten => s,n,Playback(agent-loggedoff)
[transfer]
;Catch transfers here to re-enable voicemail.
exten => _X.,1,NoOp(Transfer to ${EXTEN})
exten => _X.,n,Set(doVoicemail=yes)
exten => _X.,n,Goto(main,${EXTEN},1)
[main] ;You'll already have this bit.
;Phone Extensions
exten => _1XXX,1,NoOp(Dialling phone ${EXTEN})
exten => _1XXX,n,Dial(SIP/${EXTEN},,rotwh)
exten => _1XXX,n,Hangup
;Agent extensions
exten => _2XXX,1,NoOp(Dialling agent ${EXTEN} with voicemail ${doVoicemail})
exten => _2XXX,n,Macro(agent-dial,${EXTEN})
exten => _2XXX,n,Hangup
;Get voicemail
exten => _2XXX*,1,Answer
exten => _2XXX*,n,VoiceMailMain(${EXTEN:0:4}@default)
exten => _2XXX*,n,Hangup
;Phone Login shortcut
exten => _2XXX1,1,Answer
exten => _2XXX1,n,Macro(phone-login,${EXTEN:0:4},${CALLERID(num)})
exten => _2XXX1,n,Hangup
;Phone Logout shortcut
exten => _2XXX11,1,Answer
exten => _2XXX11,n,Macro(phone-logout,${EXTEN:0:4})
exten => _2XXX11,n,Hangup
;Phone Login
exten => 1,1,Read(agent,agent-user)
exten => 1,n,Read(phone,agent-newlocation)
exten => 1,n,Macro(phone-login,${agent},$phone)
exten => 1,n,Hangup
;Phone Logout
exten => 11,1,Read(agent,agent-user)
exten => 11,n,Macro(phone-logout,${agent})
exten => 11,n,Hangup
Do an Asterisk reload to register the new extensions.
NOTE: If you like, you can disable password checking by commenting out the lines indicated in your extensions.conf
Register Agents with OrderlyStats
In order for OrderlyStats to start tracking calls to and from your agents, you need to add the Agent Extensions to OrderlyStats. To do this, go to the Agents page (in the menu on the left hand side of the Control Panel) and hit Add Interface at the bottom of the page, and enter in Local/200X@main for each of the Agents like this:
 |  |
| Adding the first Agent... | Adding the second Agent... |
Agent Details
You should also fill in the rest of the details for each Agent, and hit Update at the bottom of the page to save:
The username and password fields are for the Agent Toolbar - more about this later. You should leave the '/n' checkboxes unchecked.
Note: The LINE Agent is automatically created by the system, and is used to indicate that a call has been answered, but not by an Agent.
Test Calls
Now let's test this config. First we're going to log in Agent 2001 (John Doe) to phone 1001 (ExpressTalk). Using ExpressTalk, dial 1, which is the login extension. You'll be asked to enter the Agent number (2001 for John Doe), the phone number (1001 for ExpressTalk), and John's password (1234 from voicemail.conf). John will then be logged in to that phone.
Now use SJPhone to call John Doe, by dialling 2001. You'll see the call come up as an INBOUND call to John Doe in the OrderlyStats Control Panel:
 |
John's phone Ringing with the inbound call from SJPhone / 1003.
|
 |
| After answer, John is shown as Talking to Caller 1003. |
Hint: If the time counters do not start at 0s, you need to make sure the clock on your OrderlyStats machine is correctly set, AND that the clock on your browser machine is correctly set. On Linux you can do this automatically with the ntpdate package. On Windows you can set the System Clock to automatically get the correct time with the Internet Time dialog.
Now that a call has been placed to John's phone, the system will now also log calls from that phone as belonging to John. To test, use John's phone (ExpressTalk) to dial SJPhone (1003), and you should see the call come up as an OUTBOUND call in the OrderlyStats Control Panel:
 |
John makes an outbound call to 1003.
|
Now we're going to log in the second Agent, Jane Smith (2002). We're going to log her into X-Lite (1002). We're going to use the shortcut login extension, so log in to the phone by dialling 20021 with X-Lite. This will automatically pick up the Agent ID (2002) from the number dialled, and the phone ID (1002) from the Caller ID, so you'll just be asked for Jane's password, which is 5678.
To test Jane's log in, dial 2002 from John's phone (ExpressTalk). As this is an internal call, each leg of the call will be shown separately in the Control Panel, as an INBOUND call to Jane, and an OUTBOUND call from John:
 |
John (2001) makes an internal call to Jane (2002).
|
The call is only shown once in the OrderlyStats reports (historical logs), as an INTERNAL call:
 |
John misses an inbound call, makes an outbound call, calls Jane but she doesn't answer, and then calls Jane and she does answer. Calls are shown with the most recent at the top of the page (but you can change the sort order using the arrows at the top of each column).
|
Now try logging out Jane by dialling 11 from X-Lite (phone 1002). If you now dial Jane's extension (2002) with any other phone, she'll still be shown as taking an INBOUND call, but the system will send the call to her Voicemail automatically. The call will not be shown as answered.
HINT: You can have the Agents log in and out more quickly by dialling their extension then 1 to log in, or 11 to log out (e.g. 20021 for Jane to log in, and 200211 for Jane to log out).
|
| 4. Configure Music On Hold |
|
If you're happy to use the default Asterisk Music On Hold, you can skip to the next section.
Asterisk Music On Hold
Now we've got our Agent extensions set up, it's time to think about our queues. The first thing we'll need is Music On Hold to play to the Callers while they are waiting.
You can play a single file or groups of files; in the latter case Asterisk will play each file in order, then repeat (assuming your Caller is still on hold by that point).
- To specify groups of files, you put them in the same directory.
- To play a single file you create a directory and put the single file in it.
You can also specify multiple different groups of files to play under different circumstances.
The default group of music on hold files is in
/var/lib/asterisk/mohmp3 (Asterisk 1.0.X and 1.2.X), and /var/lib/asterisk/moh (Asterisk 1.4.X and above)
This directory contains three sound files in MP3 format (1.0/1.2) or WAV format (1.4 and above). Asterisk 1.2 and 1.0 play MP3 files by default, but there are good reasons why you should avoid doing this (see below).
To tell Asterisk about your groups of files, you list them as classes in
/etc/asterisk/musiconhold.conf, which initially has just one class defined called 'default':
Asterisk 1.0.10 and below:
;
; Music on hold class definitions
;
[classes]
default => quietMP3:/var/lib/asterisk/mohmp3
|
Asterisk 1.2.x, 1.4.x and above:
;
; Music on Hold -- Sample Configuration
;
;1.2.X - for MP3s
[default]
mode=quietmp3
directory=/var/lib/asterisk/mohmp3
;1.4.X and above - for Asterisk-supported sound files, including WAV and RAW
[default]
mode=files
directory=/var/lib/asterisk/moh
|
To begin with, all the other classes are commented out. Note that although the syntax for musiconhold.conf has changed between Asterisk 1.0.x and 1.2.x, Asterisk 1.2.x will work with the old syntax (but will print a warning).
Test Default Configuration
We'll start by testing the default configuration. Add the following lines to /etc/asterisk/extensions.conf, at the end of the [main] context.
exten => 3000,1,Answer
exten => 3000,2,SetMusicOnHold(default)
exten => 3000,3,WaitMusicOnHold(20)
exten => 3000,4,Hangup
Next do an Asterisk reload to tell Asterisk about the new extension.
Now dial extension 3000 with any phone. You should hear the default music.
Play Your Own Music
You'll probably want to change the music played to suit your own tastes, so find an MP3 of some music you'd like to play to your Callers. A good source of free classical MP3s is classiccat.net.
Upload your chosen MP3(s) to your Asterisk server, and put them in /var/lib/asterisk/mohmp3 and delete the other MP3s there.
Shutdown and restart Asterisk - a reload won't do as the music streams do not reset themselves on reload. Then dial extension 3000 again with your phone. You should hear the music you've chosen.
Change the File Type
Continuously decoding MP3 files for potentially many Callers is computationally very expensive. It's much better to use an uncompressed format - this will reduce the incidence of sound glitches on your Asterisk system (and if you are suffering from glitchy audio, you should check to make sure your Asterisk is not playing any MP3 music or prompts). The next step is to replace the MP3s played by Asterisk with RAW streams (an uncompressed audio format). There are three reasons for doing this.
- Mpg123 (used to play MP3s on old versions of Asterisk) is not licensed for use in commercial environments.
- Playing RAW streams is much more efficient than playing MP3s, as your server doesn't have to keep decoding and redecoding the files.
- There's a bug in some versions of Asterisk which means that quite often it won't loop playback with mpg123 (a
request to schedule message in the past?!?! message appears, and the Caller hears silence). Playback of MP3 has also been associated with core dumps and glitchy audio.
We can fix all of these by playing RAW files.
Note: As of Asterisk 1.2.0, Mpg123 is no longer used by Asterisk, which has its own MP3 player. However, it's still a good idea to play raw files for performance reasons, and so Asterisk 1.2.x and 1.4.x support a new files mode for playing raw files. |
|
Asterisk 1.0.10 and below:
We have to create a new program to play the raw files:
> vi /usr/bin/rawplayer
Type in (or copy-and-paste) the following file:
#!/bin/sh
for name in $@; do
cat $name ;
done
Once you've saved your new rawplayer, you must make it executable:
> chmod 755 /usr/bin/rawplayer
|
|
Asterisk 1.2.x, 1.4.x and above:
These versions of Asterisk are able to play raw files unaided, so there's no need to create a separate rawplayer.
|
Now that you've created your player, you also need to convert your MP3 files to RAW format.
> cd /var/lib/asterisk/mohmp3
Let's assume you have a single file in this directory called mymusic.mp3. The following will convert it into a 16-bit WAV file:
> lame --decode mymusic.mp3 mymusic.wav
Next you have to convert it from a WAV file to a RAW file. We'll use Sox for this:
> sox -V mymusic.wav -r 8000 -c 1 -w mymusic.raw
This converts the WAV file to RAW (binary) format at the appropriate sample rate (8kHz).
|
Asterisk 1.0.10 and below ONLY:
Finally, in order for Asterisk to be able to read the file, it must have a .mp3 extension (even though it isn't an MP3 any more).
> mv mymusic.raw mymusic.raw.mp3
|
You should remove any leftover MP3 and WAV files from the directory.
You also need to update /etc/asterisk/musiconhold.conf to play your new raw file. Change it so it looks like this:
Asterisk 1.0.10 and below:
;
; Music on hold class definitions
;
[classes]
default => custom:/var/lib/asterisk/mohmp3,/usr/bin/rawplayer
|
Asterisk 1.2.x, 1.4.x and above:
;
; Music on Hold -- Sample Configuration
;
[default]
mode=files
directory=/var/lib/asterisk/mohmp3
|
Remember to shutdown and restart Asterisk, as you've made changes to your Music On Hold configuration, and test again by calling extension 3000.
Note: If you're using Asterisk 1.2.x or 1.4.x with mode=files, each new Caller will hear your on-hold music from the start (rather than where it left off from the previous call as with Asterisk 1.0.x). If this behaviour is not desired, you can use the rawplayer as described above, or compile a rawplayer from the source in /usr/src/asterisk-1.2.x/contrib/utils - see the README in that directory for more information. |
Create Additional Music Classes
You might want to play different music for different occasions. If you want to do this, then create a new directory inside mohmp3, and put your additional raw files in there, and add lines to your musiconhold.conf like this:
Asterisk 1.0.10 and below:
;
; Music on hold class definitions
;
[classes]
default => custom:/var/lib/asterisk/mohmp3,/usr/bin/rawplayer
;my new music class
myclass => custom:/var/lib/asterisk/mohmp3/mydirectory,/usr/bin/rawplayer
|
Asterisk 1.2.x, 1.4.x and above:
;
; Music on Hold -- Sample Configuration
;
;you'll have moh instead of mohmp3 if you're using 1.4.x or above.
[default]
mode=files
directory=/var/lib/asterisk/mohmp3
[myclass]
mode=files
directory=/var/lib/asterisk/mohmp3/mydirectory
|
Once you've defined your classes, you can test them by changing the entry for extension 3000 in /etc/asterisk/extensions.conf:
exten => 3000,1,Answer
;Play my new music class, instead of the default.
exten => 3000,2,SetMusicOnHold(myclass)
exten => 3000,3,WaitMusicOnHold(20)
exten => 3000,4,Hangup
| Note: Remember to restart Asterisk if you've made any changes to your music on hold system. |
|
| 5. Create Queues |
|
Now you've defined your Agents and their phones, you're ready to set up a queue.
Queue definitions are found in /etc/asterisk/queues.conf. As you'll see there are a lot of configuration options; here are two example queues to get you started.
[Sales]
music=default
strategy=ringall
eventwhencalled=yes
timeout=15
retry=1
wrapuptime=0
maxlen = 0
announce-frequency = 0
announce-holdtime = no
[CustServ]
music=default
eventwhencalled=yes
strategy=ringall
timeout=15
retry=1
wrapuptime=0
maxlen = 0
announce-frequency = 0
announce-holdtime = no
These queues will ring all assigned Agents when a new Caller arrives, and will not make any announcements regarding queue size, estimated wait etc.
If you've defined a custom music class, you can set your queue to use it with the music parameter.
Do an Asterisk reload, and the new queues will appear in the Control Panel within 10 seconds:
 |
New queues appear automatically in OrderlyStats
|
It is possible to assign static Agents to your queues in queues.conf with a member line like this:
member => Local/2001@main ;Adds John Smith to queue
However, this is not a good idea as static Agents cannot then be logged in and out of queues dynamically - they are permanently assigned instead. This means that static Agents have the following drawbacks:
- Static Agents cannot log in and out when they arrive for work and leave for home,
- Static Agents' session times cannot be tracked,
- Callers cannot be automatically routed away from the queue if no-one's there to answer them,
- Static Agents cannot be dynamically reassigned to different queues, and
- Static Agents' phones are rung all the time, regardless of whether the Agent is present to answer.
These drawbacks are removed by using dynamic Agents instead as described in the next section.
| Hint: You can use Group functionality to assign groups of Agents to queues, but many of our users have had problems with this system, so we don't recommend it. It's much better to add Agents individually to each queue.
|
| Hint: Although Asterisk supports it, we also don't recommend adding phones directly to queues, as they may not always be staffed. If this happens, your phones will ring even when there are no people to answer them. It's also impossible to track individual Agent performance when phones are used directly.
|
|
| 6. Queue Log In and Log Out |
|
To recap, so far we have defined our Agents, and the phones they use, and provided a mechanism to allow the Agents to log on and off particular phones.
We have also defined two queues, so the last thing we need to do is create the mechanism that allows Agents to log in and out of the queues, so they can start receiving queued calls.
The Hard Way
Skip to The Easy Way if you're using OrderlyStats.
If you're not using OrderlyStats, you can provide your Agents with numbers to dial to log in and out of individual queues, but you must then give your queues numeric names. Here is an example:
[macro-queue-login]
exten => s,1,Set(agent=${ARG1})
exten => s,n,Set(queue=${ARG2})
exten => s,n,NoOp(Queue login agent ${agent} to queue ${phone});
exten => s,n,VMAuthenticate(${agent}) ;comment out this line to disable password authentication.
exten => s,n,AddQueueMember(${queue},Local/${agent}@main);
exten => s,n,Playback(agent-loginok)
[macro-queue-logout]
exten => s,1,Set(agent=${ARG1})
exten => s,n,Set(queue=${ARG2})
exten => s,n,NoOp(Queue logout agent ${agent} from queue ${phone});
exten => s,n,VMAuthenticate(${agent}) ;comment out this line to disable password authentication.
exten => s,n,RemoveQueueMember(${queue},Local/${agent}@main);
exten => s,n,Playback(agent-loggedoff)
[main]
;...
exten => _3XXX1,1,Answer
exten => _3XXX1,n,Read(Agent,Agent-user)
exten => _3XXX1,n,Macro(queue-login,${Agent},${EXTEN:0:4})
exten => _3XXX1,n,Hangup
exten => _3XXX11,1,Answer
exten => _3XXX11,n,Read(Agent,Agent-user)
exten => _3XXX11,n,Macro(queue-logout,${Agent},${EXTEN:0:4})
exten => _3XXX11,n,Hangup
This has the following limitations:
- All your queue names must be four digits long and start with the number 3 (which is not user-friendly), and
- The Call Centre Manager cannot manage which Agent is assigned to each queue, and
- Agents who are members of multiple queues will have to log in and log out of each one separately, and
- Agents may not be able to perform login or logout if their phone is already ringing or in use, and
- There is no support for Agent prioritisation (using the Penalty system), and
- There is no support for wrap-up (using the Pause system).
The Easy Way
The easy way to do queue login and logout is with OrderlyStats. OrderlyStats comes with an Agent Toolbar that your Agents use to log in and out of their queues. The first step is to assign the Agents to the queues, using the Agents page - click on the 'None' link at the end of each Agent's row to open the assigner dialog, like this:
 |
 |
| Assigning John to Sales and CustServ |
Assigning Jane to CustServ |
Although the Agents are now assigned, they won't start taking calls until you log them in with the Login button ( ), which you can do from this page as Call Centre Manager.
Agent Toolbar
For your Agents to log themselves in and out of your queues, they need the Agent Toolbar. You should have already set them up with a username and password for this in the Agent Details section above. Once logged in, the toolbar looks like this:
 |
| Jane's Agent Toolbar showing an answered INBOUND call. |
To Log Out of all her queues, Jane just needs to hit the Log Out button. She can log in to all her assigned queues with one touch by hitting the Log In button.
If your Agents need time to wrap up after each call before taking the next call, they can do this by hitting the Pause button during the call, or aftwerwards. This will prevent the queue(s) to which they are assigned from sending them more calls until they hit the Resume button.
The OrderlyStats Reports will show you Agent session times, and also time spent in wrap up after each call,
Note: The Toolbar Login/Logout function logs an Agent in or out of all the queues to which the Agent is assigned in the Agents page.
Agents do not have direct control over which queues they are assigned to with the Agent Toolbar. This is by design.
As Call Centre Manager, you can do this yourself at any time using the Agents page to reassign Agents on the fly, or log them in and out yourself using the Log In/Log Out buttons next to each Agent in the Control Panel. You retain full control of which queue(s) each Agent is assigned to.
|
| 7. Test Your Queue |
|
The last step is to provide an extension for incoming Callers to ring into the queue. Add the following lines to /etc/asterisk/extensions.conf at the end of the [main] context.
exten => 3001,1,Answer
exten => 3001,n,Ringing
exten => 3001,n,Wait(2)
exten => 3001,n,Set(_doVoicemail=no)
exten => 3001,n,Queue(CustServ,twh)
exten => 3001,n,Hangup
exten => 3002,1,Answer
exten => 3002,n,Ringing
exten => 3002,n,Wait(2)
exten => 3002,n,Set(_doVoicemail=no)
exten => 3002,n,Queue(Sales,twh)
exten => 3002,n,Hangup
Next do an Asterisk reload.
To test your queue, use SJPhone (1003) to dial extension 3001 (CustServ).
You should hear music on hold through SJPhone, and the other phones will start ringing.
You will see something like this in the Control Panel:
 |
| A queued call in the CustServ queue. Jane's phone is ringing, but John is currently Paused, so no calls are placed to him. |
Note that if there are no Agents available, the Caller will hear music on hold indefinitely.
Hint: If you want to change this behaviour, then add leavewhenempty=yes to the queue's entry in queues.conf, and replace the Hangup line in the above example with, for instance, a call to leave Voicemail instead. As of Asterisk 1.2.0, this is the default behaviour.
|
That's it for the tutorial. You should now have a fully functioning Call Centre system with hot-desking Agents and Voicemail. Realtime and historical reports and dynamic Agent assignment are provided through OrderlyStats.
The next section covers integration with our OrderlyQ add-on, which helps you - Answer more Callers without hiring additional staff,
- Improve Caller satisfaction, and
- Improve Agent morale.
OrderlyQ works with any Asterisk-based queue, so if you need help increasing your answer rate, make sure you ask us for a free trial.
|
| 8. OrderlyQ Integration |
|
To get ORDERLYQ
, please contact us so we can set up a queue for you.
OrderlyQ works with your existing Asterisk queues to distribute Callers to your Agents. Callers are given an estimated wait time, and invited to hang up and call back at any time without losing their place, so this is great if you don't have enough Agents to cope with demand, or if you're looking to reduce your staffing costs. Call Centres using OrderlyQ typically reduce their abandonment to less than 1/3 of its former value.
Once we've set up your account, we'll send you your Queue Code (see below), and also give you access to our configuration screens so you can configure OrderlyQ to suit your needs.
In order to work with your Asterisk queues, you'll need to make the following configuration changes on your Asterisk server. The whole process shouldn't take more than about five minutes.
Install OrderlyQ Sounds
OrderlyQ uses its own sounds to play to your Callers to tell them how long they will be waiting, and tell them that they have the option to hang up and call back without losing their place. Once you've signed up, we'll send you a link to an archive file that contains the necessary sounds. Run the following commands to install them on your Asterisk server:
> cd /var/lib/asterisk/sounds
> tar -xvzf /path/to/OrderlyQSounds.tar.gz
This will create a new subdirectory called OrderlyQ containing all the sounds used by the application.
Hint: You can provide your own sounds for your Callers to hear by overwriting the sounds in the OrderlyQ directory.
|
Set Up Manager Access
OrderlyQ listens for queue events through Asterisk's Manager protocol. In order to do this, OrderlyQ must be able to access your server, which means you need to edit /etc/asterisk/manager.conf.
First enable Manager by setting enabled = yes in the [general] section at the top of the file.
Next add the following lines:
[MyUsername]
secret=MyPassword
deny=0.0.0.0/0.0.0.0
permit=85.13.195.164/255.255.255.255
permit=87.117.198.14/255.255.255.255
read = system,call,log,verbose,command,Agent,user
write = call,log,verbose,command,Agent,user
You should change the username and password to something more secure. The deny and permit lines help ensure that only OrderlyQ can receive messages from your Asterisk server.
| Note: For additional security, we can encrypt the Manager session if required. Please Contact us for further details.
| | Hint: If you're having trouble connecting to our servers, test with telnet to port 4573. If you can't get through, it probably means you need to open up your firewall on ports 4573 (FastAGI, Outgoing) and 5038 (Manager, Incoming). |
Route calls through OrderlyQ
The last step is to send Callers through OrderlyQ on the way to your Agents. To do this you need to modify /etc/asterisk/extensions.conf. The following example assumes you have already set up a queue as outlined in this tutorial.
exten => 2020,1,Answer
exten => 2020,2,Ringing
exten => 2020,3,Wait(2)
;Set music for Callers in OrderlyQ
exten => 2020,4,SetMusicOnHold(default)
;Send Callers to OrderlyQ.
exten => 2020,5,agi(agi://qqq.orderlyq.com/orderlyq?queueCode=QUEUE_CODE&username
=MyUsername&password=MyPassword&AsteriskQueueName=MyQueue) ;All one line.
exten => 2020,6,Queue(MyQueue|r)
exten => 2020,7,Hangup
There are two new lines here, and a slight change to one of the pre-existing lines.
The first line sets the music on hold to play while Callers are in OrderlyQ.
The second line is the call to OrderlyQ, which will manage the call until it's time for it to be answered by one of your Agents.
The agi call contains variables that tell OrderlyQ how to access queue information on your server. There are four parameters (separated by the '&' character).
- The first parameter,
queueCode, should be the numerical Queue Code of the OrderlyQ queue you're using (which is shown in your member's control panel). - The second and third parameters are the username and password defined in your
manager.conf file.
- The last parameter is the name of the queue to protect (as defined in queues.conf, and as listed in the Queue call two lines below).
The call to Queue on the next line has also been modified to play the ringing tone, instead of music on hold. The reason for this is that OrderlyQ ensures that Callers will only be on hold for a very short time once they leave the OrderlyQ system, so it's better to play them the ringing tone to indicate that their call is about to be answered, rather than more Music On Hold (as hearing more Music On Hold is likely to make them hang up).
Hint: If you're not in the US, you'll probably want to change the ring tone being played to suit the phones in your country. You can do this by editing the country=us line in the [general] section of /etc/asterisk/indications.conf.
| | Note: Don't worry if your queue system is different from the one described in this tutorial, or if you're not using Asterisk - you can still use OrderlyQ. |
| Note: Asterisk 1.0.x and 1.2.x users should also apply the FastAGI contingency patch, to prevent calls from being dropped should your servers become unable to reach ours for any reason. Contingency handling is built into Asterisk 1.4.x already, so there's no need to apply the patch if you have this version or above. |
Finally do an Asterisk reload, and your Callers will never have to wait on hold again!
|
|