[asterisk-commits] file: branch 1.4 r110628 - in /branches/1.4: ./ include/asterisk/ main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Mar 25 09:37:35 CDT 2008
Author: file
Date: Tue Mar 25 09:37:35 2008
New Revision: 110628
URL: http://svn.digium.com/view/asterisk?view=rev&rev=110628
Log:
Add an option (transmit_silence) which transmits silence during both Record() and DTMF generation. The reason this is an option is that in order to transmit silence we have to setup a translation path. This may not be needed/wanted in all cases.
(closes issue #10058)
Reported by: tracinet
Modified:
branches/1.4/Makefile
branches/1.4/include/asterisk/options.h
branches/1.4/main/app.c
branches/1.4/main/asterisk.c
Modified: branches/1.4/Makefile
URL: http://svn.digium.com/view/asterisk/branches/1.4/Makefile?view=diff&rev=110628&r1=110627&r2=110628
==============================================================================
--- branches/1.4/Makefile (original)
+++ branches/1.4/Makefile Tue Mar 25 09:37:35 2008
@@ -601,6 +601,7 @@
echo ";cache_record_files = yes ; Cache recorded sound files to another directory during recording" ; \
echo ";record_cache_dir = /tmp ; Specify cache directory (used in cnjunction with cache_record_files)" ; \
echo ";transmit_silence_during_record = yes ; Transmit SLINEAR silence while a channel is being recorded" ; \
+ echo ";transmit_silence = yes ; Transmit SLINEAR silence while a channel is being recorded or DTMF is being generated" ; \
echo ";transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of directly" ; \
echo ";runuser = asterisk ; The user to run as" ; \
echo ";rungroup = asterisk ; The group to run as" ; \
Modified: branches/1.4/include/asterisk/options.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/options.h?view=diff&rev=110628&r1=110627&r2=110628
==============================================================================
--- branches/1.4/include/asterisk/options.h (original)
+++ branches/1.4/include/asterisk/options.h Tue Mar 25 09:37:35 2008
@@ -66,7 +66,7 @@
AST_OPT_FLAG_OVERRIDE_CONFIG = (1 << 15),
/*! Reconnect */
AST_OPT_FLAG_RECONNECT = (1 << 16),
- /*! Transmit Silence during Record() */
+ /*! Transmit Silence during Record() and DTMF Generation */
AST_OPT_FLAG_TRANSMIT_SILENCE = (1 << 17),
/*! Suppress some warnings */
AST_OPT_FLAG_DONT_WARN = (1 << 18),
Modified: branches/1.4/main/app.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/app.c?view=diff&rev=110628&r1=110627&r2=110628
==============================================================================
--- branches/1.4/main/app.c (original)
+++ branches/1.4/main/app.c Tue Mar 25 09:37:35 2008
@@ -215,6 +215,7 @@
{
const char *ptr;
int res = 0;
+ struct ast_silence_generator *silgen = NULL;
if (!between)
between = 100;
@@ -228,6 +229,10 @@
/* ast_waitfor will return the number of remaining ms on success */
if (res < 0)
return res;
+
+ if (ast_opt_transmit_silence) {
+ silgen = ast_channel_start_silence_generator(chan);
+ }
for (ptr = digits; *ptr; ptr++) {
if (*ptr == 'w') {
@@ -253,6 +258,10 @@
that has occurred previously while acting on the primary channel */
if (ast_autoservice_stop(peer) && !res)
res = -1;
+ }
+
+ if (silgen) {
+ ast_channel_stop_silence_generator(chan, silgen);
}
return res;
Modified: branches/1.4/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/asterisk.c?view=diff&rev=110628&r1=110627&r2=110628
==============================================================================
--- branches/1.4/main/asterisk.c (original)
+++ branches/1.4/main/asterisk.c Tue Mar 25 09:37:35 2008
@@ -2483,8 +2483,8 @@
/* Build transcode paths via SLINEAR, instead of directly */
} else if (!strcasecmp(v->name, "transcode_via_sln")) {
ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_TRANSCODE_VIA_SLIN);
- /* Transmit SLINEAR silence while a channel is being recorded */
- } else if (!strcasecmp(v->name, "transmit_silence_during_record")) {
+ /* Transmit SLINEAR silence while a channel is being recorded or DTMF is being generated on a channel */
+ } else if (!strcasecmp(v->name, "transmit_silence_during_record") || !strcasecmp(v->name, "transmit_silence")) {
ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_TRANSMIT_SILENCE);
/* Enable internal timing */
} else if (!strcasecmp(v->name, "internal_timing")) {
More information about the asterisk-commits
mailing list