[ext-queues]
include => ext-queues-custom
exten => 1,1,Macro(user-callerid,)
exten => 1,n,Set(CDR(from_did)=${FROM_DID})
exten => 1,n,Answer
exten => 1,n,Set(__BLKVM_OVERRIDE=BLKVM/${EXTEN}/${CHANNEL})
exten => 1,n,Set(__BLKVM_BASE=${EXTEN})
exten => 1,n,Set(DB(${BLKVM_OVERRIDE})=TRUE)
exten => 1,n,ExecIf($["${REGEX("(M[(]auto-blkvm[)])" ${DIAL_OPTIONS})}" != "1"]?Set(_DIAL_OPTIONS=${DIAL_OPTIONS}M(auto-blkvm)))
exten => 1,n,Set(__NODEST=${EXTEN})
exten => 1,n,Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/q${EXTEN}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID}-${CALLERID(num)})
exten => 1,n,Set(__CWIGNORE=TRUE)
exten => 1,n,Queue(1,tn,,)
exten => 1,n,Noop(Deleting: ${BLKVM_OVERRIDE} ${DB_DELETE(${BLKVM_OVERRIDE})})
exten => 1,n,Set(__NODEST=)
exten => 1,n,Set(__CWIGNORE=)
exten => 1,n,Goto(from-did-direct,100,1)
exten => 1*,1,Macro(agent-add,1,)
exten => 1**,1,Macro(agent-del,1)
exten => *451,1,Set(QUEUENO=1)
exten => *451,n,Goto(app-queue-toggle,s,start)
; end of [ext-queues]
[macro-record-enable]
include => macro-record-enable-custom
exten => s,1,GotoIf($["${BLINDTRANSFER}" = ""]?check)
exten => s,n,ResetCDR(w)
exten => s,n(check),ExecIf($["${ARG1}"=""]?MacroExit())
exten => s,n,GotoIf($["${ARG2}"="Group"]?Group:OUT)
exten => s,n(Group),Set(LOOPCNT=${FIELDQTY(ARG1,-)})
exten => s,n,Set(ITER=1)
exten => s,n(begin),GotoIf($["${CUT(DB(AMPUSER/${CUT(ARG1,-,${ITER})}/recording),=,3)}" != "Always"]?continue)
exten => s,n,Set(TEXTEN=${CUT(ARG1,-,${ITER})})
exten => s,n,Noop(Recording enable for ${TEXTEN})
exten => s,n,Set(CALLFILENAME=${UNIQUEID}-g${TEXTEN}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${CALLERID(number)})
exten => s,n,Goto(record)
exten => s,n(continue),Set(ITER=$[${ITER}+1])
exten => s,n,GotoIf($[${ITER}<=${LOOPCNT}]?begin)
exten => s,n(OUT),GotoIf($["${ARG2}"="IN"]?IN)
exten => s,n,ExecIf($["${CUT(DB(AMPUSER/${ARG1}/recording),\\\|,1):4}" != "Always"]?MacroExit())
exten => s,n,Noop(Recording enable for ${ARG1})
exten => s,n,Set(CALLFILENAME=${UNIQUEID}-${STRFTIME(${EPOCH},,%Y-%m-%d-%H:%M:%S)}-${CALLERID(number)}-${CALLERID(dnid)}-o-1.1)
exten => s,n,Goto(record)
exten => s,n(IN),ExecIf($["${CUT(DB(AMPUSER/${ARG1}/recording),\\\|,2):3}" != "Always"]?MacroExit())
exten => s,n,Noop(Recording enable for ${ARG1})
exten => s,n,Set(CALLFILENAME=${UNIQUEID}-${STRFTIME(${EPOCH},,%Y-%m-%d-%H:%M:%S)}-${CALLERID(number)}-${ARG1)}-i-1.1)
exten => s,n(record),Set(CALLDIRNAME=${STRFTIME(${EPOCH},,%Y-%m-%d)})
exten => s,n,Set(CALLDIR2NAME=${STRFTIME(${EPOCH},,%H)})
exten => s,n,System(mkdir ${MIXMON_DIR}${CALLDIRNAME}/${CALLDIR2NAME} -p -m 0705)
exten => s,n,Set(MIXMON_DIR2=${MIXMON_DIR}${CALLDIRNAME}/${CALLDIR2NAME}/)
exten => s,n,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
exten => s,n,MixMonitor(${MIXMON_DIR2}${CALLFILENAME}.${MIXMON_FORMAT},,${MIXMON_POST})
exten => s,n,MacroExit()
; end of [macro-record-enable]