ari: Add silence generator controls

This patch adds the ability to start a silence generator on a channel
via ARI. This generator will play silence on the channel (avoiding audio
timeouts on the peer) until it is stopped, or some other media operation
is started (like playing media, starting music on hold, etc.).

(closes issue ASTERISK-22514)
Review: https://reviewboard.asterisk.org/r/3019/
........

Merged revisions 402926 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402928 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
David M. Lee
2013-11-21 15:56:34 +00:00
parent 71612fb007
commit d1ad4a95f8
6 changed files with 318 additions and 4 deletions

View File

@@ -321,6 +321,38 @@ void ast_ari_channels_stop_moh(struct ast_variable *headers,
ast_ari_response_no_content(response);
}
void ast_ari_channels_start_silence(struct ast_variable *headers,
struct ast_ari_channels_start_silence_args *args,
struct ast_ari_response *response)
{
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
control = find_control(response, args->channel_id);
if (control == NULL) {
/* Response filled in by find_control */
return;
}
stasis_app_control_silence_start(control);
ast_ari_response_no_content(response);
}
void ast_ari_channels_stop_silence(struct ast_variable *headers,
struct ast_ari_channels_stop_silence_args *args,
struct ast_ari_response *response)
{
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
control = find_control(response, args->channel_id);
if (control == NULL) {
/* Response filled in by find_control */
return;
}
stasis_app_control_silence_stop(control);
ast_ari_response_no_content(response);
}
void ast_ari_channels_play(struct ast_variable *headers,
struct ast_ari_channels_play_args *args,
struct ast_ari_response *response)