In order for FreePBX to rename and move the call recording, the built in variable MIXMON_POST in FreePBX is set (either in the GUI or the Global file) and pointed to the moverecfreepbx.sh file, this script will move the call post processing and rename it to the following format <DateTime>_<Duration><Direction>_<Number_>_<Ext>_<CustomerInternalRef>.WAV.
Installation Steps
- Download the sample moverecfreepbx.sh file at https://www.callcabinet.com/Downloads/AtmosModule/moverecfreepbx.sh or for QueueMetrics at https://www.callcabinet.com/Downloads/AtmosModule/Queuemetrics/moverecfreepbx.sh.
- Edit the CCSTAGING variable in the moverec.sh file to point to the location that the CallCabinet module is installed in, by default it is set to: /home/callcabinet.
- Place the moverec.sh into /usr/share/asterisk/agi-bin/ .This script automatically renames and replaces your recordings in your repository, using a specific name format that contains detailed information about the recording, so that it can be easily retrieved later on.
- In the asterisk dialplan (extensions_addtional.conf), define the post-recording action as follows:
usr/share/asterisk/agi-bin/moverecfreepbx.sh ^{MIXMONITOR_FILENAME} “^{AMPUSER}” “^{CALLERID(number)}” “^{CDR(dst)}” ^{CDR(start)} “^{CDR(src)}” ^{UNIQUEID} “^{AGENTEXTEN}”
Alternatively the variables can be set under in the FreePBX GUI under settings > advanced settings > Post Call Recording Script
Note: You might need to enable the following before the “Post Call Recording Script” will show up under advanced settings:
Display Readonly Settings True
Override Readonly Settings True
Additional information:
VARIABLE DEFENITIONS
====================
moverec.sh => script name that will handle the renaming
{MIXMONITOR_FILENAME} => filename of the recording (populated by Asterisk)
{AMPUSER} => user extension (dependent on the Asterisk distro being used…this is the FreePBX version)
{CALLERID(number)} => caller-id will be replaced at call time
{CDR(dst)} => dialed number, will be replaced at call time
{CDR(start)} => start time of the call, will be replaced at call time