Asterisk - The Open Source Telephony Project
18.5.0
|
#include "asterisk.h"
#include <math.h>
#include <pjsip.h>
#include <pjlib.h>
#include "asterisk/res_pjsip.h"
#include "asterisk/res_pjsip_cli.h"
#include "asterisk/logger.h"
#include "asterisk/astobj2.h"
#include "asterisk/sorcery.h"
#include "asterisk/acl.h"
#include "asterisk/utils.h"
#include "include/res_pjsip_private.h"
#include "asterisk/http_websocket.h"
Go to the source code of this file.
Data Structures | |
struct | internal_state |
Macros | |
#define | BIND_DELAY_US 100000 |
#define | BIND_TRIES 3 |
#define | DEFAULT_STATE_BUCKETS 53 |
Default number of state container buckets. More... | |
#define | MAX_POINTER_STRING 33 |
Functions | |
static void | __init_temp_state_store (void) |
int | ast_sip_destroy_sorcery_transport (void) |
struct ast_sip_transport_state * | ast_sip_get_transport_state (const char *transport_id) |
Retrieve transport state. More... | |
struct ao2_container * | ast_sip_get_transport_states (void) |
Retrieves all transport states. More... | |
int | ast_sip_initialize_sorcery_transport (void) |
Initialize sorcery with transport support. More... | |
void | ast_sip_message_apply_transport (const char *transport_name, pjsip_tx_data *tdata) |
Apply the configuration for a transport to an outgoing message. More... | |
struct ast_sip_service_route_vector * | ast_sip_service_route_vector_alloc (void) |
Allocate a vector of service routes. More... | |
void | ast_sip_service_route_vector_destroy (struct ast_sip_service_route_vector *service_routes) |
Destroy a vector of service routes. More... | |
int | ast_sip_transport_state_set_preferred_identity (const char *transport_name, const char *identity) |
Sets the P-Preferred-Identity on a child transport. More... | |
int | ast_sip_transport_state_set_service_routes (const char *transport_name, struct ast_sip_service_route_vector *service_routes) |
Sets the service routes on a child transport. More... | |
int | ast_sip_transport_state_set_transport (const char *transport_name, pjsip_transport *transport) |
Sets the PJSIP transport on a child transport. More... | |
static int | ca_list_file_to_str (const void *obj, const intptr_t *args, char **buf) |
static int | ca_list_path_to_str (const void *obj, const intptr_t *args, char **buf) |
static int | cert_file_to_str (const void *obj, const intptr_t *args, char **buf) |
static struct ao2_container * | cli_get_container (const char *regex) |
static int | cli_iterate (void *container, ao2_callback_fn callback, void *args) |
static int | cli_print_body (void *obj, void *arg, int flags) |
static int | cli_print_header (void *obj, void *arg, int flags) |
static void * | cli_retrieve_by_id (const char *id) |
static void | copy_state_to_transport (struct ast_sip_transport *transport) |
static int | destroy_sip_transport_state (void *data) |
static struct internal_state * | find_internal_state_by_transport (const struct ast_sip_transport *transport) |
static struct ast_sip_transport_state * | find_or_create_temporary_state (struct ast_sip_transport *transport) |
static struct ast_sip_transport_state * | find_state_by_transport (const struct ast_sip_transport *transport) |
static struct ast_sip_transport_state * | find_temporary_state (struct ast_sip_transport *transport) |
static int | format_ami_endpoint_transport (const struct ast_sip_endpoint *endpoint, struct ast_sip_ami *ami) |
static int | has_state_changed (struct ast_sip_transport_state *a, struct ast_sip_transport_state *b) |
static struct internal_state * | internal_state_alloc (struct ast_sip_transport *transport) |
static int | internal_state_cmp (void *obj, void *arg, int flags) |
comparator function for state objects More... | |
static void | internal_state_destroy (void *obj) |
Destructor for ast_sip_transport state information. More... | |
static int | internal_state_hash (const void *obj, const int flags) |
hashing function for state objects More... | |
static int | localnet_to_str (const void *obj, const intptr_t *args, char **buf) |
static int | localnet_to_vl (const void *obj, struct ast_variable **fields) |
static void | localnet_to_vl_append (struct ast_variable **head, struct ast_ha *ha) |
static int | populate_transport_states (void *obj, void *arg, int flags) |
static int | privkey_file_to_str (const void *obj, const intptr_t *args, char **buf) |
static int | remove_temporary_state (void) |
static int | require_client_cert_to_str (const void *obj, const intptr_t *args, char **buf) |
static void | set_qos (struct ast_sip_transport *transport, pj_qos_params *qos) |
static void * | sip_transport_alloc (const char *name) |
Allocator for transport. More... | |
static void | sip_transport_destroy (void *obj) |
Destructor for transport. More... | |
static void | sip_transport_state_destroy (void *obj) |
Destructor for ast_sip_transport state information. More... | |
static int | sip_transport_to_ami (const struct ast_sip_transport *transport, struct ast_str **buf) |
static void | states_cleanup (void *states) |
static void | temp_state_store_cleanup (void *data) |
static int | tls_method_to_str (const void *obj, const intptr_t *args, char **buf) |
static int | tos_to_str (const void *obj, const intptr_t *args, char **buf) |
static int | transport_apply (const struct ast_sorcery *sorcery, void *obj) |
Apply handler for transports. More... | |
static int | transport_bind_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
Custom handler for turning a string bind into a pj_sockaddr. More... | |
static int | transport_bind_to_str (const void *obj, const intptr_t *args, char **buf) |
static int | transport_localnet_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
Helper function which turns a cipher name into an identifier. More... | |
static int | transport_protocol_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
Custom handler for turning a string protocol into an enum. More... | |
static int | transport_protocol_to_str (const void *obj, const intptr_t *args, char **buf) |
static int | transport_state_cmp (void *obj, void *arg, int flags) |
comparator function for state objects More... | |
static int | transport_state_hash (const void *obj, const int flags) |
hashing function for state objects More... | |
static int | transport_state_init (const struct aco_option *opt, struct ast_variable *var, void *obj) |
Custom handler for type just makes sure the state is created. More... | |
static int | transport_tls_bool_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
Custom handler for TLS boolean settings. More... | |
static int | transport_tls_file_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
Custom handler for TLS method setting. More... | |
static int | transport_tls_method_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
Custom handler for TLS method setting. More... | |
static int | transport_tos_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
Custom handler for TOS setting. More... | |
static int | verify_client_to_str (const void *obj, const intptr_t *args, char **buf) |
static int | verify_server_to_str (const void *obj, const intptr_t *args, char **buf) |
Variables | |
static struct ast_cli_entry | cli_commands [] |
static struct ast_sip_cli_formatter_entry * | cli_formatter |
struct ast_sip_endpoint_formatter | endpoint_transport_formatter |
static struct ast_threadstorage | temp_state_store = { .once = PTHREAD_ONCE_INIT , .key_init = __init_temp_state_store , .custom_init = NULL , } |
static const char * | tls_method_map [] |
static struct ao2_container * | transport_states |
static const char * | transport_types [] |
#define BIND_DELAY_US 100000 |
Referenced by transport_apply().
#define BIND_TRIES 3 |
Referenced by transport_apply().
#define DEFAULT_STATE_BUCKETS 53 |
Default number of state container buckets.
Definition at line 39 of file config_transport.c.
Referenced by ast_sip_get_transport_states(), and ast_sip_initialize_sorcery_transport().
#define MAX_POINTER_STRING 33 |
Definition at line 36 of file config_transport.c.
|
static |
Definition at line 60 of file config_transport.c.
int ast_sip_destroy_sorcery_transport | ( | void | ) |
Definition at line 1692 of file config_transport.c.
References ao2_ref, ARRAY_LEN, ast_cli_unregister_multiple(), ast_sip_unregister_cli_formatter(), ast_sip_unregister_endpoint_formatter(), and NULL.
Referenced by ast_res_pjsip_destroy_configuration().
struct ast_sip_transport_state* ast_sip_get_transport_state | ( | const char * | transport_id | ) |
Retrieve transport state.
transport_id |
Definition at line 1564 of file config_transport.c.
References ao2_bump, ao2_find, ao2_lock, ao2_ref, ao2_unlock, ast_sip_transport_state::flow, NULL, OBJ_SEARCH_KEY, internal_state::state, and ast_sip_transport_state::transport.
Referenced by ast_sip_message_apply_transport(), ast_sip_set_tpselector_from_transport(), ast_sip_transport_state_set_preferred_identity(), ast_sip_transport_state_set_service_routes(), ast_sip_transport_state_set_transport(), change_outgoing_sdp_stream_media_address(), create_rtp(), and session_outgoing_nat_hook().
struct ao2_container* ast_sip_get_transport_states | ( | void | ) |
Retrieves all transport states.
Definition at line 1604 of file config_transport.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_callback, ao2_container_alloc_hash, DEFAULT_STATE_BUCKETS, NULL, OBJ_MULTIPLE, OBJ_NODATA, populate_transport_states(), transport_state_cmp(), and transport_state_hash().
Referenced by anonymous_identify(), find_endpoint(), get_udp_transport(), get_write_timeout(), and process_nat().
int ast_sip_initialize_sorcery_transport | ( | void | ) |
Initialize sorcery with transport support.
Definition at line 1618 of file config_transport.c.
References ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_cleanup, ao2_container_alloc_hash, ARRAY_LEN, ast_cli_register_multiple, AST_DEFAULT_WEBSOCKET_WRITE_TIMEOUT_STR, ast_log, AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sip_get_sorcery(), ast_sip_register_cli_formatter(), ast_sip_register_endpoint_formatter(), ast_sorcery_apply_default, ast_sorcery_object_field_register, ast_sorcery_object_field_register_custom, ast_sorcery_object_get_id(), ast_sorcery_object_register, ast_sorcery_retrieve_by_fields(), ca_list_file_to_str(), ca_list_path_to_str(), cert_file_to_str(), cli_get_container(), cli_iterate(), cli_print_body(), cli_print_header(), cli_retrieve_by_id(), cos, DEFAULT_STATE_BUCKETS, FLDSET, ast_sip_cli_formatter_entry::get_container, ast_sip_cli_formatter_entry::get_id, internal_state_cmp(), internal_state_hash(), ast_sip_cli_formatter_entry::iterate, localnet_to_str(), localnet_to_vl(), LOG_ERROR, ast_sip_cli_formatter_entry::name, NULL, OPT_BOOL_T, OPT_INT_T, OPT_STRINGFIELD_T, OPT_UINT_T, PARSE_IN_RANGE, password, ast_sip_cli_formatter_entry::print_body, ast_sip_cli_formatter_entry::print_header, privkey_file_to_str(), require_client_cert_to_str(), ast_sip_cli_formatter_entry::retrieve_by_id, sip_transport_alloc(), sorcery, STRFLDSET, tls_method_to_str(), tos_to_str(), transport_apply(), transport_bind_handler(), transport_bind_to_str(), transport_localnet_handler(), transport_protocol_handler(), transport_protocol_to_str(), transport_state_init(), transport_tls_bool_handler(), transport_tls_file_handler(), transport_tls_method_handler(), transport_tos_handler(), verify_client_to_str(), and verify_server_to_str().
Referenced by ast_res_pjsip_initialize_configuration().
void ast_sip_message_apply_transport | ( | const char * | transport_name, |
pjsip_tx_data * | tdata | ||
) |
Apply the configuration for a transport to an outgoing message.
transport_name | The name of the transport to apply configuration from |
tdata | The SIP message |
Definition at line 301 of file config_transport.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_sip_add_header(), ast_sip_get_transport_state(), ast_strlen_zero, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_sip_transport_state::flow, ast_sip_transport_state::preferred_identity, and ast_sip_transport_state::service_routes.
Referenced by ast_sip_send_out_of_dialog_request(), handle_outgoing_request(), handle_outgoing_response(), and supplement_outgoing_response().
struct ast_sip_service_route_vector* ast_sip_service_route_vector_alloc | ( | void | ) |
Allocate a vector of service routes.
non-NULL | success |
NULL | failure |
Definition at line 352 of file config_transport.c.
References ast_calloc, AST_VECTOR_INIT, and NULL.
Referenced by save_response_fields_to_transport().
void ast_sip_service_route_vector_destroy | ( | struct ast_sip_service_route_vector * | service_routes | ) |
Destroy a vector of service routes.
service_routes | A vector of service routes |
Definition at line 366 of file config_transport.c.
References ast_free, and AST_VECTOR_CALLBACK_VOID.
Referenced by ast_sip_transport_state_set_service_routes(), and save_response_fields_to_transport().
int ast_sip_transport_state_set_preferred_identity | ( | const char * | transport_name, |
const char * | identity | ||
) |
Sets the P-Preferred-Identity on a child transport.
transport_name | The name of the transport to be set on |
identity | The P-Preferred-Identity to use on requests on this transport |
0 | success |
-1 | failure |
Definition at line 242 of file config_transport.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_free, ast_sip_get_transport_state(), ast_strdup, ast_strlen_zero, ast_sip_transport_state::flow, and ast_sip_transport_state::preferred_identity.
Referenced by save_response_fields_to_transport().
int ast_sip_transport_state_set_service_routes | ( | const char * | transport_name, |
struct ast_sip_service_route_vector * | service_routes | ||
) |
Sets the service routes on a child transport.
transport_name | The name of the transport to be set on |
service_routes | A vector of service routes |
0 | success |
-1 | failure |
Definition at line 270 of file config_transport.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_sip_get_transport_state(), ast_sip_service_route_vector_destroy(), ast_strlen_zero, ast_sip_transport_state::flow, and ast_sip_transport_state::service_routes.
Referenced by save_response_fields_to_transport().
int ast_sip_transport_state_set_transport | ( | const char * | transport_name, |
pjsip_transport * | transport | ||
) |
Sets the PJSIP transport on a child transport.
transport_name | The name of the transport to be updated |
transport | The PJSIP transport |
0 | success |
-1 | failure |
Definition at line 206 of file config_transport.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_sip_get_transport_state(), ast_strlen_zero, ast_sip_transport_state::flow, internal_state::transport, and ast_sip_transport_state::transport.
Referenced by save_response_fields_to_transport().
|
static |
Definition at line 922 of file config_transport.c.
References ast_strdup, ast_sip_transport::ca_list_file, and internal_state::transport.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 931 of file config_transport.c.
References ast_strdup, ast_sip_transport::ca_list_path, and internal_state::transport.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 940 of file config_transport.c.
References ast_strdup, ast_sip_transport::cert_file, and internal_state::transport.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 1454 of file config_transport.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_cleanup, ao2_container_alloc_list, ao2_container_dup(), ao2_ref, ast_sip_get_sorcery(), ast_sorcery_object_id_compare(), ast_sorcery_object_id_sort(), ast_sorcery_retrieve_by_regex(), container, NULL, and RAII_VAR.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 1479 of file config_transport.c.
References ast_sip_get_sorcery(), ast_sorcery_retrieve_by_id(), container, internal_state::transport, and ast_sip_endpoint::transport.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 1512 of file config_transport.c.
References ao2_cleanup, ARRAY_IN_BOUNDS, ast_assert, ast_sip_cli_print_sorcery_objectset(), ast_sorcery_object_get_id(), ast_str_append(), CLI_INDENT_TO_SPACES, context, ast_sip_transport::cos, find_state_by_transport(), ast_sip_transport_state::host, ast_sip_cli_context::indent_level, NULL, ast_sip_cli_context::output_buffer, RAII_VAR, ast_sip_cli_context::show_details, ast_sip_cli_context::show_details_only_level_0, ast_sip_transport::tos, internal_state::transport, transport_types, and ast_sip_transport::type.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 1497 of file config_transport.c.
References ast_assert, ast_str_append(), CLI_HEADER_FILLER, CLI_INDENT_TO_SPACES, CLI_MAX_WIDTH, context, ast_sip_cli_context::indent_level, NULL, and ast_sip_cli_context::output_buffer.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 1492 of file config_transport.c.
References ast_sip_get_sorcery(), and ast_sorcery_retrieve_by_id().
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 568 of file config_transport.c.
References ast_assert, ast_sip_transport_state::ciphers, ast_sip_transport::ciphers, ast_sip_transport::external_address, ast_sip_transport::external_address_refresher, ast_sip_transport_state::external_signaling_address, ast_sip_transport::external_signaling_address, ast_sip_transport_state::external_signaling_address_refresher, ast_sip_transport_state::host, ast_sip_transport::host, ast_sip_transport_state::localnet, ast_sip_transport::localnet, ast_sip_transport::state, ast_sip_transport_state::tls, and ast_sip_transport::tls.
Referenced by transport_apply().
|
static |
Definition at line 415 of file config_transport.c.
References ast_dnsmgr_release(), ast_free, ast_free_ha(), ast_sip_transport_state::external_media_address_refresher, ast_sip_transport_state::external_signaling_address_refresher, ast_sip_transport_state::id, ast_sip_transport_state::localnet, and ast_sip_transport_state::transport.
Referenced by sip_transport_state_destroy().
|
static |
Definition at line 453 of file config_transport.c.
References ao2_find, ast_sorcery_object_get_id(), OBJ_NOLOCK, and OBJ_SEARCH_KEY.
Referenced by find_state_by_transport(), and transport_apply().
|
static |
Definition at line 534 of file config_transport.c.
References ao2_alloc, ao2_ref, ast_sorcery_object_get_id(), ast_strdup, ast_threadstorage_get(), ast_sip_transport_state::ciphers, find_temporary_state(), ast_sip_transport_state::id, NULL, sip_transport_state_destroy(), internal_state::state, temp_state_store, ast_sip_transport_state::tls, ast_sip_transport_state::type, and ast_sip_transport::type.
Referenced by tls_method_to_str(), transport_bind_handler(), transport_localnet_handler(), transport_protocol_handler(), transport_state_init(), transport_tls_bool_handler(), transport_tls_file_handler(), and transport_tls_method_handler().
|
static |
Definition at line 460 of file config_transport.c.
References ao2_bump, ao2_ref, find_internal_state_by_transport(), NULL, and internal_state::state.
Referenced by cli_print_body(), localnet_to_str(), localnet_to_vl(), require_client_cert_to_str(), tls_method_to_str(), transport_bind_to_str(), verify_client_to_str(), and verify_server_to_str().
|
static |
Definition at line 489 of file config_transport.c.
References ao2_ref, ast_threadstorage_get(), NULL, internal_state::state, and temp_state_store.
Referenced by find_or_create_temporary_state(), and internal_state_alloc().
|
static |
Definition at line 168 of file config_transport.c.
References ao2_cleanup, ast_free, ast_sip_create_ami_event(), ast_sip_get_sorcery(), ast_sorcery_object_get_id(), ast_sorcery_retrieve_by_id(), ast_str_append(), ast_str_buffer(), ast_strlen_zero, astman_append(), astman_send_error_va(), buf, ast_sip_ami::count, ast_sip_ami::m, NULL, RAII_VAR, ast_sip_ami::s, sip_transport_to_ami(), internal_state::transport, and ast_sip_endpoint::transport.
|
static |
Definition at line 580 of file config_transport.c.
References ast_ha::addr, ast_sockaddr_cmp(), ast_sip_transport_state::ciphers, ast_sip_transport_state::external_media_address, ast_sip_transport_state::external_signaling_address, HAVE_PJSIP_TLS_TRANSPORT_PROTO, ast_sip_transport_state::host, ast_sip_transport_state::localnet, ast_ha::netmask, ast_sip_transport_state::tls, and ast_sip_transport_state::type.
Referenced by transport_apply().
|
static |
Definition at line 502 of file config_transport.c.
References ao2_alloc, ao2_bump, ao2_cleanup, ast_sorcery_object_get_id(), ast_strdup, find_temporary_state(), internal_state::id, internal_state_destroy(), NULL, remove_temporary_state(), internal_state::state, ast_sip_transport::state, and internal_state::transport.
Referenced by transport_apply().
|
static |
comparator function for state objects
Definition at line 84 of file config_transport.c.
References ast_assert, CMP_MATCH, internal_state::id, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and OBJ_SEARCH_PARTIAL_KEY.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Destructor for ast_sip_transport state information.
Definition at line 444 of file config_transport.c.
References ao2_cleanup, ast_free, internal_state::id, internal_state::state, and internal_state::transport.
Referenced by internal_state_alloc().
|
static |
hashing function for state objects
Definition at line 63 of file config_transport.c.
References ast_assert, ast_str_hash(), OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, and OBJ_SEARCH_OBJECT.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 1403 of file config_transport.c.
References ao2_cleanup, ast_free, ast_ha_join(), ast_str_buffer(), ast_str_create, ast_strdup, find_state_by_transport(), ast_sip_transport_state::localnet, MAX_OBJECT_FIELD, RAII_VAR, str, and internal_state::transport.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 1381 of file config_transport.c.
References ao2_cleanup, find_state_by_transport(), ast_sip_transport_state::localnet, localnet_to_vl_append(), ast_ha::next, NULL, RAII_VAR, and internal_state::transport.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 1371 of file config_transport.c.
References ast_ha::addr, AST_SENSE_ALLOW, ast_sockaddr_stringify_addr(), ast_strdupa, ast_variable_list_append, ast_variable_new, MAX_OBJECT_FIELD, ast_ha::netmask, ast_ha::sense, and str.
Referenced by localnet_to_vl().
|
static |
Definition at line 1594 of file config_transport.c.
References ao2_link, CMP_MATCH, container, and internal_state::state.
Referenced by ast_sip_get_transport_states().
|
static |
Definition at line 949 of file config_transport.c.
References ast_strdup, ast_sip_transport::privkey_file, and internal_state::transport.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 475 of file config_transport.c.
References ao2_cleanup, ast_threadstorage_get(), NULL, internal_state::state, and temp_state_store.
Referenced by internal_state_alloc().
|
static |
Definition at line 1100 of file config_transport.c.
References ao2_cleanup, ast_strdup, AST_YESNO, find_state_by_transport(), RAII_VAR, and internal_state::transport.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 376 of file config_transport.c.
References ast_sip_transport::cos, and ast_sip_transport::tos.
Referenced by transport_apply().
|
static |
Allocator for transport.
Definition at line 399 of file config_transport.c.
References ao2_cleanup, ast_sorcery_generic_alloc(), ast_string_field_init, NULL, sip_transport_destroy(), and internal_state::transport.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Destructor for transport.
Definition at line 391 of file config_transport.c.
References ast_string_field_free_memory, and internal_state::transport.
Referenced by sip_transport_alloc().
|
static |
Destructor for ast_sip_transport state information.
Definition at line 436 of file config_transport.c.
References ast_sip_push_task_wait_servant(), destroy_sip_transport_state(), and NULL.
Referenced by find_or_create_temporary_state().
|
static |
Definition at line 162 of file config_transport.c.
References ast_sip_sorcery_object_to_ami().
Referenced by format_ami_endpoint_transport().
|
static |
Definition at line 624 of file config_transport.c.
References ao2_unlock.
Referenced by transport_apply().
|
static |
|
static |
Definition at line 1161 of file config_transport.c.
References a, ao2_cleanup, args, ARRAY_IN_BOUNDS, ARRAY_LEN, ast_cli(), ast_free, ast_log, ast_str_append(), ast_str_buffer(), ast_str_create, ast_strdup, ast_strdupa, ast_strip(), ast_strlen_zero, buf, ast_sip_transport_state::ciphers, ast_sip_transport::ciphers, CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, find_or_create_temporary_state(), find_state_by_transport(), LOG_ERROR, name, NULL, parse(), RAII_VAR, S_OR, str, strsep(), ast_sip_transport_state::tls, tls_method_map, internal_state::transport, ast_cli_entry::usage, ast_variable::value, and var.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 1444 of file config_transport.c.
References ast_asprintf, ast_sip_transport::tos, and internal_state::transport.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Apply handler for transports.
Definition at line 632 of file config_transport.c.
References ast_sip_transport::allow_reload, ao2_cleanup, ao2_link_flags, ao2_replace, ao2_unlink_flags, ao2_wrlock, ast_compare_versions(), ast_debug, ast_dnsmgr_lookup(), ast_log, ast_sip_get_pjsip_endpoint(), AST_SIP_X_AST_TXP, AST_SIP_X_AST_TXP_LEN, ast_sorcery_diff(), ast_sorcery_object_get_id(), ast_strlen_zero, AST_TRANSPORT_TCP, AST_TRANSPORT_TLS, AST_TRANSPORT_UDP, AST_TRANSPORT_WS, AST_TRANSPORT_WSS, ast_variables_destroy(), ast_sip_transport::async_operations, BIND_DELAY_US, BIND_TRIES, ast_sip_transport::ca_list_file, ast_sip_transport::ca_list_path, ast_sip_transport::cert_file, copy_state_to_transport(), ast_sip_transport::cos, ast_sip_transport::external_media_address, ast_sip_transport::external_signaling_address, find_internal_state_by_transport(), ast_sip_transport::flow, has_state_changed(), internal_state_alloc(), LOG_ERROR, LOG_WARNING, NULL, OBJ_NOLOCK, ast_sip_transport::password, ast_sip_transport::privkey_file, RAII_VAR, set_qos(), ast_sip_transport::state, states_cleanup(), ast_sip_transport_state::tls, ast_sip_transport::tos, internal_state::transport, and ast_sip_transport::type.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Custom handler for turning a string bind into a pj_sockaddr.
Definition at line 1014 of file config_transport.c.
References ao2_cleanup, buf, find_or_create_temporary_state(), RAII_VAR, internal_state::transport, and ast_variable::value.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 1030 of file config_transport.c.
References ao2_cleanup, ast_calloc, find_state_by_transport(), MAX_OBJECT_FIELD, RAII_VAR, and internal_state::transport.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Helper function which turns a cipher name into an identifier.
Custom handler for TLS cipher setting
Custom handler for localnet setting
Definition at line 1346 of file config_transport.c.
References ao2_cleanup, ast_append_ha(), ast_free_ha(), ast_strlen_zero, error(), find_or_create_temporary_state(), ast_sip_transport_state::localnet, NULL, RAII_VAR, internal_state::transport, and ast_variable::value.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Custom handler for turning a string protocol into an enum.
Definition at line 959 of file config_transport.c.
References ao2_cleanup, AST_TRANSPORT_TCP, AST_TRANSPORT_TLS, AST_TRANSPORT_UDP, AST_TRANSPORT_WS, AST_TRANSPORT_WSS, find_or_create_temporary_state(), ast_sip_transport::flow, RAII_VAR, internal_state::transport, ast_sip_transport::type, and ast_variable::value.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 1000 of file config_transport.c.
References ARRAY_IN_BOUNDS, ast_strdup, ast_sip_transport::flow, internal_state::transport, transport_types, and ast_sip_transport::type.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
comparator function for state objects
Definition at line 134 of file config_transport.c.
References ast_assert, CMP_MATCH, ast_sip_transport_state::id, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and OBJ_SEARCH_PARTIAL_KEY.
Referenced by ast_sip_get_transport_states().
|
static |
hashing function for state objects
Definition at line 113 of file config_transport.c.
References ast_assert, ast_str_hash(), OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, and OBJ_SEARCH_OBJECT.
Referenced by ast_sip_get_transport_states().
|
static |
Custom handler for type just makes sure the state is created.
Definition at line 869 of file config_transport.c.
References ao2_cleanup, find_or_create_temporary_state(), and internal_state::transport.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Custom handler for TLS boolean settings.
Definition at line 1050 of file config_transport.c.
References ao2_cleanup, ast_true(), find_or_create_temporary_state(), ast_variable::name, RAII_VAR, internal_state::transport, and ast_variable::value.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Custom handler for TLS method setting.
Definition at line 880 of file config_transport.c.
References ao2_cleanup, ast_file_is_readable(), ast_log, ast_sorcery_object_get_id(), ast_string_field_set, ast_strlen_zero, ast_sip_transport::ca_list_file, ast_sip_transport::ca_list_path, ast_sip_transport::cert_file, find_or_create_temporary_state(), LOG_ERROR, LOG_WARNING, ast_variable::name, ast_sip_transport::privkey_file, RAII_VAR, internal_state::transport, and ast_variable::value.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Custom handler for TLS method setting.
Definition at line 1115 of file config_transport.c.
References ao2_cleanup, ast_strlen_zero, find_or_create_temporary_state(), RAII_VAR, internal_state::transport, and ast_variable::value.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Custom handler for TOS setting.
Definition at line 1419 of file config_transport.c.
References ast_log, ast_sorcery_object_get_id(), ast_str2tos(), LOG_ERROR, LOG_WARNING, ast_sip_transport::tos, internal_state::transport, value, and ast_variable::value.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 1086 of file config_transport.c.
References ao2_cleanup, ast_strdup, AST_YESNO, find_state_by_transport(), RAII_VAR, and internal_state::transport.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 1072 of file config_transport.c.
References ao2_cleanup, ast_strdup, AST_YESNO, find_state_by_transport(), RAII_VAR, and internal_state::transport.
Referenced by ast_sip_initialize_sorcery_transport().
|
static |
Definition at line 1542 of file config_transport.c.
|
static |
Definition at line 1562 of file config_transport.c.
struct ast_sip_endpoint_formatter endpoint_transport_formatter |
Definition at line 202 of file config_transport.c.
|
static |
Definition at line 60 of file config_transport.c.
Referenced by find_or_create_temporary_state(), find_temporary_state(), and remove_temporary_state().
|
static |
Definition at line 1149 of file config_transport.c.
Referenced by tls_method_to_str().
|
static |
Definition at line 40 of file config_transport.c.
Referenced by anonymous_identify(), find_endpoint(), get_udp_transport(), get_write_timeout(), and process_nat().
|
static |
Definition at line 992 of file config_transport.c.
Referenced by cli_print_body(), and transport_protocol_to_str().