summaryrefslogtreecommitdiff
path: root/channel.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2005-07-05 22:21:54 +0000
committerKevin P. Fleming <kpfleming@digium.com>2005-07-05 22:21:54 +0000
commit6797e6334f75a62a33469cae29774662c1fc1cd3 (patch)
tree668c1e724d6e6b458bdc1a45abbd044fa00e060d /channel.c
parent054317fb13d8c871759c07c4edd330bbb84aa4d5 (diff)
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
Diffstat (limited to 'channel.c')
-rwxr-xr-xchannel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/channel.c b/channel.c
index 5fa5d3697..04b77af27 100755
--- a/channel.c
+++ b/channel.c
@@ -1885,8 +1885,6 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr)
} else
f = fr;
if (f) {
- res = chan->tech->write(chan, f);
-
if (f->frametype == AST_FRAME_VOICE && chan->spiers) {
struct ast_channel_spy *spying;
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)
ast_log(LOG_WARNING, "Failed to write data to channel monitor write stream\n");
}
+
+ res = chan->tech->write(chan, f);
} else
res = 0;
}