|
Asterisk - The Open Source Telephony Project GIT-master-545c459
|
#include "asterisk.h"#include <pjsip.h>#include <pjsip_ua.h>#include <pjlib.h>#include "asterisk/res_pjsip.h"#include "asterisk/channel.h"#include "asterisk/pbx.h"#include "asterisk/astobj2.h"#include "asterisk/cli.h"#include "asterisk/time.h"#include "asterisk/test.h"#include "asterisk/statsd.h"#include "include/res_pjsip_private.h"#include "asterisk/taskprocessor.h"#include "asterisk/taskpool.h"
Go to the source code of this file.
Data Structures | |
| struct | sip_options_aor |
| Structure which contains an AOR and contacts for qualifying purposes. More... | |
| struct | sip_options_contact_callback_data |
| Structure used to contain information for an OPTIONS callback. More... | |
| struct | sip_options_contact_observer_task_data |
| Task details for adding an AOR to an endpoint state compositor. More... | |
| struct | sip_options_endpoint_aor_status |
| Structure which contains status information for an AOR feeding an endpoint state compositor. More... | |
| struct | sip_options_endpoint_compositor_task_data |
| Task details for adding an AOR to an endpoint state compositor. More... | |
| struct | sip_options_endpoint_state_compositor |
| Structure which contains composites information for endpoint state. More... | |
| struct | sip_options_qualify_resolve_task_data |
| struct | sip_options_synchronize_aor_task_data |
| Task data for AOR creation or updating. More... | |
| struct | sip_options_synchronize_task_data |
| Structure which contains information required to synchronize. More... | |
| struct | sip_options_target_result |
| Result of qualifying an individual address belonging to a contact resolved from an A, AAAA or SRV record. More... | |
Macros | |
| #define | AOR_BUCKETS 1567 |
| These are the number of buckets to store AORs in. | |
| #define | AOR_STATUS_BUCKETS 3 |
| These are the number of buckets (per endpoint state compositor) to use to store AOR statuses. | |
| #define | CONTACT_BUCKETS 13 |
| These are the number of buckets (per AOR) to use to store contacts. | |
| #define | CONTACT_STATUS_BUCKETS 1567 |
| These are the number of contact status buckets. | |
| #define | DEFAULT_ENCODING "identity" |
| #define | DEFAULT_LANGUAGE "en" |
| #define | ENDPOINT_STATE_COMPOSITOR_BUCKETS 13 |
| These are the number of buckets to store endpoint state compositors. | |
| #define | ENDPOINT_STATE_COMPOSITOR_INITIAL_SIZE 1 |
| The initial vector size for the endpoint state compositors on an AOR. | |
| #define | MAX_UNLOAD_TIMEOUT_TIME 10 /* Seconds */ |
| Maximum wait time to join the below shutdown group. | |
Functions | |
| static int | ami_show_contacts (struct mansession *s, const struct message *m) |
| static int | ami_sip_qualify (struct mansession *s, const struct message *m) |
| AO2_STRING_FIELD_CMP_FN (ast_sip_contact_status, name) | |
| Comparator function for contact statuses. | |
| AO2_STRING_FIELD_CMP_FN (sip_options_aor, name) | |
| Comparator function for SIP OPTIONS AORs. | |
| AO2_STRING_FIELD_CMP_FN (sip_options_endpoint_aor_status, name) | |
| Comparator function for endpoint AOR status. | |
| AO2_STRING_FIELD_CMP_FN (sip_options_endpoint_state_compositor, name) | |
| Comparator function for endpoint state compositors. | |
| AO2_STRING_FIELD_HASH_FN (ast_sip_contact_status, name) | |
| Hashing function for contact statuses. | |
| AO2_STRING_FIELD_HASH_FN (sip_options_aor, name) | |
| Hashing function for OPTIONS AORs. | |
| AO2_STRING_FIELD_HASH_FN (sip_options_endpoint_aor_status, name) | |
| Hashing function for endpoint AOR status. | |
| AO2_STRING_FIELD_HASH_FN (sip_options_endpoint_state_compositor, name) | |
| Hashing function for endpoint state compositors. | |
| AO2_STRING_FIELD_SORT_FN (ast_sip_contact_status, name) | |
| Sort function for contact statuses. | |
| static void | aor_observer_deleted (const void *obj) |
| Observer callback invoked on AOR deletion. | |
| static void | aor_observer_modified (const void *obj) |
| Observer callback invoked on AOR creation or modification. | |
| void | ast_res_pjsip_cleanup_options_handling (void) |
| struct ast_sip_contact_status * | ast_res_pjsip_find_or_create_contact_status (const struct ast_sip_contact *contact) |
| int | ast_res_pjsip_init_options_handling (int reload) |
| int | ast_res_pjsip_preinit_options_handling (void) |
| int | ast_sip_format_contact_ami (void *obj, void *arg, int flags) |
| Formats the contact and sends over AMI. | |
| const char * | ast_sip_get_contact_short_status_label (const enum ast_sip_contact_status_type status) |
| struct ast_sip_contact_status * | ast_sip_get_contact_status (const struct ast_sip_contact *contact) |
| Retrieve the current status for a contact. | |
| const char * | ast_sip_get_contact_status_label (const enum ast_sip_contact_status_type status) |
| translate ast_sip_contact_status_type to character string. | |
| static char * | cli_qualify (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
| static char * | cli_reload_qualify_aor (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
| static char * | cli_reload_qualify_endpoint (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
| static char * | cli_show_qualify_aor (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
| static char * | cli_show_qualify_endpoint (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
| static void | contact_observer_created (const void *obj) |
| Observer callback invoked on contact creation. | |
| static void | contact_observer_deleted (const void *obj) |
| Observer callback invoked on contact deletion. | |
| static void | contact_observer_updated (const void *obj) |
| Observer callback invoked on contact update. | |
| static int | contact_status_publish_update_task (void *obj) |
| Task to notify endpoints of a contact status change. | |
| static void | endpoint_observer_deleted (const void *obj) |
| Observer callback invoked on endpoint deletion. | |
| static void | endpoint_observer_modified (const void *obj) |
| Observer callback invoked on endpoint creation or modification. | |
| static int | format_ami_contact_status (const struct ast_sip_endpoint *endpoint, struct ast_sip_ami *ami) |
| static int | format_ami_contactlist_handler (void *obj, void *arg, int flags) |
| static int | format_contact_status_for_aor (void *obj, void *arg, int flags) |
| static struct ao2_container * | get_all_contacts (void) |
| static int | has_qualify_changed (const struct ast_sip_contact *contact, const struct sip_options_aor *aor_options) |
| Check if the contact qualify options are different than local aor qualify options. | |
| static pj_bool_t | options_on_rx_request (pjsip_rx_data *rdata) |
| static void | qualify_contact_cb (void *token, pjsip_event *e) |
| Callback for an OPTIONS response, timeout, or transport error. | |
| static pj_status_t | send_options_response (pjsip_rx_data *rdata, int code) |
| static struct ast_sip_contact_status * | sip_contact_status_alloc (const char *name) |
| static struct ast_sip_contact_status * | sip_contact_status_copy (const struct ast_sip_contact_status *src) |
| static void | sip_contact_status_dtor (void *obj) |
| Destructor for contact statuses. | |
| static int | sip_contact_to_ami (const struct ast_sip_contact *contact, struct ast_str **buf) |
| static struct sip_options_aor * | sip_options_aor_alloc (struct ast_sip_aor *aor) |
| Allocator for AOR OPTIONS. | |
| static void | sip_options_aor_dtor (void *obj) |
| Destructor function for SIP OPTIONS AORs. | |
| static int | sip_options_aor_observer_deleted_task (void *obj) |
| Task to delete an AOR from the known universe. | |
| static int | sip_options_aor_observer_modified_task (void *obj) |
| Task to synchronize the AOR. | |
| static int | sip_options_aor_remove_task (void *obj) |
| Task which removes an AOR from all of the ESCs it is reporting to. | |
| static void | sip_options_apply_aor_configuration (struct sip_options_aor *aor_options, struct ast_sip_aor *aor, int is_new) |
| Function which applies configuration to an AOR options structure. | |
| static pj_status_t | sip_options_apply_transport_to_destination (const pjsip_tx_data *tdata, pjsip_host_info *destination) |
| Apply a request's transport selector to its DNS destination. | |
| static void | sip_options_cancel_target_transactions (struct sip_options_contact_callback_data *batch) |
| Terminate all in-flight target transactions for a batch. | |
| static int | sip_options_cleanup_aor_task (void *obj) |
| Management task to clean up an AOR. | |
| static int | sip_options_cleanup_task (void *obj) |
| Management task to clean up the environment. | |
| static int | sip_options_contact_add_management_task (void *obj) |
| Task to add a dynamic contact to an AOR in its serializer. | |
| static int | sip_options_contact_add_task (void *obj) |
| Task which adds a dynamic contact to an AOR. | |
| static struct sip_options_contact_callback_data * | sip_options_contact_callback_data_alloc (struct ast_sip_contact *contact, struct sip_options_aor *aor_options, struct ast_sip_endpoint *endpoint, pjsip_tx_data *resolve_tdata) |
| Contact callback data allocator. | |
| static void | sip_options_contact_callback_data_dtor (void *obj) |
| Destructor for contact callback data. | |
| static int | sip_options_contact_delete_management_task (void *obj) |
| Task to delete a contact from an AOR in its serializer. | |
| static int | sip_options_contact_delete_task (void *obj) |
| Task which deletes a dynamic contact from an AOR. | |
| static int | sip_options_contact_status_available_count (void *obj, void *arg, int flags) |
| Count AVAILABLE qualified contacts. | |
| static int | sip_options_contact_status_notify_task (void *obj) |
| Task to notify an AOR of a contact status change. | |
| static void | sip_options_contact_status_update (struct ast_sip_contact_status *contact_status) |
| static struct ao2_container * | sip_options_contact_statuses_alloc (void) |
| Helper function to allocate a contact statuses container. | |
| static int | sip_options_contact_update_task (void *obj) |
| Task which updates a dynamic contact to an AOR. | |
| static int | sip_options_determine_initial_qualify_time (int qualify_frequency) |
| Determine an initial time for scheduling AOR qualifying. | |
| static int | sip_options_endpoint_compositor_add_task (void *obj) |
| Task which adds an AOR to an endpoint state compositor. | |
| static int | sip_options_endpoint_compositor_remove_task (void *obj) |
| Task which adds removes an AOR from an endpoint state compositor. | |
| static int | sip_options_endpoint_observer_deleted_task (void *obj) |
| Task to delete an endpoint from the known universe. | |
| static int | sip_options_endpoint_observer_modified_task (void *obj) |
| Task to synchronize the endpoint. | |
| static void | sip_options_endpoint_state_compositor_dtor (void *obj) |
| Destructor for endpoint state compositors. | |
| static struct sip_options_endpoint_state_compositor * | sip_options_endpoint_state_compositor_find_or_alloc (const struct ast_sip_endpoint *endpoint) |
| Find (or create) an endpoint state compositor. | |
| static void | sip_options_endpoint_unlink_aor_feeders (struct ast_sip_endpoint *endpoint, struct sip_options_endpoint_state_compositor *endpoint_state_compositor) |
| Unlink AORs feeding the endpoint status compositor. | |
| static enum ast_endpoint_state | sip_options_get_endpoint_state_compositor_state (const struct sip_options_endpoint_state_compositor *endpoint_state_compositor) |
| Return the current state of an endpoint state compositor. | |
| static int | sip_options_init_task (void *mgmt_serializer) |
| Management task to finish setting up the environment. | |
| static void | sip_options_notify_endpoint_state_compositors (struct sip_options_aor *aor_options, enum ast_sip_contact_status_type status) |
| Function which notifies endpoint state compositors of a state change of an AOR. | |
| static void | sip_options_publish_contact_state (const struct sip_options_aor *aor_options, const struct ast_sip_contact_status *contact_status) |
| Function which publishes a contact status update to all interested endpoints. | |
| static int | sip_options_qualify_aor (void *obj) |
| Task to qualify contacts of an AOR. | |
| static int | sip_options_qualify_contact (void *obj, void *arg, int flags) |
| Send a SIP OPTIONS request for a contact. | |
| static void | sip_options_qualify_resolve_cb (pj_status_t status, void *token, const pjsip_server_addresses *addresses) |
| DNS callback used to fan out a qualify to every resolved target. | |
| static int | sip_options_qualify_resolve_task (void *obj) |
| Process a DNS resolution result on the AOR serializer. | |
| static void | sip_options_qualify_resolve_task_dtor (void *obj) |
| static void | sip_options_queue_target_result (struct sip_options_contact_callback_data *batch, enum ast_sip_contact_status_type status) |
| Queue a resolved target's qualification result to be combined with the other targets. | |
| static int | sip_options_remove_contact (void *obj, void *arg, int flags) |
| Forward declaration of this helpful function. | |
| static void | sip_options_remove_contact_status (struct sip_options_aor *aor_options, struct ast_sip_contact *contact) |
| Remove contact status for a hint. | |
| static void | sip_options_set_contact_status (struct ast_sip_contact_status *contact_status, enum ast_sip_contact_status_type status) |
| Set the contact status for a contact. | |
| static int | sip_options_set_contact_status_qualified (void *obj, void *arg, int flags) |
| Transition the contact status to qualified mode. | |
| static int | sip_options_set_contact_status_unqualified (void *obj, void *arg, int flags) |
| Transition the contact status to unqualified mode. | |
| static void | sip_options_synchronize (int reload) |
| Synchronize our local container of AORs and endpoint state compositors with the current configuration. | |
| static int | sip_options_synchronize_aor (void *obj, void *arg, int flags) |
| Synchronize an AOR with our local state. | |
| static int | sip_options_synchronize_aor_task (void *obj) |
| Task to synchronize an AOR with our local state. | |
| static int | sip_options_synchronize_endpoint (void *obj, void *arg, int flags) |
| Synchronize an endpoint with our local state. | |
| static int | sip_options_synchronize_task (void *obj) |
| Task to synchronize our local container of AORs and endpoint state compositors with the current configuration. | |
| static void | sip_options_target_result_dtor (void *obj) |
| Destructor for a resolved target's qualification result. | |
| static int | sip_options_target_result_task (void *obj) |
| Combine the result of one resolved target with the other targets. | |
| static void | sip_options_transaction_free (pjsip_transaction *tsx) |
| static int | sip_options_unused_aor (void *obj, void *arg, int flags) |
| Callback which removes any unused AORs that remained after reloading. | |
| static int | sip_options_unused_endpoint_state_compositor (void *obj, void *arg, int flags) |
| Callback function used to unlink and remove event state compositors that have no AORs feeding them. | |
| static int | sip_options_update_aor_task (void *obj) |
| Task to synchronize an AOR with our local state. | |
| static void | sip_options_update_endpoint_state_compositor_aor (struct sip_options_endpoint_state_compositor *endpoint_state_compositor, const char *name, enum ast_sip_contact_status_type status) |
| Update the AOR status on an endpoint state compositor. | |
Variables | |
| static const struct ast_sorcery_observer | aor_observer_callbacks |
| Observer callbacks for AORs. | |
| static struct ast_cli_entry | cli_options [] |
| static const struct ast_sorcery_observer | contact_observer_callbacks |
| Observer callbacks for contacts. | |
| static struct ast_sip_endpoint_formatter | contact_status_formatter |
| static const struct ast_sorcery_observer | endpoint_observer_callbacks |
| Observer callbacks for endpoints. | |
| static struct ast_taskprocessor * | management_serializer |
| static pjsip_module | options_module |
| static const char * | short_status_map [] |
| static struct ao2_container * | sip_options_aors |
| static struct ao2_container * | sip_options_contact_statuses |
| static struct ao2_container * | sip_options_endpoint_state_compositors |
| static const char * | status_map [] |
| #define AOR_BUCKETS 1567 |
These are the number of buckets to store AORs in.
Definition at line 103 of file pjsip_options.c.
| #define AOR_STATUS_BUCKETS 3 |
These are the number of buckets (per endpoint state compositor) to use to store AOR statuses.
Definition at line 123 of file pjsip_options.c.
| #define CONTACT_BUCKETS 13 |
These are the number of buckets (per AOR) to use to store contacts.
Definition at line 114 of file pjsip_options.c.
| #define CONTACT_STATUS_BUCKETS 1567 |
These are the number of contact status buckets.
Definition at line 110 of file pjsip_options.c.
| #define DEFAULT_ENCODING "identity" |
Definition at line 97 of file pjsip_options.c.
| #define DEFAULT_LANGUAGE "en" |
Definition at line 96 of file pjsip_options.c.
| #define ENDPOINT_STATE_COMPOSITOR_BUCKETS 13 |
These are the number of buckets to store endpoint state compositors.
Definition at line 117 of file pjsip_options.c.
| #define ENDPOINT_STATE_COMPOSITOR_INITIAL_SIZE 1 |
The initial vector size for the endpoint state compositors on an AOR.
Definition at line 120 of file pjsip_options.c.
| #define MAX_UNLOAD_TIMEOUT_TIME 10 /* Seconds */ |
Maximum wait time to join the below shutdown group.
Definition at line 126 of file pjsip_options.c.
|
static |
Definition at line 2859 of file pjsip_options.c.
References ao2_callback, ao2_container_count(), ao2_ref, astman_get_header(), astman_send_error(), astman_send_list_complete_end(), astman_send_list_complete_start(), astman_send_listack(), ast_sip_ami::count, format_ami_contactlist_handler(), get_all_contacts(), ast_sip_ami::m, OBJ_NODATA, and ast_sip_ami::s.
Referenced by ast_res_pjsip_init_options_handling().
|
static |
Definition at line 3074 of file pjsip_options.c.
References ao2_cleanup, ao2_find, ao2_ref, ast_sip_get_sorcery(), ast_sip_push_task_wait_serializer, ast_sorcery_retrieve_by_id(), ast_strdupa, ast_strip(), ast_strlen_zero(), astman_get_header(), astman_send_ack(), astman_send_error(), NULL, OBJ_SEARCH_KEY, RAII_VAR, sip_options_aor::serializer, sip_options_aors, sip_options_qualify_aor(), and strsep().
Referenced by ast_res_pjsip_init_options_handling().
| AO2_STRING_FIELD_CMP_FN | ( | ast_sip_contact_status | , |
| name | |||
| ) |
Comparator function for contact statuses.
| AO2_STRING_FIELD_CMP_FN | ( | sip_options_aor | , |
| name | |||
| ) |
Comparator function for SIP OPTIONS AORs.
| AO2_STRING_FIELD_CMP_FN | ( | sip_options_endpoint_aor_status | , |
| name | |||
| ) |
Comparator function for endpoint AOR status.
| AO2_STRING_FIELD_CMP_FN | ( | sip_options_endpoint_state_compositor | , |
| name | |||
| ) |
Comparator function for endpoint state compositors.
| AO2_STRING_FIELD_HASH_FN | ( | ast_sip_contact_status | , |
| name | |||
| ) |
Hashing function for contact statuses.
| AO2_STRING_FIELD_HASH_FN | ( | sip_options_aor | , |
| name | |||
| ) |
Hashing function for OPTIONS AORs.
| AO2_STRING_FIELD_HASH_FN | ( | sip_options_endpoint_aor_status | , |
| name | |||
| ) |
Hashing function for endpoint AOR status.
| AO2_STRING_FIELD_HASH_FN | ( | sip_options_endpoint_state_compositor | , |
| name | |||
| ) |
Hashing function for endpoint state compositors.
| AO2_STRING_FIELD_SORT_FN | ( | ast_sip_contact_status | , |
| name | |||
| ) |
Sort function for contact statuses.
|
static |
Observer callback invoked on AOR deletion.
Definition at line 2451 of file pjsip_options.c.
References ast_sip_push_task_wait_serializer, management_serializer, and sip_options_aor_observer_deleted_task().
|
static |
Observer callback invoked on AOR creation or modification.
Definition at line 2420 of file pjsip_options.c.
References ast_sip_push_task_wait_serializer, management_serializer, and sip_options_aor_observer_modified_task().
| void ast_res_pjsip_cleanup_options_handling | ( | void | ) |
Definition at line 3246 of file pjsip_options.c.
References ao2_cleanup, aor_observer_callbacks, ARRAY_LEN, ast_cli_unregister_multiple(), ast_manager_unregister(), ast_sip_get_pjsip_endpoint(), ast_sip_get_sorcery(), ast_sip_push_task_wait_serializer, ast_sip_unregister_endpoint_formatter(), ast_sorcery_observer_remove(), ast_taskprocessor_unreference(), cli_options, contact_observer_callbacks, contact_status_formatter, endpoint_observer_callbacks, management_serializer, NULL, options_module, sip_options_aors, sip_options_cleanup_task(), sip_options_contact_statuses, and sip_options_endpoint_state_compositors.
Referenced by ast_res_pjsip_init_options_handling(), and unload_pjsip().
| struct ast_sip_contact_status * ast_res_pjsip_find_or_create_contact_status | ( | const struct ast_sip_contact * | contact | ) |
Definition at line 463 of file pjsip_options.c.
References ao2_find, ao2_link_flags, ao2_lock, ao2_ref, ao2_unlock, ast_sip_contact::aor, ast_sip_contact_status::aor, ast_assert, ast_sip_get_contact_status_label(), ast_sorcery_object_get_id(), AST_STATSD_GAUGE, ast_statsd_log_string_va(), ast_string_field_set, CREATED, ast_sip_contact_status::last_status, NULL, OBJ_NOLOCK, OBJ_SEARCH_KEY, ast_sip_contact_status::rtt, sip_contact_status_alloc(), sip_options_contact_status_update(), sip_options_contact_statuses, ast_sip_contact_status::status, ast_sip_contact::uri, and ast_sip_contact_status::uri.
Referenced by contact_apply_handler(), permanent_uri_handler(), sip_options_contact_add_task(), sip_options_contact_status_available_count(), sip_options_qualify_contact(), sip_options_set_contact_status_qualified(), and sip_options_set_contact_status_unqualified().
| int ast_res_pjsip_init_options_handling | ( | int | reload | ) |
Definition at line 3311 of file pjsip_options.c.
References ami_show_contacts(), ami_sip_qualify(), AO2_ALLOC_OPT_LOCK_RWLOCK, ao2_container_alloc_hash, AOR_BUCKETS, ARRAY_LEN, ast_cli_register_multiple, ast_manager_register_xml, ast_res_pjsip_cleanup_options_handling(), ast_sip_create_serializer(), ast_sip_get_pjsip_endpoint(), ast_sip_push_task_wait_serializer, ast_sip_register_endpoint_formatter(), ast_taskprocessor_alert_set_levels(), AST_TASKPROCESSOR_HIGH_WATER_LEVEL, cli_options, contact_status_formatter, ENDPOINT_STATE_COMPOSITOR_BUCKETS, EVENT_FLAG_REPORTING, EVENT_FLAG_SYSTEM, management_serializer, NULL, options_module, reload(), sip_options_aors, sip_options_endpoint_state_compositors, sip_options_init_task(), and sip_options_synchronize().
Referenced by load_module(), and reload_configuration_task().
| int ast_res_pjsip_preinit_options_handling | ( | void | ) |
Definition at line 3305 of file pjsip_options.c.
References sip_options_contact_statuses, and sip_options_contact_statuses_alloc().
Referenced by load_module().
| int ast_sip_format_contact_ami | ( | void * | obj, |
| void * | arg, | ||
| int | flags | ||
| ) |
Formats the contact and sends over AMI.
| obj | a pointer an ast_sip_contact_wrapper structure |
| arg | a pointer to an ast_sip_ami structure |
| flags | ignored |
| 0 | Success, otherwise non-zero on error |
Definition at line 3125 of file pjsip_options.c.
References ao2_cleanup, ast_sip_contact_wrapper::aor_id, ast_sip_ami::arg, ast_free, ast_sip_create_ami_event(), ast_sip_get_contact_status(), ast_sip_get_contact_status_label(), ast_sorcery_object_get_id(), ast_str_append(), ast_str_buffer(), ast_strlen_zero(), AST_TIME_T_LEN, ast_time_t_to_string(), astman_append(), ast_sip_contact::authenticate_qualify, AVAILABLE, buf, ast_sip_contact::call_id, ast_sip_contact_wrapper::contact, ast_sip_ami::count, ast_sip_contact::endpoint_name, ast_sip_contact::expiration_time, ast_sip_contact::outbound_proxy, ast_sip_contact::path, ast_sip_contact::qualify_2xx_only, ast_sip_contact::qualify_frequency, ast_sip_contact::qualify_timeout, ast_sip_ami::s, S_OR, status, UNKNOWN, ast_sip_contact::uri, ast_sip_contact::user_agent, ast_sip_contact::via_addr, and ast_sip_contact::via_port.
Referenced by ami_show_registration_contact_statuses(), and format_contact_status_for_aor().
| const char * ast_sip_get_contact_short_status_label | ( | const enum ast_sip_contact_status_type | status | ) |
Definition at line 338 of file pjsip_options.c.
References ARRAY_LEN, ast_assert, short_status_map, and status.
Referenced by cli_contact_print_body().
| struct ast_sip_contact_status * ast_sip_get_contact_status | ( | const struct ast_sip_contact * | contact | ) |
Retrieve the current status for a contact.
| contact | The contact. |
| non-NULL | Success |
| NULL | Status information not found |
Definition at line 524 of file pjsip_options.c.
References ao2_find, ast_sorcery_object_get_id(), OBJ_SEARCH_KEY, and sip_options_contact_statuses.
Referenced by add_outgoing_request_headers(), ast_sip_format_contact_ami(), cli_contact_print_body(), contact_add_security_headers_to_status(), contact_has_security_mechanisms(), contact_remove_unreachable(), format_ami_contactlist_handler(), pjsip_contact_function_read(), registrar_add_unreachable(), rfc3329_incoming_response(), sip_options_contact_update_task(), and vec_contact_cmp().
| const char * ast_sip_get_contact_status_label | ( | const enum ast_sip_contact_status_type | status | ) |
translate ast_sip_contact_status_type to character string.
| the | character string equivalent. |
Definition at line 332 of file pjsip_options.c.
References ARRAY_LEN, ast_assert, and status.
Referenced by ast_res_pjsip_find_or_create_contact_status(), ast_sip_format_contact_ami(), ast_sip_initialize_sorcery_location(), ast_sip_persistent_endpoint_publish_contact_state(), format_ami_contactlist_handler(), pjsip_contact_function_read(), sip_options_contact_status_notify_task(), sip_options_remove_contact_status(), and sip_options_set_contact_status().
|
static |
Definition at line 2752 of file pjsip_options.c.
References a, ao2_cleanup, ao2_find, ao2_ref, ast_cli(), ast_sip_get_sorcery(), ast_sip_push_task_wait_serializer, ast_sorcery_retrieve_by_id(), ast_strdupa, ast_strip(), ast_strlen_zero(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, OBJ_SEARCH_KEY, RAII_VAR, sip_options_aor::serializer, sip_options_aors, sip_options_qualify_aor(), strsep(), and ast_cli_entry::usage.
|
static |
Definition at line 3038 of file pjsip_options.c.
References a, ao2_ref, ast_cli(), ast_sip_get_sorcery(), ast_sip_push_task_wait_serializer, ast_sorcery_retrieve_by_id(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, management_serializer, NULL, sip_options_aor_observer_modified_task(), and ast_cli_entry::usage.
|
static |
Definition at line 2984 of file pjsip_options.c.
References a, ao2_cleanup, ao2_ref, ast_cli(), ast_sip_get_sorcery(), ast_sip_push_task_wait_serializer, ast_sorcery_retrieve_by_id(), ast_strdupa, ast_strip(), ast_strlen_zero(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, management_serializer, NULL, RAII_VAR, sip_options_aor_observer_modified_task(), strsep(), and ast_cli_entry::usage.
|
static |
Definition at line 2946 of file pjsip_options.c.
References a, ao2_find, ao2_ref, ast_cli(), sip_options_aor::authenticate_qualify, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, OBJ_SEARCH_KEY, sip_options_aor::qualify_2xx_only, sip_options_aor::qualify_frequency, sip_options_aor::qualify_timeout, sip_options_aors, and ast_cli_entry::usage.
|
static |
Definition at line 2889 of file pjsip_options.c.
References a, ao2_cleanup, ao2_find, ao2_ref, ast_cli(), ast_sip_get_sorcery(), ast_sorcery_retrieve_by_id(), ast_strdupa, ast_strip(), ast_strlen_zero(), sip_options_aor::authenticate_qualify, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, OBJ_SEARCH_KEY, sip_options_aor::qualify_2xx_only, sip_options_aor::qualify_frequency, sip_options_aor::qualify_timeout, RAII_VAR, sip_options_aors, strsep(), and ast_cli_entry::usage.
|
static |
Observer callback invoked on contact creation.
Definition at line 2593 of file pjsip_options.c.
References ast_sip_push_task_wait_serializer, management_serializer, and sip_options_contact_add_management_task().
|
static |
Observer callback invoked on contact deletion.
Definition at line 2739 of file pjsip_options.c.
References ast_sip_push_task_wait_serializer, management_serializer, and sip_options_contact_delete_management_task().
|
static |
Observer callback invoked on contact update.
Definition at line 2631 of file pjsip_options.c.
References ao2_cleanup, ao2_find, ao2_ref, ast_sip_contact::aor, sip_options_contact_observer_task_data::aor_options, ast_debug, ast_free, ast_malloc, ast_sip_get_send_contact_status_on_update_registration(), ast_sip_get_sorcery(), ast_sip_push_task, ast_sip_push_task_wait_serializer, ast_sorcery_retrieve_by_id(), has_qualify_changed(), management_serializer, OBJ_SEARCH_KEY, sip_options_aor_observer_modified_task(), sip_options_aors, and sip_options_contact_update_task().
|
static |
Task to notify endpoints of a contact status change.
Definition at line 435 of file pjsip_options.c.
References ao2_find, ao2_ref, ast_sip_contact_status::aor, OBJ_SEARCH_KEY, sip_options_aors, and sip_options_publish_contact_state().
Referenced by sip_options_contact_status_update().
|
static |
Observer callback invoked on endpoint deletion.
Definition at line 2288 of file pjsip_options.c.
References ast_sip_push_task_wait_serializer, management_serializer, and sip_options_endpoint_observer_deleted_task().
|
static |
Observer callback invoked on endpoint creation or modification.
Definition at line 2320 of file pjsip_options.c.
References ast_sip_push_task_wait_serializer, management_serializer, and sip_options_endpoint_observer_modified_task().
|
static |
Definition at line 3190 of file pjsip_options.c.
References ast_sip_endpoint::aors, ast_sip_ami::arg, ast_sip_for_each_aor(), and format_contact_status_for_aor().
|
static |
Definition at line 2822 of file pjsip_options.c.
References ao2_cleanup, ast_sip_ami::arg, ast_free, ast_sip_create_ami_event(), ast_sip_get_contact_status(), ast_sip_get_contact_status_label(), ast_str_append(), ast_str_buffer(), astman_append(), AVAILABLE, buf, CMP_STOP, ast_sip_ami::count, ast_sip_ami::s, sip_contact_to_ami(), status, and UNKNOWN.
Referenced by ami_show_contacts().
|
static |
Definition at line 3183 of file pjsip_options.c.
References ast_sip_for_each_contact(), and ast_sip_format_contact_ami().
Referenced by format_ami_contact_status().
|
static |
Definition at line 2806 of file pjsip_options.c.
References AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sip_get_sorcery(), ast_sorcery_retrieve_by_fields(), and NULL.
Referenced by ami_show_contacts().
|
static |
Check if the contact qualify options are different than local aor qualify options.
Definition at line 2476 of file pjsip_options.c.
References ast_sip_contact::authenticate_qualify, sip_options_aor::authenticate_qualify, ast_sip_contact::qualify_2xx_only, sip_options_aor::qualify_2xx_only, ast_sip_contact::qualify_frequency, sip_options_aor::qualify_frequency, ast_sip_contact::qualify_timeout, and sip_options_aor::qualify_timeout.
Referenced by contact_observer_updated(), and sip_options_contact_add_management_task().
|
static |
Definition at line 266 of file pjsip_options.c.
References ao2_cleanup, ast_copy_pj_str(), ast_exists_extension(), AST_MAX_EXTENSION, ast_pjsip_rdata_get_endpoint(), ast_shutting_down(), ast_sip_is_allowed_uri(), ast_sip_pjsip_uri_get_username(), AST_SIP_USER_OPTIONS_TRUNCATE_CHECK, ast_strlen_zero(), NULL, RAII_VAR, and send_options_response().
|
static |
Callback for an OPTIONS response, timeout, or transport error.
Definition at line 1018 of file pjsip_options.c.
References ao2_ref, sip_options_contact_callback_data::aor_options, ast_debug, ast_log, ast_sorcery_object_get_id(), AVAILABLE, sip_options_contact_callback_data::contact, LOG_ERROR, sip_options_aor::qualify_2xx_only, sip_options_queue_target_result(), status, and UNAVAILABLE.
Referenced by sip_options_qualify_resolve_task().
|
static |
Definition at line 214 of file pjsip_options.c.
References ao2_cleanup, ast_log, ast_pjsip_rdata_get_endpoint(), ast_sip_add_header(), ast_sip_create_response(), ast_sip_get_pjsip_endpoint(), ast_sip_send_stateful_response(), DEFAULT_ENCODING, DEFAULT_LANGUAGE, LOG_ERROR, NULL, and status.
Referenced by options_on_rx_request().
|
static |
Definition at line 354 of file pjsip_options.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_ref, ast_string_field_init, AST_VECTOR_INIT, ast_sip_contact_status::name, name, NULL, ast_sip_contact_status::security_mechanisms, and sip_contact_status_dtor().
Referenced by ast_res_pjsip_find_or_create_contact_status(), and sip_contact_status_copy().
|
static |
Definition at line 373 of file pjsip_options.c.
References ao2_ref, ast_sip_security_mechanisms_vector_copy(), ast_string_fields_copy, ast_sip_contact_status::last_status, ast_sip_contact_status::name, NULL, ast_sip_contact_status::rtt, ast_sip_contact_status::security_mechanisms, sip_contact_status_alloc(), and ast_sip_contact_status::status.
Referenced by sip_options_contact_status_notify_task(), sip_options_remove_contact_status(), and sip_options_set_contact_status().
|
static |
Destructor for contact statuses.
Definition at line 345 of file pjsip_options.c.
References ast_sip_security_mechanisms_vector_destroy(), ast_string_field_free_memory, and ast_sip_contact_status::security_mechanisms.
Referenced by sip_contact_status_alloc().
|
static |
Definition at line 2816 of file pjsip_options.c.
References ast_sip_sorcery_object_to_ami(), and buf.
Referenced by format_ami_contactlist_handler().
|
static |
Allocator for AOR OPTIONS.
Definition at line 1371 of file pjsip_options.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_container_alloc_hash, AO2_CONTAINER_ALLOC_OPT_DUPS_REJECT, ao2_ref, ast_sip_get_distributor_serializer_hash(), ast_sorcery_object_get_id(), ast_sorcery_object_id_compare(), ast_sorcery_object_id_hash(), ast_sorcery_object_id_sort(), ast_str_hash(), AST_VECTOR_INIT, sip_options_aor::compositors, CONTACT_BUCKETS, sip_options_aor::contacts, sip_options_aor::dynamic_contacts, ENDPOINT_STATE_COMPOSITOR_INITIAL_SIZE, sip_options_aor::name, NULL, sip_options_aor::serializer, and sip_options_aor_dtor().
Referenced by sip_options_aor_observer_modified_task(), and sip_options_synchronize_aor().
|
static |
Destructor function for SIP OPTIONS AORs.
Definition at line 1349 of file pjsip_options.c.
References ao2_callback, ao2_cleanup, ao2_ref, ast_assert, ast_taskprocessor_unreference(), AST_VECTOR_FREE, AST_VECTOR_SIZE, sip_options_aor::compositors, sip_options_aor::contacts, sip_options_aor::dynamic_contacts, OBJ_NODATA, OBJ_UNLINK, sip_options_aor::serializer, and sip_options_remove_contact().
Referenced by sip_options_aor_alloc().
|
static |
Task to delete an AOR from the known universe.
Definition at line 2430 of file pjsip_options.c.
References ao2_find, ao2_ref, ast_debug, ast_sip_push_task_wait_serializer, ast_sorcery_object_get_id(), sip_options_aor::name, OBJ_SEARCH_KEY, OBJ_UNLINK, sip_options_aor::serializer, sip_options_aor_remove_task(), and sip_options_aors.
Referenced by aor_observer_deleted().
|
static |
Task to synchronize the AOR.
Definition at line 2365 of file pjsip_options.c.
References ao2_callback, ao2_find, ao2_link, ao2_ref, sip_options_synchronize_aor_task_data::aor, sip_options_synchronize_aor_task_data::aor_options, AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sip_get_sorcery(), ast_sip_push_task_wait_serializer, ast_sorcery_object_get_id(), ast_sorcery_retrieve_by_fields(), endpoints, NULL, OBJ_NODATA, OBJ_SEARCH_KEY, sip_options_aor::serializer, sip_options_aor_alloc(), sip_options_aors, sip_options_apply_aor_configuration(), sip_options_synchronize_endpoint(), and sip_options_update_aor_task().
Referenced by aor_observer_modified(), cli_reload_qualify_aor(), cli_reload_qualify_endpoint(), contact_observer_updated(), and sip_options_contact_add_management_task().
|
static |
Task which removes an AOR from all of the ESCs it is reporting to.
Definition at line 2093 of file pjsip_options.c.
References ao2_ref, ast_sip_sched_task_cancel(), NULL, REMOVED, sip_options_aor::sched_task, and sip_options_notify_endpoint_state_compositors().
Referenced by sip_options_aor_observer_deleted_task(), and sip_options_unused_aor().
|
static |
Function which applies configuration to an AOR options structure.
Definition at line 1644 of file pjsip_options.c.
References ao2_callback, ao2_container_clone, ao2_container_count(), ao2_container_dup(), ao2_find, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_link, ao2_ref, ast_debug, ast_log, ast_sip_get_sorcery(), ast_sip_sched_task_cancel(), AST_SIP_SCHED_TASK_DATA_AO2, AST_SIP_SCHED_TASK_VARIABLE, ast_sip_schedule_task(), ast_sorcery_object_get_id(), ast_sorcery_retrieve_by_prefix(), ast_taskprocessor_name(), ast_sip_aor::authenticate_qualify, sip_options_aor::authenticate_qualify, sip_options_aor::available, sip_options_aor::contacts, sip_options_aor::dynamic_contacts, LOG_ERROR, LOG_WARNING, sip_options_aor::name, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_SEARCH_KEY, OBJ_UNLINK, ast_sip_aor::permanent_contacts, prefix, ast_sip_aor::qualify_2xx_only, sip_options_aor::qualify_2xx_only, ast_sip_aor::qualify_frequency, sip_options_aor::qualify_frequency, ast_sip_aor::qualify_timeout, sip_options_aor::qualify_timeout, sip_options_aor::sched_task, sip_options_aor::serializer, sip_options_contact_status_available_count(), sip_options_determine_initial_qualify_time(), sip_options_qualify_aor(), sip_options_remove_contact(), sip_options_set_contact_status_qualified(), and sip_options_set_contact_status_unqualified().
Referenced by sip_options_aor_observer_modified_task(), sip_options_synchronize_aor_task(), and sip_options_update_aor_task().
|
static |
Apply a request's transport selector to its DNS destination.
pjsip_get_request_dest builds the destination from the Request-URI and may miss an outbound transport/listener. Before manual DNS resolution, apply the selected transport to the destination and check for mismatches so we use the correct transport for the request.
Definition at line 1113 of file pjsip_options.c.
Referenced by sip_options_qualify_contact().
|
static |
Terminate all in-flight target transactions for a batch.
Definition at line 689 of file pjsip_options.c.
References AST_VECTOR_GET, AST_VECTOR_SIZE, and batch.
Referenced by sip_options_target_result_task().
|
static |
Management task to clean up an AOR.
Definition at line 3205 of file pjsip_options.c.
References ao2_cleanup, ao2_ref, ast_debug, ast_sip_sched_task_cancel(), AST_VECTOR_RESET, sip_options_aor::compositors, sip_options_aor::name, NULL, sip_options_aor::qualify_frequency, and sip_options_aor::sched_task.
Referenced by sip_options_cleanup_task().
|
static |
Management task to clean up the environment.
Definition at line 3226 of file pjsip_options.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, AO2_ITERATOR_UNLINK, ao2_ref, ast_sip_push_task_wait_serializer, sip_options_aor::serializer, sip_options_aors, and sip_options_cleanup_aor_task().
Referenced by ast_res_pjsip_cleanup_options_handling().
|
static |
Task to add a dynamic contact to an AOR in its serializer.
Definition at line 2560 of file pjsip_options.c.
References ao2_find, ao2_ref, ast_debug, ast_sip_get_sorcery(), ast_sip_push_task_wait_serializer, ast_sorcery_retrieve_by_id(), has_qualify_changed(), OBJ_SEARCH_KEY, sip_options_aor_observer_modified_task(), sip_options_aors, and sip_options_contact_add_task().
Referenced by contact_observer_created().
|
static |
Task which adds a dynamic contact to an AOR.
Definition at line 2500 of file pjsip_options.c.
References ao2_cleanup, ao2_container_count(), ao2_link, ao2_ref, ast_debug, ast_log, ast_res_pjsip_find_or_create_contact_status(), ast_sip_sched_task_cancel(), AST_SIP_SCHED_TASK_DATA_AO2, AST_SIP_SCHED_TASK_VARIABLE, ast_sip_schedule_task(), ast_taskprocessor_name(), AVAILABLE, LOG_ERROR, NULL, sip_options_notify_endpoint_state_compositors(), and sip_options_qualify_aor().
Referenced by sip_options_contact_add_management_task().
|
static |
Contact callback data allocator.
Definition at line 1078 of file pjsip_options.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_bump, ao2_ref, sip_options_contact_callback_data::aor_options, ast_tvnow(), AST_VECTOR_INIT, sip_options_contact_callback_data::contact, sip_options_contact_callback_data::endpoint, NULL, sip_options_contact_callback_data::resolve_tdata, sip_options_contact_callback_data::rtt_start, sip_options_contact_callback_data_dtor(), and sip_options_contact_callback_data::target_transactions.
Referenced by sip_options_qualify_contact().
|
static |
Destructor for contact callback data.
Definition at line 1057 of file pjsip_options.c.
References ao2_cleanup, sip_options_contact_callback_data::aor_options, AST_VECTOR_FREE, AST_VECTOR_RESET, sip_options_contact_callback_data::contact, sip_options_contact_callback_data::endpoint, NULL, sip_options_contact_callback_data::resolve_tdata, sip_options_transaction_free(), and sip_options_contact_callback_data::target_transactions.
Referenced by sip_options_contact_callback_data_alloc().
|
static |
Task to delete a contact from an AOR in its serializer.
Definition at line 2719 of file pjsip_options.c.
References ao2_find, ao2_ref, ast_sip_push_task_wait_serializer, OBJ_SEARCH_KEY, sip_options_aors, and sip_options_contact_delete_task().
Referenced by contact_observer_deleted().
|
static |
Task which deletes a dynamic contact from an AOR.
Definition at line 2679 of file pjsip_options.c.
References ao2_container_count(), ao2_find, ao2_ref, ast_debug, ast_sip_sched_task_cancel(), NULL, OBJ_NODATA, OBJ_SEARCH_OBJECT, OBJ_UNLINK, sip_options_notify_endpoint_state_compositors(), sip_options_remove_contact_status(), and UNAVAILABLE.
Referenced by sip_options_contact_delete_management_task().
|
static |
Count AVAILABLE qualified contacts.
Definition at line 1612 of file pjsip_options.c.
References ao2_ref, ast_res_pjsip_find_or_create_contact_status(), available(), AVAILABLE, CREATED, REMOVED, ast_sip_contact_status::status, UNAVAILABLE, and UNKNOWN.
Referenced by sip_options_apply_aor_configuration().
|
static |
Task to notify an AOR of a contact status change.
Definition at line 811 of file pjsip_options.c.
References ao2_find, ao2_link, ao2_ref, ast_sip_contact_status::aor, sip_options_contact_callback_data::aor_options, ast_assert, ast_debug, ast_sip_get_contact_status_label(), ast_sorcery_object_get_id(), AST_STATSD_GAUGE, ast_statsd_log_full_va(), ast_statsd_log_string_va(), AST_STATSD_TIMER, ast_test_suite_event_notify, ast_tvdiff_us(), ast_tvnow(), ast_verb, AVAILABLE, sip_options_aor::available, sip_options_contact_callback_data::contact, sip_options_aor::contacts, ast_sip_contact_status::last_status, ast_sip_contact_status::name, sip_options_aor::name, OBJ_SEARCH_KEY, OBJ_SEARCH_OBJECT, sip_options_aor::qualify_frequency, ast_sip_contact_status::rtt, sip_options_contact_callback_data::rtt_start, sip_contact_status_copy(), sip_options_contact_status_update(), sip_options_contact_statuses, sip_options_notify_endpoint_state_compositors(), ast_sip_contact_status::status, sip_options_contact_callback_data::status, UNAVAILABLE, and ast_sip_contact_status::uri.
Referenced by sip_options_target_result_task().
|
static |
Definition at line 450 of file pjsip_options.c.
References ao2_ref, ast_sip_push_task, contact_status_publish_update_task(), and management_serializer.
Referenced by ast_res_pjsip_find_or_create_contact_status(), sip_options_contact_status_notify_task(), sip_options_contact_update_task(), sip_options_remove_contact_status(), and sip_options_set_contact_status().
|
static |
Helper function to allocate a contact statuses container.
Definition at line 404 of file pjsip_options.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE, and CONTACT_STATUS_BUCKETS.
Referenced by ast_res_pjsip_preinit_options_handling().
|
static |
Task which updates a dynamic contact to an AOR.
Definition at line 2603 of file pjsip_options.c.
References ao2_ref, ast_free, ast_sip_get_contact_status(), AVAILABLE, CREATED, REMOVED, sip_options_contact_status_update(), ast_sip_contact_status::status, UNAVAILABLE, and UNKNOWN.
Referenced by contact_observer_updated().
|
static |
Determine an initial time for scheduling AOR qualifying.
Definition at line 1498 of file pjsip_options.c.
References ast_random_double, ast_sip_get_max_initial_qualify_time(), and sip_options_aor::qualify_frequency.
Referenced by sip_options_apply_aor_configuration().
|
static |
Task which adds an AOR to an endpoint state compositor.
Definition at line 1932 of file pjsip_options.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_debug, AST_VECTOR_APPEND, AVAILABLE, sip_options_update_endpoint_state_compositor_aor(), and UNAVAILABLE.
Referenced by sip_options_synchronize_endpoint().
|
static |
Task which adds removes an AOR from an endpoint state compositor.
Definition at line 1960 of file pjsip_options.c.
References ao2_ref, ast_debug, AST_VECTOR_GET, AST_VECTOR_REMOVE, and AST_VECTOR_SIZE.
Referenced by sip_options_endpoint_unlink_aor_feeders().
|
static |
Task to delete an endpoint from the known universe.
Definition at line 2268 of file pjsip_options.c.
References ao2_find, ao2_ref, ast_debug, ast_sorcery_object_get_id(), OBJ_SEARCH_KEY, OBJ_UNLINK, sip_options_endpoint_state_compositors, and sip_options_endpoint_unlink_aor_feeders().
Referenced by endpoint_observer_deleted().
|
static |
Task to synchronize the endpoint.
Definition at line 2298 of file pjsip_options.c.
References ao2_find, ao2_ref, ast_debug, ast_sorcery_object_get_id(), NULL, OBJ_SEARCH_KEY, OBJ_UNLINK, sip_options_endpoint_state_compositors, sip_options_endpoint_unlink_aor_feeders(), and sip_options_synchronize_endpoint().
Referenced by endpoint_observer_modified().
|
static |
Destructor for endpoint state compositors.
Definition at line 1863 of file pjsip_options.c.
References ao2_cleanup, and sip_options_endpoint_state_compositor::aor_statuses.
Referenced by sip_options_endpoint_state_compositor_find_or_alloc().
|
static |
Find (or create) an endpoint state compositor.
Definition at line 1877 of file pjsip_options.c.
References ao2_alloc, AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_container_alloc_hash, ao2_find, ao2_link_flags, ao2_lock, ao2_ref, ao2_unlock, AOR_STATUS_BUCKETS, sip_options_endpoint_state_compositor::aor_statuses, ast_sorcery_object_get_id(), sip_options_endpoint_state_compositor::name, NULL, OBJ_NOLOCK, OBJ_SEARCH_KEY, sip_options_endpoint_state_compositor_dtor(), and sip_options_endpoint_state_compositors.
Referenced by sip_options_synchronize_endpoint().
|
static |
Unlink AORs feeding the endpoint status compositor.
Definition at line 2224 of file pjsip_options.c.
References sip_options_endpoint_state_compositor::active, ao2_find, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, sip_options_endpoint_state_compositor::aor_statuses, ast_debug, ast_sip_push_task_wait_serializer, ast_sorcery_object_get_id(), sip_options_endpoint_compositor_task_data::endpoint_state_compositor, sip_options_endpoint_aor_status::name, OBJ_SEARCH_KEY, sip_options_aors, and sip_options_endpoint_compositor_remove_task().
Referenced by sip_options_endpoint_observer_deleted_task(), and sip_options_endpoint_observer_modified_task().
|
static |
Return the current state of an endpoint state compositor.
Definition at line 707 of file pjsip_options.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, sip_options_endpoint_state_compositor::aor_statuses, AST_ENDPOINT_OFFLINE, AST_ENDPOINT_ONLINE, and sip_options_endpoint_aor_status::available.
Referenced by sip_options_synchronize_endpoint(), and sip_options_update_endpoint_state_compositor_aor().
|
static |
Management task to finish setting up the environment.
Definition at line 3283 of file pjsip_options.c.
References aor_observer_callbacks, ast_sip_get_sorcery(), ast_sorcery_observer_add(), contact_observer_callbacks, endpoint_observer_callbacks, management_serializer, and sip_options_synchronize().
Referenced by ast_res_pjsip_init_options_handling().
|
static |
Function which notifies endpoint state compositors of a state change of an AOR.
Definition at line 785 of file pjsip_options.c.
References ao2_cleanup, ao2_lock, ao2_unlock, AST_VECTOR_GET, AST_VECTOR_RESET, AST_VECTOR_SIZE, sip_options_aor::compositors, sip_options_aor::name, REMOVED, sip_options_update_endpoint_state_compositor_aor(), and status.
Referenced by sip_options_aor_remove_task(), sip_options_contact_add_task(), sip_options_contact_delete_task(), sip_options_contact_status_notify_task(), sip_options_remove_contact_status(), and sip_options_update_aor_task().
|
static |
Function which publishes a contact status update to all interested endpoints.
Definition at line 417 of file pjsip_options.c.
References ast_sip_persistent_endpoint_publish_contact_state(), AST_VECTOR_GET, AST_VECTOR_SIZE, sip_options_aor::compositors, and sip_options_endpoint_state_compositor::name.
Referenced by contact_status_publish_update_task().
|
static |
Task to qualify contacts of an AOR.
Definition at line 1331 of file pjsip_options.c.
References ao2_callback, ast_debug, sip_options_aor::contacts, sip_options_aor::name, OBJ_NODATA, sip_options_aor::qualify_frequency, and sip_options_qualify_contact().
Referenced by ami_sip_qualify(), cli_qualify(), sip_options_apply_aor_configuration(), and sip_options_contact_add_task().
|
static |
Send a SIP OPTIONS request for a contact.
Definition at line 1236 of file pjsip_options.c.
References ao2_cleanup, ao2_ref, sip_options_contact_callback_data::aor_options, ast_debug, ast_log, ast_res_pjsip_find_or_create_contact_status(), ast_sip_create_request(), ast_sip_get_pjsip_endpoint(), ast_sip_get_sorcery(), ast_sip_set_outbound_proxy(), ast_sorcery_object_get_id(), ast_sorcery_retrieve_by_id(), ast_strlen_zero(), AST_VECTOR_GET, AST_VECTOR_SIZE, sip_options_aor::compositors, sip_options_contact_callback_data::contact, sip_options_contact_callback_data::endpoint, ast_sip_contact::endpoint_name, LOG_ERROR, sip_options_endpoint_state_compositor::name, sip_options_aor::name, NULL, ast_sip_contact::outbound_proxy, RAII_VAR, sip_options_apply_transport_to_destination(), sip_options_contact_callback_data_alloc(), sip_options_qualify_resolve_cb(), and ast_sip_contact::uri.
Referenced by sip_options_qualify_aor().
|
static |
DNS callback used to fan out a qualify to every resolved target.
Definition at line 1141 of file pjsip_options.c.
References sip_options_qualify_resolve_task_data::addresses, AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_bump, ao2_ref, ast_copy_pj_str(), ast_log, ast_malloc, ast_sip_push_task, ast_sorcery_object_get_id(), batch, LOG_WARNING, NULL, sip_options_qualify_resolve_task(), sip_options_qualify_resolve_task_dtor(), and status.
Referenced by sip_options_qualify_contact().
|
static |
Process a DNS resolution result on the AOR serializer.
Definition at line 590 of file pjsip_options.c.
References ao2_bump, ao2_ref, ast_sip_create_request(), ast_sip_send_out_of_dialog_request_with_tsx(), ast_sip_set_outbound_proxy(), ast_strlen_zero(), AST_VECTOR_APPEND, batch, NULL, qualify_contact_cb(), sip_options_queue_target_result(), and UNAVAILABLE.
Referenced by sip_options_qualify_resolve_cb().
|
static |
Definition at line 577 of file pjsip_options.c.
References ao2_ref, and ast_free.
Referenced by sip_options_qualify_resolve_cb().
|
static |
Queue a resolved target's qualification result to be combined with the other targets.
Definition at line 977 of file pjsip_options.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_bump, ao2_ref, ast_log, ast_sip_push_task, ast_sorcery_object_get_id(), ast_taskpool_serializer_get_current(), batch, LOG_WARNING, result, sip_options_target_result_dtor(), sip_options_target_result_task(), and status.
Referenced by qualify_contact_cb(), and sip_options_qualify_resolve_task().
|
static |
Forward declaration of this helpful function.
Callback function to remove a contact and its contact status from an AOR.
Definition at line 1487 of file pjsip_options.c.
References CMP_MATCH, and sip_options_remove_contact_status().
Referenced by sip_options_aor_dtor(), and sip_options_apply_aor_configuration().
|
static |
Remove contact status for a hint.
Definition at line 1414 of file pjsip_options.c.
References ao2_find, ao2_ref, ast_sip_contact::aor, ast_debug, ast_sip_get_contact_status_label(), ast_sorcery_object_get_id(), AST_STATSD_GAUGE, ast_statsd_log_string_va(), ast_verb, AVAILABLE, sip_options_aor::available, ast_sip_contact_status::last_status, sip_options_aor::name, OBJ_SEARCH_KEY, OBJ_UNLINK, sip_options_aor::qualify_frequency, REMOVED, ast_sip_contact_status::rtt, sip_contact_status_copy(), sip_options_contact_status_update(), sip_options_contact_statuses, sip_options_notify_endpoint_state_compositors(), ast_sip_contact_status::status, UNAVAILABLE, and ast_sip_contact::uri.
Referenced by sip_options_contact_delete_task(), and sip_options_remove_contact().
|
static |
Set the contact status for a contact.
Definition at line 1514 of file pjsip_options.c.
References ao2_link, ao2_ref, ast_sip_contact_status::aor, ast_sip_get_contact_status_label(), AST_STATSD_GAUGE, ast_statsd_log_string_va(), ast_test_suite_event_notify, ast_verb, ast_sip_contact_status::last_status, ast_sip_contact_status::name, ast_sip_contact_status::rtt, sip_contact_status_copy(), sip_options_contact_status_update(), sip_options_contact_statuses, status, ast_sip_contact_status::status, and ast_sip_contact_status::uri.
Referenced by sip_options_set_contact_status_qualified(), and sip_options_set_contact_status_unqualified().
|
static |
Transition the contact status to qualified mode.
Definition at line 1585 of file pjsip_options.c.
References ao2_ref, ast_res_pjsip_find_or_create_contact_status(), AVAILABLE, CREATED, REMOVED, sip_options_set_contact_status(), ast_sip_contact_status::status, UNAVAILABLE, and UNKNOWN.
Referenced by sip_options_apply_aor_configuration().
|
static |
Transition the contact status to unqualified mode.
Definition at line 1558 of file pjsip_options.c.
References ao2_ref, ast_res_pjsip_find_or_create_contact_status(), AVAILABLE, CREATED, REMOVED, sip_options_set_contact_status(), ast_sip_contact_status::status, UNAVAILABLE, and UNKNOWN.
Referenced by sip_options_apply_aor_configuration().
|
static |
Synchronize our local container of AORs and endpoint state compositors with the current configuration.
Definition at line 2210 of file pjsip_options.c.
References ast_sip_push_task_wait_serializer, management_serializer, reload(), and sip_options_synchronize_task().
Referenced by ast_res_pjsip_init_options_handling(), and sip_options_init_task().
|
static |
Synchronize an AOR with our local state.
Definition at line 1826 of file pjsip_options.c.
References ao2_find, ao2_link, ao2_ref, ast_sip_push_task_wait_serializer, ast_sorcery_object_get_id(), OBJ_NODATA, OBJ_SEARCH_KEY, OBJ_UNLINK, sip_options_aor_alloc(), sip_options_aors, and sip_options_synchronize_aor_task().
Referenced by sip_options_synchronize_task().
|
static |
Task to synchronize an AOR with our local state.
Definition at line 1788 of file pjsip_options.c.
References sip_options_endpoint_state_compositor::active, ao2_cleanup, ao2_lock, ao2_unlock, ast_debug, AST_VECTOR_GET, AST_VECTOR_RESET, AST_VECTOR_SIZE, REMOVED, sip_options_apply_aor_configuration(), and sip_options_update_endpoint_state_compositor_aor().
Referenced by sip_options_synchronize_aor().
|
static |
Synchronize an endpoint with our local state.
Definition at line 1989 of file pjsip_options.c.
References ao2_find, ao2_lock, ao2_ref, ao2_unlock, ast_sip_endpoint::aors, ast_debug, AST_ENDPOINT_OFFLINE, ast_log, ast_sip_persistent_endpoint_update_state(), ast_sip_push_task_wait_serializer, ast_sorcery_object_get_id(), ast_strdupa, ast_strip(), ast_strlen_zero(), LOG_WARNING, NULL, OBJ_SEARCH_KEY, sip_options_aors, sip_options_endpoint_compositor_add_task(), sip_options_endpoint_state_compositor_find_or_alloc(), sip_options_get_endpoint_state_compositor_state(), and strsep().
Referenced by sip_options_aor_observer_modified_task(), sip_options_endpoint_observer_modified_task(), and sip_options_synchronize_task().
|
static |
Task to synchronize our local container of AORs and endpoint state compositors with the current configuration.
Definition at line 2154 of file pjsip_options.c.
References ao2_callback, ao2_container_clone, ao2_ref, AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sip_get_sorcery(), ast_sorcery_retrieve_by_fields(), NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, sip_options_aors, sip_options_endpoint_state_compositors, sip_options_synchronize_aor(), sip_options_synchronize_endpoint(), sip_options_unused_aor(), and sip_options_unused_endpoint_state_compositor().
Referenced by sip_options_synchronize().
|
static |
Destructor for a resolved target's qualification result.
Definition at line 936 of file pjsip_options.c.
References ao2_cleanup, and result.
Referenced by sip_options_queue_target_result().
|
static |
Combine the result of one resolved target with the other targets.
Definition at line 946 of file pjsip_options.c.
References ao2_bump, ao2_ref, ast_assert, AVAILABLE, batch, result, sip_options_cancel_target_transactions(), sip_options_contact_status_notify_task(), and UNAVAILABLE.
Referenced by sip_options_queue_target_result().
|
static |
Definition at line 674 of file pjsip_options.c.
Referenced by sip_options_contact_callback_data_dtor().
|
static |
Callback which removes any unused AORs that remained after reloading.
Definition at line 2112 of file pjsip_options.c.
References ao2_unlink, ast_debug, ast_sip_push_task_wait_serializer, CMP_MATCH, sip_options_aor::name, sip_options_aor::serializer, sip_options_aor_remove_task(), and sip_options_aors.
Referenced by sip_options_synchronize_task().
|
static |
Callback function used to unlink and remove event state compositors that have no AORs feeding them.
Definition at line 2129 of file pjsip_options.c.
References ao2_container_count(), sip_options_endpoint_state_compositor::aor_statuses, AST_ENDPOINT_OFFLINE, ast_sip_persistent_endpoint_update_state(), CMP_MATCH, and sip_options_endpoint_state_compositor::name.
Referenced by sip_options_synchronize_task().
|
static |
Task to synchronize an AOR with our local state.
Definition at line 2337 of file pjsip_options.c.
References ast_debug, available(), AVAILABLE, sip_options_apply_aor_configuration(), sip_options_notify_endpoint_state_compositors(), and UNAVAILABLE.
Referenced by sip_options_aor_observer_modified_task().
|
static |
Update the AOR status on an endpoint state compositor.
Definition at line 731 of file pjsip_options.c.
References sip_options_endpoint_state_compositor::active, AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_find, ao2_link, ao2_ref, ao2_unlink, sip_options_endpoint_state_compositor::aor_statuses, ast_debug, AST_ENDPOINT_ONLINE, ast_sip_persistent_endpoint_update_state(), AVAILABLE, sip_options_endpoint_aor_status::available, sip_options_endpoint_aor_status::name, sip_options_endpoint_state_compositor::name, name, NULL, OBJ_NOLOCK, OBJ_SEARCH_KEY, REMOVED, sip_options_get_endpoint_state_compositor_state(), and status.
Referenced by sip_options_endpoint_compositor_add_task(), sip_options_notify_endpoint_state_compositors(), and sip_options_synchronize_aor_task().
|
static |
Observer callbacks for AORs.
Definition at line 2458 of file pjsip_options.c.
Referenced by ast_res_pjsip_cleanup_options_handling(), and sip_options_init_task().
|
static |
Definition at line 3117 of file pjsip_options.c.
Referenced by ast_res_pjsip_cleanup_options_handling(), and ast_res_pjsip_init_options_handling().
|
static |
Observer callbacks for contacts.
Definition at line 2746 of file pjsip_options.c.
Referenced by ast_res_pjsip_cleanup_options_handling(), and sip_options_init_task().
|
static |
Definition at line 3197 of file pjsip_options.c.
Referenced by ast_res_pjsip_cleanup_options_handling(), and ast_res_pjsip_init_options_handling().
|
static |
Observer callbacks for endpoints.
Definition at line 2327 of file pjsip_options.c.
Referenced by ast_res_pjsip_cleanup_options_handling(), and sip_options_init_task().
|
static |
Definition at line 212 of file pjsip_options.c.
Referenced by aor_observer_deleted(), aor_observer_modified(), ast_res_pjsip_cleanup_options_handling(), ast_res_pjsip_init_options_handling(), cli_reload_qualify_aor(), cli_reload_qualify_endpoint(), contact_observer_created(), contact_observer_deleted(), contact_observer_updated(), endpoint_observer_deleted(), endpoint_observer_modified(), sip_options_contact_status_update(), sip_options_init_task(), and sip_options_synchronize().
|
static |
Definition at line 309 of file pjsip_options.c.
Referenced by ast_res_pjsip_cleanup_options_handling(), and ast_res_pjsip_init_options_handling().
|
static |
Definition at line 324 of file pjsip_options.c.
Referenced by ast_sip_get_contact_short_status_label().
|
static |
Definition at line 194 of file pjsip_options.c.
Referenced by ami_sip_qualify(), ast_res_pjsip_cleanup_options_handling(), ast_res_pjsip_init_options_handling(), cli_qualify(), cli_show_qualify_aor(), cli_show_qualify_endpoint(), contact_observer_updated(), contact_status_publish_update_task(), sip_options_aor_observer_deleted_task(), sip_options_aor_observer_modified_task(), sip_options_cleanup_task(), sip_options_contact_add_management_task(), sip_options_contact_delete_management_task(), sip_options_endpoint_unlink_aor_feeders(), sip_options_synchronize_aor(), sip_options_synchronize_endpoint(), sip_options_synchronize_task(), and sip_options_unused_aor().
|
static |
Definition at line 200 of file pjsip_options.c.
Referenced by ast_res_pjsip_cleanup_options_handling(), ast_res_pjsip_find_or_create_contact_status(), ast_res_pjsip_preinit_options_handling(), ast_sip_get_contact_status(), sip_options_contact_status_notify_task(), sip_options_remove_contact_status(), and sip_options_set_contact_status().
|
static |
Definition at line 206 of file pjsip_options.c.
Referenced by ast_res_pjsip_cleanup_options_handling(), ast_res_pjsip_init_options_handling(), sip_options_endpoint_observer_deleted_task(), sip_options_endpoint_observer_modified_task(), sip_options_endpoint_state_compositor_find_or_alloc(), and sip_options_synchronize_task().
|
static |
Definition at line 316 of file pjsip_options.c.