Due to privacy concerns we have a menu for our callers to choose if they accept the calls being recorded or not. The easiest way for this was an IVR that called the Monitor() application before calling Queue(). However, if Monitor() is active, when the (dynamic) agent picks up the receiver and the call is bridged, the COMPLETEAGENT record is written immediately to queue_log with a call length of 0 seconds.
Now I've got two questions:
1) Is this an Asterisk bug (I'm using the latest 1.4 version) or a misconfiguration on my part? I'll post the relevant pieces of extensions.conf and queue.conf.
2) Are there any other options to record calls conditionally?
Here are the excerpts from my config files:
;extensions.conf
[sales]
exten => s,n,Answer
exten => s,n,NoOp(__MONITOR_ALLOWED is set to "${MONITOR_ALLOWED}")
exten => s,n,GotoIf($["1" = "${MONITOR_ALLOWED}"]?mbegin:qbegin)
exten => s,n(mbegin),Set(D_MONITOR=q-sales-${STRFTIME(,,%F-%T)}-${UNIQUEID}-${CALLERID(num)})
exten => s,n,Monitor(wav,${D_MONITOR},mb)
exten => s,n(qbegin),Queue(sales,,,,90)
exten => s,n,NoOp(QUEUESTATUS was "${QUEUESTATUS}")
exten => s,n,Hangup()
;queues.conf
[general]
;No Options here
[sales]
maxlen=0
reportholdtime=yes
periodic-announce-frequency=60
strategy=fewestcalls
joinempty=strict
announce-round-seconds=10
retry=30
announce-holdtime=yes
announce-frequency=60
timeout=10
music=default
autofill=yes
ringinuse=no