on Asterisk 1.4-r90231
Agents.conf
=================
do NOT use
* recordagentcalls=yes
* recordformat=wav
* monitor-join=yes
do set
* savecallsin=/var/spool/asterisk/monitor
* persistentagents=yes
dialplan
==================
assume
* ${ARG1} is the queue to be joined
[macro-queue]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Set(QUEUENAME=${ARG1})
exten => s,n,AGI(QueueInfo.agi|queuetimeout|${ARG1})
exten => s,n,MixMonitor(/var/spool/asterisk/monitor/${QUEUENAME}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID}.wav|bv(0)V(0))
exten => s,n,Queue(${ARG1}|tw|||${timeout})
....