mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
This patch implements the REST API's for POST /channels/{channelId}/play
and GET /playback/{playbackId}. This allows an external application to initiate playback of a sound on a channel while the channel is in the Stasis application. /play commands are issued asynchronously, and return immediately with the URL of the associated /playback resource. Playback commands queue up, playing in succession. The /playback resource shows the state of a playback operation as enqueued, playing or complete. (Although the operation will only be in the 'complete' state for a very short time, since it is almost immediately freed up). (closes issue ASTERISK-21283) (closes issue ASTERISK-21586) Review: https://reviewboard.asterisk.org/r/2531/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -330,6 +330,15 @@ void stasis_http_response_alloc_failed(struct stasis_http_response *response)
|
||||
response->response_text = "Internal Server Error";
|
||||
}
|
||||
|
||||
void stasis_http_response_created(struct stasis_http_response *response,
|
||||
const char *url)
|
||||
{
|
||||
response->message = ast_json_null();
|
||||
response->response_code = 201;
|
||||
response->response_text = "Created";
|
||||
ast_str_append(&response->headers, 0, "Location: %s\r\n", url);
|
||||
}
|
||||
|
||||
static void add_allow_header(struct stasis_rest_handlers *handler,
|
||||
struct stasis_http_response *response)
|
||||
{
|
||||
|
Reference in New Issue
Block a user