Настроил его по мануалу:
Код: Выделить всё
[columns]
alias realdst => realdst
alias filename => filename
Код: Выделить всё
;--== begin of [app-mp3] ==--;
[macro-app-mp3]
exten => s,1,Set(monopt=nice -n 19 /usr/bin/lame -b 32 "${ARG1}${ARG2}.wav" "${ARG1}${ARG2}.mp3" && rm -f "${ARG1}${ARG2}.wav" && chmod 777 "${ARG1}${ARG2}.mp3" && rm -f "${ARG1}${UNIQUEID}.wav")
exten => s,n,NoOp(Call Unique ID is - ${UNIQUEID})
exten => s,n,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
exten => s,n,Set(CDR(filename)=${STRFTIME(${EPOCH},,%Y%m%d)}/${UNIQUEID}.mp3)
exten => s,n,Set(CDR(realdst)=${CALLERID(num)})
exten => s,n,MixMonitor(${ARG1}${ARG2}.wav,i(MIXMONITORID),${monopt})
;--== end of [app-mp3] ==--;
Код: Выделить всё
exten => s,n,Set(CDR(filename)=${STRFTIME(${EPOCH},,%Y%m%d)}/${UNIQUEID}.mp3)
В таблице CDR колонка filename содержит записи только тогда когда вызывается приложение "dial", если внешний абонент попадает в очередь, запись в базу не происходит.
Сам макрос вызывается в диалплане так:
Код: Выделить всё
[company-day]
exten => 3755505,1,Set(CHANNEL(musicclass)=mymusic)
same => n,Set(CALLERID(name)=A${CALLERID(num)})
same => n,Macro(app-mp3,/var/spool/asterisk/monitor/,${STRFTIME(${EPOCH},,%Y%m%d)}/${UNIQUEID})
same => n,Answer
same => n,Set(TIMEOUT(digit)=2)
same => n,Wait(1)
same => n,Background(records/introrus)
same => n,WaitExten(2)
same => n,Playback(recholdrus)
same => n,Queue(company-day-rus,tckw,,,,,sendnumber)
exten => 1,1,GoTo(kaz-main,s,1)
exten => 2,1,GoTo(rus-main,s,1)
[kaz-main]
include => internal
exten => s,1,Set(CALLERID(name)=AK${CALLERID(num)})
same => n,Set(CHANNEL(language)=kz)
same => n,NoOp(${CALLERID(name)})
same => n,Background(records/chooseoption)
same => n,WaitExten(2)
same => n,Playback(rechold)
same => n,Queue(company-day-kaz,tck,,,,,sendnumber)
exten => 1,1,Playback(rechold,m)
same => n,Queue(company-day-kaz,tck,,,,,sendnumber)
exten => 2,1,Playback(rechold,m)
same => n,Queue(company-callagent-kaz,tk,300,,,,sendnumber)
same => n,Queue(company-agent,tck,,,,,sendnumber)
exten => 3,1,Playback(rechold,m)
same => n,Queue(company-railways-kaz,tck,,,,,sendnumber)
exten => i,1,Playback(pbx-invalid)
exten => i,n,WaitExten(2)
exten => i,n,Goto(1,1)
exten => t,1,Playback(vm-goodbye)
exten => t,n,Hangup()
[rus-main]
include => internal
exten => s,1,Set(CALLERID(name)=AR${CALLERID(num)})
same => n,Macro(app-mp3,/var/spool/asterisk/monitor/,${STRFTIME(${EPOCH},,%Y%m%d)}/${UNIQUEID})
same => n,NoOp(${CALLERID(name)})
same => n,Background(records/chooseoption)
same => n,WaitExten(2)
same => n,Playback(rechold)
same => n,Queue(company-day-rus,tck,,,,,sendnumber)
exten => 1,1,Playback(rechold,m)
same => n,Queue(company-day-rus,tck,,,,,sendnumber)
exten => 2,1,Playback(rechold,m)
same => n,Queue(company-callagent-rus,tk,300,,,,sendnumber)
same => n,Queue(company-agent,tck)
exten => 3,1,Playback(rechold,m)
same => n,Queue(company-railways-rus,tck,,,,,sendnumber)
exten => i,1,Playback(pbx-invalid)
exten => i,n,WaitExten(2)
exten => i,n,Goto(1,1)
exten => t,1,Playback(vm-goodbye)
exten => t,n,Hangup()
Код: Выделить всё
[general]
monitor-type=MixMonitor