From d9e34da4ae08433eff64416b74d61a43679fad4b Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Fri, 16 Jul 2010 17:10:36 +0000 Subject: [PATCH] Total analysis time error with SIP and silence suppression When using app_amd with SIP providers that have silence suppression on, the iTotalTime count increases exponentially. (closes issue #17656) Reported by: juls git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@277182 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_amd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/app_amd.c b/apps/app_amd.c index 3fab6c999b..0b73cdbdb6 100644 --- a/apps/app_amd.c +++ b/apps/app_amd.c @@ -215,10 +215,11 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data) if (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_NULL || f->frametype == AST_FRAME_CNG) { /* If the total time exceeds the analysis time then give up as we are not too sure */ - if (f->frametype == AST_FRAME_VOICE) + if (f->frametype == AST_FRAME_VOICE) { framelength = (ast_codec_get_samples(f) / DEFAULT_SAMPLES_PER_MS); - else - framelength += 2 * maxWaitTimeForFrame; + } else { + framelength = 2 * maxWaitTimeForFrame; + } iTotalTime += framelength; if (iTotalTime >= totalAnalysisTime) { -- 2.47.2