Quantcast
Channel: FreePBX Community Forums - Latest posts
Viewing all articles
Browse latest Browse all 226539

Converting recorded wav calls to mp3

$
0
0

That was not the solution I needed but it pointed me in the direction. With a executable post script of: /var/lib/asterisk/bin/convert_recordings.sh ^{TIMESTR} ^{FROMEXTEN} ^{CALLFILENAME} ^{UNIQUEID} ^{ARG3} and code of:

/bin/nice /bin/sleep 3
dy=$(date '+%Y')
dm=$(date '+%m')
dd=$(date '+%d')
file_age=35
wavfilenopath="$(echo $dtpath$3.wav | sed 's/.*\///')"
mp3filenopath="$(echo $dtpath$3.mp3 | sed 's/.*\///')"
dtpath=/var/spool/asterisk/monitor/$dy/$dm/$dd/
/bin/nice /usr/local/bin/lame -b 16 -m m -q 9-resample "$dtpath$3.wav" "$dtpath$3.mp3" && rm -frv "$dtpath$3.wav"
/bin/nice /bin/chown  asterisk:asterisk $dtpath/$3.mp3
# Update the CDR Database
mysql -u root -s -N -D asteriskcdrdb<<<"UPDATE cdr SET
recordingfile='$mp3filenopath' WHERE recordingfile = '$wavfilenopath'"

It runs the conversion on only the intended call and then updates the cdr and removes the wav file.

Thank you dicko for your assistance.


Viewing all articles
Browse latest Browse all 226539

Trending Articles