[asterisk-commits] trunk r30360 - /trunk/apps/app_echo.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu May 25 12:21:10 MST 2006
Author: russell
Date: Thu May 25 14:21:09 2006
New Revision: 30360
URL: http://svn.digium.com/view/asterisk?rev=30360&view=rev
Log:
add the ability to be able to echo DTMF_BEGIN/END, HTML, and IMAGE frames, too
(issue #7193, Mithraen, with some mods)
Modified:
trunk/apps/app_echo.c
Modified: trunk/apps/app_echo.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_echo.c?rev=30360&r1=30359&r2=30360&view=diff
==============================================================================
--- trunk/apps/app_echo.c (original)
+++ trunk/apps/app_echo.c Thu May 25 14:21:09 2006
@@ -72,26 +72,30 @@
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;
}
More information about the asterisk-commits
mailing list