mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-18 18:58:22 +00:00
Make read/write mode have a lock parameter and use it properly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -45,13 +45,15 @@ static int echo_exec(struct ast_channel *chan, void *data)
|
||||
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));
|
||||
ast_set_write_format(chan, ast_best_codec(chan->nativeformats), 1);
|
||||
ast_set_read_format(chan, ast_best_codec(chan->nativeformats), 1);
|
||||
/* Do our thing here */
|
||||
while(ast_waitfor(chan, -1) > -1) {
|
||||
f = ast_read(chan);
|
||||
if (!f)
|
||||
break;
|
||||
f->delivery.tv_sec = 0;
|
||||
f->delivery.tv_usec = 0;
|
||||
if (f->frametype == AST_FRAME_VOICE) {
|
||||
if (ast_write(chan, f))
|
||||
break;
|
||||
|
Reference in New Issue
Block a user