[Asterisk-code-review] app_amd: Fix infinite loop on silent calls (...asterisk[13])

Friendly Automation asteriskteam at digium.com
Tue Apr 30 10:03:44 CDT 2019


Friendly Automation has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/11317 )

Change subject: app_amd: Fix infinite loop on silent calls
......................................................................

app_amd: Fix infinite loop on silent calls

The total time logic will now be executed on calls which
do not pass any media.

ASTERISK-28143

Change-Id: I24726bd29d7e467fc721ca265363417234b22855
---
M apps/app_amd.c
1 file changed, 9 insertions(+), 1 deletion(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



diff --git a/apps/app_amd.c b/apps/app_amd.c
index 5a2543c..f56fe79 100644
--- a/apps/app_amd.c
+++ b/apps/app_amd.c
@@ -282,7 +282,7 @@
 		int ms = 0;
 
 		/* Figure out how long we waited */
-		if (res > 0) {
+		if (res >= 0) {
 			ms = 2 * maxWaitTimeForFrame - res;
 		}
 
@@ -412,6 +412,14 @@
 				}
 
 			}
+		} else {
+			iTotalTime += ms;
+			if (iTotalTime >= totalAnalysisTime) {
+				ast_frfree(f);
+				strcpy(amdStatus , "NOTSURE");
+				sprintf(amdCause , "TOOLONG-%d", iTotalTime);
+				break;
+			}
 		}
 		ast_frfree(f);
 	}

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11317
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I24726bd29d7e467fc721ca265363417234b22855
Gerrit-Change-Number: 11317
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Abhay Gupta <abhay at avissol.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190430/b536cb10/attachment.html>


More information about the asterisk-code-review mailing list