Author Topic: Queuemetrics 1.5.1 outbound by Agent problems  (Read 4564 times)

peterk

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Queuemetrics 1.5.1 outbound by Agent problems
« on: March 06, 2009, 17:49:20 »
LS,

I'm using Queuemetris 1.5.1 with Asterisk 1.2.26.1 svn rev 79171 (trixbox)

I have changed the extension_queuemetric.conf (have to relay everything to a other asterisk by sip who functions as a gateway.

When we make a call from the agent page with the button "call" we can see (logging asterisk) that the call will be made, but when the call is made it will not be connected to the agent and the call is disconnected. (the person who anser the phone get 2 beeps)

I realy hope the someone can help me with this problem.


----
asterisk console logging from call made by agent 2675, outbound queue 123, to number 00620628909
----
 
  == Parsing '/etc/asterisk/asterisk.conf': Found
  == Parsing '/etc/asterisk/extconfig.conf': Found
Asterisk 1.2.26.1 svn rev 79171, Copyright (C) 1999 - 2007 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'show license' for details.
=========================================================================
Connected to Asterisk 1.2.26.1 svn rev 79171 currently running on enovpbx2 (pid = 13347)
X connection>
Verbosity is at least 3
  == Parsing '/etc/asterisk/manager.conf': Found
  == Parsing '/etc/asterisk/manager_custom.conf': Found
  == Manager 'admin' logged on from 127.0.0.1
    -- Executing Answer("Local/28@queuemetrics-c2ba,2", "") in new stack
    -- Executing NoOp("Local/28@queuemetrics-c2ba,2", " "QM: Agent Custom Dial. Dialing S{EXTTODIAL}  on queue q-123 made by Agent/2675" ") in new stack
    -- Executing Set("Local/28@queuemetrics-c2ba,2", "QDIALER_QUEUE=q-123") in new stack
    -- Executing Set("Local/28@queuemetrics-c2ba,2", "QDIALER_NUMBER=00620628909") in new stack
    -- Executing Set("Local/28@queuemetrics-c2ba,2", "QDIALER_AGENT=Agent/2675") in new stack
    -- Executing Set("Local/28@queuemetrics-c2ba,2", "QDIALER_CHANNEL=SIP/pgwpbx/00620628909") in new stack
    -- Executing Set("Local/28@queuemetrics-c2ba,2", "QueueName=q-123") in new stack
    -- Executing MixMonitor("Local/28@queuemetrics-c2ba,2", "Q-q-123-1236357893.2561.WAV|b|") in new stack
    -- Executing Goto("Local/28@queuemetrics-c2ba,2", "qm-queuedial|s|1") in new stack
    -- Goto (qm-queuedial,s,1)
    -- Executing NoOp("Local/28@queuemetrics-c2ba,2", "Outbound call -> A:Agent/2675 N:00620628909 Q:q-123 Ch:SIP/pgwpbx/00620628909") in new stack
    -- Executing Set("Local/28@queuemetrics-c2ba,2", "CDR(accountcode)=QDIALAGI") in new stack
    -- Executing Set("Local/28@queuemetrics-c2ba,2", "ST=1236357893") in new stack
    -- Executing Set("Local/28@queuemetrics-c2ba,2", "GM=QDV-Agent/2675") in new stack
    -- Executing Set("Local/28@queuemetrics-c2ba,2", "GLOBAL(QDV-Agent/2675)=U") in new stack
    -- Executing Set("Local/28@queuemetrics-c2ba,2", "GLOBAL(QDV-Agent/2675ans)=0") in new stack
    -- Executing Macro("Local/28@queuemetrics-c2ba,2", "queuelog|1236357893|1236357893.2561|q-123|Agent/2675|CALLOUTBOUND|-|00620628909") in new stack
    -- Executing System("Local/28@queuemetrics-c2ba,2", " echo "1236357893|1236357893.2561|") in new stack
  == Begin MixMonitor Recording Local/28@queuemetrics-c2ba,2
    -- Executing Answer("Local/28@queuemetrics-c2ba,1", "") in new stack
    -- Executing Wait("Local/28@queuemetrics-c2ba,1", "10") in new stack
    -- Executing Dial("Local/28@queuemetrics-c2ba,2", "SIP/pgwpbx/00620628909|30|gM(queuedial-answer^1236357893.2561^QDV-Agent/2675^q-123^Agent/2675^1236357893)") in new stack
    -- Called pgwpbx/00620628909
    -- SIP/pgwpbx-09ae21f0 is ringing
  == Manager 'admin' logged off from 127.0.0.1
    -- SIP/pgwpbx-09ae21f0 answered Local/28@queuemetrics-c2ba,2
    -- Executing NoOp("SIP/pgwpbx-09ae21f0", ""Macro: queuedial-answer UID:1236357893.2561 GR:QDV-Agent/2675 Q:q-123 A:Agent/2675 E:1236357893"") in new stack
    -- Executing Set("SIP/pgwpbx-09ae21f0", "NOW=1236357901") in new stack
    -- Executing Set("SIP/pgwpbx-09ae21f0", "WD=8") in new stack
    -- Executing Macro("SIP/pgwpbx-09ae21f0", "queuelog|1236357901|1236357893.2561|q-123|Agent/2675|CONNECT|8") in new stack
    -- Executing System("SIP/pgwpbx-09ae21f0", " echo "1236357901|1236357893.2561|") in new stack
    -- Executing Set("SIP/pgwpbx-09ae21f0", "GLOBAL(QDV-Agent/2675)=A") in new stack
    -- Executing Set("SIP/pgwpbx-09ae21f0", "GLOBAL(QDV-Agent/2675ans)=1236357901") in new stack
    -- Executing NoOp("SIP/pgwpbx-09ae21f0", ""Macro queuedial-answer terminating" ") in new stack
    -- Executing Hangup("Local/28@queuemetrics-c2ba,1", "") in new stack
  == Spawn extension (queuemetrics, 10, 3) exited non-zero on 'Local/28@queuemetrics-c2ba,1'
  == Spawn extension (qm-queuedial, s, 8) exited non-zero on 'Local/28@queuemetrics-c2ba,2'
    -- Executing NoOp("Local/28@queuemetrics-c2ba,2", " "Call exiting: status 0 answered at: 0 DS: ANSWER"  ") in new stack
    -- Executing Goto("Local/28@queuemetrics-c2ba,2", "case-0") in new stack
  == Spawn extension (qm-queuedial, h, 2) exited non-zero on 'Local/28@queuemetrics-c2ba,2'
  == End MixMonitor Recording Local/28@queuemetrics-c2ba,2
enovpbx2*CLI>



----
exensions_queuemetrics.conf
------
exten => 22,1,Answer
exten => 22,2,NoOp( "QM: Pausing Agent/${AGENTCODE} with pause reason '${PAUSEREASON}' made by '${QM_LOGIN}' " )
exten => 22,3,PauseQueueMember(|Agent/${AGENTCODE})
exten => 22,4,System( echo "${EPOCH}|${UNIQUEID}|NONE|Agent/${AGENTCODE}|PAUSEREASON|${PAUSEREASON}" >> /var/log/asterisk/queue_log )
exten => 22,5,Hangup

; extension 23: agent unpause
exten => 23,1,Answer
exten => 23,2,NoOp( "QM: Unpausing Agent/${AGENTCODE} made by '${QM_LOGIN}' " )
exten => 23,3,UnpauseQueueMember(|Agent/${AGENTCODE})
exten => 23,4,Hangup

; extension 24: agent addqueuemember (for asterisk v1.2)
exten => 24,1,Answer
exten => 24,2,NoOp( "QM: AddQueueMember (asterisk v1.2) Agent/${AGENTCODE} on queue ${QUEUENAME} made by '${QM_LOGIN}'" )
exten => 24,3,System( echo "${EPOCH}|${UNIQUEID}|${QUEUENAME}|Local/${AGENTCODE}@from-internal|ADDMEMBER|" >> /var/log/asterisk/queue_log )
exten => 24,4,Hangup

; extension 25: agent addqueuemember (for asterisk v1.4+)
exten => 25,1,Answer
exten => 25,2,NoOp( "QM: AddQueueMember (asterisk v1.4+) Agent/${AGENTCODE} on queue ${QUEUENAME} made by '${QM_LOGIN}'" )
exten => 25,3,AddQueueMember(${QUEUENAME}|Local/${AGENTCODE}@from-internal)
exten => 25,4,Hangup

; extension 26: agent removequeuemember
exten => 26,1,Answer
exten => 26,2,NoOp( "QM: RemoveQueueMember (asterisk v1.2) Agent/${AGENTCODE} on queue ${QUEUENAME} made by '${QM_LOGIN}'" )
exten => 26,3,System( echo "${EPOCH}|${UNIQUEID}|${QUEUENAME}|Local/${AGENTCODE}@from-internal|REMOVEMEMBER|" >> /var/log/asterisk/queue_log )
exten => 26,4,Hangup

; extension 27: agent removequeuemember (for asterisk v1.4+)
exten => 27,1,Answer
exten => 27,2,NoOp( "QM: RemoveQueueMember (asterisk v1.4+) Agent/${AGENTCODE} on queue ${QUEUENAME} made by '${QM_LOGIN}'" )
exten => 27,3,RemoveQueueMember(${QUEUENAME}|Local/${AGENTCODE}@from-internal)
exten => 27,4,Hangup

; extension 28: agent custom dial
exten => 28,1,Answer
exten => 28,2,NoOp( "QM: Agent Custom Dial. Dialing S{EXTTODIAL} \ on queue ${OUTQUEUE} made by '${QM_LOGIN}'" )
exten => 28,3,Set(QDIALER_QUEUE=${OUTQUEUE})
exten => 28,4,Set(QDIALER_NUMBER=${EXTTODIAL})
exten => 28,5,Set(QDIALER_AGENT=Agent/${AGENTCODE})
exten => 28,6,Set(QDIALER_CHANNEL=SIP/pgwpbx/${QDIALER_NUMBER})
exten => 28,7,Set(QueueName=${QDIALER_QUEUE})
exten => 28,8,MixMonitor(Q-${QDIALER_QUEUE}-${UNIQUEID}.WAV|b|)
exten => 28,9,Goto(qm-queuedial,s,1)
exten => 28,10,Hangup


; extension 422xxx: add member

exten => _422XXX,1,Answer
exten => _422XXX,2,AddQueueMember(my-queue,Agent/${EXTEN:2})
exten => _422XXX,3,System( echo "${EPOCH}|${UNIQUEID}|NONE|Agent/${EXTEN:2}|AGENTLOGIN|-" >> /var/log/asterisk/queue_log )
exten => _422XXX,4,DBput(dynlogin/log_Agent-${EXTEN:2}=${EPOCH})
exten => _422XXX,5,Hangup

; Remove Member - 432xxx

exten => _432XXX,1,Answer
exten => _432XXX,2,RemoveQueueMember(my-queue,Agent/${EXTEN:2})
exten => _432XXX,3,DBget(ORGEPOCH=dynlogin/log_Agent-${EXTEN:2})
exten => _432XXX,4,Set(RV=$[${EPOCH} - ${ORGEPOCH}])
exten => _432XXX,5,GotoIf($["${RV}" = "0"]?8:6)
exten => _432XXX,6,System( echo  "${EPOCH}|${UNIQUEID}|NONE|Agent/${EXTEN:2}|AGENTLOGOFF|-|${RV}" >> /var/log/asterisk/queue_log )
exten => _432XXX,7,DBdel(dynlogin/log_Agent-${EXTEN:2})
exten => _432XXX,8,Hangup

;
; ================================================================
; The following dialplan is used in order to make oubound calls
; that are tracked through QueueMetrics.
; See http://forum.queuemetrics.com/index.php?board=12.0
; ================================================================


[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)


[queuedial-loggedon]
; This piece of dialplan will let only logged on agents dial out
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/${AGENTBYCALLERID_${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,GotoIf($[${LEN(${QDIALER_AGENT})} > 6]?qm-queuedial,s,1)
exten => _XXX.,n,NoOp,Extension ${CALLERID(num)} is not logged on as agent.
exten => _XXX.,n,Playback(agent-loggedoff)
exten => _XXX.,n,Congestion


[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,Outbound 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,Macro(queuelog,${ST},${UNIQUEID},${QDIALER_QUEUE},${QDIALER_AGENT},CALLOUTBOUND,-,${QDIALER_NUMBER})
exten => s,n,Dial(${QDIALER_CHANNEL},30,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})



; --------------------------------------------------------------------
; $Log: extensions_queuemetrics.conf,v $
; Revision 1.7  2009/02/16 10:37:47  marcos
; #619: Add AddQueueMember and RemoveQueueMember triggering buttons on agent's live page.
;
; Revision 1.6  2009/02/10 18:17:26  lenz
; Bug #498: CALLOUTBOUND
;
; Revision 1.5  2009/01/12 12:05:47  marcos
; #600 Added QM_LOGIN on all asterisk dialplan calls
;
; Revision 1.4  2008/06/10 16:53:50  lenz
; Aggiunto[queuedial-loggedon] per tutorial outbound 2.0
;
; Revision 1.3  2008/06/07 11:16:58  lenz
; Pure-scripting outbound solution.
;
; Revision 1.2  2007/07/30 15:43:55  lenz
; Bug #173: default compatibili con TrixBox.
;
; Revision 1.1  2007/06/18 13:30:24  lenz
; Prima versione.
;
;
;

------

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Queuemetrics 1.5.1 outbound by Agent problems
« Reply #1 on: March 06, 2009, 19:17:34 »
We realize there is a bug with the version of extensions_queuemetrics.conf that ships with QM 1.5.1; you have to add this part:


Quote
; extension 28: agent custom dial
exten => 28,1,Answer
exten => 28,2,NoOp( "QM: Agent Custom Dial. Dialing ${EXTTODIAL} on queue ${OUTQUEUE}  made by '${QM_LOGIN}'" )
exten => 28,3,Set(QDIALER_QUEUE=${OUTQUEUE})
exten => 28,4,Set(QDIALER_NUMBER=${EXTTODIAL})
exten => 28,5,Set(QDIALER_AGENT=Agent/${AGENTCODE})
exten => 28,6,Set(QDIALER_CHANNEL=SIP/${QDIALER_NUMBER})
exten => 28,7,Set(QueueName=${QDIALER_QUEUE})
exten => 28,8,MixMonitor(Q-${QDIALER_QUEUE}-${UNIQUEID}.WAV|b|)
exten => 28,9,Goto(qm-queuedial,s,1)
exten => 28,10,Hangup

Of course, set QDIALER_CHANNEL so that it makes sense with your system.
We are preparing a new tutorial for Trixbox that will use only dynamic agents and we will release it in a few days.


peterk

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: Queuemetrics 1.5.1 outbound by Agent problems
« Reply #2 on: March 10, 2009, 13:06:10 »
I replaced the text with the new text as advice (I don't see any difference)

The problem is not resolved; I still have the same problem.

I will wait until the new tutorial is released, but I hope that it will solve my problem.
If you have any idee how to solve this I would appreciate it 


----
; extension 28: agent custom dial
exten => 28,1,Answer
exten => 28,2,NoOp( "QM: Agent Custom Dial. Dialing S{EXTTODIAL} \ on queue ${OUTQUEUE} made by '${QM_LOGIN}'" )
exten => 28,3,Set(QDIALER_QUEUE=${OUTQUEUE})
exten => 28,4,Set(QDIALER_NUMBER=${EXTTODIAL})
exten => 28,5,Set(QDIALER_AGENT=Agent/${AGENTCODE})
exten => 28,6,Set(QDIALER_CHANNEL=SIP/pgwpbx/${QDIALER_NUMBER})
exten => 28,7,Set(QueueName=${QDIALER_QUEUE})
exten => 28,8,MixMonitor(Q-${QDIALER_QUEUE}-${UNIQUEID}.WAV|b|)
exten => 28,9,Goto(qm-queuedial,s,1)
exten => 28,10,Hangup
----

with
-----
; extension 28: agent custom dial
exten => 28,1,Answer
exten => 28,2,NoOp( "QM: Agent Custom Dial. Dialing ${EXTTODIAL} on queue ${OUTQUEUE}  made by '${QM_LOGIN}'" )
exten => 28,3,Set(QDIALER_QUEUE=${OUTQUEUE})
exten => 28,4,Set(QDIALER_NUMBER=${EXTTODIAL})
exten => 28,5,Set(QDIALER_AGENT=Agent/${AGENTCODE})
exten => 28,6,Set(QDIALER_CHANNEL=SIP/${QDIALER_NUMBER})
exten => 28,7,Set(QueueName=${QDIALER_QUEUE})
exten => 28,8,MixMonitor(Q-${QDIALER_QUEUE}-${UNIQUEID}.WAV|b|)
exten => 28,9,Goto(qm-queuedial,s,1)
exten => 28,10,Hangup
---


QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Queuemetrics 1.5.1 outbound by Agent problems
« Reply #3 on: March 10, 2009, 16:03:46 »
What do you see on the Asterisk CLI?

I think that you'll have to use queueDial.agi for Asterisk 1.2; the dialplan is for version 1.4+

See  http://queuemetrics.com/faq.jsp#faq-013-queueDial
 
If it does not work, try this: http://queuemetrics.com/faq.jsp#faq-014-agi

Please let us know how it goes.