Asterisk - The Open Source Telephony Project
18.5.0
|
Internal API's for res_ari. More...
Go to the source code of this file.
Data Structures | |
struct | ast_ari_conf |
All configuration options for ARI. More... | |
struct | ast_ari_conf_general |
Global configuration options for ARI. More... | |
struct | ast_ari_conf_user |
Per-user configuration options. More... | |
Functions | |
void | ari_handle_websocket (struct ast_websocket_server *ws_server, struct ast_tcptls_session_instance *ser, const char *uri, enum ast_http_method method, struct ast_variable *get_params, struct ast_variable *headers) |
Wrapper for invoking the websocket code for an incoming connection. More... | |
int | ast_ari_cli_register (void) |
Register CLI commands for ARI. More... | |
void | ast_ari_cli_unregister (void) |
Unregister CLI commands for ARI. More... | |
#define | ARI_AUTH_REALM_LEN 80 |
#define | ARI_PASSWORD_LEN 256 |
User's password mx length. More... | |
enum | ast_ari_password_format { ARI_PASSWORD_FORMAT_PLAIN, ARI_PASSWORD_FORMAT_CRYPT } |
Password format. More... | |
int | ast_ari_config_init (void) |
Initialize the ARI configuration. More... | |
int | ast_ari_config_reload (void) |
Reload the ARI configuration. More... | |
void | ast_ari_config_destroy (void) |
Destroy the ARI configuration. More... | |
struct ast_ari_conf * | ast_ari_config_get (void) |
Get the current ARI configuration. More... | |
struct ast_ari_conf_user * | ast_ari_config_validate_user (const char *username, const char *password) |
Validated a user's credentials. More... | |
Internal API's for res_ari.
Definition in file internal.h.
#define ARI_AUTH_REALM_LEN 80 |
Max length for auth_realm field
Definition at line 62 of file internal.h.
Referenced by ast_ari_config_init().
#define ARI_PASSWORD_LEN 256 |
User's password mx length.
If 256 seems like a lot, a crypt SHA-512 has over 106 characters.
Definition at line 93 of file internal.h.
Referenced by ast_ari_config_init().
Password format.
Enumerator | |
---|---|
ARI_PASSWORD_FORMAT_PLAIN | Plaintext password. |
ARI_PASSWORD_FORMAT_CRYPT | crypt(3) password |
Definition at line 81 of file internal.h.
void ari_handle_websocket | ( | struct ast_websocket_server * | ws_server, |
struct ast_tcptls_session_instance * | ser, | ||
const char * | uri, | ||
enum ast_http_method | method, | ||
struct ast_variable * | get_params, | ||
struct ast_variable * | headers | ||
) |
Wrapper for invoking the websocket code for an incoming connection.
ws_server | WebSocket server to invoke. |
ser | HTTP session. |
uri | Requested URI. |
method | Requested HTTP method. |
get_params | Parsed query parameters. |
headers | Parsed HTTP headers. |
Definition at line 191 of file ari_websockets.c.
References ast_websocket_uri_cb(), and ast_http_uri::data.
Referenced by ast_ari_invoke().
int ast_ari_cli_register | ( | void | ) |
Register CLI commands for ARI.
Definition at line 434 of file res/ari/cli.c.
References ARRAY_LEN, and ast_cli_register_multiple.
Referenced by load_module().
void ast_ari_cli_unregister | ( | void | ) |
Unregister CLI commands for ARI.
Definition at line 438 of file res/ari/cli.c.
References ARRAY_LEN, and ast_cli_unregister_multiple().
Referenced by unload_module().
void ast_ari_config_destroy | ( | void | ) |
Destroy the ARI configuration.
Definition at line 383 of file res/ari/config.c.
References aco_info_destroy(), and ao2_global_obj_release.
Referenced by unload_module().
struct ast_ari_conf* ast_ari_config_get | ( | void | ) |
Get the current ARI configuration.
This is an immutable object, so don't modify it. It is AO2 managed, so ao2_cleanup() when you're done with it.
NULL
on error. Definition at line 227 of file res/ari/config.c.
References ao2_global_obj_ref, ast_log, CONF_FILENAME, and LOG_ERROR.
Referenced by ari_show(), ari_show_user(), ari_show_users(), ast_ari_callback(), ast_ari_config_validate_user(), ast_ari_json_format(), ast_ari_websocket_session_create(), complete_ari_user(), is_enabled(), origin_allowed(), and process_config().
int ast_ari_config_init | ( | void | ) |
Initialize the ARI configuration.
Definition at line 337 of file res/ari/config.c.
References ACO_EXACT, aco_info_destroy(), aco_info_init(), aco_option_register, aco_option_register_custom, ARI_AUTH_REALM_LEN, ARI_PASSWORD_LEN, AST_DEFAULT_WEBSOCKET_WRITE_TIMEOUT_STR, channelvars_handler(), enabled, encoding_format_handler(), FLDSET, NULL, OPT_BOOL_T, OPT_CHAR_ARRAY_T, OPT_INT_T, OPT_NOOP_T, OPT_STRINGFIELD_T, PARSE_IN_RANGE, password, password_format_handler(), process_config(), ast_ari_conf_user::read_only, and STRFLDSET.
Referenced by load_module().
int ast_ari_config_reload | ( | void | ) |
Reload the ARI configuration.
Definition at line 378 of file res/ari/config.c.
References process_config().
Referenced by reload_module().
struct ast_ari_conf_user* ast_ari_config_validate_user | ( | const char * | username, |
const char * | password | ||
) |
Validated a user's credentials.
username | Name of the user. |
password | User's password. |
NULL
if username or password is invalid. Definition at line 237 of file res/ari/config.c.
References ao2_cleanup, ao2_find, ao2_ref, ARI_PASSWORD_FORMAT_CRYPT, ARI_PASSWORD_FORMAT_PLAIN, ast_ari_config_get(), ast_crypt_validate(), ast_log, ast_strlen_zero, LOG_WARNING, NULL, OBJ_SEARCH_KEY, RAII_VAR, and user.
Referenced by authenticate_api_key(), and authenticate_user().