Asterisk - The Open Source Telephony Project  18.5.0
Data Structures | Macros | Functions | Variables
astobj2.c File Reference

Functions implementing astobj2 objects. More...

#include "asterisk.h"
#include "asterisk/_private.h"
#include "asterisk/astobj2.h"
#include "astobj2_private.h"
#include "astobj2_container_private.h"
#include "asterisk/cli.h"
#include "asterisk/paths.h"
Include dependency graph for astobj2.c:

Go to the source code of this file.

Data Structures

struct  __priv_data
 
struct  ao2_lock_priv
 
struct  ao2_lockobj_priv
 
struct  ao2_rwlock_priv
 
struct  ao2_weakproxy_notification
 
struct  astobj2
 
struct  astobj2_lock
 
struct  astobj2_lockobj
 
struct  astobj2_rwlock
 

Macros

#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
 convert from a pointer _p to a user-defined object More...
 
#define AO2_MAGIC   0xa70b123
 
#define AO2_WEAK   0xa70b122
 
#define ast_log   ast_log_safe
 
#define DEBUG_THREADS_LOOSE_ABI
 
#define EXCESSIVE_REF_COUNT   100000
 
#define EXTERNAL_OBJ(_p)   ((_p) == NULL ? NULL : (_p)->user_data)
 convert from a pointer _p to an astobj2 object More...
 
#define INTERNAL_OBJ(user_data)   (struct astobj2 *) ((char *) user_data - sizeof(struct astobj2))
 
#define INTERNAL_OBJ_CHECK(user_data)   __INTERNAL_OBJ_CHECK(user_data, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define INTERNAL_OBJ_LOCKOBJ(user_data)   ((struct astobj2_lockobj *) (((char *) (user_data)) - sizeof(struct astobj2_lockobj)))
 
#define INTERNAL_OBJ_MUTEX(user_data)   ((struct astobj2_lock *) (((char *) (user_data)) - sizeof(struct astobj2_lock)))
 
#define INTERNAL_OBJ_RWLOCK(user_data)   ((struct astobj2_rwlock *) (((char *) (user_data)) - sizeof(struct astobj2_rwlock)))
 
#define IS_AO2_MAGIC_BAD(p)   (AO2_MAGIC != (p->priv_data.magic | 1))
 

Functions

enum ao2_lock_req __adjust_lock (void *user_data, enum ao2_lock_req lock_how, int keep_stronger)
 
void * __ao2_alloc (size_t data_size, ao2_destructor_fn destructor_fn, unsigned int options, const char *tag, const char *file, int line, const char *func)
 
void * __ao2_alloc_with_lockobj (size_t data_size, ao2_destructor_fn destructor_fn, void *lockobj, const char *tag, const char *file, int line, const char *func)
 
void __ao2_cleanup (void *obj)
 
void __ao2_cleanup_debug (void *obj, const char *tag, const char *file, int line, const char *function)
 
void * __ao2_get_weakproxy (void *obj, const char *tag, const char *file, int line, const char *func)
 Get the weakproxy attached to obj. More...
 
int __ao2_lock (void *user_data, enum ao2_lock_req lock_how, const char *file, const char *func, int line, const char *var)
 Lock an object. More...
 
int __ao2_ref (void *user_data, int delta, const char *tag, const char *file, int line, const char *func)
 
int __ao2_trylock (void *user_data, enum ao2_lock_req lock_how, const char *file, const char *func, int line, const char *var)
 Try locking– (don't block if fail) More...
 
int __ao2_unlock (void *user_data, const char *file, const char *func, int line, const char *var)
 Unlock an object. More...
 
void * __ao2_weakproxy_alloc (size_t data_size, ao2_destructor_fn destructor_fn, const char *tag, const char *file, int line, const char *func)
 Allocate an ao2_weakproxy object. More...
 
void * __ao2_weakproxy_get_object (void *weakproxy, int flags, const char *tag, const char *file, int line, const char *func)
 Get the object associated with weakproxy. More...
 
int __ao2_weakproxy_ref_object (void *weakproxy, int delta, int flags, const char *tag, const char *file, int line, const char *func)
 Run ao2_t_ref on the object associated with weakproxy. More...
 
int __ao2_weakproxy_set_object (void *weakproxy, void *obj, int flags, const char *tag, const char *file, int line, const char *func)
 Associate weakproxy with obj. More...
 
void * ao2_object_get_lockaddr (void *user_data)
 Return the mutex lock address of an object. More...
 
unsigned int ao2_options_get (void *obj)
 Retrieve the ao2 options used to create the object. More...
 
int ao2_weakproxy_subscribe (void *weakproxy, ao2_weakproxy_notification_cb cb, void *data, int flags)
 Request notification when weakproxy points to NULL. More...
 
int ao2_weakproxy_unsubscribe (void *weakproxy, ao2_weakproxy_notification_cb destroyed_cb, void *data, int flags)
 Remove notification of real object destruction. More...
 
static void astobj2_cleanup (void)
 
int astobj2_init (void)
 
static void * internal_ao2_alloc (size_t data_size, ao2_destructor_fn destructor_fn, unsigned int options, void *lockobj, const char *tag, const char *file, int line, const char *func)
 
int internal_is_ao2_object (void *user_data)
 
void log_bad_ao2 (void *user_data, const char *file, int line, const char *func)
 

Variables

static FILE * ref_log
 

Detailed Description

Functions implementing astobj2 objects.

Author
Richard Mudgett rmudg.nosp@m.ett@.nosp@m.digiu.nosp@m.m.co.nosp@m.m

Definition in file astobj2.c.

Macro Definition Documentation

◆ __INTERNAL_OBJ_CHECK

#define __INTERNAL_OBJ_CHECK (   user_data,
  file,
  line,
  func 
)

convert from a pointer _p to a user-defined object

Returns
the pointer to the astobj2 structure

Definition at line 171 of file astobj2.c.

Referenced by __ao2_get_weakproxy(), __ao2_lock(), __ao2_ref(), __ao2_trylock(), __ao2_unlock(), __ao2_weakproxy_get_object(), __ao2_weakproxy_ref_object(), and __ao2_weakproxy_set_object().

◆ AO2_MAGIC

#define AO2_MAGIC   0xa70b123

◆ AO2_WEAK

#define AO2_WEAK   0xa70b122

◆ ast_log

#define ast_log   ast_log_safe
Examples:
/usr/src/asterisk-18.5.0/include/asterisk/logger.h, /usr/src/asterisk-18.5.0/include/asterisk/strings.h, and /usr/src/asterisk-18.5.0/main/app.c.

Definition at line 42 of file astobj2.c.

Referenced by __aco_option_register(), __adjust_lock(), __adsi_transmit_messages(), __allocate_taskprocessor(), __analog_handle_event(), __analog_ss_thread(), __ao2_container_alloc_rbtree(), __ao2_global_obj_ref(), __ao2_global_obj_replace(), __ao2_link(), __ao2_lock(), __ao2_ref(), __ao2_trylock(), __ao2_unlock(), __ao2_weakproxy_alloc(), __ast_answer(), __ast_assert_failed(), __ast_bridge_technology_register(), __ast_channel_alloc_ap(), __ast_cli_register(), __ast_codec_register_with_format(), __ast_custom_function_register(), __ast_dsp_call_progress(), __ast_fd_set_flags(), __ast_file_read_dirs(), __ast_format_def_register(), __ast_format_interface_register(), __ast_http_load(), __ast_pbx_run(), __ast_play_and_record(), __ast_queue_frame(), __ast_read(), __ast_register_translator(), __ast_request_and_dial(), __ast_smoother_feed(), __ast_sorcery_object_type_insert_wizard(), __ast_sorcery_open(), __ast_sorcery_wizard_register(), __ast_string_field_free_memory(), __ast_udptl_reload(), __ast_vm_greeter_register(), __ast_vm_register(), __attempt_transmit(), __auto_congest(), __dahdi_exception(), __find_callno(), __iax2_poke_noanswer(), __init_manager(), __mgcp_xmit(), __print_debug_details(), __queues_show(), __rtp_recvfrom(), __set_address_from_contact(), __sip_autodestruct(), __sip_pretend_ack(), __sip_reliable_xmit(), __sip_xmit(), __ssl_setup(), __ssl_setup_certs(), __start_taskprocessor(), __stub__ast_aes_decrypt(), __stub__ast_aes_encrypt(), __stub__ast_aes_set_decrypt_key(), __stub__ast_aes_set_encrypt_key(), __transmit_response(), __unload_module(), _analog_get_index(), _ast_addressfamily_to_sockaddrsize(), _ast_heap_create(), _ast_sockaddr_from_sin(), _ast_sockaddr_port(), _ast_sockaddr_set_port(), _ast_sockaddr_to_sin(), _ast_strlen_zero(), _dahdi_get_index(), _dsp_init(), _enum_array_map(), _extension_match_core(), _get_mohbyname(), _if_exec(), _macro_exec(), _moh_register(), _mohclass_unref(), _pgsql_exec(), _sip_show_peers(), _sip_tcp_helper_thread(), _while_exec(), accept_thread(), access_counter_file(), acf_abs_exec(), acf_cc_read(), acf_cc_write(), acf_channel_read(), acf_curl_exec(), acf_curl_helper(), acf_curl_write(), acf_curlopt_helper(), acf_curlopt_write(), acf_cut_exec(), acf_cut_exec2(), acf_faxopt_read(), acf_faxopt_write(), acf_fetch(), acf_iaxvar_read(), acf_iaxvar_write(), acf_if(), acf_isexten_exec(), acf_jabberreceive_read(), acf_jabberstatus_read(), acf_max_exec(), acf_meetme_info(), acf_min_exec(), acf_odbc_read(), acf_odbc_write(), acf_sort_exec(), acf_sprintf(), acf_strftime(), acf_strptime(), acf_transaction_write(), acf_vm_info(), ack_trans(), acl_change_stasis_cb(), acl_handler(), acl_on_rx_msg(), aco_init(), aco_option_find(), aco_pending_config(), aco_process_ast_config(), aco_process_config(), aco_process_var(), aco_set_defaults(), action_dahdishowchannels(), action_getvar(), action_hangup(), action_kick_last(), action_playback(), action_playback_and_continue(), activate_thread(), actual_load_config(), add_agi_cmd(), add_calltoken_ignore(), add_cc_call_info_to_response(), add_cfg_entry(), add_content(), add_email_attachment(), add_event_to_list(), add_exten_to_pattern_tree(), add_extensions(), add_features_datastore(), add_header(), add_hints(), add_identifier(), add_identity_header(), add_in_calls(), add_json_object(), add_line(), add_message_id(), add_notify(), add_out_calls(), add_priority(), add_realm_authentication(), add_redirect(), add_rt_multi_cfg_entry(), add_sdp(), add_sip_domain(), add_static_payload(), add_to_agi(), add_vm_recipients_from_string(), admin_exec(), adsi_begin(), adsi_careful_send(), adsi_get_cpeid(), adsi_get_cpeinfo(), adsi_load_session(), adsi_process(), adsi_prog(), adsi_transmit_message_full(), advanced_options(), ael2_parse(), ael2_print(), aes_helper(), after_bridge_move_channel_fail(), agent_after_bridge_cb_failed(), agent_function_read(), agent_login_exec(), agent_request_exec(), agents_sweep(), agi_exec_full(), alarmreceiver_exec(), alloc_expr_node(), alloc_notify_task_data(), alloc_resampler(), alloc_sub(), alsa_card_init(), alsa_indicate(), alsa_new(), alsa_read(), alsa_request(), alsa_write(), amihook_helper(), aMYSQL_clear(), aMYSQL_connect(), aMYSQL_disconnect(), aMYSQL_fetch(), aMYSQL_nextresult(), aMYSQL_query(), analog_answer(), analog_call(), analog_exception(), analog_handle_init_event(), analog_hangup(), analog_publish_channel_alarm_clear(), analog_request(), analog_ss_thread(), analogsub_to_dahdisub(), announce_to_dial(), answer(), anti_injection(), aoc_append_ie(), aoc_parse_ie(), app_control_move(), app_control_redirect(), app_control_remove_channel_from_bridge(), app_control_silence_start(), app_create(), app_event_filter_set(), app_exec(), app_handle_subscriptions(), app_send(), app_send_end_msg(), app_subscribe(), app_to_json(), app_unsubscribe(), appcdr_callback(), append_ha_core(), append_mailbox(), append_row_to_cfg(), append_vmu_info_astman(), applicationmap_handler(), apply_acl(), apply_contact_acl(), apply_dtls_attrib(), apply_general_options(), apply_option(), apply_option_entertainment(), apply_option_timeout(), apply_options_full(), apply_outgoing(), aqm_exec(), ari_channel_thread(), ari_channels_handle_originate_with_id(), ari_originate_dial(), assign_and_insert(), ast_add_extension2_lockopt(), ast_add_hint(), ast_adsi_install_funcs(), ast_agi_register(), ast_agi_send(), ast_alaw_init(), ast_alertpipe_flush(), ast_alertpipe_init(), ast_alertpipe_read(), ast_aoc_create(), ast_aoc_decode(), ast_aoc_encode(), ast_app_dtget(), ast_app_exec_macro(), ast_app_exec_sub(), ast_app_expand_sub_args(), ast_app_group_match_get_count(), ast_append_acl(), ast_apply_acl_internal(), ast_apply_ha(), ast_ari_applications_filter_cb(), ast_ari_applications_get_cb(), ast_ari_applications_list_cb(), ast_ari_applications_subscribe_cb(), ast_ari_applications_unsubscribe_cb(), ast_ari_asterisk_add_log_cb(), ast_ari_asterisk_delete_log_cb(), ast_ari_asterisk_delete_object_cb(), ast_ari_asterisk_get_global_var_cb(), ast_ari_asterisk_get_info(), ast_ari_asterisk_get_info_cb(), ast_ari_asterisk_get_module_cb(), ast_ari_asterisk_get_object_cb(), ast_ari_asterisk_list_log_channels_cb(), ast_ari_asterisk_list_modules_cb(), ast_ari_asterisk_load_module_cb(), ast_ari_asterisk_ping_cb(), ast_ari_asterisk_reload_module_cb(), ast_ari_asterisk_rotate_log_cb(), ast_ari_asterisk_set_global_var_cb(), ast_ari_asterisk_unload_module_cb(), ast_ari_asterisk_update_object_cb(), ast_ari_bridges_add_channel_cb(), ast_ari_bridges_clear_video_source_cb(), ast_ari_bridges_create_cb(), ast_ari_bridges_create_with_id_cb(), ast_ari_bridges_destroy_cb(), ast_ari_bridges_get_cb(), ast_ari_bridges_list_cb(), ast_ari_bridges_play_cb(), ast_ari_bridges_play_with_id_cb(), ast_ari_bridges_record(), ast_ari_bridges_record_cb(), ast_ari_bridges_remove_channel(), ast_ari_bridges_remove_channel_cb(), ast_ari_bridges_set_video_source_cb(), ast_ari_bridges_start_moh_cb(), ast_ari_bridges_stop_moh_cb(), ast_ari_channels_answer_cb(), ast_ari_channels_continue_in_dialplan(), ast_ari_channels_continue_in_dialplan_cb(), ast_ari_channels_create_cb(), ast_ari_channels_dial_cb(), ast_ari_channels_external_media_cb(), ast_ari_channels_get_cb(), ast_ari_channels_get_channel_var_cb(), ast_ari_channels_hangup_cb(), ast_ari_channels_hold_cb(), ast_ari_channels_list_cb(), ast_ari_channels_move_cb(), ast_ari_channels_mute_cb(), ast_ari_channels_originate_cb(), ast_ari_channels_originate_with_id_cb(), ast_ari_channels_play_cb(), ast_ari_channels_play_with_id_cb(), ast_ari_channels_record(), ast_ari_channels_record_cb(), ast_ari_channels_redirect_cb(), ast_ari_channels_ring_cb(), ast_ari_channels_ring_stop_cb(), ast_ari_channels_rtpstatistics_cb(), ast_ari_channels_send_dtmf_cb(), ast_ari_channels_set_channel_var_cb(), ast_ari_channels_snoop_channel_cb(), ast_ari_channels_snoop_channel_with_id_cb(), ast_ari_channels_start_moh_cb(), ast_ari_channels_start_silence_cb(), ast_ari_channels_stop_moh_cb(), ast_ari_channels_stop_silence_cb(), ast_ari_channels_unhold_cb(), ast_ari_channels_unmute_cb(), ast_ari_config_get(), ast_ari_config_validate_user(), ast_ari_device_states_delete_cb(), ast_ari_device_states_get_cb(), ast_ari_device_states_list_cb(), ast_ari_device_states_update_cb(), ast_ari_endpoints_get_cb(), ast_ari_endpoints_list_by_tech_cb(), ast_ari_endpoints_list_cb(), ast_ari_endpoints_send_message_cb(), ast_ari_endpoints_send_message_to_endpoint_cb(), ast_ari_events_event_websocket_ws_attempted_cb(), ast_ari_events_event_websocket_ws_established_cb(), ast_ari_events_user_event_cb(), ast_ari_get_docs(), ast_ari_invoke(), ast_ari_mailboxes_delete_cb(), ast_ari_mailboxes_get_cb(), ast_ari_mailboxes_list_cb(), ast_ari_mailboxes_update_cb(), ast_ari_playbacks_control_cb(), ast_ari_playbacks_get_cb(), ast_ari_playbacks_stop_cb(), ast_ari_recordings_cancel_cb(), ast_ari_recordings_copy_stored(), ast_ari_recordings_copy_stored_cb(), ast_ari_recordings_delete_stored(), ast_ari_recordings_delete_stored_cb(), ast_ari_recordings_get_live_cb(), ast_ari_recordings_get_stored_cb(), ast_ari_recordings_get_stored_file_cb(), ast_ari_recordings_list_stored_cb(), ast_ari_recordings_mute_cb(), ast_ari_recordings_pause_cb(), ast_ari_recordings_stop_cb(), ast_ari_recordings_unmute_cb(), ast_ari_recordings_unpause_cb(), ast_ari_sounds_get_cb(), ast_ari_sounds_list_cb(), ast_ari_validate_application(), ast_ari_validate_application_move_failed(), ast_ari_validate_application_replaced(), ast_ari_validate_asterisk_info(), ast_ari_validate_asterisk_ping(), ast_ari_validate_boolean(), ast_ari_validate_bridge(), ast_ari_validate_bridge_attended_transfer(), ast_ari_validate_bridge_blind_transfer(), ast_ari_validate_bridge_created(), ast_ari_validate_bridge_destroyed(), ast_ari_validate_bridge_merged(), ast_ari_validate_bridge_video_source_changed(), ast_ari_validate_build_info(), ast_ari_validate_caller_id(), ast_ari_validate_channel(), ast_ari_validate_channel_caller_id(), ast_ari_validate_channel_connected_line(), ast_ari_validate_channel_created(), ast_ari_validate_channel_destroyed(), ast_ari_validate_channel_dialplan(), ast_ari_validate_channel_dtmf_received(), ast_ari_validate_channel_entered_bridge(), ast_ari_validate_channel_hangup_request(), ast_ari_validate_channel_hold(), ast_ari_validate_channel_left_bridge(), ast_ari_validate_channel_state_change(), ast_ari_validate_channel_talking_finished(), ast_ari_validate_channel_talking_started(), ast_ari_validate_channel_unhold(), ast_ari_validate_channel_userevent(), ast_ari_validate_channel_varset(), ast_ari_validate_config_info(), ast_ari_validate_config_tuple(), ast_ari_validate_contact_info(), ast_ari_validate_contact_status_change(), ast_ari_validate_date(), ast_ari_validate_device_state(), ast_ari_validate_device_state_changed(), ast_ari_validate_dial(), ast_ari_validate_dialed(), ast_ari_validate_dialplan_cep(), ast_ari_validate_endpoint(), ast_ari_validate_endpoint_state_change(), ast_ari_validate_event(), ast_ari_validate_format_lang_pair(), ast_ari_validate_list(), ast_ari_validate_live_recording(), ast_ari_validate_log_channel(), ast_ari_validate_mailbox(), ast_ari_validate_message(), ast_ari_validate_missing_params(), ast_ari_validate_module(), ast_ari_validate_peer(), ast_ari_validate_peer_status_change(), ast_ari_validate_playback(), ast_ari_validate_playback_continuing(), ast_ari_validate_playback_finished(), ast_ari_validate_playback_started(), ast_ari_validate_recording_failed(), ast_ari_validate_recording_finished(), ast_ari_validate_recording_started(), ast_ari_validate_rtpstat(), ast_ari_validate_set_id(), ast_ari_validate_sound(), ast_ari_validate_stasis_end(), ast_ari_validate_stasis_start(), ast_ari_validate_status_info(), ast_ari_validate_stored_recording(), ast_ari_validate_system_info(), ast_ari_validate_text_message(), ast_ari_validate_text_message_received(), ast_ari_validate_variable(), ast_ari_websocket_events_event_websocket_established(), ast_ari_websocket_events_event_websocket_init(), ast_ari_websocket_session_create(), ast_ari_websocket_session_read(), ast_ari_websocket_session_write(), ast_async_goto(), ast_audiosocket_connect(), ast_audiosocket_init(), ast_audiosocket_receive_frame(), ast_audiosocket_send_frame(), ast_autoservice_start(), ast_beep_start(), ast_bridge_add_channel(), ast_bridge_channel_queue_frame(), ast_bridge_depart(), ast_bridge_features_ds_set_string(), ast_bridge_features_set_limits(), ast_bridge_timelimit(), ast_bridge_transfer_attended(), ast_bridge_transfer_blind(), ast_bucket_init(), ast_calendar_register(), ast_call_forward(), ast_carefulwrite(), ast_cc_get_param(), ast_cc_set_param(), ast_cdr_generic_unregister(), ast_cdr_getvar(), ast_cdr_serialize_variables(), ast_cdr_setvar(), ast_cel_fill_record(), ast_cel_str_to_event_type(), ast_change_hint(), ast_channel_add_bridge_role(), ast_channel_by_exten_cb(), ast_channel_by_name_cb(), ast_channel_by_uniqueid_cb(), ast_channel_cmp_cb(), ast_channel_connected_line_macro(), ast_channel_end_dtmf(), ast_channel_hangupcause_hash_set(), ast_channel_log(), ast_channel_make_compatible_helper(), ast_channel_move(), ast_channel_publish_varset(), ast_channel_queryoption(), ast_channel_redirecting_macro(), ast_channel_register(), ast_channel_setoption(), ast_channel_start_silence_generator(), ast_channel_stop_silence_generator(), ast_channel_suppress(), ast_channel_unsuppress(), ast_check_signature(), ast_check_signature_bin(), ast_check_timing2(), ast_clear_mixmonitor_methods(), ast_cli_completion_vector(), ast_cli_perms_init(), ast_cli_unregister(), ast_codec_samples_count(), ast_config_internal_load(), ast_config_text_file_save2(), ast_connected_line_build_data(), ast_connected_line_parse_data(), ast_context_find_or_create(), ast_context_remove_extension_callerid2(), ast_context_verify_includes(), ast_crypt_validate(), ast_data_buffer_cache_adjust(), ast_db_del(), ast_db_deltree(), ast_db_gettree(), ast_db_gettree_by_prefix(), ast_db_put(), ast_decrypt_bin(), ast_device_state_engine_init(), ast_devstate_prov_add(), ast_dns_query_set_add(), ast_dns_query_set_resolve_async(), ast_dns_resolve(), ast_dns_resolve_async(), ast_dns_resolve_ipv6_and_ipv4(), ast_dns_resolver_register(), ast_do_pickup(), ast_dsp_call_progress(), ast_dsp_process(), ast_dsp_silence_noise_with_energy(), ast_duplicate_acl_list(), ast_eid_to_str(), ast_enable_packet_fragmentation(), ast_encrypt_bin(), ast_endpoint_create(), ast_event_get_ie_pltype(), ast_event_get_ie_type_name(), ast_event_get_type_name(), ast_event_new(), ast_extension_close(), ast_fax_log(), ast_fax_state_to_str(), ast_find_ourip(), ast_format_cap_update_by_allow_disallow(), ast_format_def_unregister(), ast_format_str_reduce(), ast_framehook_attach(), ast_framehook_list_fixup(), ast_func_read(), ast_func_read2(), ast_func_write(), ast_get_chan_applicationmap(), ast_get_encoded_char(), ast_get_enum(), ast_get_group(), ast_get_money_str(), ast_get_number_str(), ast_handle_cc_control_frame(), ast_hangup(), ast_http_get_auth(), ast_http_get_contents(), ast_http_header_match(), ast_http_header_match_in(), ast_http_response_status_line(), ast_iax2_new(), ast_include_new(), ast_io_remove(), ast_iostream_close(), ast_iostream_start_tls(), ast_ivr_menu_run_internal(), ast_jb_put(), ast_json_init(), ast_json_vpack(), ast_linear_stream(), ast_local_init(), ast_lock_path_flock(), ast_lock_path_lockfile(), ast_log_show_lock(), ast_makesocket(), ast_manager_register_struct(), ast_media_cache_create_or_update(), ast_module_reload(), ast_moh_files_next(), ast_monitor_change_fname(), ast_monitor_start(), ast_monitor_stop(), ast_msg_handler_register(), ast_msg_handler_unregister(), ast_msg_send(), ast_msg_tech_register(), ast_msg_tech_unregister(), ast_multicast_rtp_create_options(), ast_named_acl_find(), ast_netsock_bindaddr(), ast_odbc_direct_execute(), ast_odbc_find_table(), ast_odbc_prepare_and_execute(), ast_odbc_print_errors(), ast_openstream_full(), ast_openvstream(), ast_ouraddrfor(), ast_parking_register_bridge_features(), ast_parking_unregister_bridge_features(), ast_parse_digest(), ast_pbx_outgoing_exten_predial(), ast_pbx_run_args(), ast_pbx_start(), ast_phoneprov_provider_register(), ast_pickup_call(), ast_pktccops_gate_alloc(), ast_playtones_start(), ast_presence_state_helper(), ast_process_pending_reloads(), ast_prod(), ast_pthread_create_detached_stack(), ast_pthread_create_stack(), ast_queue_cc_frame(), ast_queue_hangup_with_cause(), ast_read_image(), ast_read_textfile(), ast_readfile(), ast_record_review(), ast_redirecting_build_data(), ast_redirecting_parse_data(), ast_register_application2(), ast_register_switch(), ast_remotecontrol(), ast_res_pjsip_cleanup_options_handling(), ast_res_pjsip_init_message_filter(), ast_res_pjsip_initialize_configuration(), ast_rtcp_read(), ast_rtcp_write(), ast_rtp_convert_stats_json(), ast_rtp_dtls_cfg_parse(), ast_rtp_dtls_cfg_validate(), ast_rtp_dtmf_begin(), ast_rtp_dtmf_continuation(), ast_rtp_dtmf_end_with_duration(), ast_rtp_engine_register2(), ast_rtp_glue_register2(), ast_rtp_ice_start(), ast_rtp_ice_turn_request(), ast_rtp_instance_drop_packets(), ast_rtp_instance_early_bridge(), ast_rtp_instance_early_bridge_make_compatible(), ast_rtp_instance_get_recv_buffer_count(), ast_rtp_instance_get_recv_buffer_max(), ast_rtp_instance_get_sdes_received(), ast_rtp_instance_get_send_buffer_count(), ast_rtp_instance_make_compatible(), ast_rtp_instance_new(), ast_rtp_instance_queue_report(), ast_rtp_instance_reset_test_engine(), ast_rtp_instance_set_schedid(), ast_rtp_interpret(), ast_rtp_on_turn_rx_rtcp_data(), ast_rtp_on_turn_rx_rtp_data(), ast_rtp_read(), ast_rtp_sendcng(), ast_rtp_write(), ast_safe_fork(), ast_say_date_with_format_da(), ast_say_date_with_format_de(), ast_say_date_with_format_en(), ast_say_date_with_format_es(), ast_say_date_with_format_fr(), ast_say_date_with_format_gr(), ast_say_date_with_format_he(), ast_say_date_with_format_is(), ast_say_date_with_format_it(), ast_say_date_with_format_ja(), ast_say_date_with_format_nl(), ast_say_date_with_format_pl(), ast_say_date_with_format_pt(), ast_say_date_with_format_th(), ast_say_date_with_format_vi(), ast_say_date_with_format_zh(), ast_say_number_full_pt(), ast_sched_del(), ast_sched_dump(), ast_sched_start_thread(), ast_search_dns(), ast_search_dns_ex(), ast_security_event_report(), ast_senddigit_mf_begin(), ast_serializer_pool_create(), ast_serializer_pool_destroy(), ast_serializer_pool_set_alerts(), ast_set_cc_callback_macro(), ast_set_cc_offer_timer(), ast_set_cc_recall_timer(), ast_set_ccbs_available_timer(), ast_set_ccnr_available_timer(), ast_set_default_eid(), ast_set_mixmonitor_methods(), ast_set_priority(), ast_set_qos(), ast_sign_bin(), ast_sip_api_provider_register(), ast_sip_check_authentication(), ast_sip_cli_traverse_objects(), ast_sip_create_dialog_uac(), ast_sip_create_joint_call_cap(), ast_sip_create_rdata_with_contact(), ast_sip_create_request(), ast_sip_create_request_with_auth(), ast_sip_create_subscription(), ast_sip_initialize_cli(), ast_sip_initialize_distributor(), ast_sip_initialize_resolver(), ast_sip_initialize_scheduler(), ast_sip_initialize_sorcery_auth(), ast_sip_initialize_sorcery_location(), ast_sip_initialize_sorcery_transport(), ast_sip_initialize_system(), ast_sip_initialize_transport_management(), ast_sip_location_retrieve_contact_and_aor_from_list_filtered(), ast_sip_ouraddrfor(), ast_sip_persistent_endpoint_add_to_regcontext(), ast_sip_pubsub_generate_body_content(), ast_sip_pubsub_register_body_generator(), ast_sip_register_authenticator(), ast_sip_register_endpoint_identifier_with_name(), ast_sip_register_event_publisher_handler(), ast_sip_register_outbound_authenticator(), ast_sip_register_publish_handler(), ast_sip_register_subscription_handler(), ast_sip_requires_authentication(), ast_sip_retrieve_auths(), ast_sip_retrieve_auths_vector(), ast_sip_sched_task_cancel(), ast_sip_schedule_task(), ast_sip_session_alloc(), ast_sip_session_create_outgoing(), ast_sip_session_is_pending_stream_default(), ast_sip_session_regenerate_answer(), ast_sip_session_register_sdp_handler(), ast_sip_set_tpselector_from_transport(), ast_sip_set_tpselector_from_transport_name(), ast_sip_unregister_authenticator(), ast_sip_unregister_outbound_authenticator(), ast_sipinfo_send(), ast_slinfactory_feed(), ast_smoother_read(), ast_sockaddr_hash(), ast_sockaddr_parse(), ast_sockaddr_resolve(), ast_sockaddr_split_hostport(), ast_sockaddr_stringify_fmt(), ast_sorcery_object_fields_register(), ast_speech_register(), ast_srtp_add_stream(), ast_srtp_change_source(), ast_srtp_create(), ast_srtp_policy_alloc(), ast_srtp_protect(), ast_srtp_replace(), ast_srtp_unprotect(), ast_start_mixmonitor(), ast_stir_shaken_add_verification(), ast_stir_shaken_sign(), ast_stir_shaken_verify(), ast_stop_mixmonitor(), ast_stopstream(), ast_str_substitute_variables_full(), ast_str_to_uuid(), ast_streamfile(), ast_taskprocessor_get(), ast_taskprocessor_name(), ast_tcptls_client_create(), ast_tcptls_client_start(), ast_tcptls_server_root(), ast_tcptls_server_start(), AST_TEST_DEFINE(), ast_test_register(), ast_thread_inhibit_escalations(), ast_thread_inhibit_escalations_swap(), ast_thread_is_user_interface(), ast_thread_user_interface_set(), ast_threadpool_create(), ast_tls_read_conf(), ast_tps_init(), ast_translate_path_steps(), ast_translator_best_choice(), ast_translator_build_path(), ast_udptl_new_with_bindaddr(), ast_udptl_read(), ast_udptl_write(), ast_ulaw_init(), ast_unload_resource(), ast_unlock_path_lockfile(), ast_unreal_answer(), ast_unreal_fixup(), ast_unreal_hangup(), ast_unreal_indicate(), ast_unreal_new_channels(), ast_unreal_setoption(), ast_uri_create_(), ast_uri_parse(), ast_uuid_init(), ast_vm_test_swap_table_in(), ast_vm_test_swap_table_out(), ast_waitfordigit_full(), ast_websocket_read(), ast_websocket_read_string(), ast_websocket_server_add_protocol2(), ast_websocket_uri_cb(), ast_write_stream(), ast_writefile(), ast_writestream(), ast_xml_doc_item_alloc(), ast_xml_open(), ast_xml_query(), ast_xmldoc_build_documentation(), ast_xmldoc_load_documentation(), ast_yyerror(), asterisk_publication_devicestate_refresh(), asterisk_publication_mwi_refresh(), astobj2_init(), async_delete_name_rec(), async_delete_name_rec_task(), async_play_sound_helper(), asyncgoto_exec(), attach_barge(), attempt_thread(), attempt_transfer(), attended_transfer_bridge(), attended_transfer_exec(), attended_transfer_monitor_thread(), attended_transfer_properties_alloc(), au_seek(), au_trunc(), audiosocket_exec(), audiosocket_request(), audiosocket_run(), auth_apply(), auth_create(), auth_credentials(), auth_exec(), auth_http_callback(), auth_observer(), auth_type_handler(), authenticate(), authenticate_api_key(), authenticate_reply(), authenticate_verify(), autoservice_run(), available(), background_detect_exec(), balance_stack(), base64_helper(), base_encode(), beanstalk_put(), begin_dial_prerun(), blacklist_read(), blind_transfer_exec(), blond_nonfinal_exit(), blr_ebl(), blr_txt(), bridge_agent_hold_deferred_create(), bridge_alloc(), bridge_base_init(), bridge_builtin_set_limits(), bridge_channel_feature_digit_timeout(), bridge_channel_handle_write(), bridge_channel_park(), bridge_channel_settle_owed_events(), bridge_exec(), bridge_impart_internal(), bridge_moh_create(), bridge_p2p_rtp_write(), bridge_parking_push(), bridge_stasis_push(), bridge_stasis_push_peek(), bridge_stasis_run_cb(), bridge_topics_init(), bridgewait_exec(), bucket_copy(), bucket_file_run_curl(), bucket_http_wizard_retrieve_id(), build_ami_notify(), build_calendar(), build_callno_limits(), build_cc_interfaces_chanvar(), build_channels(), build_conf(), build_config_docs(), build_device(), build_dtmf_features(), build_expression_queue(), build_gateway(), build_mapping(), build_notify(), build_peer(), build_regex(), build_route(), build_user(), builtin_features_helper(), bump_gains(), cache_get_callno_locked(), cache_test_aggregate_calc_fn(), calc_metric(), calculate_far_max_ifp(), calculate_local_max_datagram(), caldav_add_event(), caldav_get_events_between(), caldav_load_calendar(), caldav_request(), caldav_write_event(), calendar_busy_exec(), calendar_devstate_change(), calendar_event_notify(), calendar_event_read(), calendar_join_attendees(), calendar_query_exec(), calendar_query_result_exec(), calendar_write_exec(), call_pickup_incoming_request(), caller_safety_timeout(), callerid_feed(), callerid_feed_jp(), callerid_get_dtmf(), callerid_read(), callerid_write(), calling_target_exit(), canary_thread(), cancel_and_unpublish(), canmatch(), careful_write(), category_register(), cb_events(), cc_available(), cc_caller_requested(), cc_esc_publish_handler(), cc_handle_publish_error(), cccancel_exec(), cdata(), cdr_enable_batch_mode(), cdr_generic_register(), cdr_handler(), cdr_object_update_party_b(), cdr_prop_write(), cdr_prop_write_callback(), cdr_read(), cdr_read_callback(), cdr_retrieve_time(), cdr_submit_batch(), cdr_toggle_runtime_options(), cdr_write(), cel_bs_put(), cel_generic_cb(), cel_linkedid_ref(), cel_pre_apply_config(), celt_set(), chan_misdn_log(), chan_pjsip_answer(), chan_pjsip_call(), chan_pjsip_cng_tone_detected(), chan_pjsip_digit_end(), chan_pjsip_hangup(), chan_pjsip_indicate(), chan_pjsip_new(), chan_pjsip_set_rtp_peer(), chan_pjsip_transfer(), chan_pjsip_write_stream(), chanavail_exec(), channel_admin_exec(), channel_chanspy_start_cb(), channel_chanspy_stop_cb(), channel_do_masquerade(), channel_get_external_vars(), channel_read_pjsip(), channel_read_rtcp(), channel_read_rtp(), channel_replaced_cb(), channel_set_intercept_mode(), channel_spy(), channel_stolen_cb(), channel_to_session(), chanspy_exec(), check_abstract_reference(), check_access(), check_app_args(), check_auth(), check_break(), check_context_names(), check_continue(), check_day(), check_debug(), check_dow(), check_event_type(), check_expr2_input(), check_featuregroup(), check_for_conference(), check_goto(), check_header(), check_header_fmt(), check_includes(), check_init(), check_key(), check_label(), check_macro_returns(), check_month(), check_password(), check_pval_item(), check_range(), check_retire_linkedid(), check_rtp_timeout(), check_srcaddr(), check_switch_expr(), check_tcptls_cert_name(), check_timerange(), check_type(), check_user_full(), check_vars(), check_via(), clean_stmt(), cleanup_module(), clearcbone(), cleardisplay(), clearflag(), cleartimer(), cli_display_named_acl(), cli_fax_show_session(), close_call(), close_client(), close_mailbox(), close_mansession_file(), close_rtp_connection(), close_udptl_connection(), codec2_new(), codec_prefs_handler(), comeback_goto(), common_identify(), compile_script(), complete_dialplan_add_extension(), complete_dialplan_add_ignorepat(), complete_dialplan_add_include(), complete_dialplan_remove_context(), complete_dialplan_remove_extension(), complete_dialplan_remove_ignorepat(), complete_dialplan_remove_include(), complete_transfer(), compose_func_args(), compress_subclass(), conf_add(), conf_del(), conf_exec(), conf_flush(), conf_invalid_event_fn(), conf_queue_dtmf(), conf_rec_name(), conf_run(), conf_send_event_to_participants(), conf_start_record(), confbridge_exec(), confbridge_handle_atxfer(), config_curl(), config_device(), config_function_read(), config_handler(), config_ldap(), config_line(), config_load(), config_module(), config_mysql(), config_odbc(), config_parse_variables(), config_pgsql(), config_text_file_load(), configure_connection_charset(), configure_local_rtp(), configure_parking_extensions(), confkick_exec(), connected_line_method_handler(), connectedline_read(), connectedline_write(), console_autoanswer(), console_cmd(), console_indicate(), console_request(), console_transfer(), console_video_start(), consulting_exit(), contact_apply_handler(), context_merge(), control_create(), control_swap_channel_in_bridge(), control_tone_frame_response(), control_wait(), controlplayback_exec(), cops_connect(), cops_gate_cmd(), cops_sendmsg(), copy(), copy_header(), copy_message(), copy_rules(), copy_to_voicemail(), copy_via_headers(), corosync_show_members(), count_exec(), count_lines(), cpg_confchg_cb(), cpg_deliver_cb(), create_addr(), create_artificial_auth(), create_dialog_uas(), create_dirpath(), create_dynamic_lot_full(), create_foo_type_message(), create_in_dialog_request(), create_jb(), create_match_char_tree(), create_new_socket(), create_object(), create_out_of_dialog_request(), create_outgoing_sdp_stream(), create_queue_member(), create_routes(), create_rtp(), create_subscription_tree(), create_temp_file(), create_transaction(), create_video_frame(), create_vmaccount(), crement_function_read(), crypto_activate(), crypto_init_keys(), crypto_load(), csv_log(), csv_quote(), curl_and_check_expiration(), curl_header_callback(), curl_public_key(), current_state_reusable(), custom_connection_handler(), custom_log(), custom_prepare(), custom_transport_handler(), cut_internal(), dahdi_answer(), dahdi_call(), dahdi_callwait(), dahdi_cc_callback(), dahdi_confmute(), dahdi_create_channel_range(), dahdi_decoder_framein(), dahdi_decoder_frameout(), dahdi_dial_str(), dahdi_digit_begin(), dahdi_ec_disable(), dahdi_ec_enable(), dahdi_encoder_framein(), dahdi_encoder_frameout(), dahdi_fake_event(), dahdi_func_write(), dahdi_handle_dtmf(), dahdi_handle_event(), dahdi_hangup(), dahdi_indicate(), dahdi_master_slave_link(), dahdi_new(), dahdi_open(), dahdi_read(), dahdi_request(), dahdi_restart(), dahdi_ring_phone(), dahdi_sendtext(), dahdi_set_hook(), dahdi_setoption(), dahdi_show_channel(), dahdi_test_timer(), dahdi_timer_open(), dahdi_timer_set_rate(), dahdi_train_ec(), dahdi_translate(), dahdi_write(), dahdi_write_frame(), dahdiras_exec(), dahdiscan_exec(), db_create_astdb(), db_execute_sql(), db_get_common(), db_open(), deadagi_exec(), debug_ha_sense_appended(), dec_init(), default_listener_pvt_alloc(), default_listener_shutdown(), default_task_pushed(), default_tps_processing_function(), defer_action(), DEFINE_SQL_STATEMENT(), del_identifier(), delete_device(), deprecation_notice(), destroy_all_channels(), destroy_curl(), destroy_mysql(), destroy_odbc(), destroy_pgsql(), destroy_pval_item(), destroy_trans(), detect_read(), detect_write(), determine_actual_value(), determine_starting_point(), devstate_init(), devstate_write(), dial_exec_full(), dial_handle_playtones(), dialgroup_read(), dialgroup_write(), dialog_info_to_string(), dialog_initialize_dtls_srtp(), dictate_exec(), digest_create_request_with_auth(), digitcollect(), digitdirect(), direct_media_glare_mitigation_handler(), direct_media_method_handler(), directory_exec(), disa_exec(), disable_jack_hook(), disable_t38(), dispatch_message(), dispatch_thread_handler(), display_last_error(), display_nat_warning(), display_single_entry(), dll_tests(), dns_naptr_alloc(), dns_parse_answer(), dns_parse_answer_ex(), dns_query_alloc(), dns_srv_alloc(), dns_system_resolver_resolve(), dns_system_resolver_set_response(), dnsmgr_refresh(), do_autokill(), do_convolve_pair(), do_directory(), do_forward(), do_magic_pickup(), do_message(), do_message_auth(), do_monitor(), do_monitor_headset(), do_notify(), do_pktccops(), do_register(), do_reload(), do_say(), do_sco_listen(), do_waiting(), does_category_match(), does_id_conflict(), domain_alias_apply(), double_checking_exit(), dtmf_info_incoming_request(), dtmf_stream(), dtmfstore_exec(), dump_queue(), dump_queue_members(), dumpsub(), dundi_answer_entity(), dundi_answer_query(), dundi_discover(), dundi_encrypt(), dundi_error_output(), dundi_exec(), dundi_helper(), dundi_lookup_internal(), dundi_precache_full(), dundi_precache_internal(), dundi_prop_precache(), dundi_query(), dundi_query_read(), dundi_result_read(), dundi_rexmit(), dundi_send(), dundi_xmit(), dundifunc_read(), duplicate_pseudo(), eagi_exec(), ebl_callback(), enable_jack_hook(), encode_open_type(), endelm(), endpt_send_request(), enum_callback(), enum_query_read(), enum_result_read(), eval_exten_read(), evaluate_and(), evaluate_equal(), evaluate_greater_than(), evaluate_history_entry(), evaluate_less_than(), evaluate_like(), evaluate_not(), evaluate_or(), event_session_alloc(), ewscal_load_calendar(), exchangecal_get_events_between(), exchangecal_load_calendar(), exchangecal_request(), exchangecal_write_event(), exec(), exec_exec(), execif_exec(), execute(), execute_cb(), execute_curl_instance(), exists(), expand_gosub_args(), expiration_global_loaded(), explicit_publish_cb(), ext_cmp_pattern_pos(), exten_state_publisher_cb(), extension_is_compatible(), extension_matches(), extenspy_exec(), extstate_read(), fax_detect_attach(), fax_detect_framehook(), fax_gateway_detect_t38(), fax_gateway_detect_v21(), fax_gateway_framehook(), fax_gateway_new(), fax_gateway_request_t38(), fax_gateway_start(), fax_generator_generate(), fax_rate_str_to_int(), fax_session_new(), fax_session_reserve(), fbuf_append(), feature_attended_transfer(), feature_read(), feature_write(), featuremap_read(), featuremap_write(), festival_exec(), fetch_access_token(), fetch_google_access_token(), fetch_icalendar(), ffmpeg_decode(), ffmpeg_encode(), file2format(), file_read(), file_write(), filehelper(), filename_parse(), filestream_close(), filter(), finalize_content(), find_account(), find_body_generator(), find_cache(), find_channel_control(), find_conf(), find_conf_realtime(), find_desc(), find_details(), find_engine(), find_identifier(), find_line_by_instance(), find_line_by_name(), find_matching_endif(), find_matching_endwhile(), find_matching_priority(), find_option_cb(), find_or_create(), find_or_create_details(), find_pval_goto_item(), find_queue_by_name_rt(), find_registrar_aor(), find_sdp(), find_speeddial_by_instance(), find_subchannel_and_lock(), find_subchannel_by_instance_reference(), find_subchannel_by_name(), find_subchannel_by_reference(), find_table(), find_transcoders(), findmeexec(), finish_bookmark(), flash_exec(), fn_wrapper(), forkcdr_callback(), forkcdr_exec(), forward_message(), frame_trace_helper(), framein(), free_zone(), freq_parser(), from_user_handler(), func_args(), func_channel_read(), func_channel_write(), func_channel_write_real(), func_channels_read(), func_check_sipdomain(), func_confbridge_helper(), func_confbridge_info(), func_get_parkingslot_channel(), func_header_read(), func_headers_read2(), func_mchan_read(), func_mchan_write(), func_mixmonitor_read(), func_mute_write(), func_read_header(), func_write_header(), function_amiclient(), function_db_delete(), function_db_exists(), function_db_read(), function_db_write(), function_enum(), function_eval(), function_eval2(), function_fieldnum_helper(), function_ooh323_read(), function_ooh323_write(), function_realtime_read(), function_realtime_readdestroy(), function_realtime_store(), function_realtime_write(), function_txtcidname(), g719read(), g719seek(), g719trunc(), g719write(), g723_len(), g723_read(), g723_trunc(), g723_write(), g726_read(), g726_seek(), g726_write(), g729_read(), g729_trunc(), g729_write(), generate_computational_cost(), generate_parked_user(), generic_fax_exec(), generic_http_callback(), generic_prepare(), generic_read(), get_agi_cmd(), get_alarms(), get_also_info(), get_auth_search_type(), get_button_template(), get_calleridname(), get_canmatch_exten(), get_comma(), get_defaults(), get_destination(), get_domain(), get_ewscal_ids_for(), get_hrir(), get_id_header(), get_in_brackets_const(), get_in_brackets_full(), get_input(), get_interface_helper(), get_languages(), get_lock(), get_member_penalty(), get_name_and_number(), get_number_str_en(), get_pattern_node(), get_range(), get_rdnis(), get_refer_info(), get_timerange(), get_to_address(), get_token(), get_unused_callno(), getdisplaybyname(), getflagbyname(), getkeybyname(), getstatebyname(), getsubbyname(), global_apply(), global_loaded_observer(), gosub_exec(), gosub_run(), gosubif_exec(), goto_exten(), goto_line(), goto_line_rel(), grab_transfer(), group_count_function_read(), group_function_read(), group_function_write(), grow(), gsm_read(), gsm_seek(), gsm_tell(), gsm_trunc(), gsm_write(), gsmtolin_framein(), h261_decap(), h263_decap(), h263_encap(), h263_open(), h263_read(), h263_trunc(), h263_write(), h263p_decap(), h263p_encap(), h264_decap(), h264_encap(), h264_open(), h264_read(), h264_trunc(), h264_write(), handle_alarms(), handle_atsign(), handle_audiosocket_connection(), handle_auth(), handle_bridge_enter_message(), handle_bridge_leave_message(), handle_call_incoming(), handle_call_outgoing(), handle_call_token(), handle_callforward_button(), handle_capabilities_res_message(), handle_cc_subscribe(), handle_channel_snapshot_update_message(), handle_clear_alarms(), handle_cli_database_show(), handle_cli_database_showkey(), handle_cli_indication_add(), handle_cli_indication_remove(), handle_cli_presencestate_list(), handle_client_registration(), handle_command_response(), handle_common_options(), handle_connection(), handle_dial_message(), handle_dump_docs(), handle_enbloc_call_message(), handle_error(), handle_exec(), handle_export_primitives(), handle_find_file(), handle_getoption(), handle_gosub(), handle_hd_hf(), handle_identify(), handle_incoming(), handle_incoming_request(), handle_init_event(), handle_input(), handle_invite_replaces(), handle_jack_audio(), handle_keypad_button_message(), handle_local_optimization_begin(), handle_local_optimization_end(), handle_manager_show_events(), handle_message(), handle_missing_column(), handle_negotiated_sdp(), handle_offhook_message(), handle_open_receive_channel_ack_message(), handle_options(), handle_parked_call_message(), handle_participant_join(), handle_phoneprov(), handle_pjproject_show_log_mappings(), handle_playtones(), handle_queue_change_priority_caller(), handle_recordfile(), handle_registration_response(), handle_registrations(), handle_request(), handle_request_bye(), handle_request_info(), handle_request_invite(), handle_request_invite_st(), handle_request_notify(), handle_request_refer(), handle_request_register(), handle_request_subscribe(), handle_response(), handle_response_ciev(), handle_response_clip(), handle_response_cmgr(), handle_response_info(), handle_response_invite(), handle_response_message(), handle_response_notify(), handle_response_peerpoke(), handle_response_publish(), handle_response_refer(), handle_response_register(), handle_response_subscribe(), handle_response_update(), handle_show_hint(), handle_single_token(), handle_slash(), handle_soft_key_event_message(), handle_stimulus_message(), handle_t38_options(), handle_tcptls_connection(), handle_transfer_button(), handle_updates(), hangupcause_read(), hash_ao2_destroy(), hash_ao2_node_destructor(), hash_read(), hashkeys_read(), hashkeys_read2(), hep_queue_cb(), hepv3_config_pre_apply(), hepv3_data_alloc(), hesitant_exit(), hint_read(), hold_intercept_fn_write(), holding_bridge_join(), hook_callback(), hook_event_cb(), hook_off(), hook_on(), hook_re_enable(), hook_write(), http_body_check_chunk_sync(), http_body_discard_chunk_trailer_headers(), http_body_discard_contents(), http_body_get_chunk_length(), http_body_read_contents(), http_callback(), http_post_callback(), httpd_helper_thread(), iax2_ack_registry(), iax2_call(), iax2_canmatch(), iax2_devicestate(), iax2_do_register(), iax2_dup_variable_datastore(), iax2_exec(), iax2_exists(), iax2_fixup(), iax2_hangup(), iax2_key_rotate(), iax2_matchmore(), iax2_poke_peer(), iax2_prov_app(), iax2_register(), iax2_request(), iax2_send(), iax2_trunk_queue(), iax_error_output(), iax_firmware_reload(), iax_frame_wrap(), iax_process_template(), iax_provision_reload(), iax_provision_version(), iax_template_parse(), ical_load_calendar(), icalendar_add_event(), icalendar_update_events(), ices_exec(), icesencode(), iconv_read(), ident_handler(), ident_to_str(), idle_sched_cb(), idle_sched_init_pj_thread(), iftime(), ilbc_read(), ilbc_trunc(), ilbc_write(), ilbctolin_framein(), import_ch(), in_band_indication(), incoming_request(), increase_call_count(), indicate_data_internal(), init_acf_query(), init_app_class(), init_convolve_channel_pair(), init_details(), init_jack_data(), init_req(), init_resp(), init_timing_thread(), initial_notify_task(), initialize_cc_devstate_map(), initialize_cc_max_requests(), initialize_udptl(), initreqprep(), inotify_daemon(), inprocess_count(), insert_penaltychange(), insert_user_in_contact_uri(), int_handler_fn(), internal_aco_type_find(), internal_ao2_alloc(), internal_feature_read(), internal_feature_write(), internal_featuremap_read(), internal_featuremap_write(), invent_message(), ip_identify_apply(), ip_identify_match_handler(), is_empty(), is_valid_dtmf(), is_writable(), is_zero_or_null(), isAnsweringMachine(), isexten_function_read(), ivr_dispatch(), jack_hook_callback(), jack_hook_write(), jb_error_output(), jb_framedata_init(), jb_get_and_deliver(), jb_helper(), jb_warning_output(), jingle_action_hook(), jingle_action_session_initiate(), jingle_add_google_candidates_to_transport(), jingle_add_ice_udp_candidates_to_transport(), jingle_indicate(), jingle_interpret_content(), jingle_interpret_description(), jingle_interpret_google_transport(), jingle_interpret_ice_udp_transport(), jingle_request(), jingle_send_error_response(), jingle_send_response(), jingle_send_session_action(), jingle_send_session_info(), jingle_send_session_terminate(), jingle_send_transport_info(), jingle_write(), join_conference_bridge(), join_queue(), json_to_ast_variables(), keepalive_global_loaded(), keepalive_transport_thread(), key_favorite(), key_main_page(), keypad_cfg_read(), killpid(), kqueue_timer_ack(), kqueue_timer_disable_continuous(), kqueue_timer_enable_continuous(), kqueue_timer_open(), kqueue_timer_set_rate(), launch_asyncagi(), launch_ha_netscript(), launch_monitor_thread(), launch_netscript(), launch_script(), launch_service(), ldap_loadentry(), ldap_mod_append(), ldap_mod_create(), ldap_mod_duplicate(), ldap_reconnect(), leave_voicemail(), linear_alloc(), linear_generator(), linear_release(), link_option_to_types(), link_topic_proxy(), lintogsm_framein(), lintolpc10_framein(), lintoulaw(), list_item_handler(), listener(), listfilter(), load_asterisk_conf(), load_column_config(), load_config(), load_config_meetme(), load_endpoint(), load_general_config(), load_indications(), load_module(), load_modules(), load_moh_classes(), load_mysql_config(), load_odbc_config(), load_or_reload_lua_stuff(), load_pbx_builtins(), load_pjsip(), load_pktccops_config(), load_realtime_musiconhold(), load_realtime_rules(), load_resource(), load_resource_list(), load_tech_calendars(), load_values_config(), load_zonemessages(), loader_config_init(), loadresult2str(), local_alloc(), local_ast_moh_cleanup(), local_ast_moh_start(), local_call(), local_devicestate(), local_read(), local_request_with_stream_topology(), local_write(), lock_info_destroy(), log_attended_transfer(), log_caps(), log_exec(), log_failed_request(), log_forwarder(), log_jack_status(), logged_dlclose(), lookup_iface(), lpc10tolin_framein(), lua_find_extension(), lua_get_state(), macroif_exec(), mailbox_to_num(), main(), make_email_file(), make_number(), make_silence(), make_str(), make_trunk(), manager_fax_sessions_entry(), manager_generic_msg_cb(), manager_list_voicemail_users(), manager_log(), manager_parking_lot_list(), manager_parking_status_all_lots(), manager_show_dialplan_helper(), manager_sipnotify(), manager_status_voicemail_user(), map_video_codec(), massage_mods_for_entry(), matchmore(), math(), matrix_rebuild(), mbl_call(), mbl_hangup(), mbl_load_adapter(), mbl_load_config(), mbl_load_device(), mbl_request(), mbl_sendsms_exec(), md5(), measurenoise(), media_cache_item_populate_from_astdb(), meetme_menu_admin_extended(), meetmemute(), memcpy_decrypt(), memcpy_encrypt(), memory_cache_populate(), memory_cache_stale_update_object(), message_playback_callback_fn(), message_template_build(), message_template_parse_emailbody(), message_template_parse_filebody(), mf_stream(), mgcp_call(), mgcp_fixup(), mgcp_indicate(), mgcp_new(), mgcp_reload(), mgcp_request(), mgcp_rtp_read(), mgcp_senddigit_begin(), mgcp_senddigit_end(), mgcp_ss(), mgcp_write(), mgcpsock_read(), milliwatt_generate(), minivm_accmess_exec(), minivm_account_func_read(), minivm_counter_func_read(), minivm_counter_func_write(), minivm_delete_exec(), minivm_greet_exec(), minivm_mwi_exec(), minivm_notify_exec(), minivm_record_exec(), misdn_answer(), misdn_call(), misdn_cfg_get(), misdn_cfg_get_config_string(), misdn_cfg_init(), misdn_cfg_is_msn_valid(), misdn_cfg_update_ptp(), misdn_check_l2l1(), misdn_digit_end(), misdn_facility_exec(), misdn_hangup(), misdn_indication(), misdn_new(), misdn_request(), misdn_send_text(), misdn_set_opt_exec(), misdn_write(), mixmonitor_exec(), mixmonitor_save_prep(), mixmonitor_thread(), mkif(), mkintf(), mkstemp_file(), module_load_error(), moh_alloc(), moh_files_alloc(), moh_files_generator(), moh_files_release(), moh_generate(), moh_parse_options(), moh_release(), mohalloc(), monmp3thread(), morsecode_exec(), mp3_exec(), mp3_rewrite(), mp3_squeue(), mp3_trunc(), mp3_write(), mp3play(), mpeg4_decode(), msg_create_from_file(), msg_data_func_read(), msg_data_func_write(), msg_func_read(), msg_func_write(), msg_q_cb(), msg_send(), msg_send_exec(), mssql_connect(), multicast_rtp_request(), multicast_rtp_write(), multicast_send_control_packet(), mute_fragment(), mwi_app_event_cb(), mwi_create_state(), mwi_create_subscription(), mwi_send_init(), mwi_send_process_buffer(), mwi_send_process_event(), mwi_sorcery_init(), mwi_subscribe_single(), mwi_thread(), my_all_subchannels_hungup(), my_callwait(), my_connect_db(), my_dial_digits(), my_distinctive_ring(), my_dsp_set_digitmode(), my_get_callerid(), my_handle_dtmf(), my_handle_notify_message(), my_is_off_hook(), my_load_module(), my_new_analog_ast_channel(), my_on_hook(), my_send_callerid(), my_set_cadence(), my_start_cid_detect(), my_wink(), mysql_ds_destroy(), mysql_ds_fixup(), MYSQL_exec(), mysql_log(), mysql_reconnect(), named_acl_find_realtime(), native_start(), nbs_alloc(), nbs_call(), nbs_hangup(), nbs_new(), nbs_request(), NBScat_exec(), NBScatplay(), netconsole(), network_thread(), new_find_extension(), new_realtime_sqlite3_db(), new_subscribe(), newpvt(), non_neg_value_range(), notify_contact(), notify_endpoint(), notify_new_message(), notify_uri(), num_to_mailbox(), object_type_loaded_observer(), odbc_load_module(), odbc_log(), odbc_obj_connect(), odbc_obj_disconnect(), ogg_speex_open(), ogg_speex_seek(), ogg_speex_tell(), ogg_speex_trunc(), ogg_vorbis_open(), ogg_vorbis_read(), ogg_vorbis_rewrite(), ogg_vorbis_seek(), ogg_vorbis_trunc(), ogg_vorbis_write(), old_milliwatt_exec(), on_load_attestation(), on_load_ca_file(), on_load_ca_path(), on_load_path(), on_load_public_cert_url(), on_personality_change_normal(), onAlerting(), onCallEstablished(), onevent(), onModeChanged(), onNewCallCreated(), onOutgoingCall(), onProgress(), ooh323_alloc(), ooh323_call(), ooh323_convertAsteriskCapToH323Cap(), ooh323_digit_begin(), ooh323_digit_end(), ooh323_fixup(), ooh323_indicate(), ooh323_new(), ooh323_onReceivedDigit(), ooh323_onReceivedSetup(), ooh323_queryoption(), ooh323_request(), ooh323_rtp_read(), ooh323_set_read_format(), ooh323_set_rtp_peer(), ooh323_set_write_format(), ooh323_write(), ooh323c_start_call_thread(), ooh323c_start_receive_channel(), ooh323c_start_stack_thread(), ooh323c_start_transmit_channel(), op_colon(), op_div(), op_eq(), op_eqtilde(), op_func(), op_minus(), op_negate(), op_plus(), op_rem(), op_tildetilde(), op_times(), open_history(), open_mailbox(), open_stream(), option_handler_findslot(), option_handler_parkpos(), options_incoming_request(), opus_get(), opus_set(), originate_exec(), osp_auth(), osp_check_destination(), osp_create_callid(), osp_create_provider(), osp_create_transaction(), osp_create_uuid(), osp_load(), osp_lookup(), osp_next(), osp_uuid2str(), osp_validate_token(), osplookup_exec(), ospnext_exec(), oss_indicate(), oss_new(), oss_request(), overload_trigger_handler(), page_exec(), park_and_announce_app_exec(), park_common_setup(), parked_call_app_exec(), parked_call_message_response(), parking_duration_callback(), parking_lot_build_or_update(), parking_lot_cfg_create_extensions(), parking_park_bridge_channel(), parking_park_call(), parking_set_duration(), parse(), parse_args(), parse_bookmark(), parse_buffers_policy(), parse_busy_pattern(), parse_config(), parse_data(), parse_empty_options(), parse_gain_value(), parse_ie(), parse_line(), parse_minse(), parse_moved_contact(), parse_naptr(), parse_options(), parse_register_contact(), parse_request(), parse_session_expires(), parse_srv(), parse_tag(), parse_tone_uri(), parse_tone_zone(), parse_uri_cb(), parse_via(), parsing(), participant_entertainment_start(), participant_reaction_announcer_join(), party_id_build_data(), party_id_write(), party_name_build_data(), party_name_write(), party_number_build_data(), party_number_write(), party_subaddress_build_data(), pbx_builtin_answer(), pbx_builtin_background(), pbx_builtin_execiftime(), pbx_builtin_gotoif(), pbx_builtin_gotoiftime(), pbx_builtin_hangup(), pbx_builtin_importvar(), pbx_builtin_pushvar_helper(), pbx_builtin_saycharacters_case(), pbx_builtin_saynumber(), pbx_builtin_serialize_variables(), pbx_builtin_setamaflags(), pbx_builtin_setvar(), pbx_builtin_setvar_multiple(), pbx_builtin_waitexten(), pbx_extension_helper(), pbx_find_extension(), pbx_live_dangerously(), pbx_load_config(), pbx_load_module(), pbx_load_users(), pbx_outgoing_attempt(), pbx_outgoing_exec(), pbx_parseable_goto(), pbx_start_incoming_request(), pbx_substitute_variables_helper_full(), pcm_read(), pcm_seek(), pcm_trunc(), pcm_write(), peek_read(), peer_iphash_cb(), peer_set_srcaddr(), peercnt_add(), permanent_uri_handler(), pgsql_exec(), pgsql_log(), pgsql_reconnect(), phase_e_handler(), phone_call(), phone_digit_end(), phone_exception(), phone_hangup(), phone_indicate(), phone_mini_packet(), phone_new(), phone_read(), phone_request(), phone_setup(), phone_write(), phone_write_buf(), phoneprov_alloc(), pickup_by_exten(), pickup_by_group(), pickup_exec(), pickupchan_exec(), pidf_generate_body_content(), pidf_supplement_body(), pidf_to_string(), pidf_validate_presence(), pidf_validate_tuple(), pitchshift_helper(), pj_thread_register_check(), pjsip_acf_channel_read(), pjsip_acf_dial_contacts_read(), pjsip_acf_dtmf_mode_read(), pjsip_acf_dtmf_mode_write(), pjsip_acf_media_offer_read(), pjsip_acf_media_offer_write(), pjsip_acf_moh_passthrough_read(), pjsip_acf_moh_passthrough_write(), pjsip_acf_parse_uri_read(), pjsip_acf_session_refresh_write(), pjsip_aor_function_read(), pjsip_channel_cli_register(), pjsip_contact_function_read(), pjsip_endpoint_function_read(), pjsip_logger_write_to_pcap(), pktccops_add_ippool(), play_file(), play_message(), play_message_by_id(), play_message_by_id_helper(), play_message_category(), play_message_datetime(), play_moh_exec(), play_on_channel(), play_on_channel_in_bridge(), play_record_review(), play_sound_helper(), playback_exec(), playback_final_update(), playback_first_update(), playtones_alloc(), playtones_generator(), policy_set_suite(), pop_exec(), post_raw(), pp_each_extension_helper(), pqm_exec(), pre_bridge_setup(), precache_trans(), precache_transactions(), prep_email_sub_vars(), presence_read(), presence_write(), print_escaped_uri(), privacy_exec(), private_enum_init(), proc_422_rsp(), proc_session_timer(), process_ast_dsp(), process_category(), process_cn_rfc3389(), process_config(), process_cors_request(), process_crypto(), process_dahdi(), process_description_file(), process_echocancel(), process_message(), process_message_callback(), process_my_load_module(), process_opcode(), process_output(), process_request(), process_returncode(), process_sdp(), process_sdp_a_audio(), process_sdp_a_dtls(), process_sdp_c(), process_sdp_o(), process_text_line(), process_via(), profile_set_param(), prometheus_config_pre_apply(), prometheus_metric_register(), proxy_from_config(), proxy_update(), pthread_timer_set_rate(), publish(), publish_acl_change(), publish_app_cdr_message(), publish_channel_alarm_clear(), publish_chanspy_message(), publish_cluster_discovery_to_stasis_full(), publish_device_state_to_stasis(), publish_event_to_corosync(), publish_mwi_to_stasis(), publish_request_initial(), publish_span_alarm_clear(), publish_to_corosync(), publish_transfer_fail(), publish_transfer_success(), publish_transfer_threeway(), publisher_start(), publishers_create(), publishers_destroy(), pubsub_on_rx_mwi_notify_request(), pubsub_on_rx_publish_request(), pubsub_on_rx_refresh(), pubsub_on_rx_subscribe_request(), purge_old_messages(), push_notify_channel(), push_to_serializer(), pvalCheckType(), pvalGlobalsAddStatement(), pvalTopLevAddObject(), pw_cb(), ql_exec(), qualify_contact_cb(), queue_dtmf_readq(), queue_exec(), queue_file(), queue_function_exists(), queue_function_mem_read(), queue_function_mem_write(), queue_function_memberpenalty_read(), queue_function_memberpenalty_write(), queue_function_qac_dep(), queue_function_queuegetchannel(), queue_function_queuememberlist(), queue_function_queuewaitingcount(), queue_function_var(), queue_multi_channel_to_ami(), queue_reload_request(), queue_set_param(), queue_voice_frame(), quote(), qupd_exec(), radius_log(), rb_ao2_destroy(), rb_ao2_node_destructor(), rcv_mac_addr(), rcvfax_exec(), read_config(), read_exec(), read_header(), read_mf_digits(), read_mf_exec(), read_packet(), read_password_from_file(), read_pjsip(), read_sf_digits(), read_sf_exec(), readexten_exec(), readmimefile(), realtime_curl(), realtime_destroy_handler(), realtime_directory(), realtime_exec(), realtime_handler(), realtime_ldap_base_ap(), realtime_ldap_result_to_vars(), realtime_multi_curl(), realtime_multi_handler(), realtime_multi_ldap(), realtime_multi_mysql(), realtime_multi_odbc(), realtime_multi_pgsql(), realtime_mysql(), realtime_odbc(), realtime_peer(), realtime_peer_by_addr(), realtime_peer_get_sippeer_helper(), realtime_pgsql(), realtime_require_handler(), realtime_sqlite3_destroy(), realtime_sqlite3_exec_query(), realtime_sqlite3_exec_query_with_handle(), realtime_sqlite3_exec_update(), realtime_sqlite3_exec_update_with_handle(), realtime_sqlite3_helper(), realtime_sqlite3_load(), realtime_sqlite3_require(), realtime_sqlite3_store(), realtime_sqlite3_update(), realtime_sqlite3_update2(), realtime_store_handler(), realtime_update2_handler(), realtime_update_handler(), realtimefield_read(), recalling_exit(), receive_message(), receivefax_exec(), receivefax_t38_init(), record_exec(), record_file(), redirect_handler(), redirecting_read(), redirecting_reason_build_data(), redirecting_write(), refer_blind_callback(), refer_incoming_attended_request(), refer_incoming_blind_request(), refer_incoming_refer_request(), refresh_list(), reg_source_db(), regex(), register_aor_core(), register_channel_tech(), register_exten(), register_peer_exten(), register_realtime_peers_with_callbackextens(), register_service(), register_verify(), registrar_add_contact(), registrar_find_contact(), registrar_on_rx_request(), registry_rerequest(), release_doomed_pris(), reload(), reload_config(), reload_followme(), reload_module(), reload_queue_members(), reload_queue_rules(), reload_queues(), reload_single_member(), reload_single_queue(), remove_by_peercallno(), remove_by_transfercallno(), remove_detect(), remove_dtmf_store(), remove_from_queue(), remove_header(), remove_hold_intercept(), remove_scrambler(), remove_talk_detect(), removed_options_handler(), replace(), replace_callno(), reply_digest(), request(), request_channel(), require_curl(), require_mysql(), require_odbc(), require_pgsql(), reregister_immediately_cb(), res_sdp_crypto_build_offer(), res_sdp_crypto_parse_offer(), res_sdp_srtp_get_attr(), res_srtp_init(), res_srtp_new(), reset_conf(), resolve_first(), resource_list_apply_handler(), respprep(), restart_monitor(), restart_pktc_thread(), restore_conference(), restore_gains(), retrans_pkt(), retransfer_enter(), retransfer_exit(), retrieve_resource_list(), retrydial_exec(), return_exec(), revert_fax_buffers(), rfcomm_read_cmgr(), rfcomm_read_result(), rfcomm_read_sms_prompt(), rm_file(), rqm_exec(), rt_handle_member_record(), rtcp_debug_test_addr(), rtp_add_candidates_to_ice(), rtp_allocate_transport(), rtp_check_timeout(), rtp_codecs_assign_payload_code_rx(), rtp_instance_parse_transport_wide_cc(), rtp_raw_write(), rtp_reload(), rtp_transport_wide_cc_feedback_produce(), rtp_write_rtcp_fir(), rtp_write_rtcp_psfb(), run_agi(), run_app_helper(), run_curl(), run_externnotify(), run_ras(), run_task(), s_streamwait3(), safe_append(), safe_exec_prep(), save_conference(), save_to_folder(), say_init_mode(), saycountedadj_exec(), saycountednoun_exec(), sayfile_exec(), scan_service(), scan_thread(), sched_settime(), schedule_publish_refresh(), schedule_registration(), schedule_retry(), schtd_dtor(), sco_accept(), sco_bind(), scramble_write(), sdp_register(), security_event_to_ami_blob(), select_entry(), send_callerid(), send_check_user_failure_response(), send_client(), send_cluster_notify(), send_delay(), send_device_state(), send_dtmf(), send_ews_request_and_parse(), send_expansion_text(), send_in_dialog_request(), send_message(), send_month_labels(), send_options_response(), send_request(), send_request_cb(), send_response(), send_retransmit(), send_select_output(), send_start_msg_snapshots(), send_start_rtp(), send_text(), send_unsolicited_mwi_notify(), send_unsolicited_mwi_notify_to_contact(), send_waveform_to_channel(), send_waveform_to_fd(), senddtmf_exec(), sendfax_exec(), sendfax_t38_init(), sendimage_exec(), sendmail(), sendmf_exec(), sendpage(), sendtext(), sendurl_exec(), session_do(), session_on_rx_request(), set(), set_active(), set_bridge_features_on_config(), set_caps(), set_config(), set_crypto_policy(), set_destination(), set_fax_t38_caps(), set_format(), set_full_cmd(), set_hold_intercept(), set_host_ipaddr(), set_if(), set_incoming_call_offer_cap(), set_insecure_flags(), set_loop(), set_member_value(), set_member_value_help_members(), set_outbound_authentication_credentials(), set_outbound_initial_authentication_credentials(), set_passthru_update(), set_priority_all(), set_queue_member_pause(), set_sound(), set_state(), set_t38timeout(), set_ttl(), set_type(), set_ulimit(), set_var(), setflag(), setformat(), setsubstate(), setup_dahdi_int(), setup_dtls_srtp(), setup_filestack(), setup_mixmonitor(), setup_mixmonitor_ds(), setup_privacy_args(), setup_rtp_connection(), setup_rtp_remote(), setup_sdes_srtp(), setup_stunaddr(), setup_udptl_connection(), sha1(), shared_read(), shared_write(), shell_helper(), shift_pop(), show_chanstats_cb(), show_dialplan_helper(), showdisplay(), showkeys(), signal_pipe(), silk_get(), silk_set(), sip_acf_channel_read(), sip_addheader(), sip_call(), sip_cancel_destroy(), sip_cc_monitor_suspend(), sip_check_authtimeout(), sip_cli_notify(), sip_dtmfmode(), sip_dump_history(), sip_endpoint_apply_handler(), sip_fixup(), sip_hangup(), sip_indicate(), sip_msg_send(), sip_new(), sip_options_apply_aor_configuration(), sip_options_contact_add_task(), sip_options_qualify_contact(), sip_options_synchronize_endpoint(), sip_outbound_publish_apply(), sip_outbound_publish_callback(), sip_outbound_publish_synchronize(), sip_outbound_publisher_alloc(), sip_outbound_publisher_init(), sip_outbound_publisher_set_uris(), sip_outbound_registration_apply(), sip_outbound_registration_regc_alloc(), sip_outbound_registration_response_cb(), sip_outbound_registration_state_destroy(), sip_outbound_registration_timer_cb(), sip_parse_host(), sip_parse_nat_option(), sip_parse_register_line(), sip_pidf_validate(), sip_poke_noanswer(), sip_poke_peer(), sip_queryoption(), sip_read(), sip_reg_timeout(), sip_register(), sip_reload(), sip_request_call(), sip_reregister(), sip_resolve_invoke_user_callback(), sip_route_process_header(), sip_send_keepalive(), sip_sendcustominfo(), sip_sendhtml(), sip_setoption(), sip_sipredirect(), sip_st_alloc(), sip_subscribe_mwi(), sip_subscription_send_request(), sip_tcptls_read(), sip_tcptls_write(), sip_thread_start(), sip_threadinfo_create(), sip_to_pjsip(), sip_write(), sipinfo_send(), sipsock_read(), siren14_parse_sdp_fmtp(), siren14read(), siren14seek(), siren14trunc(), siren14write(), siren7_parse_sdp_fmtp(), siren7read(), siren7seek(), siren7trunc(), siren7write(), skel_exec(), skinny_call(), skinny_extensionstate_cb(), skinny_fixup(), skinny_indicate(), skinny_new(), skinny_newcall(), skinny_noauth_cb(), skinny_nokeepalive_cb(), skinny_register(), skinny_request(), skinny_session(), skinny_session_cleanup(), skinny_write(), sla_add_trunk_to_station(), sla_build_station(), sla_build_trunk(), sla_load_config(), sla_queue_event_conf(), sla_state(), sla_station_exec(), sla_trunk_exec(), slinear_seek(), slinear_trunc(), slinear_write(), smart_bridge_operation(), smdi_load(), smdi_msg_read(), smdi_msg_retrieve_read(), smdi_read(), smdi_toggle_mwi(), smoother_frame_feed(), sms_exec(), sms_generate(), sms_handleincoming(), sms_log(), sms_messagerx2(), sms_process(), sms_readfile(), sms_writefile(), sndfax_exec(), socket_process_helper(), socket_process_meta(), socket_read(), softhangup_exec(), softmix_bridge_create(), softmix_bridge_join(), softmix_bridge_write(), softmix_bridge_write_text(), softmix_mixing_array_grow(), softmix_mixing_array_init(), softmix_mixing_loop(), softmix_mixing_thread(), sorcery_astdb_filter_objectset(), sorcery_config_internal_load(), sorcery_config_open(), sorcery_function_read(), sorcery_memory_cache_create(), sorcery_memory_cache_open(), sorcery_object_load(), sorcery_realtime_filter_objectset(), sorcery_realtime_open(), sorcery_realtime_retrieve_multiple(), sound_file_exists(), soundcard_init(), soundcard_writeframe(), span_message(), spandsp_fax_new(), spandsp_fax_read(), spandsp_fax_start(), spandsp_fax_write(), spandsp_log(), spandsp_modems(), spandsp_v21_detect(), spawn_dp_lookup(), spawn_mp3(), speex_get_wb_sz_at(), speex_read(), speex_samples(), speex_write(), speextolin_framein(), spy_generate(), srv_datastore_setup(), srv_query_read(), srv_result_read(), ssl_lock(), ssl_verify(), stackpeek_read(), stale_cache_update(), start_moh_exec(), start_monitor_exec(), start_network_thread(), start_poll_thread(), start_rtp(), start_stream(), startelm(), starttimer(), stasis_app_control_answer(), stasis_app_control_play_uri(), stasis_app_control_record(), stasis_app_device_state_delete(), stasis_app_device_state_update(), stasis_app_exec(), stasis_app_message_handler(), stasis_app_playback_operation(), stasis_app_recording_operation(), stasis_app_send(), stasis_app_stored_recording_find_by_name(), stasis_app_subscribe_channel(), stasis_app_unregister(), stasis_app_user_event(), stasis_caching_topic_create(), stasis_caching_unsubscribe(), stasis_end_to_json(), stasis_init(), stasis_log_bad_type_access(), stasis_message_sink_should_stay(), stasis_message_sink_wait_for(), stasis_message_sink_wait_for_count(), stasis_message_type_declined(), stasis_start_to_json(), stasis_state_add_publisher(), stasis_state_add_subscriber(), stasis_unsubscribe(), state_alloc(), static_realtime_cb(), statsd_exec(), stimulate_attended_transfer(), stir_shaken_certificate_apply(), stir_shaken_certificate_load(), stir_shaken_general_load(), stir_shaken_get_serial_number_x509(), stir_shaken_read(), stir_shaken_read_key(), stir_shaken_sign(), stir_shaken_store_load(), stir_shaken_verify_json(), stir_shaken_verify_signature(), store_boost(), store_by_peercallno(), store_by_transfercallno(), store_config(), store_config_core(), store_curl(), store_digit(), store_mixer(), store_mysql(), store_odbc(), store_pgsql(), store_tone_zone_ring_cadence(), str_to_agent_policy(), str_to_monitor_policy(), stream_echo_exec(), stream_echo_perform(), stream_echo_write_error(), strreplace(), stun_monitor_request(), stun_start_monitor(), stun_stop_monitor(), sub_persistence_recreate(), sub_start_silence(), sub_stop_silence(), subscribe_all(), subscribe_device_state(), subscript(), subscription_established(), subscription_get_handler_from_rdata(), subscription_persistence_load(), subscription_persistence_recreate(), subscription_persistence_update(), subscriptions_create(), subscriptions_destroy(), substitute_escapes(), subsystem_alert_decrement(), swap_subs(), sysinfo_helper(), syslog_log(), system_apply(), system_create_resolver_and_set_nameservers(), system_exec_helper(), t38_attach_framehook(), t38_change_state(), t38_interpret_parameters(), t38_reinvite_response_cb(), t38_tx_packet_handler(), talk_detect_fn_write(), taskprocessor_push(), tdd_feed(), tdd_new(), tds_error_handler(), tds_load_module(), tds_log(), tds_message_handler(), test_alloc(), test_config_validity(), test_generate_results(), test_jb_error_output(), test_jb_warn_output(), test_law_cmp(), test_state_changed(), test_stir_shaken_cleanup_cert(), test_stir_shaken_create_cert(), test_stir_shaken_write_temp_key(), test_vm_api_create_voicemail_files(), test_vm_api_create_voicemail_folder(), test_vm_api_remove_all_messages(), test_vm_api_test_setup(), testclient_exec(), testserver_exec(), thread_inhibits_escalations(), timed_read(), timelen_handler_fn(), timeout_read(), timeout_write(), timerfd_timer_ack(), timerfd_timer_open(), timezone_add(), timing_read(), tls_method_to_str(), to_number(), to_string(), tonepair_alloc(), tonepair_generator(), tos_handler(), tps_alert_add(), tps_task_alloc(), tps_task_alloc_local(), transfer(), transfer_call_step1(), transfer_cancel_step2(), transfer_exec(), transfer_redirect(), transmit(), transmit_audio(), transmit_cc_notify(), transmit_info_dtmf(), transmit_info_with_vidupdate(), transmit_invite(), transmit_refer(), transmit_register(), transmit_request_with_auth(), transmit_response_bysession(), transmit_response_using_temp(), transmit_response_with_auth(), transmit_response_with_sdp(), transmit_response_with_t38_sdp(), transmit_state_notify(), transmit_t38(), transport_apply(), transport_create(), transport_tls_file_handler(), transport_tos_handler(), try_calling(), try_firmware(), try_load_key(), try_suggested_sip_codec(), try_transfer(), tryexec_exec(), tvfix(), txt_callback(), udptl_pre_apply_config(), uint_handler_fn(), unalloc_sub(), unbound_config_apply_default(), unbound_config_preapply(), unbound_resolver_resolve(), unicast_rtp_request(), unistim_answer(), unistim_call(), unistim_do_senddigit(), unistim_fixup(), unistim_indicate(), unistim_new(), unistim_request(), unistim_rtp_read(), unistim_sendtext(), unistim_set_rtp_peer(), unistim_ss(), unistim_write(), unistimsock_read(), unload_dynamic_module(), unload_module(), unlock_read(), unregister_exten(), unshift_push(), unsignal_pipe(), unsubscribe(), unsupported_handler(), update2_curl(), update2_ldap(), update2_mysql(), update2_odbc(), update2_pgsql(), update2_prepare(), update_call_counter(), update_config(), update_connected_line_information(), update_content_type(), update_curl(), update_from(), update_header(), update_key(), update_modem_bits(), update_mysql(), update_odbc(), update_pgsql(), update_registry(), update_scoreboard(), update_stats(), update_to_uri(), upqm_exec(), uri_parse_and_default(), used_blocks(), userevent_exec(), users_apply_handler(), ustmtext(), valid_priv_reply(), validate_data(), validate_metric(), validate_metric_type_counter(), validate_metric_type_gauge(), validate_metric_type_set(), validate_metric_type_timer(), validate_name(), validate_numeric(), validate_publish_config(), validate_user_cb(), value_in_range(), variable_list_append(), vars_to_headers(), verbose_exec(), verify_default_parking_lot(), verify_default_profiles(), verify_user_event_fields(), vm_allocate_dh(), vm_authenticate(), vm_change_password(), vm_check_password_shell(), vm_exec(), vm_execmain(), vm_intro(), vm_mailbox_snapshot_create(), vm_msg_forward(), vm_msg_move(), vm_msg_play(), vm_msg_remove(), vm_msg_snapshot_create(), vm_newuser_setup(), vm_options(), vmsayname_exec(), volume_read(), volume_write(), vox_read(), vox_seek(), vox_trunc(), vox_write(), vp8_set(), wait_exec(), wait_file(), wait_file2(), wait_for_answer(), wait_for_digits(), wait_for_output(), wait_for_winner(), wait_to_recall_exit(), wait_to_retransfer_exit(), waitfor_exec(), waitforring_exec(), waitstream_core(), waituntil_exec(), wav_close(), wav_read(), wav_seek(), wav_trunc(), wav_write(), websocket_cb(), websocket_client_args_create(), websocket_client_create(), websocket_client_create_key(), websocket_client_handle_response_code(), websocket_client_handshake(), websocket_client_handshake_get_response(), websocket_echo_callback(), websocket_on_rx_msg(), while(), write_cel(), write_header(), write_history(), write_openssl_error_to_log(), write_password_to_file(), write_stream(), writefile(), writefile_account(), ws_safe_read(), xmldoc_build_field(), xmldoc_get_syntax_fun(), xmldoc_string_cleanup(), xmldoc_string_wrap(), xmldoc_update_config_option(), xmldoc_update_config_type(), xmpp_action_hook(), xmpp_client_alloc(), xmpp_client_authenticate_digest(), xmpp_client_authenticate_sasl(), xmpp_client_authenticating(), xmpp_client_config_post_apply(), xmpp_client_receive(), xmpp_client_reconnect(), xmpp_client_request_tls(), xmpp_client_requested_tls(), xmpp_client_service_discovery_get_hook(), xmpp_client_set_presence(), xmpp_client_subscribe_user(), xmpp_client_thread(), xmpp_client_unsubscribe_user(), xmpp_component_authenticate(), xmpp_component_authenticating(), xmpp_component_register_get_hook(), xmpp_component_register_set_hook(), xmpp_component_service_discovery_get_hook(), xmpp_component_service_discovery_items_hook(), xmpp_config_prelink(), xmpp_connect_hook(), xmpp_join_exec(), xmpp_leave_exec(), xmpp_pak_presence(), xmpp_pak_s10n(), xmpp_pubsub_create_affiliations(), xmpp_pubsub_delete_node_list(), xmpp_pubsub_handle_error(), xmpp_pubsub_handle_event(), xmpp_pubsub_request_nodes(), xmpp_pubsub_subscribe(), xmpp_pubsub_unsubscribe(), xmpp_roster_hook(), xmpp_send_cb(), xmpp_send_exec(), xmpp_sendgroup_exec(), xpidf_to_string(), yyerror(), yyparse(), and zombify_threads().

◆ DEBUG_THREADS_LOOSE_ABI

#define DEBUG_THREADS_LOOSE_ABI

Definition at line 30 of file astobj2.c.

◆ EXCESSIVE_REF_COUNT

#define EXCESSIVE_REF_COUNT   100000

Referenced by __ao2_ref().

◆ EXTERNAL_OBJ

#define EXTERNAL_OBJ (   _p)    ((_p) == NULL ? NULL : (_p)->user_data)

convert from a pointer _p to an astobj2 object

Returns
the pointer to the user-defined portion.

Definition at line 191 of file astobj2.c.

Referenced by internal_ao2_alloc().

◆ INTERNAL_OBJ

#define INTERNAL_OBJ (   user_data)    (struct astobj2 *) ((char *) user_data - sizeof(struct astobj2))

◆ INTERNAL_OBJ_CHECK

#define INTERNAL_OBJ_CHECK (   user_data)    __INTERNAL_OBJ_CHECK(user_data, __FILE__, __LINE__, __PRETTY_FUNCTION__)

◆ INTERNAL_OBJ_LOCKOBJ

#define INTERNAL_OBJ_LOCKOBJ (   user_data)    ((struct astobj2_lockobj *) (((char *) (user_data)) - sizeof(struct astobj2_lockobj)))

Definition at line 160 of file astobj2.c.

Referenced by __adjust_lock(), __ao2_lock(), __ao2_ref(), __ao2_trylock(), and __ao2_unlock().

◆ INTERNAL_OBJ_MUTEX

#define INTERNAL_OBJ_MUTEX (   user_data)    ((struct astobj2_lock *) (((char *) (user_data)) - sizeof(struct astobj2_lock)))

◆ INTERNAL_OBJ_RWLOCK

#define INTERNAL_OBJ_RWLOCK (   user_data)    ((struct astobj2_rwlock *) (((char *) (user_data)) - sizeof(struct astobj2_rwlock)))

Definition at line 157 of file astobj2.c.

Referenced by __adjust_lock(), __ao2_lock(), __ao2_ref(), __ao2_trylock(), and __ao2_unlock().

◆ IS_AO2_MAGIC_BAD

#define IS_AO2_MAGIC_BAD (   p)    (AO2_MAGIC != (p->priv_data.magic | 1))

Definition at line 98 of file astobj2.c.

Referenced by internal_is_ao2_object().

Function Documentation

◆ __adjust_lock()

enum ao2_lock_req __adjust_lock ( void *  user_data,
enum ao2_lock_req  lock_how,
int  keep_stronger 
)

Definition at line 425 of file astobj2.c.

References __adjust_lock(), AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_OBJ, AO2_ALLOC_OPT_LOCK_RWLOCK, AO2_LOCK_REQ_MUTEX, AO2_LOCK_REQ_RDLOCK, AO2_LOCK_REQ_WRLOCK, ao2_rdlock, ao2_unlock, ao2_wrlock, ast_log, INTERNAL_OBJ, INTERNAL_OBJ_LOCKOBJ, INTERNAL_OBJ_RWLOCK, ao2_lockobj_priv::lock, astobj2_lockobj::lockobj, LOG_ERROR, ao2_rwlock_priv::num_lockers, __priv_data::options, astobj2::priv_data, and astobj2_rwlock::rwlock.

Referenced by __adjust_lock(), __ao2_iterator_next(), __ao2_link(), __ao2_weakproxy_find(), ao2_iterator_restart(), hash_ao2_node_destructor(), internal_ao2_traverse(), and rb_ao2_node_destructor().

426 {
427  struct astobj2 *obj = INTERNAL_OBJ(user_data);
428  struct astobj2_rwlock *obj_rwlock;
429  struct astobj2_lockobj *obj_lockobj;
430  enum ao2_lock_req orig_lock;
431 
432  switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
434  obj_rwlock = INTERNAL_OBJ_RWLOCK(user_data);
435  if (obj_rwlock->rwlock.num_lockers < 0) {
436  orig_lock = AO2_LOCK_REQ_WRLOCK;
437  } else {
438  orig_lock = AO2_LOCK_REQ_RDLOCK;
439  }
440  switch (lock_how) {
441  case AO2_LOCK_REQ_MUTEX:
442  lock_how = AO2_LOCK_REQ_WRLOCK;
443  /* Fall through */
444  case AO2_LOCK_REQ_WRLOCK:
445  if (lock_how != orig_lock) {
446  /* Switch from read lock to write lock. */
449  }
450  break;
451  case AO2_LOCK_REQ_RDLOCK:
452  if (!keep_stronger && lock_how != orig_lock) {
453  /* Switch from write lock to read lock. */
456  }
457  break;
458  }
459  break;
461  obj_lockobj = INTERNAL_OBJ_LOCKOBJ(user_data);
462  orig_lock = __adjust_lock(obj_lockobj->lockobj.lock, lock_how, keep_stronger);
463  break;
464  default:
465  ast_log(LOG_ERROR, "Invalid lock option on ao2 object %p\n", user_data);
466  /* Fall through */
469  orig_lock = AO2_LOCK_REQ_MUTEX;
470  break;
471  }
472 
473  return orig_lock;
474 }
uint32_t options
The ao2 object option flags.
Definition: astobj2.c:70
ao2_lock_req
Which lock to request.
Definition: astobj2.h:701
#define ao2_unlock(a)
Definition: astobj2.h:730
#define ao2_wrlock(a)
Definition: astobj2.h:720
#define INTERNAL_OBJ_LOCKOBJ(user_data)
Definition: astobj2.c:160
struct ao2_rwlock_priv rwlock
Definition: astobj2.c:134
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
void * user_data[0]
Definition: astobj2.c:147
#define INTERNAL_OBJ(user_data)
Definition: astobj2.c:163
#define ao2_rdlock(a)
Definition: astobj2.h:719
#define INTERNAL_OBJ_RWLOCK(user_data)
Definition: astobj2.c:157
void * user_data[0]
Definition: astobj2.c:106
enum ao2_lock_req __adjust_lock(void *user_data, enum ao2_lock_req lock_how, int keep_stronger)
Definition: astobj2.c:425
struct __priv_data priv_data
Definition: astobj2.c:105
struct ao2_lockobj_priv lockobj
Definition: astobj2.c:145

◆ __ao2_alloc()

void* __ao2_alloc ( size_t  data_size,
ao2_destructor_fn  destructor_fn,
unsigned int  options,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Definition at line 765 of file astobj2.c.

References internal_ao2_alloc(), and NULL.

Referenced by __ao2_container_alloc_hash(), __ao2_container_alloc_rbtree(), __ao2_weakproxy_alloc(), __ast_channel_internal_alloc(), __ast_format_cap_alloc(), __ast_named_lock_get(), __ast_sorcery_open(), __sip_alloc(), _moh_class_malloc(), and state_alloc().

767 {
768  return internal_ao2_alloc(data_size, destructor_fn, options, NULL, tag, file, line, func);
769 }
#define NULL
Definition: resample.c:96
static struct test_options options
static void * internal_ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn, unsigned int options, void *lockobj, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:681

◆ __ao2_alloc_with_lockobj()

void* __ao2_alloc_with_lockobj ( size_t  data_size,
ao2_destructor_fn  destructor_fn,
void *  lockobj,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Definition at line 771 of file astobj2.c.

References AO2_ALLOC_OPT_LOCK_OBJ, and internal_ao2_alloc().

773 {
774  return internal_ao2_alloc(data_size, destructor_fn, AO2_ALLOC_OPT_LOCK_OBJ, lockobj,
775  tag, file, line, func);
776 }
struct ao2_lockobj_priv lockobj
Definition: astobj2.c:145
static void * internal_ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn, unsigned int options, void *lockobj, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:681

◆ __ao2_cleanup()

void __ao2_cleanup ( void *  obj)

gcc attribute(cleanup()) functions

Note
they must be able to handle NULL parameters because most of the allocation/find functions can fail and we don't want to try to tear down a NULL

Definition at line 674 of file astobj2.c.

References ao2_ref.

Referenced by agent_request_exec(), ast_ari_bridges_set_video_source(), bridge_agent_hold_push(), bridge_builtin_set_limits(), bridge_stasis_queue_join_action(), dial_bridge_after_cb(), internal_bridge_after_cb(), native_rtp_bridge_framehook_attach(), and parking_set_duration().

675 {
676  if (obj) {
677  ao2_ref(obj, -1);
678  }
679 }
#define ao2_ref(o, delta)
Definition: astobj2.h:464

◆ __ao2_cleanup_debug()

void __ao2_cleanup_debug ( void *  obj,
const char *  tag,
const char *  file,
int  line,
const char *  function 
)

Definition at line 667 of file astobj2.c.

References __ao2_ref().

668 {
669  if (obj) {
670  __ao2_ref(obj, -1, tag, file, line, function);
671  }
672 }
int __ao2_ref(void *user_data, int delta, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:498

◆ __ao2_get_weakproxy()

void* __ao2_get_weakproxy ( void *  obj,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Get the weakproxy attached to obj.

Since
14.0.0
Parameters
objThe object to retrieve a weakproxy from
Returns
The weakproxy object

Definition at line 914 of file astobj2.c.

References __ao2_ref(), __INTERNAL_OBJ_CHECK, AO2_MAGIC, __priv_data::magic, NULL, astobj2::priv_data, and __priv_data::weakptr.

915 {
916  struct astobj2 *obj_internal = __INTERNAL_OBJ_CHECK(obj, file, line, func);
917 
918  if (!obj_internal || obj_internal->priv_data.magic != AO2_MAGIC) {
919  /* This method is meant to be run on normal ao2 objects! */
920  return NULL;
921  }
922 
923  if (!obj_internal->priv_data.weakptr) {
924  return NULL;
925  }
926 
927  __ao2_ref(obj_internal->priv_data.weakptr, +1, tag, file, line, func);
928  return obj_internal->priv_data.weakptr;
929 }
#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
convert from a pointer _p to a user-defined object
Definition: astobj2.c:171
#define NULL
Definition: resample.c:96
#define AO2_MAGIC
Definition: astobj2.c:96
int __ao2_ref(void *user_data, int delta, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:498
void * weakptr
Definition: astobj2.c:57
struct __priv_data priv_data
Definition: astobj2.c:105
uint32_t magic
Definition: astobj2.c:93

◆ __ao2_lock()

int __ao2_lock ( void *  a,
enum ao2_lock_req  lock_how,
const char *  file,
const char *  func,
int  line,
const char *  var 
)

Lock an object.

Parameters
aA pointer to the object we want to lock.
lock_how,file,func,line,var
Returns
0 on success, other values on error.

Definition at line 222 of file astobj2.c.

References __ast_pthread_mutex_lock(), __ast_rwlock_rdlock(), __ast_rwlock_wrlock(), __INTERNAL_OBJ_CHECK, __LOG_ERROR, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_OBJ, AO2_ALLOC_OPT_LOCK_RWLOCK, AO2_LOCK_REQ_MUTEX, AO2_LOCK_REQ_RDLOCK, AO2_LOCK_REQ_WRLOCK, ast_atomic_fetchadd_int(), ast_log, INTERNAL_OBJ_LOCKOBJ, INTERNAL_OBJ_MUTEX, INTERNAL_OBJ_RWLOCK, ao2_lock_priv::lock, ao2_rwlock_priv::lock, ao2_lockobj_priv::lock, astobj2_lockobj::lockobj, __priv_data::lockused, astobj2_lock::mutex, NULL, ao2_rwlock_priv::num_lockers, __priv_data::options, astobj2::priv_data, ref_log, and astobj2_rwlock::rwlock.

Referenced by _agent_lock(), _ast_bridge_channel_lock(), and _ast_bridge_lock().

223 {
224  struct astobj2 *obj = __INTERNAL_OBJ_CHECK(user_data, file, line, func);
225  struct astobj2_lock *obj_mutex;
226  struct astobj2_rwlock *obj_rwlock;
227  struct astobj2_lockobj *obj_lockobj;
228  int res = 0;
229 
230  if (obj == NULL) {
231  return -1;
232  }
233 
234  if (ref_log) {
235  obj->priv_data.lockused = 1;
236  }
237 
238  switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
240  obj_mutex = INTERNAL_OBJ_MUTEX(user_data);
241  res = __ast_pthread_mutex_lock(file, line, func, var, &obj_mutex->mutex.lock);
242 #ifdef AO2_DEBUG
243  if (!res) {
244  ast_atomic_fetchadd_int(&ao2.total_locked, 1);
245  }
246 #endif
247  break;
249  obj_rwlock = INTERNAL_OBJ_RWLOCK(user_data);
250  switch (lock_how) {
251  case AO2_LOCK_REQ_MUTEX:
252  case AO2_LOCK_REQ_WRLOCK:
253  res = __ast_rwlock_wrlock(file, line, func, &obj_rwlock->rwlock.lock, var);
254  if (!res) {
255  ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, -1);
256 #ifdef AO2_DEBUG
257  ast_atomic_fetchadd_int(&ao2.total_locked, 1);
258 #endif
259  }
260  break;
261  case AO2_LOCK_REQ_RDLOCK:
262  res = __ast_rwlock_rdlock(file, line, func, &obj_rwlock->rwlock.lock, var);
263  if (!res) {
264  ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, +1);
265 #ifdef AO2_DEBUG
266  ast_atomic_fetchadd_int(&ao2.total_locked, 1);
267 #endif
268  }
269  break;
270  }
271  break;
273  /* The ao2 object has no lock. */
274  break;
276  obj_lockobj = INTERNAL_OBJ_LOCKOBJ(user_data);
277  res = __ao2_lock(obj_lockobj->lockobj.lock, lock_how, file, func, line, var);
278  break;
279  default:
280  ast_log(__LOG_ERROR, file, line, func, "Invalid lock option on ao2 object %p\n",
281  user_data);
282  return -1;
283  }
284 
285  return res;
286 }
uint32_t options
The ao2 object option flags.
Definition: astobj2.c:70
int __ao2_lock(void *user_data, enum ao2_lock_req lock_how, const char *file, const char *func, int line, const char *var)
Lock an object.
Definition: astobj2.c:222
struct ao2_lock_priv mutex
Definition: astobj2.c:121
#define var
Definition: ast_expr2f.c:614
int __ast_rwlock_rdlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
Definition: lock.c:819
#define __LOG_ERROR
Definition: logger.h:284
#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
convert from a pointer _p to a user-defined object
Definition: astobj2.c:171
#define NULL
Definition: resample.c:96
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
Definition: lock.h:755
ast_rwlock_t lock
Definition: astobj2.c:127
#define INTERNAL_OBJ_LOCKOBJ(user_data)
Definition: astobj2.c:160
struct ao2_rwlock_priv rwlock
Definition: astobj2.c:134
ast_mutex_t lock
Definition: astobj2.c:116
#define ast_log
Definition: astobj2.c:42
uint32_t lockused
Set to 1 when the lock is used if refdebug is enabled.
Definition: astobj2.c:77
void * user_data[0]
Definition: astobj2.c:147
#define INTERNAL_OBJ_RWLOCK(user_data)
Definition: astobj2.c:157
#define INTERNAL_OBJ_MUTEX(user_data)
Definition: astobj2.c:154
int __ast_rwlock_wrlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
Definition: lock.c:917
void * user_data[0]
Definition: astobj2.c:106
int __ast_pthread_mutex_lock(const char *filename, int lineno, const char *func, const char *mutex_name, ast_mutex_t *t)
Definition: lock.c:253
struct __priv_data priv_data
Definition: astobj2.c:105
static FILE * ref_log
Definition: astobj2.c:44
struct ao2_lockobj_priv lockobj
Definition: astobj2.c:145

◆ __ao2_ref()

int __ao2_ref ( void *  user_data,
int  delta,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Definition at line 498 of file astobj2.c.

References __ast_assert_failed(), __INTERNAL_OBJ_CHECK, __LOG_ERROR, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_OBJ, AO2_ALLOC_OPT_LOCK_RWLOCK, AO2_ALLOC_OPT_NO_REF_DEBUG, ao2_lock, AO2_MAGIC, ao2_ref, ao2_t_ref, ao2_unlock, ast_assert, ast_atomic_fetch_add, ast_atomic_fetchadd_int(), ast_free, ast_get_tid(), AST_LIST_HEAD_INIT_NOLOCK, AST_LIST_REMOVE_HEAD, ast_log, ast_mutex_destroy, ast_rwlock_destroy, ao2_weakproxy_notification::cb, ao2_weakproxy_notification::data, ao2_weakproxy::destroyed_cb, __priv_data::destructor_fn, EXCESSIVE_REF_COUNT, INTERNAL_OBJ_CHECK, INTERNAL_OBJ_LOCKOBJ, INTERNAL_OBJ_MUTEX, INTERNAL_OBJ_RWLOCK, ao2_weakproxy_notification::list, ao2_lock_priv::lock, ao2_rwlock_priv::lock, ao2_lockobj_priv::lock, astobj2_lockobj::lockobj, __priv_data::lockused, __priv_data::magic, astobj2_lock::mutex, NULL, __priv_data::options, astobj2::priv_data, __priv_data::ref_counter, ref_log, astobj2_rwlock::rwlock, and __priv_data::weakptr.

Referenced by __ao2_cleanup_debug(), __ao2_container_clone(), __ao2_get_weakproxy(), __ao2_global_obj_ref(), __ao2_global_obj_replace(), __ao2_global_obj_replace_unref(), __ao2_iterator_next(), __ao2_weakproxy_get_object(), __ao2_weakproxy_ref_object(), __ao2_weakproxy_set_object(), __ast_format_cap_append(), __ast_module_ref(), __ast_module_unref(), __container_unlink_node_debug(), __find_call(), _mohclass_unref(), hash_ao2_new_node(), internal_ao2_traverse(), and rb_ao2_new_node().

500 {
501  struct astobj2 *obj = __INTERNAL_OBJ_CHECK(user_data, file, line, func);
502  struct astobj2_lock *obj_mutex;
503  struct astobj2_rwlock *obj_rwlock;
504  struct astobj2_lockobj *obj_lockobj;
505  int32_t current_value;
506  int32_t ret;
507  struct ao2_weakproxy *weakproxy = NULL;
508  const char *lock_state;
509 
510  if (obj == NULL) {
511  if (ref_log && user_data) {
512  fprintf(ref_log, "%p,%d,%d,%s,%d,%s,**invalid**,%s\n",
513  user_data, delta, ast_get_tid(), file, line, func, tag ?: "");
514  fflush(ref_log);
515  }
516  return -1;
517  }
518 
519  /* if delta is 0, just return the refcount */
520  if (delta == 0) {
521  return obj->priv_data.ref_counter;
522  }
523 
524  if (delta < 0 && obj->priv_data.magic == AO2_MAGIC && (weakproxy = obj->priv_data.weakptr)) {
525  ao2_lock(weakproxy);
526  }
527 
528  /* we modify with an atomic operation the reference counter */
529  ret = ast_atomic_fetch_add(&obj->priv_data.ref_counter, delta, __ATOMIC_RELAXED);
530  current_value = ret + delta;
531 
532 #ifdef AO2_DEBUG
533  ast_atomic_fetchadd_int(&ao2.total_refs, delta);
534 #endif
535 
536  if (weakproxy) {
537  struct ao2_weakproxy cbs;
538 
539  if (current_value == 1) {
540  /* The only remaining reference is the one owned by the weak object */
541  struct astobj2 *internal_weakproxy;
542 
543  internal_weakproxy = INTERNAL_OBJ_CHECK(weakproxy);
544 
545  /* Unlink the obj from the weak proxy */
546  internal_weakproxy->priv_data.weakptr = NULL;
547  obj->priv_data.weakptr = NULL;
548 
549  /* transfer list to local copy so callbacks are run with weakproxy unlocked. */
550  cbs.destroyed_cb = weakproxy->destroyed_cb;
552 
553  /* weak is already unlinked from obj so this won't recurse */
554  ao2_ref(user_data, -1);
555  }
556 
557  ao2_unlock(weakproxy);
558 
559  if (current_value == 1) {
560  struct ao2_weakproxy_notification *destroyed_cb;
561 
562  /* Notify the subscribers that weakproxy now points to NULL. */
563  while ((destroyed_cb = AST_LIST_REMOVE_HEAD(&cbs.destroyed_cb, list))) {
564  destroyed_cb->cb(weakproxy, destroyed_cb->data);
565  ast_free(destroyed_cb);
566  }
567 
568  ao2_ref(weakproxy, -1);
569  }
570  }
571 
572  if (0 < current_value) {
573  /* The object still lives. */
574 #define EXCESSIVE_REF_COUNT 100000
575 
576  if (EXCESSIVE_REF_COUNT <= current_value && ret < EXCESSIVE_REF_COUNT) {
577  char excessive_ref_buf[100];
578 
579  /* We just reached or went over the excessive ref count trigger */
580  snprintf(excessive_ref_buf, sizeof(excessive_ref_buf),
581  "Excessive refcount %d reached on ao2 object %p",
582  (int)current_value, user_data);
583  ast_log(__LOG_ERROR, file, line, func, "%s\n", excessive_ref_buf);
584 
585  __ast_assert_failed(0, excessive_ref_buf, file, line, func);
586  }
587 
589  fprintf(ref_log, "%p,%s%d,%d,%s,%d,%s,%d,%s\n", user_data,
590  (delta < 0 ? "" : "+"), delta, ast_get_tid(),
591  file, line, func, (int)ret, tag ?: "");
592  fflush(ref_log);
593  }
594  return ret;
595  }
596 
597  /* this case must never happen */
598  if (current_value < 0) {
599  ast_log(__LOG_ERROR, file, line, func,
600  "Invalid refcount %d on ao2 object %p\n", (int)current_value, user_data);
601  if (ref_log) {
602  /* Log to ref_log even if AO2_ALLOC_OPT_NO_REF_DEBUG */
603  fprintf(ref_log, "%p,%d,%d,%s,%d,%s,**invalid**,%s\n",
604  user_data, delta, ast_get_tid(), file, line, func, tag ?: "");
605  fflush(ref_log);
606  }
607  ast_assert(0);
608  /* stop here even if assert doesn't DO_CRASH */
609  return -1;
610  }
611 
612  /* last reference, destroy the object */
613  if (obj->priv_data.destructor_fn != NULL) {
614  obj->priv_data.destructor_fn(user_data);
615  }
616 
617 #ifdef AO2_DEBUG
618  ast_atomic_fetchadd_int(&ao2.total_mem, - obj->priv_data.data_size);
619  ast_atomic_fetchadd_int(&ao2.total_objects, -1);
620 #endif
621 
622  /* In case someone uses an object after it's been freed */
623  obj->priv_data.magic = 0;
624 
625  switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
627  obj_mutex = INTERNAL_OBJ_MUTEX(user_data);
628  lock_state = obj->priv_data.lockused ? "used" : "unused";
629  ast_mutex_destroy(&obj_mutex->mutex.lock);
630 
631  ast_free(obj_mutex);
632  break;
634  obj_rwlock = INTERNAL_OBJ_RWLOCK(user_data);
635  lock_state = obj->priv_data.lockused ? "used" : "unused";
636  ast_rwlock_destroy(&obj_rwlock->rwlock.lock);
637 
638  ast_free(obj_rwlock);
639  break;
641  lock_state = "none";
642  ast_free(obj);
643  break;
645  obj_lockobj = INTERNAL_OBJ_LOCKOBJ(user_data);
646  lock_state = obj->priv_data.lockused ? "used" : "unused";
647  ao2_t_ref(obj_lockobj->lockobj.lock, -1, "release lockobj");
648 
649  ast_free(obj_lockobj);
650  break;
651  default:
652  ast_log(__LOG_ERROR, file, line, func,
653  "Invalid lock option on ao2 object %p\n", user_data);
654  lock_state = "invalid";
655  break;
656  }
657 
659  fprintf(ref_log, "%p,%d,%d,%s,%d,%s,**destructor**lock-state:%s**,%s\n",
660  user_data, delta, ast_get_tid(), file, line, func, lock_state, tag ?: "");
661  fflush(ref_log);
662  }
663 
664  return ret;
665 }
#define ao2_t_ref(o, delta, tag)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:463
uint32_t options
The ao2 object option flags.
Definition: astobj2.c:70
struct ao2_lock_priv mutex
Definition: astobj2.c:121
#define ast_rwlock_destroy(rwlock)
Definition: lock.h:231
#define ast_atomic_fetch_add(ptr, val, memorder)
Support for atomic instructions.
Definition: lock.h:667
#define ast_assert(a)
Definition: utils.h:695
#define ao2_unlock(a)
Definition: astobj2.h:730
#define __LOG_ERROR
Definition: logger.h:284
#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
convert from a pointer _p to a user-defined object
Definition: astobj2.c:171
#define NULL
Definition: resample.c:96
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
Definition: lock.h:755
ast_rwlock_t lock
Definition: astobj2.c:127
#define EXCESSIVE_REF_COUNT
#define AO2_MAGIC
Definition: astobj2.c:96
#define INTERNAL_OBJ_LOCKOBJ(user_data)
Definition: astobj2.c:160
struct ao2_rwlock_priv rwlock
Definition: astobj2.c:134
ast_mutex_t lock
Definition: astobj2.c:116
#define ast_log
Definition: astobj2.c:42
#define INTERNAL_OBJ_CHECK(user_data)
Definition: astobj2.c:183
int ast_get_tid(void)
Get current thread ID.
Definition: main/utils.c:2504
#define ao2_ref(o, delta)
Definition: astobj2.h:464
ao2_destructor_fn destructor_fn
Definition: astobj2.c:55
#define ao2_lock(a)
Definition: astobj2.h:718
uint32_t lockused
Set to 1 when the lock is used if refdebug is enabled.
Definition: astobj2.c:77
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
Definition: linkedlists.h:832
void DO_CRASH_NORETURN __ast_assert_failed(int condition, const char *condition_str, const char *file, int line, const char *function)
Definition: main/utils.c:2564
struct ao2_weakproxy::@224 destroyed_cb
struct ao2_weakproxy_notification::@339 list
void * weakptr
Definition: astobj2.c:57
#define INTERNAL_OBJ_RWLOCK(user_data)
Definition: astobj2.c:157
#define INTERNAL_OBJ_MUTEX(user_data)
Definition: astobj2.c:154
#define ast_free(a)
Definition: astmm.h:182
#define AST_LIST_HEAD_INIT_NOLOCK(head)
Initializes a list head structure.
Definition: linkedlists.h:680
void * user_data[0]
Definition: astobj2.c:106
This struct should be opaque, but it&#39;s size is needed.
Definition: astobj2.h:530
int32_t ref_counter
Definition: astobj2.c:63
struct __priv_data priv_data
Definition: astobj2.c:105
ao2_weakproxy_notification_cb cb
Definition: astobj2.c:110
int int32_t
Definition: db.h:60
#define ast_mutex_destroy(a)
Definition: lock.h:186
static FILE * ref_log
Definition: astobj2.c:44
struct ao2_lockobj_priv lockobj
Definition: astobj2.c:145
uint32_t magic
Definition: astobj2.c:93

◆ __ao2_trylock()

int __ao2_trylock ( void *  a,
enum ao2_lock_req  lock_how,
const char *  file,
const char *  func,
int  line,
const char *  var 
)

Try locking– (don't block if fail)

Parameters
aA pointer to the object we want to lock.
lock_how,file,func,line,var
Returns
0 on success, other values on error.

Definition at line 342 of file astobj2.c.

References __ast_pthread_mutex_trylock(), __ast_rwlock_tryrdlock(), __ast_rwlock_trywrlock(), __INTERNAL_OBJ_CHECK, __LOG_ERROR, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_OBJ, AO2_ALLOC_OPT_LOCK_RWLOCK, AO2_LOCK_REQ_MUTEX, AO2_LOCK_REQ_RDLOCK, AO2_LOCK_REQ_WRLOCK, ast_atomic_fetchadd_int(), ast_log, INTERNAL_OBJ_LOCKOBJ, INTERNAL_OBJ_MUTEX, INTERNAL_OBJ_RWLOCK, ao2_lock_priv::lock, ao2_rwlock_priv::lock, ao2_lockobj_priv::lock, astobj2_lockobj::lockobj, __priv_data::lockused, astobj2_lock::mutex, NULL, ao2_rwlock_priv::num_lockers, __priv_data::options, astobj2::priv_data, ref_log, and astobj2_rwlock::rwlock.

Referenced by _ast_bridge_channel_trylock(), and _ast_bridge_trylock().

343 {
344  struct astobj2 *obj = __INTERNAL_OBJ_CHECK(user_data, file, line, func);
345  struct astobj2_lock *obj_mutex;
346  struct astobj2_rwlock *obj_rwlock;
347  struct astobj2_lockobj *obj_lockobj;
348  int res = 0;
349 
350  if (obj == NULL) {
351  return -1;
352  }
353 
354  if (ref_log) {
355  obj->priv_data.lockused = 1;
356  }
357 
358  switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
360  obj_mutex = INTERNAL_OBJ_MUTEX(user_data);
361  res = __ast_pthread_mutex_trylock(file, line, func, var, &obj_mutex->mutex.lock);
362 #ifdef AO2_DEBUG
363  if (!res) {
364  ast_atomic_fetchadd_int(&ao2.total_locked, 1);
365  }
366 #endif
367  break;
369  obj_rwlock = INTERNAL_OBJ_RWLOCK(user_data);
370  switch (lock_how) {
371  case AO2_LOCK_REQ_MUTEX:
372  case AO2_LOCK_REQ_WRLOCK:
373  res = __ast_rwlock_trywrlock(file, line, func, &obj_rwlock->rwlock.lock, var);
374  if (!res) {
375  ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, -1);
376 #ifdef AO2_DEBUG
377  ast_atomic_fetchadd_int(&ao2.total_locked, 1);
378 #endif
379  }
380  break;
381  case AO2_LOCK_REQ_RDLOCK:
382  res = __ast_rwlock_tryrdlock(file, line, func, &obj_rwlock->rwlock.lock, var);
383  if (!res) {
384  ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, +1);
385 #ifdef AO2_DEBUG
386  ast_atomic_fetchadd_int(&ao2.total_locked, 1);
387 #endif
388  }
389  break;
390  }
391  break;
393  /* The ao2 object has no lock. */
394  return 0;
396  obj_lockobj = INTERNAL_OBJ_LOCKOBJ(user_data);
397  res = __ao2_trylock(obj_lockobj->lockobj.lock, lock_how, file, func, line, var);
398  break;
399  default:
400  ast_log(__LOG_ERROR, file, line, func, "Invalid lock option on ao2 object %p\n",
401  user_data);
402  return -1;
403  }
404 
405  return res;
406 }
int __ao2_trylock(void *user_data, enum ao2_lock_req lock_how, const char *file, const char *func, int line, const char *var)
Try locking– (don&#39;t block if fail)
Definition: astobj2.c:342
int __ast_rwlock_trywrlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
Definition: lock.c:1228
uint32_t options
The ao2 object option flags.
Definition: astobj2.c:70
struct ao2_lock_priv mutex
Definition: astobj2.c:121
#define var
Definition: ast_expr2f.c:614
#define __LOG_ERROR
Definition: logger.h:284
#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
convert from a pointer _p to a user-defined object
Definition: astobj2.c:171
#define NULL
Definition: resample.c:96
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
Definition: lock.h:755
ast_rwlock_t lock
Definition: astobj2.c:127
#define INTERNAL_OBJ_LOCKOBJ(user_data)
Definition: astobj2.c:160
struct ao2_rwlock_priv rwlock
Definition: astobj2.c:134
ast_mutex_t lock
Definition: astobj2.c:116
#define ast_log
Definition: astobj2.c:42
uint32_t lockused
Set to 1 when the lock is used if refdebug is enabled.
Definition: astobj2.c:77
void * user_data[0]
Definition: astobj2.c:147
#define INTERNAL_OBJ_RWLOCK(user_data)
Definition: astobj2.c:157
#define INTERNAL_OBJ_MUTEX(user_data)
Definition: astobj2.c:154
void * user_data[0]
Definition: astobj2.c:106
struct __priv_data priv_data
Definition: astobj2.c:105
int __ast_pthread_mutex_trylock(const char *filename, int lineno, const char *func, const char *mutex_name, ast_mutex_t *t)
Definition: lock.c:366
static FILE * ref_log
Definition: astobj2.c:44
int __ast_rwlock_tryrdlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
Definition: lock.c:1178
struct ao2_lockobj_priv lockobj
Definition: astobj2.c:145

◆ __ao2_unlock()

int __ao2_unlock ( void *  a,
const char *  file,
const char *  func,
int  line,
const char *  var 
)

Unlock an object.

Parameters
aA pointer to the object we want unlock.
file,func,line,var
Returns
0 on success, other values on error.

Definition at line 288 of file astobj2.c.

References __ast_pthread_mutex_unlock(), __ast_rwlock_unlock(), __INTERNAL_OBJ_CHECK, __LOG_ERROR, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_OBJ, AO2_ALLOC_OPT_LOCK_RWLOCK, ast_atomic_fetchadd_int(), ast_log, INTERNAL_OBJ_LOCKOBJ, INTERNAL_OBJ_MUTEX, INTERNAL_OBJ_RWLOCK, ao2_lock_priv::lock, ao2_rwlock_priv::lock, ao2_lockobj_priv::lock, astobj2_lockobj::lockobj, astobj2_lock::mutex, NULL, ao2_rwlock_priv::num_lockers, __priv_data::options, astobj2::priv_data, and astobj2_rwlock::rwlock.

Referenced by _agent_unlock(), _ast_bridge_channel_unlock(), and _ast_bridge_unlock().

289 {
290  struct astobj2 *obj = __INTERNAL_OBJ_CHECK(user_data, file, line, func);
291  struct astobj2_lock *obj_mutex;
292  struct astobj2_rwlock *obj_rwlock;
293  struct astobj2_lockobj *obj_lockobj;
294  int res = 0;
295  int current_value;
296 
297  if (obj == NULL) {
298  return -1;
299  }
300 
301  switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
303  obj_mutex = INTERNAL_OBJ_MUTEX(user_data);
304  res = __ast_pthread_mutex_unlock(file, line, func, var, &obj_mutex->mutex.lock);
305 #ifdef AO2_DEBUG
306  if (!res) {
307  ast_atomic_fetchadd_int(&ao2.total_locked, -1);
308  }
309 #endif
310  break;
312  obj_rwlock = INTERNAL_OBJ_RWLOCK(user_data);
313 
314  current_value = ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, -1) - 1;
315  if (current_value < 0) {
316  /* It was a WRLOCK that we are unlocking. Fix the count. */
317  ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, -current_value);
318  }
319  res = __ast_rwlock_unlock(file, line, func, &obj_rwlock->rwlock.lock, var);
320 #ifdef AO2_DEBUG
321  if (!res) {
322  ast_atomic_fetchadd_int(&ao2.total_locked, -1);
323  }
324 #endif
325  break;
327  /* The ao2 object has no lock. */
328  break;
330  obj_lockobj = INTERNAL_OBJ_LOCKOBJ(user_data);
331  res = __ao2_unlock(obj_lockobj->lockobj.lock, file, func, line, var);
332  break;
333  default:
334  ast_log(__LOG_ERROR, file, line, func, "Invalid lock option on ao2 object %p\n",
335  user_data);
336  res = -1;
337  break;
338  }
339  return res;
340 }
uint32_t options
The ao2 object option flags.
Definition: astobj2.c:70
struct ao2_lock_priv mutex
Definition: astobj2.c:121
#define var
Definition: ast_expr2f.c:614
#define __LOG_ERROR
Definition: logger.h:284
#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
convert from a pointer _p to a user-defined object
Definition: astobj2.c:171
#define NULL
Definition: resample.c:96
int __ast_rwlock_unlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
Definition: lock.c:748
int __ao2_unlock(void *user_data, const char *file, const char *func, int line, const char *var)
Unlock an object.
Definition: astobj2.c:288
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
Definition: lock.h:755
ast_rwlock_t lock
Definition: astobj2.c:127
#define INTERNAL_OBJ_LOCKOBJ(user_data)
Definition: astobj2.c:160
struct ao2_rwlock_priv rwlock
Definition: astobj2.c:134
ast_mutex_t lock
Definition: astobj2.c:116
#define ast_log
Definition: astobj2.c:42
int __ast_pthread_mutex_unlock(const char *filename, int lineno, const char *func, const char *mutex_name, ast_mutex_t *t)
Definition: lock.c:421
void * user_data[0]
Definition: astobj2.c:147
#define INTERNAL_OBJ_RWLOCK(user_data)
Definition: astobj2.c:157
#define INTERNAL_OBJ_MUTEX(user_data)
Definition: astobj2.c:154
void * user_data[0]
Definition: astobj2.c:106
struct __priv_data priv_data
Definition: astobj2.c:105
struct ao2_lockobj_priv lockobj
Definition: astobj2.c:145

◆ __ao2_weakproxy_alloc()

void* __ao2_weakproxy_alloc ( size_t  data_size,
ao2_destructor_fn  destructor_fn,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Allocate an ao2_weakproxy object.

Since
14.0.0
Parameters
data_sizeThe sizeof() of the user-defined structure.
destructor_fnThe destructor function (can be NULL)
Note
"struct ao2_weakproxy" must be the first field of any object. This can be done by using AO2_WEAKPROXY to declare your structure.

Definition at line 790 of file astobj2.c.

References __ao2_alloc(), AO2_ALLOC_OPT_LOCK_MUTEX, AO2_WEAK, ast_assert, ast_log, INTERNAL_OBJ, LOG_ERROR, __priv_data::magic, NULL, and astobj2::priv_data.

792 {
793  struct ao2_weakproxy *weakproxy;
794 
795  if (data_size < sizeof(*weakproxy)) {
796  ast_assert(0);
797  ast_log(LOG_ERROR, "Requested data_size smaller than minimum.\n");
798  return NULL;
799  }
800 
801  weakproxy = __ao2_alloc(data_size, destructor_fn, AO2_ALLOC_OPT_LOCK_MUTEX,
802  tag, file, line, func);
803 
804  if (weakproxy) {
805  struct astobj2 *weakproxy_internal;
806 
807  /* Just created weakproxy, no need to check if it's valid. */
808  weakproxy_internal = INTERNAL_OBJ(weakproxy);
809  weakproxy_internal->priv_data.magic = AO2_WEAK;
810  }
811 
812  return weakproxy;
813 }
#define ast_assert(a)
Definition: utils.h:695
#define AO2_WEAK
Definition: astobj2.c:97
#define NULL
Definition: resample.c:96
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
#define INTERNAL_OBJ(user_data)
Definition: astobj2.c:163
void * __ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn, unsigned int options, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:765
This struct should be opaque, but it&#39;s size is needed.
Definition: astobj2.h:530
struct __priv_data priv_data
Definition: astobj2.c:105
uint32_t magic
Definition: astobj2.c:93

◆ __ao2_weakproxy_get_object()

void* __ao2_weakproxy_get_object ( void *  weakproxy,
int  flags,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Get the object associated with weakproxy.

Since
14.0.0
Parameters
weakproxyThe weakproxy to read from.
flagsOBJ_NOLOCK to avoid locking weakproxy.
Returns
A reference to the object previously set by ao2_weakproxy_set_object.
Return values
NULLEither no object was set or the previously set object has been freed.

Definition at line 886 of file astobj2.c.

References __ao2_ref(), __INTERNAL_OBJ_CHECK, ao2_lock, ao2_unlock, AO2_WEAK, NULL, and OBJ_NOLOCK.

Referenced by __ao2_weakproxy_find().

888 {
889  struct astobj2 *internal = __INTERNAL_OBJ_CHECK(weakproxy, file, line, func);
890  void *obj;
891 
892  if (!internal || internal->priv_data.magic != AO2_WEAK) {
893  /* This method is meant to be run on weakproxy objects! */
894  return NULL;
895  }
896 
897  /* We have a weak object, grab reference to object within lock */
898  if (!(flags & OBJ_NOLOCK)) {
899  ao2_lock(weakproxy);
900  }
901 
902  obj = internal->priv_data.weakptr;
903  if (obj) {
904  __ao2_ref(obj, +1, tag, file, line, func);
905  }
906 
907  if (!(flags & OBJ_NOLOCK)) {
908  ao2_unlock(weakproxy);
909  }
910 
911  return obj;
912 }
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ao2_unlock(a)
Definition: astobj2.h:730
#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
convert from a pointer _p to a user-defined object
Definition: astobj2.c:171
#define AO2_WEAK
Definition: astobj2.c:97
#define NULL
Definition: resample.c:96
#define ao2_lock(a)
Definition: astobj2.h:718
int __ao2_ref(void *user_data, int delta, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:498

◆ __ao2_weakproxy_ref_object()

int __ao2_weakproxy_ref_object ( void *  weakproxy,
int  delta,
int  flags,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Run ao2_t_ref on the object associated with weakproxy.

Since
14.0.0
Parameters
weakproxyThe weakproxy to read from.
deltaValue to add to the reference counter.
flagsOBJ_NOLOCK to avoid locking weakproxy.
Return values
-2weakproxy is not a valid ao2_weakproxy.
-1weakproxy has no associated object.
Returns
The value of the reference counter before the operation.

Definition at line 859 of file astobj2.c.

References __ao2_ref(), __INTERNAL_OBJ_CHECK, ao2_lock, ao2_unlock, AO2_WEAK, and OBJ_NOLOCK.

861 {
862  struct astobj2 *internal = __INTERNAL_OBJ_CHECK(weakproxy, file, line, func);
863  int ret = -1;
864 
865  if (!internal || internal->priv_data.magic != AO2_WEAK) {
866  /* This method is meant to be run on weakproxy objects! */
867  return -2;
868  }
869 
870  /* We have a weak object, grab lock. */
871  if (!(flags & OBJ_NOLOCK)) {
872  ao2_lock(weakproxy);
873  }
874 
875  if (internal->priv_data.weakptr) {
876  ret = __ao2_ref(internal->priv_data.weakptr, delta, tag, file, line, func);
877  }
878 
879  if (!(flags & OBJ_NOLOCK)) {
880  ao2_unlock(weakproxy);
881  }
882 
883  return ret;
884 }
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ao2_unlock(a)
Definition: astobj2.h:730
#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
convert from a pointer _p to a user-defined object
Definition: astobj2.c:171
#define AO2_WEAK
Definition: astobj2.c:97
#define ao2_lock(a)
Definition: astobj2.h:718
int __ao2_ref(void *user_data, int delta, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:498

◆ __ao2_weakproxy_set_object()

int __ao2_weakproxy_set_object ( void *  weakproxy,
void *  obj,
int  flags,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Associate weakproxy with obj.

Since
14.0.0
Parameters
weakproxyAn object created by ao2_weakproxy_alloc.
objAn ao2 object not created by ao2_weakproxy_alloc.
flagsOBJ_NOLOCK to avoid locking weakproxy.
Return values
0Success
-1Failure
Note
obj must be newly created, this procedure is not thread safe if any other code can reach obj before this procedure ends.
weakproxy may be previously existing, but must not currently have an object set.
The only way to unset an object is for it to be destroyed. Any call to this function while an object is already set will fail.

Definition at line 815 of file astobj2.c.

References __ao2_ref(), __INTERNAL_OBJ_CHECK, ao2_lock, AO2_MAGIC, ao2_unlock, AO2_WEAK, __priv_data::magic, OBJ_NOLOCK, astobj2::priv_data, and __priv_data::weakptr.

817 {
818  struct astobj2 *weakproxy_internal = __INTERNAL_OBJ_CHECK(weakproxy, file, line, func);
819  struct astobj2 *obj_internal = __INTERNAL_OBJ_CHECK(obj, file, line, func);
820  int ret = -1;
821 
822  if (!weakproxy_internal
823  || weakproxy_internal->priv_data.magic != AO2_WEAK) {
824  return -1;
825  }
826 
827  if (!obj_internal
828  || obj_internal->priv_data.weakptr
829  || obj_internal->priv_data.magic != AO2_MAGIC) {
830  return -1;
831  }
832 
833  if (!(flags & OBJ_NOLOCK)) {
834  ao2_lock(weakproxy);
835  }
836 
837  if (!weakproxy_internal->priv_data.weakptr) {
838  __ao2_ref(obj, +1, tag, file, line, func);
839  __ao2_ref(weakproxy, +1, tag, file, line, func);
840 
841  weakproxy_internal->priv_data.weakptr = obj;
842  obj_internal->priv_data.weakptr = weakproxy;
843 
844  ret = 0;
845  }
846 
847  if (!(flags & OBJ_NOLOCK)) {
848  ao2_unlock(weakproxy);
849  /* It is possible for obj to be accessed now. It's allowed
850  * for weakproxy to already be in a container. Another thread
851  * could have been waiting for a lock on weakproxy to retrieve
852  * the object.
853  */
854  }
855 
856  return ret;
857 }
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ao2_unlock(a)
Definition: astobj2.h:730
#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
convert from a pointer _p to a user-defined object
Definition: astobj2.c:171
#define AO2_WEAK
Definition: astobj2.c:97
#define AO2_MAGIC
Definition: astobj2.c:96
#define ao2_lock(a)
Definition: astobj2.h:718
int __ao2_ref(void *user_data, int delta, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:498
void * weakptr
Definition: astobj2.c:57
struct __priv_data priv_data
Definition: astobj2.c:105
uint32_t magic
Definition: astobj2.c:93

◆ ao2_object_get_lockaddr()

void* ao2_object_get_lockaddr ( void *  obj)

Return the mutex lock address of an object.

Parameters
[in]objA pointer to the object we want.
Returns
the address of the mutex lock, else NULL.

This function comes in handy mainly for debugging locking situations, where the locking trace code reports the lock address, this allows you to correlate against object address, to match objects to reported locks.

Warning
AO2 lock objects do not include tracking fields when DEBUG_THREADS is not enabled.
Since
1.6.1

Definition at line 476 of file astobj2.c.

References AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, INTERNAL_OBJ_CHECK, INTERNAL_OBJ_MUTEX, ao2_lock_priv::lock, astobj2_lock::mutex, NULL, __priv_data::options, and astobj2::priv_data.

Referenced by ast_rtp_ice_turn_request(), ast_serializer_shutdown_group_join(), ast_sip_session_suspend(), bridge_channel_wait(), bridge_manager_thread(), consumer_should_stay(), consumer_wait_for(), consumer_wait_for_completion(), control_wait(), db_sync_thread(), ice_reset_session(), pbx_outgoing_attempt(), rtp_deallocate_transport(), sip_session_suspend_task(), stasis_subscription_join(), and wait_for_stimulus().

477 {
478  struct astobj2 *obj;
479  struct astobj2_lock *obj_mutex;
480 
482 
483  if (obj == NULL) {
484  return NULL;
485  }
486 
487  switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
489  obj_mutex = INTERNAL_OBJ_MUTEX(user_data);
490  return &obj_mutex->mutex.lock;
491  default:
492  break;
493  }
494 
495  return NULL;
496 }
uint32_t options
The ao2 object option flags.
Definition: astobj2.c:70
struct ao2_lock_priv mutex
Definition: astobj2.c:121
void * user_data[0]
Definition: astobj2.c:123
#define NULL
Definition: resample.c:96
ast_mutex_t lock
Definition: astobj2.c:116
#define INTERNAL_OBJ_CHECK(user_data)
Definition: astobj2.c:183
#define INTERNAL_OBJ_MUTEX(user_data)
Definition: astobj2.c:154
struct __priv_data priv_data
Definition: astobj2.c:105

◆ ao2_options_get()

unsigned int ao2_options_get ( void *  obj)

Retrieve the ao2 options used to create the object.

Parameters
objpointer to the (user-defined part) of an object.
Returns
options from enum ao2_alloc_opts.

Definition at line 778 of file astobj2.c.

References INTERNAL_OBJ_CHECK, __priv_data::options, and astobj2::priv_data.

Referenced by __ast_named_lock_get(), hash_ao2_alloc_empty_clone(), and rb_ao2_alloc_empty_clone().

779 {
780  struct astobj2 *orig_obj;
781 
782  orig_obj = INTERNAL_OBJ_CHECK(obj);
783  if (!orig_obj) {
784  return 0;
785  }
786  return orig_obj->priv_data.options;
787 }
uint32_t options
The ao2 object option flags.
Definition: astobj2.c:70
#define INTERNAL_OBJ_CHECK(user_data)
Definition: astobj2.c:183
struct __priv_data priv_data
Definition: astobj2.c:105

◆ ao2_weakproxy_subscribe()

int ao2_weakproxy_subscribe ( void *  weakproxy,
ao2_weakproxy_notification_cb  cb,
void *  data,
int  flags 
)

Request notification when weakproxy points to NULL.

Since
14.0.0
Parameters
weakproxyThe weak object
cbProcedure to call when no real object is associated
dataPassed to cb
flagsOBJ_NOLOCK to avoid locking weakproxy.
Return values
0Success
-1Failure
Note
Callbacks are run in the reverse order of subscriptions.
This procedure will allow the same cb / data pair to be added to the same weakproxy multiple times.
It is the caller's responsibility to ensure that *data is valid until after cb() is run or ao2_weakproxy_unsubscribe is called.
If the weakproxy currently points to NULL the callback will be run immediately, without being added to the subscriber list.

Definition at line 931 of file astobj2.c.

References ao2_lock, ao2_unlock, AO2_WEAK, ast_calloc, AST_LIST_INSERT_HEAD, ao2_weakproxy_notification::cb, ao2_weakproxy_notification::data, ao2_weakproxy::destroyed_cb, INTERNAL_OBJ_CHECK, ao2_weakproxy_notification::list, __priv_data::magic, NULL, OBJ_NOLOCK, astobj2::priv_data, sub, and __priv_data::weakptr.

Referenced by __ast_named_lock_get(), __ast_sorcery_open(), AST_TEST_DEFINE(), link_topic_proxy(), and state_alloc().

932 {
933  struct astobj2 *weakproxy_internal = INTERNAL_OBJ_CHECK(weakproxy);
934  int ret = -1;
935  int hasobj;
936 
937  if (!weakproxy_internal || weakproxy_internal->priv_data.magic != AO2_WEAK) {
938  return -1;
939  }
940 
941  if (!(flags & OBJ_NOLOCK)) {
942  ao2_lock(weakproxy);
943  }
944 
945  hasobj = weakproxy_internal->priv_data.weakptr != NULL;
946  if (hasobj) {
947  struct ao2_weakproxy *weak = weakproxy;
948  struct ao2_weakproxy_notification *sub = ast_calloc(1, sizeof(*sub));
949 
950  if (sub) {
951  sub->cb = cb;
952  sub->data = data;
953  AST_LIST_INSERT_HEAD(&weak->destroyed_cb, sub, list);
954  ret = 0;
955  }
956  }
957 
958  if (!(flags & OBJ_NOLOCK)) {
959  ao2_unlock(weakproxy);
960  }
961 
962  if (!hasobj) {
963  cb(weakproxy, data);
964  ret = 0;
965  }
966 
967  return ret;
968 }
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ao2_unlock(a)
Definition: astobj2.h:730
#define AO2_WEAK
Definition: astobj2.c:97
#define NULL
Definition: resample.c:96
#define INTERNAL_OBJ_CHECK(user_data)
Definition: astobj2.c:183
#define ao2_lock(a)
Definition: astobj2.h:718
struct ao2_weakproxy::@224 destroyed_cb
struct ao2_weakproxy_notification::@339 list
void * weakptr
Definition: astobj2.c:57
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
Definition: linkedlists.h:710
#define ast_calloc(num, len)
A wrapper for calloc()
Definition: astmm.h:204
This struct should be opaque, but it&#39;s size is needed.
Definition: astobj2.h:530
struct __priv_data priv_data
Definition: astobj2.c:105
struct stasis_forward * sub
Definition: res_corosync.c:240
ao2_weakproxy_notification_cb cb
Definition: astobj2.c:110
uint32_t magic
Definition: astobj2.c:93

◆ ao2_weakproxy_unsubscribe()

int ao2_weakproxy_unsubscribe ( void *  weakproxy,
ao2_weakproxy_notification_cb  cb,
void *  data,
int  flags 
)

Remove notification of real object destruction.

Since
14.0.0
Parameters
weakproxyThe weak object
cbCallback to remove from destroy notification list
dataData pointer to match
flagsOBJ_NOLOCK to avoid locking weakproxy. OBJ_MULTIPLE to remove all copies of the same cb / data pair.
Returns
The number of subscriptions removed.
Return values
0cb / data pair not found, nothing removed.
-1Failure due to invalid parameters.
Note
Unless flags includes OBJ_MULTIPLE, this will only remove a single copy of the cb / data pair. If it was subscribed multiple times it must be unsubscribed as many times. The OBJ_MULTIPLE flag can be used to remove matching subscriptions.
When it's time to run callbacks they are copied to a temporary list so the weakproxy can be unlocked before running. That means it's possible for this function to find nothing before the callback is run in another thread.

Definition at line 970 of file astobj2.c.

References a, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_clone, ao2_container_count(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_link, ao2_lock, ao2_t_alloc, ao2_t_callback, ao2_t_container_alloc_list, ao2_t_iterator_next, ao2_t_ref, ao2_t_unlink, ao2_unlock, AO2_WEAK, ast_cli_args::argc, ast_cli_args::argv, ast_add_profile(), ast_cli(), AST_CLI_DEFINE, ast_free, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, ast_mark(), ast_verbose(), ao2_weakproxy_notification::cb, CLI_GENERATE, CLI_HANDLER, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ao2_weakproxy_notification::data, ao2_weakproxy::destroyed_cb, ast_cli_args::fd, INTERNAL_OBJ_CHECK, ao2_weakproxy_notification::list, __priv_data::magic, NULL, OBJ_MULTIPLE, OBJ_NOLOCK, astobj2::priv_data, sub, and ast_cli_entry::usage.

Referenced by AST_TEST_DEFINE().

971 {
972  struct astobj2 *internal_weakproxy = INTERNAL_OBJ_CHECK(weakproxy);
973  struct ao2_weakproxy *weak;
975  int ret = 0;
976 
977  if (!internal_weakproxy || internal_weakproxy->priv_data.magic != AO2_WEAK || !destroyed_cb) {
978  return -1;
979  }
980 
981  if (!(flags & OBJ_NOLOCK)) {
982  ao2_lock(weakproxy);
983  }
984 
985  weak = weakproxy;
987  if (sub->cb == destroyed_cb && sub->data == data) {
989  ast_free(sub);
990  ret++;
991  if (!(flags & OBJ_MULTIPLE)) {
992  break;
993  }
994  }
995  }
997 
998  if (!(flags & OBJ_NOLOCK)) {
999  ao2_unlock(weakproxy);
1000  }
1001 
1002  return ret;
1003 }
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ao2_unlock(a)
Definition: astobj2.h:730
#define AO2_WEAK
Definition: astobj2.c:97
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
Definition: linkedlists.h:614
#define INTERNAL_OBJ_CHECK(user_data)
Definition: astobj2.c:183
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
Definition: linkedlists.h:556
#define ao2_lock(a)
Definition: astobj2.h:718
struct ao2_weakproxy::@224 destroyed_cb
struct ao2_weakproxy_notification::@339 list
#define ast_free(a)
Definition: astmm.h:182
This struct should be opaque, but it&#39;s size is needed.
Definition: astobj2.h:530
struct __priv_data priv_data
Definition: astobj2.c:105
struct stasis_forward * sub
Definition: res_corosync.c:240
ao2_weakproxy_notification_cb cb
Definition: astobj2.c:110
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
Definition: linkedlists.h:528
uint32_t magic
Definition: astobj2.c:93

◆ astobj2_cleanup()

static void astobj2_cleanup ( void  )
static

Definition at line 1154 of file astobj2.c.

References ARRAY_LEN, ast_cli_unregister_multiple(), ast_opt_ref_debug, NULL, and ref_log.

Referenced by astobj2_init().

1155 {
1156 #if defined(AO2_DEBUG)
1157  ast_cli_unregister_multiple(cli_astobj2, ARRAY_LEN(cli_astobj2));
1158 #endif
1159 
1160  if (ast_opt_ref_debug) {
1161  fclose(ref_log);
1162  ref_log = NULL;
1163  }
1164 }
#define ARRAY_LEN(a)
Definition: isdn_lib.c:42
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
Definition: clicompat.c:30
#define NULL
Definition: resample.c:96
static FILE * ref_log
Definition: astobj2.c:44
#define ast_opt_ref_debug
Definition: options.h:135

◆ astobj2_init()

int astobj2_init ( void  )

Provided by astobj2.c

Definition at line 1166 of file astobj2.c.

References ARRAY_LEN, ast_cli_register_multiple, ast_config_AST_LOG_DIR, ast_log, ast_opt_ref_debug, ast_register_cleanup(), astobj2_cleanup(), container_init(), LOG_ERROR, NULL, and ref_log.

Referenced by asterisk_daemon().

1167 {
1168  char ref_filename[1024];
1169 
1170  if (ast_opt_ref_debug) {
1171  snprintf(ref_filename, sizeof(ref_filename), "%s/refs", ast_config_AST_LOG_DIR);
1172  ref_log = fopen(ref_filename, "w");
1173  if (!ref_log) {
1174  ast_log(LOG_ERROR, "Could not open ref debug log file: %s\n", ref_filename);
1175  }
1176  }
1177 
1179 
1180  if (container_init() != 0) {
1181  fclose(ref_log);
1182  ref_log = NULL;
1183  return -1;
1184  }
1185 
1186 #if defined(AO2_DEBUG)
1187  ast_cli_register_multiple(cli_astobj2, ARRAY_LEN(cli_astobj2));
1188 #endif /* defined(AO2_DEBUG) */
1189 
1190  return 0;
1191 }
#define ARRAY_LEN(a)
Definition: isdn_lib.c:42
static void astobj2_cleanup(void)
Definition: astobj2.c:1154
#define ast_cli_register_multiple(e, len)
Register multiple commands.
Definition: cli.h:265
#define NULL
Definition: resample.c:96
#define ast_log
Definition: astobj2.c:42
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
Definition: clicompat.c:19
#define LOG_ERROR
Definition: logger.h:285
const char * ast_config_AST_LOG_DIR
Definition: options.c:159
static FILE * ref_log
Definition: astobj2.c:44
#define ast_opt_ref_debug
Definition: options.h:135
int container_init(void)

◆ internal_ao2_alloc()

static void* internal_ao2_alloc ( size_t  data_size,
ao2_destructor_fn  destructor_fn,
unsigned int  options,
void *  lockobj,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)
static

Definition at line 681 of file astobj2.c.

References __ast_calloc(), __LOG_DEBUG, __LOG_ERROR, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_OBJ, AO2_ALLOC_OPT_LOCK_RWLOCK, AO2_ALLOC_OPT_NO_REF_DEBUG, AO2_MAGIC, ao2_t_bump, ao2_t_ref, ast_atomic_fetchadd_int(), ast_get_tid(), ast_log, ast_mutex_init, ast_rwlock_init, __priv_data::destructor_fn, EXTERNAL_OBJ, ao2_lock_priv::lock, ao2_rwlock_priv::lock, ao2_lockobj_priv::lock, astobj2_lockobj::lockobj, __priv_data::magic, astobj2_lock::mutex, NULL, __priv_data::options, astobj2::priv_data, astobj2_lock::priv_data, astobj2_rwlock::priv_data, astobj2_lockobj::priv_data, __priv_data::ref_counter, ref_log, and astobj2_rwlock::rwlock.

Referenced by __ao2_alloc(), and __ao2_alloc_with_lockobj().

683 {
684  /* allocation */
685  struct astobj2 *obj;
686  struct astobj2_lock *obj_mutex;
687  struct astobj2_rwlock *obj_rwlock;
688  struct astobj2_lockobj *obj_lockobj;
689  size_t overhead;
690 
691  switch (options & AO2_ALLOC_OPT_LOCK_MASK) {
693  overhead = sizeof(*obj_mutex);
694  obj_mutex = __ast_calloc(1, overhead + data_size, file, line, func);
695  if (obj_mutex == NULL) {
696  return NULL;
697  }
698 
699  ast_mutex_init(&obj_mutex->mutex.lock);
700  obj = (struct astobj2 *) &obj_mutex->priv_data;
701  break;
703  overhead = sizeof(*obj_rwlock);
704  obj_rwlock = __ast_calloc(1, overhead + data_size, file, line, func);
705  if (obj_rwlock == NULL) {
706  return NULL;
707  }
708 
709  ast_rwlock_init(&obj_rwlock->rwlock.lock);
710  obj = (struct astobj2 *) &obj_rwlock->priv_data;
711  break;
713  overhead = sizeof(*obj);
714  obj = __ast_calloc(1, overhead + data_size, file, line, func);
715  if (obj == NULL) {
716  return NULL;
717  }
718  break;
720  lockobj = ao2_t_bump(lockobj, "set lockobj");
721  if (!lockobj) {
722  ast_log(__LOG_ERROR, file, line, func, "AO2_ALLOC_OPT_LOCK_OBJ requires a non-NULL lockobj.\n");
723  return NULL;
724  }
725 
726  overhead = sizeof(*obj_lockobj);
727  obj_lockobj = __ast_calloc(1, overhead + data_size, file, line, func);
728  if (obj_lockobj == NULL) {
729  ao2_t_ref(lockobj, -1, "release lockobj for failed alloc");
730  return NULL;
731  }
732 
733  obj_lockobj->lockobj.lock = lockobj;
734  obj = (struct astobj2 *) &obj_lockobj->priv_data;
735  break;
736  default:
737  /* Invalid option value. */
738  ast_log(__LOG_DEBUG, file, line, func, "Invalid lock option requested\n");
739  return NULL;
740  }
741 
742  /* Initialize common ao2 values. */
743  obj->priv_data.destructor_fn = destructor_fn; /* can be NULL */
744  obj->priv_data.ref_counter = 1;
745  obj->priv_data.options = options;
746  obj->priv_data.magic = AO2_MAGIC;
747 
748 #ifdef AO2_DEBUG
749  obj->priv_data.data_size = data_size;
750  ast_atomic_fetchadd_int(&ao2.total_objects, 1);
751  ast_atomic_fetchadd_int(&ao2.total_mem, data_size);
752  ast_atomic_fetchadd_int(&ao2.total_refs, 1);
753 #endif
754 
756  fprintf(ref_log, "%p,+1,%d,%s,%d,%s,**constructor**%zu**%zu**,%s\n",
757  EXTERNAL_OBJ(obj), ast_get_tid(), file, line, func, overhead, data_size, tag ?: "");
758  fflush(ref_log);
759  }
760 
761  /* return a pointer to the user data */
762  return EXTERNAL_OBJ(obj);
763 }
#define ao2_t_ref(o, delta, tag)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:463
void * __ast_calloc(size_t nmemb, size_t size, const char *file, int lineno, const char *func) attribute_malloc
Definition: astmm.c:1635
uint32_t options
The ao2 object option flags.
Definition: astobj2.c:70
#define __LOG_DEBUG
Definition: logger.h:240
struct ao2_lock_priv mutex
Definition: astobj2.c:121
#define __LOG_ERROR
Definition: logger.h:284
#define NULL
Definition: resample.c:96
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
Definition: lock.h:755
ast_rwlock_t lock
Definition: astobj2.c:127
#define AO2_MAGIC
Definition: astobj2.c:96
struct ao2_rwlock_priv rwlock
Definition: astobj2.c:134
ast_mutex_t lock
Definition: astobj2.c:116
#define ast_log
Definition: astobj2.c:42
struct __priv_data priv_data
Definition: astobj2.c:135
int ast_get_tid(void)
Get current thread ID.
Definition: main/utils.c:2504
ao2_destructor_fn destructor_fn
Definition: astobj2.c:55
#define EXTERNAL_OBJ(_p)
convert from a pointer _p to an astobj2 object
Definition: astobj2.c:191
#define ast_rwlock_init(rwlock)
wrapper for rwlock with tracking enabled
Definition: lock.h:222
struct __priv_data priv_data
Definition: astobj2.c:146
#define ao2_t_bump(obj, tag)
Bump refcount on an AO2 object by one, returning the object.
Definition: astobj2.h:483
int32_t ref_counter
Definition: astobj2.c:63
struct __priv_data priv_data
Definition: astobj2.c:105
#define ast_mutex_init(pmutex)
Definition: lock.h:184
static struct test_options options
static FILE * ref_log
Definition: astobj2.c:44
struct __priv_data priv_data
Definition: astobj2.c:122
struct ao2_lockobj_priv lockobj
Definition: astobj2.c:145
uint32_t magic
Definition: astobj2.c:93

◆ internal_is_ao2_object()

int internal_is_ao2_object ( void *  user_data)

Definition at line 193 of file astobj2.c.

References INTERNAL_OBJ, and IS_AO2_MAGIC_BAD.

194 {
195  struct astobj2 *p;
196 
197  if (!user_data) {
198  return 0;
199  }
200 
201  p = INTERNAL_OBJ(user_data);
202 
203  return !p || IS_AO2_MAGIC_BAD(p) ? 0 : 1;
204 }
#define INTERNAL_OBJ(user_data)
Definition: astobj2.c:163
#define IS_AO2_MAGIC_BAD(p)
Definition: astobj2.c:98
void * user_data[0]
Definition: astobj2.c:106

◆ log_bad_ao2()

void log_bad_ao2 ( void *  user_data,
const char *  file,
int  line,
const char *  func 
)

Definition at line 206 of file astobj2.c.

References __ast_assert_failed(), INTERNAL_OBJ, __priv_data::magic, and astobj2::priv_data.

207 {
208  struct astobj2 *p;
209  char bad_magic[100];
210 
211  if (!user_data) {
212  __ast_assert_failed(0, "user_data is NULL", file, line, func);
213  return;
214  }
215 
216  p = INTERNAL_OBJ(user_data);
217  snprintf(bad_magic, sizeof(bad_magic), "bad magic number 0x%x for object %p",
219  __ast_assert_failed(0, bad_magic, file, line, func);
220 }
void DO_CRASH_NORETURN __ast_assert_failed(int condition, const char *condition_str, const char *file, int line, const char *function)
Definition: main/utils.c:2564
#define INTERNAL_OBJ(user_data)
Definition: astobj2.c:163
void * user_data[0]
Definition: astobj2.c:106
struct __priv_data priv_data
Definition: astobj2.c:105
uint32_t magic
Definition: astobj2.c:93

Variable Documentation

◆ ref_log

FILE* ref_log
static