diff options
author | Joshua Colp <jcolp@digium.com> | 2014-04-30 12:42:42 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2014-04-30 12:42:42 +0000 |
commit | 10f4d0f65dd8adcd33031e1bf87c9bcf8dd472d1 (patch) | |
tree | 777b680bcf746ea26a426d174f5c3c9d9e6b8d19 /res/stasis/control.c | |
parent | 7378d3e054136e2fb7e5a994f93621ecf51e8917 (diff) |
res_stasis: Add progress indications to operations which perform media.
This change fixes operations which did not account for the fact that they may
be executed on channels which have not been answered. These operations will
now indicate progress when invoked.
ASTERISK-23560 #close
ASTERISk-23560 #comment Reported by: Jan Svoboda
Review: https://reviewboard.asterisk.org/r/3495/
........
Merged revisions 413121 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/stasis/control.c')
-rw-r--r-- | res/stasis/control.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/res/stasis/control.c b/res/stasis/control.c index 88ef8969d..8802e8128 100644 --- a/res/stasis/control.c +++ b/res/stasis/control.c @@ -444,6 +444,10 @@ static int app_control_dtmf(struct stasis_app_control *control, { RAII_VAR(struct stasis_app_control_dtmf_data *, dtmf_data, data, ast_free); + if (ast_channel_state(chan) != AST_STATE_UP) { + ast_indicate(chan, AST_CONTROL_PROGRESS); + } + if (dtmf_data->before) { ast_safe_sleep(chan, dtmf_data->before); } @@ -629,6 +633,10 @@ static int app_control_moh_start(struct stasis_app_control *control, { char *moh_class = data; + if (ast_channel_state(chan) != AST_STATE_UP) { + ast_indicate(chan, AST_CONTROL_PROGRESS); + } + ast_moh_start(chan, moh_class, NULL); ast_free(moh_class); @@ -661,6 +669,10 @@ void stasis_app_control_moh_stop(struct stasis_app_control *control) static int app_control_silence_start(struct stasis_app_control *control, struct ast_channel *chan, void *data) { + if (ast_channel_state(chan) != AST_STATE_UP) { + ast_indicate(chan, AST_CONTROL_PROGRESS); + } + if (control->silgen) { /* We have a silence generator, but it may have been implicitly * disabled by media actions (music on hold, playing media, |