[Home]

Summary:ASTERISK-28608: app_amd: Use time calculation to calculate timeout
Reporter:Michael Cargile (mcargile)Labels:patch
Date Opened:2019-11-05 11:42:56.000-0600Date Closed:2019-11-20 10:02:12.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Applications/app_amd
Versions:13.29.1 Frequency of
Occurrence
Related
Issues:
is related toASTERISK-28143 app_amd: Infinite loop on silent calls
Environment:Attachments:( 0) amd_timeout.patch
Description:ASTERISK-28143 added AST_FRAME_NULL as a frame type to count in its total ms calculation which is used to determine if it has reached its timeout. The issue is that this section:

{noformat}
/* If we fail to read in a frame, that means they hung up */
if (!(f = ast_read(chan))) {
ast_verb(3, "AMD: Channel [%s]. HANGUP\n", ast_channel_name(chan));
ast_debug(1, "Got hangup\n");
strcpy(amdStatus, "HANGUP");
res = 1;
break;
}
{noformat}

can return AST_FRAME_NULL at random time intervals. As such it is unreliable for calculating the time spend in app_amd. Instead an actual timer should be used to calculate the timeout.
Comments:By: Asterisk Team (asteriskteam) 2019-11-05 11:42:57.700-0600

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].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Joshua C. Colp (jcolp) 2019-11-05 11:45:57.543-0600

Is this something you plan on undertaking? app_amd is extended support, so support comes from the community itself and thus without a change it can take some time to get looked into.

By: Michael Cargile (mcargile) 2019-11-05 11:46:01.631-0600

Fixes the TIMEOUT issue in app_amd by using an actual timer rather than relying on a calculation of time based off the frames.

By: Michael Cargile (mcargile) 2019-11-05 11:47:21.785-0600

Already did. Been a while since I submitted a patch though so need to refresh myself on the process.

By: Michael Cargile (mcargile) 2019-11-05 13:27:21.862-0600

Code has been successfully submitted to Gerrit.

By: Michael Cargile (mcargile) 2019-11-13 08:50:56.576-0600

Just wanted to check to see if there was anything else I needed to do to get this code reviewed. I think I followed the guides properly.

By: Kevin Harwell (kharwell) 2019-11-13 09:34:13.113-0600

[~mcargile], nothing left to do, but wait for the patch to be reviewed. Thanks for the submission!

By: Friendly Automation (friendly-automation) 2019-11-20 10:02:12.893-0600

Change 13247 merged by Friendly Automation:
app_amd: Fixed timeout issue

[https://gerrit.asterisk.org/c/asterisk/+/13247|https://gerrit.asterisk.org/c/asterisk/+/13247]

By: Friendly Automation (friendly-automation) 2019-11-20 10:37:56.501-0600

Change 13161 merged by Friendly Automation:
app_amd: Fixed timeout issue

[https://gerrit.asterisk.org/c/asterisk/+/13161|https://gerrit.asterisk.org/c/asterisk/+/13161]

By: Friendly Automation (friendly-automation) 2019-11-20 16:18:02.506-0600

Change 13251 merged by Kevin Harwell:
app_amd: Fixed timeout issue

[https://gerrit.asterisk.org/c/asterisk/+/13251|https://gerrit.asterisk.org/c/asterisk/+/13251]

By: Friendly Automation (friendly-automation) 2019-11-20 16:18:44.746-0600

Change 13252 merged by Kevin Harwell:
app_amd: Fixed timeout issue

[https://gerrit.asterisk.org/c/asterisk/+/13252|https://gerrit.asterisk.org/c/asterisk/+/13252]