Hi mirkox
I'm using Asterisk 13.7.2
I modified the dialplan a fair bit to have transfers behave properly, so it is likely something I did that is logging more than it should.
Here is my dialplan for transfers:
[from-qm-xfer]
exten => _X.,1,Verbose(1,QueueMetrics Transfer)
exten => _X.,n,Set(QDIALER_XFER=Yes)
exten => _X.,n,Set(QDIALER_NUMBER=${EXTEN})
exten => _X.,n,Set(QDIALER_QUEUE=${QUEUENUM})
;; check to see if destination extension is logged into QM, if not, revert back to agent
exten => _X.,n,Gotoif(${DB_EXISTS(QM/Exten/${EXTEN})}?valid:invalid)
exten => _X.,n(invalid),Set(QDIALER_AGENT=Agent/${DB(QM/Exten/${CONNECTEDLINE(num)})})
exten => _X.,n,Set(QDIALER_CHANNEL=${CONNECTEDLINE(num)})
exten => _X.,n,Set(QDIALER_NUMBER=${DB(DEVICE/${CONNECTEDLINE(num)}/dial)})
exten => _X.,n,Goto(doxfer)
exten => _X.,n(valid),Set(QDIALER_AGENT=Agent/${DB(QM/Exten/${EXTEN})})
exten => _X.,n,Set(QDIALER_CHANNEL=SIP/${EXTEN})
exten => _X.,n(doxfer),Goto(qm-xferdial,s,1)
exten => h,1,Hangup()
;; this is basically the same as qm-queuedial
[qm-xferdial]
exten => s,1,NoOp( "Transferred call - A:${QDIALER_AGENT} N:${QDIALER_NUMBER} Q:${QDIALER_QUEUE} Ch:${QDIALER_CHANNEL}" )
exten => s,n,Set(CDR(accountcode)=QDIALAGI)
exten => s,n,Set(ST=${EPOCH})
exten => s,n,Set(GM=QDV-${QDIALER_AGENT})
exten => s,n,Set(GLOBAL(${GM})=U)
exten => s,n,Set(GLOBAL(${GM}ans)=0)
exten => s,n,GotoIf($[${QDIALER_NUMBER:0:1} = 3]?gotoagent)
exten => s,n,Set(QDIALER_CHANNEL=SIP/${QDIALER_NUMBER})
exten => s,n,Goto(gomacro)
exten => s,n(gotoagent),Set(QDIALER_CHANNEL=Local/${QDIALER_NUMBER}@agentmap/n)
exten => s,n(gomacro),Macro(queuelog,${ST},${UNIQUEID},${QDIALER_QUEUE},${QDIALER_AGENT},TRANSFER,,${CALLERID(num)})
exten => s,n,Dial(${QDIALER_CHANNEL},400,gM(queuedial-answer^${UNIQUEID}^${GM}^${QDIALER_QUEUE}^${QDIALER_AGENT}^${ST}))
exten => s,n,Set(CAUSECOMPLETE=${IF($["${DIALSTATUS}" = "ANSWER"]?C)})
; Trapping call termination here
exten => h,1,NoOp( "Call exiting: status ${GLOBAL(${GM})} answered at: ${GLOBAL(${GM}ans)} DS: ${DIALSTATUS}" )
exten => h,n,Goto(case-${GLOBAL(${GM})}) ;; disabling this to see if transfers are logged better
exten => h,n,Hangup()
; Call unanswered
exten => h,n(case-U),Set(WT=$[${EPOCH} - ${ST}])
exten => h,n,Macro(queuelog,${EPOCH},${UNIQUEID},${QDIALER_QUEUE},${QDIALER_AGENT},ABANDON,1,1,${WT})
exten => h,n,Hangup()
; call answered: agent/callee hung
exten => h,n(case-A),Set(COMPLETE=${IF($["${CAUSECOMPLETE}" = "C"]?COMPLETEAGENT:COMPLETECALLER)})
exten => h,n,Set(WT=$[${GLOBAL(${GM}ans)} - ${ST}])
exten => h,n,Set(CT=$[${EPOCH} - ${GLOBAL(${GM}ans)}])
exten => h,n,Macro(queuelog,${EPOCH},${UNIQUEID},${QDIALER_QUEUE},${QDIALER_AGENT},${COMPLETE},${WT},${CT})
exten => h,n,Hangup()