3. Running an outbound call-center

This section of the manual explains how to run outbound call-center activity. We assume that you have already configured your call-center for inbound, as explained in the previous section.

3.1. Some things you should know about outbound

In order to run outbound campaigns in your call center, you need to set it up so that agents have a procedure to place outgoing calls.

3.1.1. Why is an "outbound" call different from a normal call?

There are two reasons why "outbound call-center" calls are different from casual calls:

  • They are made as a part of one or more ongoing campaigns, and not one-by-one as they come
  • You want to be able to distinguish them from "casual" calls made for different purpouses

That’s why in our example we use a prefix model where the agent dials a specially formatted number where he specifies the campaign code, e.g. in order to dial number 012345678 for campaign 987, he dials 8987012345678, as in:

  • 8 means outbound campaign dialling, different from your extenal prefix that is usually 0 or 9
  • 987 is the campaign code
  • 012345678 is the number to be dialled

As this procedure is complex and error-prone, QueueMetrics offers a web interface that makes it trivial (you just select the campaign from a drop-down list and enter the number to be dialled).

3.1.2. How do I keep track of outbound agents?

As agents that make outbound calls are not, technically speaking, members of a queue (as there is no such thing in Asterisk as an outbound queue), we have a problem trying to understand if they are available or not in the real-time reporting.

As a solution, we suggest to create special queues in Asterisk for outbound presence; these are normal, inbound queues that never get any call, but agents can log-on and log-off from them. This will cause no problem with Asterisk but will make your life easier when monitoring the call-center.

3.1.3. How is outbound activity tracked?

Outbound activity is tracked just like inbound, that is:

  • The wait time for a call will be the call set-up time
  • The talk time will be the conversation time
  • The caller-id will be the called number
  • The calling person will be show in the Agent field

For lost outbound calls, the "agent" field will be displayed.

3.1.4. Can I track inbound and outbound activity at once?

Yes, QueueMetrics lets you track both inbound and outbound activity at once, on a queue-by-queue basis. This is very useful e.g. in the realtime monitoring, so that on a single page you see all of your agents and their current activities, or in the reports to see the total talk time or number of calls related to an agent.

This gets to be misleading when running reports, because the "wait times" and "lost call ratio" of a mixed inbound/outbound queue are meaningless; this is because you do control wait times when receiving inbound calls, but you cannot do the same when calling outside (callees will answer if and when they please). So be careful when doing this.

3.2. Configuration changes

3.2.1. Changes to the Asterisk configuration

The first thing you have to do is to specify how yor outgong calls are going to be placed - using an external analog line, or T1, or maybe a direct SIP trunk.

Edit the file /etc/asterisk/queuemetrics_extensions.conf and look for the following piece of dialplan:

[queuedial]
; this piece of dialplan is just a calling hook into
; the [qm-queuedial] context that actually does the
; outbound dialing - replace as needed - just fill in the
; same variables.
exten => _XXX.,1,Set(QDIALER_QUEUE=q-${EXTEN:0:3})
exten => _XXX.,n,Set(QDIALER_NUMBER=${EXTEN:3})
exten => _XXX.,n,Set(QDIALER_AGENT=Agent/${CALLERID(num)})
exten => _XXX.,n,Set(QDIALER_CHANNEL=SIP/${QDIALER_NUMBER})
exten => _XXX.,n,Set(QueueName=${QDIALER_QUEUE})
exten => _XXX.,n,MixMonitor(Q-${QDIALER_QUEUE}-${UNIQUEID}.WAV|b|)
exten => _XXX.,n,Goto(qm-queuedial,s,1)

As you can see, here we set a number of variables that let us decide who is the caller and which number he’s trying to reach, and will set up audio recording for the outbound call.

Very likely you’ll have to change at least the line that defines the channel, e.g.

exten => _XXX.,n,Set(QDIALER_CHANNEL=Zap/g0/${QDIALER_NUMBER})

Will let you call number 012345678 as Zap/g0/012345678 that is, will dial it on the fist available channel in your Zaptel card.

You may otherwise have a format like SIP/myprovider/012345678 that will dial numer 012345678 through a SIP trunk called "myprovider".

You should also add the following piece of code to your extensions_queuemetrics.conf file (make sure it’s not already present):

; extension 28: agent custom dial
exten => 28,1,Answer
exten => 28,2,NoOp( "QM: Agent Custom Dial. ...." )
exten => 28,3,Set(QDIALER_QUEUE=${OUTQUEUE})
exten => 28,4,Set(QDIALER_NUMBER=${EXTTODIAL})
exten => 28,5,Set(QDIALER_AGENT=Agent/${AGENTCODE})
exten => 28,6,Set(QDIALER_CHANNEL=SIP/${QDIALER_NUMBER})
exten => 28,7,Set(QueueName=${QDIALER_QUEUE})
exten => 28,8,MixMonitor(Q-${QDIALER_QUEUE}-${UNIQUEID}.WAV|b|)
exten => 28,9,Goto(qm-queuedial,s,1)
exten => 28,10,Hangup

This is used by the web interface for assisted dialling. Make the same change to the QDIALER_CHANNEL variable that you made in the previous context.

As a last change, add the following section to the dialplan (check if it’s not already present):

; extension 14 makes remote monitoring possible for OUTBOUND CALLS
exten => 14,1,Answer
exten => 14,2,NoOp( "QM_AGENT_CODE: ${QM_AGENT_CODE}" )
exten => 14,3,NoOp( "QM_EXT_MONITOR: ${QM_EXT_MONITOR}" )
exten => 14,4,NoOp( "QM_AGENT_EXT: ${QM_AGENT_EXT}" )
exten => 14,5,NoOp( "QM_LOGIN: ${QM_LOGIN}" )
exten => 14,6,ChanSpy(Local/${QM_AGENT_CODE:6}@from-internal)
exten => 14,7,Hangup

This makes it possible to do live listening of outgoing calls.

3.2.2. Changes to the Trixbox configuration

Go to FreePBXAdd custom trunk

Create a new trunk with the following parameters:

  • Custom dial string: Local/$OUTNUM$\@queuedial/n

Leave all other fields blank.

./Pictures/out-trunk.png

Save the new trunk.

Now you have to create a route to use our trunk.

Click on Outbound routesNew route and use the following parameters:

  • Route name: QueueDial
  • Dial patterns: 8|. (this means: all dialled extensions that start with 8 match this route)
  • Trunk sequence: select Local/$OUTNUM$\@queuedial/n

./Pictures/out-route.png

Save the new route and reload configuration.

As a last thing, you should create a queue for outbound dialling. Create a new queue like you did for inbound, this time with the following parameters:

  • Queue Number: 350
  • Queue name: OUT-Callback

./Pictures/out-callback.png

Save and apply changes.

This queue is to be used only as a placeholder to keep track of agent availability status, and will never process any actual call.

3.2.2.1. Testing the new configuration

At this point try dialing 8123456 from one of the extensions; this tries dialling the PSTN number 456 on campaign 123. Even if you get an error (and this is very much likely, as 456 will not be a valid PSTN number) if you look at the end of the file /var/log/asterisk/queue_log you will see that a few lines have been appended, e.g.:

1179399430|1179399430.13|q-123|NONE|ENTERQUEUE|-|456
1179399430|1179399430.13|q-123|NONE|ABANDON|1|1|0

This means everything is in place and working. If now you run a successful call through it, the log will look something like:

1179822810|1179822810.22|q-123|NONE|ENTERQUEUE|-|6309886
1179822813|1179822810.22|q-123|Agent/101|CONNECT|3|
1179822823|1179822810.22|q-123|Agent/101|COMPLETEAGENT|3|10

3.2.3. Changes to the QueueMetrics configuration

Log in to QueueMetrics and go to Edit queues.

Create a new queue with the following parameters:

  • Queue alias: OUT-Callback
  • Queue(s): 350
  • Call flow: Outbound calls
  • Main agents: Agent/200, Agent/201, Agent/202

Leave other fields blank.

./Pictures/out-queue.png

Save and go back to the main page.

[Tip]Tip

You may want to add this queue to the "00 All" entries, so you can see all activity at a glance; or (better) you can create a new "00 All Inbound" to track all inbound activity separately. See also Can I track inbound and outbound activity at once?.

3.2.4. Placing calls

In order for an agent to place a call, you now have two choices:

  • Dial the trunk directly, e.g. 8 123 56789
  • Use assisted dialling

To use assisted dialling, log on as an agent and go to the Agent’s page.

Log on to queue "OUT-Callback" using the "Add member" button.

./Pictures/out-agent.png

When you are logged on, click on "Dial".

Enter your current extension, select the campaign and enter the number to be dialled.

./Pictures/out-agentdialling.png

The phone will ring; when you pick it up, the outbound number will be dialled.

While the call is in progress, you will see call progress as usual:

./Pictures/out-callprogress.png

As always, you can use the Pause and Status keys as you would for an inbound call.

3.3. Call listening

In order to listen to recorded outbound calls, you simply use the same procedure you used for inbound calls:

  • Run a report
  • Click on "Answered"
  • Navigate to the bottom of the page
  • Click on "All calls"
  • See list of all calls found
  • Click on magnifying glass icon
  • Click on the audio file.

./Pictures/out-recording.png

In order to do live listening, as well, you simply follow the same procedure you did for inbound call, that is:

  • Go to the Realtime report
  • Wait for a call to be available
  • When it is, click on the small telephone icon
  • Enter your local extension.

./Pictures/out-live.png

Your phone will ring and you will listen to the call as it’s being made.