Example #1
0
void ast_ari_get_stored_sound(struct ast_variable *headers, struct ast_get_stored_sound_args *args, struct ast_ari_response *response)
{
	struct ast_json *sound_blob;

	sound_blob = create_sound_blob(args->sound_id, NULL);
	if (!sound_blob) {
		ast_ari_response_error(response, 404, "Not Found", "Sound not found");
		return;
	}

	ast_ari_response_ok(response, sound_blob);
}
Example #2
0
/*! \brief Generate a Sound structure and append it to the output blob */
static int append_sound_cb(void *obj, void *arg, void *data, int flags)
{
	struct ast_json *sounds_array = arg;
	char *filename = obj;
	struct ast_ari_sounds_list_args *args = data;
	struct ast_json *sound_blob = create_sound_blob(filename, args);
	if (!sound_blob) {
		return 0;
	}

	ast_json_array_append(sounds_array, sound_blob);
	return 0;
}