Encironment
Asterisk: 13.29.2
FreePBX: 13.0.197.31
Requirement
I would like to copy a recording call file only after call is finished
Actual Scenario
Right now, I have my Inbound Route set as Force to record all calls, and all files are being created on “var/spools/asterisk/monitor/year/month/day”, but the file is increasing as long as the call is during.
Looking at the conf, I could see the MixMonitor is liek this:
[ext-did-0002]
include => ext-did-0002-custom
.....
exten => 4810,1,Set(__DIRECTION=INBOUND)
exten => 4810,n,Gosub(sub-record-check,s,1(in,${EXTEN},force))
[sub-record-check]
......
exten => recordcheck,n,MixMonitor(${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME}.${MON_FMT},abi(LOCAL_MIXMON_ID)${MIXMON_BEEP},${MIXMON_POST})
But I need to copy this file to a backup dir into another server.
Question
How the proper way to safely move this file to another dir only after the call is finished?
I was thinking that I could create a sub-record-cancel-custom and try to move it to another folder. Is thar a good way?
[sub-record-cancel]
include => sub-record-cancel-custom
exten => s,1,Return()
Thanks,