Update application description to be a bit more accurate, and clean up a little bit of code formatting

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Russell Bryant 20 years ago
parent d09769fba7
commit 008be638a5

@ -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> 2005-11-16 Russell Bryant <russell@digium.com>
* Makefile: Fix the output of Makefile generated variables to doxygen * Makefile: Fix the output of Makefile generated variables to doxygen

@ -43,12 +43,12 @@ static char *tdesc = "Simple Echo Application";
static char *app = "Echo"; 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 = static char *descrip =
" Echo(): Echo audio read from channel back to the channel. \n" " Echo(): This application will echo any audio, video, or DTMF frames read from\n"
"User can exit the application by either pressing the '#' key, \n" "the calling channel back to itself. If the DTMF digit '#' is received, the\n"
"or hanging up.\n"; "application will exit.\n";
STANDARD_LOCAL_USER; STANDARD_LOCAL_USER;
@ -56,14 +56,18 @@ LOCAL_USER_DECL;
static int echo_exec(struct ast_channel *chan, void *data) static int echo_exec(struct ast_channel *chan, void *data)
{ {
int res=-1; int res = -1;
int format;
struct localuser *u; struct localuser *u;
struct ast_frame *f; struct ast_frame *f;
LOCAL_USER_ADD(u); LOCAL_USER_ADD(u);
ast_set_write_format(chan, ast_best_codec(chan->nativeformats));
ast_set_read_format(chan, ast_best_codec(chan->nativeformats)); format = ast_best_codec(chan->nativeformats);
/* Do our thing here */ ast_set_write_format(chan, format);
while(ast_waitfor(chan, -1) > -1) { ast_set_read_format(chan, format);
while (ast_waitfor(chan, -1) > -1) {
f = ast_read(chan); f = ast_read(chan);
if (!f) if (!f)
break; break;
@ -79,13 +83,16 @@ static int echo_exec(struct ast_channel *chan, void *data)
if (f->subclass == '#') { if (f->subclass == '#') {
res = 0; res = 0;
break; break;
} else } else {
if (ast_write(chan, f)) if (ast_write(chan, f))
break; break;
}
} }
ast_frfree(f); ast_frfree(f);
} }
LOCAL_USER_REMOVE(u); LOCAL_USER_REMOVE(u);
return res; return res;
} }

Loading…
Cancel
Save