Call recording using Asterisk MixMonitor and Softphone.Pro
It’s always good to know that customers genuinely need the product you’re building. Our Softphone.Pro is sold in 70+ countries, and tens of thousands of people use it every day.
What’s especially rewarding is the trust our customers show when they ask us questions that go beyond the softphone itself. One of the things we are asked quite often is how to configure call recording in... Asterisk. Our answer usually comes in two parts.
Part 1. Asterisk MixMonitor
To record calls in Asterisk, use the MixMonitor application. Its syntax looks like this:
MixMonitor(filename.extension,[options,[command]])
Filename is the name of the file to be recorded. If you do not specify an absolute path, the file is saved to the default directory defined in asterisk.conf.
Options are flags that tell MixMonitor what exactly to do:
- a: If the file already exists, append the new recording instead of overwriting it.
- b: Save audio only while the call is bridged; this option does not apply to conferences.
- v(x): Adjust the volume of the audio you hear, within a range of -4 to 4.
- V(x): Adjust the volume of the audio you send, within the same range.
- W(x): Adjust both directions at once.
For even more options for every occasion, see the Asterisk documentation.
Here is the simplest example. The command
exten => 100,1,MixMonitor(call-${UNIQUEID}.wav)
translated into human language means:
- record and save all subsequent calls
- to the default folder
- creating a separate file for each conversation
- in WAV format
- with a filename starting with
call - followed by a unique ID assigned automatically.
As you can see, it’s all quite simple. And if this post helps someone take their first steps toward becoming a VoIP engineer, congratulations — and welcome to the club :)
From there, you can climb the next rungs of mastery. For example, to make recordings easier to find, you can add the date and phone numbers to the filename:
exten => 100,1,MixMonitor(/opt/records/${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}_${CALLERID(num)}_${CALLERID(dnid)}.wav)
Rumor has it that Asterisk gurus can write even more elaborate commands, but we usually spare our customers that part. Especially since our answer has a second half.
Part 2. Call recording in Softphone.Pro
If the command line is not where you’d like to spend the best years of your life, there is another excellent option — simple and quick: enable “Start call recording automatically” in the Softphone.Pro settings and choose the format you need.
In fact, it is enabled by default, so all you need to do is make sure everything is still set that way :)
After that, there is no need to hunt for recordings in the Asterisk interface — they are always close at hand in the Call Log.
Even if recording is disabled by default, you can switch it on during a call at any time. Just click the button in the pop-up window, and the important conversation will be saved. Asterisk, with all due respect, will not give you that option — Softphone.Pro will.
And what if the customer objects to having the call recorded? In some countries, the law restricts recording a customer’s voice without consent (see GDPR)... but you can still record your own side of the conversation — the agent channel. It can be a useful compromise: privacy is respected, while you still retain at least some evidence in case of a dispute.
As with Asterisk, Softphone.Pro can be configured to save recordings wherever you need them. For example, recordings can be uploaded automatically to:
- a shared network folder;
- a web server;
- an FTP server;
- cloud storage — Dropbox, Google Drive, or Microsoft OneDrive.
Record with us, record like us, record better than us — with Softphone.Pro :)
YOU MAY ALSO LIKE
Blog Echo in Headset: software and hardware solution
Blog Call me maybe… via “sip:”, “callto:”, and “tel:”
Blog VoIP choppy audio: how to quickly find records with stuttering and breaking up
Support How to set up stereo call recording