mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 16:50:14 +00:00
don't write frames out to channel until after sending them to spies and/or monitor, since the channel driver might modify the frame data in the buffer (bug #4623)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6035 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1885,8 +1885,6 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr)
|
|||||||
} else
|
} else
|
||||||
f = fr;
|
f = fr;
|
||||||
if (f) {
|
if (f) {
|
||||||
res = chan->tech->write(chan, f);
|
|
||||||
|
|
||||||
if (f->frametype == AST_FRAME_VOICE && chan->spiers) {
|
if (f->frametype == AST_FRAME_VOICE && chan->spiers) {
|
||||||
struct ast_channel_spy *spying;
|
struct ast_channel_spy *spying;
|
||||||
for (spying = chan->spiers; spying; spying=spying->next) {
|
for (spying = chan->spiers; spying; spying=spying->next) {
|
||||||
@@ -1917,6 +1915,8 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr)
|
|||||||
if (ast_writestream(chan->monitor->write_stream, f) < 0)
|
if (ast_writestream(chan->monitor->write_stream, f) < 0)
|
||||||
ast_log(LOG_WARNING, "Failed to write data to channel monitor write stream\n");
|
ast_log(LOG_WARNING, "Failed to write data to channel monitor write stream\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
res = chan->tech->write(chan, f);
|
||||||
} else
|
} else
|
||||||
res = 0;
|
res = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user