Asterisk Logger. More...
#include "asterisk.h"#include <syslog.h>#include "asterisk/_private.h"#include "asterisk/paths.h"#include "asterisk/logger.h"#include "asterisk/lock.h"#include "asterisk/channel.h"#include "asterisk/config.h"#include "asterisk/term.h"#include "asterisk/cli.h"#include "asterisk/utils.h"#include "asterisk/manager.h"#include "asterisk/threadstorage.h"#include "asterisk/strings.h"#include "asterisk/pbx.h"#include "asterisk/app.h"#include <signal.h>#include <time.h>#include <sys/stat.h>#include <fcntl.h>#include <execinfo.h>
Go to the source code of this file.
Data Structures | |
| struct | logchannel |
| struct | logchannels |
| struct | logmsg |
| struct | logmsgs |
| struct | verb |
| struct | verbosers |
Defines | |
| #define | FORMATL "%-35.35s %-8.8s %-9.9s " |
| #define | GETTID() getpid() |
| #define | LOG_BUF_INIT_SIZE 256 |
| #define | MAX_BACKTRACE_FRAMES 20 |
| #define | VERBOSE_BUF_INIT_SIZE 256 |
Enumerations | |
| enum | logmsgtypes { LOGMSG_NORMAL = 0, LOGMSG_VERBOSE } |
| enum | logtypes { LOGTYPE_SYSLOG, LOGTYPE_FILE, LOGTYPE_CONSOLE } |
| enum | rotatestrategy { SEQUENTIAL = 1 << 0, ROTATE = 1 << 1, TIMESTAMP = 1 << 2 } |
Functions | |
| void | __ast_verbose (const char *file, int line, const char *func, const char *fmt,...) |
| This works like ast_log, but prints verbose messages to the console depending on verbosity level set. ast_verbose(VERBOSE_PREFIX_3 "Whatever %s is happening\n", "nothing"); This will print the message to the console if the verbose level is set to a level >= 3 Note the abscence of a comma after the VERBOSE_PREFIX_3. This is important. VERBOSE_PREFIX_1 through VERBOSE_PREFIX_3 are defined. | |
| void | __ast_verbose_ap (const char *file, int line, const char *func, const char *fmt, va_list ap) |
| static void | __init_log_buf (void) |
| static void | __init_verbose_buf (void) |
| static void | _handle_SIGXFSZ (int sig) |
| void | ast_backtrace (void) |
| struct ast_bt * | ast_bt_create (void) |
| void * | ast_bt_destroy (struct ast_bt *bt) |
| int | ast_bt_get_addresses (struct ast_bt *bt) |
| char ** | ast_bt_get_symbols (void **addresses, size_t num_frames) |
| void | ast_child_verbose (int level, const char *fmt,...) |
| void | ast_log (int level, const char *file, int line, const char *function, const char *fmt,...) |
| send log messages to syslog and/or the console | |
| static void | ast_log_vsyslog (struct logmsg *msg) |
| int | ast_logger_register_level (const char *name) |
| Register a new logger level. | |
| void | ast_logger_unregister_level (const char *name) |
| Unregister a previously registered logger level. | |
| void | ast_queue_log (const char *queuename, const char *callid, const char *agent, const char *event, const char *fmt,...) |
| int | ast_register_verbose (void(*v)(const char *string)) |
| int | ast_unregister_verbose (void(*v)(const char *string)) |
| void | ast_verbose (const char *fmt,...) |
| void | close_logger (void) |
| static char * | handle_logger_reload (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
| static char * | handle_logger_rotate (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
| static char * | handle_logger_set_level (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
| static char * | handle_logger_show_channels (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
| CLI command to show logging system configuration. | |
| int | init_logger (void) |
| static void | init_logger_chain (int locked) |
| static void | logger_print_normal (struct logmsg *logmsg) |
| Print a normal log message to the channels. | |
| static void | logger_queue_init (void) |
| static int | logger_queue_restart (int queue_rotate) |
| static int | logger_queue_rt_start (void) |
| int | logger_reload (void) |
| Reload the logger module without rotating log files (also used from loader.c during a full Asterisk reload) | |
| static void * | logger_thread (void *data) |
| Actual logging thread. | |
| static unsigned int | make_components (const char *s, int lineno) |
| static struct logchannel * | make_logchannel (const char *channel, const char *components, int lineno) |
| static int | reload_logger (int rotate) |
| static int | rotate_file (const char *filename) |
| static void | update_logchannels (void) |
Variables | |
| static struct ast_cli_entry | cli_logger [] |
| static int | close_logger_thread = 0 |
| static const int | colors [32] |
| Colors used in the console for logging. | |
| static char | dateformat [256] = "%b %e %T" |
| static char | exec_after_rotate [256] = "" |
| static int | filesize_reload_needed |
| static unsigned int | global_logmask = 0xFFFF |
| static struct sigaction | handle_SIGXFSZ |
| static char | hostname [MAXHOSTNAMELEN] |
| static char * | levels [32] |
| Logging channels used in the Asterisk logging system. | |
| static struct ast_threadstorage | log_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_log_buf , .custom_init = NULL , } |
| static struct logchannels | logchannels |
| static ast_cond_t | logcond |
| struct { | |
| unsigned int queue_adaptive_realtime:1 | |
| unsigned int queue_log:1 | |
| unsigned int queue_log_to_file:1 | |
| } | logfiles |
| static int | logger_initialized |
| static struct logmsgs | logmsgs |
| static pthread_t | logthread = AST_PTHREADT_NULL |
| static FILE * | qlog |
| static char | queue_log_name [256] = QUEUELOG |
| static int | queuelog_init |
| static enum rotatestrategy | rotatestrategy |
| static struct ast_threadstorage | verbose_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_verbose_buf , .custom_init = NULL , } |
| static struct verbosers | verbosers |
| #define FORMATL "%-35.35s %-8.8s %-9.9s " |
Referenced by handle_logger_show_channels().
| #define VERBOSE_BUF_INIT_SIZE 256 |
Definition at line 212 of file logger.c.
Referenced by __ast_verbose_ap().
| enum logmsgtypes |
Definition at line 127 of file logger.c.
{
LOGMSG_NORMAL = 0,
LOGMSG_VERBOSE,
};
| enum logtypes |
| enum rotatestrategy |
Definition at line 84 of file logger.c.
{
SEQUENTIAL = 1 << 0, /* Original method - create a new file, in order */
ROTATE = 1 << 1, /* Rotate all files, such that the oldest file has the highest suffix */
TIMESTAMP = 1 << 2, /* Append the epoch timestamp onto the end of the archived file */
} rotatestrategy = SEQUENTIAL;
| void __ast_verbose | ( | const char * | file, |
| int | line, | ||
| const char * | func, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
This works like ast_log, but prints verbose messages to the console depending on verbosity level set. ast_verbose(VERBOSE_PREFIX_3 "Whatever %s is happening\n", "nothing"); This will print the message to the console if the verbose level is set to a level >= 3 Note the abscence of a comma after the VERBOSE_PREFIX_3. This is important. VERBOSE_PREFIX_1 through VERBOSE_PREFIX_3 are defined.
Send a verbose message (based on verbose level)
Definition at line 1523 of file logger.c.
References __ast_verbose_ap().
{
va_list ap;
va_start(ap, fmt);
__ast_verbose_ap(file, line, func, fmt, ap);
va_end(ap);
}
| void __ast_verbose_ap | ( | const char * | file, |
| int | line, | ||
| const char * | func, | ||
| const char * | fmt, | ||
| va_list | ap | ||
| ) |
Definition at line 1487 of file logger.c.
References ast_str_thread_get(), verbose_buf, VERBOSE_BUF_INIT_SIZE, ast_opt_timestamp, ast_tvnow(), ast_localtime(), ast_strftime(), ast_str_set_va(), AST_DYNSTR_BUILD_FAILED, ast_log(), __LOG_VERBOSE, and ast_str_buffer().
Referenced by __ast_verbose(), and ast_verbose().
{
struct ast_str *buf = NULL;
int res = 0;
if (!(buf = ast_str_thread_get(&verbose_buf, VERBOSE_BUF_INIT_SIZE)))
return;
if (ast_opt_timestamp) {
struct timeval now;
struct ast_tm tm;
char date[40];
char *datefmt;
now = ast_tvnow();
ast_localtime(&now, &tm, NULL);
ast_strftime(date, sizeof(date), dateformat, &tm);
datefmt = alloca(strlen(date) + 3 + strlen(fmt) + 1);
sprintf(datefmt, "%c[%s] %s", 127, date, fmt);
fmt = datefmt;
} else {
char *tmp = alloca(strlen(fmt) + 2);
sprintf(tmp, "%c%s", 127, fmt);
fmt = tmp;
}
/* Build string */
res = ast_str_set_va(&buf, 0, fmt, ap);
/* If the build failed then we can drop this allocated message */
if (res == AST_DYNSTR_BUILD_FAILED)
return;
ast_log(__LOG_VERBOSE, file, line, func, "%s", ast_str_buffer(buf));
}
| static void _handle_SIGXFSZ | ( | int | sig | ) | [static] |
Definition at line 934 of file logger.c.
{
/* Indicate need to reload */
filesize_reload_needed = 1;
}
| void ast_backtrace | ( | void | ) |
Definition at line 1457 of file logger.c.
References ast_bt_create(), ast_log(), LOG_WARNING, ast_bt_get_symbols(), ast_bt::addresses, ast_bt::num_frames, ast_debug, LOG_DEBUG, free, and ast_bt_destroy().
{
#ifdef HAVE_BKTR
struct ast_bt *bt;
int i = 0;
char **strings;
if (!(bt = ast_bt_create())) {
ast_log(LOG_WARNING, "Unable to allocate space for backtrace structure\n");
return;
}
if ((strings = ast_bt_get_symbols(bt->addresses, bt->num_frames))) {
ast_debug(1, "Got %d backtrace record%c\n", bt->num_frames, bt->num_frames != 1 ? 's' : ' ');
for (i = 3; i < bt->num_frames - 2; i++) {
ast_log(LOG_DEBUG, "#%d: [%p] %s\n", i - 3, bt->addresses[i], strings[i]);
}
/* MALLOC_DEBUG will erroneously report an error here, unless we undef the macro. */
#undef free
free(strings);
} else {
ast_debug(1, "Could not allocate memory for backtrace\n");
}
ast_bt_destroy(bt);
#else
ast_log(LOG_WARNING, "Must run configure with '--with-execinfo' for stack backtraces.\n");
#endif /* defined(HAVE_BKTR) */
}
| struct ast_bt* ast_bt_create | ( | void | ) | [read] |
Definition at line 1280 of file logger.c.
References ast_calloc, ast_log(), LOG_ERROR, ast_bt::alloced, and ast_bt_get_addresses().
Referenced by ast_backtrace().
{
struct ast_bt *bt = ast_calloc(1, sizeof(*bt));
if (!bt) {
ast_log(LOG_ERROR, "Unable to allocate memory for backtrace structure!\n");
return NULL;
}
bt->alloced = 1;
ast_bt_get_addresses(bt);
return bt;
}
| void* ast_bt_destroy | ( | struct ast_bt * | bt | ) |
Definition at line 1302 of file logger.c.
References ast_bt::alloced, and ast_free.
Referenced by ast_backtrace().
| int ast_bt_get_addresses | ( | struct ast_bt * | bt | ) |
Definition at line 1295 of file logger.c.
References ast_bt::num_frames, ast_bt::addresses, and AST_MAX_BT_FRAMES.
Referenced by __ast_pthread_mutex_lock(), __ast_pthread_mutex_trylock(), __ast_cond_wait(), __ast_cond_timedwait(), __ast_rwlock_rdlock(), __ast_rwlock_wrlock(), __ast_rwlock_timedrdlock(), __ast_rwlock_timedwrlock(), __ast_rwlock_tryrdlock(), __ast_rwlock_trywrlock(), and ast_bt_create().
{
bt->num_frames = backtrace(bt->addresses, AST_MAX_BT_FRAMES);
return 0;
}
| char** ast_bt_get_symbols | ( | void ** | addresses, |
| size_t | num_frames | ||
| ) |
Definition at line 1311 of file logger.c.
References ast_calloc, ast_bt::num_frames, ast_utils_which(), ast_log(), LOG_DEBUG, ast_malloc, S_OR, ast_free, ast_strlen_zero(), ast_realloc, and ast_copy_string().
Referenced by ao2_bt(), and ast_backtrace().
{
char **strings = NULL;
#if defined(BETTER_BACKTRACES)
int stackfr;
bfd *bfdobj; /* bfd.h */
Dl_info dli; /* dlfcn.h */
long allocsize;
asymbol **syms = NULL; /* bfd.h */
bfd_vma offset; /* bfd.h */
const char *lastslash;
asection *section;
const char *file, *func;
unsigned int line;
char address_str[128];
char msg[1024];
size_t strings_size;
size_t *eachlen;
#endif
#if defined(BETTER_BACKTRACES)
strings_size = num_frames * sizeof(*strings);
eachlen = ast_calloc(num_frames, sizeof(*eachlen));
if (!(strings = ast_calloc(num_frames, sizeof(*strings)))) {
return NULL;
}
for (stackfr = 0; stackfr < num_frames; stackfr++) {
int found = 0, symbolcount;
msg[0] = '\0';
if (!dladdr(addresses[stackfr], &dli)) {
continue;
}
if (strcmp(dli.dli_fname, "asterisk") == 0) {
char asteriskpath[256];
if (!(dli.dli_fname = ast_utils_which("asterisk", asteriskpath, sizeof(asteriskpath)))) {
/* This will fail to find symbols */
ast_log(LOG_DEBUG, "Failed to find asterisk binary for debug symbols.\n");
dli.dli_fname = "asterisk";
}
}
lastslash = strrchr(dli.dli_fname, '/');
if ( (bfdobj = bfd_openr(dli.dli_fname, NULL)) &&
bfd_check_format(bfdobj, bfd_object) &&
(allocsize = bfd_get_symtab_upper_bound(bfdobj)) > 0 &&
(syms = ast_malloc(allocsize)) &&
(symbolcount = bfd_canonicalize_symtab(bfdobj, syms))) {
if (bfdobj->flags & DYNAMIC) {
offset = addresses[stackfr] - dli.dli_fbase;
} else {
offset = addresses[stackfr] - (void *) 0;
}
for (section = bfdobj->sections; section; section = section->next) {
if ( !bfd_get_section_flags(bfdobj, section) & SEC_ALLOC ||
section->vma > offset ||
section->size + section->vma < offset) {
continue;
}
if (!bfd_find_nearest_line(bfdobj, section, syms, offset - section->vma, &file, &func, &line)) {
continue;
}
/* Stack trace output */
found++;
if ((lastslash = strrchr(file, '/'))) {
const char *prevslash;
for (prevslash = lastslash - 1; *prevslash != '/' && prevslash >= file; prevslash--);
if (prevslash >= file) {
lastslash = prevslash;
}
}
if (dli.dli_saddr == NULL) {
address_str[0] = '\0';
} else {
snprintf(address_str, sizeof(address_str), " (%p+%lX)",
dli.dli_saddr,
(unsigned long) (addresses[stackfr] - dli.dli_saddr));
}
snprintf(msg, sizeof(msg), "%s:%u %s()%s",
lastslash ? lastslash + 1 : file, line,
S_OR(func, "???"),
address_str);
break; /* out of section iteration */
}
}
if (bfdobj) {
bfd_close(bfdobj);
if (syms) {
ast_free(syms);
}
}
/* Default output, if we cannot find the information within BFD */
if (!found) {
if (dli.dli_saddr == NULL) {
address_str[0] = '\0';
} else {
snprintf(address_str, sizeof(address_str), " (%p+%lX)",
dli.dli_saddr,
(unsigned long) (addresses[stackfr] - dli.dli_saddr));
}
snprintf(msg, sizeof(msg), "%s %s()%s",
lastslash ? lastslash + 1 : dli.dli_fname,
S_OR(dli.dli_sname, "<unknown>"),
address_str);
}
if (!ast_strlen_zero(msg)) {
char **tmp;
eachlen[stackfr] = strlen(msg);
if (!(tmp = ast_realloc(strings, strings_size + eachlen[stackfr] + 1))) {
ast_free(strings);
strings = NULL;
break; /* out of stack frame iteration */
}
strings = tmp;
strings[stackfr] = (char *) strings + strings_size;
ast_copy_string(strings[stackfr], msg, eachlen[stackfr] + 1);
strings_size += eachlen[stackfr] + 1;
}
}
if (strings) {
/* Recalculate the offset pointers */
strings[0] = (char *) strings + num_frames * sizeof(*strings);
for (stackfr = 1; stackfr < num_frames; stackfr++) {
strings[stackfr] = strings[stackfr - 1] + eachlen[stackfr - 1] + 1;
}
}
#else /* !defined(BETTER_BACKTRACES) */
strings = backtrace_symbols(addresses, num_frames);
#endif /* defined(BETTER_BACKTRACES) */
return strings;
}
| void ast_child_verbose | ( | int | level, |
| const char * | fmt, | ||
| ... | |||
| ) |
Definition at line 426 of file logger.c.
References option_verbose, ast_malloc, and ast_free.
Referenced by launch_script().
{
char *msg = NULL, *emsg = NULL, *sptr, *eptr;
va_list ap, aq;
int size;
/* Don't bother, if the level isn't that high */
if (option_verbose < level) {
return;
}
va_start(ap, fmt);
va_copy(aq, ap);
if ((size = vsnprintf(msg, 0, fmt, ap)) < 0) {
va_end(ap);
va_end(aq);
return;
}
va_end(ap);
if (!(msg = ast_malloc(size + 1))) {
va_end(aq);
return;
}
vsnprintf(msg, size + 1, fmt, aq);
va_end(aq);
if (!(emsg = ast_malloc(size * 2 + 1))) {
ast_free(msg);
return;
}
for (sptr = msg, eptr = emsg; ; sptr++) {
if (*sptr == '"') {
*eptr++ = '\\';
}
*eptr++ = *sptr;
if (*sptr == '\0') {
break;
}
}
ast_free(msg);
fprintf(stdout, "verbose \"%s\" %d\n", emsg, level);
fflush(stdout);
ast_free(emsg);
}
| void ast_log | ( | int | level, |
| const char * | file, | ||
| int | line, | ||
| const char * | function, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
send log messages to syslog and/or the console
Used for sending a log message This is the standard logger function. Probably the only way you will invoke it would be something like this: ast_log(AST_LOG_WHATEVER, "Problem with the %s Captain. We should get some more. Will %d be enough?\n", "flux capacitor", 10); where WHATEVER is one of ERROR, DEBUG, EVENT, NOTICE, or WARNING depending on which log you wish to output to. These are implemented as macros, that will provide the function with the needed arguments.
Definition at line 1186 of file logger.c.
References ast_tvnow(), ast_str_thread_get(), log_buf, LOG_BUF_INIT_SIZE, __LOG_VERBOSE, AST_RWLIST_EMPTY, ast_str_set_va(), AST_DYNSTR_BUILD_FAILED, term_filter_escapes(), ast_str_buffer(), option_verbose, option_debug, __LOG_DEBUG, ast_calloc_with_stringfields, ast_string_field_set, logmsg::type, LOGMSG_VERBOSE, LOGMSG_NORMAL, ast_localtime(), ast_strftime(), logmsg::level, logmsg::line, levels, logmsg::process_id, GETTID, logthread, AST_PTHREADT_NULL, AST_LIST_LOCK, AST_LIST_INSERT_TAIL, logchannel::list, ast_cond_signal, logcond, AST_LIST_UNLOCK, logger_print_normal(), and ast_free.
Referenced by ast_jb_put(), jb_get_and_deliver(), create_jb(), ast_append_ha(), resolve_first(), ast_ouraddrfor(), ast_find_ourip(), yyparse(), yyerror(), ast_alaw_init(), ast_aoc_create(), aoc_parse_ie(), ast_aoc_decode(), aoc_append_ie(), ast_aoc_encode(), ast_app_dtget(), ast_app_run_macro(), ast_dtmf_stream(), linear_release(), linear_generator(), linear_alloc(), ast_linear_stream(), __ast_play_and_record(), ast_app_group_match_get_count(), ast_lock_path_lockfile(), ast_unlock_path_lockfile(), ast_lock_path_flock(), ast_unlock_path_flock(), ast_record_review(), ivr_dispatch(), ast_ivr_menu_run_internal(), ast_read_textfile(), parse_options(), ast_get_encoded_char(), ast_safe_fork(), get_token(), send_dtmf(), goto_line(), goto_line_rel(), send_delay(), set_state(), cleartimer(), getflagbyname(), setflag(), clearflag(), starttimer(), getkeybyname(), getsubbyname(), getstatebyname(), getdisplaybyname(), showkeys(), showdisplay(), cleardisplay(), digitdirect(), clearcbone(), digitcollect(), subscript(), onevent(), process_returncode(), process_opcode(), adsi_process(), compile_script(), adsi_prog(), send_tone_burst(), alarmreceiver_exec(), load_config(), isAnsweringMachine(), auth_exec(), chanavail_exec(), asyncgoto_exec(), spy_generate(), start_spying(), channel_spy(), chanspy_exec(), extenspy_exec(), dahdiscan_exec(), join_conference_bridge(), confbridge_exec(), controlplayback_exec(), careful_write(), conf_run(), conf_exec(), run_ras(), dahdiras_exec(), del_exec(), do_forward(), wait_for_answer(), setup_privacy_args(), dial_handle_playtones(), dial_exec_full(), retrydial_exec(), load_module(), dictate_exec(), pickup_by_exten(), pickup_by_group(), pickup_exec(), pickupchan_exec(), goto_exten(), select_entry(), realtime_directory(), directory_exec(), disa_exec(), exec_exec(), tryexec_exec(), execif_exec(), app_exec(), span_message(), t38_tx_packet_handler(), phase_e_handler(), fax_generator_generate(), transmit_audio(), transmit_t38(), transmit(), sndfax_exec(), rcvfax_exec(), send_waveform_to_fd(), send_waveform_to_channel(), festival_exec(), flash_exec(), profile_set_param(), reload_followme(), clear_caller(), wait_for_winner(), findmeexec(), forkcdr_exec(), icesencode(), ices_exec(), sendimage_exec(), skel_exec(), log_jack_status(), alloc_resampler(), handle_input(), init_jack_data(), queue_voice_frame(), handle_jack_audio(), handle_options(), jack_hook_callback(), enable_jack_hook(), disable_jack_hook(), jack_hook_write(), _macro_exec(), macroif_exec(), build_conf(), conf_flush(), conf_queue_dtmf(), sla_queue_event_conf(), announce_thread(), find_conf_realtime(), find_conf(), count_exec(), admin_exec(), channel_admin_exec(), meetmemute(), load_config_meetme(), sla_station_exec(), sla_trunk_exec(), sla_state(), sla_build_trunk(), sla_add_trunk_to_station(), sla_build_station(), sla_load_config(), acf_meetme_info(), milliwatt_generate(), old_milliwatt_exec(), message_template_build(), base_encode(), prep_email_sub_vars(), find_account(), sendmail(), create_dirpath(), play_record_review(), notify_new_message(), leave_voicemail(), minivm_mwi_exec(), minivm_notify_exec(), minivm_record_exec(), minivm_greet_exec(), minivm_delete_exec(), minivm_accmess_exec(), create_vmaccount(), timezone_add(), message_template_parse_filebody(), message_template_parse_emailbody(), apply_general_options(), minivm_account_func_read(), access_counter_file(), minivm_counter_func_read(), minivm_counter_func_write(), mixmonitor_thread(), launch_monitor_thread(), mixmonitor_exec(), morsecode_exec(), mp3play(), timed_read(), mp3_exec(), NBScatplay(), NBScat_exec(), originate_exec(), osp_create_provider(), osp_create_transaction(), osp_validate_token(), osp_check_destination(), osp_auth(), osp_create_uuid(), osp_uuid2str(), osp_create_callid(), osp_lookup(), osp_next(), ospauth_exec(), osplookup_exec(), ospnext_exec(), ospfinished_exec(), osp_load(), page_exec(), parkandannounce_exec(), s_streamwait3(), do_say(), say_init_mode(), playback_exec(), reload(), handle_playtones(), privacy_exec(), device_state_cb(), create_queue_member(), insert_penaltychange(), parse_empty_options(), queue_set_param(), rt_handle_member_record(), find_queue_by_name_rt(), load_realtime_queue(), join_queue(), calc_metric(), queue_transfer_fixup(), setup_transfer_datastore(), try_calling(), dump_queue_members(), set_member_paused(), set_member_penalty(), get_member_penalty(), reload_queue_members(), pqm_exec(), upqm_exec(), rqm_exec(), aqm_exec(), ql_exec(), copy_rules(), queue_exec(), queue_function_var(), queue_function_exists(), queue_function_qac(), queue_function_qac_dep(), queue_function_queuewaitingcount(), queue_function_queuememberlist(), queue_function_memberpenalty_read(), queue_function_memberpenalty_write(), reload_queue_rules(), reload_single_member(), reload_single_queue(), reload_queues(), read_exec(), readexten_exec(), acf_isexten_exec(), readfile_exec(), record_exec(), diskavail(), flush_telem(), linkcount(), retreive_memory(), birdbath(), donodelog(), do_dtmf_local(), setdtr(), openserial(), send_usb_txt(), statpost(), load_rpt_vars(), rpt_do_stats(), rpt_do_lstats(), rpt_push_alt_macro(), sayfile(), saycharstr(), saynum(), telem_lookup(), wait_interval(), rpt_tele_thread(), rpt_telemetry(), rpt_call(), connect_link(), function_ilink(), function_autopatchup(), function_cop(), collect_function_digits(), handle_link_data(), rbi_out(), serial_remote_io(), sendkenwood(), check_freq_ic706(), ic706_pltocode(), set_freq_ic706(), set_offset_ic706(), set_mode_ic706(), set_ctcss_mode_ic706(), set_ic706(), setrem(), check_tx_freq(), get_mem_set(), channel_steer(), channel_revert(), function_remote(), handle_remote_dtmf_digit(), handle_remote_data(), attempt_reconnect(), local_dtmf_helper(), do_scheduler(), rpt(), rpt_master(), rpt_exec(), rpt_manager_do_stats(), saycountednoun_exec(), saycountedadj_exec(), senddtmf_exec(), sendtext_exec(), setcallerid_pres_exec(), sms_log(), sms_readfile(), sms_writefile(), sms_handleincoming(), sms_messagerx2(), sms_generate(), sms_process(), sms_exec(), softhangup_exec(), pop_exec(), return_exec(), gosub_exec(), gosubif_exec(), local_write(), peek_read(), handle_gosub(), system_exec_helper(), background_detect_exec(), measurenoise(), testclient_exec(), testserver_exec(), transfer_exec(), sendurl_exec(), userevent_exec(), verbose_exec(), log_exec(), inprocess_count(), apply_option(), vm_check_password_shell(), check_password(), apply_options_full(), is_valid_dtmf(), vm_change_password(), copy(), make_email_file(), add_email_attachment(), sendpage(), invent_message(), copy_message(), run_externnotify(), save_to_folder(), adsi_begin(), forward_message(), wait_file2(), play_message_category(), play_message_datetime(), play_message(), open_mailbox(), close_mailbox(), vm_intro(), vm_newuser(), vm_options(), vm_authenticate(), vm_execmain(), vm_exec(), find_or_create(), append_mailbox(), vm_box_exists(), acf_mailbox_exists(), mwi_sub_event_cb(), substitute_escapes(), read_password_from_file(), write_password_to_file(), vmsayname_exec(), advanced_options(), waitforring_exec(), do_waiting(), waitfor_exec(), waituntil_exec(), find_matching_endwhile(), _while_exec(), alloc_expr_node(), make_number(), make_str(), to_number(), to_string(), compose_func_args(), op_func(), op_eq(), op_plus(), op_minus(), op_negate(), op_times(), op_div(), op_rem(), op_colon(), op_eqtilde(), ast_yyerror(), ast_safe_system(), netconsole(), listener(), ast_makesocket(), ast_tryconnect(), set_ulimit(), ast_set_priority(), ast_el_read_char(), ast_remotecontrol(), ast_readconfig(), canary_thread(), main(), INTERNAL_OBJ(), internal_ao2_ref(), ast_audiohook_write_frame(), audiohook_read_frame_both(), ast_channel_audiohook_count_by_source(), ast_channel_audiohook_count_by_source_running(), autoservice_run(), ast_autoservice_start(), multiplexed_bridge_create(), multiplexed_nudge(), multiplexed_thread_function(), __ast_bridge_technology_register(), bridge_array_add(), bridge_make_compatible(), callerid_get_dtmf(), callerid_feed_jp(), callerid_feed(), str_to_agent_policy(), str_to_monitor_policy(), ast_cc_get_param(), ast_cc_set_param(), ast_set_cc_offer_timer(), ast_set_ccnr_available_timer(), ast_set_cc_recall_timer(), ast_set_ccbs_available_timer(), ast_handle_cc_control_frame(), cc_available(), cc_caller_requested(), build_cc_interfaces_chanvar(), ast_queue_cc_frame(), cccancel_exec(), initialize_cc_max_requests(), ast_cdr_register(), ast_cdr_setvar(), ast_cdr_serialize_variables(), check_post(), ast_cdr_alloc(), cdr_merge_vars(), ast_cdr_merge(), ast_cdr_end(), ast_cdr_submit_batch(), do_reload(), ast_cdr_engine_init(), generic_prepare(), odbc_log(), unload_module(), writefile(), csv_log(), custom_log(), manager_log(), odbc_load_module(), pgsql_log(), config_module(), radius_log(), sqlite_log(), load_column_config(), load_values_config(), write_cdr(), syslog_log(), tds_log(), anti_injection(), mssql_connect(), tds_error_handler(), tds_message_handler(), tds_load_module(), parse_events(), parse_apps(), ast_cel_get_ama_flag_name(), ast_cel_fill_record(), add_agent(), agent_answer(), __agent_start_monitoring(), agent_read(), agent_fixup(), agent_indicate(), agent_call(), agent_get_base_channel(), agent_set_base_channel(), agent_new(), read_agent_config(), agent_request(), login_exec(), agentmonitoroutgoing_exec(), function_agent(), alsa_card_init(), soundcard_init(), alsa_write(), alsa_read(), alsa_indicate(), alsa_new(), alsa_request(), open_stream(), start_stream(), console_request(), console_indicate(), set_active(), store_config_core(), analogsub_to_dahdisub(), my_start_cid_detect(), my_get_callerid(), my_distinctive_ring(), my_callwait(), my_send_callerid(), my_dsp_set_digitmode(), my_wink(), my_handle_dtmf(), my_set_cadence(), my_set_waitingfordt(), my_all_subchannels_hungup(), my_new_pri_ast_channel(), my_pri_open_media(), my_is_off_hook(), my_dial_digits(), my_is_dialing(), my_handle_dchan_exception(), my_handle_link_exception(), my_ss7_set_loopback(), my_new_ss7_ast_channel(), my_handle_notify_message(), _dahdi_get_index(), handle_clear_alarms(), dahdi_open(), alloc_sub(), unalloc_sub(), dahdi_digit_begin(), conf_add(), conf_del(), reset_conf(), dahdi_enable_ec(), dahdi_train_ec(), dahdi_disable_ec(), bump_gains(), restore_gains(), dahdi_set_hook(), dahdi_confmute(), save_conference(), restore_conference(), send_callerid(), dahdi_callwait(), dahdi_call(), revert_fax_buffers(), dahdi_hangup(), dahdi_answer(), dahdi_setoption(), parse_buffers_policy(), dahdi_func_write(), dahdi_link(), dahdi_bridge(), dahdi_ring_phone(), attempt_transfer(), check_for_conference(), get_alarms(), dahdi_handle_dtmf(), handle_alarms(), dahdi_handle_event(), __dahdi_exception(), dahdi_read(), dahdi_write(), dahdi_indicate(), dahdi_new(), analog_ss_thread(), mwi_thread(), mwi_send_init(), mwi_send_process_buffer(), mwi_send_process_event(), handle_init_event(), do_monitor(), restart_monitor(), pri_resolve_span(), pri_create_trunkgroup(), pri_create_spanmap(), device2chan(), mkintf(), dahdi_new_pri_nobch_channel(), duplicate_pseudo(), determine_starting_point(), dahdi_request(), dahdi_ss7_error(), dahdi_pri_message(), dahdi_pri_error(), prepare_pri(), complete_span_helper(), dahdi_restart(), dahdi_show_channel(), dahdi_fake_event(), linkset_addsigchan(), build_channels(), process_echocancel(), process_dahdi(), setup_dahdi_int(), dahdi_status_data_provider_get(), dahdi_version_data_provider_get(), dahdi_sendtext(), add_codec_to_answer(), gtalk_invite(), gtalk_ringing_ack(), gtalk_is_answered(), gtalk_is_accepted(), gtalk_handle_dtmf(), gtalk_hangup_farend(), gtalk_create_candidates(), gtalk_alloc(), gtalk_new(), gtalk_free_pvt(), gtalk_newcall(), gtalk_update_externip(), gtalk_update_stun(), gtalk_write(), gtalk_sendtext(), gtalk_sendhtml(), gtalk_call(), gtalk_request(), gtalk_show_channels(), gtalk_parser(), gtalk_create_member(), gtalk_load_config(), __oh323_update_info(), __oh323_destroy(), oh323_digit_begin(), oh323_digit_end(), oh323_call(), oh323_hangup(), oh323_rtp_read(), oh323_read(), oh323_write(), oh323_indicate(), oh323_fixup(), __oh323_rtp_create(), __oh323_new(), oh323_alloc(), find_call_locked(), build_alias(), update_common_options(), build_user(), realtime_user(), build_peer(), realtime_peer(), create_addr(), oh323_request(), receive_digit(), external_rtp_create(), setup_rtp_connection(), connection_made(), progress(), setup_incoming_call(), answer_call(), chan_ringing(), cleanup_connection(), handle_cli_h323_cycle_gk(), reload_config(), convertcap(), oh323_set_rtp_peer(), iax_error_output(), jb_error_output(), jb_warning_output(), iax2_dup_variable_datastore(), compress_subclass(), scheduled_destroy(), make_trunk(), store_by_transfercallno(), remove_by_transfercallno(), store_by_peercallno(), remove_by_peercallno(), peercnt_add(), build_callno_limits(), add_calltoken_ignore(), get_unused_callno(), replace_callno(), __find_callno(), try_firmware(), reload_firmware(), handle_error(), __attempt_transmit(), iax2_fixup(), __auto_congest(), handle_call_token(), iax2_call(), iax2_hangup(), iax2_bridge(), ast_iax2_new(), iax2_trunk_queue(), memcpy_decrypt(), memcpy_encrypt(), iax2_send(), check_access(), authenticate_verify(), register_verify(), authenticate(), authenticate_reply(), try_transfer(), complete_transfer(), iax2_ack_registry(), iax2_register(), reg_source_db(), update_registry(), registry_rerequest(), spawn_dp_lookup(), iax_park_thread(), iax_park(), socket_read(), socket_process_meta(), acf_iaxvar_write(), socket_process(), iax2_do_register(), iax2_prov_app(), __iax2_poke_noanswer(), iax2_poke_peer(), iax2_request(), start_network_thread(), check_srcaddr(), peer_set_srcaddr(), set_config(), cache_get_callno_locked(), find_cache(), iax2_exists(), iax2_canmatch(), iax2_matchmore(), iax2_exec(), acf_channel_read(), iax2_devicestate(), jingle_is_answered(), jingle_handle_dtmf(), jingle_hangup_farend(), jingle_create_candidates(), jingle_alloc(), jingle_new(), jingle_free_pvt(), jingle_newcall(), jingle_write(), jingle_indicate(), jingle_sendtext(), jingle_digit(), jingle_sendhtml(), jingle_call(), jingle_request(), jingle_show_channels(), jingle_parser(), jingle_create_member(), jingle_load_config(), local_setoption(), local_devicestate(), local_answer(), local_fixup(), local_call(), local_alloc(), local_new(), __mgcp_xmit(), dump_queue(), retrans_pkt(), send_request(), mgcp_call(), mgcp_rtp_read(), mgcp_write(), mgcp_fixup(), mgcp_senddigit_begin(), mgcp_senddigit_end(), mgcp_indicate(), mgcp_new(), find_subchannel_and_lock(), parse(), process_sdp(), add_header(), add_line(), init_resp(), init_req(), add_sdp(), handle_response(), mgcp_ss(), handle_hd_hf(), handle_request(), mgcpsock_read(), mgcp_request(), build_gateway(), mgcp_reload(), update_config(), read_config(), misdn_call(), misdn_answer(), misdn_digit_end(), misdn_indication(), misdn_hangup(), process_ast_dsp(), misdn_write(), misdn_bridge(), misdn_request(), misdn_send_text(), misdn_new(), import_ch(), add_in_calls(), add_out_calls(), cb_events(), misdn_facility_exec(), misdn_check_l2l1(), misdn_set_opt_exec(), chan_misdn_log(), nbs_call(), nbs_alloc(), nbs_hangup(), nbs_xwrite(), nbs_new(), nbs_request(), find_desc(), used_blocks(), soundcard_writeframe(), setformat(), oss_indicate(), oss_new(), oss_request(), console_cmd(), console_autoanswer(), store_boost(), store_mixer(), store_config(), phone_indicate(), phone_digit_end(), phone_call(), phone_hangup(), phone_setup(), phone_exception(), phone_read(), phone_write_buf(), phone_write(), phone_new(), phone_mini_packet(), mkif(), phone_request(), parse_gain_value(), __unload_module(), sip_cc_monitor_suspend(), dialog_ref_debug(), sip_threadinfo_create(), sip_tcptls_write(), sip_check_authtimeout(), _sip_tcp_helper_thread(), proxy_update(), __sip_xmit(), ast_sip_ouraddrfor(), __sip_reliable_xmit(), __sip_autodestruct(), sip_scheddestroy(), __sip_pretend_ack(), sip_setoption(), sip_queryoption(), sip_sendhtml(), register_peer_exten(), sip_call(), update_call_counter(), sip_hangup(), try_suggested_sip_codec(), sip_write(), sip_fixup(), sip_indicate(), sip_new(), sip_read(), sip_st_alloc(), sip_alloc(), process_via(), sip_register(), sip_subscribe_mwi(), parse_request(), find_sdp(), get_ip_and_port_from_sdp(), process_sdp_o(), process_sdp_c(), process_sdp_a_audio(), finalize_content(), add_content(), copy_header(), copy_via_headers(), set_destination(), respprep(), __transmit_response(), transmit_response_using_temp(), transmit_response_with_auth(), get_domain(), get_crypto_attrib(), transmit_response_with_t38_sdp(), add_cc_call_info_to_response(), transmit_response_with_sdp(), transmit_invite(), transmit_cc_notify(), transmit_state_notify(), manager_sipnotify(), sip_reregister(), sip_reg_timeout(), transmit_register(), transmit_refer(), transmit_request_with_auth(), __set_address_from_contact(), parse_register_contact(), check_auth(), get_rdnis(), get_destination(), get_refer_info(), get_also_info(), check_via(), check_user_full(), receive_message(), sip_dump_history(), handle_request_info(), sip_cli_notify(), reply_digest(), func_header_read(), func_check_sipdomain(), function_sippeer(), function_sipchaninfo_read(), parse_moved_contact(), handle_response_update(), cc_handle_publish_error(), handle_response_publish(), handle_response_invite(), handle_response_notify(), handle_response_subscribe(), handle_response_refer(), handle_response_register(), handle_response_peerpoke(), handle_response_info(), handle_response_message(), sip_park_thread(), sip_park(), handle_request_notify(), handle_request_options(), handle_invite_replaces(), do_magic_pickup(), handle_request_invite(), handle_request_bye(), pidf_validate_tuple(), pidf_validate_presence(), sip_pidf_validate(), cc_esc_publish_handler(), handle_request_publish(), handle_cc_subscribe(), handle_request_subscribe(), handle_request_register(), handle_incoming(), sipsock_read(), check_rtp_timeout(), restart_session_timer(), stop_session_timer(), start_session_timer(), proc_session_timer(), parse_minse(), parse_session_expires(), proc_422_rsp(), sip_poke_noanswer(), sip_poke_peer(), sip_request_call(), set_insecure_flags(), handle_t38_options(), handle_common_options(), add_sip_domain(), add_realm_authentication(), sip_dtmfmode(), sip_addheader(), sip_sipredirect(), setup_srtp(), process_crypto(), peer_iphash_cb(), get_button_template(), find_line_by_instance(), find_subchannel_by_instance_reference(), find_subchannel_by_reference(), find_speeddial_by_instance(), register_exten(), unregister_exten(), skinny_register(), transmit_response(), skinny_newcall(), skinny_ss(), skinny_call(), skinny_write(), skinny_fixup(), skinny_transfer(), skinny_indicate(), skinny_new(), handle_transfer_button(), handle_register_message(), handle_callforward_button(), handle_keypad_button_message(), handle_stimulus_message(), handle_offhook_message(), handle_onhook_message(), handle_capabilities_res_message(), handle_open_receive_channel_ack_message(), handle_enbloc_call_message(), handle_soft_key_event_message(), handle_message(), destroy_session(), get_input(), skinny_req_parse(), accept_thread(), skinny_request(), config_parse_variables(), config_line(), config_device(), config_load(), display_last_error(), send_client(), get_to_address(), close_client(), send_retransmit(), send_select_output(), rcv_mac_addr(), write_history(), swap_subs(), close_call(), unistim_ss(), start_rtp(), TransferCallStep1(), HandleCallOutgoing(), HandleCallIncoming(), unistim_do_senddigit(), key_call(), Keyfavorite(), OpenHistory(), process_request(), parsing(), channel_to_session(), unistim_call(), unistim_hangup(), unistim_answer(), unistimsock_read(), unistim_rtp_read(), unistim_write(), unistim_fixup(), in_band_indication(), unistim_indicate(), find_subchannel_by_name(), unistim_senddigit_end(), unistim_sendtext(), unistim_new(), unistim_request(), ParseBookmark(), finish_bookmark(), build_device(), kickptt(), hidthread(), find_desc_usb(), usbradio_text(), usbradio_write(), usbradio_read(), usbradio_fixup(), usbradio_indicate(), usbradio_new(), usbradio_request(), radio_tune(), store_rxdemod(), store_txmixa(), store_txmixb(), store_rxcdtype(), store_rxsdtype(), store_txtoctype(), xpmr_config(), ast_channel_register(), ast_best_codec(), __ast_channel_alloc_ap(), __ast_queue_frame(), ast_channel_destructor(), ast_hangup(), __ast_answer(), ast_waitfor_nandfds(), ast_waitfordigit_full(), __ast_read(), ast_indicate_data(), ast_prod(), ast_write(), set_format(), ast_call_forward(), __ast_request_and_dial(), ast_request(), ast_channel_make_compatible_helper(), __ast_channel_masquerade(), ast_set_owners_and_peers(), ast_do_masquerade(), ast_channel_bridge(), ast_channel_setoption(), ast_channel_queryoption(), tonepair_alloc(), tonepair_generator(), ast_get_group(), data_channels_provider_handler(), ast_channel_start_silence_generator(), ast_channel_stop_silence_generator(), party_name_build_data(), party_number_build_data(), party_subaddress_build_data(), party_id_build_data(), ast_connected_line_build_data(), ast_connected_line_parse_data(), ast_redirecting_build_data(), ast_redirecting_parse_data(), set_full_cmd(), ast_cli_perms_init(), __ast_cli_unregister(), __ast_cli_register(), parse_args(), ast_ais_clm_load_module(), ast_ais_clm_unload_module(), lintoulaw(), dahdi_write_frame(), dahdi_encoder_framein(), dahdi_encoder_frameout(), dahdi_decoder_framein(), dahdi_decoder_frameout(), dahdi_translate(), find_transcoders(), gsmtolin_framein(), lintogsm_framein(), ilbctolin_framein(), lpc10tolin_framein(), lintolpc10_framein(), resample_frame(), speextolin_framein(), parse_config(), ast_include_new(), process_text_line(), config_text_file_load(), read_config_maps(), ast_config_engine_register(), find_engine(), ast_config_internal_load(), console_video_start(), data_structure_compatible(), __ast_data_register(), __ast_data_unregister(), data_search_generate(), data_result_generate_node(), data_result_generate(), ast_data_get(), ast_data_retrieve(), dbinit(), ast_db_put(), ast_db_get(), ast_db_gettree(), devstate_cache_cb(), handle_devstate_change(), devstate_change_collector_cb(), ast_device_state_engine_init(), ast_enable_distributed_devstate(), dns_parse_answer(), ast_search_dns(), dnsmgr_refresh(), refresh_list(), dnsmgr_init(), mute_fragment(), store_digit(), __ast_dsp_call_progress(), ast_dsp_call_progress(), ast_dsp_silence(), ast_dsp_noise(), ast_dsp_process(), txt_callback(), blr_txt(), ebl_callback(), blr_ebl(), parse_ie(), parse_naptr(), enum_callback(), ast_get_enum(), private_enum_init(), ast_event_get_type_name(), ast_event_get_ie_type_name(), ast_event_get_ie_pltype(), ast_event_check_subscriber(), ast_event_subscribe_new(), ast_event_new(), ast_event_get_cached(), ast_event_queue_and_cache(), ast_event_queue(), evt_event_deliver_cb(), ast_event_cb(), add_publish_event(), add_subscribe_event(), build_event_channel(), subscribe_event_destroy(), event_channel_destroy(), ast_ais_evt_load_module(), ast_ais_evt_unload_module(), bridge_call_thread(), create_dynamic_parkinglot(), park_space_reserve(), park_call_full(), masq_park_call(), play_message_on_chan(), builtin_automonitor(), builtin_automixmonitor(), builtin_blindtransfer(), check_compat(), builtin_atxfer(), ast_register_feature(), register_group(), register_group_feature(), feature_exec_app(), feature_request_and_dial(), ast_channel_log(), set_bridge_features_on_config(), add_features_datastores(), clear_dialed_interfaces(), ast_bridge_call(), manage_parked_call(), manage_parkinglot(), park_call_exec(), parked_call_exec(), parkinglot_config_read(), parkinglot_activate(), build_parkinglot(), process_applicationmap_line(), process_config(), usage_context_add_ramp(), usage_context_add_spaces(), parkinglot_is_marked_cb(), parkinglot_activate_cb(), action_bridge(), ast_pickup_call(), ast_do_pickup(), ast_bridge_timelimit(), bridge_exec(), __ast_format_register(), ast_format_unregister(), ast_stopstream(), ast_writestream(), build_filename(), fn_wrapper(), ast_filehelper(), ast_openstream_full(), ast_openvstream(), ast_readaudio_callback(), ast_readvideo_callback(), ast_streamfile(), ast_readfile(), ast_writefile(), waitstream_core(), ast_format_str_reduce(), g719read(), g719write(), g723_read(), g723_write(), g726_read(), g726_write(), g729_read(), g729_write(), gsm_read(), gsm_write(), gsm_seek(), h263_open(), h263_read(), h263_write(), h264_open(), h264_read(), h264_write(), ilbc_read(), ilbc_write(), jpeg_read_image(), jpeg_write_image(), ogg_vorbis_open(), ogg_vorbis_rewrite(), write_stream(), ogg_vorbis_write(), read_samples(), ogg_vorbis_read(), ogg_vorbis_trunc(), ogg_vorbis_seek(), ogg_vorbis_tell(), pcm_read(), pcm_seek(), pcm_write(), check_header(), update_header(), write_header(), siren14read(), siren14write(), siren7read(), siren7write(), slinear_read(), slinear_write(), vox_read(), vox_write(), check_header_fmt(), wav_close(), wav_read(), wav_write(), wav_seek(), smoother_frame_feed(), __ast_smoother_feed(), ast_smoother_read(), ast_parse_allow_disallow(), g723_len(), speex_get_wb_sz_at(), speex_samples(), ast_codec_get_samples(), ast_codec_get_len(), ast_framehook_attach(), aes_helper(), func_inheritance_write(), base64_helper(), party_name_write(), party_number_write(), party_id_write(), callerpres_read(), callerpres_write(), callerid_read(), callerid_write(), connectedline_read(), connectedline_write(), redirecting_read(), redirecting_write(), func_channel_read(), func_channel_write_real(), func_channels_read(), config_function_read(), acf_curlopt_write(), acf_curlopt_helper(), acf_curl_helper(), cut_internal(), acf_sort_exec(), acf_cut_exec(), acf_cut_exec2(), function_db_read(), function_db_write(), function_db_exists(), function_db_delete(), devstate_write(), hint_read(), dialgroup_read(), dialgroup_write(), isexten_function_read(), function_enum(), enum_query_read(), enum_result_read(), function_txtcidname(), count_lines(), file2format(), file_read(), file_write(), extstate_read(), shared_read(), shared_write(), group_count_function_read(), group_function_write(), iconv_read(), get_lock(), unlock_read(), iftime(), acf_if(), set(), math(), crement_function_read(), md5(), generic_execute(), acf_odbc_write(), acf_odbc_read(), init_acf_query(), pitchshift_helper(), function_realtime_read(), function_realtime_write(), realtimefield_read(), function_realtime_store(), function_realtime_readdestroy(), sha1(), shell_helper(), speex_write(), speex_read(), acf_sprintf(), srv_datastore_setup(), srv_query_read(), srv_result_read(), function_fieldnum_helper(), listfilter(), filter(), replace(), regex(), quote(), csv_quote(), acf_strftime(), acf_strptime(), function_eval(), function_eval2(), shift_pop(), unshift_push(), sysinfo_helper(), timeout_read(), timeout_write(), uriencode(), uridecode(), volume_write(), ast_heap_create(), ast_http_send(), add_redirect(), __ast_http_load(), iax_frame_wrap(), iax_template_parse(), iax_process_template(), iax_provision_reload(), ast_read_image(), playtones_alloc(), playtones_generator(), ast_playtones_start(), handle_cli_indication_add(), handle_cli_indication_remove(), store_tone_zone_ring_cadence(), parse_tone_zone(), load_indications(), ast_io_remove(), load_dynamic_module(), ast_unload_resource(), ast_process_pending_reloads(), queue_reload_request(), ast_module_reload(), inspect_module(), load_resource(), load_resource_list(), load_modules(), inotify_daemon(), rotate_file(), logger_queue_restart(), logger_queue_init(), ast_bt_create(), ast_bt_get_symbols(), ast_backtrace(), __ast_verbose_ap(), ast_logger_register_level(), unref_mansession(), handle_updates(), action_hangup(), action_getvar(), action_command(), manager_modulecheck(), do_message(), session_do(), ast_manager_unregister(), ast_manager_register_struct(), process_output(), generic_http_callback(), auth_http_callback(), __init_manager(), _enum_array_map(), misdn_cfg_get(), misdn_cfg_is_msn_valid(), misdn_cfg_get_config_string(), misdn_cfg_update_ptp(), misdn_cfg_init(), ast_netsock_bindaddr(), ast_netsock_set_qos(), ast_sockaddr_stringify_fmt(), ast_sockaddr_split_hostport(), ast_sockaddr_parse(), ast_sockaddr_resolve(), _ast_sockaddr_port(), _ast_sockaddr_set_port(), ast_sockaddr_hash(), ast_set_qos(), _ast_sockaddr_to_sin(), _ast_sockaddr_from_sin(), pbx_exec(), update_scoreboard(), get_canmatch_exten(), new_find_extension(), add_exten_to_pattern_tree(), create_match_char_tree(), ext_cmp1(), _extension_match_core(), ast_extension_close(), pbx_find_extension(), __ast_custom_function_register(), func_args(), ast_func_read(), ast_func_read2(), ast_func_write(), ast_str_substitute_variables_full(), pbx_substitute_variables_helper_full(), pbx_extension_helper(), __ast_pbx_run(), increase_call_count(), ast_pbx_start(), ast_context_remove_extension_callerid2(), ast_register_application2(), ast_register_switch(), show_dialplan_helper(), manager_show_dialplan_helper(), ast_context_find_or_create(), context_merge(), get_range(), get_timerange(), ast_check_timing2(), ast_async_goto(), add_priority(), ast_add_extension2_lockopt(), async_wait(), ast_pbx_outgoing_exten(), ast_pbx_run_app(), ast_pbx_outgoing_app(), pbx_builtin_hangup(), pbx_builtin_gotoiftime(), pbx_builtin_execiftime(), pbx_builtin_waitexten(), pbx_builtin_background(), pbx_builtin_serialize_variables(), pbx_builtin_pushvar_helper(), pbx_builtin_setvar(), pbx_builtin_setvar_multiple(), pbx_builtin_importvar(), pbx_builtin_gotoif(), pbx_builtin_saynumber(), load_pbx(), ast_context_verify_includes(), pbx_parseable_goto(), pbx_load_module(), complete_dialplan_remove_include(), complete_dialplan_remove_extension(), complete_dialplan_add_include(), complete_dialplan_add_extension(), complete_dialplan_add_ignorepat(), complete_dialplan_remove_ignorepat(), pbx_load_config(), pbx_load_users(), dundi_error_output(), dundi_answer_entity(), dundi_prop_precache(), dundi_answer_query(), update_key(), dundi_encrypt(), check_key(), handle_command_response(), ack_trans(), dundi_xmit(), destroy_trans(), dundi_rexmit(), dundi_send(), do_autokill(), dundi_discover(), precache_trans(), dundi_query(), precache_transactions(), dundi_lookup_internal(), dundi_precache_full(), dundi_precache_internal(), dundifunc_read(), dundi_query_read(), dundi_result_read(), build_mapping(), do_register(), dundi_helper(), dundi_exec(), lua_get_state(), exists(), canmatch(), matchmore(), exec(), lua_find_extension(), load_or_reload_lua_stuff(), realtime_exec(), apply_outgoing(), safe_append(), remove_from_queue(), attempt_thread(), launch_service(), scan_service(), queue_file(), scan_thread(), ael2_print(), check_macro_returns(), extension_matches(), check_expr2_input(), check_includes(), check_timerange(), check_dow(), check_day(), check_month(), check_break(), check_continue(), check_label(), check_goto(), find_pval_goto_item(), check_app_args(), check_switch_expr(), check_context_names(), check_abstract_reference(), check_pval_item(), add_extensions(), destroy_pval_item(), pvalCheckType(), pvalGlobalsAddStatement(), pvalTopLevAddObject(), adsi_careful_send(), __adsi_transmit_messages(), ast_adsi_transmit_message_full(), ast_adsi_get_cpeid(), ast_adsi_get_cpeinfo(), ast_adsi_load_session(), ast_agi_send(), get_agi_cmd(), add_agi_cmd(), add_to_agi(), launch_asyncagi(), launch_netscript(), launch_ha_netscript(), launch_script(), handle_getoption(), handle_recordfile(), handle_exec(), ast_agi_register(), ast_agi_unregister(), run_agi(), agi_exec_full(), eagi_exec(), deadagi_exec(), dispatch_thread_handler(), build_calendar(), load_tech_calendars(), ast_calendar_register(), do_notify(), calendar_event_notify(), calendar_devstate_change(), calendar_busy_exec(), add_event_to_list(), calendar_query_exec(), calendar_join_attendees(), calendar_query_result_exec(), calendar_write_exec(), calendar_event_read(), auth_credentials(), caldav_request(), caldav_write_event(), caldav_get_events_between(), caldav_add_event(), caldav_load_calendar(), ssl_verify(), startelm(), cdata(), endelm(), send_ews_request_and_parse(), get_ewscal_ids_for(), ewscal_load_calendar(), parse_tag(), exchangecal_request(), exchangecal_write_event(), exchangecal_get_events_between(), exchangecal_load_calendar(), fetch_icalendar(), icalendar_add_event(), icalendar_update_events(), ical_load_calendar(), handle_orig(), realtime_curl(), realtime_multi_curl(), update_curl(), update2_curl(), store_curl(), destroy_curl(), require_curl(), config_curl(), reload_module(), ldap_loadentry(), realtime_ldap_base_ap(), realtime_multi_ldap(), config_ldap(), update_ldap(), update2_ldap(), ldap_reconnect(), custom_prepare(), realtime_odbc(), realtime_multi_odbc(), update_odbc(), update2_prepare(), update2_odbc(), store_odbc(), destroy_odbc(), config_odbc(), require_odbc(), find_table(), realtime_pgsql(), realtime_multi_pgsql(), update_pgsql(), update2_pgsql(), store_pgsql(), destroy_pgsql(), config_pgsql(), require_pgsql(), pgsql_reconnect(), set_var(), check_vars(), cdr_handler(), add_cfg_entry(), config_handler(), get_params(), realtime_handler(), add_rt_multi_cfg_entry(), realtime_multi_handler(), realtime_update_handler(), realtime_update2_handler(), realtime_store_handler(), realtime_destroy_handler(), realtime_require_handler(), pw_cb(), try_load_key(), ast_sign_bin(), ast_decrypt_bin(), ast_encrypt_bin(), ast_check_signature_bin(), ast_check_signature(), crypto_load(), find_details(), find_or_create_details(), update_modem_bits(), ast_fax_state_to_str(), ast_fax_log(), fax_rate_str_to_int(), fax_session_reserve(), fax_session_new(), set_fax_t38_caps(), disable_t38(), generic_fax_exec(), receivefax_t38_init(), receivefax_exec(), sendfax_t38_init(), sendfax_exec(), cli_fax_show_session(), cli_fax_show_sessions(), acf_faxopt_read(), acf_faxopt_write(), update_stats(), spandsp_log(), spandsp_fax_new(), spandsp_fax_write(), spandsp_fax_start(), post_raw(), process_message_callback(), readmimefile(), http_post_callback(), aji_find_version(), aji_status_exec(), acf_jabberstatus_read(), acf_jabberreceive_read(), delete_old_messages(), aji_join_exec(), aji_leave_exec(), aji_send_exec(), aji_sendgroup_exec(), aji_recv(), aji_send_raw(), aji_start_sasl(), aji_act_hook(), aji_register_approve_handler(), aji_register_query_handler(), aji_ditems_handler(), aji_client_info_handler(), aji_dinfo_handler(), aji_handle_message(), aji_handle_presence(), aji_handle_subscribe(), aji_send_raw_chat(), ast_aji_create_chat(), ast_aji_invite_chat(), aji_recv_loop(), aji_pruneregister(), aji_client_connect(), aji_initialize(), aji_mwi_cb(), aji_devstate_cb(), aji_handle_pubsub_event(), aji_handle_pubsub_error(), aji_delete_node_list(), aji_set_presence(), aji_set_group_presence(), aji_create_client(), aji_create_buddy(), aji_load_config(), aji_reload(), ast_monitor_start(), ast_monitor_stop(), ast_monitor_change_fname(), start_monitor_exec(), moh_files_release(), ast_moh_files_next(), moh_files_generator(), moh_files_alloc(), spawn_mp3(), monmp3thread(), play_moh_exec(), wait_moh_exec(), set_moh_exec(), start_moh_exec(), _get_mohbyname(), mohalloc(), moh_release(), moh_alloc(), moh_generate(), moh_scan_files(), init_app_class(), _moh_register(), local_ast_moh_cleanup(), local_ast_moh_start(), moh_class_destructor(), load_moh_classes(), mute_add_audiohook(), find_transaction(), ast_odbc_find_table(), ast_odbc_direct_execute(), ast_odbc_prepare_and_execute(), ast_odbc_smart_execute(), ast_odbc_sanity_check(), load_odbc_config(), odbc_register_class(), odbc_release_obj2(), commit_exec(), rollback_exec(), _ast_odbc_request_obj2(), odbc_obj_disconnect(), odbc_obj_connect(), acf_transaction_write(), lookup_iface(), phoneprov_callback(), build_route(), add_user_extension(), pp_each_extension_helper(), cops_sendmsg(), ast_pktccops_gate_alloc(), cops_gate_cmd(), cops_connect(), do_pktccops(), restart_pktc_thread(), load_pktccops_config(), pktccops_add_ippool(), create_new_socket(), ast_rtp_new(), ast_rtp_dtmf_begin(), ast_rtp_dtmf_continuation(), ast_rtp_dtmf_end_with_duration(), ast_rtcp_write_rr(), ast_rtcp_write_sr(), ast_rtp_write(), process_dtmf_rfc2833(), process_cn_rfc3389(), ast_rtcp_read(), bridge_p2p_rtp_write(), ast_rtp_read(), ast_rtp_sendcng(), rtp_reload(), multicast_send_control_packet(), multicast_rtp_write(), append_ie(), smdi_toggle_mwi(), purge_old_messages(), smdi_read(), smdi_load(), smdi_msg_retrieve_read(), smdi_msg_read(), ast_speech_register(), res_srtp_new(), ast_srtp_policy_alloc(), policy_set_suite(), ast_srtp_unprotect(), ast_srtp_protect(), ast_srtp_change_source(), stun_monitor_request(), stun_stop_monitor(), stun_start_monitor(), dahdi_timer_set_rate(), dahdi_test_timer(), _lookup_timer(), kqueue_timer_open(), pthread_timer_set_rate(), read_pipe(), write_byte(), init_timing_thread(), timerfd_timer_open(), timerfd_timer_close(), timerfd_timer_set_rate(), timerfd_timer_ack(), timerfd_timer_enable_continuous(), timerfd_timer_disable_continuous(), timerfd_timer_get_event(), ast_rtp_engine_register2(), ast_rtp_glue_register2(), ast_rtp_instance_new(), remote_bridge_loop(), ast_rtp_instance_bridge(), ast_rtp_instance_early_bridge(), wait_file(), say_number_full(), ast_say_number_full_pt(), ast_say_number_full_se(), ast_say_number_full_zh(), ast_say_number_full_ur(), ast_say_enumeration_full_he(), say_date(), say_date_with_format(), ast_say_date_with_format_en(), ast_say_date_with_format_da(), ast_say_date_with_format_de(), ast_say_date_with_format_th(), ast_say_date_with_format_he(), ast_say_date_with_format_es(), ast_say_date_with_format_fr(), ast_say_date_with_format_it(), ast_say_date_with_format_nl(), ast_say_date_with_format_pl(), ast_say_date_with_format_pt(), ast_say_date_with_format_zh(), say_time(), say_datetime(), say_datetime_from_now(), ast_say_date_with_format_gr(), ast_say_date_with_format_vi(), ast_sched_thread_create(), schedule(), ast_sched_del(), ast_sched_runq(), check_event_type(), add_ie(), ast_security_event_report(), _analog_get_index(), analog_attempt_transfer(), analog_request(), analog_call(), analog_hangup(), analog_answer(), __analog_ss_thread(), __analog_handle_event(), analog_exception(), analog_handle_init_event(), sig_pri_get_orig_dialstring(), sig_pri_request(), pri_active_dchan_index(), pri_find_dchan(), pri_fixup_principle(), pri_find_fixup_principle(), pri_check_restart(), do_idle_thread(), pri_ss_thread(), sig_pri_handle_subcmds(), pri_dchannel(), sig_pri_hangup(), sig_pri_call(), sig_pri_indicate(), sig_pri_digit_begin(), sig_pri_start_pri(), pri_send_callrerouting_facility_exec(), ss7_handle_cqm(), ss7_start_call(), ss7_linkset(), sig_ss7_add_sigchan(), sig_ss7_call(), sig_ss7_hangup(), sig_ss7_answer(), ast_slinfactory_feed(), parse_srv(), ssl_lock(), ast_stun_request(), ast_tps_init(), tps_processing_function(), tps_taskprocessor_destroy(), tps_taskprocessor_pop(), ast_taskprocessor_name(), ast_taskprocessor_get(), ast_taskprocessor_push(), ast_tcptls_server_read(), ast_tcptls_server_write(), handle_tcptls_connection(), ast_tcptls_server_root(), ast_tcptls_client_start(), ast_tcptls_client_create(), ast_tcptls_server_start(), ast_tls_read_conf(), tdd_new(), tdd_feed(), powerof(), framein(), ast_translator_build_path(), calc_cost(), __ast_register_translator(), ast_translate_path_steps(), encode_open_type(), ast_udptl_read(), calculate_local_max_datagram(), calculate_far_max_ifp(), ast_udptl_new_with_bindaddr(), ast_udptl_write(), ast_udptl_proto_register(), ast_udptl_bridge(), __ast_udptl_reload(), ast_ulaw_init(), ast_pthread_create_stack(), ast_pthread_create_detached_stack(), ast_wait_for_output(), ast_carefulwrite(), ast_careful_fwrite(), tvfix(), __ast_string_field_init(), ast_enable_packet_fragmentation(), ast_parse_digest(), create_video_frame(), fbuf_append(), h263p_encap(), h263p_decap(), ffmpeg_encode(), ffmpeg_decode(), h263_encap(), h263_decap(), h261_decap(), mpeg4_decode(), h264_encap(), h264_decap(), map_video_codec(), dec_init(), xmldoc_string_wrap(), xmldoc_string_cleanup(), xmldoc_get_syntax_fun(), xmldoc_build_field(), and ast_xmldoc_load_documentation().
{
struct logmsg *logmsg = NULL;
struct ast_str *buf = NULL;
struct ast_tm tm;
struct timeval now = ast_tvnow();
int res = 0;
va_list ap;
char datestring[256];
if (!(buf = ast_str_thread_get(&log_buf, LOG_BUF_INIT_SIZE)))
return;
if (level != __LOG_VERBOSE && AST_RWLIST_EMPTY(&logchannels)) {
/*
* we don't have the logger chain configured yet,
* so just log to stdout
*/
int result;
va_start(ap, fmt);
result = ast_str_set_va(&buf, BUFSIZ, fmt, ap); /* XXX BUFSIZ ? */
va_end(ap);
if (result != AST_DYNSTR_BUILD_FAILED) {
term_filter_escapes(ast_str_buffer(buf));
fputs(ast_str_buffer(buf), stdout);
}
return;
}
/* don't display LOG_DEBUG messages unless option_verbose _or_ option_debug
are non-zero; LOG_DEBUG messages can still be displayed if option_debug
is zero, if option_verbose is non-zero (this allows for 'level zero'
LOG_DEBUG messages to be displayed, if the logmask on any channel
allows it)
*/
if (!option_verbose && !option_debug && (level == __LOG_DEBUG))
return;
/* Ignore anything that never gets logged anywhere */
if (level != __LOG_VERBOSE && !(global_logmask & (1 << level)))
return;
/* Build string */
va_start(ap, fmt);
res = ast_str_set_va(&buf, BUFSIZ, fmt, ap);
va_end(ap);
/* If the build failed, then abort and free this structure */
if (res == AST_DYNSTR_BUILD_FAILED)
return;
/* Create a new logging message */
if (!(logmsg = ast_calloc_with_stringfields(1, struct logmsg, res + 128)))
return;
/* Copy string over */
ast_string_field_set(logmsg, message, ast_str_buffer(buf));
/* Set type */
if (level == __LOG_VERBOSE) {
logmsg->type = LOGMSG_VERBOSE;
} else {
logmsg->type = LOGMSG_NORMAL;
}
/* Create our date/time */
ast_localtime(&now, &tm, NULL);
ast_strftime(datestring, sizeof(datestring), dateformat, &tm);
ast_string_field_set(logmsg, date, datestring);
/* Copy over data */
logmsg->level = level;
logmsg->line = line;
ast_string_field_set(logmsg, level_name, levels[level]);
ast_string_field_set(logmsg, file, file);
ast_string_field_set(logmsg, function, function);
logmsg->process_id = (long) GETTID();
/* If the logger thread is active, append it to the tail end of the list - otherwise skip that step */
if (logthread != AST_PTHREADT_NULL) {
AST_LIST_LOCK(&logmsgs);
AST_LIST_INSERT_TAIL(&logmsgs, logmsg, list);
ast_cond_signal(&logcond);
AST_LIST_UNLOCK(&logmsgs);
} else {
logger_print_normal(logmsg);
ast_free(logmsg);
}
return;
}
| static void ast_log_vsyslog | ( | struct logmsg * | msg | ) | [static] |
Definition at line 945 of file logger.c.
References ast_syslog_priority_from_loglevel(), logmsg::level, levels, logmsg::process_id, logmsg::file, logmsg::line, logmsg::function, logmsg::message, and term_strip().
Referenced by logger_print_normal().
{
char buf[BUFSIZ];
int syslog_level = ast_syslog_priority_from_loglevel(msg->level);
if (syslog_level < 0) {
/* we are locked here, so cannot ast_log() */
fprintf(stderr, "ast_log_vsyslog called with bogus level: %d\n", msg->level);
return;
}
snprintf(buf, sizeof(buf), "%s[%ld]: %s:%d in %s: %s",
levels[msg->level], msg->process_id, msg->file, msg->line, msg->function, msg->message);
term_strip(buf, buf, strlen(buf) + 1);
syslog(syslog_level, "%s", buf);
}
| int ast_logger_register_level | ( | const char * | name | ) |
Register a new logger level.
| name | The name of the level to be registered |
| -1 | if an error occurs |
| non-zero | level to be used with ast_log for sending messages to this level |
Definition at line 1594 of file logger.c.
References available(), AST_RWLIST_WRLOCK, ARRAY_LEN, levels, ast_log(), LOG_WARNING, AST_RWLIST_UNLOCK, ast_strdup, ast_debug, and update_logchannels().
Referenced by ast_cc_init(), and load_module().
{
unsigned int level;
unsigned int available = 0;
AST_RWLIST_WRLOCK(&logchannels);
for (level = 0; level < ARRAY_LEN(levels); level++) {
if ((level >= 16) && !available && !levels[level]) {
available = level;
continue;
}
if (levels[level] && !strcasecmp(levels[level], name)) {
ast_log(LOG_WARNING,
"Unable to register dynamic logger level '%s': a standard logger level uses that name.\n",
name);
AST_RWLIST_UNLOCK(&logchannels);
return -1;
}
}
if (!available) {
ast_log(LOG_WARNING,
"Unable to register dynamic logger level '%s'; maximum number of levels registered.\n",
name);
AST_RWLIST_UNLOCK(&logchannels);
return -1;
}
levels[available] = ast_strdup(name);
AST_RWLIST_UNLOCK(&logchannels);
ast_debug(1, "Registered dynamic logger level '%s' with index %d.\n", name, available);
update_logchannels();
return available;
}
| void ast_logger_unregister_level | ( | const char * | name | ) |
Unregister a previously registered logger level.
| name | The name of the level to be unregistered |
Definition at line 1637 of file logger.c.
References AST_RWLIST_WRLOCK, ARRAY_LEN, levels, free, AST_RWLIST_UNLOCK, ast_debug, and update_logchannels().
Referenced by unload_module(), and load_module().
{
unsigned int found = 0;
unsigned int x;
AST_RWLIST_WRLOCK(&logchannels);
for (x = 16; x < ARRAY_LEN(levels); x++) {
if (!levels[x]) {
continue;
}
if (strcasecmp(levels[x], name)) {
continue;
}
found = 1;
break;
}
if (found) {
/* take this level out of the global_logmask, to ensure that no new log messages
* will be queued for it
*/
global_logmask &= ~(1 << x);
free(levels[x]);
levels[x] = NULL;
AST_RWLIST_UNLOCK(&logchannels);
ast_debug(1, "Unregistered dynamic logger level '%s' with index %d.\n", name, x);
update_logchannels();
} else {
AST_RWLIST_UNLOCK(&logchannels);
}
}
| void ast_queue_log | ( | const char * | queuename, |
| const char * | callid, | ||
| const char * | agent, | ||
| const char * | event, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
Definition at line 475 of file logger.c.
References AST_RWLIST_WRLOCK, logger_queue_init(), AST_RWLIST_UNLOCK, ast_queue_log(), ast_check_realtime(), ast_tvnow(), ast_localtime(), ast_strftime(), logfiles, AST_DECLARE_APP_ARGS, args, AST_APP_ARG, AST_NONSTANDARD_APP_ARGS, ast_realtime_require_field(), RQ_CHAR, S_OR, SENTINEL, ast_store_realtime(), qlog, and AST_RWLIST_RDLOCK.
Referenced by rt_handle_member_record(), find_queue_by_name_rt(), update_realtime_members(), rna(), wait_our_turn(), queue_transfer_fixup(), try_calling(), set_member_paused(), set_member_penalty(), rqm_exec(), aqm_exec(), ql_exec(), queue_exec(), manager_add_queue_member(), manager_remove_queue_member(), manager_queue_log_custom(), handle_queue_add_member(), handle_queue_remove_member(), login_exec(), ast_queue_log(), and reload_logger().
{
va_list ap;
struct timeval tv;
struct ast_tm tm;
char qlog_msg[8192];
int qlog_len;
char time_str[30];
if (!logger_initialized) {
/* You are too early. We are not open yet! */
return;
}
if (!queuelog_init) {
AST_RWLIST_WRLOCK(&logchannels);
if (!queuelog_init) {
/*
* We have delayed initializing the queue logging system so
* preloaded realtime modules can get up. We must initialize
* now since someone is trying to log something.
*/
logger_queue_init();
queuelog_init = 1;
AST_RWLIST_UNLOCK(&logchannels);
ast_queue_log("NONE", "NONE", "NONE", "QUEUESTART", "%s", "");
} else {
AST_RWLIST_UNLOCK(&logchannels);
}
}
if (ast_check_realtime("queue_log")) {
tv = ast_tvnow();
ast_localtime(&tv, &tm, NULL);
ast_strftime(time_str, sizeof(time_str), "%F %T.%6q", &tm);
va_start(ap, fmt);
vsnprintf(qlog_msg, sizeof(qlog_msg), fmt, ap);
va_end(ap);
if (logfiles.queue_adaptive_realtime) {
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(data)[5];
);
AST_NONSTANDARD_APP_ARGS(args, qlog_msg, '|');
/* Ensure fields are large enough to receive data */
ast_realtime_require_field("queue_log",
"data1", RQ_CHAR, strlen(S_OR(args.data[0], "")),
"data2", RQ_CHAR, strlen(S_OR(args.data[1], "")),
"data3", RQ_CHAR, strlen(S_OR(args.data[2], "")),
"data4", RQ_CHAR, strlen(S_OR(args.data[3], "")),
"data5", RQ_CHAR, strlen(S_OR(args.data[4], "")),
SENTINEL);
/* Store the log */
ast_store_realtime("queue_log", "time", time_str,
"callid", callid,
"queuename", queuename,
"agent", agent,
"event", event,
"data1", S_OR(args.data[0], ""),
"data2", S_OR(args.data[1], ""),
"data3", S_OR(args.data[2], ""),
"data4", S_OR(args.data[3], ""),
"data5", S_OR(args.data[4], ""),
SENTINEL);
} else {
ast_store_realtime("queue_log", "time", time_str,
"callid", callid,
"queuename", queuename,
"agent", agent,
"event", event,
"data", qlog_msg,
SENTINEL);
}
if (!logfiles.queue_log_to_file) {
return;
}
}
if (qlog) {
va_start(ap, fmt);
qlog_len = snprintf(qlog_msg, sizeof(qlog_msg), "%ld|%s|%s|%s|%s|", (long)time(NULL), callid, queuename, agent, event);
vsnprintf(qlog_msg + qlog_len, sizeof(qlog_msg) - qlog_len, fmt, ap);
va_end(ap);
AST_RWLIST_RDLOCK(&logchannels);
if (qlog) {
fprintf(qlog, "%s\n", qlog_msg);
fflush(qlog);
}
AST_RWLIST_UNLOCK(&logchannels);
}
}
| int ast_register_verbose | ( | void(*)(const char *string) | v | ) |
Definition at line 1544 of file logger.c.
References ast_malloc, verb::verboser, AST_RWLIST_WRLOCK, AST_RWLIST_INSERT_HEAD, logchannel::list, and AST_RWLIST_UNLOCK.
Referenced by ast_makesocket(), and main().
{
struct verb *verb;
if (!(verb = ast_malloc(sizeof(*verb))))
return -1;
verb->verboser = v;
AST_RWLIST_WRLOCK(&verbosers);
AST_RWLIST_INSERT_HEAD(&verbosers, verb, list);
AST_RWLIST_UNLOCK(&verbosers);
return 0;
}
| int ast_unregister_verbose | ( | void(*)(const char *string) | v | ) |
Definition at line 1560 of file logger.c.
References AST_RWLIST_WRLOCK, AST_RWLIST_TRAVERSE_SAFE_BEGIN, logchannel::list, verb::verboser, AST_RWLIST_REMOVE_CURRENT, ast_free, AST_RWLIST_TRAVERSE_SAFE_END, and AST_RWLIST_UNLOCK.
{
struct verb *cur;
AST_RWLIST_WRLOCK(&verbosers);
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&verbosers, cur, list) {
if (cur->verboser == v) {
AST_RWLIST_REMOVE_CURRENT(list);
ast_free(cur);
break;
}
}
AST_RWLIST_TRAVERSE_SAFE_END;
AST_RWLIST_UNLOCK(&verbosers);
return cur ? 0 : -1;
}
| void ast_verbose | ( | const char * | fmt, |
| ... | |||
| ) |
Definition at line 1535 of file logger.c.
References __ast_verbose_ap().
Referenced by dumpchan_exec(), ivr_demo_func(), conf_run(), mdc1200_notify(), load_rpt_vars(), attempt_reconnect(), rpt(), rpt_exec(), verbose_exec(), dialout(), play_record_review(), ast_set_priority(), quit_handler(), ast_remotecontrol(), ast_readconfig(), main(), ao2_bt(), __ast_bridge_technology_register(), ast_bridge_technology_unregister(), __agent_start_monitoring(), alsa_digit(), alsa_text(), alsa_call(), alsa_answer(), alsa_hangup(), alsa_indicate(), console_answer(), dahdi_ss7_message(), dahdi_pri_message(), dahdi_softhangup_all(), find_gtalk(), gtalk_handle_dtmf(), h323_reload(), iax_debug_output(), jb_debug_output(), timing_read(), jingle_handle_dtmf(), mgcp_reload(), handle_cli_misdn_send_facility(), oss_digit_end(), oss_text(), oss_call(), oss_answer(), oss_hangup(), oss_indicate(), phone_exception(), phone_check_exception(), initialize_initreq(), retrans_pkt(), sip_scheddestroy(), send_response(), send_request(), sip_sendtext(), __sip_destroy(), sip_rtp_read(), sip_read(), process_sdp(), process_sdp_a_audio(), process_sdp_a_video(), process_sdp_a_text(), set_destination(), add_codec_to_sdp(), add_vcodec_to_sdp(), add_tcodec_to_sdp(), add_noncodec_to_sdp(), add_sdp(), transmit_register(), auth_headers(), parse_register_contact(), list_route(), get_rdnis(), get_destination(), get_refer_info(), get_also_info(), check_via(), check_peer_ok(), receive_message(), handle_request_info(), do_register_auth(), handle_response(), handle_request_invite(), handle_request_refer(), handle_request_message(), handle_request_subscribe(), handle_incoming(), handle_request_do(), sip_reload(), load_module(), transmit_softkeysetres(), handle_transfer_button(), handle_offhook_message(), setformat(), usbradio_digit_end(), usbradio_text(), usbradio_indicate(), find_transcoders(), handle_frame(), ast_frame_dump(), hook_event_cb(), print_frame(), timeout_write(), ast_module_reload(), start_resource(), astman_append(), dundi_debug_output(), ast_agi_send(), run_agi(), load_config(), aji_log_hook(), aji_handle_presence(), aji_handle_subscribe(), aji_receive_node_list(), aji_test(), moh_files_release(), init_files_class(), ast_rtp_dtmf_begin(), ast_rtp_dtmf_continuation(), ast_rtp_dtmf_end_with_duration(), ast_rtcp_write_rr(), ast_rtcp_write_sr(), ast_rtp_raw_write(), process_dtmf_rfc2833(), ast_rtcp_read(), bridge_p2p_rtp_write(), ast_rtp_read(), ast_rtp_sendcng(), ast_say_number_full_he(), ast_say_enumeration_full_he(), pri_dchannel(), ss7_reset_linkset(), ss7_linkset(), __ast_str_helper(), stun_process_attr(), and ast_stun_handle_packet().
{
va_list ap;
va_start(ap, fmt);
__ast_verbose_ap("", 0, "", fmt, ap);
va_end(ap);
}
| void close_logger | ( | void | ) |
Provided by logger.c
Definition at line 1147 of file logger.c.
References f, AST_LIST_LOCK, close_logger_thread, ast_cond_signal, logcond, AST_LIST_UNLOCK, logthread, AST_PTHREADT_NULL, AST_RWLIST_WRLOCK, qlog, AST_RWLIST_TRAVERSE, logchannel::list, logchannel::fileptr, and AST_RWLIST_UNLOCK.
Referenced by quit_handler().
{
struct logchannel *f = NULL;
logger_initialized = 0;
/* Stop logger thread */
AST_LIST_LOCK(&logmsgs);
close_logger_thread = 1;
ast_cond_signal(&logcond);
AST_LIST_UNLOCK(&logmsgs);
if (logthread != AST_PTHREADT_NULL)
pthread_join(logthread, NULL);
AST_RWLIST_WRLOCK(&logchannels);
if (qlog) {
fclose(qlog);
qlog = NULL;
}
AST_RWLIST_TRAVERSE(&logchannels, f, list) {
if (f->fileptr && (f->fileptr != stdout) && (f->fileptr != stderr)) {
fclose(f->fileptr);
f->fileptr = NULL;
}
}
closelog(); /* syslog */
AST_RWLIST_UNLOCK(&logchannels);
return;
}
| static char* handle_logger_reload | ( | struct ast_cli_entry * | e, |
| int | cmd, | ||
| struct ast_cli_args * | a | ||
| ) | [static] |
Definition at line 801 of file logger.c.
References CLI_INIT, ast_cli_entry::command, ast_cli_entry::usage, CLI_GENERATE, reload_logger(), ast_cli(), ast_cli_args::fd, CLI_FAILURE, and CLI_SUCCESS.
{
switch (cmd) {
case CLI_INIT:
e->command = "logger reload";
e->usage =
"Usage: logger reload\n"
" Reloads the logger subsystem state. Use after restarting syslogd(8) if you are using syslog logging.\n";
return NULL;
case CLI_GENERATE:
return NULL;
}
if (reload_logger(0)) {
ast_cli(a->fd, "Failed to reload the logger\n");
return CLI_FAILURE;
}
return CLI_SUCCESS;
}
| static char* handle_logger_rotate | ( | struct ast_cli_entry * | e, |
| int | cmd, | ||
| struct ast_cli_args * | a | ||
| ) | [static] |
Definition at line 820 of file logger.c.
References CLI_INIT, ast_cli_entry::command, ast_cli_entry::usage, CLI_GENERATE, reload_logger(), ast_cli(), ast_cli_args::fd, CLI_FAILURE, and CLI_SUCCESS.
{
switch (cmd) {
case CLI_INIT:
e->command = "logger rotate";
e->usage =
"Usage: logger rotate\n"
" Rotates and Reopens the log files.\n";
return NULL;
case CLI_GENERATE:
return NULL;
}
if (reload_logger(1)) {
ast_cli(a->fd, "Failed to reload the logger and rotate log files\n");
return CLI_FAILURE;
}
return CLI_SUCCESS;
}
| static char* handle_logger_set_level | ( | struct ast_cli_entry * | e, |
| int | cmd, | ||
| struct ast_cli_args * | a | ||
| ) | [static] |
Definition at line 839 of file logger.c.
References state, CLI_INIT, ast_cli_entry::command, ast_cli_entry::usage, CLI_GENERATE, ast_cli_args::argc, CLI_SHOWUSAGE, AST_RWLIST_WRLOCK, ARRAY_LEN, levels, ast_cli_args::argv, AST_RWLIST_UNLOCK, ast_true(), ast_console_toggle_loglevel(), ast_cli_args::fd, ast_cli(), and CLI_SUCCESS.
{
int x;
int state;
int level = -1;
switch (cmd) {
case CLI_INIT:
e->command = "logger set level {DEBUG|NOTICE|WARNING|ERROR|VERBOSE|DTMF} {on|off}";
e->usage =
"Usage: logger set level {DEBUG|NOTICE|WARNING|ERROR|VERBOSE|DTMF} {on|off}\n"
" Set a specific log level to enabled/disabled for this console.\n";
return NULL;
case CLI_GENERATE:
return NULL;
}
if (a->argc < 5)
return CLI_SHOWUSAGE;
AST_RWLIST_WRLOCK(&logchannels);
for (x = 0; x < ARRAY_LEN(levels); x++) {
if (levels[x] && !strcasecmp(a->argv[3], levels[x])) {
level = x;
break;
}
}
AST_RWLIST_UNLOCK(&logchannels);
state = ast_true(a->argv[4]) ? 1 : 0;
if (level != -1) {
ast_console_toggle_loglevel(a->fd, level, state);
ast_cli(a->fd, "Logger status for '%s' has been set to '%s'.\n", levels[level], state ? "on" : "off");
} else
return CLI_SHOWUSAGE;
return CLI_SUCCESS;
}
| static char* handle_logger_show_channels | ( | struct ast_cli_entry * | e, |
| int | cmd, | ||
| struct ast_cli_args * | a | ||
| ) | [static] |
CLI command to show logging system configuration.
Definition at line 882 of file logger.c.
References CLI_INIT, ast_cli_entry::command, ast_cli_entry::usage, CLI_GENERATE, ast_cli(), ast_cli_args::fd, FORMATL, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, logchannel::list, logchannel::filename, logchannel::type, LOGTYPE_CONSOLE, LOGTYPE_SYSLOG, logchannel::disabled, ARRAY_LEN, levels, logchannel::logmask, AST_RWLIST_UNLOCK, and CLI_SUCCESS.
{
#define FORMATL "%-35.35s %-8.8s %-9.9s "
struct logchannel *chan;
switch (cmd) {
case CLI_INIT:
e->command = "logger show channels";
e->usage =
"Usage: logger show channels\n"
" List configured logger channels.\n";
return NULL;
case CLI_GENERATE:
return NULL;
}
ast_cli(a->fd, FORMATL, "Channel", "Type", "Status");
ast_cli(a->fd, "Configuration\n");
ast_cli(a->fd, FORMATL, "-------", "----", "------");
ast_cli(a->fd, "-------------\n");
AST_RWLIST_RDLOCK(&logchannels);
AST_RWLIST_TRAVERSE(&logchannels, chan, list) {
unsigned int level;
ast_cli(a->fd, FORMATL, chan->filename, chan->type == LOGTYPE_CONSOLE ? "Console" : (chan->type == LOGTYPE_SYSLOG ? "Syslog" : "File"),
chan->disabled ? "Disabled" : "Enabled");
ast_cli(a->fd, " - ");
for (level = 0; level < ARRAY_LEN(levels); level++) {
if ((chan->logmask & (1 << level)) && levels[level]) {
ast_cli(a->fd, "%s ", levels[level]);
}
}
ast_cli(a->fd, "\n");
}
AST_RWLIST_UNLOCK(&logchannels);
ast_cli(a->fd, "\n");
return CLI_SUCCESS;
}
| int init_logger | ( | void | ) |
Provided by logger.c
Definition at line 1123 of file logger.c.
References handle_SIGXFSZ, ast_cond_init, logcond, ast_pthread_create, logthread, logger_thread(), ast_cond_destroy, ast_cli_register_multiple(), cli_logger, ARRAY_LEN, ast_mkdir(), ast_config_AST_LOG_DIR, and init_logger_chain().
Referenced by main().
{
/* auto rotate if sig SIGXFSZ comes a-knockin */
sigaction(SIGXFSZ, &handle_SIGXFSZ, NULL);
/* start logger thread */
ast_cond_init(&logcond, NULL);
if (ast_pthread_create(&logthread, NULL, logger_thread, NULL) < 0) {
ast_cond_destroy(&logcond);
return -1;
}
/* register the logger cli commands */
ast_cli_register_multiple(cli_logger, ARRAY_LEN(cli_logger));
ast_mkdir(ast_config_AST_LOG_DIR, 0777);
/* create log channels */
init_logger_chain(0 /* locked */);
logger_initialized = 1;
return 0;
}
| static void init_logger_chain | ( | int | locked | ) | [static] |
Definition at line 303 of file logger.c.
References var, ast_config_load2(), CONFIG_STATUS_FILEINVALID, AST_RWLIST_WRLOCK, AST_RWLIST_REMOVE_HEAD, logchannel::list, ast_free, AST_RWLIST_UNLOCK, errno, ast_calloc, logchannel::type, LOGTYPE_CONSOLE, logchannel::logmask, __LOG_WARNING, __LOG_NOTICE, __LOG_ERROR, AST_RWLIST_INSERT_HEAD, ast_variable_retrieve(), ast_true(), ast_copy_string(), logfiles, TIMESTAMP, ROTATE, SEQUENTIAL, ast_variable_browse(), ast_variable::next, make_logchannel(), ast_variable::name, ast_variable::value, ast_variable::lineno, ast_console_puts_mutable(), qlog, and ast_config_destroy().
Referenced by reload_logger(), and init_logger().
{
struct logchannel *chan;
struct ast_config *cfg;
struct ast_variable *var;
const char *s;
struct ast_flags config_flags = { 0 };
if (!(cfg = ast_config_load2("logger.conf", "logger", config_flags)) || cfg == CONFIG_STATUS_FILEINVALID) {
return;
}
/* delete our list of log channels */
if (!locked) {
AST_RWLIST_WRLOCK(&logchannels);
}
while ((chan = AST_RWLIST_REMOVE_HEAD(&logchannels, list))) {
ast_free(chan);
}
global_logmask = 0;
if (!locked) {
AST_RWLIST_UNLOCK(&logchannels);
}
errno = 0;
/* close syslog */
closelog();
/* If no config file, we're fine, set default options. */
if (!cfg) {
if (errno) {
fprintf(stderr, "Unable to open logger.conf: %s; default settings will be used.\n", strerror(errno));
} else {
fprintf(stderr, "Errors detected in logger.conf: see above; default settings will be used.\n");
}
if (!(chan = ast_calloc(1, sizeof(*chan)))) {
return;
}
chan->type = LOGTYPE_CONSOLE;
chan->logmask = __LOG_WARNING | __LOG_NOTICE | __LOG_ERROR;
if (!locked) {
AST_RWLIST_WRLOCK(&logchannels);
}
AST_RWLIST_INSERT_HEAD(&logchannels, chan, list);
global_logmask |= chan->logmask;
if (!locked) {
AST_RWLIST_UNLOCK(&logchannels);
}
return;
}
if ((s = ast_variable_retrieve(cfg, "general", "appendhostname"))) {
if (ast_true(s)) {
if (gethostname(hostname, sizeof(hostname) - 1)) {
ast_copy_string(hostname, "unknown", sizeof(hostname));
fprintf(stderr, "What box has no hostname???\n");
}
} else
hostname[0] = '\0';
} else
hostname[0] = '\0';
if ((s = ast_variable_retrieve(cfg, "general", "dateformat")))
ast_copy_string(dateformat, s, sizeof(dateformat));
else
ast_copy_string(dateformat, "%b %e %T", sizeof(dateformat));
if ((s = ast_variable_retrieve(cfg, "general", "queue_log"))) {
logfiles.queue_log = ast_true(s);
}
if ((s = ast_variable_retrieve(cfg, "general", "queue_log_to_file"))) {
logfiles.queue_log_to_file = ast_true(s);
}
if ((s = ast_variable_retrieve(cfg, "general", "queue_log_name"))) {
ast_copy_string(queue_log_name, s, sizeof(queue_log_name));
}
if ((s = ast_variable_retrieve(cfg, "general", "exec_after_rotate"))) {
ast_copy_string(exec_after_rotate, s, sizeof(exec_after_rotate));
}
if ((s = ast_variable_retrieve(cfg, "general", "rotatestrategy"))) {
if (strcasecmp(s, "timestamp") == 0) {
rotatestrategy = TIMESTAMP;
} else if (strcasecmp(s, "rotate") == 0) {
rotatestrategy = ROTATE;
} else if (strcasecmp(s, "sequential") == 0) {
rotatestrategy = SEQUENTIAL;
} else {
fprintf(stderr, "Unknown rotatestrategy: %s\n", s);
}
} else {
if ((s = ast_variable_retrieve(cfg, "general", "rotatetimestamp"))) {
rotatestrategy = ast_true(s) ? TIMESTAMP : SEQUENTIAL;
fprintf(stderr, "rotatetimestamp option has been deprecated. Please use rotatestrategy instead.\n");
}
}
if (!locked) {
AST_RWLIST_WRLOCK(&logchannels);
}
var = ast_variable_browse(cfg, "logfiles");
for (; var; var = var->next) {
if (!(chan = make_logchannel(var->name, var->value, var->lineno))) {
/* Print error message directly to the consoles since the lock is held
* and we don't want to unlock with the list partially built */
ast_console_puts_mutable("ERROR: Unable to create log channel '", __LOG_ERROR);
ast_console_puts_mutable(var->name, __LOG_ERROR);
ast_console_puts_mutable("'\n", __LOG_ERROR);
continue;
}
AST_RWLIST_INSERT_HEAD(&logchannels, chan, list);
global_logmask |= chan->logmask;
}
if (qlog) {
fclose(qlog);
qlog = NULL;
}
if (!locked) {
AST_RWLIST_UNLOCK(&logchannels);
}
ast_config_destroy(cfg);
}
| static void logger_print_normal | ( | struct logmsg * | logmsg | ) | [static] |
Print a normal log message to the channels.
Definition at line 964 of file logger.c.
References logmsg::level, __LOG_VERBOSE, ast_strdupa, logmsg::message, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, logchannel::list, verb::verboser, AST_RWLIST_UNLOCK, ast_string_field_set, AST_RWLIST_EMPTY, logchannel::disabled, logchannel::type, LOGTYPE_SYSLOG, logchannel::logmask, ast_log_vsyslog(), LOGTYPE_CONSOLE, logmsg::line, logmsg::date, term_color(), logmsg::level_name, colors, logmsg::process_id, logmsg::file, COLOR_BRWHITE, logmsg::function, ast_console_puts_mutable(), LOGTYPE_FILE, logchannel::fileptr, term_strip(), ast_strlen_zero(), errno, logchannel::filename, manager_event, EVENT_FLAG_SYSTEM, reload_logger(), and ast_verb.
Referenced by logger_thread(), and ast_log().
{
struct logchannel *chan = NULL;
char buf[BUFSIZ];
struct verb *v = NULL;
if (logmsg->level == __LOG_VERBOSE) {
char *tmpmsg = ast_strdupa(logmsg->message + 1);
/* Iterate through the list of verbosers and pass them the log message string */
AST_RWLIST_RDLOCK(&verbosers);
AST_RWLIST_TRAVERSE(&verbosers, v, list)
v->verboser(logmsg->message);
AST_RWLIST_UNLOCK(&verbosers);
ast_string_field_set(logmsg, message, tmpmsg);
}
AST_RWLIST_RDLOCK(&logchannels);
if (!AST_RWLIST_EMPTY(&logchannels)) {
AST_RWLIST_TRAVERSE(&logchannels, chan, list) {
/* If the channel is disabled, then move on to the next one */
if (chan->disabled)
continue;
/* Check syslog channels */
if (chan->type == LOGTYPE_SYSLOG && (chan->logmask & (1 << logmsg->level))) {
ast_log_vsyslog(logmsg);
/* Console channels */
} else if (chan->type == LOGTYPE_CONSOLE && (chan->logmask & (1 << logmsg->level))) {
char linestr[128];
char tmp1[80], tmp2[80], tmp3[80], tmp4[80];
/* If the level is verbose, then skip it */
if (logmsg->level == __LOG_VERBOSE)
continue;
/* Turn the numerical line number into a string */
snprintf(linestr, sizeof(linestr), "%d", logmsg->line);
/* Build string to print out */
snprintf(buf, sizeof(buf), "[%s] %s[%ld]: %s:%s %s: %s",
logmsg->date,
term_color(tmp1, logmsg->level_name, colors[logmsg->level], 0, sizeof(tmp1)),
logmsg->process_id,
term_color(tmp2, logmsg->file, COLOR_BRWHITE, 0, sizeof(tmp2)),
term_color(tmp3, linestr, COLOR_BRWHITE, 0, sizeof(tmp3)),
term_color(tmp4, logmsg->function, COLOR_BRWHITE, 0, sizeof(tmp4)),
logmsg->message);
/* Print out */
ast_console_puts_mutable(buf, logmsg->level);
/* File channels */
} else if (chan->type == LOGTYPE_FILE && (chan->logmask & (1 << logmsg->level))) {
int res = 0;
/* If no file pointer exists, skip it */
if (!chan->fileptr) {
continue;
}
/* Print out to the file */
res = fprintf(chan->fileptr, "[%s] %s[%ld] %s: %s",
logmsg->date, logmsg->level_name, logmsg->process_id, logmsg->file, term_strip(buf, logmsg->message, BUFSIZ));
if (res <= 0 && !ast_strlen_zero(logmsg->message)) {
fprintf(stderr, "**** Asterisk Logging Error: ***********\n");
if (errno == ENOMEM || errno == ENOSPC)
fprintf(stderr, "Asterisk logging error: Out of disk space, can't log to log file %s\n", chan->filename);
else
fprintf(stderr, "Logger Warning: Unable to write to log file '%s': %s (disabled)\n", chan->filename, strerror(errno));
manager_event(EVENT_FLAG_SYSTEM, "LogChannel", "Channel: %s\r\nEnabled: No\r\nReason: %d - %s\r\n", chan->filename, errno, strerror(errno));
chan->disabled = 1;
} else if (res > 0) {
fflush(chan->fileptr);
}
}
}
} else if (logmsg->level != __LOG_VERBOSE) {
fputs(logmsg->message, stdout);
}
AST_RWLIST_UNLOCK(&logchannels);
/* If we need to reload because of the file size, then do so */
if (filesize_reload_needed) {
reload_logger(-1);
ast_verb(1, "Rotated Logs Per SIGXFSZ (Exceeded file size limit)\n");
}
return;
}
| static void logger_queue_init | ( | void | ) | [static] |
Definition at line 1099 of file logger.c.
References ast_unload_realtime(), logfiles, logger_queue_rt_start(), ast_config_AST_LOG_DIR, qlog, ast_log(), LOG_ERROR, and errno.
Referenced by ast_queue_log().
{
ast_unload_realtime("queue_log");
if (logfiles.queue_log) {
char qfname[PATH_MAX];
if (logger_queue_rt_start()) {
return;
}
/* Open the log file. */
snprintf(qfname, sizeof(qfname), "%s/%s", ast_config_AST_LOG_DIR,
queue_log_name);
if (qlog) {
/* Just in case it was already open. */
fclose(qlog);
}
qlog = fopen(qfname, "a");
if (!qlog) {
ast_log(LOG_ERROR, "Unable to create queue log: %s\n", strerror(errno));
}
}
}
| static int logger_queue_restart | ( | int | queue_rotate | ) | [static] |
Definition at line 700 of file logger.c.
References logger_queue_rt_start(), ast_config_AST_LOG_DIR, qlog, rotate_file(), ast_log(), LOG_ERROR, and errno.
Referenced by reload_logger().
{
int res = 0;
char qfname[PATH_MAX];
if (logger_queue_rt_start()) {
return res;
}
snprintf(qfname, sizeof(qfname), "%s/%s", ast_config_AST_LOG_DIR, queue_log_name);
if (qlog) {
/* Just in case it was still open. */
fclose(qlog);
qlog = NULL;
}
if (queue_rotate) {
rotate_file(qfname);
}
/* Open the log file. */
qlog = fopen(qfname, "a");
if (!qlog) {
ast_log(LOG_ERROR, "Unable to create queue log: %s\n", strerror(errno));
res = -1;
}
return res;
}
| static int logger_queue_rt_start | ( | void | ) | [static] |
Definition at line 665 of file logger.c.
References ast_check_realtime(), ast_realtime_require_field(), RQ_DATETIME, RQ_CHAR, SENTINEL, and logfiles.
Referenced by logger_queue_restart(), and logger_queue_init().
{
if (ast_check_realtime("queue_log")) {
if (!ast_realtime_require_field("queue_log",
"time", RQ_DATETIME, 26,
"data1", RQ_CHAR, 20,
"data2", RQ_CHAR, 20,
"data3", RQ_CHAR, 20,
"data4", RQ_CHAR, 20,
"data5", RQ_CHAR, 20,
SENTINEL)) {
logfiles.queue_adaptive_realtime = 1;
} else {
logfiles.queue_adaptive_realtime = 0;
}
if (!logfiles.queue_log_to_file) {
/* Don't open the log file. */
return 1;
}
}
return 0;
}
| int logger_reload | ( | void | ) |
Reload the logger module without rotating log files (also used from loader.c during a full Asterisk reload)
Reload logger without rotating log files.
Definition at line 793 of file logger.c.
References reload_logger(), RESULT_FAILURE, and RESULT_SUCCESS.
{
if (reload_logger(0)) {
return RESULT_FAILURE;
}
return RESULT_SUCCESS;
}
| static void* logger_thread | ( | void * | data | ) | [static] |
Actual logging thread.
Definition at line 1053 of file logger.c.
References logchannel::next, AST_LIST_LOCK, AST_LIST_EMPTY, close_logger_thread, ast_cond_wait, logcond, logmsgs::lock, AST_LIST_FIRST, AST_LIST_HEAD_INIT_NOLOCK, AST_LIST_UNLOCK, AST_LIST_NEXT, logchannel::list, logger_print_normal(), and ast_free.
Referenced by init_logger().
{
struct logmsg *next = NULL, *msg = NULL;
for (;;) {
/* We lock the message list, and see if any message exists... if not we wait on the condition to be signalled */
AST_LIST_LOCK(&logmsgs);
if (AST_LIST_EMPTY(&logmsgs)) {
if (close_logger_thread) {
break;
} else {
ast_cond_wait(&logcond, &logmsgs.lock);
}
}
next = AST_LIST_FIRST(&logmsgs);
AST_LIST_HEAD_INIT_NOLOCK(&logmsgs);
AST_LIST_UNLOCK(&logmsgs);
/* Otherwise go through and process each message in the order added */
while ((msg = next)) {
/* Get the next entry now so that we can free our current structure later */
next = AST_LIST_NEXT(msg, list);
/* Depending on the type, send it to the proper function */
logger_print_normal(msg);
/* Free the data since we are done */
ast_free(msg);
}
/* If we should stop, then stop */
if (close_logger_thread)
break;
}
return NULL;
}
| static unsigned int make_components | ( | const char * | s, |
| int | lineno | ||
| ) | [static] |
Definition at line 219 of file logger.c.
References ast_strdupa, strsep(), ast_skip_blanks(), ARRAY_LEN, and levels.
Referenced by make_logchannel(), and update_logchannels().
{
char *w;
unsigned int res = 0;
char *stringp = ast_strdupa(s);
unsigned int x;
while ((w = strsep(&stringp, ","))) {
w = ast_skip_blanks(w);
if (!strcmp(w, "*")) {
res = 0xFFFFFFFF;
break;
} else for (x = 0; x < ARRAY_LEN(levels); x++) {
if (levels[x] && !strcasecmp(w, levels[x])) {
res |= (1 << x);
break;
}
}
}
return res;
}
| static struct logchannel* make_logchannel | ( | const char * | channel, |
| const char * | components, | ||
| int | lineno | ||
| ) | [static, read] |
Definition at line 243 of file logger.c.
References logchannel::facility, ast_strlen_zero(), ast_calloc, logchannel::components, logchannel::lineno, logchannel::type, LOGTYPE_CONSOLE, ast_syslog_facility(), ast_free, LOGTYPE_SYSLOG, ast_copy_string(), logchannel::filename, ast_config_AST_LOG_DIR, logchannel::fileptr, ast_console_puts_mutable(), __LOG_ERROR, errno, LOGTYPE_FILE, logchannel::logmask, and make_components().
Referenced by init_logger_chain().
{
struct logchannel *chan;
char *facility;
if (ast_strlen_zero(channel) || !(chan = ast_calloc(1, sizeof(*chan) + strlen(components) + 1)))
return NULL;
strcpy(chan->components, components);
chan->lineno = lineno;
if (!strcasecmp(channel, "console")) {
chan->type = LOGTYPE_CONSOLE;
} else if (!strncasecmp(channel, "syslog", 6)) {
/*
* syntax is:
* syslog.facility => level,level,level
*/
facility = strchr(channel, '.');
if (!facility++ || !facility) {
facility = "local0";
}
chan->facility = ast_syslog_facility(facility);
if (chan->facility < 0) {
fprintf(stderr, "Logger Warning: bad syslog facility in logger.conf\n");
ast_free(chan);
return NULL;
}
chan->type = LOGTYPE_SYSLOG;
ast_copy_string(chan->filename, channel, sizeof(chan->filename));
openlog("asterisk", LOG_PID, chan->facility);
} else {
if (!ast_strlen_zero(hostname)) {
snprintf(chan->filename, sizeof(chan->filename), "%s/%s.%s",
channel[0] != '/' ? ast_config_AST_LOG_DIR : "", channel, hostname);
} else {
snprintf(chan->filename, sizeof(chan->filename), "%s/%s",
channel[0] != '/' ? ast_config_AST_LOG_DIR : "", channel);
}
if (!(chan->fileptr = fopen(chan->filename, "a"))) {
/* Can't do real logging here since we're called with a lock
* so log to any attached consoles */
ast_console_puts_mutable("ERROR: Unable to open log file '", __LOG_ERROR);
ast_console_puts_mutable(chan->filename, __LOG_ERROR);
ast_console_puts_mutable("': ", __LOG_ERROR);
ast_console_puts_mutable(strerror(errno), __LOG_ERROR);
ast_console_puts_mutable("'\n", __LOG_ERROR);
ast_free(chan);
return NULL;
}
chan->type = LOGTYPE_FILE;
}
chan->logmask = make_components(chan->components, lineno);
return chan;
}
| static int reload_logger | ( | int | rotate | ) | [static] |
Definition at line 728 of file logger.c.
References f, AST_RWLIST_WRLOCK, qlog, ast_mkdir(), ast_config_AST_LOG_DIR, AST_RWLIST_TRAVERSE, logchannel::list, logchannel::disabled, manager_event, EVENT_FLAG_SYSTEM, logchannel::filename, logchannel::fileptr, rotate_file(), init_logger_chain(), ast_unload_realtime(), logfiles, logger_queue_restart(), AST_RWLIST_UNLOCK, ast_queue_log(), and ast_verb.
Referenced by logger_reload(), handle_logger_reload(), handle_logger_rotate(), and logger_print_normal().
{
int queue_rotate = rotate;
struct logchannel *f;
int res = 0;
AST_RWLIST_WRLOCK(&logchannels);
if (qlog) {
if (rotate < 0) {
/* Check filesize - this one typically doesn't need an auto-rotate */
if (ftello(qlog) > 0x40000000) { /* Arbitrarily, 1 GB */
fclose(qlog);
qlog = NULL;
} else {
queue_rotate = 0;
}
} else {
fclose(qlog);
qlog = NULL;
}
} else {
queue_rotate = 0;
}
ast_mkdir(ast_config_AST_LOG_DIR, 0777);
AST_RWLIST_TRAVERSE(&logchannels, f, list) {
if (f->disabled) {
f->disabled = 0; /* Re-enable logging at reload */
manager_event(EVENT_FLAG_SYSTEM, "LogChannel", "Channel: %s\r\nEnabled: Yes\r\n", f->filename);
}
if (f->fileptr && (f->fileptr != stdout) && (f->fileptr != stderr)) {
int rotate_this = 0;
if (ftello(f->fileptr) > 0x40000000) { /* Arbitrarily, 1 GB */
/* Be more proactive about rotating massive log files */
rotate_this = 1;
}
fclose(f->fileptr); /* Close file */
f->fileptr = NULL;
if (rotate || rotate_this) {
rotate_file(f->filename);
}
}
}
filesize_reload_needed = 0;
init_logger_chain(1 /* locked */);
ast_unload_realtime("queue_log");
if (logfiles.queue_log) {
res = logger_queue_restart(queue_rotate);
AST_RWLIST_UNLOCK(&logchannels);
ast_queue_log("NONE", "NONE", "NONE", "CONFIGRELOAD", "%s", "");
ast_verb(1, "Asterisk Queue Logger restarted\n");
} else {
AST_RWLIST_UNLOCK(&logchannels);
}
return res;
}
| static int rotate_file | ( | const char * | filename | ) | [static] |
Definition at line 567 of file logger.c.
References SEQUENTIAL, TIMESTAMP, ROTATE, ARRAY_LEN, ast_strlen_zero(), ast_dummy_channel_alloc(), pbx_builtin_setvar_helper(), pbx_substitute_variables_helper(), ast_safe_system(), ast_log(), LOG_WARNING, and ast_channel_release().
Referenced by logger_queue_restart(), and reload_logger().
{
char old[PATH_MAX];
char new[PATH_MAX];
int x, y, which, found, res = 0, fd;
char *suffixes[4] = { "", ".gz", ".bz2", ".Z" };
switch (rotatestrategy) {
case SEQUENTIAL:
for (x = 0; ; x++) {
snprintf(new, sizeof(new), "%s.%d", filename, x);
fd = open(new, O_RDONLY);
if (fd > -1)
close(fd);
else
break;
}
if (rename(filename, new)) {
fprintf(stderr, "Unable to rename file '%s' to '%s'\n", filename, new);
res = -1;
} else {
filename = new;
}
break;
case TIMESTAMP:
snprintf(new, sizeof(new), "%s.%ld", filename, (long)time(NULL));
if (rename(filename, new)) {
fprintf(stderr, "Unable to rename file '%s' to '%s'\n", filename, new);
res = -1;
} else {
filename = new;
}
break;
case ROTATE:
/* Find the next empty slot, including a possible suffix */
for (x = 0; ; x++) {
found = 0;
for (which = 0; which < ARRAY_LEN(suffixes); which++) {
snprintf(new, sizeof(new), "%s.%d%s", filename, x, suffixes[which]);
fd = open(new, O_RDONLY);
if (fd > -1) {
close(fd);
found = 1;
break;
}
}
if (!found) {
break;
}
}
/* Found an empty slot */
for (y = x; y > 0; y--) {
for (which = 0; which < ARRAY_LEN(suffixes); which++) {
snprintf(old, sizeof(old), "%s.%d%s", filename, y - 1, suffixes[which]);
fd = open(old, O_RDONLY);
if (fd > -1) {
/* Found the right suffix */
close(fd);
snprintf(new, sizeof(new), "%s.%d%s", filename, y, suffixes[which]);
if (rename(old, new)) {
fprintf(stderr, "Unable to rename file '%s' to '%s'\n", old, new);
res = -1;
}
break;
}
}
}
/* Finally, rename the current file */
snprintf(new, sizeof(new), "%s.0", filename);
if (rename(filename, new)) {
fprintf(stderr, "Unable to rename file '%s' to '%s'\n", filename, new);
res = -1;
} else {
filename = new;
}
}
if (!ast_strlen_zero(exec_after_rotate)) {
struct ast_channel *c = ast_dummy_channel_alloc();
char buf[512];
pbx_builtin_setvar_helper(c, "filename", filename);
pbx_substitute_variables_helper(c, exec_after_rotate, buf, sizeof(buf));
if (ast_safe_system(buf) == -1) {
ast_log(LOG_WARNING, "error executing '%s'\n", buf);
}
c = ast_channel_release(c);
}
return res;
}
| static void update_logchannels | ( | void | ) | [static] |
Definition at line 1578 of file logger.c.
References AST_RWLIST_WRLOCK, AST_RWLIST_TRAVERSE, logchannel::list, logchannel::logmask, make_components(), logchannel::components, logchannel::lineno, and AST_RWLIST_UNLOCK.
Referenced by ast_logger_register_level(), and ast_logger_unregister_level().
{
struct logchannel *cur;
AST_RWLIST_WRLOCK(&logchannels);
global_logmask = 0;
AST_RWLIST_TRAVERSE(&logchannels, cur, list) {
cur->logmask = make_components(cur->components, cur->lineno);
global_logmask |= cur->logmask;
}
AST_RWLIST_UNLOCK(&logchannels);
}
struct ast_cli_entry cli_logger[] [static] |
Definition at line 927 of file logger.c.
Referenced by init_logger().
int close_logger_thread = 0 [static] |
Definition at line 150 of file logger.c.
Referenced by logger_thread(), and close_logger().
const int colors[32] [static] |
Colors used in the console for logging.
Definition at line 176 of file logger.c.
Referenced by logger_print_normal().
char dateformat[256] = "%b %e %T" [static] |
Definition at line 74 of file logger.c.
Referenced by build_device().
char exec_after_rotate[256] = "" [static] |
int filesize_reload_needed [static] |
unsigned int global_logmask = 0xFFFF [static] |
struct sigaction handle_SIGXFSZ [static] |
{
.sa_handler = _handle_SIGXFSZ,
.sa_flags = SA_RESTART,
}
Definition at line 940 of file logger.c.
Referenced by init_logger().
char hostname[MAXHOSTNAMELEN] [static] |
Definition at line 96 of file logger.c.
Referenced by app_exec(), netconsole(), cli_prompt(), ast_remotecontrol(), ast_readconfig(), main(), tds_load_module(), iax2_register(), sip_subscribe_mwi(), and set_destination().
char* levels[32] [static] |
Logging channels used in the Asterisk logging system.
The first 16 levels are reserved for system usage, and the remaining levels are reserved for usage by dynamic levels registered via ast_logger_register_level.
Definition at line 165 of file logger.c.
Referenced by ast_network_puts_mutable(), make_components(), handle_logger_set_level(), handle_logger_show_channels(), ast_log_vsyslog(), ast_log(), ast_logger_register_level(), and ast_logger_unregister_level().
struct ast_threadstorage log_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_log_buf , .custom_init = NULL , } [static] |
struct logchannels logchannels [static] |
ast_cond_t logcond [static] |
Definition at line 149 of file logger.c.
Referenced by logger_thread(), init_logger(), close_logger(), and ast_log().
struct { ... } logfiles [static] |
Referenced by init_logger_chain(), ast_queue_log(), logger_queue_rt_start(), reload_logger(), and logger_queue_init().
int logger_initialized [static] |
pthread_t logthread = AST_PTHREADT_NULL [static] |
Definition at line 148 of file logger.c.
Referenced by init_logger(), close_logger(), and ast_log().
FILE* qlog [static] |
Definition at line 152 of file logger.c.
Referenced by init_logger_chain(), ast_queue_log(), logger_queue_restart(), reload_logger(), logger_queue_init(), and close_logger().
| unsigned int queue_adaptive_realtime |
char queue_log_name[256] = QUEUELOG [static] |
| unsigned int queue_log_to_file |
int queuelog_init [static] |
enum rotatestrategy rotatestrategy [static] |
struct ast_threadstorage verbose_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_verbose_buf , .custom_init = NULL , } [static] |
Definition at line 211 of file logger.c.
Referenced by __ast_verbose_ap().