QueueMetrics forum
QueueMetrics => Outbound and QueueMetrics => Topic started by: AngeloA on April 25, 2007, 10:49:35
-
Hi
Have installed Queuemetrics, great product, and have inbound queues working properly. I have also setup dial-out queues and everything works properly, except that if the remote caller hangs up first then queuemetrics does not see the remote hang up and the call is displayed as being on-going and the time just keeps on increasing. After the remote phone is hung up, the local phone will then attempt to remake the call.
Could anyone please help me solve this. I have included a snip from my extensions.conf below.
Thanks
Angelo
exten => s,n,Set(NUM=${OUTNUM})
exten => s,n,Set(DIALSTRING=${OUT_${DIAL_TRUNK}})
exten => s,n,Set(QUEUENAME=${CALLERID(number)})
exten => s,n,Set(AGENT=${CALLERID(name)})
exten => s,n,AGI(queueDial.agi|${NUM}|${DIALSTRING}/${NUM}|${QUEUENAME}|${AGENT})
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s,n(chanfull),Noop(max channels used up)
exten => s-BUSY,1,NoOp(Dial failed due to trunk reporting BUSY - giving up)
exten => s-BUSY,2,Busy(20)
exten => s-NOANSWER,1,NoOp(Dial failed due to trunk reporting NOANSWER - giving up)
exten => s-NOANSWER,2,Playtones(congestion)
exten => s-NOANSWER,3,Congestion(20)
exten => s-CANCEL,1,NoOp(Dial failed due to trunk reporting CANCEL - giving up)
exten => s-CANCEL,2,Playtones(congestion)
exten => s-CANCEL,3,Congestion(20)
exten => _s-.,1,NoOp(Dial failed due to ${DIALSTATUS} - failing through to other trunks)
exten => h,1,Macro(hangupcall)
-
This is strange: queueDial.agi is being used on hundreds of sites.... Can you be a bit more precise about which kind of channels you are using for dial out? and what happens in the dialplan on your error condition: does the queueuDial.agi terminate and pass control to other parts of the dialplan?
-
Hi
I'm using zap channels to dial out on. I have two pri cards in my box and one is used for outgoing calls and the other is used for incoming (published number) calls. I have set it up so that if all my outgoing lines are in use then zap will start using the pri reserved for incoming calls. Now, when the remote side hangs up, I get the error condition and the phone falls over to the other pri and attempts to make another call. If, however, the agent hangs up first or I get a BUSY, NOANSWER or CANCEL, then queueDial.agi terminates properly and passes control over to the rest of my dialplan.
Thanks
Angelo
-
How do you set up the outgoing channel to handle the fail-over?
-
Hi
I did not include all of the extensions.conf, but after the line
exten => s,n,Goto(s-${DIALSTATUS},1)
it continues and does the fail-over to the other pri. So when I hit the error condition it continues on to the rest of the dialplan.
What response should I be looking for if the remote hangs up first? I could include this response in the queueDial.agi and make it terminate properly.
-
I am still wondering what happens - can you please try this:
- remove the file /var/log/asterisk/agi-log.txt
- try placing exactly one call through queueDial and have the remote hangup
After this, have a look at the /var/log/asterisk/agi-log.txt file and posty the results you see.
What I think tentatively is this: the call goes through, but as the DIALSTATUS is filled, the call is repeated. Bt I cannot say much without having a look at the log....
-
Hi
Below is the output from the agi-log.txt, where the remote caller hangup first.
*QueueDial ---- 3461- ZAP/g2/3461----Wed May 2 11:30:50 2007
*Dial Num: '3461' Chan: 'ZAP/g2/3461' on Queue: '2220' Agent: 'Angelo'
*SetVar: 'QDIALER_NUMBER' = '3461' - 200 result=1
*SetVar: 'QDIALER_CHANNEL' = 'ZAP/g2/3461' - 200 result=1
*SetVar: 'QDIALER_QUEUE' = '2220' - 200 result=1
*SetVar: 'QueueName' = '2220' - 200 result=1
*SetVar: 'QDIALER_AGENT' = 'Angelo' - 200 result=1
As you can see it does not log anything after the agent name, although it does dial out etc.
I seem to think that queuemetrics does not recognise the remote hangup "beep- beep" tone and that's why it does a fail-over.
-
Hello Angelo,
I think you should use a numeric code for the Agent, like "1234" so that it logs "Agent/1234" and not "Agent/Angelo".
Also, are you sure that "ZAP/g2/3461" is the number to dial correctly? it seems a bit short to be a PSTN number...
-
Hi
I have replaced the name with the number, but this change had no effect. The AGI script still does not terminate properly when the remote side hangs up. The PSTN number that I dial is correct, I just deleted the first part for anonymity.
Is there anything else that you can suggest I look at?
Thanks in advance
Angelo
-
Okay, I would then try calling this manually (by you) until you find what goes wrong. You can also look at /var/log/asterisk/agi-log.txt for debug.
-
Hi
I did a workaround to resolve the problem when the remote caller hangs up first. Firstly, it seems that most of the times if the remote side hangs up first, Asterisk does no send the AGI variable back to the queueDial script and then it does not terminate properly and the call just seems to go on and on.
So I put the following line into my hang-up-call macro:
exten => s,n,System( echo "${EPOCH}|${UNIQUEID}|${QUEUENAME}|${AGENT}|COMPLETECALLER|0|${ANSWEREDTIME}" >> /var/log/asterisk/queue_log )
this line then records, into queue_log, that the call is terminated properly and queuemetrics no longer displays a call as continuing indefinitely.
I put in 'COMPLETECALLER' as I know that I only get the error when remote hangsup first and '0' as we are not interested how long the remote party took to answer the phone.
Thanks once more for a great product
Angelo
-
That's a hack, sure, but a nice one :-)
-
Hi
I have replaced the name with the number, but this change had no effect. The AGI script still does not terminate properly when the remote side hangs up. The PSTN number that I dial is correct, I just deleted the first part for anonymity.
Although this is an older thread, I am experiencing a similar issue. I followed the tutorial for setting up the outbound "queue", and it seems to track the beginning of the call just fine, but not the end. Doesn't really seem to matter who hangs up first in my case.
I am using an IAX2 trunk for mine. My dialplan for this is as follows:
[queuedial]
exten => _XXX.,1,SetVar(MY_QUE=${EXTEN:0:3})
exten => _XXX.,2,SetVar(MY_NUM=${EXTEN:3})
exten => _XXX.,3,SetVar(MY_AGENT=${CALLERIDNUM})
exten => _XXX.,4,NoOp,Ag: ${MY_AGENT} N: ${MY_NUM} Q: ${MY_QUE}
exten => _XXX.,5,MixMonitor(Q-${MY_QUE}-${UNIQUEID}.wav|b|)
exten => _XXX.,6,DeadAGI(queueDial.agi|${MY_NUM}|IAX2/iax2trunk/${MY_NUM}|q-${MY_QUE}|Local/${MY_AGENT}@from-internal)
exten => _XXX.,7,Congestion
You may also note that I am tracking "Local/${MY_AGENT}@from-internal". This is because "agents" seem to disappear from our CDR, and we currently bill out based on CDR info.
As described by AngeloA, the end of the call does not seem to get logged. I'd rather not hack my main hangup script, especially on a production server. Could something similar be placed in the above dialplan? Or is there something in the queueDial.agi script I should look for?
Thanks!
DionV
-
Which version of Asterisk are you running?
-
Trixbox 2.2 with Asterisk 1.2.20
-
I am experiencing the same issue with the basic settings as described in the documentation. I am using Queuemetrics 1.4.1 and Trixbox 2.2 with Asterisk 1.2.22-1
Here is the code from extensions_custom.conf:
[queuedial]
exten => _XXX.,1,SetVar(MY_QUE=${EXTEN:0:3})
exten => _XXX.,2,SetVar(MY_NUM=${EXTEN:3})
exten => _XXX.,3,SetVar(MY_AGENT=${CALLERIDNUM})
exten => _XXX.,4,NoOp,Ag: ${MY_AGENT} N: ${MY_NUM} Q: ${MY_QUE}
exten => _XXX.,5,NoOp,MixMonitor(Q-${MY_QUE}-${UNIQUEID}.wav|b|)
exten => _XXX.,6,DeadAGI(queueDial.agi|${MY_NUM}|Zap/g0/${MY_NUM}|q-${MY_QUE}|Agent/${MY_AGENT})
exten => _XXX.,7,Congestion
Here is the output from agi-log.txt:
*QueueDial ---- 8841575- Zap/g0/8841575----Tue Oct 16 17:17:08 2007
*Dial Num: '8841575' Chan: 'Zap/g0/8841575' on Queue: 'q-100' Agent: 'Agent/2181'
*SetVar: 'QDIALER_NUMBER' = '8841575' - 200 result=1
*SetVar: 'QDIALER_CHANNEL' = 'Zap/g0/8841575' - 200 result=1
*SetVar: 'QDIALER_QUEUE' = 'q-100' - 200 result=1
*SetVar: 'QueueName' = 'q-100' - 200 result=1
*SetVar: 'QDIALER_AGENT' = 'Agent/2181' - 200 result=1
That's all I ever get. It doesn't matter which side hangs up.
My trunk is configured with this dial string: Local/$OUTNUM$@queuedial
I don't know what I may have not setup correctly but it seems like it should be pretty simple.
-
This is strange, as the queuedail.agi was developed for 1.2. You're calling it through DeadAGI, correct?
-
Yes. Basically cut and pasted the queuedial dialplan from the PDF.
-
I am also experiencing mostly the same issue. When we use our outbound queue and the remote party hangs up, everything gets logged correctly. When the agent hangs up, the call never gets terminated from QM.
Here are the details.
Running Trixbox 1.1.1 and Asterisk 1.2.22
extensions_custom.conf is setup exactly as ericf has it set up.
Here is my agi-log.txt on a call where the user hangs up.
*QueueDial ---- 503*******- Zap/g4/503*******----Sat Nov 3 13:21:23 2007
*Dial Num: '503*******' Chan: 'Zap/g4/503*******' on Queue: 'q-603' Agent: 'Agent/118'*Cmd: EXEC dial "Zap/g4/503*******||g"
* A: 200 result=0
*GetVar: 'ANSWEREDTIME' = '43'
*GetVar: 'DIALSTATUS' = 'ANSWER'
*GetVar: 'ANSWEREDTIME' = '43'
*Hangup: '0' AT: '43' DS: 'ANSWER'
*1194121290 - 1194121333 - COMPLETECALLER - 7 - 43
*Terminating
Here is my agi-log.txt where the agent hangs up.
*QueueDial ---- 503*******- Zap/g4/503*******----Sat Nov 3 13:48:55 2007
*Dial Num: '503*******' Chan: 'Zap/g4/503*******' on Queue: 'q-603' Agent: 'Agent/118'*SetVar: 'QDIALER_NUMBER' = '503*******' - 200 result=1
*SetVar: 'QDIALER_CHANNEL' = 'Zap/g4/503*******' - 200 result=1
*SetVar: 'QDIALER_QUEUE' = 'q-603' - 200 result=1
*SetVar: 'QueueName' = 'q-603' - 200 result=1
*SetVar: 'QDIALER_AGENT' = 'Agent/118' - 200 result=1
Any help that you can give me in this matter would be great,
Thanks,
-
We are investigating on this issue - bug #229.
-
Does thei happens whenever the agent hangs up, or only when the agent hangs up while not in conversation or while the agents hangs up while in conversation?
I am trying to replicate this behaviour on both * 1.2 and 1.4 we have here in the lab and I am not having success...
-
If anybody is using * 1.4, try the following:
A locally executed AGI script will receive SIGHUP on hangup from the channel except when using DeadAGI. This can be disabled by setting the AGISIGHUP channel variable to "no" before executing the AGI application.
And see if the application behaves correctly. If you're running 1.2, this cannot be done. I believe the cause of this problem is the script receiving HANGUPs.
-
I am not quite understanding what you mean "while in conversation" or "while not in conversation" It boils down to who hangs up first. If the agent hangs up first, the call is not terminated correctly in queuemetrics. If the customer hangs up first, the call is terminated correctly. Currently, we have been telling our agents to allow the customer to hang up so that the numbers look correct.
As to the script getting SIGHUP, I believe this may be the case. Since I am running Asterisk 1.2, I can't use the AGISIGHUP variable. What harm would occur if I ignore the SIGHUP in the AGI script itself. Will this work?
-
I suggest you track the h extension and write a fake entry, though the actual talk time will be mistracked.
-
Thanks for the tip. I am now tracking the h extension and this issue seems to be fixed.
-
Hi guys,
Sorry to drag up such and old post, but I am also having this issue.
I am running TrixBox with * ver 1.2.23.
If the person called hangs up, the queue_log gets written to fine, If my agents initiate the hangup queue_log does not get updated with the hangup info so it appears that the call goes on forever...
here is a snippet of my agi-log.txt file from when an agent hangs up, like others who have posted it does not appear to be a complete log. *Dialed number edited*
*QueueDial ---- 4253****- ZAP/g0/4253****----Wed Jan 30 16:00:51 2008
*Dial Num: '4253677415' Chan: 'ZAP/g0/4253677415' on Queue: 'q-101' Agent: 'Agent/208'
*SetVar: 'QDIALER_NUMBER' = '4253****' - 200 result=1
*SetVar: 'QDIALER_CHANNEL' = 'ZAP/g0/4253****' - 200 result=1
*SetVar: 'QDIALER_QUEUE' = 'q-101' - 200 result=1
*SetVar: 'QueueName' = 'q-101' - 200 result=1
*SetVar: 'QDIALER_AGENT' = 'Agent/208' - 200 result=1
It seems that the previous poster was able to get around this issue by "tracking the h extension".
I do not understand this statement, could somebody point me in the right direction with what tracking an extension refers too?
-
Derrickhix
Here was my final solution to this problem.
[custom-outbound-queue]
exten => s,1,NoOp,Ag: ${MY_AGENT} N: ${MY_NUM} Q: ${MY_QUE}
exten => s,2,Macro(outbound-callerid,1)
exten => s,3,MixMonitor(Q-${MY_QUE}-${UNIQUEID}.wav|b|)
exten => s,4,DeadAGI(queueDial.agi|${MY_NUM}|Zap/g4/${MY_NUM}|q-${MY_QUE}|Agent/${MY_AGENT})
exten => s,5,Congestion
exten => h,1,System( echo "${EPOCH}|${UNIQUEID}|${QUEUENAME}|${AGENT}|COMPLETECALLER|0|${ANSWEREDTIME}" >> /var/log/asterisk/queue_log )
exten => h,2,NoOp,Epoch: ${EPOCH} UniqueID: ${UNIQUEID} QueueName: ${QUEUENAME} Agent: ${AGENT} AnsweredTime: ${ANSWEREDTIME}"
exten => h,3,Macro(hangupcall)
With it being so long ago, I am not sure if this was the only change that I made. Give it a go and see if it works for you.
-
If anybody is using * 1.4, try the following:
A locally executed AGI script will receive SIGHUP on hangup from the channel except when using DeadAGI. This can be disabled by setting the AGISIGHUP channel variable to "no" before executing the AGI application.
And see if the application behaves correctly. If you're running 1.2, this cannot be done. I believe the cause of this problem is the script receiving HANGUPs.
I am using 1.4.17 and I am getting the same error. Here is my outbound section of extensions.conf:
exten => _NXXNXXXXXX,1,noop(2)
exten => _NXXNXXXXXX,n,Set(AGENT="Agent/1${CALLERID(num)}")
exten => _NXXNXXXXXX,n,Set(CALLERID(num)="5555555555")
exten => _NXXNXXXXXX,n,Set(CALLERID(name)="Intercorp")
exten => _NXXNXXXXXX,n,GotoIf($["${CDR(ACCOUNTCODE)}" = "service"]?outbound,${EXTEN},101)
exten => _NXXNXXXXXX,n,Dial(ZAP/G1/${EXTEN},60,t)
exten => _NXXNXXXXXX,n,Hangup
exten => _NXXNXXXXXX,101,Set(AGISIGHUP=no)
exten => _NXXNXXXXXX,n,AGI(queueDial.agi|${EXTEN}|ZAP/G1/${EXTEN}|service_outbound|${AGENT})
exten => _NXXNXXXXXX,n,Hangup
-
You should try with the 'h' trick.
-
Hi Guys,
I honestly don't know if this is the right place to post this, or I should start a new post with this, but I am having similar issue.
I get "agent/CALLERID(num)" (i.e e.g agent/1000) shown as one of the logged on agent on the realtime screen after the call have been terminated. It seems that queuemetrics is logging on the agent after the call ended. I need to stop this, as the agents are already logged on, and only needs to do "pause" with a pause code so that calls can stop coming to them, and they can make calls and then unpause to start receiving calls again, when done with making calls.
How can I stop queuemetrics from logging them on as specified above after making calls?
I use Asterisk-1.4.18 and here is what I currently do in my queuedial context.
[queuedial]
exten => _XXX.,1,Set(MY_QUE=${EXTEN:0:3})
exten => _XXX.,n,Set(MY_NUM=${EXTEN:3})
exten => _XXX.,n,Set(MY_AGENT=${CALLERID(num)})
exten => _XXX.,n,NoOp,Ag: ${MY_AGENT} N: ${MY_NUM} Q: ${MY_QUE}
exten => _XXX.,n,MixMonitor(Q-${MY_QUE}-${UNIQUEID}.wav|b|)
exten => _XXX.,n,Set(AGISIGHUP=no)
exten=>_XXX.,n,AGI(queueDial.agi|${MY_NUM}|Zap/g0/${MY_NUM}|q-${MY_QUE}|Agent/${MY_AGENT})
exten => _XXX.,n,Congestion()
exten => h,1,Hangup()
Cheers to all.
-
You should implement the solution described here.
-
We have developed a pure-diaplan solution that should work as a plug-in replacement for the queueDial.agi on 1.4 systems:
http://forum.queuemetrics.com/index.php?topic=261.0
Please test it and let us know how it goes.