Ok, so I’m working off old data from like Asterisk 1.3, but I’m trying to set a recording filename, then ring the extension (This is a context from a DB I have setup of numbers to record) and record the call, then have lame convert the file to MP3 once it’s done, however I don’t want it to record if nobody answers… Here is what I have, and I know I could be way off here…
exten => s,1,Set(FILENAME=${TIMESTAMP}-${CALLERID(number)})
exten => s,2,Set(MONITOR_EXEC_ARGS=&& nice -n 19 /usr/local/bin/lame -b 96 -t -F -m m --bitwidth 16 --quiet "/var/spool/asterisk/monitor/${FILENAME}.wav" "/var/spool/asterisk/monitor/${FILENAME}.mp3" && rm -f "/var/spool/asterisk/monitor/${FILENAME}.wav")
exten => s,3,MixMonitor(${FILENAME}.wav,b)
exten => s,4,Dial(PJSIP/302,24)
exten => s,5,Playback(number-not-answering)
exten => s,6,Playback(goodbye)
exten => s,7,Hangup()
Right now timestamp isn’t working and it’s throwing everything off I believe.
WORKING (Except for the ,b option)! USE THIS:
exten => s,1,Set(FILENAME=${STRFTIME(${EPOCH},,%m%d%Y-%H%M%S)}-${CALLERID(number)})
exten => s,2,Set(MONOPT=nice -n 19 /usr/local/bin/lame -b 16 --silent /var/spool/asterisk/monitor/${FILENAME}.wav /var/spool/asterisk/monitor/${FILENAME}.mp3 && rm -f /var/spool/asterisk/monitor/${FILENAME}.wav)
exten => s,3,MixMonitor(${FILENAME}.wav,b,${MONOPT})
exten => s,4,Dial(PJSIP/302,24)
exten => s,5,Playback(number-not-answering)
exten => s,6,Playback(goodbye)
exten => s,7,Hangup()