[Home]

Summary:ASTERISK-25328: Wrong ANSWEREDTIME after Dial app execution
Reporter:Sébastien M. (sebclick)Labels:
Date Opened:2015-08-18 07:46:37Date Closed:2015-08-21 08:23:03
Priority:MajorRegression?Yes
Status:Closed/CompleteComponents:Applications/app_dial
Versions:13.1.0 Frequency of
Occurrence
Related
Issues:
is related toASTERISK-25336 Documentation: Explanation of DIALEDTIME and ANSWEREDTIME variables could be more explicit
Environment:Attachments:( 0) debugANSWEREDTIME-Asterisk11
( 1) debugANSWEREDTIME-Asterisk13
Description:https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Dial
??DIALEDTIME - This is the time from dialing a channel until when it is disconnected.??
??ANSWEREDTIME - This is the amount of time for actual call.??
??DIALSTATUS - This is the status of the call??

*Dialplan :*
{quote}
exten => _017013xxxx,1,Answer()
exten => _017013xxxx,n,wait(5)
exten => _017013xxxx,n,Dial(SIP/027273xxxx@CBV2-BCT1-VIP-MGC,20,gH)
exten => _017013xxxx,n,NoOp(DIALSTATUS is $\{DIALSTATUS\}, ANSWEREDTIME is $\{ANSWEREDTIME\}, DIALEDTIME is $\{DIALEDTIME\})
{quote}

*Test :*
I call 017013xxxx. After 5 second, Asterisk dial the 027273xxxx.
The 027273xxxx waits for 4 seconds and pick up the call for 10 seconds before hang up.

$\{ANSWEREDTIME\} should be 10.

*Log :*
{quote}
== Using SIP RTP CoS mark 5
   -- Executing \[017013xxxx@public:1\] Answer("SIP/CBV2-BCT1-VIP-MGC-0000002b", "") in new stack
   -- Executing \[017013xxxx@public:2\] Wait("SIP/CBV2-BCT1-VIP-MGC-0000002b", "5") in new stack
   -- Executing \[017013xxxx@public:3\] Dial("SIP/CBV2-BCT1-VIP-MGC-0000002b", "SIP/027273xxxx@CBV2-BCT1-VIP-MGC,20,gH") in new stack
 == Using SIP RTP CoS mark 5
   -- Called SIP/027273xxxx@CBV2-BCT1-VIP-MGC
   -- SIP/CBV2-BCT1-VIP-MGC-0000002c is ringing
   -- SIP/CBV2-BCT1-VIP-MGC-0000002c is making progress passing it to SIP/CBV2-BCT1-VIP-MGC-0000002b
      > 0x2b554d6328d0 -- Probation passed - setting RTP source address to 46.255.54.7:32102
      > 0x2b5570029720 -- Probation passed - setting RTP source address to 46.255.54.5:35774
   -- SIP/CBV2-BCT1-VIP-MGC-0000002c answered SIP/CBV2-BCT1-VIP-MGC-0000002b
   -- Channel SIP/CBV2-BCT1-VIP-MGC-0000002b joined 'simple_bridge' basic-bridge <f79aafa2-149a-49d0-b13b-1c3dee8c5db0>
   -- Channel SIP/CBV2-BCT1-VIP-MGC-0000002c joined 'simple_bridge' basic-bridge <f79aafa2-149a-49d0-b13b-1c3dee8c5db0>
   -- Channel SIP/CBV2-BCT1-VIP-MGC-0000002c left 'simple_bridge' basic-bridge <f79aafa2-149a-49d0-b13b-1c3dee8c5db0>
   -- Channel SIP/CBV2-BCT1-VIP-MGC-0000002b left 'simple_bridge' basic-bridge <f79aafa2-149a-49d0-b13b-1c3dee8c5db0>
   -- Executing \[017013xxxx@public:4\] NoOp("SIP/CBV2-BCT1-VIP-MGC-0000002b", "DIALSTATUS is ANSWER, ANSWEREDTIME is 19, DIALEDTIME is 19") in new stack
   -- Auto fallthrough, channel 'SIP/CBV2-BCT1-VIP-MGC-0000002b' status is 'ANSWER'
{quote}

*Result :*

$\{ANSWEREDTIME\} is 19 but should be 10.

On Asterisk 11.9.0, ANSWEREDTIME works well and was 10.
Comments:By: Asterisk Team (asteriskteam) 2015-08-18 07:46:39.554-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Rusty Newton (rnewton) 2015-08-18 13:56:01.677-0500

[~rmudgett] looked over the issue and the ANSWEREDTIME appears to be accurate.

"Answer + Wait 5 + Peer answers after 4 + connected 10 is 19 seconds."

Are you confusing the answered time with what would be the bridged time?




By: Sébastien M. (sebclick) 2015-08-19 08:13:58.015-0500

Hi,

When I read the doc, ANSWEREDTIME seems to be the bridged time : the duration where the 2 participants have spoken together.
This variable is good on Asterisk 11.

If it's not a bug, how can I obtain this information ?

Thanks

By: Richard Mudgett (rmudgett) 2015-08-19 11:48:44.930-0500

The ANSWEREDTIME starts when the channel is answered.  Don't manually answer the call before dialing.  When the called channel answers it will automatically answer the calling channel so they can be bridged.  This way the ANSWEREDTIME will also be the bridged time.  You should not need to manually answer the call unless your dialplan is going to interact with the caller such as an automated attendent.

By: Sébastien M. (sebclick) 2015-08-20 04:25:12.497-0500

Thanks for your response.

I need to answer the call because I have an IVR before the dial command.

A simple example :
{quote}
exten => _017013xxxx,1,Answer()
exten => _017013xxxx,n,Playback(welcome)
exten => _017013xxxx,n,Dial(SIP/027273xxxx@CBV2-BCT1-VIP-MGC,20,gH)
exten => _017013xxxx,n,NoOp(DIALSTATUS is $\{DIALSTATUS\}, ANSWEREDTIME is $\{ANSWEREDTIME\}, DIALEDTIME is $\{DIALEDTIME\})
{quote}





By: Rusty Newton (rnewton) 2015-08-21 08:22:48.552-0500

So, ANSWEREDTIME is behaving appropriately. The difference in behavior can be accounted for by a change in what "answered" in this context means between 11 and 13.

If you are really wanting the bridged time you can probably get that from CDR.. so you may want to look into that route.

At this point I'm going to close out the issue since we don't have a bug. However I did file a documentation issue as it could be improved[1].

If you need further support in figuring out the best solution then the appropriate place to continue the conversation is on forums.asterisk.org or the asterisk-users mailing list[2]

[1]: https://issues.asterisk.org/jira/browse/ASTERISK-25336
[2]: http://www.asterisk.org/community/discuss