FireBrick Call Recording
- 1 Overview
- 2 Configuring the FireBrick for call recording
- 3 Configuring the A&A / FireBrick call recording and emailing software
- 4 Running the A&A / FireBrick call recording and emailing software
- 5 Using the A&A / FireBrick call recording software for announcements (e.g. out of hours announcement)
- 6 Pre-call announcements (e.g. "this call will be recorded")
The FireBrick supports call recording by teeing off the two way audio from a call leg and sending to a SIP endpoint. The SIP endpoint will then record the call and handle it in any way you wish.
The recording is controlled by setting an email address on a call leg. This can be configured for telephone users and set to automatically record incoming one, outgoing only, or all calls. You can also set this on a hunt group to record all incoming calls to the hunt group (attaching the recording to the calling leg).
The recording server can be any SIP endpoint, such as an asterisk box. A Linux-based call recording app is available to FireBrick customers for this purpose (see below).
If the SIP endpoint supports stereo A-law then the recording is made in stereo with each side of the conversation on a channel. Our call recording app makes stereo A-law WAV files, and can be configured to send these by email as each call ends.
Configuring the FireBrick for call recording
To set up automatic call recording you must, at a minimum:
- give the FireBrick the location of your call recording server; and
- configure each extension you wish to record.
Give the FireBrick the location of your call recording server
You give the FireBrick the location of your call recording server by setting the record-server property. This can be either a hostname or IP address.
By default, the FireBrick will play a beep before recording begins. If you want to stop this, set record-beep to false. This is an additional attribute, as part of the main voip config. It applies to all recordings.
Configure each extension you wish to record
You must set the record property for each extension you wish to record automatically. By default this is set to false; to record automatically, on both inbound and outbound calls, set this to true. If you want to record only inbound or outbound calls, set the property to either in-only or out-only accordingly.
If you want the recording to be emailed to the user, you need to set the user's email address, via the email property. This is passed to the call recording application, which handles the email sending.
Configuring the A&A / FireBrick call recording and emailing software
There are two elements to the A&A/FireBrick call recording software:
- a C application, voip-answer, which acts as a SIP endpoint and handles the call recording; and
- a python script
Setting up voip-answer
The voip-answer application comes with a Makefile, but I found I needed to make a couple of tweaks to get it to work:
1.) the Makefile is dependent on deps/siptools.c. If you do not have access to the A&A svn, you'll need to:
a.) comment out the following lines in the Makefile:
svn export --force -r 28442 svn://changeless.aa.net.uk/fb6000/trunk/apps/siptools.c $@ touch $@ # SVN sets the timestamp to the committed one (which triggers "building" every time)
b.) make sure that you have siptools.c in dep/
2.) depending on your version of voip-answer.c, you may need to set the email address parameter (i.e. the from address). Change line 803 from:
sprintf (temp, "sip:%email@example.com", done);
to whatever email address you want to the recordings to be sent from. (%c is the unique ID of the call recording)
(As of 9th August 2018, this has been replaced in voip-answer.c with "sip:%s%.*s", so no modification is necessary.)
3.) By default, the (temporary) path for the recordings is /tmp/. If you want to change this, amend line 62:
char template = "/tmp/voip-answer-XXXXXX";
Once you have configured the script to your preferences, install it by running make.
(If you do not have it installed already, you might need to install libpopt-dev.)
Setting up python email script
Running the A&A / FireBrick call recording and emailing software
The A&A/Firebrick call recording software has seven possible arguments / switches:
- rec-script / r: path to your recording script
- save-script / s: path to your saved file script
- bind-host / h: binds host to the hostname you provide
- bind-port / p: binds to the port you provide
- directory / d: sets the directory path for wav files to be used in audio playback / announcements (see below)
- debug / v: enables verbose / debug mode
- dump / V: outputs a packet dump
So, for example, if you wanted to run voip-answer with a call recording script at /voipuser/voip-answer/python/voip-rec-email/voip_rec_email.py, serving wav files for announcements from /voipuser/voip-answer/sounds/, you would run it with:
./voip-answer -r /voipuser/voip-answer/python/voip-rec-email/voip_rec_email.py -d /voipuser/voip-answer/sounds/
If you want to run it as a background process (which you probably do...), append an ampersand:
./voip-answer -r /voipuser/voip-answer/python/voip-rec-email/voip_rec_email.py -d /voipuser/voip-answer/sounds/ &
Using the A&A / FireBrick call recording software for announcements (e.g. out of hours announcement)
As well as acting as a SIP endpoint for recording calls, voip-answer doubles as a playback system, which you can use to play announcements.
Creating the announcement / playback files
The sound files used for announcements / playback must meet all the following:
- 8000Hz sample rate
- mono only
You can easily use Audacity to create suitable files; just remember to set the sample rate to 8000Hz, and to set the track to mono only, first.
If, when you play the files back through voip-answer, they sound distorted, chances are you have either got the sample rate wrong, or else accidentally recorded them in stereo.
If you have a recording at a different sample rate, using Audacity, change the project's sample rate to 8000, then change the recording's sample rate to 8000, and then use the "Change Speed" effect on the recording — if the original rate was 44100Hz, apply a speed multiple of 5.50.
Hosting the announcement / playback files
Files to be played back can be put in any directory readable by voip-answer. You tell it which directory to look in by using the directory or -d switch. For example:
./voip-answer -d /voipuser/voip-answer/sounds/
Triggering the announcement / playback files
You send traffic to the announcement / playback files by configuring a new extension on the FireBrick, and giving it a SIP URI containing the relevant parameters.
The parameters you can choose from are:
Prefixes (in this order)
XXX= This call is not to be answered, but call progress. XXX is final status = This call is not to be answered, but call progress. End with constant ringing - Add a ring, may be repeated ! Add a SIT, may be repeated N* The playback sequence is to be repeated N times
You can download aai.wav and sit.wav [here].
Following the prefix are dot separated filenames, assumed to be wav files, to play.
A filename can have a ? after it followed by another filename. This skips the second file if the first exists.
Each dot is also a small time delay, so several dots can be used for a pause.
Suffixes, one applies
=filename Record to file * Silence # Refer to #
So if you wanted two rings, followed by playback of a file called "onholiday.wav", you would specify the following SIP URI:
Pre-call announcements (e.g. "this call will be recorded")
You can combine these features with the REFER function ("#"), to create a extension which will first play back an announcement (such as "This call will be recorded"), before referring the call to your chosen destination.
You do not need to do anything with the voip-answer.c script (other than make sure your chosen recordings are in the right place).
Configure your FireBrick:
- As at 10th August 2018, make sure you have alphas enabled, and have at least alpha V1.48.123
- Create a new telephone extension (or amend an existing one)
- Give it the username "Voicemail" and do not give it a password
- Add the URI: <your-pre-call-sound-file>#<extension you want to refer to>@hostname/address
So if you wanted to first play an announcement of called "callsarerecorded.wav", followed by a refer to your extension or hunt group number 500, you would use: