aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authoralecdavis <alecdavis@f38db490-d61c-443f-a65b-d21fe96a405b>2010-03-02 09:16:02 +0000
committeralecdavis <alecdavis@f38db490-d61c-443f-a65b-d21fe96a405b>2010-03-02 09:16:02 +0000
commitc12416ef9c863cc624118d6d36b2ecb0905c4e7c (patch)
treeba6ade8b1b2ca561ccb466cc115dc4d117ad6973 /apps
parentfa69e55358f33f5c380e2746f723d70e1832384d (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 (closes issue #16880) Reported by: alecdavis Patches: based on echo_exit_1-6-1.diff.txt uploaded by alecdavis (license 585) Tested by: alecdavis git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@249846 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_echo.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/apps/app_echo.c b/apps/app_echo.c
index 1a8abe9f0..46b393aae 100644
--- a/apps/app_echo.c
+++ b/apps/app_echo.c
@@ -54,18 +54,26 @@ static int echo_exec(struct ast_channel *chan, void *data)
while (ast_waitfor(chan, -1) > -1) {
struct ast_frame *f = ast_read(chan);
- if (!f)
+ 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);
}