Asterisk - The Open Source Telephony Project GIT-master-fe341c2
|
Go to the source code of this file.
Data Structures | |
struct | ast_websocket_client |
Macros | |
#define | AST_WS_CLIENT_FIELD_USER_START 24 |
Enumerations | |
enum | ast_ws_client_fields { AST_WS_CLIENT_FIELD_NONE = 0 , AST_WS_CLIENT_FIELD_URI = (1 << 0) , AST_WS_CLIENT_FIELD_PROTOCOLS = (1 << 1) , AST_WS_CLIENT_FIELD_USERNAME = (1 << 3) , AST_WS_CLIENT_FIELD_PASSWORD = (1 << 4) , AST_WS_CLIENT_FIELD_TLS_ENABLED = (1 << 7) , AST_WS_CLIENT_FIELD_CA_LIST_FILE = (1 << 8) , AST_WS_CLIENT_FIELD_CA_LIST_PATH = (1 << 9) , AST_WS_CLIENT_FIELD_CERT_FILE = (1 << 10) , AST_WS_CLIENT_FIELD_PRIV_KEY_FILE = (1 << 11) , AST_WS_CLIENT_FIELD_CONNECTION_TYPE = (1 << 13) , AST_WS_CLIENT_FIELD_RECONNECT_INTERVAL = (1 << 14) , AST_WS_CLIENT_FIELD_RECONNECT_ATTEMPTS = (1 << 15) , AST_WS_CLIENT_FIELD_CONNECTION_TIMEOUT = (1 << 16) , AST_WS_CLIENT_FIELD_VERIFY_SERVER_CERT = (1 << 17) , AST_WS_CLIENT_FIELD_VERIFY_SERVER_HOSTNAME = (1 << 18) , AST_WS_CLIENT_NEEDS_RECONNECT } |
Functions | |
struct ast_websocket * | ast_websocket_client_connect (struct ast_websocket_client *wc, void *lock_obj, const char *display_name, enum ast_websocket_result *result) |
Connect to a websocket server using the configured authentication, retry and TLS options. More... | |
enum ast_ws_client_fields | ast_websocket_client_get_field_diff (struct ast_websocket_client *old_wc, struct ast_websocket_client *new_wc) |
Detect changes between two websocket client configurations. More... | |
int | ast_websocket_client_observer_add (const struct ast_sorcery_observer *callbacks) |
Add sorcery observers for websocket client events. More... | |
void | ast_websocket_client_observer_remove (const struct ast_sorcery_observer *callbacks) |
Remove sorcery observers for websocket client events. More... | |
int | ast_websocket_client_reload (void) |
Force res_websocket_client to reload its configuration. More... | |
struct ao2_container * | ast_websocket_client_retrieve_all (void) |
Retrieve a container of all websocket client objects. More... | |
struct ast_websocket_client * | ast_websocket_client_retrieve_by_id (const char *id) |
Retrieve a websocket client object by ID. More... | |
#define AST_WS_CLIENT_FIELD_USER_START 24 |
Definition at line 54 of file websocket_client.h.
enum ast_ws_client_fields |
Definition at line 25 of file websocket_client.h.
struct ast_websocket * ast_websocket_client_connect | ( | struct ast_websocket_client * | wc, |
void * | lock_obj, | ||
const char * | display_name, | ||
enum ast_websocket_result * | result | ||
) |
Connect to a websocket server using the configured authentication, retry and TLS options.
wc | A pointer to the ast_websocket_structure |
lock_obj | A pointer to an ao2 object to lock while the connection is being attempted or NULL if no locking is needed. |
display_name | An id string to use for logging messages. If NULL or empty the connection's ID will be used. |
result | A pointer to an enum ast_websocket_result to store the result of the connection attempt. |
Definition at line 240 of file res_websocket_client.c.
References ao2_lock, ao2_unlock, ast_calloc, ast_log, ast_set2_flag, ast_sorcery_object_get_id(), AST_SSL_DONT_VERIFY_SERVER, AST_SSL_IGNORE_COMMON_NAME, ast_strdup, ast_strlen_zero(), ast_websocket_client_create_with_options(), ast_websocket_result_to_str(), AST_WS_TYPE_CLIENT_PERSISTENT, ast_websocket_client::ca_list_file, ast_websocket_client::ca_list_path, ast_websocket_client::cert_file, ast_websocket_client::connect_timeout, ast_websocket_client::connection_type, errno, LOG_WARNING, NULL, options, ast_websocket_client::password, ast_websocket_client::priv_key_file, ast_websocket_client::protocols, ast_websocket_client::reconnect_attempts, ast_websocket_client::reconnect_interval, result, ast_websocket_client::tls_enabled, ast_websocket_client::uri, ast_websocket_client::username, ast_websocket_client::verify_server_cert, ast_websocket_client::verify_server_hostname, and WS_OK.
Referenced by outbound_session_handler_thread().
enum ast_ws_client_fields ast_websocket_client_get_field_diff | ( | struct ast_websocket_client * | old_wc, |
struct ast_websocket_client * | new_wc | ||
) |
Detect changes between two websocket client configurations.
old_ow | The old websocket configuration. |
new_ow | The new websocket configuration. |
Definition at line 451 of file res_websocket_client.c.
References ast_debug, ast_log, ast_sorcery_diff(), ast_sorcery_object_get_id(), ast_strings_equal(), ast_variables_destroy(), AST_WS_CLIENT_FIELD_CA_LIST_FILE, AST_WS_CLIENT_FIELD_CA_LIST_PATH, AST_WS_CLIENT_FIELD_CERT_FILE, AST_WS_CLIENT_FIELD_CONNECTION_TIMEOUT, AST_WS_CLIENT_FIELD_CONNECTION_TYPE, AST_WS_CLIENT_FIELD_NONE, AST_WS_CLIENT_FIELD_PASSWORD, AST_WS_CLIENT_FIELD_PRIV_KEY_FILE, AST_WS_CLIENT_FIELD_PROTOCOLS, AST_WS_CLIENT_FIELD_RECONNECT_ATTEMPTS, AST_WS_CLIENT_FIELD_RECONNECT_INTERVAL, AST_WS_CLIENT_FIELD_TLS_ENABLED, AST_WS_CLIENT_FIELD_URI, AST_WS_CLIENT_FIELD_USERNAME, AST_WS_CLIENT_FIELD_VERIFY_SERVER_CERT, AST_WS_CLIENT_FIELD_VERIFY_SERVER_HOSTNAME, LOG_WARNING, ast_variable::name, ast_variable::next, NULL, RAII_VAR, sorcery, and ast_variable::value.
Referenced by ari_conf_owc_detect_changes().
int ast_websocket_client_observer_add | ( | const struct ast_sorcery_observer * | callbacks | ) |
Add sorcery observers for websocket client events.
callbacks | The observer callbacks to add. |
Definition at line 516 of file res_websocket_client.c.
References ast_log, ast_sorcery_observer_add(), callbacks, LOG_ERROR, and sorcery.
Referenced by ari_conf_init().
void ast_websocket_client_observer_remove | ( | const struct ast_sorcery_observer * | callbacks | ) |
Remove sorcery observers for websocket client events.
callbacks | The observer callbacks to remove. |
Definition at line 530 of file res_websocket_client.c.
References ast_sorcery_observer_remove(), callbacks, and sorcery.
Referenced by ari_conf_destroy().
int ast_websocket_client_reload | ( | void | ) |
Force res_websocket_client to reload its configuration.
Definition at line 590 of file res_websocket_client.c.
References ast_debug, ast_sorcery_reload(), and sorcery.
Referenced by ari_conf_load().
struct ao2_container * ast_websocket_client_retrieve_all | ( | void | ) |
Retrieve a container of all websocket client objects.
Definition at line 432 of file res_websocket_client.c.
References AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sorcery_retrieve_by_fields(), NULL, and sorcery.
struct ast_websocket_client * ast_websocket_client_retrieve_by_id | ( | const char * | id | ) |
Retrieve a websocket client object by ID.
id | The ID of the websocket client object. |
Definition at line 442 of file res_websocket_client.c.
References ast_sorcery_retrieve_by_id(), NULL, and sorcery.
Referenced by outbound_websocket_websocket_client_id_from_str().