Difference between revisions of "Vicidial Recording Management Clarified"
From ViciWiki
(Created page with "# During call, audio file is created in /var/spool/asterisk/monitor") |
|||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | == Five Stages with Details == |
||
+ | |||
# During call, audio file is created in /var/spool/asterisk/monitor |
# During call, audio file is created in /var/spool/asterisk/monitor |
||
+ | #* A script constantly checks this folder for changes. |
||
+ | # Move from monitor to monitorDONE |
||
+ | #* As soon as any file in /var/spool/asterisk/monitor stops changing, the file is moved to /var/spool/asterisk/monitorDONE |
||
+ | #* Involved scripts include a combination of these: (Based on set up by your installer, check your crontab -e) |
||
+ | #** /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl |
||
+ | #** /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl --MIX |
||
+ | #** /usr/share/astguiclient/AST_CRON_audio_1_move_VDonly.pl |
||
+ | # Create a compressed copy in /var/spool/asterisk/monitorDONE/MP3 |
||
+ | #* Original recording file is moved to /var/spool/asterisk/monitorDONE/WAV |
||
+ | #* At this stage the WAV file in /var/spool/asterisk/monitorDONE/WAV can be discarded as a redundant file since the MP3 exists. |
||
+ | #* Obviously can use other compression methods such as GSM |
||
+ | #* /usr/share/astguiclient/AST_CRON_audio_2_compress.pl --MP3 |
||
+ | # Copy the archive server via FTP |
||
+ | #* MP3 file is now moved from /var/spool/asterisk/monitorDONE/MP3 to /var/spool/asterisk/monitorDONE/FTP |
||
+ | #* MP3 file in /var/spool/asterisk/monitorDONE/FTP is now redundant (in most cases) |
||
+ | #* If continuing to FTP2, the file in FTP folder is not yet redundant |
||
+ | #* Link/URL in User and Lead record altered to the VARHTTP_path from /etc/astguiclient.conf |
||
+ | #* /usr/share/astguiclient/AST_CRON_audio_3_ftp.pl |
||
+ | #* Uses credentials from /etc/astguiclient.conf |
||
+ | # Copy to redundant archive server via FTP |
||
+ | #* MP3 file is now moved from /var/spool/asterisk/monitorDONE/FTP to /var/spool/asterisk/monitorDONE/FTP2 |
||
+ | #* MP3 file in /var/spool/asterisk/monitorDONE/FTP2 is now redundant |
||
+ | #* /usr/share/astguiclient/AST_CRON_audio_4_ftp2.pl |
||
+ | #* Script requires credentials on the Command Line as those in /etc/astguiclient.conf have already been used by the previous script. |
||
+ | |||
+ | == Pruning == |
||
+ | |||
+ | Pruning of redundant audio files to avoid filling the HD on Dialers: (crontab -e entry) |
||
+ | <pre> |
||
+ | ### remove redundant archived recordings more than 7 days old |
||
+ | 24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/FTP -maxdepth 2 -type f -mtime +7 -print | xargs rm -f |
||
+ | ### and delete originals after 1 day |
||
+ | 24 1 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/ORIG -maxdepth 2 -type f -mtime +1 -print | xargs rm -f |
||
+ | </pre> |
||
+ | This method leaves the recordings in MP3 alone until they've been pushed to the archive server. However: if the archiving process fails, the HD can fill with MP3s. |
||
+ | |||
+ | == Suggestions == |
||
+ | |||
+ | * Verify the processes are not already running when they begin if this option is available. This avoids slow processes bogging down the server. (--run-check) |
||
+ | * Avoid logging in to the FTP daemon on Every File, keep the connection open (--ftp-persistent) |
||
+ | * Do not "assume" the FTP transfer was successful. Check! (--ftp-validate) |
||
+ | * Example with the FTP transfer script: |
||
+ | <pre>/usr/share/astguiclient/AST_CRON_audio_3_ftp.pl --MP3 --run-check --ftp-persistent --ftp-validate</pre> |
||
+ | * Run each script manually with --help to get options. Nothing will be modified when you use --help. |
||
+ | * Test with --debugX and using options to limit the file count to a single file. This allows testing quickly without serious damage. |
Latest revision as of 15:27, 19 May 2020
Five Stages with Details
- During call, audio file is created in /var/spool/asterisk/monitor
- A script constantly checks this folder for changes.
- Move from monitor to monitorDONE
- As soon as any file in /var/spool/asterisk/monitor stops changing, the file is moved to /var/spool/asterisk/monitorDONE
- Involved scripts include a combination of these: (Based on set up by your installer, check your crontab -e)
- /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl
- /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl --MIX
- /usr/share/astguiclient/AST_CRON_audio_1_move_VDonly.pl
- Create a compressed copy in /var/spool/asterisk/monitorDONE/MP3
- Original recording file is moved to /var/spool/asterisk/monitorDONE/WAV
- At this stage the WAV file in /var/spool/asterisk/monitorDONE/WAV can be discarded as a redundant file since the MP3 exists.
- Obviously can use other compression methods such as GSM
- /usr/share/astguiclient/AST_CRON_audio_2_compress.pl --MP3
- Copy the archive server via FTP
- MP3 file is now moved from /var/spool/asterisk/monitorDONE/MP3 to /var/spool/asterisk/monitorDONE/FTP
- MP3 file in /var/spool/asterisk/monitorDONE/FTP is now redundant (in most cases)
- If continuing to FTP2, the file in FTP folder is not yet redundant
- Link/URL in User and Lead record altered to the VARHTTP_path from /etc/astguiclient.conf
- /usr/share/astguiclient/AST_CRON_audio_3_ftp.pl
- Uses credentials from /etc/astguiclient.conf
- Copy to redundant archive server via FTP
- MP3 file is now moved from /var/spool/asterisk/monitorDONE/FTP to /var/spool/asterisk/monitorDONE/FTP2
- MP3 file in /var/spool/asterisk/monitorDONE/FTP2 is now redundant
- /usr/share/astguiclient/AST_CRON_audio_4_ftp2.pl
- Script requires credentials on the Command Line as those in /etc/astguiclient.conf have already been used by the previous script.
Pruning
Pruning of redundant audio files to avoid filling the HD on Dialers: (crontab -e entry)
### remove redundant archived recordings more than 7 days old 24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/FTP -maxdepth 2 -type f -mtime +7 -print | xargs rm -f ### and delete originals after 1 day 24 1 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/ORIG -maxdepth 2 -type f -mtime +1 -print | xargs rm -f
This method leaves the recordings in MP3 alone until they've been pushed to the archive server. However: if the archiving process fails, the HD can fill with MP3s.
Suggestions
- Verify the processes are not already running when they begin if this option is available. This avoids slow processes bogging down the server. (--run-check)
- Avoid logging in to the FTP daemon on Every File, keep the connection open (--ftp-persistent)
- Do not "assume" the FTP transfer was successful. Check! (--ftp-validate)
- Example with the FTP transfer script:
/usr/share/astguiclient/AST_CRON_audio_3_ftp.pl --MP3 --run-check --ftp-persistent --ftp-validate
- Run each script manually with --help to get options. Nothing will be modified when you use --help.
- Test with --debugX and using options to limit the file count to a single file. This allows testing quickly without serious damage.