Asterisk main include file. File version handling, generic pbx functions. More...
Go to the source code of this file.
Macros | |
#define | AST_DIR_MODE 0777 |
#define | AST_FILE_MODE 0666 |
#define | ASTERISK_FILE_VERSION(file, version) |
Register/unregister a source code file with the core. More... | |
#define | bcopy 0x__dont_use_bcopy__use_memmove_instead() |
#define | bzero 0x__dont_use_bzero__use_memset_instead"" |
#define | DEFAULT_LANGUAGE "en" |
#define | DEFAULT_SAMPLE_RATE 8000 |
#define | DEFAULT_SAMPLES_PER_MS ((DEFAULT_SAMPLE_RATE)/1000) |
#define | sched_setscheduler __PLEASE_USE_ast_set_priority_INSTEAD_OF_sched_setscheduler__ |
#define | setpriority __PLEASE_USE_ast_set_priority_INSTEAD_OF_setpriority__ |
Functions | |
int | ast_add_profile (const char *, uint64_t scale) |
support for event profiling More... | |
char * | ast_complete_source_filename (const char *partial, int n) |
int | ast_fd_init (void) |
const char * | ast_file_version_find (const char *file) |
Find version for given module name. More... | |
int64_t | ast_mark (int, int start1_stop0) |
int | ast_pbx_init (void) |
int64_t | ast_profile (int, int64_t) |
int | ast_register_atexit (void(*func)(void)) |
Register a function to be executed before Asterisk exits. More... | |
int | ast_register_cleanup (void(*func)(void)) |
Register a function to be executed before Asterisk gracefully exits. More... | |
void | ast_register_file_version (const char *file, const char *version) |
Register the version of a source code file with the core. More... | |
int | ast_set_priority (int) |
We set ourselves to a high priority, that we might pre-empt everything else. If your PBX has heavy activity on it, this is a good thing. More... | |
void | ast_unregister_atexit (void(*func)(void)) |
Unregister a function registered with ast_register_atexit(). More... | |
void | ast_unregister_file_version (const char *file) |
Unregister a source code file from the core. More... | |
Asterisk main include file. File version handling, generic pbx functions.
Definition in file asterisk.h.
#define AST_DIR_MODE 0777 |
Definition at line 33 of file asterisk.h.
#define AST_FILE_MODE 0666 |
Definition at line 36 of file asterisk.h.
Referenced by __ast_play_and_record(), action_createconfig(), ast_lock_path_lockfile(), ast_monitor_start(), chanspy_exec(), copy(), dbinit(), dictate_exec(), extenspy_exec(), festival_exec(), handle_cli_file_convert(), handle_pri_set_debug_file(), handle_recordfile(), load_module(), record_exec(), recordthread(), sms_log(), and try_firmware().
#define ASTERISK_FILE_VERSION | ( | file, | |
version | |||
) |
Register/unregister a source code file with the core.
file | the source file name |
version | the version string (typically a SVN revision keyword string) |
This macro will place a file-scope constructor and destructor into the source of the module using it; this will cause the version of this file to registered with the Asterisk core (and unregistered) at the appropriate times.
Example:
Definition at line 180 of file asterisk.h.
#define bcopy 0x__dont_use_bcopy__use_memmove_instead() |
Definition at line 240 of file asterisk.h.
#define bzero 0x__dont_use_bzero__use_memset_instead"" |
Definition at line 239 of file asterisk.h.
#define DEFAULT_LANGUAGE "en" |
Definition at line 39 of file asterisk.h.
Referenced by fileexists_core().
#define DEFAULT_SAMPLE_RATE 8000 |
Definition at line 41 of file asterisk.h.
Referenced by check_header(), ogg_vorbis_open(), ogg_vorbis_rewrite(), setformat(), and write_header().
#define DEFAULT_SAMPLES_PER_MS ((DEFAULT_SAMPLE_RATE)/1000) |
Definition at line 42 of file asterisk.h.
Referenced by ast_stream_fastforward(), ast_stream_rewind(), and isAnsweringMachine().
#define sched_setscheduler __PLEASE_USE_ast_set_priority_INSTEAD_OF_sched_setscheduler__ |
Definition at line 44 of file asterisk.h.
Referenced by ast_set_priority().
#define setpriority __PLEASE_USE_ast_set_priority_INSTEAD_OF_setpriority__ |
Definition at line 43 of file asterisk.h.
Referenced by ast_set_priority().
int ast_add_profile | ( | const char * | name, |
uint64_t | scale | ||
) |
support for event profiling
(note, this must be documented a lot more) ast_add_profile allocates a generic 'counter' with a given name, which can be shown with the command 'core show profile <name>'
The counter accumulates positive or negative values supplied by
support for event profiling
Definition at line 710 of file asterisk.c.
References ast_calloc, ast_realloc, ast_strdup, profile_data::e, profile_data::entries, profile_entry::events, profile_entry::mark, profile_data::max_size, profile_entry::name, prof_data, profile_entry::scale, and profile_entry::value.
Referenced by extension_match_core().
char* ast_complete_source_filename | ( | const char * | partial, |
int | n | ||
) |
Definition at line 357 of file asterisk.c.
References AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_strdup, len(), and ast_atexit::list.
Referenced by handle_verbose().
int ast_fd_init | ( | void | ) |
const char* ast_file_version_find | ( | const char * | file | ) |
Find version for given module name.
file | Module name (i.e. chan_sip.so) |
Definition at line 376 of file asterisk.c.
References AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, and ast_atexit::list.
Referenced by manager_modulecheck().
int64_t ast_mark | ( | int | , |
int | start1_stop0 | ||
) |
Definition at line 775 of file asterisk.c.
References profile_data::e, profile_data::entries, profile_entry::events, profile_entry::mark, prof_data, rdtsc(), profile_entry::scale, and profile_entry::value.
Referenced by __ast_pthread_mutex_lock(), and extension_match_core().
int ast_pbx_init | ( | void | ) |
Provided by pbx.c
Definition at line 11407 of file pbx.c.
References ao2_container_alloc, ast_register_atexit(), HASH_EXTENHINT_SIZE, hint_cmp(), hint_hash(), hints, pbx_shutdown(), statecbs, and statecbs_cmp().
Referenced by main().
int64_t ast_profile | ( | int | , |
int64_t | |||
) |
Definition at line 740 of file asterisk.c.
References profile_data::e, profile_data::entries, profile_entry::events, prof_data, profile_entry::scale, and profile_entry::value.
int ast_register_atexit | ( | void(*)(void) | func | ) |
Register a function to be executed before Asterisk exits.
func | The callback function to use. |
0 | on success. |
-1 | on error. |
Definition at line 998 of file asterisk.c.
References ast_atexit::func, and register_atexit().
Referenced by __init_manager(), ast_aoc_cli_init(), ast_builtins_init(), ast_cc_init(), ast_cdr_engine_init(), ast_cel_engine_init(), ast_channels_init(), ast_data_init(), ast_event_init(), ast_features_init(), ast_file_init(), ast_http_init(), ast_image_init(), ast_indications_init(), ast_pbx_init(), ast_stun_init(), ast_test_init(), ast_timing_init(), ast_tps_init(), ast_udptl_init(), ast_utils_init(), ast_xmldoc_load_documentation(), astdb_init(), astobj2_init(), dnsmgr_init(), do_reload(), init_framer(), load_module(), load_pbx(), main(), and register_config_cli().
int ast_register_cleanup | ( | void(*)(void) | func | ) |
Register a function to be executed before Asterisk gracefully exits.
func | The callback function to use. |
0 | on success. |
-1 | on error. |
Definition at line 1003 of file asterisk.c.
References ast_atexit::func, and register_atexit().
Referenced by ast_autoservice_init().
void ast_register_file_version | ( | const char * | file, |
const char * | version | ||
) |
Register the version of a source code file with the core.
file | the source file name |
version | the version string (typically a SVN revision keyword string) |
This function should not be called directly, but instead the ASTERISK_FILE_VERSION macro should be used to register a file with the core.
Definition at line 318 of file asterisk.c.
References ast_calloc, AST_RWLIST_INSERT_HEAD, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_strdupa, ast_strip(), ast_strip_quoted(), and ast_atexit::list.
int ast_set_priority | ( | int | ) |
We set ourselves to a high priority, that we might pre-empt everything else. If your PBX has heavy activity on it, this is a good thing.
Provided by asterisk.c
Definition at line 1650 of file asterisk.c.
References ast_log(), ast_verbose(), LOG_WARNING, sched_setscheduler, and setpriority.
Referenced by app_exec(), ast_safe_system(), canary_thread(), icesencode(), launch_script(), main(), mp3play(), NBScatplay(), send_waveform_to_fd(), spawn_mp3(), and spawn_ras().
void ast_unregister_atexit | ( | void(*)(void) | func | ) |
Unregister a function registered with ast_register_atexit().
func | The callback function to unregister. |
Definition at line 1008 of file asterisk.c.
References __ast_unregister_atexit(), AST_LIST_LOCK, AST_LIST_UNLOCK, and ast_atexit::func.
Referenced by do_reload(), and unload_module().
void ast_unregister_file_version | ( | const char * | file | ) |
Unregister a source code file from the core.
file | the source file name |
This function should not be called directly, but instead the ASTERISK_FILE_VERSION macro should be used to automatically unregister the file when the module is unloaded.
Definition at line 339 of file asterisk.c.
References ast_free, AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, and ast_atexit::list.