[Home]

Summary:ASTERISK-24620: ANSWEREDTIME channel variable read via AGI returns NULL result on an answered channel
Reporter:Mason Chase (moontius)Labels:
Date Opened:2014-12-15 08:09:11.000-0600Date Closed:
Priority:MajorRegression?
Status:Open/NewComponents:Applications/app_dial
Versions:13.0.2 Frequency of
Occurrence
Constant
Related
Issues:
Environment:CentOS 6.5 64bitAttachments:( 0) 2014-12-16_-_full_debug.txt
( 1) debug.txt
( 2) debugextract.txt
Description:Below is the log of Asterisk Console during Callback request by 6012XXXXXXX
a) when call SIP/sipprovider/6012XXXXXXX is connected
b) Asterisk is dialing another sip channel SIP/ims_peer/60327XXXXXX
c) call duriation on SIP/ims_peer/60327XXXXXX is 00:00:12
d) GET VARIABLE ANSWEREDTIME report Wrong : 0
e) GET VARIABLE DIALEDTIME report Wrong : 28

[Edit by Rusty - Remove inline debug - logs don't go in the description field. In the future, please use attachments for logs.]
Comments:By: Rusty Newton (rnewton) 2014-12-15 09:49:13.739-0600

Attaching reporter's debug.

By: Rusty Newton (rnewton) 2014-12-15 09:51:59.419-0600

We require a complete debug log to help triage the issue. This document will provide instructions on how to collect debugging logs from an Asterisk machine for the purpose of helping bug marshals troubleshoot an issue: https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information


Specifically make sure to get all of the logger channel types, and make sure the DEBUG messages appear in your log before attaching it to the issue.

Press Send Back or Enter Feedback to send the issue back to us.

By: Rusty Newton (rnewton) 2014-12-15 17:47:46.294-0600

Thanks for the additional debug!

Your first debug log doesn't contain enough information about the channels involved to identify the issue, but I believe I see the issue in the new debug log. I haven't used this variable before, but it does look like a bug to me.

The channel in question gets answered.
{noformat}
   -- SIP/SIP_Proivder_A-00000006 answered
[Dec 16 00:58:24] DEBUG[15121][C-00000003]: pbx.c:4921 pbx_extension_helper: Launching 'Answer'
{noformat}

Then you read the variable:

{noformat}
<SIP/SIP_Proivder_A-00000006>AGI Rx << GET VARIABLE ANSWEREDTIME
[Dec 16 00:58:25] DEBUG[15121][C-00000003]: pbx.c:3720 ast_str_retrieve_variable: Result of 'ANSWEREDTIME' is NULL
{noformat}

Which is NULL and seems inappropriate considering the documentation from https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Dial:

{noformat}
ANSWEREDTIME - This is the amount of time for actual call.
{noformat}

And it is safe to assume that means since the call was answered. I'm going to go ahead and open the issue up since this looks buggy. I'm not sure what other debug will be needed, so this may be good for now.

By: Sylvester Kuisis (gl1tchh) 2016-03-15 05:40:07.894-0500

Hi,

I see this has been dormant for quite some time. I've just run into this issue again, on version 13.7.2, using callfiles to initiate a call. I have attached an excerpt of my debug logs (a DumpChan from after hangup, as well as the VarSets for DIALEDTIME set to 11, where ANSWEREDTIME is set to 0).

The logs were created using a callfile in the following context:

{code}
[debug]
exten => _X.,1,Dial(SIP/SIP_PROVIDER/${EXTEN})
exten => _X.,n,Goto(debug,h,1)

exten => h,1,DumpChan()
exten => h,n,Hangup()
{code}

I have the full debug logs available if needed.

By: Sean Bright (seanbright) 2019-03-12 11:16:43.192-0500

I think the confusion might be that the {{Dial}} application is not used for any of these examples. The {{Dial}} application sets these variables, but starting a call via call file or {{Originate}} or another method does not use {{Dial}}.