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

Abhay Gupta asteriskteam at digium.com
Tue Dec 4 02:10:57 CST 2018


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


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

app_amd: Infinite loop on silent calls

Change-Id: I24726bd29d7e467fc721ca265363417234b22855
---
M apps/app_amd.c
1 file changed, 4 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/36/10736/1

diff --git a/apps/app_amd.c b/apps/app_amd.c
index 3f805bb..0e60f9e 100644
--- a/apps/app_amd.c
+++ b/apps/app_amd.c
@@ -282,7 +282,9 @@
 		/* 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 */
 		if (!(f = ast_read(chan))) {
@@ -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/10736
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-MessageType: newchange
Gerrit-Change-Id: I24726bd29d7e467fc721ca265363417234b22855
Gerrit-Change-Number: 10736
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/20181204/68db5226/attachment.html>


More information about the asterisk-code-review mailing list