I've been browsing every help file and forum topic I can find but I can't figure out how to get Outbound call log working with our otherwise perfectly functioning system. I've got the extensions_queuemetrics.conf file with the following details:
[queuedial]
; this piece of dialplan is just a calling hook into the [qm-queuedial] context that actually does the
; outbound dialing - replace as needed - just fill in the same variables.
exten => _XXX.,1,Set(QDIALER_QUEUE=q-${EXTEN:0:3})
exten => _XXX.,n,Set(QDIALER_NUMBER=${EXTEN:3})
exten => _XXX.,n,Set(QDIALER_AGENT=Agent/${CALLERID(num)})
exten => _XXX.,n,Set(QDIALER_CHANNEL=SIP/${QDIALER_NUMBER})
exten => _XXX.,n,Set(QueueName=${QDIALER_QUEUE})
exten => _XXX.,n,MixMonitor(Q-${QDIALER_QUEUE}-${UNIQUEID}.WAV,b,)
exten => _XXX.,n,Goto(qm-queuedial,s,1)
[qm-queuedial]
; We use a global variable to pass values back from the answer-detect macro.
; STATUS = U unanswered
; = A answered (plus CAUSECOMPLETE=C when callee hung up)
; The 'g' dial parameter must be used in order to track callee disconnecting.
; Note that we'll be using the 'h' hook in any case to do the logging when channels go down.
; We set the CDR(accountcode) for live monitoring by QM.
;
exten => s,1,NoOp()
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,Macro(queuelog,${ST},${UNIQUEID},${QDIALER_QUEUE},${QDIALER_AGENT},CALLOUTBOUND,,${QDIALER_NUMBER})
exten => s,n,Dial(${QDIALER_CHANNEL},300,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})})
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()
[macro-queuedial-answer]
; Expecting $ARG1: uniqueid of the caller channel
; $ARG2: global variable to store the answer results
; $ARG3: queue name
; $ARG4: agent name
; $ARG5: enterqueue
;
exten => s,1,NoOp("Macro: queuedial-answer UID:${ARG1} GR:${ARG2} Q:${ARG3} A:${ARG4} E:${ARG5}")
exten => s,n,Set(NOW=${EPOCH})
exten => s,n,Set(WD=$[${NOW} - ${ARG5}])
exten => s,n,Macro(queuelog,${NOW},${ARG1},${ARG3},${ARG4},CONNECT,${WD})
exten => s,n,Set(GLOBAL(${ARG2})=A)
exten => s,n,Set(GLOBAL(${ARG2}ans)=${NOW})
exten => s,n,NoOp("Macro queuedial-answer terminating" )
[macro-queuelog]
; The advantage of using this macro is that you can choose whether to use the Shell version
; (where you have complete control of what gets written) or the Application version (where you
; do not need a shellout, so it's way faster).
;
; Expecting $ARG1: Timestamp
; $ARG2: Call-id
; $ARG3: Queue
; $ARG4: Agent
; $ARG5: Verb
; $ARG6: Param1
; $ARG7: Param2
; $ARG8: Param3
;
;exten => s,1,System( echo "${ARG1}|${ARG2}|${ARG3|${ARG4}|${ARG5}|${ARG6}|${ARG7}|${ARG8}" >> /var/log/asterisk/queue_log )
exten => s,1,QueueLog(${ARG3},${ARG2},${ARG4},${ARG5},${ARG6}|${ARG7}|${ARG8})
and I've it included in extensions_custom.conf
I made a queue in QM called "q-340" and I tried adding 340 when dialing out numbers but Asterisk doesn't want to complete the call, period:
-- Executing [3406365551234@from-internal:1] ResetCDR("SIP/118-05c00ae0", "") in new stack
-- Executing [3406365551234@from-internal:2] NoCDR("SIP/118-05c00ae0", "") in new stack
-- Executing [3406365551234@from-internal:3] Wait("SIP/118-05c00ae0", "1") in new stack
-- Executing [3406365551234@from-internal:4] Playback("SIP/118-05c00ae0", "silence/1&cannot-complete-as-dialed&check-number-dial-again|noanswer") in new stack
-- <SIP/118-05c00ae0> Playing 'silence/1' (language 'en')
-- <SIP/118-05c00ae0> Playing 'cannot-complete-as-dialed' (language 'en')
-- <SIP/118-05c00ae0> Playing 'check-number-dial-again' (language 'en')
-- Executing [3406365551234@from-internal:5] Wait("SIP/118-05c00ae0", "1") in new stack
-- Executing [3406365551234@from-internal:6] Congestion("SIP/118-05c00ae0", "20") in new stack
== Spawn extension (from-internal, 3406365551234, 6) exited non-zero on 'SIP/118-05c00ae0'
-- Executing [h@from-internal:1] Macro("SIP/118-05c00ae0", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("SIP/118-05c00ae0", "1?skiprg") in new stack
-- Goto (macro-hangupcall,s,4)
-- Executing [s@macro-hangupcall:4] GotoIf("SIP/118-05c00ae0", "1?skipblkvm") in new stack
-- Goto (macro-hangupcall,s,7)
-- Executing [s@macro-hangupcall:7] GotoIf("SIP/118-05c00ae0", "1?theend") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] Hangup("SIP/118-05c00ae0", "") in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'SIP/118-05c00ae0' in macro 'hangupcall'
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'SIP/118-05c00ae0'
Do I need to define 340 somewhere else? How do I know that it's even reading my _XXX? Not sure where to start troubleshooting.