Considering the in-efficiancy of running agi scripts for every call, especially when calling (local) members of a queue, here is the dialplan equivalence of the recordingcheck script. Just replace the entire macro record enable with the code below. This code also eliminates the need to run the archive_recordings script every night, as it stores the recording in the proper location!
[macro-record-enable]
exten => s,1,GotoIf($[${LEN(${BLINDTRANSFER})} > 0]?:stopm)
exten => s,n,ResetCDR(w)
exten => s,n(stopm),StopMonitor()
exten => s,n,Gotoif($[${DB(AMPUSER/${ARG1}/recording)} != ""]?${ARG2},1)
exten => s,n,Noop(No recording settings found for ${ARG1})
exten => OUT,1,Gotoif($[$["${DB(AMPUSER/${ARG1}/recording)}" : ".*out=([^|]+)"] = Always]?r,1)
exten => GROUP,1,Gotoif($[$["${DB(AMPUSER/${ARG1}/recording)}" : ".*out=([^|]+)"] = Always]?r,1)
exten => IN,1,Gotoif($[$["${DB(AMPUSER/${ARG1}/recording)}" : ".*in=([^|]*)"] = Always]?r,1)
exten => r,1,Set(TYPE=${IF($[${ARG2}=Group]?g:${TYPE})})
exten => r,n,Set(TYPE=${IF($[${ARG2}=OUT]?out:${TYPE})})
exten => r,n,Set(TYPE=${IF($[${ARG2}=IN]?in:${TYPE})})
exten => r,n,Set(CALLFILEPATH=${STRFTIME(${EPOCH},,%Y)}/${STRFTIME(${EPOCH},,%m)}/${STRFTIME(${EPOCH},,%d)}/${ARG1}/${TYPE})
exten => r,n,Set(CALLFILENAME=${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}.${UNIQUEID})
exten => r,n,SYSTEM(mkdir -p ${astspooldir}/monitor/${CALLFILEPATH})
exten => r,n,MixMonitor(${CALLFILEPATH}/${CALLFILENAME}.WAV)