QueueMetrics > QueueMetrics installation
Track inbound direct call (outside of an inbound queue)
peterbokune:
Can you help me understand what you're doing in qm-queuedialer please?
I can trap the DIALSTATUS for the direct inbound calls in a context called: ext-local-custom
Given this I'm reconsidering moving to this code. Does it make sense?
--- Code: ---[from-pstn-custom]
; ... your existing dialplan; We use the last 4 digits of the DID as the user's extension (check for your install)
exten => _X.,n,Set(user=${EXTEN:-4:4})
; eg. user=1111
; Set InQ to be the queue you want to track for incoming queue
; comma separated -- quotes are essential!
exten => _X.,n,Set(InQueues="125,126")
exten => _X.,n,Set(IsInQueue=0)
exten => _X.,n,While(${EXISTS(${InQueues})})
exten => _X.,n,Set(InQ="${CUT(InQueues,\,,1)}")
exten => _X.,n,Set(InQueues="${CUT(InQueues,\,,2-)}")
exten => _X.,n,Set(QML="${QUEUE_MEMBER_LIST(${InQ})}")
exten => _X.,n,While(${EXISTS(${QML})}))
exten => _X.,n,Set(IsInQueue=${IF($[ ${CUT(CUT(QML,@,1),/,2)} = ${user}]?$[${IsInQueue}+1]:${IsInQueue})})
exten => _X.,n,GotoIf($[${IsInQueue}]?matched) ; track it, stop looking!
exten => _X.,n,Set(QML="${CUT(QML,\,,2-)}")
exten => _X.,n,EndWhile
exten => _X.,n,EndWhile
exten => _X.,n(matched),Set(QDIALER_NUMBER=${CALLERID(number)})
exten => _X.,n,Set(QDIALER_QUEUE=q-${InQ})
exten => _X.,n,Set(QDIALER_AGENT=Local/${user}@from-queue)
exten => _X.,n,Set(QDIALER_CHANNEL=SIP/${user})
exten => _X.,n,NoOp(Track Call? ${IsInQueue})
exten => _X.,n,GotoIf($[${IsInQueue}]?queue:noqueue)
exten => _X.,n(queue),NoOp( "Inbound call - A:${QDIALER_AGENT} N:${QDIALER_NUMBER} Q:${QDIALER_QUEUE} Ch:${QDIALER_CHANNEL}" )
exten => _X.,n,Set(CDR(accountcode)=QDIALAGI)
exten => _X.,n,Set(ST=${EPOCH})
exten => _X.,n,Set(GM=QDV-${QDIALER_AGENT})
exten => _X.,n,Set(GLOBAL(${GM})=U)
exten => _X.,n,Set(GLOBAL(${GM}ans)=0)
exten => _X.,n,Macro(queuelog,${ST},${UNIQUEID},${QDIALER_QUEUE},${QDIALER_AGENT},CALLOUTBOUND,,${QDIALER_NUMBER})
exten => _X.,n(noqueue),Goto(ext-did,${EXTEN},1)
[ext-local-custom]
; Trapping call termination here
exten => h,1,Set(CAUSECOMPLETE=${IF($["${DIALSTATUS}" = "ANSWER"]?C)})
exten => h,n,NoOp( "Call exiting: status ${GLOBAL(${GM})} answered at: ${GLOBAL(${GM}ans)} DS: ${DIALSTATUS}" )
exten => h,n,Goto(case-${GLOBAL(${GM})})
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)i,Set(COMPLETE=${IF($["${CAUSECOMPLETE}" = "C"]?COMPLETECALLER:COMPLETEAGENT)})
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()
; Call not tracked
exten => h,n(case-),NoOp(here)
exten => h,n,Hangup()
--- End code ---
The problem with this is that it doesn't get called when connected and terminated.
Maybe the "cook the CDR" approach is better...
QueueMetrics:
--- Quote from: peterbokune on August 09, 2010, 21:37:06 ---
I need to re-factor this. I never give inbound callers to the ability to get to voicemail.
Perhaps I'll make a new qm-queuedial context to pass the calls to which use the existing FreePBX framework for passing the calls.
--- End quote ---
If you have problems with INBOUND, you should use simple queues, as their logging is already correct. The script is used for outbound,.
peterbokune:
--- Quote from: QueueMetrics on August 11, 2010, 11:02:42 ---
--- Quote from: peterbokune on August 09, 2010, 21:37:06 ---
I need to re-factor this. I never give inbound callers to the ability to get to voicemail.
Perhaps I'll make a new qm-queuedial context to pass the calls to which use the existing FreePBX framework for passing the calls.
--- End quote ---
If you have problems with INBOUND, you should use simple queues, as their logging is already correct. The script is used for outbound,.
--- End quote ---
This would imply then one queue for every employee that would be tracked. In rough numbers, this would be about 50 more queues added. Yes, this is probably the best solution. It adds clutter to the FreePBX config but the QueueMetrics config isn't cosmetically different (it won't increase menus, etc). I'll go that way next.
QueueMetrics:
I think this is the best way, unless you want to do the loggiong manually like one does for outbound. If you do not need to do anything fancy with the line, like e.g dtecting DND, voicemail, follow me's etc, I think thi sis the easiset way to go.
Navigation
[0] Message Index
[*] Previous page
Go to full version