QueueMetrics forum

QueueMetrics => Outbound and QueueMetrics => Topic started by: mirof on October 30, 2007, 23:22:40

Title: Problem in outbound queue
Post by: mirof on October 30, 2007, 23:22:40
Hi,
I've a problem in outbound queues Agent placing calls can'be identified.

In extensions_custom.conf I put:

; Queue out
[queuedial]
exten => _X.,1,SetVar(MY_QUE=${EXTEN:0:1})
exten => _X.,2,SetVar(MY_NUM=${EXTEN:1})
exten => _X.,3,Set(MY_AGENT=${AGENTBYCALLERID_${CALLERIDNUM})
exten => _X.,4,NoOp,Ag: ${MY_AGENT} N: ${MY_NUM} Q: ${MY_QUE}
exten => _X.,5,NoOp,MixMonitor(Q-${MY_QUE}-${UNIQUEID}.wav|b|)
exten => _X.,6,DeadAGI(queueDial.agi|${MY_NUM}|SIP/pri0/${MY_NUM}|q-${MY_QUE}|Agent/${MY_AGENT})
exten => _X.,7,Congestion

When Agents make calls using the right outbound route ${MY_AGENT} is always empty so in queue_log I can't identify who makes the call, I can only see Agent/ , and in real time monitor the same.

Anyone can help me?

My Setup:
Queuemetrics 1.4.2
on
Trixbox 2.2.4 (Asterisk 1.2.22)

  Thanks

   ---Fabio
Title: Re: Problem in outbound queue
Post by: QueueMetrics on October 31, 2007, 19:57:28
Not sure if it's a typo, but

Code: [Select]
Set(MY_AGENT=${AGENTBYCALLERID_${CALLERIDNUM})
Is lacking at least one }!
Title: Re: Problem in outbound queue
Post by: mirof on November 03, 2007, 08:14:00
Oh Gosh!
Youre right! it's' not a typo.

I fixed my mistake but it still won't work

I tried to change ${CALLERIDNUM} which is deprecated with other variables
such as ${CALLERID(num)} or ${AMPUSER} but I got no results.
Title: Re: Problem in outbound queue
Post by: QueueMetrics on November 04, 2007, 10:13:51
I would do the following:
- Start a call from one agent and leave it open
- Find the Asterisk channel name through the CLI

Code: [Select]
aleph*CLI> show channels
Channel              Location             State   Application(Data)
H323/ip$10.10.3.6:22 s@coda-dps:9         Up      Queue(queue-dps|t|http://www.p


- Show the details of the channel, like:

Code: [Select]
aleph*CLI> show channel H323/ip$10.10.3.6:2256/14
 -- General --
           Name: H323/ip$10.10.3.6:2256/14
           Type: H323
       UniqueID: 1194167463.819
      Caller ID: 21
 Caller ID Name: test
.....
 --   PBX   --
        Context: coda-dps
      Extension: s
       Priority: 9
.....

      Variables:
MACRO_DEPTH=0
SYSTEMSTATUS=SUCCESS
TRANSFER_CONTEXT=queuetransfer
CallRefNum=1194167463.819
QueueName=queue-dps
MONITOR_FILENAME=DPS-1194167463.819

So you can spot what is correct for you to read.

Title: Re: Problem in outbound queue
Post by: mirof on November 04, 2007, 18:08:20
Ok,
in my channels detail a can see my callerID number but my variable is always empty.  :-\

Perhaps i fount something interesting.
The trouble appears only if the agent logs in using queuemetrics web interface which uses the custom extension:

; extension 20: agent callback login
; For this to work, there must be no password on the agent.
exten => 20,1,Answer
exten => 20,2,NoOp( "QM: Logging on Agent/${AGENTCODE} to extension ${AGENT_EXT}@from-internal" )
exten => 20,3,AgentCallBackLogin(${AGENTCODE}||${AGENT_EXT})
exten => 20,4,Hangup

If i do the login procedure directly from the phone using trixbox interactive AgentCallBackLogin it works fine using:

; Agent Login
exten => 123,1,AgentCallBackLogin(|${CALLERID(number)}@from-internal)

I tracked back both login procedures and there is something interesting:

1st login proc:

Code: [Select]
    -- Executing Answer("Local/20@queuemetrics-7a7e,2", "") in new stack
    -- Executing NoOp("Local/20@queuemetrics-7a7e,2", " "QM: Logging on Agent/4026 to extension 219@from-internal" ") in new stack
    -- Executing AgentCallbackLogin("Local/20@queuemetrics-7a7e,2", "4026||219") in new stack
       > Channel Local/20@queuemetrics-7a7e,1 was answered.
    -- Executing Answer("Local/20@queuemetrics-7a7e,1", "") in new stack
    -- Executing Wait("Local/20@queuemetrics-7a7e,1", "10") in new stack
    -- Executing Answer("Local/20@queuemetrics-7a7e,2", "") in new stack
    -- Executing NoOp("Local/20@queuemetrics-7a7e,2", " "QM: Logging on Agent/4026 to extension 219@from-internal" ") in new stack
    -- Executing AgentCallbackLogin("Local/20@queuemetrics-7a7e,2", "4026||219") in new stack
       > Channel Local/20@queuemetrics-7a7e,1 was answered.
    -- Executing Answer("Local/20@queuemetrics-7a7e,1", "") in new stack
    -- Executing Wait("Local/20@queuemetrics-7a7e,1", "10") in new stack
    -- Playing 'agent-loginok' (language 'en')
    -- Playing 'agent-loginok' (language 'en')
  == Callback Agent '4026' logged in on 219
  == Callback Agent '4026' logged in on 219
    -- Executing Hangup("Local/20@queuemetrics-7a7e,2", "") in new stack

2nd login proc:

Code: [Select]
    -- Executing AgentCallbackLogin("SIP/219-09f06180", "|219@from-internal") in new stack
    -- Playing 'agent-user' (language 'it')
    -- Executing AgentCallbackLogin("SIP/219-09f06180", "|219@from-internal") in new stack
    -- Playing 'agent-user' (language 'it')
    -- Playing 'agent-newlocation' (language 'it')
    -- Playing 'agent-newlocation' (language 'it')
  == Setting global variable 'AGENTBYCALLERID_219' to '4026'
  == Setting global variable 'AGENTBYCALLERID_219' to '4026'
    -- Playing 'agent-loginok' (language 'it')
    -- Playing 'agent-loginok' (language 'it')
  == Callback Agent '4026' logged in on 219
  == Callback Agent '4026' logged in on 219
    -- Playing 'vm-goodbye' (language 'it')
    -- Playing 'vm-goodbye' (language 'it')
  == Spawn extension (from-internal, 123, 1) exited non-zero on 'SIP/219-09f06180'
    -- Executing Macro("SIP/219-09f06180", "hangupcall") in new stack
    -- Executing ResetCDR("SIP/219-09f06180", "w") in new stack
    -- Executing NoCDR("SIP/219-09f06180", "") in new stack
    -- Executing GotoIf("SIP/219-09f06180", "1?skiprg") in new stack
    -- Goto (macro-hangupcall,s,6)
    -- Executing GotoIf("SIP/219-09f06180", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,9)
    -- Executing Wait("SIP/219-09f06180", "5") in new stack
  == Spawn extension (from-internal, 123, 1) exited non-zero on 'SIP/219-09f06180'
    -- Executing Macro("SIP/219-09f06180", "hangupcall") in new stack

In the 2nd one we can see:
  == Setting global variable 'AGENTBYCALLERID_219' to '4026'
  == Setting global variable 'AGENTBYCALLERID_219' to '4026'

 ??? I think it could be the matter.

Now, how can i force the same behaviour even if i do the login procedure from web interface?

Thanks for help.


Title: Re: Problem in outbound queue
Post by: QueueMetrics on November 05, 2007, 14:45:07
I thoiught the variable would be set uatomatically buy AgentCallBackLigin in any case; if it's not the case, just set the AstDB variable yourself after the first AgentCallBackLogin.
Title: Re: Problem in outbound queue
Post by: Mailsouth on July 02, 2008, 22:59:14
Is there a fix? I have the same problem but I'm not sure how you fixed it, from reading this post.
Title: Re: Problem in outbound queue
Post by: QueueMetrics on July 03, 2008, 08:59:47
Try this:
when the channel is open, try a "show variables"
one of the channel variables will surely holr the agent id/extension.
use that.
Title: Re: Problem in outbound queue
Post by: Mailsouth on July 03, 2008, 21:41:08
okay I'm definately a noob to this how do I do this?
Title: Re: Problem in outbound queue
Post by: QueueMetrics on July 03, 2008, 22:25:28
While the conversation is ongoing (and incorrectly logged...) run a show channel command on the Asterisk CLI for the leg of the call that goes from the agent to Asterisk.
Title: Re: Problem in outbound queue
Post by: Mailsouth on July 06, 2008, 18:49:19
Okay, I got that part but it still doesn't seem like its importing any information. 

So this is what I have in my dial plan

[queuedial]
exten => _.,1,Set(MY_QUEUE=OUT)
exten => _.,2,Set(MY_NUM=${EXTEN})
exten => _.,3,Set(MY_AGENT=${AMPUSER})
exten => _.,4,NoOp,Ag: ${MY_AGENT} N: ${MY_NUM} Q: ${MY_QUE}
exten => _.,5,MixMonitor(Q-${MY_QUE}-${UNIQUEID}.wav|b|)
exten => _.,6,DeadAGI(queueDial.agi|${MY_NUM}|Zap/G2/${MY_NUM}|q-${MY_QUE}|Agent/${MY_AGENT})
exten => _.,7,Congestion

and this is what I get in my queue_log after I make a call to 3290592 from ext 6213

1215362500|1215362500.19745|q-|NONE|ENTERQUEUE|-|3290592
1215362500|1215362500.19745|q-|Agent/|CONNECT|0|
1215362514|1215362500.19745|q-|Agent/|CONNECT|14|
1215362518|1215362500.19745|q-|Agent/|COMPLETEAGENT|14|4
1215362518|1215362500.19745|q-|NONE|ENTERQUEUE|-|h
1215362518|1215362500.19745|q-|Agent/|CONNECT|0|
1215362514|1215362500.19745|q-|Agent/|CONNECT|-4|
1215362518|1215362500.19745|q-|Agent/|COMPLETEAGENT|-4|4


Title: Re: Problem in outbound queue
Post by: QueueMetrics on July 22, 2008, 09:27:20
Whis verion of sterisk are tyou using? I would expect to see at least the OUT queue, that is fixed....
Title: Re: Problem in outbound queue
Post by: Mailsouth on August 08, 2008, 23:39:17
sorry it took so long to get back to this.  We have version 1.4.19
Title: Re: Problem in outbound queue
Post by: QueueMetrics on August 09, 2008, 16:34:46
Which messsages do you find on the Asterisk CLI?
Title: Re: Problem in outbound queue
Post by: Mailsouth on August 09, 2008, 16:57:35
I'm not sure I know what you mean.
Title: Re: Problem in outbound queue
Post by: QueueMetrics on August 10, 2008, 16:25:57
When you're running an outbound call, if you set verbose 99 on the Asterisk CLI, what messages do you see?
Title: Re: Problem in outbound queue
Post by: emel_punk on March 02, 2009, 17:59:04
i used this and it work !! but on asterisk 1.4

,set(anagent=${AGENTBYCALLERID_${CALLERID(NUMBER)}})



i have another client with asterisk 1.2 and its always empty so... may be problems with asterisk 1.2.
Title: Re: Problem in outbound queue
Post by: QueueMetrics on March 03, 2009, 15:32:18
I think that Set and Setvar should be used based on the *n version.
Title: Re: Problem in outbound queue
Post by: emel_punk on March 03, 2009, 18:59:34
SORRY THIS IS WHAT I USED OND asterisk 1.2.5

exten => 3139000,1,answer
exten => 3139000,n,setvar(agenteis=${AGENTBYCALLERID_${CALLERID(NUMBER)}})
exten => 3139000,n,noop(------------------>${agenteis})
exten => 3139000,n,gotoif($["${agenteis}"!="")]?marcarag)
exten => 3139000,n,musiconhold()
exten => 3139000,n(marcarag),DEADAGI(queueDial.agi|${EXTEN}|zap/g0/${EXTEN}|outbound|Agent/${agenteis})
exten => 3139000,n,hangup


but its always empty....

why???
Title: Re: Problem in outbound queue
Post by: QueueMetrics on March 04, 2009, 09:44:14
1. make sure the system is idle (e.g at night)
2. connect to the Asterisk cli via "asterisk -vvvvvvvvvr"
3. run the QM transaction
4. copy the printout of what happended in Asterisk

Title: Re: Problem in outbound queue
Post by: emel_punk on March 04, 2009, 14:45:55
HERE IS IT........
[root@pbxprime asterisk]# asterisk -vvvvvvvvvr
  == Parsing '/etc/asterisk/asterisk.conf': Found
  == Parsing '/etc/asterisk/extconfig.conf': Found
Asterisk 1.2.15, Copyright (C) 1999 - 2006 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.15 currently running on pbxprime (pid = 3826)
Verbosity is at least 9
    -- Accepting AUTHENTICATED call from XX.XX:XX:XX:
       > requested format = unknown,
       > requested prefs = (),
       > actual format = ulaw,
       > host prefs = (ilbc|ulaw|alaw|gsm),
       > priority = mine
    -- Executing Answer("IAX2/10000-3", "") in new stack
    -- Executing SetVar("IAX2/10000-3", "agenteis=") in new stack
    -- Executing NoOp("IAX2/10000-3", "------------------>") in new stack
    -- Executing GotoIf("IAX2/10000-3", "0?marcarag") in new stack
    -- Executing MusicOnHold("IAX2/10000-3", "") in new stack
    -- Started music on hold, class 'default', on IAX2/10000-3
pbxprime*CLI>
[root@pbxprime asterisk]#
Title: Re: Problem in outbound queue
Post by: QueueMetrics on March 04, 2009, 16:48:22
I would try the following tests:

Code: [Select]
...
exten => 3139000,n,setvar(clid=${CALLERID(NUMBER)})
exten => 3139000,n,setvar(agenteis=${AGENTBYCALLERID_${clid}})
exten => 3139000,n,noop(clid: ${clid} agent: ${agenteis})
...

also please run a SHOW AGENTS before running the command.

A lot of thing have been chenged in 1.2 to 1.4 in the dialplan vars etc....


Title: Re: Problem in outbound queue
Post by: emel_punk on March 09, 2009, 18:07:28
you were almost right !!! i ahve problems with asterisk but with iax extensions...  sip works perefectlly !!


THANSK AGAIN !!
Title: Re: Problem in outbound queue
Post by: QueueMetrics on March 10, 2009, 16:01:28
 ;D
Title: Re: Problem in outbound queue
Post by: arturohg on June 14, 2009, 21:42:40
I seem to have a similar problem. 

When I tried the suggested 3139000 code I got this:

Code: [Select]
       -- Executing Answer("SIP/156-08314098", "") in new stack
    -- Executing Set("SIP/156-08314098", "clid=156") in new stack
    -- Executing Set("SIP/156-08314098", "agenteis=") in new stack
    -- Executing NoOp("SIP/156-08314098", "clid: 156 agent: ") in new stack

So the AGENTBYCALLERID variable is empty

And show agents:
Quote
loca*CLI> show agents
150          (Gustavo) not logged in (musiconhold is 'default')
151          (Meysie) not logged in (musiconhold is 'default')
156          (Pedro) available at '156@druid-user-telemarketing' (musiconhold is 'default')
3 agents configured [1 online , 2 offline]

I have the same problem that mirof said on November 04, 2007, 18:08:20
When I use an empty AgentCallBackLogin with the phone I get this message:
Quote
Setting global variable 'AGENTBYCALLERID_156' to '156'

but when I use the QM login app it does not show this message

Thanks
Title: Re: Problem in outbound queue
Post by: arturohg on June 15, 2009, 03:13:47
I think i fixed the problem.
I hardcoded the variable to the context. 

Quote
exten => 20,1,Answer
exten => 20,2,NoOp( "QM: Logging on Agent/${AGENTCODE} to extension ${AGENT_EXT}@druid-user-telemarketing made by '${QM_LOGIN}'" )
exten => 20,3,AgentCallBackLogin(${AGENTCODE}||${AGENT_EXT}@druid-user-telemarketing)
exten => 20,4,Set(AGENTBYCALLERID_${AGENTCODE}=${AGENT_EXT},g)
exten => 20,5,System( echo "${EPOCH}|${UNIQUEID}|NONE|Agent/${AGENTCODE}|AGENTCALLBACKLOGIN|${AGENT_EXT}@druid-user-telemarketing" >> /var/log/asterisk/queue_log )
exten => 20,6,Hangup

but I also had to clear the variable with the logoff

Quote
exten => 21,1,Answer
exten => 21,2,NoOp( "QM: Logging off Agent/${AGENTCODE} made by '${QM_LOGIN}' with ${AGENT_EXT}" )
exten => 21,3,System(asterisk -rx "agent logoff Agent/${AGENTCODE}")
exten => 21,4,Set(AGENTBYCALLERID_${AGENTCODE}=,g)
exten => 21,5,System( echo "${EPOCH}|${UNIQUEID}|NONE|Agent/${AGENTCODE}|AGENTCALLBACKLOGOFF|${AGENT_EXT}@druid-user-telemarketing|${LOGONTIME}|CommandLogoff" >> /var/log/asterisk/queue_log )
exten => 21,6,Hangup

I hope this helps
Title: Re: Problem in outbound queue
Post by: QueueMetrics on June 15, 2009, 11:31:50
 ;D