diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2005-11-01 17:22:25 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2005-11-01 17:22:25 +0000 |
commit | 03ceef35ac9572e64a596d0094b800e25fda7e0d (patch) | |
tree | b24f65814e64ea93c42d8db91cbc40459344bbc7 /app.c | |
parent | 236ce8f796d1cba6c4eecea243512ac04909ee20 (diff) |
optionally send silence during recording (issue #5135)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'app.c')
-rwxr-xr-x | app.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -560,6 +560,7 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch int dspsilence = 0; int gotsilence = 0; /* did we timeout for silence? */ int rfmt=0; + struct ast_silence_generator *silgen = NULL; if (silencethreshold < 0) silencethreshold = global_silence_threshold; @@ -615,8 +616,6 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch if (path) ast_unlock_path(path); - - if (maxsilence > 0) { sildet = ast_dsp_new(); /* Create the silence detector */ if (!sildet) { @@ -632,9 +631,13 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch return -1; } } + /* Request a video update */ ast_indicate(chan, AST_CONTROL_VIDUPDATE); + if (option_transmit_silence_during_record) + silgen = ast_channel_start_silence_generator(chan); + if (x == fmtcnt) { /* Loop forever, writing the packets we read to the writer(s), until we read a # or get a hangup */ @@ -735,6 +738,9 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch ast_log(LOG_WARNING, "Error creating writestream '%s', format '%s'\n", recordfile, sfmt[x]); } + if (silgen) + ast_channel_stop_silence_generator(chan, silgen); + *duration = end - start; for (x=0;x<fmtcnt;x++) { |