aboutsummaryrefslogtreecommitdiffstats
path: root/main/app.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/app.c')
-rw-r--r--main/app.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/main/app.c b/main/app.c
index 7a2227fb9..ee72d1078 100644
--- a/main/app.c
+++ b/main/app.c
@@ -244,6 +244,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;
@@ -258,6 +259,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 */
@@ -284,6 +289,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;
}