V11.5.1 help running a post recording script

Hi Guys,

I am really struggling and would appreciate some help!

We are trying to set the MIXMON_POST or similar variable to run a script that we have received once a call completes. The purpose of the script is to rename and move the recorded call to another folder for additional processing.

The script we are trying to run is

MIXMON_POST = /usr/share/asterisk/agi-bin/moverec.sh ^{MIXMONITOR_FILENAME} “^{AMPUSER}” “^{CALLERID(number)}” “^{CDR(dst)}” ^{CDR(start)}

The question is where and how is the best pace to set this script to run?

I hope this makes sense, looking forward to hearing from you.

Are you thinking MONITOR_EXEC or MONITOR_EXEC_ARGS maybe?


You would set them with the Set command in your dialplan before you call your MixMonitor() or Monitor() Command.

I dont think so, I am trying to run a script, but I guess simply renaming the file would also work. Do you know how \ where to either run a script (similar to the one in my post) or to rename the recording filename based on call values?

You configure the script that the Monitor Application runs by setting the MONITOR_EXEC variable to be it.

For example:

exten => 100,1,NoOP()
 same =>     n,Set(MONITOR_EXEC=/usr/share/asterisk/agi-bin/moverec.sh ^{MIXMONITOR_FILENAME} "^{AMPUSER}" "^{CALLERID(number)}" "^{CDR(dst)}" ^{CDR(start)})
 sane =>     n,Monitor()
 same =>     n,Dial(SIP/100)

MixMonitor() takes an argument for what command to run instead

exten => 100,1,NoOP()
 same =>     n,MixMonitor(${CDR(UNIQUEID)},b,/usr/share/asterisk/agi-bin/moverec.sh ^{MIXMONITOR_FILENAME} "^{AMPUSER}" "^{CALLERID(number)}" "^{CDR(dst)}" ^{CDR(start)})
 same =>     n,Dial(SIP/100)

Both of these examples should record the call and then execute your script after.

1 Like

Thanks John!!

Last question, which file do I set these in?

Excuse my ignorance, still learning :slight_smile:

By default It’d be in your extensions.conf

1 Like