How do you normally handle empty files created by MixMonitor(b)?
When using:
MixMonitor(filename.wav,b)
Asterisk creates the recording file immediately, even if the channel is never bridged.
The b option prevents audio from being written until the channel is bridged, but calls that hang up in an IVR before any bridge still leave behind an empty/header-only WAV file.
On a high-volume system this can result in thousands of empty recording files, which then have to be handled by storage/upload processes.
How do regular production Asterisk systems normally deal with this?
Use the /tmp/ dir and let “Linux do its magic”. For other systems where we have files we want to clean out we have a script (via cron) that looks at the last time the file was modified. If it’s empty we remove it.
set up a cron job that checks the recording files. If a file is no longer open/in use by Asterisk and is only 44 bytes (WAV header only), it can be treated as an empty recording and removed.