Asterisk - The Open Source Telephony Project
21.4.1
|
/api-docs/sounds.{format} implementation- Sound resources More...
#include "asterisk.h"
#include "resource_sounds.h"
#include "asterisk/media_index.h"
#include "asterisk/sounds_index.h"
#include "asterisk/format.h"
#include "asterisk/format_cap.h"
#include "asterisk/json.h"
Go to the source code of this file.
Data Structures | |
struct | lang_format_info |
arguments that are necessary for adding format/lang pairs More... | |
struct | sounds_cb_data |
Functions | |
static int | add_format_information_cb (void *obj, void *arg, void *data, int flags) |
Add format/lang pairs to the array embedded in the sound object. | |
static int | append_sound_cb (void *obj, void *arg, void *data, int flags) |
Generate a Sound structure and append it to the output blob. | |
void | ast_ari_sounds_get (struct ast_variable *headers, struct ast_ari_sounds_get_args *args, struct ast_ari_response *response) |
Get a sound's details. More... | |
void | ast_ari_sounds_list (struct ast_variable *headers, struct ast_ari_sounds_list_args *args, struct ast_ari_response *response) |
List all sounds. More... | |
static struct ast_json * | create_sound_blob (const char *filename, struct ast_ari_sounds_list_args *args, struct ast_media_index *sounds_index) |
Generate a Sound structure as documented in sounds.json for the specified filename. | |
static int | filter_langs_cb (void *obj, void *arg, int flags) |
Filter out all languages not matching the specified language. | |
/api-docs/sounds.{format} implementation- Sound resources
Definition in file resource_sounds.c.
void ast_ari_sounds_get | ( | struct ast_variable * | headers, |
struct ast_ari_sounds_get_args * | args, | ||
struct ast_ari_response * | response | ||
) |
Get a sound's details.
headers | HTTP headers | |
args | Swagger parameters | |
[out] | response | HTTP response |
Definition at line 220 of file resource_sounds.c.
References ast_ari_response_error(), ast_ari_response_ok(), ast_sounds_get_index_for_file(), create_sound_blob(), and ast_ari_sounds_get_args::sound_id.
Referenced by ast_ari_sounds_get_cb().
void ast_ari_sounds_list | ( | struct ast_variable * | headers, |
struct ast_ari_sounds_list_args * | args, | ||
struct ast_ari_response * | response | ||
) |
List all sounds.
headers | HTTP headers | |
args | Swagger parameters | |
[out] | response | HTTP response |
Definition at line 180 of file resource_sounds.c.
References append_sound_cb(), ast_ari_response_error(), ast_ari_response_ok(), ast_json_array_create(), ast_json_array_size(), ast_json_unref(), ast_media_get_media(), ast_sounds_get_index(), OBJ_NODATA, and RAII_VAR.
Referenced by ast_ari_sounds_list_cb().