]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 277183 via svnmerge from
authorPaul Belanger <paul.belanger@polybeacon.com>
Fri, 16 Jul 2010 17:18:01 +0000 (17:18 +0000)
committerPaul Belanger <paul.belanger@polybeacon.com>
Fri, 16 Jul 2010 17:18:01 +0000 (17:18 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r277183 | pabelanger | 2010-07-16 13:13:46 -0400 (Fri, 16 Jul 2010) | 15 lines

  Merged revisions 277182 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r277182 | pabelanger | 2010-07-16 13:10:36 -0400 (Fri, 16 Jul 2010) | 8 lines

    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.6.2@277188 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_amd.c

index b37f913ae5b40b46cb5a6781b8000bf3188b1f69..eb19d8d716453f1d59364579e7adcbd1a4694641 100644 (file)
@@ -270,10 +270,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) {