Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
/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. More... | |
static int | append_sound_cb (void *obj, void *arg, void *data, int flags) |
Generate a Sound structure and append it to the output blob. More... | |
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. More... | |
static int | filter_langs_cb (void *obj, void *arg, int flags) |
Filter out all languages not matching the specified language. More... | |
/api-docs/sounds.{format} implementation- Sound resources
Definition in file resource_sounds.c.
|
static |
Add format/lang pairs to the array embedded in the sound object.
Definition at line 43 of file resource_sounds.c.
References ao2_cleanup, ao2_ref, args, ast_format_cap_count(), ast_format_cap_get_format(), ast_format_get_name(), ast_json_array_append(), ast_json_pack(), ast_media_get_format_cap(), ast_strlen_zero(), CMP_STOP, language, NULL, and RAII_VAR.
Referenced by create_sound_blob().
|
static |
Generate a Sound structure and append it to the output blob.
Definition at line 166 of file resource_sounds.c.
References sounds_cb_data::args, ast_json_array_append(), create_sound_blob(), and sounds_cb_data::index.
Referenced by ast_ari_sounds_list().
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 ao2_cleanup, args, ast_ari_response_error(), ast_ari_response_ok(), ast_sounds_get_index_for_file(), create_sound_blob(), and NULL.
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 ao2_callback_data, ao2_cleanup, append_sound_cb(), sounds_cb_data::args, args, 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(), NULL, OBJ_NODATA, and RAII_VAR.
Referenced by ast_ari_sounds_list_cb().
|
static |
Generate a Sound structure as documented in sounds.json for the specified filename.
Definition at line 97 of file resource_sounds.c.
References add_format_information_cb(), ao2_callback, ao2_callback_data, ao2_cleanup, ao2_container_count(), args, ast_json_array_size(), ast_json_object_get(), ast_json_pack(), ast_json_ref(), ast_json_unref(), ast_media_get_description(), ast_media_get_variants(), ast_strdupa, ast_strlen_zero(), lang_format_info::filename, filter_langs_cb(), sip_to_pjsip::info(), NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, and RAII_VAR.
Referenced by append_sound_cb(), and ast_ari_sounds_get().
|
static |
Filter out all languages not matching the specified language.
Definition at line 86 of file resource_sounds.c.
References CMP_MATCH.
Referenced by create_sound_blob().