Asterisk - The Open Source Telephony Project
18.5.0
|
#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/threadpool.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_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... | |
Macros | |
#define | AOR_BUCKETS 1567 |
These are the number of buckets to store AORs in. More... | |
#define | AOR_STATUS_BUCKETS 3 |
These are the number of buckets (per endpoint state compositor) to use to store AOR statuses. More... | |
#define | CONTACT_BUCKETS 13 |
These are the number of buckets (per AOR) to use to store contacts. More... | |
#define | CONTACT_STATUS_BUCKETS 1567 |
These are the number of contact status buckets. More... | |
#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. More... | |
#define | ENDPOINT_STATE_COMPOSITOR_INITIAL_SIZE 1 |
The initial vector size for the endpoint state compositors on an AOR. More... | |
#define | MAX_UNLOAD_TIMEOUT_TIME 10 /* Seconds */ |
Maximum wait time to join the below shutdown group. More... | |
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. More... | |
AO2_STRING_FIELD_CMP_FN (sip_options_aor, name) | |
Comparator function for SIP OPTIONS AORs. More... | |
AO2_STRING_FIELD_CMP_FN (sip_options_endpoint_state_compositor, name) | |
Comparator function for endpoint state compositors. More... | |
AO2_STRING_FIELD_CMP_FN (sip_options_endpoint_aor_status, name) | |
Comparator function for endpoint AOR status. More... | |
AO2_STRING_FIELD_HASH_FN (ast_sip_contact_status, name) | |
Hashing function for contact statuses. More... | |
AO2_STRING_FIELD_HASH_FN (sip_options_aor, name) | |
Hashing function for OPTIONS AORs. More... | |
AO2_STRING_FIELD_HASH_FN (sip_options_endpoint_state_compositor, name) | |
Hashing function for endpoint state compositors. More... | |
AO2_STRING_FIELD_HASH_FN (sip_options_endpoint_aor_status, name) | |
Hashing function for endpoint AOR status. More... | |
AO2_STRING_FIELD_SORT_FN (ast_sip_contact_status, name) | |
Sort function for contact statuses. More... | |
static void | aor_observer_deleted (const void *obj) |
Observer callback invoked on AOR deletion. More... | |
static void | aor_observer_modified (const void *obj) |
Observer callback invoked on AOR creation or modification. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
static void | contact_observer_deleted (const void *obj) |
Observer callback invoked on contact deletion. More... | |
static void | contact_observer_updated (const void *obj) |
Observer callback invoked on contact update. More... | |
static int | contact_status_publish_update_task (void *obj) |
Task to notify endpoints of a contact status change. More... | |
static void | endpoint_observer_deleted (const void *obj) |
Observer callback invoked on endpoint deletion. More... | |
static void | endpoint_observer_modified (const void *obj) |
Observer callback invoked on endpoint creation or modification. More... | |
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. More... | |
static pj_bool_t | options_on_rx_request (pjsip_rx_data *rdata) |
static void | qualify_contact_cb (void *token, pjsip_event *e) |
Callback for when we get a result from a SIP OPTIONS request (a response or a timeout) More... | |
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. More... | |
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. More... | |
static void | sip_options_aor_dtor (void *obj) |
Destructor function for SIP OPTIONS AORs. More... | |
static int | sip_options_aor_observer_deleted_task (void *obj) |
Task to delete an AOR from the known universe. More... | |
static int | sip_options_aor_observer_modified_task (void *obj) |
Task to synchronize the AOR. More... | |
static int | sip_options_aor_remove_task (void *obj) |
Task which removes an AOR from all of the ESCs it is reporting to. More... | |
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. More... | |
static int | sip_options_cleanup_aor_task (void *obj) |
Management task to clean up an AOR. More... | |
static int | sip_options_cleanup_task (void *obj) |
Management task to clean up the environment. More... | |
static int | sip_options_contact_add_management_task (void *obj) |
Task to add a dynamic contact to an AOR in its serializer. More... | |
static int | sip_options_contact_add_task (void *obj) |
Task which adds a dynamic contact to an AOR. More... | |
static struct sip_options_contact_callback_data * | sip_options_contact_callback_data_alloc (struct ast_sip_contact *contact, struct sip_options_aor *aor_options) |
Contact callback data allocator. More... | |
static void | sip_options_contact_callback_data_dtor (void *obj) |
Destructor for contact callback data. More... | |
static int | sip_options_contact_delete_management_task (void *obj) |
Task to delete a contact from an AOR in its serializer. More... | |
static int | sip_options_contact_delete_task (void *obj) |
Task which deletes a dynamic contact from an AOR. More... | |
static int | sip_options_contact_status_available_count (void *obj, void *arg, int flags) |
Count AVAILABLE qualified contacts. More... | |
static int | sip_options_contact_status_notify_task (void *obj) |
Task to notify an AOR of a contact status change. More... | |
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. More... | |
static int | sip_options_contact_update_task (void *obj) |
Task which updates a dynamic contact to an AOR. More... | |
static int | sip_options_determine_initial_qualify_time (int qualify_frequency) |
Determine an initial time for scheduling AOR qualifying. More... | |
static int | sip_options_endpoint_compositor_add_task (void *obj) |
Task which adds an AOR to an endpoint state compositor. More... | |
static int | sip_options_endpoint_compositor_remove_task (void *obj) |
Task which adds removes an AOR from an endpoint state compositor. More... | |
static int | sip_options_endpoint_observer_deleted_task (void *obj) |
Task to delete an endpoint from the known universe. More... | |
static int | sip_options_endpoint_observer_modified_task (void *obj) |
Task to synchronize the endpoint. More... | |
static void | sip_options_endpoint_state_compositor_dtor (void *obj) |
Destructor for endpoint state compositors. More... | |
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. More... | |
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. More... | |
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. More... | |
static int | sip_options_init_task (void *mgmt_serializer) |
Management task to finish setting up the environment. More... | |
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. More... | |
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. More... | |
static int | sip_options_qualify_aor (void *obj) |
Task to qualify contacts of an AOR. More... | |
static int | sip_options_qualify_contact (void *obj, void *arg, int flags) |
Send a SIP OPTIONS request for a contact. More... | |
static int | sip_options_remove_contact (void *obj, void *arg, int flags) |
Forward declaration of this helpful function. More... | |
static void | sip_options_remove_contact_status (struct sip_options_aor *aor_options, struct ast_sip_contact *contact) |
Remove contact status for a hint. More... | |
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. More... | |
static int | sip_options_set_contact_status_qualified (void *obj, void *arg, int flags) |
Transition the contact status to qualified mode. More... | |
static int | sip_options_set_contact_status_unqualified (void *obj, void *arg, int flags) |
Transition the contact status to unqualified mode. More... | |
static void | sip_options_synchronize (int reload) |
Synchronize our local container of AORs and endpoint state compositors with the current configuration. More... | |
static int | sip_options_synchronize_aor (void *obj, void *arg, int flags) |
Synchronize an AOR with our local state. More... | |
static int | sip_options_synchronize_aor_task (void *obj) |
Task to synchronize an AOR with our local state. More... | |
static int | sip_options_synchronize_endpoint (void *obj, void *arg, int flags) |
Synchronize an endpoint with our local state. More... | |
static int | sip_options_synchronize_task (void *obj) |
Task to synchronize our local container of AORs and endpoint state compositors with the current configuration. More... | |
static int | sip_options_unused_aor (void *obj, void *arg, int flags) |
Callback which removes any unused AORs that remained after reloading. More... | |
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. More... | |
static int | sip_options_update_aor_task (void *obj) |
Task to synchronize an AOR with our local state. More... | |
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. More... | |
Variables | |
static const struct ast_sorcery_observer | aor_observer_callbacks |
Observer callbacks for AORs. More... | |
static struct ast_cli_entry | cli_options [] |
static const struct ast_sorcery_observer | contact_observer_callbacks |
Observer callbacks for contacts. More... | |
static struct ast_sip_endpoint_formatter | contact_status_formatter |
static const struct ast_sorcery_observer | endpoint_observer_callbacks |
Observer callbacks for endpoints. More... | |
static struct ast_taskprocessor * | management_serializer |
static pjsip_module | options_module |
static const char * | short_status_map [] |
static struct ast_serializer_shutdown_group * | shutdown_group |
Shutdown group for options serializers. More... | |
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.
Referenced by ast_res_pjsip_init_options_handling().
#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.
Referenced by sip_options_endpoint_state_compositor_find_or_alloc().
#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.
Referenced by sip_options_aor_alloc().
#define CONTACT_STATUS_BUCKETS 1567 |
These are the number of contact status buckets.
Definition at line 110 of file pjsip_options.c.
Referenced by sip_options_contact_statuses_alloc().
#define DEFAULT_ENCODING "identity" |
Definition at line 97 of file pjsip_options.c.
Referenced by send_options_response().
#define DEFAULT_LANGUAGE "en" |
Definition at line 96 of file pjsip_options.c.
Referenced by send_options_response().
#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.
Referenced by ast_res_pjsip_init_options_handling().
#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.
Referenced by sip_options_aor_alloc().
#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.
Referenced by ast_res_pjsip_cleanup_options_handling().
|
static |
Definition at line 2453 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 2666 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_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.
Referenced by ast_sip_get_contact_status(), sip_contact_status_copy(), and sip_options_endpoint_state_compositor_dtor().
AO2_STRING_FIELD_CMP_FN | ( | sip_options_aor | , |
name | |||
) |
Comparator function for SIP OPTIONS AORs.
AO2_STRING_FIELD_CMP_FN | ( | sip_options_endpoint_state_compositor | , |
name | |||
) |
Comparator function for endpoint state compositors.
AO2_STRING_FIELD_CMP_FN | ( | sip_options_endpoint_aor_status | , |
name | |||
) |
Comparator function for endpoint AOR status.
AO2_STRING_FIELD_HASH_FN | ( | ast_sip_contact_status | , |
name | |||
) |
Hashing function for contact statuses.
Referenced by ast_sip_get_contact_status(), sip_contact_status_copy(), and sip_options_endpoint_state_compositor_dtor().
AO2_STRING_FIELD_HASH_FN | ( | sip_options_aor | , |
name | |||
) |
Hashing function for OPTIONS AORs.
AO2_STRING_FIELD_HASH_FN | ( | sip_options_endpoint_state_compositor | , |
name | |||
) |
Hashing function for endpoint state compositors.
AO2_STRING_FIELD_HASH_FN | ( | sip_options_endpoint_aor_status | , |
name | |||
) |
Hashing function for endpoint AOR status.
AO2_STRING_FIELD_SORT_FN | ( | ast_sip_contact_status | , |
name | |||
) |
Sort function for contact statuses.
Referenced by sip_contact_status_copy().
|
static |
Observer callback invoked on AOR deletion.
Definition at line 2046 of file pjsip_options.c.
References ast_sip_push_task_wait_serializer(), and sip_options_aor_observer_deleted_task().
|
static |
Observer callback invoked on AOR creation or modification.
Definition at line 2015 of file pjsip_options.c.
References ast_sip_push_task_wait_serializer(), and sip_options_aor_observer_modified_task().
void ast_res_pjsip_cleanup_options_handling | ( | void | ) |
Definition at line 2835 of file pjsip_options.c.
References ao2_cleanup, ARRAY_LEN, ast_cli_unregister_multiple(), ast_log, ast_manager_unregister(), ast_serializer_shutdown_group_join(), 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(), LOG_WARNING, management_serializer, MAX_UNLOAD_TIMEOUT_TIME, NULL, options_module, and sip_options_cleanup_task().
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 462 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(), 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 2918 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, ENDPOINT_STATE_COMPOSITOR_BUCKETS, EVENT_FLAG_REPORTING, EVENT_FLAG_SYSTEM, NULL, options_module, 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 2912 of file pjsip_options.c.
References 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 2717 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, 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_frequency, ast_sip_contact::qualify_timeout, ast_sip_contact_status::rtt, ast_sip_ami::s, S_OR, status, ast_sip_contact_status::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 342 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 523 of file pjsip_options.c.
References ao2_find, AO2_STRING_FIELD_CMP_FN(), AO2_STRING_FIELD_HASH_FN(), ast_sorcery_object_get_id(), sip_options_endpoint_aor_status::name, and OBJ_SEARCH_KEY.
Referenced by ast_sip_format_contact_ami(), cli_contact_print_body(), contact_remove_unreachable(), format_ami_contactlist_handler(), pjsip_contact_function_read(), and sip_options_contact_update_task().
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 336 of file pjsip_options.c.
References ARRAY_LEN, ast_assert, status, and status_map.
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 2346 of file pjsip_options.c.
References ao2_cleanup, ao2_find, ao2_ref, ast_cli_args::argc, ast_cli_args::argv, 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, ast_cli_args::fd, NULL, OBJ_SEARCH_KEY, RAII_VAR, sip_options_aor::serializer, sip_options_qualify_aor(), strsep(), and ast_cli_entry::usage.
|
static |
Definition at line 2630 of file pjsip_options.c.
References ao2_ref, ast_cli_args::argc, ast_cli_args::argv, 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, ast_cli_args::fd, NULL, sip_options_aor_observer_modified_task(), and ast_cli_entry::usage.
|
static |
Definition at line 2576 of file pjsip_options.c.
References ao2_cleanup, ao2_ref, ast_cli_args::argc, ast_cli_args::argv, 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, ast_cli_args::fd, NULL, RAII_VAR, sip_options_aor_observer_modified_task(), strsep(), and ast_cli_entry::usage.
|
static |
Definition at line 2539 of file pjsip_options.c.
References ao2_find, ao2_ref, ast_cli_args::argc, ast_cli_args::argv, ast_cli(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, NULL, OBJ_SEARCH_KEY, and ast_cli_entry::usage.
|
static |
Definition at line 2483 of file pjsip_options.c.
References ao2_cleanup, ao2_find, ao2_ref, ast_cli_args::argc, ast_cli_args::argv, ast_cli(), ast_sip_get_sorcery(), 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, ast_cli_args::fd, NULL, OBJ_SEARCH_KEY, RAII_VAR, strsep(), and ast_cli_entry::usage.
|
static |
Observer callback invoked on contact creation.
Definition at line 2187 of file pjsip_options.c.
References ast_sip_push_task_wait_serializer(), and sip_options_contact_add_management_task().
|
static |
Observer callback invoked on contact deletion.
Definition at line 2333 of file pjsip_options.c.
References ast_sip_push_task_wait_serializer(), and sip_options_contact_delete_management_task().
|
static |
Observer callback invoked on contact update.
Definition at line 2225 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(), sip_options_contact_observer_task_data::contact, has_qualify_changed(), OBJ_SEARCH_KEY, sip_options_aor::serializer, sip_options_aor_observer_modified_task(), and sip_options_contact_update_task().
|
static |
Task to notify endpoints of a contact status change.
Definition at line 434 of file pjsip_options.c.
References ao2_find, ao2_ref, ast_sip_contact_status::aor, OBJ_SEARCH_KEY, and sip_options_publish_contact_state().
Referenced by sip_options_contact_status_update().
|
static |
Observer callback invoked on endpoint deletion.
Definition at line 1883 of file pjsip_options.c.
References ast_sip_push_task_wait_serializer(), and sip_options_endpoint_observer_deleted_task().
|
static |
Observer callback invoked on endpoint creation or modification.
Definition at line 1915 of file pjsip_options.c.
References ast_sip_push_task_wait_serializer(), and sip_options_endpoint_observer_modified_task().
|
static |
Definition at line 2779 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 2416 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_contact_status::rtt, ast_sip_ami::s, sip_contact_to_ami(), status, ast_sip_contact_status::status, and UNKNOWN.
Referenced by ami_show_contacts().
|
static |
Definition at line 2772 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 2400 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 2071 of file pjsip_options.c.
References ast_sip_contact::authenticate_qualify, ast_sip_contact::qualify_frequency, and ast_sip_contact::qualify_timeout.
Referenced by contact_observer_updated(), and sip_options_contact_add_management_task().
|
static |
Definition at line 268 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_USER_OPTIONS_TRUNCATE_CHECK, ast_strlen_zero, exten, NULL, RAII_VAR, and send_options_response().
|
static |
Callback for when we get a result from a SIP OPTIONS request (a response or a timeout)
Definition at line 786 of file pjsip_options.c.
References ao2_ref, sip_options_contact_callback_data::aor_options, ast_log, ast_sip_push_task(), ast_sorcery_object_get_id(), AVAILABLE, sip_options_contact_callback_data::contact, LOG_ERROR, LOG_NOTICE, sip_options_aor::serializer, sip_options_contact_status_notify_task(), status, sip_options_contact_callback_data::status, and UNAVAILABLE.
Referenced by sip_options_qualify_contact().
|
static |
Definition at line 215 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 356 of file pjsip_options.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_ref, ast_string_field_init, ast_sip_contact_status::name, NULL, and sip_contact_status_dtor().
Referenced by ast_res_pjsip_find_or_create_contact_status(), and sip_contact_status_copy().
|
static |
Definition at line 374 of file pjsip_options.c.
References ao2_ref, AO2_STRING_FIELD_CMP_FN(), AO2_STRING_FIELD_HASH_FN(), AO2_STRING_FIELD_SORT_FN(), ast_string_fields_copy, ast_sip_contact_status::last_status, sip_options_endpoint_aor_status::name, ast_sip_contact_status::name, NULL, ast_sip_contact_status::rtt, 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 349 of file pjsip_options.c.
References ast_string_field_free_memory.
Referenced by sip_contact_status_alloc().
|
static |
Definition at line 2410 of file pjsip_options.c.
References ast_sip_sorcery_object_to_ami().
Referenced by format_ami_contactlist_handler().
|
static |
Allocator for AOR OPTIONS.
Definition at line 963 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_create_serializer_group(), ast_sorcery_object_get_id(), ast_sorcery_object_id_compare(), ast_sorcery_object_id_hash(), ast_sorcery_object_id_sort(), ast_taskprocessor_build_name(), AST_TASKPROCESSOR_MAX_NAME, AST_VECTOR_INIT, CONTACT_BUCKETS, sip_options_aor::contacts, sip_options_aor::dynamic_contacts, ENDPOINT_STATE_COMPOSITOR_INITIAL_SIZE, 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 941 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::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 2025 of file pjsip_options.c.
References ao2_find, ao2_ref, ast_debug, ast_sip_push_task_wait_serializer(), ast_sorcery_object_get_id(), OBJ_SEARCH_KEY, OBJ_UNLINK, sip_options_aor::serializer, and sip_options_aor_remove_task().
Referenced by aor_observer_deleted().
|
static |
Task to synchronize the AOR.
Definition at line 1960 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_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 1688 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 1240 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::contacts, sip_options_aor::dynamic_contacts, LOG_ERROR, LOG_WARNING, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_SEARCH_KEY, OBJ_UNLINK, ast_sip_aor::permanent_contacts, prefix, ast_sip_aor::qualify_frequency, ast_sip_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 |
Management task to clean up an AOR.
Definition at line 2794 of file pjsip_options.c.
References ao2_cleanup, ao2_ref, ast_debug, ast_sip_sched_task_cancel(), AST_VECTOR_RESET, NULL, and sip_options_aor::sched_task.
Referenced by sip_options_cleanup_task().
|
static |
Management task to clean up the environment.
Definition at line 2815 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, 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 2154 of file pjsip_options.c.
References ao2_find, ao2_ref, ast_sip_contact::aor, sip_options_contact_observer_task_data::aor_options, ast_debug, ast_sip_get_sorcery(), ast_sip_push_task_wait_serializer(), ast_sorcery_retrieve_by_id(), sip_options_contact_observer_task_data::contact, has_qualify_changed(), OBJ_SEARCH_KEY, sip_options_aor::serializer, sip_options_aor_observer_modified_task(), and sip_options_contact_add_task().
Referenced by contact_observer_created().
|
static |
Task which adds a dynamic contact to an AOR.
Definition at line 2094 of file pjsip_options.c.
References ao2_cleanup, ao2_container_count(), ao2_link, ao2_ref, sip_options_contact_observer_task_data::aor_options, 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, sip_options_contact_observer_task_data::contact, sip_options_aor::contacts, sip_options_aor::dynamic_contacts, LOG_ERROR, NULL, sip_options_aor::sched_task, sip_options_aor::serializer, 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 828 of file pjsip_options.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_bump, sip_options_contact_callback_data::aor_options, ast_tvnow(), sip_options_contact_callback_data::contact, NULL, sip_options_contact_callback_data::rtt_start, and sip_options_contact_callback_data_dtor().
Referenced by sip_options_qualify_contact().
|
static |
Destructor for contact callback data.
Definition at line 819 of file pjsip_options.c.
References ao2_cleanup, sip_options_contact_callback_data::aor_options, and sip_options_contact_callback_data::contact.
Referenced by sip_options_contact_callback_data_alloc().
|
static |
Task to delete a contact from an AOR in its serializer.
Definition at line 2313 of file pjsip_options.c.
References ao2_find, ao2_ref, ast_sip_contact::aor, sip_options_contact_observer_task_data::aor_options, ast_sip_push_task_wait_serializer(), sip_options_contact_observer_task_data::contact, OBJ_SEARCH_KEY, sip_options_aor::serializer, and sip_options_contact_delete_task().
Referenced by contact_observer_deleted().
|
static |
Task which deletes a dynamic contact from an AOR.
Definition at line 2273 of file pjsip_options.c.
References ao2_container_count(), ao2_find, ao2_ref, sip_options_contact_observer_task_data::aor_options, ast_debug, ast_sip_sched_task_cancel(), sip_options_contact_observer_task_data::contact, sip_options_aor::contacts, sip_options_aor::dynamic_contacts, NULL, OBJ_NODATA, OBJ_SEARCH_OBJECT, OBJ_UNLINK, sip_options_aor::sched_task, 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 1208 of file pjsip_options.c.
References ao2_ref, ast_res_pjsip_find_or_create_contact_status(), sip_options_endpoint_aor_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 661 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_contact_callback_data::contact, sip_options_aor::contacts, ast_sip_contact_status::last_status, ast_sip_contact_status::name, OBJ_SEARCH_KEY, OBJ_SEARCH_OBJECT, ast_sip_contact_status::rtt, sip_options_contact_callback_data::rtt_start, sip_contact_status_copy(), sip_options_contact_status_update(), 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 qualify_contact_cb().
|
static |
Definition at line 449 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 403 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 2197 of file pjsip_options.c.
References ao2_ref, sip_options_contact_observer_task_data::aor_options, ast_free, ast_sip_get_contact_status(), AVAILABLE, sip_options_contact_observer_task_data::contact, 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 1094 of file pjsip_options.c.
References ast_random_double, and ast_sip_get_max_initial_qualify_time().
Referenced by sip_options_apply_aor_configuration().
|
static |
Task which adds an AOR to an endpoint state compositor.
Definition at line 1527 of file pjsip_options.c.
References ao2_lock, ao2_ref, ao2_unlock, sip_options_endpoint_compositor_task_data::aor_options, ast_debug, AST_VECTOR_APPEND, AVAILABLE, sip_options_endpoint_compositor_task_data::endpoint_state_compositor, sip_options_endpoint_state_compositor::name, 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 1555 of file pjsip_options.c.
References ao2_ref, sip_options_endpoint_compositor_task_data::aor_options, ast_debug, AST_VECTOR_GET, AST_VECTOR_REMOVE, AST_VECTOR_SIZE, sip_options_endpoint_compositor_task_data::endpoint_state_compositor, and sip_options_endpoint_state_compositor::name.
Referenced by sip_options_endpoint_unlink_aor_feeders().
|
static |
Task to delete an endpoint from the known universe.
Definition at line 1863 of file pjsip_options.c.
References ao2_find, ao2_ref, ast_debug, ast_sorcery_object_get_id(), OBJ_SEARCH_KEY, OBJ_UNLINK, and sip_options_endpoint_unlink_aor_feeders().
Referenced by endpoint_observer_deleted().
|
static |
Task to synchronize the endpoint.
Definition at line 1893 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_unlink_aor_feeders(), and sip_options_synchronize_endpoint().
Referenced by endpoint_observer_modified().
|
static |
Destructor for endpoint state compositors.
Definition at line 1458 of file pjsip_options.c.
References ao2_cleanup, AO2_STRING_FIELD_CMP_FN(), AO2_STRING_FIELD_HASH_FN(), sip_options_endpoint_state_compositor::aor_statuses, and sip_options_endpoint_aor_status::name.
Referenced by sip_options_endpoint_state_compositor_find_or_alloc().
|
static |
Find (or create) an endpoint state compositor.
Definition at line 1472 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, and sip_options_endpoint_state_compositor_dtor().
Referenced by sip_options_synchronize_endpoint().
|
static |
Unlink AORs feeding the endpoint status compositor.
Definition at line 1819 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_compositor_task_data::aor_options, 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_aor::serializer, 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 557 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, sip_options_endpoint_aor_status::available, and state.
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 2885 of file pjsip_options.c.
References ast_serializer_shutdown_group_alloc(), ast_sip_get_sorcery(), ast_sorcery_observer_add(), 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 635 of file pjsip_options.c.
References ao2_cleanup, ao2_lock, ao2_unlock, AST_VECTOR_GET, AST_VECTOR_RESET, AST_VECTOR_SIZE, REMOVED, and sip_options_update_endpoint_state_compositor_aor().
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 416 of file pjsip_options.c.
References ast_sip_persistent_endpoint_publish_contact_state(), AST_VECTOR_GET, AST_VECTOR_SIZE, 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 923 of file pjsip_options.c.
References ao2_callback, ast_debug, sip_options_aor::contacts, OBJ_NODATA, sip_options_qualify_contact(), and sip_options_remove_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 847 of file pjsip_options.c.
References ao2_cleanup, ao2_ref, ast_debug, ast_log, ast_res_pjsip_find_or_create_contact_status(), ast_sip_create_request(), ast_sip_get_sorcery(), ast_sip_send_out_of_dialog_request(), ast_sip_set_outbound_proxy(), ast_sorcery_object_get_id(), ast_sorcery_retrieve_by_id(), ast_strlen_zero, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_sip_contact::endpoint_name, LOG_ERROR, sip_options_endpoint_state_compositor::name, NULL, ast_sip_contact::outbound_proxy, qualify_contact_cb(), RAII_VAR, sip_options_contact_callback_data_alloc(), and ast_sip_contact::uri.
Referenced by sip_options_qualify_aor().
|
static |
Forward declaration of this helpful function.
Callback function to remove a contact and its contact status from an AOR.
Definition at line 1083 of file pjsip_options.c.
References CMP_MATCH, and sip_options_remove_contact_status().
Referenced by sip_options_aor_dtor(), sip_options_apply_aor_configuration(), and sip_options_qualify_aor().
|
static |
Remove contact status for a hint.
Definition at line 1010 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, ast_sip_contact_status::last_status, OBJ_SEARCH_KEY, OBJ_UNLINK, REMOVED, ast_sip_contact_status::rtt, sip_contact_status_copy(), sip_options_contact_status_update(), 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 1110 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(), 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 1181 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 1154 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 1805 of file pjsip_options.c.
References ast_sip_push_task_wait_serializer(), reload(), sip_options_synchronize_task_data::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 1421 of file pjsip_options.c.
References sip_options_synchronize_aor_task_data::added, ao2_find, ao2_link, ao2_ref, sip_options_synchronize_aor_task_data::aor, sip_options_synchronize_aor_task_data::aor_options, ast_sip_push_task_wait_serializer(), ast_sorcery_object_get_id(), sip_options_synchronize_aor_task_data::existing, OBJ_NODATA, OBJ_SEARCH_KEY, OBJ_UNLINK, sip_options_aor::serializer, sip_options_aor_alloc(), 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 1383 of file pjsip_options.c.
References sip_options_endpoint_state_compositor::active, sip_options_synchronize_aor_task_data::added, ao2_cleanup, ao2_lock, ao2_unlock, sip_options_synchronize_aor_task_data::aor, sip_options_synchronize_aor_task_data::aor_options, 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 1584 of file pjsip_options.c.
References sip_options_endpoint_state_compositor::active, ao2_find, ao2_lock, ao2_ref, ao2_unlock, sip_options_endpoint_compositor_task_data::aor_options, 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, sip_options_endpoint_compositor_task_data::endpoint_state_compositor, LOG_WARNING, NULL, OBJ_SEARCH_KEY, sip_options_aor::serializer, 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 1749 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_synchronize_task_data::reload, 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 |
Callback which removes any unused AORs that remained after reloading.
Definition at line 1707 of file pjsip_options.c.
References ao2_unlink, ast_debug, ast_sip_push_task_wait_serializer(), CMP_MATCH, sip_options_aor::serializer, and sip_options_aor_remove_task().
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 1724 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 1932 of file pjsip_options.c.
References sip_options_synchronize_aor_task_data::added, sip_options_synchronize_aor_task_data::aor, sip_options_synchronize_aor_task_data::aor_options, ast_debug, sip_options_endpoint_aor_status::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 581 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(), sip_options_endpoint_aor_status::available, AVAILABLE, sip_options_endpoint_aor_status::name, sip_options_endpoint_state_compositor::name, NULL, OBJ_NOLOCK, OBJ_SEARCH_KEY, REMOVED, and sip_options_get_endpoint_state_compositor_state().
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 2053 of file pjsip_options.c.
|
static |
Definition at line 2709 of file pjsip_options.c.
|
static |
Observer callbacks for contacts.
Definition at line 2340 of file pjsip_options.c.
|
static |
Definition at line 2786 of file pjsip_options.c.
|
static |
Observer callbacks for endpoints.
Definition at line 1922 of file pjsip_options.c.
|
static |
Definition at line 213 of file pjsip_options.c.
Referenced by ast_res_pjsip_cleanup_options_handling(), and sip_options_contact_status_update().
|
static |
Definition at line 313 of file pjsip_options.c.
Referenced by ast_res_pjsip_cleanup_options_handling(), and ast_res_pjsip_init_options_handling().
|
static |
Definition at line 328 of file pjsip_options.c.
Referenced by ast_sip_get_contact_short_status_label().
|
static |
Shutdown group for options serializers.
Definition at line 129 of file pjsip_options.c.
Referenced by ast_serializer_shutdown_group_alloc().
|
static |
Definition at line 195 of file pjsip_options.c.
|
static |
Definition at line 201 of file pjsip_options.c.
|
static |
Definition at line 207 of file pjsip_options.c.
|
static |
Definition at line 320 of file pjsip_options.c.
Referenced by ast_sip_get_contact_status_label().