diff options
Diffstat (limited to 'apps/app_sayunixtime.c')
-rw-r--r-- | apps/app_sayunixtime.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/apps/app_sayunixtime.c b/apps/app_sayunixtime.c index 7d34ed9cd..3b4d2b51e 100644 --- a/apps/app_sayunixtime.c +++ b/apps/app_sayunixtime.c @@ -59,7 +59,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") <parameter name="options" required="false"> <optionlist> <option name="j"> - <para>Allow the calling user to dial digits to jump to that extension.</para> + <para>Allow the calling user to dial digits to jump to that extension. + This option is automatically enabled if + <variable>SAY_DTMF_INTERRUPT</variable> is present on the channel and + set to 'true' (case insensitive)</para> </option> </optionlist> </parameter> @@ -129,6 +132,7 @@ static int sayunixtime_exec(struct ast_channel *chan, const char *data) const char * haltondigits = AST_DIGIT_NONE; struct ast_flags64 opts = { 0, }; char *opt_args[OPT_ARG_ARRAY_SIZE]; + const char *interrupt_string; if (!data) { return 0; @@ -146,6 +150,14 @@ static int sayunixtime_exec(struct ast_channel *chan, const char *data) } } + /* Check if 'SAY_DTMF_INTERRUPT' is true and apply the same behavior as the j flag. */ + ast_channel_lock(chan); + interrupt_string = pbx_builtin_getvar_helper(chan, "SAY_DTMF_INTERRUPT"); + if (ast_true(interrupt_string)) { + haltondigits = AST_DIGIT_ANY; + } + ast_channel_unlock(chan); + ast_get_time_t(ast_strlen_zero(args.timeval) ? NULL : args.timeval, &unixtime, time(NULL), NULL); if (ast_channel_state(chan) != AST_STATE_UP) { |