i have an issue regarding call recording. What i wanted to do is automatically upload the call recording after hangup
My extensions.conf looks some like this
exten => _!,n,System(mkdir “/var/spool/asterisk/${CALLERID(number)}”)
exten => _!,n,Set(FILENAME=CallingTime(${EPOCH})-Called(${EXTEN}))
exten => _!,n,Set(MONITOR_EXEC_ARGS=&& mv “/var/spool/asterisk/monitor/${FILENAME}.wav” “/var/spool/asterisk/${CALLERID(number)}/”)
exten => _!,n,Monitor(wav,${FILENAME},mb)
exten => _!,n,Dial(SIP/100,r)
exten => _!,n,Hangup()
I’ve tried adding
exten => _!,n,System( uploader ${CALLERID(number)} /var/spool/asterisk/${CALLERID(number)}/ ${FILENAME}.wav)
but the recording is not available yet
I’ve tried adding it after hangup
exten => h,1,System( uploader ${CALLERID(number)} /var/spool/asterisk/${CALLERID(number)}/ ${FILENAME}.wav )
but the recording is not available yet
i’ve tried appending the uploader function into the MONITOR_EXEC_ARGS which look something like this
exten => _!,n,Set(MONITOR_EXEC_ARGS=&& mv “/var/spool/asterisk/monitor/${FILENAME}.wav” “/var/spool/asterisk/${CALLERID(number)}/” && uploader ${CALLERID(number)} /var/spool/asterisk/${CALLERID(number)}/ ${FILENAME}.wav )
But the recording fails to merge the two leg files
If you can point me to the right direction or find what i am doing wrong here it would be very helpful. Thanks in anticipation
You should not add long action to hangup handler. That can cause asterisk stuck.
Use cdr(userfield) or other to mark records you want do, after that process it by external scripting.