summaryrefslogtreecommitdiff
path: root/res/stasis_http
diff options
context:
space:
mode:
authorJason Parker <jparker@digium.com>2013-07-01 18:56:21 +0000
committerJason Parker <jparker@digium.com>2013-07-01 18:56:21 +0000
commitf820d24db14e657a4c0fc7c6d4c1c73ef4c8f86a (patch)
treeec2cdb3992f9101c02bfa56b6f4edd9555e6ab98 /res/stasis_http
parentf41faf0b7dc4c7bb683f9a81b4c09dcfeeef2119 (diff)
ARI: Implement channel hold/unhold.
This puts the channel on hold (rather than queueing a frame from the channel). (closes issue ASTERISK-21619) Review: https://reviewboard.asterisk.org/r/2647/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393332 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/stasis_http')
-rw-r--r--res/stasis_http/resource_channels.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/res/stasis_http/resource_channels.c b/res/stasis_http/resource_channels.c
index aeeafa705..0fbb75487 100644
--- a/res/stasis_http/resource_channels.c
+++ b/res/stasis_http/resource_channels.c
@@ -150,11 +150,32 @@ void stasis_http_unmute_channel(struct ast_variable *headers, struct ast_unmute_
}
void stasis_http_hold_channel(struct ast_variable *headers, struct ast_hold_channel_args *args, struct stasis_http_response *response)
{
- ast_log(LOG_ERROR, "TODO: stasis_http_hold_channel\n");
+ 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_hold(control);
+
+ stasis_http_response_no_content(response);
}
+
void stasis_http_unhold_channel(struct ast_variable *headers, struct ast_unhold_channel_args *args, struct stasis_http_response *response)
{
- ast_log(LOG_ERROR, "TODO: stasis_http_unhold_channel\n");
+ 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_unhold(control);
+
+ stasis_http_response_no_content(response);
}
void stasis_http_play_on_channel(struct ast_variable *headers,