73 if (!lang_format_pair) {
88 char *lang_filter = arg;
90 if (strcmp(lang, lang_filter)) {
102 const char *description;
126 if (!format_lang_list) {
145 info.format_list = format_lang_list;
168 struct ast_json *sounds_array = arg;
169 char *filename = obj;
189 .index = sounds_index,
void ast_ari_response_error(struct ast_ari_response *response, int response_code, const char *response_text, const char *message_fmt,...)
Fill in an error ast_ari_response.
void ast_ari_response_ok(struct ast_ari_response *response, struct ast_json *message)
Fill in an OK (200) ast_ari_response.
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ao2_callback(c, flags, cb_fn, arg)
ao2_callback() is a generic function that applies cb_fn() to all objects in a container,...
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
#define ao2_callback_data(container, flags, cb_fn, arg, data)
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
static char language[MAX_LANGUAGE]
Asterisk JSON abstraction layer.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
int ast_json_array_append(struct ast_json *array, struct ast_json *value)
Append to an array.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
struct ast_json * ast_json_array_create(void)
Create a empty JSON array.
struct ast_json * ast_json_ref(struct ast_json *value)
Increase refcount on value.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
size_t ast_json_array_size(const struct ast_json *array)
Get the size of a JSON array.
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.
static int filter_langs_cb(void *obj, void *arg, int flags)
Filter out all languages not matching the specified language.
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.
void ast_ari_sounds_list(struct ast_variable *headers, struct ast_ari_sounds_list_args *args, struct ast_ari_response *response)
List all sounds.
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.
Generated file - declares stubs to be implemented in res/ari/resource_sounds.c.
Sound file format and description indexer.
struct ast_media_index * ast_sounds_get_index(void)
Get the sounds index.
struct ast_media_index * ast_sounds_get_index_for_file(const char *filename)
Get the index for a specific sound file.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Abstract JSON element (object, array, string, int, ...).
Structure for variables, used for configurations and for channel variables.
struct ast_media_index * index
struct ast_ari_sounds_list_args * args
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.