diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-11-01 17:22:25 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-11-01 17:22:25 +0000 |
commit | cd7ee5f7cd6d49a4ed351fa7df55c2ca3289de89 (patch) | |
tree | b24f65814e64ea93c42d8db91cbc40459344bbc7 /app.c | |
parent | dced94c17e806027133032e9c1083a2b98fdf790 (diff) |
optionally send silence during recording (issue #5135)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6925 f38db490-d61c-443f-a65b-d21fe96a405b
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++) { |