aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorpabelanger <pabelanger@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-16 17:10:36 +0000
committerpabelanger <pabelanger@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-16 17:10:36 +0000
commit1017bf9e1d1229b3f200558fc3861c85867a598e (patch)
treeba66a030b5a67f4c60d20c1aa2121fcc56797b80 /apps
parent8ef206dc8f44483aa5f5c92fec00d35883b6a68a (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@277182 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_amd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/app_amd.c b/apps/app_amd.c
index 3fab6c999..0b73cdbdb 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) {