return -1;
}
- if (ast_asprintf(playback_url, "/playback/%s",
+ if (ast_asprintf(playback_url, "/playbacks/%s",
stasis_app_playback_get_id(playback)) == -1) {
playback_url = NULL;
ast_ari_response_alloc_failed(response);
return;
}
- if (ast_asprintf(&playback_url, "/playback/%s",
+ if (ast_asprintf(&playback_url, "/playbacks/%s",
stasis_app_playback_get_id(playback)) == -1) {
playback_url = NULL;
ast_ari_response_error(
void ast_ari_response_created(struct ast_ari_response *response,
const char *url, struct ast_json *message)
{
+ RAII_VAR(struct stasis_rest_handlers *, root, get_root_handler(), ao2_cleanup);
response->message = message;
response->response_code = 201;
response->response_text = "Created";
- ast_str_append(&response->headers, 0, "Location: %s\r\n", url);
+ ast_str_append(&response->headers, 0, "Location: /%s%s\r\n", root->path_segment, url);
}
static void add_allow_header(struct stasis_rest_handlers *handler,