diff options
author | misha <mishadaut@gmail.com> | 2016-11-11 14:13:30 +0100 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2016-11-17 12:32:29 -0500 |
commit | e822a50f86e85b023c1c90a352af21a5fd83d7c6 (patch) | |
tree | ba3acbcda13069a95847cf615771823028470155 /main/app.c | |
parent | d3dba74017c6f923f52ddab1c6a03557b18de5ad (diff) |
main/app.c: Transmit Silence on ControlPlayback pause
ASTERISK-26562 #close
Change-Id: Ie6cb0ffc2b8c775639ce7784fe96f4ea00cfa2f8
Diffstat (limited to 'main/app.c')
-rw-r--r-- | main/app.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/main/app.c b/main/app.c index 621153e25..f2e3a0fe0 100644 --- a/main/app.c +++ b/main/app.c @@ -1071,6 +1071,7 @@ static int control_streamfile(struct ast_channel *chan, int res; long pause_restart_point = 0; long offset = 0; + struct ast_silence_generator *silgen = NULL; if (!file) { return -1; @@ -1161,6 +1162,10 @@ static int control_streamfile(struct ast_channel *chan, if ((suspend && strchr(suspend, res)) || res == AST_CONTROL_STREAM_SUSPEND) { pause_restart_point = ast_tellstream(ast_channel_stream(chan)); + + if (ast_opt_transmit_silence) { + silgen = ast_channel_start_silence_generator(chan); + } ast_test_suite_event_notify("PLAYBACK","Channel: %s\r\n" "Control: %s\r\n", ast_channel_name(chan), @@ -1174,6 +1179,11 @@ static int control_streamfile(struct ast_channel *chan, break; } } + if (silgen) { + ast_channel_stop_silence_generator(chan, silgen); + silgen = NULL; + } + if ((suspend && (res == *suspend)) || res == AST_CONTROL_STREAM_SUSPEND) { res = 0; ast_test_suite_event_notify("PLAYBACK","Channel: %s\r\n" |