[ext-did]
exten => s,1,Noop(----Start-in-call---)
same => n,Set(CHANNEL(hangup_handler_push)=hdlr-dialstatus,s,1(${EXTEN}))) ;; Вешаем хендлер в который выполниться по окончании звонка
same => n,Dial(SIP/trunk/${DNUM},120,WwtTrU(sub-mixmonitor-3,${CALLERID(num)},${DNUM},${UNIQUEID}))
[sub-mixmonitor-3]
exten => s,1,Noop(------------MixMonitor-3---------------)
; same => n,DumpChan()
same => n,NoCDR()
same => n,Noop(DIALEDPEERNUMBER ${DIALEDPEERNUMBER} )
same => n,Set(FILE_UNIQUEID=${ARG3})
same => n,Noop(UNIQUEID = ${FILE_UNIQUEID})
same => n,Set(WAV=/var/spool/asterisk/monitor/${FILE_UNIQUEID})
same => n,Set(filedate=${STRFTIME(${EPOCH},,%Y%m%d_%H-%M-%S)})
same => n,Set(foldername=${STRFTIME(${EPOCH},,%Y/%m)})
same => n,Set(filename=${filedate}_${ARG1:-10}_${ARG2:-10}_${FILE_UNIQUEID})
same => n,Set(MP3=/var/spool/asterisk/monitor/mp3/${foldername}/${filename})
same => n,System(mkdir -p /var/spool/asterisk/monitor/mp3/${foldername})
same => n,Set(monopt=nice -n 19 /usr/bin/lame -b 32 --silent "${WAV}.wav" "${MP3}.mp3" && rm -rf "${WAV}.wav" && chmod o+r "${MP3}.mp3")
same => n,Noop(${CDR(record)})
same => n,Noop(CHANNEL ${CHANNEL(exten)})
same => n,Set(CDR(realdst)=${ARG2});
same => n,Set(CDR(record)=${FILE_UNIQUEID})
same => n,Set(CDR(recordingfile)=${filename}.mp3)
same => n,MixMonitor(${WAV}.wav,b,${monopt})
same => n(end_sub),return
[hdlr-dialstatus]
exten => s,1,Verbose(0, -----hdlr-sms-----)
same => n,Noop(DNUM=${ARG1})
same => n,Noop(${DIALSTATUS})
same => n,Noop(#{ANSWEREDTIME})
same => n(end_hdlr),Return()
location /poster {
proxy_set_header Authorization "Basic YWRtaW46YWRtaW4K=";