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.
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.
There are two reasons why "outbound call-center" calls are different from casual calls:
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:
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).
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.
Outbound activity is tracked just like inbound, that is:
For lost outbound calls, the "agent" field will be displayed.
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.
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,HangupThis 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,HangupThis makes it possible to do live listening of outgoing calls.
Go to FreePBX → Add custom trunk
Create a new trunk with the following parameters:
Leave all other fields blank.

Save the new trunk.
Now you have to create a route to use our trunk.
Click on Outbound routes → New route and use the following parameters:

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:

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.
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
Log in to QueueMetrics and go to Edit queues.
Create a new queue with the following parameters:
Leave other fields blank.

Save and go back to the main page.
| 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?. |
In order for an agent to place a call, you now have two choices:
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.

When you are logged on, click on "Dial".
Enter your current extension, select the campaign and enter the number to be dialled.

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:

As always, you can use the Pause and Status keys as you would for an inbound call.
In order to listen to recorded outbound calls, you simply use the same procedure you used for inbound calls:

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

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