0

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

1 Answers1

0

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.

arheops
  • 14,867
  • 1
  • 15
  • 27
  • I see. So you can say that adding my uploader script into the dial plan is not correct? I just wanted to be able to execute my uploader script after the call recording is finished. Is there anyway that i can do this? –  Sep 22 '17 at 05:28
  • Have nothing to add. – arheops Sep 22 '17 at 07:49