Upgrade 3CX to v18 and get it hosted free!

Asterisk Record Calls

Author image

Automon for a Single Call

Asterisk 1.2 now comes with the new “automon” setting in features.conf that permits a user to turn on/off call recording during an active conversation.

Example by Mojo

If you have httpd with php on the * server, you can do what I did:

I set up the key combination *# in features.conf to monitor and created a few php files to interact with the results. Save the four php files into a folder on the * web server, eg: /var/www/html/recordings/ — rename them all to .php instead of .phps, and edit config.php to point to the asterisk monitor directory (usually /var/spool/asterisk/monitor). Now make a soft link so the recorded waves appear in the web tree:

ln -s /var/spool/asterisk/monitor /var/www/html/recordings/monitor

Then direct a web browser to http://asterisk_server/recordings/ and it should be pretty self-explanatory. No recordings will appear in the list if you don’t have the sox packages installed. And, of course, the w or W options must be specified in the Dial() cmd, as in Asterisk cmd Dial.

Listening on Zap Channel Calls

You can listen in (you hear them but they don’t hear you) on conversations taking place on your Asterisk ZAP channels, if you have any. See the ZapBarge command.

Monitor Calls with Astguiclient

When you know how to Monitor a call, you have to know what calls are going on in your PBX. This is much more complex than ZapBarge. For this solution I decided to write Astguiclient, a set of server and client programs that can run on a Linux or Win32 desktop.

The Server Side

A constantly run perl script telnets into the Asterisk manager API of Asterisk and gets the “show channels” output every 333 milliseconds. It then queries a database to see which “phone extension/Zap channel pairs” are not in it already, and inserts them, as well as deleting channels that are no longer active. This way it can scale easily without affecting the Asterisk server at all.

A cron job perl script, running every 5 minutes, takes recorded sound files, merges them with sox and copies them to a universal storage location so they can be easily retrieved

The Client Side

A perl/TK program pulls the current “live calls” information from the database every second using Net::MySQL and displays them in listboxes (so you can see which person is on which Zap channel). When the person whose phone you have selected is on a phone call, the recording button is enabled and you can start recording. Recording is accomplished by the program telnetting into the Asterisk Manager and sending the Monitor command for the specific channel, and stopping recording is done similarly with the StopMonitor command. You can also originate calls through this interface.

See Also


Asterisk | Tips and Tricks


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.