[Asterisk-code-review] Infinite loop in app amd on silent calls (asterisk[15])

Abhay Gupta asteriskteam at digium.com
Mon Nov 26 06:11:50 CST 2018


Abhay Gupta has uploaded this change for review. ( https://gerrit.asterisk.org/10708


Change subject: Infinite loop in app_amd on silent calls
......................................................................

Infinite loop in app_amd on silent calls

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



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/08/10708/1

diff --git a/apps/app_amd.c b/apps/app_amd.c
index 3f805bb..e7ac99e 100644
--- a/apps/app_amd.c
+++ b/apps/app_amd.c
@@ -282,6 +282,8 @@
 		/* Figure out how long we waited */
 		if (res > 0) {
 			ms = 2 * maxWaitTimeForFrame - res;
+		} else {
+			ms = 2 * maxWaitTimeForFrame;
 		}
 
 		/* If we fail to read in a frame, that means they hung up */
@@ -293,7 +295,7 @@
 			break;
 		}
 
-		if (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_CNG) {
+		if (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_CNG || f->frametype == AST_FRAME_NULL) {
 			/* Figure out how long the frame is in milliseconds */
 			if (f->frametype == AST_FRAME_VOICE) {
 				framelength = (ast_codec_samples_count(f) / DEFAULT_SAMPLES_PER_MS);

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

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3593987be77b25126680d5d17d467af196487568
Gerrit-Change-Number: 10708
Gerrit-PatchSet: 1
Gerrit-Owner: Abhay Gupta <abhay at avissol.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181126/3eda3b6a/attachment.html>


More information about the asterisk-code-review mailing list