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_rwlock_priv
struct  astobj2
struct  astobj2_lock
struct  astobj2_rwlock

Defines

#define AO2_MAGIC   0xa570b123
#define ast_log   ast_log_safe
#define EXTERNAL_OBJ(_p)   ((_p) == NULL ? NULL : (_p)->user_data)
 convert from a pointer _p to an astobj2 object
#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)))

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)
void * __ao2_alloc_debug (size_t data_size, ao2_destructor_fn destructor_fn, unsigned int options, const char *tag, const char *file, int line, const char *func, int ref_debug)
void __ao2_cleanup (void *obj)
void __ao2_cleanup_debug (void *obj, const char *tag, const char *file, int line, const char *function)
void * __ao2_global_obj_ref (struct ao2_global_obj *holder, const char *tag, const char *file, int line, const char *func, const char *name)
void __ao2_global_obj_release (struct ao2_global_obj *holder, const char *tag, const char *file, int line, const char *func, const char *name)
void * __ao2_global_obj_replace (struct ao2_global_obj *holder, void *obj, const char *tag, const char *file, int line, const char *func, const char *name)
int __ao2_global_obj_replace_unref (struct ao2_global_obj *holder, void *obj, const char *tag, const char *file, int line, const char *func, const char *name)
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.
int __ao2_ref (void *user_data, int delta)
int __ao2_ref_debug (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).
int __ao2_unlock (void *user_data, const char *file, const char *func, int line, const char *var)
 Unlock an object.
void * ao2_object_get_lockaddr (void *user_data)
 Return the mutex lock address of an object.
unsigned int ao2_options_get (void *obj)
 Retrieve the ao2 options used to create the object.
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, const char *file, int line, const char *func)
static int internal_ao2_ref (void *user_data, int delta, const char *file, int line, const char *func)
static struct astobj2INTERNAL_OBJ (void *user_data)
 convert from a pointer _p to a user-defined object
int is_ao2_object (void *user_data)

Variables

static FILE * ref_log


Detailed Description

Functions implementing astobj2 objects.

Author:
Richard Mudgett <rmudgett@digium.com>

Definition in file astobj2.c.


Define Documentation

#define AO2_MAGIC   0xa570b123

Definition at line 64 of file astobj2.c.

Referenced by internal_ao2_alloc(), and INTERNAL_OBJ().

#define ast_log   ast_log_safe

Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 40 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_container_alloc_rbtree_debug(), __ao2_global_obj_ref(), __ao2_global_obj_release(), __ao2_global_obj_replace(), __ao2_lock(), __ao2_trylock(), __ao2_unlock(), __ast_answer(), __ast_bridge_technology_register(), __ast_channel_alloc_ap(), __ast_cli_register(), __ast_cli_unregister(), __ast_codec_register(), __ast_context_create(), __ast_context_destroy(), __ast_custom_function_register(), __ast_data_register(), __ast_data_unregister(), __ast_dsp_call_progress(), __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_apply_wizard_mapping(), __ast_sorcery_open(), __ast_sorcery_wizard_register(), __ast_string_field_init(), __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(), __rtp_recvfrom(), __set_address_from_contact(), __sip_autodestruct(), __sip_pretend_ack(), __sip_reliable_xmit(), __sip_xmit(), __ssl_setup(), __transmit_response(), __unload_module(), _analog_get_index(), _ast_odbc_request_obj2(), _ast_sockaddr_from_sin(), _ast_sockaddr_port(), _ast_sockaddr_set_port(), _ast_sockaddr_to_sin(), _dahdi_get_index(), _dsp_init(), _enum_array_map(), _extension_match_core(), _macro_exec(), _moh_register(), _pgsql_exec(), _sip_show_peers(), _sip_tcp_helper_thread(), _while_exec(), accept_thread(), access_counter_file(), acf_cc_read(), acf_cc_write(), acf_channel_read(), acf_curl_helper(), 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_mailbox_exists(), acf_meetme_info(), 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_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_command(), 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_in_calls(), add_json_object(), add_line(), add_message_id(), add_out_calls(), add_pri(), add_priority(), add_realm_authentication(), add_redirect(), add_rt_multi_cfg_entry(), add_sdp(), add_sip_domain(), add_static_payload(), add_to_agi(), add_user_extension(), 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_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_dial(), app_control_redirect(), app_control_remove_channel_from_bridge(), app_control_silence_start(), app_exec(), app_handle_subscriptions(), app_send_end_msg(), app_subscribe(), app_to_json(), app_unsubscribe(), appcdr_callback(), append_mailbox(), append_row_to_cfg(), 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_channels_handle_originate_with_id(), ari_originate_dial(), assign_and_insert(), ast_add_extension2(), ast_add_extension2_lockopt(), ast_add_hint(), ast_adsi_install_funcs(), ast_agi_register(), ast_agi_send(), ast_alaw_init(), 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_append_ha(), ast_apply_acl(), ast_apply_ha(), ast_ari_applications_get_cb(), ast_ari_applications_list_cb(), ast_ari_applications_subscribe_cb(), ast_ari_applications_unsubscribe_cb(), ast_ari_asterisk_get_global_var_cb(), ast_ari_asterisk_get_info(), ast_ari_asterisk_get_info_cb(), ast_ari_asterisk_set_global_var_cb(), ast_ari_bridges_add_channel_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_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_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_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_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_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_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_replaced(), ast_ari_validate_asterisk_info(), 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_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_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_mailbox(), ast_ari_validate_message(), ast_ari_validate_missing_params(), ast_ari_validate_playback(), 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_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_text_message_variable(), ast_ari_validate_variable(), ast_ari_websocket_session_create(), ast_ari_websocket_session_read(), ast_ari_websocket_session_write(), ast_async_goto(), 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_impart(), ast_bridge_timelimit(), ast_bridge_transfer_attended(), ast_bridge_transfer_blind(), ast_bucket_init(), ast_calendar_register(), ast_call_forward(), ast_callid_threadassoc_add(), ast_callid_threadassoc_change(), ast_callid_threadassoc_remove(), ast_careful_fwrite(), ast_carefulwrite(), ast_cc_get_param(), ast_cc_set_param(), ast_cdr_engine_init(), ast_cdr_getvar(), ast_cdr_register(), ast_cdr_serialize_variables(), ast_cdr_setvar(), ast_cdr_unregister(), ast_cel_engine_init(), 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_get_manager_vars(), ast_channel_hangupcause_hash_set(), ast_channel_internal_alert_read(), ast_channel_internal_alertpipe_init(), 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_perms_init(), 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(), ast_crypt_validate(), ast_data_get(), ast_data_retrieve(), ast_db_del(), ast_db_deltree(), ast_db_gettree(), ast_db_put(), ast_decrypt_bin(), ast_device_state_engine_init(), ast_dns_resolve(), ast_dns_resolve_async(), ast_dns_resolver_register(), ast_do_pickup(), ast_dsp_call_progress(), ast_dsp_process(), ast_dsp_silence_noise_with_energy(), ast_dtmf_stream(), ast_duplicate_acl_list(), 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_handle_cc_control_frame(), ast_hangup(), ast_heap_create(), ast_http_get_auth(), ast_http_get_contents(), ast_http_header_match(), ast_http_header_match_in(), ast_http_response_status_line(), ast_http_send(), ast_iax2_new(), ast_include_new(), ast_indicate_data(), ast_io_remove(), ast_ivr_menu_run_internal(), ast_jb_put(), ast_json_free(), ast_json_vpack(), ast_linear_stream(), ast_local_init(), ast_lock_path_flock(), ast_lock_path_lockfile(), ast_log_backtrace(), ast_logger_register_level(), ast_makesocket(), ast_manager_register_struct(), ast_merge_contexts_and_delete(), 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_named_acl_find(), ast_named_acl_reload(), ast_netsock_bindaddr(), ast_odbc_direct_execute(), ast_odbc_find_table(), ast_odbc_prepare_and_execute(), ast_odbc_sanity_check(), ast_odbc_smart_execute(), ast_openstream_full(), ast_openvstream(), ast_ouraddrfor(), ast_parking_register_bridge_features(), ast_parking_unregister_bridge_features(), ast_parse_digest(), ast_pbx_outgoing_exten(), ast_pbx_run_args(), ast_pbx_start(), ast_phoneprov_add_extension(), ast_phoneprov_provider_register(), ast_phoneprov_provider_unregister(), 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_read_image(), ast_read_textfile(), ast_readaudio_callback(), ast_readconfig(), ast_readfile(), ast_readvideo_callback(), ast_record_review(), ast_redirecting_build_data(), ast_redirecting_parse_data(), ast_register_application2(), ast_register_switch(), ast_remotecontrol(), ast_request(), ast_res_pjsip_initialize_configuration(), ast_rtcp_read(), ast_rtcp_write_report(), ast_rtp_dtmf_begin(), ast_rtp_dtmf_continuation(), ast_rtp_dtmf_end_with_duration(), ast_rtp_engine_register2(), ast_rtp_glue_register2(), ast_rtp_instance_early_bridge(), ast_rtp_instance_early_bridge_make_compatible(), ast_rtp_instance_make_compatible(), ast_rtp_instance_new(), ast_rtp_new(), ast_rtp_raw_write(), ast_rtp_read(), ast_rtp_sendcng(), ast_rtp_write(), ast_safe_fork(), ast_safe_system(), 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_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_start_thread(), ast_sdp_crypto_alloc(), ast_sdp_crypto_build_offer(), ast_sdp_crypto_process(), ast_sdp_srtp_get_attrib(), ast_search_dns(), ast_security_event_report(), 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_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_dialog_uas(), ast_sip_create_request(), ast_sip_create_request_with_auth(), ast_sip_create_subscription(), ast_sip_initialize_cli(), ast_sip_initialize_sorcery_auth(), ast_sip_initialize_sorcery_location(), ast_sip_initialize_sorcery_qualify(), ast_sip_initialize_sorcery_transport(), ast_sip_initialize_system(), ast_sip_location_retrieve_contact_and_aor_from_list(), ast_sip_ouraddrfor(), 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_session_refresh(), ast_sip_session_register_sdp_handler(), 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_policy_alloc(), ast_srtp_protect(), ast_srtp_unprotect(), ast_start_mixmonitor(), 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_close_session_file(), ast_tcptls_server_read(), ast_tcptls_server_root(), ast_tcptls_server_start(), ast_tcptls_server_write(), AST_TEST_DEFINE(), ast_thread_inhibit_escalations(), 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_new_channels(), ast_unreal_setoption(), ast_uri_create_(), ast_uuid_init(), ast_waitfordigit_full(), ast_websocket_read(), ast_websocket_read_string(), ast_websocket_uri_cb(), ast_write(), ast_writefile(), ast_writestream(), ast_yyerror(), asterisk_publication_devicestate_refresh(), asterisk_publication_mwi_refresh(), astobj2_init(), asyncgoto_exec(), attach_barge(), attempt_thread(), attempt_transfer(), attended_transfer_monitor_thread(), attended_transfer_properties_alloc(), au_seek(), au_trunc(), 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(), background_detect_exec(), balance_stack(), base64_helper(), base_encode(), begin_dial_prerun(), blacklist_read(), 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_read_wr_queue_alert(), bridge_channel_settle_owed_events(), bridge_exec(), 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(), build_ami_notify(), build_calendar(), build_callno_limits(), build_cc_interfaces_chanvar(), build_channels(), build_conf(), build_device(), build_dtmf_features(), build_extension(), 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(), caching_topic_exec(), 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(), callerpres_read(), callerpres_write(), calling_target_exit(), canary_thread(), cancel_and_unpublish(), canmatch(), careful_write(), cb_events(), cc_available(), cc_caller_requested(), cc_handle_publish_error(), cccancel_exec(), cdata(), cdr_enable_batch_mode(), cdr_handler(), cdr_prop_write(), cdr_prop_write_callback(), cdr_read(), cdr_read_callback(), cdr_submit_batch(), cdr_toggle_runtime_options(), cdr_write(), cdr_write_callback(), 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_incoming_request(), chan_pjsip_indicate(), chan_pjsip_new(), chan_pjsip_transfer(), chan_pjsip_write(), chanavail_exec(), channel_admin_exec(), channel_chanspy_start_cb(), channel_chanspy_stop_cb(), channel_do_masquerade(), channel_read_pjsip(), channel_read_rtcp(), channel_read_rtp(), channel_replaced_cb(), 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_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_timerange(), check_type(), check_user_full(), check_vars(), check_via(), clean_stmt(), cleanup_module(), clear_dialed_interfaces(), 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(), comeback_goto(), commit_exec(), 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_start_record(), confbridge_exec(), 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_local_rtp(), configure_parking_extensions(), connected_line_method_handler(), connectedline_read(), connectedline_write(), console_autoanswer(), console_cmd(), console_indicate(), console_request(), console_transfer(), console_video_start(), consulting_exit(), contact_deleted(), contact_expiration_observer_created(), contact_status_alloc(), context_merge(), control_add_channel_to_bridge(), control_create(), 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_deliver_cb(), create_addr(), create_artificial_auth(), create_dirpath(), create_dynamic_lot_full(), 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_video_frame(), create_vmaccount(), crement_function_read(), crypto_activate(), crypto_load(), csv_log(), csv_quote(), custom_connection_handler(), custom_log(), custom_prepare(), custom_transport_handler(), cut_internal(), dahdi_answer(), dahdi_call(), dahdi_callwait(), dahdi_confmute(), dahdi_create_channel_range(), dahdi_decoder_framein(), dahdi_decoder_frameout(), dahdi_dial_str(), 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_status_data_provider_get(), dahdi_test_timer(), dahdi_timer_open(), dahdi_timer_set_rate(), dahdi_train_ec(), dahdi_translate(), dahdi_version_data_provider_get(), dahdi_write(), dahdi_write_frame(), dahdiras_exec(), dahdiscan_exec(), data_channels_provider_handler(), data_result_generate(), data_result_generate_node(), data_search_generate(), data_structure_compatible(), db_create_astdb(), db_execute_sql(), db_get_common(), db_open(), deadagi_exec(), dec_init(), default_listener_pvt_alloc(), default_listener_shutdown(), default_task_pushed(), default_tps_processing_function(), defer_action(), DEFINE_SQL_STATEMENT(), del_exec(), del_identifier(), destroy_curl(), destroy_mysql(), destroy_odbc(), destroy_pgsql(), destroy_pval_item(), destroy_trans(), determine_starting_point(), device2chan(), devstate_init(), devstate_write(), dial_exec_full(), dial_handle_playtones(), dialgroup_read(), dialgroup_write(), dialog_info_generate_body_content(), 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(), dll_tests(), dns_naptr_alloc(), dns_parse_answer(), dns_srv_alloc(), dnsmgr_init(), dnsmgr_refresh(), do_autokill(), 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(), double_checking_exit(), dtmf_info_incoming_request(), 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(), ewscal_load_calendar(), exchangecal_get_events_between(), exchangecal_load_calendar(), exchangecal_request(), exchangecal_write_event(), exec(), exec_exec(), execif_exec(), execute_cb(), exists(), expand_gosub_args(), ext_cmp1(), ext_cmp_pattern_pos(), extension_is_compatible(), extension_matches(), extenspy_exec(), extstate_read(), fax_detect_attach(), fax_detect_framehook(), fax_gateway_detect_t38(), 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_icalendar(), ffmpeg_decode(), ffmpeg_encode(), file2format(), file_read(), file_write(), filehelper(), filename_parse(), filestream_close(), filter(), finalize_content(), find_account(), find_app_by_name(), find_body_generator(), find_cache(), find_channel_control(), find_conf(), find_conf_realtime(), find_desc(), find_details(), find_dialog(), find_engine(), find_identifier(), find_line_by_instance(), find_line_by_name(), find_matching_endwhile(), find_option_cb(), find_or_create(), find_or_create_contact_status(), find_or_create_details(), find_pval_goto_item(), find_queue_by_name_rt(), find_recording(), 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_transaction(), find_transcoders(), findmeexec(), finish_bookmark(), flash_exec(), fn_wrapper(), forkcdr_callback(), forkcdr_exec(), forward_message(), frame_trace_helper(), framein(), 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_header_read(), func_inheritance_write(), 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_write(), g729_read(), g729_trunc(), g729_write(), generate_computational_cost(), generate_parked_user(), generic_execute(), generic_fax_exec(), generic_http_callback(), generic_prepare(), generic_read(), get_agi_cmd(), get_alarms(), get_also_info(), get_auth_header(), get_button_template(), get_calleridname(), get_canmatch_exten(), get_comma(), get_defaults(), get_destination(), get_domain(), get_ewscal_ids_for(), get_in_brackets_const(), get_in_brackets_full(), get_input(), get_languages(), get_lock(), get_member_penalty(), get_name_and_number(), 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_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_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_cache_message(), handle_cli_database_show(), handle_cli_database_showkey(), handle_cli_indication_add(), handle_cli_indication_remove(), handle_cli_presencestate_list(), handle_command_response(), handle_common_options(), handle_connection(), handle_dial_message(), handle_enbloc_call_message(), handle_error(), handle_exec(), 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_message(), handle_missing_column(), handle_offhook_message(), handle_open_receive_channel_ack_message(), handle_options(), handle_parked_call_message(), handle_participant_join(), handle_phoneprov(), handle_playtones(), 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_options(), handle_request_publish(), 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_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_data_alloc(), hesitant_exit(), hint_read(), 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_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_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(), iftime(), ilbc_read(), ilbc_trunc(), ilbc_write(), ilbctolin_framein(), import_ch(), in_band_indication(), incoming_request(), increase_call_count(), init_acf_query(), init_app_class(), init_details(), init_jack_data(), init_logger(), init_req(), init_resp(), init_start_time(), init_timing_thread(), initialize_cc_devstate_map(), initialize_cc_max_requests(), initialize_udptl(), inprocess_count(), insert_penaltychange(), inspect_module(), int_handler_fn(), internal_aco_type_find(), internal_ao2_alloc(), internal_ao2_link(), internal_ao2_ref(), internal_feature_read(), internal_feature_write(), internal_featuremap_read(), internal_featuremap_write(), INTERNAL_OBJ(), invent_message(), ip_identify(), ip_identify_match_handler(), is_valid_dtmf(), 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(), jpeg_read_image(), jpeg_write_image(), json_to_ast_variables(), keepalive_global_loaded(), keepalive_transport_thread(), key_favorite(), key_main_page(), 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_reconnect(), leave_voicemail(), linear_alloc(), linear_generator(), linear_release(), link_option_to_types(), lintogsm_framein(), lintolpc10_framein(), lintoulaw(), list_item_handler(), listener(), listfilter(), load_column_config(), load_common(), 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(), load_pktccops_config(), load_realtime_rules(), load_resource(), load_resource_list(), load_tech_calendars(), load_users(), load_values_config(), local_alloc(), local_ast_moh_cleanup(), local_ast_moh_start(), local_call(), local_devicestate(), local_read(), local_write(), localized_config_text_file_save(), log_attended_transfer(), log_cb(), log_exec(), log_jack_status(), log_unidentified_request(), logger_queue_init(), logger_queue_restart(), lookup_iface(), lpc10tolin_framein(), lua_find_extension(), lua_get_state(), macroif_exec(), main(), make_email_file(), make_number(), make_silence(), make_str(), make_trunk(), manager_fax_sessions_entry(), manager_generic_msg_cb(), manager_log(), manager_parking_lot_list(), manager_parking_status_all_lots(), manager_show_dialplan_helper(), manager_sipnotify(), map_video_codec(), 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_index_update(), meetme_menu_admin_extended(), meetmemute(), memcpy_decrypt(), memcpy_encrypt(), message_playback_callback_fn(), message_template_build(), message_template_parse_emailbody(), message_template_parse_filebody(), 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(), modify_mysql(), moh_alloc(), moh_class_destructor(), moh_files_alloc(), moh_files_generator(), moh_files_release(), moh_generate(), moh_parse_options(), moh_release(), moh_scan_files(), 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_subscription(), mwi_new_subscribe(), mwi_send_init(), mwi_send_process_buffer(), mwi_send_process_event(), mwi_sorcery_init(), mwi_subscribe_single(), mwi_thread(), mwi_unsub_event_cb(), mwi_validate_for_aor(), my_all_subchannels_hungup(), my_callwait(), 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_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(), new_find_extension(), new_invite(), new_realtime_sqlite3_db(), new_subscribe(), newpvt(), notify_contact(), notify_daemon(), notify_endpoint(), notify_new_message(), notify_uri(), object_type_loaded_observer(), odbc_load_module(), odbc_log(), odbc_obj_connect(), odbc_obj_disconnect(), odbc_register_class(), odbc_release_obj2(), ogg_vorbis_open(), ogg_vorbis_read(), ogg_vorbis_rewrite(), ogg_vorbis_seek(), ogg_vorbis_trunc(), ogg_vorbis_write(), old_milliwatt_exec(), 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_times(), open_history(), open_mailbox(), open_stream(), option_handler_findslot(), option_handler_parkpos(), options_incoming_request(), options_start(), 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(), 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_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_via(), parsing(), 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(), phoneprov_callback(), pickup_by_exten(), pickup_by_group(), pickup_exec(), pickupchan_exec(), pidf_generate_body_content(), pidf_supplement_body(), pidf_to_string(), pipe_init_nonblock(), pitchshift_helper(), pjsip_acf_channel_read(), pjsip_acf_dial_contacts_read(), pjsip_acf_media_offer_read(), pjsip_acf_media_offer_write(), pjsip_aor_function_read(), pjsip_contact_function_read(), pjsip_endpoint_function_read(), 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(), 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_list(), print_list_backwards(), 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_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(), proxy_from_config(), proxy_update(), pthread_timer_set_rate(), publish_acl_change(), publish_app_cdr_message(), publish_channel_alarm_clear(), publish_chanspy_message(), publish_device_state_to_stasis(), publish_mwi_to_stasis(), publish_request_initial(), publish_span_alarm_clear(), publish_to_corosync(), publish_transfer_fail(), publish_transfer_success(), publish_transfer_threeway(), pubsub_on_rx_publish_request(), pubsub_on_rx_subscribe_request(), purge_old_messages(), pvalCheckType(), pvalGlobalsAddStatement(), pvalTopLevAddObject(), pw_cb(), ql_exec(), qualify_contact(), qualify_contact_cb(), queue_exec(), 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(), radius_log(), rb_ao2_destroy(), rb_ao2_node_destructor(), rcv_mac_addr(), rcvfax_exec(), read_config(), read_config_maps(), read_exec(), read_header(), read_password_from_file(), read_pjsip(), readexten_exec(), readmimefile(), realtime_curl(), realtime_destroy_handler(), realtime_directory(), realtime_exec(), realtime_handler(), realtime_ldap_base_ap(), 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_execute(), realtime_sqlite3_execute_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_channel_tech(), register_exten(), register_peer_exten(), register_realtime_peers_with_callbackextens(), register_service_noref(), register_verify(), registrar_on_rx_request(), registry_rerequest(), 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_from_queue(), remove_header(), remove_talk_detect(), removed_options_handler(), replace(), replace_callno(), reply_digest(), request(), require_curl(), require_mysql(), require_odbc(), require_pgsql(), 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(), rollback_exec(), rotate_file(), rqm_exec(), rt_handle_member_record(), rtp_reload(), run_agi(), run_app_helper(), run_externnotify(), run_ras(), rx_task(), s_streamwait3(), safe_append(), save_conference(), save_to_folder(), say_date(), say_date_with_format(), say_datetime(), say_datetime_from_now(), say_init_mode(), say_number_full(), say_time(), saycountedadj_exec(), saycountednoun_exec(), scan(), scan_dir(), scan_service(), scan_thread(), sched_data_create(), schedule_publish_refresh(), schedule_qualify(), schedule_registration(), schedule_retry(), sco_accept(), sco_bind(), sdp_register(), security_event_to_ami_blob(), select_entry(), send_callerid(), send_client(), send_delay(), send_delayed_request(), send_device_state(), send_dtmf(), send_ews_request_and_parse(), send_expansion_text(), send_in_dialog_request(), 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(), sendpage(), sendtext_exec(), 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_insecure_flags(), set_member_paused(), set_member_value(), set_member_value_help_members(), set_outbound_authentication_credentials(), set_sound(), set_state(), set_t38timeout(), set_ulimit(), set_var(), setcallerid_pres_exec(), setflag(), setformat(), setsubstate(), setup_dahdi_int(), setup_dtls_srtp(), setup_mixmonitor(), setup_mixmonitor_ds(), setup_privacy_args(), setup_rtp_connection(), setup_rtp_remote(), 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_set(), sip_acf_channel_read(), sip_addheader(), sip_call(), sip_cc_monitor_suspend(), sip_check_authtimeout(), sip_cli_notify(), sip_dtmfmode(), sip_dump_history(), sip_endpoint_apply_handler(), sip_fixup(), sip_get_tpselector_from_endpoint(), sip_hangup(), sip_indicate(), sip_msg_send(), sip_new(), sip_outbound_publish_apply(), sip_outbound_publish_callback(), sip_outbound_publish_client_alloc(), sip_outbound_publish_synchronize(), 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_poke_noanswer(), sip_poke_peer(), sip_queryoption(), sip_read(), sip_reg_timeout(), sip_register(), sip_reload(), sip_request_call(), sip_reregister(), sip_route_process_header(), sip_scheddestroy(), sip_send_keepalive(), 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(), siren14read(), siren14seek(), siren14trunc(), siren14write(), 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_write(), softmix_mixing_array_grow(), softmix_mixing_array_init(), softmix_mixing_loop(), sorcery_config_internal_load(), sorcery_config_open(), sorcery_function_read(), sorcery_object_load(), sorcery_realtime_filter_objectset(), sorcery_wizard_create(), 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(), sqlite_log(), srv_datastore_setup(), srv_query_read(), srv_result_read(), ssl_verify(), stackpeek_read(), start_moh_exec(), start_monitor_exec(), start_network_thread(), start_poll_thread(), start_rtp(), start_session_timer(), start_spying(), start_stream(), startelm(), starttimer(), stasis_app_control_answer(), stasis_app_control_record(), stasis_app_device_state_delete(), stasis_app_device_state_update(), stasis_app_exec(), 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_unsubscribe(), 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_unsubscribe(), static_realtime_cb(), stimulate_attended_transfer(), 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(), strreplace(), stun_monitor_request(), stun_start_monitor(), stun_stop_monitor(), 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(), substitute_escapes(), swap_subs(), sysinfo_helper(), syslog_log(), system_apply(), system_create_resolver_and_set_nameservers(), system_exec_helper(), t38_attach_framehook(), t38_change_state(), t38_reinvite_response_cb(), t38_tx_packet_handler(), talk_detect_fn_write(), taskprocessor_push(), tcptls_stream_close(), tdd_feed(), tdd_new(), tds_error_handler(), tds_load_module(), tds_log(), tds_message_handler(), test_config_validity(), test_jb_error_output(), test_jb_warn_output(), test_law_cmp(), test_state_changed(), 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(), timeout_read(), timeout_write(), timerfd_timer_ack(), timerfd_timer_open(), timezone_add(), timing_read(), to_number(), to_string(), tonepair_alloc(), tonepair_generator(), tos_handler(), tps_task_alloc(), tps_task_alloc_local(), tps_taskprocessor_destroy(), 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_cipher_add(), transport_create(), transport_tls_cipher_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_senddigit_end(), unistim_sendtext(), unistim_set_rtp_peer(), unistim_ss(), unistim_write(), unistimsock_read(), unload_module(), unlock_read(), unregister_exten(), unshift_push(), unsignal_pipe(), unsupported_handler(), update2_curl(), update2_ldap(), update2_mysql(), update2_odbc(), update2_pgsql(), update2_prepare(), update_call_counter(), update_config(), update_contact_status(), update_curl(), update_header(), update_key(), update_ldap(), update_modem_bits(), update_mysql(), update_odbc(), update_pgsql(), update_registry(), update_scoreboard(), update_stats(), upqm_exec(), uri_parse_and_default(), used_blocks(), userevent_exec(), users_apply_handler(), users_data_provider_get(), ustmtext(), validate_user_cb(), variable_list_append(), vars_to_headers(), verbose_exec(), verify_default_parking_lot(), verify_default_profiles(), verify_user_event_fields(), vm_authenticate(), vm_box_exists(), 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(), vm_options(), vmsayname_exec(), volume_write(), vox_read(), vox_seek(), vox_trunc(), vox_write(), wait_file(), wait_file2(), wait_for_answer(), 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(), write_cdr(), write_cel(), write_header(), write_history(), write_password_to_file(), write_stream(), writefile(), ws_safe_read(), 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(), xmpp_status_exec(), xpidf_to_string(), yyerror(), yyparse(), and zombify_threads().

#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 145 of file astobj2.c.

Referenced by internal_ao2_alloc().

#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)))

Definition at line 106 of file astobj2.c.

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


Function Documentation

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

Definition at line 336 of file astobj2.c.

References AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, 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_RWLOCK, LOG_ERROR, ao2_rwlock_priv::num_lockers, __priv_data::options, astobj2::priv_data, and astobj2_rwlock::rwlock.

Referenced by ao2_iterator_restart(), hash_ao2_node_destructor(), internal_ao2_iterator_next(), internal_ao2_link(), internal_ao2_traverse(), and rb_ao2_node_destructor().

00337 {
00338    struct astobj2 *obj = INTERNAL_OBJ(user_data);
00339    struct astobj2_rwlock *obj_rwlock;
00340    enum ao2_lock_req orig_lock;
00341 
00342    switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
00343    case AO2_ALLOC_OPT_LOCK_RWLOCK:
00344       obj_rwlock = INTERNAL_OBJ_RWLOCK(user_data);
00345       if (obj_rwlock->rwlock.num_lockers < 0) {
00346          orig_lock = AO2_LOCK_REQ_WRLOCK;
00347       } else {
00348          orig_lock = AO2_LOCK_REQ_RDLOCK;
00349       }
00350       switch (lock_how) {
00351       case AO2_LOCK_REQ_MUTEX:
00352          lock_how = AO2_LOCK_REQ_WRLOCK;
00353          /* Fall through */
00354       case AO2_LOCK_REQ_WRLOCK:
00355          if (lock_how != orig_lock) {
00356             /* Switch from read lock to write lock. */
00357             ao2_unlock(user_data);
00358             ao2_wrlock(user_data);
00359          }
00360          break;
00361       case AO2_LOCK_REQ_RDLOCK:
00362          if (!keep_stronger && lock_how != orig_lock) {
00363             /* Switch from write lock to read lock. */
00364             ao2_unlock(user_data);
00365             ao2_rdlock(user_data);
00366          }
00367          break;
00368       }
00369       break;
00370    default:
00371       ast_log(LOG_ERROR, "Invalid lock option on ao2 object %p\n", user_data);
00372       /* Fall through */
00373    case AO2_ALLOC_OPT_LOCK_NOLOCK:
00374    case AO2_ALLOC_OPT_LOCK_MUTEX:
00375       orig_lock = AO2_LOCK_REQ_MUTEX;
00376       break;
00377    }
00378 
00379    return orig_lock;
00380 }

void* __ao2_alloc ( size_t  data_size,
ao2_destructor_fn  destructor_fn,
unsigned int  options 
)

Definition at line 628 of file astobj2.c.

References internal_ao2_alloc().

Referenced by hash_ao2_new_node(), and rb_ao2_new_node().

00629 {
00630    return internal_ao2_alloc(data_size, destructor_fn, options, __FILE__, __LINE__, __FUNCTION__);
00631 }

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

Definition at line 609 of file astobj2.c.

References ast_get_tid(), internal_ao2_alloc(), and NULL.

Referenced by __ao2_container_alloc_hash_debug(), __ao2_container_alloc_rbtree_debug(), __ast_channel_internal_alloc(), __ast_format_cap_alloc_debug(), __sip_alloc(), and _moh_class_malloc().

00611 {
00612    /* allocation */
00613    void *obj;
00614 
00615    if ((obj = internal_ao2_alloc(data_size, destructor_fn, options, file, line, func)) == NULL) {
00616       return NULL;
00617    }
00618 
00619    if (ref_log) {
00620       fprintf(ref_log, "%p,+1,%d,%s,%d,%s,**constructor**,%s\n", obj, ast_get_tid(), file, line, func, tag);
00621       fflush(ref_log);
00622    }
00623 
00624    /* return a pointer to the user data */
00625    return obj;
00626 }

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 526 of file astobj2.c.

References ao2_ref.

Referenced by agent_request_exec(), bridge_after_cb(), bridge_agent_hold_push(), bridge_builtin_set_limits(), bridge_stasis_queue_join_action(), and parking_set_duration().

00527 {
00528    if (obj) {
00529       ao2_ref(obj, -1);
00530    }
00531 }

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

Definition at line 519 of file astobj2.c.

References __ao2_ref_debug().

00520 {
00521    if (obj) {
00522       __ao2_ref_debug(obj, -1, tag, file, line, function);
00523    }
00524 }

void* __ao2_global_obj_ref ( struct ao2_global_obj holder,
const char *  tag,
const char *  file,
int  line,
const char *  func,
const char *  name 
)

Definition at line 708 of file astobj2.c.

References __ao2_ref(), __ao2_ref_debug(), __ast_rwlock_rdlock(), __ast_rwlock_unlock(), ast_assert, ast_log, ao2_global_obj::lock, LOG_ERROR, NULL, and ao2_global_obj::obj.

00709 {
00710    void *obj;
00711 
00712    if (!holder) {
00713       /* For sanity */
00714       ast_log(LOG_ERROR, "Must be called with a global object!\n");
00715       ast_assert(0);
00716       return NULL;
00717    }
00718 
00719    if (__ast_rwlock_rdlock(file, line, func, &holder->lock, name)) {
00720       /* Could not get the read lock. */
00721       ast_assert(0);
00722       return NULL;
00723    }
00724 
00725    obj = holder->obj;
00726    if (obj) {
00727       if (tag) {
00728          __ao2_ref_debug(obj, +1, tag, file, line, func);
00729       } else {
00730          __ao2_ref(obj, +1);
00731       }
00732    }
00733 
00734    __ast_rwlock_unlock(file, line, func, &holder->lock, name);
00735 
00736    return obj;
00737 }

void __ao2_global_obj_release ( struct ao2_global_obj holder,
const char *  tag,
const char *  file,
int  line,
const char *  func,
const char *  name 
)

Definition at line 634 of file astobj2.c.

References __ao2_ref(), __ao2_ref_debug(), __ast_rwlock_unlock(), __ast_rwlock_wrlock(), ast_assert, ast_log, ao2_global_obj::lock, LOG_ERROR, NULL, and ao2_global_obj::obj.

00635 {
00636    if (!holder) {
00637       /* For sanity */
00638       ast_log(LOG_ERROR, "Must be called with a global object!\n");
00639       ast_assert(0);
00640       return;
00641    }
00642    if (__ast_rwlock_wrlock(file, line, func, &holder->lock, name)) {
00643       /* Could not get the write lock. */
00644       ast_assert(0);
00645       return;
00646    }
00647 
00648    /* Release the held ao2 object. */
00649    if (holder->obj) {
00650       if (tag) {
00651          __ao2_ref_debug(holder->obj, -1, tag, file, line, func);
00652       } else {
00653          __ao2_ref(holder->obj, -1);
00654       }
00655       holder->obj = NULL;
00656    }
00657 
00658    __ast_rwlock_unlock(file, line, func, &holder->lock, name);
00659 }

void* __ao2_global_obj_replace ( struct ao2_global_obj holder,
void *  obj,
const char *  tag,
const char *  file,
int  line,
const char *  func,
const char *  name 
)

Definition at line 661 of file astobj2.c.

References __ao2_ref(), __ao2_ref_debug(), __ast_rwlock_unlock(), __ast_rwlock_wrlock(), ast_assert, ast_log, ao2_global_obj::lock, LOG_ERROR, NULL, and ao2_global_obj::obj.

Referenced by __ao2_global_obj_replace_unref().

00662 {
00663    void *obj_old;
00664 
00665    if (!holder) {
00666       /* For sanity */
00667       ast_log(LOG_ERROR, "Must be called with a global object!\n");
00668       ast_assert(0);
00669       return NULL;
00670    }
00671    if (__ast_rwlock_wrlock(file, line, func, &holder->lock, name)) {
00672       /* Could not get the write lock. */
00673       ast_assert(0);
00674       return NULL;
00675    }
00676 
00677    if (obj) {
00678       if (tag) {
00679          __ao2_ref_debug(obj, +1, tag, file, line, func);
00680       } else {
00681          __ao2_ref(obj, +1);
00682       }
00683    }
00684    obj_old = holder->obj;
00685    holder->obj = obj;
00686 
00687    __ast_rwlock_unlock(file, line, func, &holder->lock, name);
00688 
00689    return obj_old;
00690 }

int __ao2_global_obj_replace_unref ( struct ao2_global_obj holder,
void *  obj,
const char *  tag,
const char *  file,
int  line,
const char *  func,
const char *  name 
)

Definition at line 692 of file astobj2.c.

References __ao2_global_obj_replace(), __ao2_ref(), and __ao2_ref_debug().

00693 {
00694    void *obj_old;
00695 
00696    obj_old = __ao2_global_obj_replace(holder, obj, tag, file, line, func, name);
00697    if (obj_old) {
00698       if (tag) {
00699          __ao2_ref_debug(obj_old, -1, tag, file, line, func);
00700       } else {
00701          __ao2_ref(obj_old, -1);
00702       }
00703       return 1;
00704    }
00705    return 0;
00706 }

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:
a A 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 152 of file astobj2.c.

References __ast_pthread_mutex_lock(), __ast_rwlock_rdlock(), __ast_rwlock_wrlock(), __LOG_ERROR, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_RWLOCK, AO2_LOCK_REQ_MUTEX, AO2_LOCK_REQ_RDLOCK, AO2_LOCK_REQ_WRLOCK, ast_assert, ast_atomic_fetchadd_int(), ast_log, INTERNAL_OBJ(), INTERNAL_OBJ_MUTEX, INTERNAL_OBJ_RWLOCK, ao2_rwlock_priv::lock, ao2_lock_priv::lock, astobj2_lock::mutex, NULL, ao2_rwlock_priv::num_lockers, __priv_data::options, astobj2::priv_data, and astobj2_rwlock::rwlock.

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

00153 {
00154    struct astobj2 *obj = INTERNAL_OBJ(user_data);
00155    struct astobj2_lock *obj_mutex;
00156    struct astobj2_rwlock *obj_rwlock;
00157    int res = 0;
00158 
00159    if (obj == NULL) {
00160       ast_assert(0);
00161       return -1;
00162    }
00163 
00164    switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
00165    case AO2_ALLOC_OPT_LOCK_MUTEX:
00166       obj_mutex = INTERNAL_OBJ_MUTEX(user_data);
00167       res = __ast_pthread_mutex_lock(file, line, func, var, &obj_mutex->mutex.lock);
00168 #ifdef AO2_DEBUG
00169       if (!res) {
00170          ast_atomic_fetchadd_int(&ao2.total_locked, 1);
00171       }
00172 #endif
00173       break;
00174    case AO2_ALLOC_OPT_LOCK_RWLOCK:
00175       obj_rwlock = INTERNAL_OBJ_RWLOCK(user_data);
00176       switch (lock_how) {
00177       case AO2_LOCK_REQ_MUTEX:
00178       case AO2_LOCK_REQ_WRLOCK:
00179          res = __ast_rwlock_wrlock(file, line, func, &obj_rwlock->rwlock.lock, var);
00180          if (!res) {
00181             ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, -1);
00182 #ifdef AO2_DEBUG
00183             ast_atomic_fetchadd_int(&ao2.total_locked, 1);
00184 #endif
00185          }
00186          break;
00187       case AO2_LOCK_REQ_RDLOCK:
00188          res = __ast_rwlock_rdlock(file, line, func, &obj_rwlock->rwlock.lock, var);
00189          if (!res) {
00190             ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, +1);
00191 #ifdef AO2_DEBUG
00192             ast_atomic_fetchadd_int(&ao2.total_locked, 1);
00193 #endif
00194          }
00195          break;
00196       }
00197       break;
00198    case AO2_ALLOC_OPT_LOCK_NOLOCK:
00199       /* The ao2 object has no lock. */
00200       break;
00201    default:
00202       ast_log(__LOG_ERROR, file, line, func, "Invalid lock option on ao2 object %p\n",
00203          user_data);
00204       return -1;
00205    }
00206 
00207    return res;
00208 }

int __ao2_ref ( void *  user_data,
int  delta 
)

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

Definition at line 481 of file astobj2.c.

References ast_assert, ast_get_tid(), internal_ao2_ref(), INTERNAL_OBJ(), and NULL.

Referenced by __ao2_cleanup_debug(), __ao2_container_clone_debug(), __ao2_global_obj_ref(), __ao2_global_obj_release(), __ao2_global_obj_replace(), __ao2_global_obj_replace_unref(), __ast_format_cap_append_debug(), __ast_module_ref(), __ast_module_unref(), __container_unlink_node_debug(), __find_call(), hash_ao2_new_node(), internal_ao2_iterator_next(), internal_ao2_traverse(), and rb_ao2_new_node().

00482 {
00483    struct astobj2 *obj = INTERNAL_OBJ(user_data);
00484    int old_refcount = -1;
00485 
00486    if (obj) {
00487       old_refcount = internal_ao2_ref(user_data, delta, file, line, func);
00488    }
00489 
00490    if (ref_log && user_data) {
00491       if (!obj) {
00492          /* Invalid object: Bad magic number. */
00493          fprintf(ref_log, "%p,%d,%d,%s,%d,%s,**invalid**,%s\n",
00494             user_data, delta, ast_get_tid(), file, line, func, tag);
00495          fflush(ref_log);
00496       } else if (old_refcount + delta == 0) {
00497          fprintf(ref_log, "%p,%d,%d,%s,%d,%s,**destructor**,%s\n",
00498             user_data, delta, ast_get_tid(), file, line, func, tag);
00499          fflush(ref_log);
00500       } else if (delta != 0) {
00501          fprintf(ref_log, "%p,%s%d,%d,%s,%d,%s,%d,%s\n", user_data, (delta < 0 ? "" : "+"),
00502             delta, ast_get_tid(), file, line, func, old_refcount, tag);
00503          fflush(ref_log);
00504       }
00505    }
00506 
00507    if (obj == NULL) {
00508       ast_assert(0);
00509    }
00510 
00511    return old_refcount;
00512 }

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:
a A 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 260 of file astobj2.c.

References __ast_pthread_mutex_trylock(), __ast_rwlock_tryrdlock(), __ast_rwlock_trywrlock(), __LOG_ERROR, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_RWLOCK, AO2_LOCK_REQ_MUTEX, AO2_LOCK_REQ_RDLOCK, AO2_LOCK_REQ_WRLOCK, ast_assert, ast_atomic_fetchadd_int(), ast_log, INTERNAL_OBJ(), INTERNAL_OBJ_MUTEX, INTERNAL_OBJ_RWLOCK, ao2_rwlock_priv::lock, ao2_lock_priv::lock, astobj2_lock::mutex, NULL, ao2_rwlock_priv::num_lockers, __priv_data::options, astobj2::priv_data, and astobj2_rwlock::rwlock.

Referenced by _ast_bridge_channel_trylock(), and _ast_bridge_trylock().

00261 {
00262    struct astobj2 *obj = INTERNAL_OBJ(user_data);
00263    struct astobj2_lock *obj_mutex;
00264    struct astobj2_rwlock *obj_rwlock;
00265    int res = 0;
00266 
00267    if (obj == NULL) {
00268       ast_assert(0);
00269       return -1;
00270    }
00271 
00272    switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
00273    case AO2_ALLOC_OPT_LOCK_MUTEX:
00274       obj_mutex = INTERNAL_OBJ_MUTEX(user_data);
00275       res = __ast_pthread_mutex_trylock(file, line, func, var, &obj_mutex->mutex.lock);
00276 #ifdef AO2_DEBUG
00277       if (!res) {
00278          ast_atomic_fetchadd_int(&ao2.total_locked, 1);
00279       }
00280 #endif
00281       break;
00282    case AO2_ALLOC_OPT_LOCK_RWLOCK:
00283       obj_rwlock = INTERNAL_OBJ_RWLOCK(user_data);
00284       switch (lock_how) {
00285       case AO2_LOCK_REQ_MUTEX:
00286       case AO2_LOCK_REQ_WRLOCK:
00287          res = __ast_rwlock_trywrlock(file, line, func, &obj_rwlock->rwlock.lock, var);
00288          if (!res) {
00289             ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, -1);
00290 #ifdef AO2_DEBUG
00291             ast_atomic_fetchadd_int(&ao2.total_locked, 1);
00292 #endif
00293          }
00294          break;
00295       case AO2_LOCK_REQ_RDLOCK:
00296          res = __ast_rwlock_tryrdlock(file, line, func, &obj_rwlock->rwlock.lock, var);
00297          if (!res) {
00298             ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, +1);
00299 #ifdef AO2_DEBUG
00300             ast_atomic_fetchadd_int(&ao2.total_locked, 1);
00301 #endif
00302          }
00303          break;
00304       }
00305       break;
00306    case AO2_ALLOC_OPT_LOCK_NOLOCK:
00307       /* The ao2 object has no lock. */
00308       return 0;
00309    default:
00310       ast_log(__LOG_ERROR, file, line, func, "Invalid lock option on ao2 object %p\n",
00311          user_data);
00312       return -1;
00313    }
00314 
00315 
00316    return res;
00317 }

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

Unlock an object.

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

Definition at line 210 of file astobj2.c.

References __ast_pthread_mutex_unlock(), __ast_rwlock_unlock(), __LOG_ERROR, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_RWLOCK, ast_assert, ast_atomic_fetchadd_int(), ast_log, INTERNAL_OBJ(), INTERNAL_OBJ_MUTEX, INTERNAL_OBJ_RWLOCK, ao2_rwlock_priv::lock, ao2_lock_priv::lock, 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().

00211 {
00212    struct astobj2 *obj = INTERNAL_OBJ(user_data);
00213    struct astobj2_lock *obj_mutex;
00214    struct astobj2_rwlock *obj_rwlock;
00215    int res = 0;
00216    int current_value;
00217 
00218    if (obj == NULL) {
00219       ast_assert(0);
00220       return -1;
00221    }
00222 
00223    switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
00224    case AO2_ALLOC_OPT_LOCK_MUTEX:
00225       obj_mutex = INTERNAL_OBJ_MUTEX(user_data);
00226       res = __ast_pthread_mutex_unlock(file, line, func, var, &obj_mutex->mutex.lock);
00227 #ifdef AO2_DEBUG
00228       if (!res) {
00229          ast_atomic_fetchadd_int(&ao2.total_locked, -1);
00230       }
00231 #endif
00232       break;
00233    case AO2_ALLOC_OPT_LOCK_RWLOCK:
00234       obj_rwlock = INTERNAL_OBJ_RWLOCK(user_data);
00235 
00236       current_value = ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, -1) - 1;
00237       if (current_value < 0) {
00238          /* It was a WRLOCK that we are unlocking.  Fix the count. */
00239          ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, -current_value);
00240       }
00241       res = __ast_rwlock_unlock(file, line, func, &obj_rwlock->rwlock.lock, var);
00242 #ifdef AO2_DEBUG
00243       if (!res) {
00244          ast_atomic_fetchadd_int(&ao2.total_locked, -1);
00245       }
00246 #endif
00247       break;
00248    case AO2_ALLOC_OPT_LOCK_NOLOCK:
00249       /* The ao2 object has no lock. */
00250       break;
00251    default:
00252       ast_log(__LOG_ERROR, file, line, func, "Invalid lock option on ao2 object %p\n",
00253          user_data);
00254       res = -1;
00255       break;
00256    }
00257    return res;
00258 }

void* ao2_object_get_lockaddr ( void *  obj  ) 

Return the mutex lock address of an object.

Parameters:
[in] obj A 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.

Since:
1.6.1

Definition at line 382 of file astobj2.c.

References AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, ast_assert, INTERNAL_OBJ(), INTERNAL_OBJ_MUTEX, ao2_lock_priv::lock, astobj2_lock::mutex, NULL, __priv_data::options, and astobj2::priv_data.

Referenced by 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(), pbx_outgoing_attempt(), sip_session_suspend_task(), stasis_subscription_join(), and wait_for_stimulus().

00383 {
00384    struct astobj2 *obj = INTERNAL_OBJ(user_data);
00385    struct astobj2_lock *obj_mutex;
00386 
00387    if (obj == NULL) {
00388       ast_assert(0);
00389       return NULL;
00390    }
00391 
00392    switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
00393    case AO2_ALLOC_OPT_LOCK_MUTEX:
00394       obj_mutex = INTERNAL_OBJ_MUTEX(user_data);
00395       return &obj_mutex->mutex.lock;
00396    default:
00397       break;
00398    }
00399 
00400    return NULL;
00401 }

unsigned int ao2_options_get ( void *  obj  ) 

Retrieve the ao2 options used to create the object.

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

Definition at line 600 of file astobj2.c.

References INTERNAL_OBJ(), __priv_data::options, and astobj2::priv_data.

Referenced by hash_ao2_alloc_empty_clone(), hash_ao2_alloc_empty_clone_debug(), rb_ao2_alloc_empty_clone(), and rb_ao2_alloc_empty_clone_debug().

00601 {
00602    struct astobj2 *orig_obj = INTERNAL_OBJ(obj);
00603    if (!orig_obj) {
00604       return 0;
00605    }
00606    return orig_obj->priv_data.options;
00607 }

static void astobj2_cleanup ( void   )  [static]

Definition at line 887 of file astobj2.c.

References ARRAY_LEN, ast_cli_unregister_multiple(), and NULL.

Referenced by astobj2_init().

00888 {
00889 #if defined(AO2_DEBUG)
00890    ast_cli_unregister_multiple(cli_astobj2, ARRAY_LEN(cli_astobj2));
00891 #endif
00892 #ifdef REF_DEBUG
00893    fclose(ref_log);
00894    ref_log = NULL;
00895 #endif
00896 }

int astobj2_init ( void   ) 

Provided by astobj2.c

Definition at line 898 of file astobj2.c.

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

Referenced by main().

00899 {
00900 #ifdef REF_DEBUG
00901    char ref_filename[1024];
00902 #endif
00903 
00904    if (container_init() != 0) {
00905       return -1;
00906    }
00907 
00908 #ifdef REF_DEBUG
00909    snprintf(ref_filename, sizeof(ref_filename), "%s/refs", ast_config_AST_LOG_DIR);
00910    ref_log = fopen(ref_filename, "w");
00911    if (!ref_log) {
00912       ast_log(LOG_ERROR, "Could not open ref debug log file: %s\n", ref_filename);
00913    }
00914 #endif
00915 
00916 #if defined(AO2_DEBUG)
00917    ast_cli_register_multiple(cli_astobj2, ARRAY_LEN(cli_astobj2));
00918 #endif   /* defined(AO2_DEBUG) */
00919 
00920    ast_register_cleanup(astobj2_cleanup);
00921 
00922    return 0;
00923 }

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

Definition at line 533 of file astobj2.c.

References __ast_calloc(), __AST_DEBUG_MALLOC, __LOG_DEBUG, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_RWLOCK, AO2_MAGIC, ast_atomic_fetchadd_int(), ast_calloc, ast_log, ast_mutex_init, ast_rwlock_init, __priv_data::data_size, __priv_data::destructor_fn, EXTERNAL_OBJ, ao2_rwlock_priv::lock, ao2_lock_priv::lock, __priv_data::magic, astobj2_lock::mutex, NULL, __priv_data::options, astobj2::priv_data, astobj2_rwlock::priv_data, astobj2_lock::priv_data, __priv_data::ref_counter, and astobj2_rwlock::rwlock.

Referenced by __ao2_alloc(), and __ao2_alloc_debug().

00534 {
00535    /* allocation */
00536    struct astobj2 *obj;
00537    struct astobj2_lock *obj_mutex;
00538    struct astobj2_rwlock *obj_rwlock;
00539 
00540    switch (options & AO2_ALLOC_OPT_LOCK_MASK) {
00541    case AO2_ALLOC_OPT_LOCK_MUTEX:
00542 #if defined(__AST_DEBUG_MALLOC)
00543       obj_mutex = __ast_calloc(1, sizeof(*obj_mutex) + data_size, file, line, func);
00544 #else
00545       obj_mutex = ast_calloc(1, sizeof(*obj_mutex) + data_size);
00546 #endif
00547       if (obj_mutex == NULL) {
00548          return NULL;
00549       }
00550 
00551       ast_mutex_init(&obj_mutex->mutex.lock);
00552       obj = (struct astobj2 *) &obj_mutex->priv_data;
00553       break;
00554    case AO2_ALLOC_OPT_LOCK_RWLOCK:
00555 #if defined(__AST_DEBUG_MALLOC)
00556       obj_rwlock = __ast_calloc(1, sizeof(*obj_rwlock) + data_size, file, line, func);
00557 #else
00558       obj_rwlock = ast_calloc(1, sizeof(*obj_rwlock) + data_size);
00559 #endif
00560       if (obj_rwlock == NULL) {
00561          return NULL;
00562       }
00563 
00564       ast_rwlock_init(&obj_rwlock->rwlock.lock);
00565       obj = (struct astobj2 *) &obj_rwlock->priv_data;
00566       break;
00567    case AO2_ALLOC_OPT_LOCK_NOLOCK:
00568 #if defined(__AST_DEBUG_MALLOC)
00569       obj = __ast_calloc(1, sizeof(*obj) + data_size, file, line, func);
00570 #else
00571       obj = ast_calloc(1, sizeof(*obj) + data_size);
00572 #endif
00573       if (obj == NULL) {
00574          return NULL;
00575       }
00576       break;
00577    default:
00578       /* Invalid option value. */
00579       ast_log(__LOG_DEBUG, file, line, func, "Invalid lock option requested\n");
00580       return NULL;
00581    }
00582 
00583    /* Initialize common ao2 values. */
00584    obj->priv_data.ref_counter = 1;
00585    obj->priv_data.destructor_fn = destructor_fn;   /* can be NULL */
00586    obj->priv_data.data_size = data_size;
00587    obj->priv_data.options = options;
00588    obj->priv_data.magic = AO2_MAGIC;
00589 
00590 #ifdef AO2_DEBUG
00591    ast_atomic_fetchadd_int(&ao2.total_objects, 1);
00592    ast_atomic_fetchadd_int(&ao2.total_mem, data_size);
00593    ast_atomic_fetchadd_int(&ao2.total_refs, 1);
00594 #endif
00595 
00596    /* return a pointer to the user data */
00597    return EXTERNAL_OBJ(obj);
00598 }

static int internal_ao2_ref ( void *  user_data,
int  delta,
const char *  file,
int  line,
const char *  func 
) [static]

Definition at line 403 of file astobj2.c.

References __LOG_ERROR, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_RWLOCK, ast_assert, ast_atomic_fetchadd_int(), ast_free, ast_log, ast_mutex_destroy, ast_rwlock_destroy, __priv_data::data_size, __priv_data::destructor_fn, INTERNAL_OBJ(), INTERNAL_OBJ_MUTEX, INTERNAL_OBJ_RWLOCK, ao2_rwlock_priv::lock, ao2_lock_priv::lock, __priv_data::magic, astobj2_lock::mutex, NULL, __priv_data::options, astobj2::priv_data, __priv_data::ref_counter, and astobj2_rwlock::rwlock.

Referenced by __ao2_ref(), and __ao2_ref_debug().

00404 {
00405    struct astobj2 *obj = INTERNAL_OBJ(user_data);
00406    struct astobj2_lock *obj_mutex;
00407    struct astobj2_rwlock *obj_rwlock;
00408    int current_value;
00409    int ret;
00410 
00411    if (obj == NULL) {
00412       ast_assert(0);
00413       return -1;
00414    }
00415 
00416    /* if delta is 0, just return the refcount */
00417    if (delta == 0) {
00418       return obj->priv_data.ref_counter;
00419    }
00420 
00421    /* we modify with an atomic operation the reference counter */
00422    ret = ast_atomic_fetchadd_int(&obj->priv_data.ref_counter, delta);
00423    current_value = ret + delta;
00424 
00425 #ifdef AO2_DEBUG
00426    ast_atomic_fetchadd_int(&ao2.total_refs, delta);
00427 #endif
00428 
00429    if (0 < current_value) {
00430       /* The object still lives. */
00431       return ret;
00432    }
00433 
00434    /* this case must never happen */
00435    if (current_value < 0) {
00436       ast_log(__LOG_ERROR, file, line, func,
00437          "Invalid refcount %d on ao2 object %p\n", current_value, user_data);
00438       ast_assert(0);
00439       /* stop here even if assert doesn't DO_CRASH */
00440       return -1;
00441    }
00442 
00443    /* last reference, destroy the object */
00444    if (obj->priv_data.destructor_fn != NULL) {
00445       obj->priv_data.destructor_fn(user_data);
00446    }
00447 
00448 #ifdef AO2_DEBUG
00449    ast_atomic_fetchadd_int(&ao2.total_mem, - obj->priv_data.data_size);
00450    ast_atomic_fetchadd_int(&ao2.total_objects, -1);
00451 #endif
00452 
00453    /* In case someone uses an object after it's been freed */
00454    obj->priv_data.magic = 0;
00455 
00456    switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
00457    case AO2_ALLOC_OPT_LOCK_MUTEX:
00458       obj_mutex = INTERNAL_OBJ_MUTEX(user_data);
00459       ast_mutex_destroy(&obj_mutex->mutex.lock);
00460 
00461       ast_free(obj_mutex);
00462       break;
00463    case AO2_ALLOC_OPT_LOCK_RWLOCK:
00464       obj_rwlock = INTERNAL_OBJ_RWLOCK(user_data);
00465       ast_rwlock_destroy(&obj_rwlock->rwlock.lock);
00466 
00467       ast_free(obj_rwlock);
00468       break;
00469    case AO2_ALLOC_OPT_LOCK_NOLOCK:
00470       ast_free(obj);
00471       break;
00472    default:
00473       ast_log(__LOG_ERROR, file, line, func,
00474          "Invalid lock option on ao2 object %p\n", user_data);
00475       break;
00476    }
00477 
00478    return ret;
00479 }

static struct astobj2* INTERNAL_OBJ ( void *  user_data  )  [static, read]

convert from a pointer _p to a user-defined object

Returns:
the pointer to the astobj2 structure

Definition at line 114 of file astobj2.c.

References AO2_MAGIC, ast_assert, ast_log, LOG_ERROR, __priv_data::magic, NULL, and astobj2::priv_data.

Referenced by __adjust_lock(), __ao2_lock(), __ao2_ref_debug(), __ao2_trylock(), __ao2_unlock(), ao2_object_get_lockaddr(), ao2_options_get(), internal_ao2_ref(), and is_ao2_object().

00115 {
00116    struct astobj2 *p;
00117 
00118    if (!user_data) {
00119       ast_log(LOG_ERROR, "user_data is NULL\n");
00120       return NULL;
00121    }
00122 
00123    p = (struct astobj2 *) ((char *) user_data - sizeof(*p));
00124    if (AO2_MAGIC != p->priv_data.magic) {
00125       if (p->priv_data.magic) {
00126          ast_log(LOG_ERROR, "bad magic number 0x%x for object %p\n",
00127             p->priv_data.magic, user_data);
00128       } else {
00129          ast_log(LOG_ERROR,
00130             "bad magic number for object %p. Object is likely destroyed.\n",
00131             user_data);
00132       }
00133       ast_assert(0);
00134       return NULL;
00135    }
00136 
00137    return p;
00138 }

int is_ao2_object ( void *  user_data  ) 


Variable Documentation

FILE* ref_log [static]

Definition at line 42 of file astobj2.c.


Generated on Thu Apr 16 06:29:00 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6