Skip to content
Snippets Groups Projects
Commit f230bc9d authored by Mark Spencer's avatar Mark Spencer
Browse files

In agent, forward codecs along

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 62ed4984
No related branches found
No related tags found
No related merge requests found
......@@ -226,10 +226,11 @@ static struct ast_frame *agent_read(struct ast_channel *ast)
struct ast_frame *f = NULL;
static struct ast_frame null_frame = { AST_FRAME_NULL, };
static struct ast_frame answer_frame = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER };
ast_pthread_mutex_lock(&p->lock);
if (p->chan)
ast_pthread_mutex_lock(&p->lock);
if (p->chan) {
p->chan->pvt->rawreadformat = ast->pvt->rawreadformat;
f = ast_read(p->chan);
else
} else
f = &null_frame;
if (!f) {
/* If there's a channel, hang it up (if it's on a callback) make it NULL */
......@@ -278,9 +279,10 @@ static int agent_write(struct ast_channel *ast, struct ast_frame *f)
struct agent_pvt *p = ast->pvt->pvt;
int res = -1;
ast_pthread_mutex_lock(&p->lock);
if (p->chan)
if (p->chan) {
p->chan->pvt->rawwriteformat = ast->pvt->rawwriteformat;
res = ast_write(p->chan, f);
else
} else
res = 0;
CLEANUP(ast, p);
ast_pthread_mutex_unlock(&p->lock);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment