aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_waitforring.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_waitforring.c')
-rw-r--r--apps/app_waitforring.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/app_waitforring.c b/apps/app_waitforring.c
index 50fba47e2..f4bae2ced 100644
--- a/apps/app_waitforring.c
+++ b/apps/app_waitforring.c
@@ -48,6 +48,7 @@ static char *app = "WaitForRing";
static int waitforring_exec(struct ast_channel *chan, void *data)
{
struct ast_frame *f;
+ struct ast_silence_generator *silgen = NULL;
int res = 0;
double s;
int ms;
@@ -57,6 +58,10 @@ static int waitforring_exec(struct ast_channel *chan, void *data)
return 0;
}
+ if (ast_opt_transmit_silence) {
+ silgen = ast_channel_start_silence_generator(chan);
+ }
+
ms = s*1000.0;
while(ms > 0) {
ms = ast_waitfor(chan, ms);
@@ -101,6 +106,10 @@ static int waitforring_exec(struct ast_channel *chan, void *data)
}
}
+ if (silgen) {
+ ast_channel_stop_silence_generator(chan, silgen);
+ }
+
return res;
}