In FreePBX under General Settings\Call Recording\Run After Record you can specify an optional call monitor script to be run after the call is hung-up. A similar capability to run a script when a voicemail is left would be handy as well.
My intent would be to run a SoX command that would look at the last six seconds of the voicemail and filter out the hang-up click or the "1" touchtone (the voicemail system tell people they can press "1" to end the call, but the DTMF tone ends as part of the recording). After doing that I would amplify the recording. I realize that there is a voicemail recording gain parameter, but the hang-up click or "1" DTMF sound are often the loudest things on the recording, so I achieve better results by first filtering out those sounds, and then amplifying the audio.
If there is an alternate way of doing this, I'd be most receptive. The trickiest thing for me is to ensure that SoX is modifying the right VM file. Thanks.