I want to call Sox after every voicemail message, for every extension, in order to do some post audio processing.
I believe I need to take the entire [macro-vm] context and copy it from extensions_additional.conf where it currently resides and paste it in either extensions_custom.conf or. extensions_override_freepbx.conf.
Does it matter which file I put it in? I’m unclear on the distinction between the two files. Also, if you were me, would you put the call to sox at the end of [macro-vm] or somewhere else? Since it needs to happen after the voicemail is left, I don’t think I can leverage a custom destination, correct?
I see in the current externotify file (/var/lib/asterisk/agi-bin/vmnotify-newvm.php) it has the following variables.
$context = $argv[1];
$mailbox = $argv[2];
Do you know if in the PHP script I can reference the ${vmnu_dstdir}, ${vmnu_mbx}, and ${VM_MESSAGEFILE} variables like I would have in the dialplan? I basically want to execute the sox command on the wav file, that was left, as well as copy files from that directory into another directory and I want to make sure I can get a handle on those things within the PHP script.
Thanks again for the response… There’s only one problem…
It looks like with the externotify option to call an external program, the only parameters available are:the ones below, I can’t act on the recording without knowing the recording path and file name of the last recording. Would I be forced to use the $newvmcount to somehow string together the last part of the filename (e.g… INBOX/msg $arg[3] .wav? I assume there’s a way to pad $argv[3] with leading zeroes in PHP? Thanks again in advance.
I don’t think that’s correct… I just checked a mailbox that has 105 recordings, and the most recent recording has the highest number. 0000 is always the first recording in the folder and so I need to retrieve the most recent recording and work with that.
would be the name of the file, use the appropriate printf syntax of the language of your choice. But because the script is called every time comedian mail exits , like checking your own voicemail, you should test the age of that file to be new enough to need processing.