[general]
static = yes
writeprotect = no
autofallthrough = yes
clearglobalvars = no
priorityjumping = no

[globals]
MONITOR_EXEC = /usr/local/bin/wav2mp3
MONITOR_DIR = /var/spool/asterisk/monitor/
DIALOPTIONS = tL(3600000)
RINGTIME1 = 60

[default]

[DLPN-dialTEST]
exten => _Z.,1,NoOp(SetMixMonitor)
 same => n,Set(MONITOR_FILENAME=${STRFTIME(${EPOCH},,%Y/%m/%d/%Y%m%d_%H%M%S)}-${CALLERID(num)}-${EXTEN}-${UNIQUEID})
 same => n,Set(CDR(userfield)=${MONITOR_FILENAME})
 same => n,MixMonitor(${MONITOR_FILENAME}.wav,b)

 same => n,NoOp(Dial)
 same => n,Dial(SIP/${EXTEN},${RINGTIME1},${DIALOPTIONS})

exten => h,1,StopMixMonitor()
 same => n,System(${MONITOR_EXEC} ${MONITOR_DIR}${MONITOR_FILENAME})
 