mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-11 23:28:59 +00:00
Merged revisions 110628 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r110628 | file | 2008-03-25 11:37:35 -0300 (Tue, 25 Mar 2008) | 4 lines 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 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@110629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
1
Makefile
1
Makefile
@@ -674,6 +674,7 @@ samples: adsi
|
|||||||
echo ";cache_record_files = yes ; Cache recorded sound files to another directory during recording" ; \
|
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 ";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_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 ";transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of directly" ; \
|
||||||
echo ";runuser = asterisk ; The user to run as" ; \
|
echo ";runuser = asterisk ; The user to run as" ; \
|
||||||
echo ";rungroup = asterisk ; The group to run as" ; \
|
echo ";rungroup = asterisk ; The group to run as" ; \
|
||||||
|
@@ -64,7 +64,7 @@ enum ast_option_flags {
|
|||||||
AST_OPT_FLAG_OVERRIDE_CONFIG = (1 << 15),
|
AST_OPT_FLAG_OVERRIDE_CONFIG = (1 << 15),
|
||||||
/*! Reconnect */
|
/*! Reconnect */
|
||||||
AST_OPT_FLAG_RECONNECT = (1 << 16),
|
AST_OPT_FLAG_RECONNECT = (1 << 16),
|
||||||
/*! Transmit Silence during Record() */
|
/*! Transmit Silence during Record() and DTMF Generation */
|
||||||
AST_OPT_FLAG_TRANSMIT_SILENCE = (1 << 17),
|
AST_OPT_FLAG_TRANSMIT_SILENCE = (1 << 17),
|
||||||
/*! Suppress some warnings */
|
/*! Suppress some warnings */
|
||||||
AST_OPT_FLAG_DONT_WARN = (1 << 18),
|
AST_OPT_FLAG_DONT_WARN = (1 << 18),
|
||||||
|
@@ -244,6 +244,7 @@ int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, const ch
|
|||||||
{
|
{
|
||||||
const char *ptr;
|
const char *ptr;
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
struct ast_silence_generator *silgen = NULL;
|
||||||
|
|
||||||
if (!between)
|
if (!between)
|
||||||
between = 100;
|
between = 100;
|
||||||
@@ -258,6 +259,10 @@ int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, const ch
|
|||||||
if (res < 0)
|
if (res < 0)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
|
if (ast_opt_transmit_silence) {
|
||||||
|
silgen = ast_channel_start_silence_generator(chan);
|
||||||
|
}
|
||||||
|
|
||||||
for (ptr = digits; *ptr; ptr++) {
|
for (ptr = digits; *ptr; ptr++) {
|
||||||
if (*ptr == 'w') {
|
if (*ptr == 'w') {
|
||||||
/* 'w' -- wait half a second */
|
/* 'w' -- wait half a second */
|
||||||
@@ -284,6 +289,10 @@ int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, const ch
|
|||||||
res = -1;
|
res = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (silgen) {
|
||||||
|
ast_channel_stop_silence_generator(chan, silgen);
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2633,8 +2633,8 @@ static void ast_readconfig(void)
|
|||||||
/* Build transcode paths via SLINEAR, instead of directly */
|
/* Build transcode paths via SLINEAR, instead of directly */
|
||||||
} else if (!strcasecmp(v->name, "transcode_via_sln")) {
|
} else if (!strcasecmp(v->name, "transcode_via_sln")) {
|
||||||
ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_TRANSCODE_VIA_SLIN);
|
ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_TRANSCODE_VIA_SLIN);
|
||||||
/* Transmit SLINEAR silence while a channel is being recorded */
|
/* 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")) {
|
} 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);
|
ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_TRANSMIT_SILENCE);
|
||||||
/* Enable internal timing */
|
/* Enable internal timing */
|
||||||
} else if (!strcasecmp(v->name, "internal_timing")) {
|
} else if (!strcasecmp(v->name, "internal_timing")) {
|
||||||
|
Reference in New Issue
Block a user