diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-25 19:21:09 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-25 19:21:09 +0000 |
commit | 59737483ed88d82c033a2d9bf4d94be44de14e3c (patch) | |
tree | 1a99a9e18b61fd5283c0e1b80599065d1a230c7c /apps/app_echo.c | |
parent | 7fb949653ffffb21dd6a8bc7bd3f438c13857254 (diff) |
add the ability to be able to echo DTMF_BEGIN/END, HTML, and IMAGE frames, too
(issue #7193, Mithraen, with some mods)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@30360 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_echo.c')
-rw-r--r-- | apps/app_echo.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/apps/app_echo.c b/apps/app_echo.c index 183f843fe..eba15f8e9 100644 --- a/apps/app_echo.c +++ b/apps/app_echo.c @@ -72,26 +72,30 @@ static int echo_exec(struct ast_channel *chan, void *data) break; f->delivery.tv_sec = 0; f->delivery.tv_usec = 0; - if (f->frametype == AST_FRAME_VOICE) { - if (ast_write(chan, f)) - break; - } else if (f->frametype == AST_FRAME_VIDEO) { - if (ast_write(chan, f)) - break; - } else if (f->frametype == AST_FRAME_DTMF) { + switch (f->frametype) { + case AST_FRAME_DTMF: + case AST_FRAME_DTMF_END: if (f->subclass == '#') { res = 0; - break; - } else { - if (ast_write(chan, f)) - break; + ast_frfree(f); + goto end; + } + /* fall through */ + case AST_FRAME_DTMF_BEGIN: + case AST_FRAME_VOICE: + case AST_FRAME_VIDEO: + case AST_FRAME_TEXT: + case AST_FRAME_HTML: + case AST_FRAME_IMAGE: + if (ast_write(chan, f)) { + ast_frfree(f); + goto end; } } ast_frfree(f); } - +end: LOCAL_USER_REMOVE(u); - return res; } |