Author Topic: Tranfer shows as untracked record in DNIS  (Read 2071 times)

stephen_v

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Tranfer shows as untracked record in DNIS
« on: April 03, 2017, 14:18:34 »
Hi

When I look at the "DNIS used" report for my inbound queues, I get a number of untracked calls.
I pinned it down to transferred calls, so I'm OK that it shows it there, but it appears to count each transfer twice, which isn't what I want.

Here is an example of a transferred call:
Code: [Select]
partition |time_id    |call_id            |queue |agent      |verb           |data1        |data2              |data3 |data4 |data5 |serverid |unique_row_count |
----------|-----------|-------------------|------|-----------|---------------|-------------|-------------------|------|------|------|---------|-----------------|
P001      |1491188488 |1491188476.3585488 |9202  |NONE       |DID            |611XXXXXXXX  |                   |      |      |      |         |1                |
P001      |1491188488 |1491188476.3585488 |9202  |NONE       |ENTERQUEUE     |             |614XXXXXXXX        |1     |      |      |         |3                |
P001      |1491188493 |1491188476.3585488 |9202  |Agent/3165 |CONNECT        |5            |1491188488.3585489 |4     |      |      |         |1                |
P001      |1491188549 |1491188476.3585488 |9202  |Agent/3161 |TRANSFER       |             |614XXXXXXXX        |      |      |      |         |1                |
P001      |1491188552 |1491188476.3585488 |9202  |Agent/3161 |CONNECT        |3            |                   |      |      |      |         |1                |
P001      |1491188869 |1491188476.3585488 |9202  |Agent/3165 |COMPLETECALLER |5            |376                |1     |      |      |         |1                |
P001      |1491188869 |1491188476.3585488 |9202  |Agent/3161 |COMPLETEAGENT  |3            |317                |      |      |      |         |3                |

I assume the "untracked" is counted by the actual "TRANSFER" action and the "COMPLETEAGENT" action from the agent who it was transferred from.

What is the correct way to do this so it is counted as one, instead of two?
I'm on version 15.10.6
« Last Edit: April 03, 2017, 14:22:21 by stephen_v »

stephen_v

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: Tranfer shows as untracked record in DNIS
« Reply #1 on: April 03, 2017, 14:25:20 »
Would it not make more sense to only look at the rows with the DID verb, in the "DNIS used" report?

mirkox

  • Full Member
  • ***
  • Posts: 231
  • Karma: 4
    • View Profile
Re: Tranfer shows as untracked record in DNIS
« Reply #2 on: April 05, 2017, 14:57:13 »
Hi stephen,

the problem is that the log appears incorrect; what's the version of Asterisk you are using?

stephen_v

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: Tranfer shows as untracked record in DNIS
« Reply #3 on: April 06, 2017, 14:00:23 »
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:

Code: [Select]
[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()