Author Topic: Quemeterics not recognising remote caller hangup  (Read 35760 times)

AngeloA

  • Newbie
  • *
  • Posts: 6
  • Karma: 1
    • View Profile
    • Email
Quemeterics not recognising remote caller hangup
« 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)


QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Quemeterics not recognising remote caller hangup
« Reply #1 on: April 26, 2007, 09:10:38 »
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?

AngeloA

  • Newbie
  • *
  • Posts: 6
  • Karma: 1
    • View Profile
    • Email
Re: Quemeterics not recognising remote caller hangup
« Reply #2 on: April 26, 2007, 09:54:51 »
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

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Quemeterics not recognising remote caller hangup
« Reply #3 on: April 26, 2007, 10:02:57 »
How do you set up the outgoing channel to handle the fail-over?

AngeloA

  • Newbie
  • *
  • Posts: 6
  • Karma: 1
    • View Profile
    • Email
Re: Quemeterics not recognising remote caller hangup
« Reply #4 on: April 26, 2007, 10:44:38 »
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.

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Quemeterics not recognising remote caller hangup
« Reply #5 on: April 26, 2007, 15:11:26 »
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....

AngeloA

  • Newbie
  • *
  • Posts: 6
  • Karma: 1
    • View Profile
    • Email
Re: Quemeterics not recognising remote caller hangup
« Reply #6 on: May 02, 2007, 12:08:26 »
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.   

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Quemeterics not recognising remote caller hangup
« Reply #7 on: May 04, 2007, 17:26:57 »
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...

AngeloA

  • Newbie
  • *
  • Posts: 6
  • Karma: 1
    • View Profile
    • Email
Re: Quemeterics not recognising remote caller hangup
« Reply #8 on: May 07, 2007, 10:31:40 »
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

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Quemeterics not recognising remote caller hangup
« Reply #9 on: May 07, 2007, 17:28:56 »
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.



AngeloA

  • Newbie
  • *
  • Posts: 6
  • Karma: 1
    • View Profile
    • Email
Re: Quemeterics not recognising remote caller hangup
« Reply #10 on: May 10, 2007, 10:11:49 »
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
   

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Quemeterics not recognising remote caller hangup
« Reply #11 on: May 10, 2007, 13:05:11 »
That's a hack, sure, but a nice one :-)

dionv

  • Newbie
  • *
  • Posts: 16
  • Karma: 2
    • View Profile
Re: Quemeterics not recognising remote caller hangup
« Reply #12 on: October 09, 2007, 00:18:34 »
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:
Code: [Select]
[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

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Quemeterics not recognising remote caller hangup
« Reply #13 on: October 09, 2007, 12:04:58 »
Which version of Asterisk are you running?

dionv

  • Newbie
  • *
  • Posts: 16
  • Karma: 2
    • View Profile
Re: Quemeterics not recognising remote caller hangup
« Reply #14 on: October 10, 2007, 05:39:43 »
Trixbox 2.2 with Asterisk 1.2.20