Skip to content
Snippets Groups Projects
Commit 1a934e00 authored by Matthew Jordan's avatar Matthew Jordan
Browse files

res/res_monitor: Reset in/out sample counts on Monitor start

When repeatedly starting/stopping a Monitor on a channel, the accumulated
in/out sample counts are never reset to 0. This can cause inadvertent jumps
in the recordings, as the code in the channel core will determine incorrectly
that a jump in the recorded file position should occur. Setting the sample
counts to 0 simply reflects the initial state a Monitor should be in when it
is started, as this is the initial count that would be on the channels at that
time.

ASTERISK-24573 #close
Reported by: Nuno Borges
patches:
  24573.patch uploaded by Nuno Borges (License 6116)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@429031 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent c02beb10
No related branches found
No related tags found
No related merge requests found
......@@ -388,6 +388,8 @@ int AST_OPTIONAL_API_NAME(ast_monitor_start)(struct ast_channel *chan, const cha
} else
monitor->write_stream = NULL;
ast_channel_insmpl_set(chan, 0);
ast_channel_outsmpl_set(chan, 0);
ast_channel_monitor_set(chan, monitor);
ast_monitor_set_state(chan, AST_MONITOR_RUNNING);
/* so we know this call has been monitored in case we need to bill for it or something */
......
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