How we can record the conference call in 15 minutes chunks

Hi Team
right now I’m recording the conference call which is showing the full-time recording file until we don’t end the call. for example, if our call duration is 30 minutes it will save a single audio file of 30 minutes. but I want to save it in 15 minutes chunks. so how it is possible to save it in 15 minutes chunks? through FreePBX configuration.
thanks for the reply.

I don’t think this is possible like that. The only option I see is a script that automatically splits your whole recording into the desired parts.
Can you elaborate why you need those 15 minutes chunks?

Thanks for reply
actually, i want to save the 15 minutes of recording chunks because most of the recording chunks will be mute. so I will remove the audio chunks without audio and the remaining will send to a different server.
so there are two advantages.
1 - remove the recorded audio file without voice, it will save our disk space. because a soundless recording is useless for us.
2 - it will be easy to send 15 minutes of audio to other servers for backup, instead of sending a full-time file ( 2 or 3 hours long).

You have sox ‘buit-in’

The SoX of Silence – Digital Cardboard.

use that in a post recording script

Thanks for your reply dicko.
Yeah, The SoX of Silence is a good idea to remove the silent audio recording. but how we can configure the FreePBX to store the audio recording in chunks of 15 minutes?

If the silence is removed, do you need to split the file?

Here is one option:

and, post-recording, post-silence removal, you could also convert to mp3 to reduce file size

[Converting recorded wav calls to mp3 - #31 by umairmalik2410]

MP3 is generally overkill for telephony. If you want a lower bit rate, consider codecs designed for low bit rate telephony, e.g ADPCM, of the 32 kbps rate in the example, or GSM or G.729, for lower rates.

man sox

look for split and restart and chaining, This is a nice discussion thst broaches on your needs

if you install sox’es format libraries you can even convert to a supported format (mp3) in that chain

If you ‘split’ or reformat the file you won’t be able to use FreePBX to listen to it.

1 Like

Thanks dicko for the reply.

Since I have no memory of anyone ever asking how to do something like this, it would be great if you share the script you end with.

I’m just curious about something based on what has been said by the OP. The need is to break up a 2-3 hour call into 15 minute chunks because the majority of the call is dead air. That would mean that with a 2 hour call over an hour of the call is dead air. That’s a lot of dead air, why is the call even being recorded at that point to catch nothing but dead air? Wouldn’t the smart option to come up with something that stops recording when the call is muted and it is nothing but dead air?

I’m just going to say this as well. Someone in the Asterisk community set something like this up. Record calls, cut up call in post and convert it to another format to save space. They tested it a few times and it worked so they put it in production. Lo and behold a couple months later, they needed one of these cut up calls and it was completely worthless. It showed to be a 20 minute call based on the file data, etc but when you actually went to play it it was 2 minutes of dead air and that was it. When they used sox to check the file, it threw errors about the file.

Turns out they never really tested with existing recordings or ran test scenarios that actually matched their production environment. So just keep that in mind when testing all this, you’ll need to test at least 2-3 of these calls meaning that you need to have multiple calls lasting 2-3 hours a piece where 60% or so (the majority) of the call is muted like it normally would be.

So you can use SoX to create multiple audio files based on the amount of silence/dead air. Now you have your 180 minute call that was broken up into 4 audio files . These audio files account for 40 minutes of audio but the audio minutes of each file could be 10, 20, 5 and 5. So now you want 15 minute chunks, what are you going to do? Mix them back together then split them into 15 minutes? You’ll end up breaking up sentences and could cut words that are important to the call recording.

I will ask what I asked at the start, why are you recording calls that contain 60%+ of dead air when you could come with a method to activate the recording when the call isn’t muted and actual talking is happening?

blindly ‘chunking’ will not be good. In 2022 I would run the recording through a STT system, then take the resulting phoneme timings and sox out anything absent with a bit of padding, I bet the text file would be smaller and easier to analyze though :wink:

I suggest that arranging to record in stereo would also improve intelligability.

1- Login to FreePBX with admin
2- goto advance setting
3- then goto Force Allow Conference Recording
and click on yes.

4- after that hover on applications and click on conferences
5- then click on the edit button on the conference

6- then click on yes in Record Conference tab

7- after completing this thing you will be able to record the conference audio. recorded audio will be shown in this directory /var/spool/asterisk/monitor
8- now login to your machine where you have deployed the asterisk
I’m using ubuntu 18. in my case I will create a file in the root directory.
9- then I will write the following command in sh file to make the chunks of recording in real-time.

current_date=$(date "+%Y%m%d")
current_time=$(date +%s)
current_year=$(date "+%Y")
current_month=$(date "+%m")
current_date_d=$(date "+%d")

/usr/sbin/asterisk -rx "confbridge record stop 4000"
/usr/sbin/asterisk -rx "confbridge record start 4000 /var/spool/asterisk/monitor/$current_year/$current_month/$current_date_d/4000-4000-always-$current_date-192653-$current_time.26874.wav"

10- save the above sh file and then create a cron job to execute it every 15 minutes.

*/15 * * * * /bin/bash /root/

11- now it will record the conference call in 15 minutes chunks. it will create the chunks in real-time during the recording.
12- done

What about the silence pruning?

according to dicko
sox are the best tool to remove the silence part. we will use sox.

Correct but if you have a cron job running every 15 minutes. 1) Why would this run when there aren’t conf calls happening? 2) You wanted 15 minutes of audio with no silence. This will be 15 minutes of audio with silence. 3) You will have smaller than 15 minutes once silence is trimmed. 4) This is stopping/starting calls in 15 min intervals with no consideration of if this is cutting sentences and actual talking off while it stops/starts

I mean this was tested as a cron that runs every 15 minutes even with no confbridge active. Was that part tested? The part where it runs every 15 minutes but nothing to record.

Note there is a setting in Advanced Settings that will allow you to define a post call recording script, so you can run the script on the file as it closes instead of using cron indiscriminately. Script will run on all recordings, not just conference recordings, so you will need to add logic to determine if the recording is from a conference.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.