]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
fixes ability to exit echo app
authorAlec L Davis <sivad.a@paradise.net.nz>
Tue, 2 Mar 2010 09:05:23 +0000 (09:05 +0000)
committerAlec L Davis <sivad.a@paradise.net.nz>
Tue, 2 Mar 2010 09:05:23 +0000 (09:05 +0000)
when called from a ISDN channel, null frames prevent '#' exit.
Now only echo back VOICE and DTMF frames

(issue #16880)
Reported by: alecdavis
Patches:
      echo_exit_1-6-1.diff.txt uploaded by alecdavis (license 585)
Tested by: alecdavis

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@249843 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_echo.c

index 76c701cd70266b1d289629bad290bd42d37605b3..46b393aaefc44f0b503601d15456e6f69056000d 100644 (file)
@@ -57,16 +57,23 @@ static int echo_exec(struct ast_channel *chan, void *data)
                if (!f) {
                        break;
                }
-               f->delivery.tv_sec = 0;
-               f->delivery.tv_usec = 0;
-               if (ast_write(chan, f)) {
-                       ast_frfree(f);
-                       goto end;
-               }
-               if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '#')) {
-                       res = 0;
-                       ast_frfree(f);
-                       goto end;
+               switch (f->frametype) {
+               case AST_FRAME_VOICE:
+               case AST_FRAME_DTMF:
+                       f->delivery.tv_sec = 0;
+                       f->delivery.tv_usec = 0;
+                       if (ast_write(chan, f)) {
+                               ast_frfree(f);
+                               goto end;
+                       }
+                       if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '#')) {
+                               res = 0;
+                               ast_frfree(f);
+                               goto end;
+                       }
+                       break;
+               default:
+                       break;
                }
                ast_frfree(f);
        }