diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-11-19 19:44:46 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-11-19 19:44:46 +0000 |
commit | 39e839eedf7a9f3e5d74f7f46dca2a5151a4a147 (patch) | |
tree | f5d44d9211cef304ad2a8015a6d6fd70c6e558ba | |
parent | 90b16f1561fa5b2295bdf5f271616dd3da577083 (diff) |
Update application description to be a bit more accurate, and clean up a little bit of code formatting
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7134 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-x | ChangeLog | 4 | ||||
-rwxr-xr-x | apps/app_echo.c | 27 |
2 files changed, 21 insertions, 10 deletions
@@ -1,3 +1,7 @@ +2005-11-19 Russell Bryant <russell@digium.com> + + * app/app_echo.c: Update application description to be a bit more accurate, and clean up a little bit of code formatting + 2005-11-16 Russell Bryant <russell@digium.com> * Makefile: Fix the output of Makefile generated variables to doxygen diff --git a/apps/app_echo.c b/apps/app_echo.c index 2b7c20079..89bf7a59d 100755 --- a/apps/app_echo.c +++ b/apps/app_echo.c @@ -43,12 +43,12 @@ static char *tdesc = "Simple Echo Application"; static char *app = "Echo"; -static char *synopsis = "Echo audio read back to the user"; +static char *synopsis = "Echo audio, video, or DTMF back to the calling party"; static char *descrip = -" Echo(): Echo audio read from channel back to the channel. \n" -"User can exit the application by either pressing the '#' key, \n" -"or hanging up.\n"; +" Echo(): This application will echo any audio, video, or DTMF frames read from\n" +"the calling channel back to itself. If the DTMF digit '#' is received, the\n" +"application will exit.\n"; STANDARD_LOCAL_USER; @@ -56,14 +56,18 @@ LOCAL_USER_DECL; static int echo_exec(struct ast_channel *chan, void *data) { - int res=-1; + int res = -1; + int format; struct localuser *u; struct ast_frame *f; + LOCAL_USER_ADD(u); - ast_set_write_format(chan, ast_best_codec(chan->nativeformats)); - ast_set_read_format(chan, ast_best_codec(chan->nativeformats)); - /* Do our thing here */ - while(ast_waitfor(chan, -1) > -1) { + + format = ast_best_codec(chan->nativeformats); + ast_set_write_format(chan, format); + ast_set_read_format(chan, format); + + while (ast_waitfor(chan, -1) > -1) { f = ast_read(chan); if (!f) break; @@ -79,13 +83,16 @@ static int echo_exec(struct ast_channel *chan, void *data) if (f->subclass == '#') { res = 0; break; - } else + } else { if (ast_write(chan, f)) break; + } } ast_frfree(f); } + LOCAL_USER_REMOVE(u); + return res; } |