summaryrefslogtreecommitdiff
path: root/apps/app_echo.c
diff options
context:
space:
mode:
authorAlec L Davis <sivad.a@paradise.net.nz>2010-03-02 07:38:56 +0000
committerAlec L Davis <sivad.a@paradise.net.nz>2010-03-02 07:38:56 +0000
commit9257e8573b62268f20ae37a35b3a5fe1645a8d2e (patch)
tree5cc0110ea7c306c33e0a03b97ce69b084c5fc625 /apps/app_echo.c
parent5dbe86a3c2d8d39ab9dc6866090aeb7b18b2cc3f (diff)
fixes ability to exit echo app
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.diff.txt uploaded by alecdavis (license 585) Tested by: alecdavis git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249801 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_echo.c')
-rw-r--r--apps/app_echo.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/apps/app_echo.c b/apps/app_echo.c
index 1c7211060..5414ee37e 100644
--- a/apps/app_echo.c
+++ b/apps/app_echo.c
@@ -62,17 +62,26 @@ static int echo_exec(struct ast_channel *chan, const char *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.integer == '#')) {
- 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) {
+ if (f->subclass.integer == '#') {
+ res = 0;
+ ast_frfree(f);
+ goto end;
+ }
+ }
+ break;
+ default:
+ break;
+ }
ast_frfree(f);
}
end: