aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-25 14:37:35 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-25 14:37:35 +0000
commit056d568497159e15618aa29880451dbc1fcd8291 (patch)
tree038be7bb73b82f4bb5579aa837a796390f0f07ed /main
parent558a908c4bfb98f337b9307c6a5a06516b2bc5ea (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@110628 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/app.c9
-rw-r--r--main/asterisk.c4
2 files changed, 11 insertions, 2 deletions
diff --git a/main/app.c b/main/app.c
index a71f46adc..ffad73507 100644
--- a/main/app.c
+++ b/main/app.c
@@ -215,6 +215,7 @@ int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, const ch
{
const char *ptr;
int res = 0;
+ struct ast_silence_generator *silgen = NULL;
if (!between)
between = 100;
@@ -229,6 +230,10 @@ int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, const ch
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') {
/* 'w' -- wait half a second */
@@ -255,6 +260,10 @@ int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, const ch
res = -1;
}
+ if (silgen) {
+ ast_channel_stop_silence_generator(chan, silgen);
+ }
+
return res;
}
diff --git a/main/asterisk.c b/main/asterisk.c
index 77d1489ff..b4eeedb5c 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -2483,8 +2483,8 @@ static void ast_readconfig(void)
/* 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")) {