diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/app.c | 4 | ||||
-rw-r--r-- | main/audiohook.c | 19 | ||||
-rw-r--r-- | main/channel.c | 44 | ||||
-rw-r--r-- | main/features.c | 38 | ||||
-rw-r--r-- | main/http.c | 2 | ||||
-rw-r--r-- | main/logger.c | 4 | ||||
-rw-r--r-- | main/manager.c | 6 | ||||
-rw-r--r-- | main/pbx.c | 20 | ||||
-rw-r--r-- | main/say.c | 76 | ||||
-rw-r--r-- | main/taskprocessor.c | 6 | ||||
-rw-r--r-- | main/xmldoc.c | 2 |
11 files changed, 109 insertions, 112 deletions
diff --git a/main/app.c b/main/app.c index 27858a29b..b9be31783 100644 --- a/main/app.c +++ b/main/app.c @@ -1481,9 +1481,9 @@ static int ast_unlock_path_flock(const char *path) snprintf(s, strlen(path) + 19, "%s/lock", path); unlink(s); path_lock_destroy(p); - ast_log(LOG_DEBUG, "Unlocked path '%s'\n", path); + ast_debug(1, "Unlocked path '%s'\n", path); } else { - ast_log(LOG_DEBUG, "Failed to unlock path '%s': " + ast_debug(1, "Failed to unlock path '%s': " "lock not found\n", path); } diff --git a/main/audiohook.c b/main/audiohook.c index 23650a79f..6b2df6416 100644 --- a/main/audiohook.c +++ b/main/audiohook.c @@ -138,16 +138,13 @@ int ast_audiohook_write_frame(struct ast_audiohook *audiohook, enum ast_audiohoo other_factory_ms = other_factory_samples / 8; if (ast_test_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC) && other_factory_samples && (our_factory_ms - other_factory_ms > AST_AUDIOHOOK_SYNC_TOLERANCE)) { - if (option_debug) - ast_log(LOG_DEBUG, "Flushing audiohook %p so it remains in sync\n", audiohook); + ast_debug(1, "Flushing audiohook %p so it remains in sync\n", audiohook); ast_slinfactory_flush(factory); ast_slinfactory_flush(other_factory); } if (ast_test_flag(audiohook, AST_AUDIOHOOK_SMALL_QUEUE) && (our_factory_samples > 640 || other_factory_samples > 640)) { - if (option_debug) { - ast_log(LOG_DEBUG, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook); - } + ast_debug(1, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook); ast_slinfactory_flush(factory); ast_slinfactory_flush(other_factory); } @@ -256,8 +253,8 @@ static struct ast_frame *audiohook_read_frame_both(struct ast_audiohook *audioho } } } - } else if (option_debug) - ast_log(LOG_DEBUG, "Failed to get %d samples from read factory %p\n", (int)samples, &audiohook->read_factory); + } + ast_debug(1, "Failed to get %d samples from read factory %p\n", (int)samples, &audiohook->read_factory); /* Move on to the write factory... if there are enough samples, read them in */ if (usable_write) { @@ -275,8 +272,8 @@ static struct ast_frame *audiohook_read_frame_both(struct ast_audiohook *audioho } } } - } else if (option_debug) - ast_log(LOG_DEBUG, "Failed to get %d samples from write factory %p\n", (int)samples, &audiohook->write_factory); + } + ast_debug(1, "Failed to get %d samples from write factory %p\n", (int)samples, &audiohook->write_factory); /* Basically we figure out which buffer to use... and if mixing can be done here */ if (!read_buf && !write_buf) @@ -818,7 +815,7 @@ int ast_channel_audiohook_count_by_source(struct ast_channel *chan, const char * AST_LIST_TRAVERSE_SAFE_END; break; default: - ast_log(LOG_DEBUG, "Invalid audiohook type supplied, (%d)\n", type); + ast_debug(1, "Invalid audiohook type supplied, (%d)\n", type); return -1; } @@ -856,7 +853,7 @@ int ast_channel_audiohook_count_by_source_running(struct ast_channel *chan, cons AST_LIST_TRAVERSE_SAFE_END; break; default: - ast_log(LOG_DEBUG, "Invalid audiohook type supplied, (%d)\n", type); + ast_debug(1, "Invalid audiohook type supplied, (%d)\n", type); return -1; } return count; diff --git a/main/channel.c b/main/channel.c index 796dc8b01..ae61b7731 100644 --- a/main/channel.c +++ b/main/channel.c @@ -675,16 +675,16 @@ static int ast_channel_trace_data_update(struct ast_channel *chan, struct ast_ch return 0; /* If the last saved context does not match the current one OR we have not saved any context so far, then save the current context */ - if ((!AST_LIST_EMPTY(&traced->trace) && strcasecmp(AST_LIST_FIRST(&traced->trace)->context, chan->context)) || + if ((!AST_LIST_EMPTY(&traced->trace) && strcasecmp(AST_LIST_FIRST(&traced->trace)->context, chan->context)) || (AST_LIST_EMPTY(&traced->trace))) { /* Just do some debug logging */ if (AST_LIST_EMPTY(&traced->trace)) - ast_log(LOG_DEBUG, "Setting initial trace context to %s\n", chan->context); + ast_debug(1, "Setting initial trace context to %s\n", chan->context); else - ast_log(LOG_DEBUG, "Changing trace context from %s to %s\n", AST_LIST_FIRST(&traced->trace)->context, chan->context); + ast_debug(1, "Changing trace context from %s to %s\n", AST_LIST_FIRST(&traced->trace)->context, chan->context); /* alloc or bail out */ trace = ast_malloc(sizeof(*trace)); - if (!trace) + if (!trace) return -1; /* save the current location and store it in the trace list */ ast_copy_string(trace->context, chan->context, sizeof(trace->context)); @@ -745,7 +745,7 @@ int ast_check_hangup(struct ast_channel *chan) return 1; if (ast_tvzero(chan->whentohangup)) /* no if no hangup scheduled */ return 0; - if (ast_tvdiff_ms(chan->whentohangup, ast_tvnow()) > 0) /* no if hangup time has not come yet. */ + if (ast_tvdiff_ms(chan->whentohangup, ast_tvnow()) > 0) /* no if hangup time has not come yet. */ return 0; ast_debug(4, "Hangup time has come: %" PRIi64 "\n", ast_tvdiff_ms(chan->whentohangup, ast_tvnow())); chan->_softhangup |= AST_SOFTHANGUP_TIMEOUT; /* record event */ @@ -847,7 +847,7 @@ int ast_channel_register(const struct ast_channel_tech *tech) return -1; } } - + if (!(chan = ast_calloc(1, sizeof(*chan)))) { AST_RWLIST_UNLOCK(&backends); return -1; @@ -2775,7 +2775,7 @@ int ast_hangup(struct ast_channel *chan) } else { ast_debug(1, "Hanging up zombie '%s'\n", chan->name); } - + ast_channel_unlock(chan); ast_cc_offer(chan); ast_manager_event(chan, EVENT_FLAG_CALL, "Hangup", @@ -3568,7 +3568,7 @@ static void ast_read_generator_actions(struct ast_channel *chan, struct ast_fram } else { samples = f->samples; } - + /* This unlock is here based on two assumptions that hold true at this point in the * code. 1) this function is only called from within __ast_read() and 2) all generators * call ast_write() in their generate callback. @@ -4548,7 +4548,7 @@ int ast_senddigit_end(struct ast_channel *chan, char digit, unsigned int duratio if (res && chan->generator) ast_playtones_stop(chan); - + return 0; } @@ -4558,7 +4558,7 @@ int ast_senddigit(struct ast_channel *chan, char digit, unsigned int duration) ast_senddigit_begin(chan, digit); ast_safe_sleep(chan, (duration >= AST_DEFAULT_EMULATE_DTMF_DURATION ? duration : AST_DEFAULT_EMULATE_DTMF_DURATION)); } - + return ast_senddigit_end(chan, digit, (duration >= AST_DEFAULT_EMULATE_DTMF_DURATION ? duration : AST_DEFAULT_EMULATE_DTMF_DURATION)); } @@ -6222,32 +6222,32 @@ static void ast_set_owners_and_peers(struct ast_channel *chan1, struct ast_channel *chan2) { if (!ast_strlen_zero(chan1->accountcode) && ast_strlen_zero(chan2->peeraccount)) { - ast_log(LOG_DEBUG, "setting peeraccount to %s for %s from data on channel %s\n", + ast_debug(1, "setting peeraccount to %s for %s from data on channel %s\n", chan1->accountcode, chan2->name, chan1->name); ast_string_field_set(chan2, peeraccount, chan1->accountcode); } if (!ast_strlen_zero(chan2->accountcode) && ast_strlen_zero(chan1->peeraccount)) { - ast_log(LOG_DEBUG, "setting peeraccount to %s for %s from data on channel %s\n", + ast_debug(1, "setting peeraccount to %s for %s from data on channel %s\n", chan2->accountcode, chan1->name, chan2->name); ast_string_field_set(chan1, peeraccount, chan2->accountcode); } if (!ast_strlen_zero(chan1->peeraccount) && ast_strlen_zero(chan2->accountcode)) { - ast_log(LOG_DEBUG, "setting accountcode to %s for %s from data on channel %s\n", + ast_debug(1, "setting accountcode to %s for %s from data on channel %s\n", chan1->peeraccount, chan2->name, chan1->name); ast_string_field_set(chan2, accountcode, chan1->peeraccount); } if (!ast_strlen_zero(chan2->peeraccount) && ast_strlen_zero(chan1->accountcode)) { - ast_log(LOG_DEBUG, "setting accountcode to %s for %s from data on channel %s\n", + ast_debug(1, "setting accountcode to %s for %s from data on channel %s\n", chan2->peeraccount, chan1->name, chan2->name); ast_string_field_set(chan1, accountcode, chan2->peeraccount); } if (0 != strcmp(chan1->accountcode, chan2->peeraccount)) { - ast_log(LOG_DEBUG, "changing peeraccount from %s to %s on %s to match channel %s\n", + ast_debug(1, "changing peeraccount from %s to %s on %s to match channel %s\n", chan2->peeraccount, chan1->peeraccount, chan2->name, chan1->name); ast_string_field_set(chan2, peeraccount, chan1->accountcode); } if (0 != strcmp(chan2->accountcode, chan1->peeraccount)) { - ast_log(LOG_DEBUG, "changing peeraccount from %s to %s on %s to match channel %s\n", + ast_debug(1, "changing peeraccount from %s to %s on %s to match channel %s\n", chan1->peeraccount, chan2->peeraccount, chan1->name, chan2->name); ast_string_field_set(chan1, peeraccount, chan2->accountcode); } @@ -6999,7 +6999,7 @@ static enum ast_bridge_result ast_generic_bridge(struct ast_channel *c0, struct if (!f) { *fo = NULL; *rc = who; - ast_debug(1, "Didn't get a frame from channel: %s\n",who->name); + ast_debug(1, "Didn't get a frame from channel: %s\n", who->name); break; } @@ -7062,7 +7062,7 @@ static enum ast_bridge_result ast_generic_bridge(struct ast_channel *c0, struct f->frametype == AST_FRAME_DTMF_BEGIN)) { *fo = f; *rc = who; - ast_debug(1, "Got DTMF %s on channel (%s)\n", + ast_debug(1, "Got DTMF %s on channel (%s)\n", f->frametype == AST_FRAME_DTMF_END ? "end" : "begin", who->name); @@ -8686,7 +8686,7 @@ int ast_connected_line_parse_data(const unsigned char *data, size_t datalen, str break; /* Connected line party unknown element */ default: - ast_log(LOG_DEBUG, "Unknown connected line element: %u (%u)\n", + ast_debug(1, "Unknown connected line element: %u (%u)\n", (unsigned) ie_id, (unsigned) ie_len); break; } @@ -8714,7 +8714,7 @@ int ast_connected_line_parse_data(const unsigned char *data, size_t datalen, str * The other end is newer than we are. * We need to assume that they are compatible with us. */ - ast_log(LOG_DEBUG, "Connected line frame has newer version: %u\n", + ast_debug(1, "Connected line frame has newer version: %u\n", (unsigned) frame_version); break; } @@ -9185,7 +9185,7 @@ int ast_redirecting_parse_data(const unsigned char *data, size_t datalen, struct break; /* Redirecting unknown element */ default: - ast_log(LOG_DEBUG, "Unknown redirecting element: %u (%u)\n", + ast_debug(1, "Unknown redirecting element: %u (%u)\n", (unsigned) ie_id, (unsigned) ie_len); break; } @@ -9221,7 +9221,7 @@ int ast_redirecting_parse_data(const unsigned char *data, size_t datalen, struct * The other end is newer than we are. * We need to assume that they are compatible with us. */ - ast_log(LOG_DEBUG, "Redirecting frame has newer version: %u\n", + ast_debug(1, "Redirecting frame has newer version: %u\n", (unsigned) frame_version); break; } diff --git a/main/features.c b/main/features.c index 44f0eb829..23e8d57a8 100644 --- a/main/features.c +++ b/main/features.c @@ -854,7 +854,7 @@ static const char *findparkinglotname(struct ast_channel *chan) /*! \brief Notify metermaids that we've changed an extension */ static void notify_metermaids(const char *exten, char *context, enum ast_device_state state) { - ast_debug(4, "Notification of state change to metermaids %s@%s\n to state '%s'", + ast_debug(4, "Notification of state change to metermaids %s@%s\n to state '%s'", exten, context, ast_devstate2str(state)); ast_devstate_changed(state, "park:%s@%s", exten, context); @@ -871,7 +871,7 @@ static enum ast_device_state metermaidstate(const char *data) exten = strsep(&context, "@"); if (!context) return AST_DEVICE_INVALID; - + ast_debug(4, "Checking state of exten %s in context %s\n", exten, context); if (!ast_exists_extension(NULL, context, exten, 1, NULL)) @@ -1923,12 +1923,12 @@ static int builtin_blindtransfer(struct ast_channel *chan, struct ast_channel *p } if (transferer->cdr) { struct ast_cdr *swap = transferer->cdr; - ast_log(LOG_DEBUG,"transferer=%s; transferee=%s; lastapp=%s; lastdata=%s; chan=%s; dstchan=%s\n", + ast_debug(1, "transferer=%s; transferee=%s; lastapp=%s; lastdata=%s; chan=%s; dstchan=%s\n", transferer->name, transferee->name, transferer->cdr->lastapp, transferer->cdr->lastdata, transferer->cdr->channel, transferer->cdr->dstchannel); - ast_log(LOG_DEBUG,"TRANSFEREE; lastapp=%s; lastdata=%s, chan=%s; dstchan=%s\n", + ast_debug(1, "TRANSFEREE; lastapp=%s; lastdata=%s, chan=%s; dstchan=%s\n", transferee->cdr->lastapp, transferee->cdr->lastdata, transferee->cdr->channel, transferee->cdr->dstchannel); - ast_log(LOG_DEBUG,"transferer_real_context=%s; xferto=%s\n", transferer_real_context, xferto); + ast_debug(1, "transferer_real_context=%s; xferto=%s\n", transferer_real_context, xferto); /* swap cdrs-- it will save us some time & work */ transferer->cdr = transferee->cdr; transferee->cdr = swap; @@ -1942,7 +1942,7 @@ static int builtin_blindtransfer(struct ast_channel *chan, struct ast_channel *p } else { /* Set the channel's new extension, since it exists, using transferer context */ ast_set_flag(transferee, AST_FLAG_BRIDGE_HANGUP_DONT); /* don't let the after-bridge code run the h-exten */ - ast_log(LOG_DEBUG,"ABOUT TO AST_ASYNC_GOTO, have a pbx... set HANGUP_DONT on chan=%s\n", transferee->name); + ast_debug(1, "ABOUT TO AST_ASYNC_GOTO, have a pbx... set HANGUP_DONT on chan=%s\n", transferee->name); if (ast_channel_connected_line_macro(transferee, transferer, &transferer->connected, 1, 0)) { ast_channel_update_connected_line(transferer, &transferer->connected, NULL); } @@ -3534,7 +3534,7 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast ast_cdr_start(bridge_cdr); } } - ast_debug(4,"bridge answer set, chan answer set\n"); + ast_debug(4, "bridge answer set, chan answer set\n"); /* peer_cdr->answer will be set when a macro runs on the peer; in that case, the bridge answer will be delayed while the macro plays on the peer channel. The peer answered the call @@ -4665,7 +4665,7 @@ static struct ast_parkinglot *build_parkinglot(char *name, struct ast_variable * } else if (!strcasecmp(confvar->name, "findslot")) { parkinglot->parkfindnext = (!strcasecmp(confvar->value, "next")); } else if (!strcasecmp(confvar->name, "parkedcalltransfers")) { - ast_log(LOG_DEBUG, "Setting parking lot %s %s to %s\n", name, confvar->name, confvar->value); + ast_debug(1, "Setting parking lot %s %s to %s\n", name, confvar->name, confvar->value); if (!strcasecmp(confvar->value, "both")) { parkinglot->parkedcalltransfers = AST_FEATURE_FLAG_BYBOTH; } else if (!strcasecmp(confvar->value, "caller")) { @@ -4674,7 +4674,7 @@ static struct ast_parkinglot *build_parkinglot(char *name, struct ast_variable * parkinglot->parkedcalltransfers = AST_FEATURE_FLAG_BYCALLEE; } } else if (!strcasecmp(confvar->name, "parkedcallreparking")) { - ast_log(LOG_DEBUG, "Setting parking lot %s %s to %s\n", name, confvar->name, confvar->value); + ast_debug(1, "Setting parking lot %s %s to %s\n", name, confvar->name, confvar->value); if (!strcasecmp(confvar->value, "both")) { parkinglot->parkedcallreparking = AST_FEATURE_FLAG_BYBOTH; } else if (!strcasecmp(confvar->value, "caller")) { @@ -4683,16 +4683,16 @@ static struct ast_parkinglot *build_parkinglot(char *name, struct ast_variable * parkinglot->parkedcallreparking = AST_FEATURE_FLAG_BYCALLEE; } } else if (!strcasecmp(confvar->name, "parkedcallhangup")) { - ast_log(LOG_DEBUG, "Setting parking lot %s %s to %s\n", name, confvar->name, confvar->value); + ast_debug(1, "Setting parking lot %s %s to %s\n", name, confvar->name, confvar->value); if (!strcasecmp(confvar->value, "both")) { parkinglot->parkedcallhangup = AST_FEATURE_FLAG_BYBOTH; } else if (!strcasecmp(confvar->value, "caller")) { - parkinglot->parkedcallhangup = AST_FEATURE_FLAG_BYCALLER; + parkinglot->parkedcallhangup = AST_FEATURE_FLAG_BYCALLER; } else if (!strcasecmp(confvar->value, "callee")) { parkinglot->parkedcallhangup = AST_FEATURE_FLAG_BYCALLEE; } } else if (!strcasecmp(confvar->name, "parkedcallrecording")) { - ast_log(LOG_DEBUG, "Setting parking lot %s %s to %s\n", name, confvar->name, confvar->value); + ast_debug(1, "Setting parking lot %s %s to %s\n", name, confvar->name, confvar->value); if (!strcasecmp(confvar->value, "both")) { parkinglot->parkedcallrecording = AST_FEATURE_FLAG_BYBOTH; } else if (!strcasecmp(confvar->value, "caller")) { @@ -4762,7 +4762,7 @@ static struct ast_parkinglot *build_parkinglot(char *name, struct ast_variable * return parkinglot; } -static int load_config(void) +static int load_config(void) { int start = 0, end = 0; int res; @@ -4793,7 +4793,7 @@ static int load_config(void) default_parkinglot->parkingtime = DEFAULT_PARK_TIME; ao2_unlock(default_parkinglot); } - + if (default_parkinglot) { ast_debug(1, "Configuration of default parkinglot done.\n"); } else { @@ -5053,7 +5053,7 @@ static int load_config(void) ast_log(LOG_ERROR, "Could not build parking lot %s. Configuration error.\n", ctg); else ast_debug(1, "Configured parking context %s\n", ctg); - continue; + continue; } /* No, check if it's a group */ for (i = 0; i < ARRAY_LEN(categories); i++) { @@ -5061,7 +5061,7 @@ static int load_config(void) break; } - if (i < ARRAY_LEN(categories)) + if (i < ARRAY_LEN(categories)) continue; if (!(fg = register_group(ctg))) @@ -5937,7 +5937,7 @@ static int bridge_exec(struct ast_channel *chan, const char *data) ast_set_flag(&(bconfig.features_caller), AST_FEATURE_DISCONNECT); if (ast_test_flag(&opts, OPT_CALLEE_MONITOR)) ast_set_flag(&(bconfig.features_callee), AST_FEATURE_AUTOMON); - if (ast_test_flag(&opts, OPT_CALLER_MONITOR)) + if (ast_test_flag(&opts, OPT_CALLER_MONITOR)) ast_set_flag(&(bconfig.features_caller), AST_FEATURE_AUTOMON); if (ast_test_flag(&opts, OPT_CALLEE_PARK)) ast_set_flag(&(bconfig.features_callee), AST_FEATURE_PARKCALL); @@ -5949,8 +5949,8 @@ static int bridge_exec(struct ast_channel *chan, const char *data) /* the bridge has ended, set BRIDGERESULT to SUCCESS. If the other channel has not been hung up, return it to the PBX */ pbx_builtin_setvar_helper(chan, "BRIDGERESULT", "SUCCESS"); if (!ast_check_hangup(final_dest_chan) && !ast_test_flag(&opts, OPT_CALLEE_KILL)) { - ast_debug(1, "starting new PBX in %s,%s,%d for chan %s\n", - final_dest_chan->context, final_dest_chan->exten, + ast_debug(1, "starting new PBX in %s,%s,%d for chan %s\n", + final_dest_chan->context, final_dest_chan->exten, final_dest_chan->priority, final_dest_chan->name); if (ast_pbx_start(final_dest_chan) != AST_PBX_SUCCESS) { diff --git a/main/http.c b/main/http.c index 677e8c2b9..e2885882f 100644 --- a/main/http.c +++ b/main/http.c @@ -787,7 +787,7 @@ static struct ast_variable *parse_cookies(char *cookies) } if (option_debug) { - ast_log(LOG_DEBUG, "mmm ... cookie! Name: '%s' Value: '%s'\n", name, val); + ast_debug(1, "mmm ... cookie! Name: '%s' Value: '%s'\n", name, val); } var = ast_variable_new(name, val, __FILE__); diff --git a/main/logger.c b/main/logger.c index db9ec9bdd..f9032959e 100644 --- a/main/logger.c +++ b/main/logger.c @@ -1258,7 +1258,7 @@ char **ast_bt_get_symbols(void **addresses, size_t num_frames) 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"); + ast_debug(1, "Failed to find asterisk binary for debug symbols.\n"); dli.dli_fname = "asterisk"; } } @@ -1378,7 +1378,7 @@ void ast_backtrace(void) 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]); + ast_debug(1, "#%d: [%p] %s\n", i - 3, bt->addresses[i], strings[i]); } /* MALLOC_DEBUG will erroneously report an error here, unless we undef the macro. */ diff --git a/main/manager.c b/main/manager.c index 27fa6d8dd..8efc11d71 100644 --- a/main/manager.c +++ b/main/manager.c @@ -1214,7 +1214,7 @@ static struct mansession_session *unref_mansession(struct mansession_session *s) { int refcount = ao2_ref(s, -1); if (manager_debug) { - ast_log(LOG_DEBUG, "Mansession: %p refcount now %d\n", s, refcount - 1); + ast_debug(1, "Mansession: %p refcount now %d\n", s, refcount - 1); } return s; } @@ -4344,14 +4344,14 @@ static int manager_modulecheck(struct mansession *s, const struct message *m) cut = filename + strlen(filename); } snprintf(cut, (sizeof(filename) - strlen(filename)) - 1, ".so"); - ast_log(LOG_DEBUG, "**** ModuleCheck .so file %s\n", filename); + ast_debug(1, "**** ModuleCheck .so file %s\n", filename); res = ast_module_check(filename); if (!res) { astman_send_error(s, m, "Module not loaded"); return 0; } snprintf(cut, (sizeof(filename) - strlen(filename)) - 1, ".c"); - ast_log(LOG_DEBUG, "**** ModuleCheck .c file %s\n", filename); + ast_debug(1, "**** ModuleCheck .c file %s\n", filename); #if !defined(LOW_MEMORY) version = ast_file_version_find(filename); #endif diff --git a/main/pbx.c b/main/pbx.c index 1d8324e6e..fe52ea2c7 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -1811,10 +1811,10 @@ static void new_find_extension(const char *str, struct scoreboard *score, struct } \ } \ } - + #define NEW_MATCHER_RECURSE \ if (p->next_char && (*(str + 1) || (p->next_char->x[0] == '/' && p->next_char->x[1] == 0) \ - || p->next_char->x[0] == '!')) { \ + || p->next_char->x[0] == '!')) { \ if (*(str + 1) || p->next_char->x[0] == '!') { \ new_find_extension(str + 1, score, p->next_char, length + 1, spec + p->specificity, callerid, label, action); \ if (score->exten) { \ @@ -1825,7 +1825,7 @@ static void new_find_extension(const char *str, struct scoreboard *score, struct new_find_extension("/", score, p->next_char, length + 1, spec + p->specificity, callerid, label, action); \ if (score->exten || ((action == E_CANMATCH || action == E_MATCHMORE) && score->canmatch)) { \ ast_debug(4,"returning a (can/more) match--- %s\n", score->exten ? score->exten->exten : \ - "NULL"); \ + "NULL"); \ return; /* the first match is all we need */ \ } \ } \ @@ -1837,7 +1837,7 @@ static void new_find_extension(const char *str, struct scoreboard *score, struct return; \ } \ } - + NEW_MATCHER_CHK_MATCH; NEW_MATCHER_RECURSE; } @@ -1846,7 +1846,7 @@ static void new_find_extension(const char *str, struct scoreboard *score, struct NEW_MATCHER_CHK_MATCH; NEW_MATCHER_RECURSE; } - } else if (p->x[0] == 'X') { + } else if (p->x[0] == 'X') { if (p->x[1] == 0 && *str >= '0' && *str <= '9' ) { NEW_MATCHER_CHK_MATCH; NEW_MATCHER_RECURSE; @@ -2054,7 +2054,7 @@ static struct match_char *add_exten_to_pattern_tree(struct ast_context *con, str return 0; } #ifdef NEED_DEBUG - ast_log(LOG_DEBUG, "Adding exten %s%c%s to tree\n", s1, e1->matchcid ? '/' : ' ', e1->matchcid ? e1->cidmatch : ""); + ast_debug(1, "Adding exten %s%c%s to tree\n", s1, e1->matchcid ? '/' : ' ', e1->matchcid ? e1->cidmatch : ""); #endif m1 = con->pattern_tree; /* each pattern starts over at the root of the pattern tree */ m0 = &con->pattern_tree; @@ -2180,9 +2180,9 @@ static void create_match_char_tree(struct ast_context *con) #ifdef NEED_DEBUG int biggest_bucket, resizes, numobjs, numbucks; - ast_log(LOG_DEBUG,"Creating Extension Trie for context %s(%p)\n", con->name, con); + ast_debug(1, "Creating Extension Trie for context %s(%p)\n", con->name, con); ast_hashtab_get_stats(con->root_table, &biggest_bucket, &resizes, &numobjs, &numbucks); - ast_log(LOG_DEBUG,"This tree has %d objects in %d bucket lists, longest list=%d objects, and has resized %d times\n", + ast_debug(1, "This tree has %d objects in %d bucket lists, longest list=%d objects, and has resized %d times\n", numobjs, numbucks, biggest_bucket, resizes); #endif t1 = ast_hashtab_start_traversal(con->root_table); @@ -2701,7 +2701,7 @@ struct ast_exten *pbx_find_extension(struct ast_channel *chan, if (!tmp->pattern_tree && tmp->root_table) { create_match_char_tree(tmp); #ifdef NEED_DEBUG - ast_log(LOG_DEBUG, "Tree Created in context %s:\n", context); + ast_debug(1, "Tree Created in context %s:\n", context); log_match_char_tree(tmp->pattern_tree," "); #endif } @@ -6623,7 +6623,7 @@ static int manager_show_dialplan_helper(struct mansession *s, const struct messa if (!dpc->total_items++) manager_dpsendack(s, m); astman_append(s, "Event: ListDialplan\r\n%s", actionidtext); - astman_append(s, "Context: %s\r\nSwitch: %s/%s\r\nRegistrar: %s\r\n", ast_get_context_name(c), ast_get_switch_name(sw), ast_get_switch_data(sw), ast_get_switch_registrar(sw)); + astman_append(s, "Context: %s\r\nSwitch: %s/%s\r\nRegistrar: %s\r\n", ast_get_context_name(c), ast_get_switch_name(sw), ast_get_switch_data(sw), ast_get_switch_registrar(sw)); astman_append(s, "\r\n"); ast_debug(3, "manager_show_dialplan: Found Switch : %s \n", ast_get_switch_name(sw)); } diff --git a/main/say.c b/main/say.c index 3faf01bca..d16424da2 100644 --- a/main/say.c +++ b/main/say.c @@ -794,9 +794,9 @@ static int ast_say_number_full_da(struct ast_channel *chan, int num, const char } if (!res) { if (!ast_streamfile(chan, fn, language)) { - if ((audiofd > -1) && (ctrlfd > -1)) + if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); - else + else res = ast_waitstream(chan, ints); } ast_stopstream(chan); @@ -925,9 +925,9 @@ static int ast_say_number_full_de(struct ast_channel *chan, int num, const char } if (!res) { if (!ast_streamfile(chan, fn, language)) { - if ((audiofd > -1) && (ctrlfd > -1)) + if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); - else + else res = ast_waitstream(chan, ints); } ast_stopstream(chan); @@ -987,7 +987,7 @@ static int ast_say_number_full_en_GB(struct ast_channel *chan, int num, const ch num -= 100 * hundreds; if (num) playa++; - } else if (num < 1000000) { + } else if (num < 1000000) { res = ast_say_number_full_en_GB(chan, num / 1000, ints, language, audiofd, ctrlfd); if (res) return res; @@ -995,7 +995,7 @@ static int ast_say_number_full_en_GB(struct ast_channel *chan, int num, const ch num %= 1000; if (num && num < 100) playa++; - } else if (num < 1000000000) { + } else if (num < 1000000000) { int millions = num / 1000000; res = ast_say_number_full_en_GB(chan, millions, ints, language, audiofd, ctrlfd); if (res) @@ -1008,12 +1008,12 @@ static int ast_say_number_full_en_GB(struct ast_channel *chan, int num, const ch ast_debug(1, "Number '%d' is too big for me\n", num); res = -1; } - + if (!res) { if (!ast_streamfile(chan, fn, language)) { - if ((audiofd > -1) && (ctrlfd > -1)) + if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); - else + else res = ast_waitstream(chan, ints); } ast_stopstream(chan); @@ -1124,7 +1124,7 @@ static int ast_say_number_full_es(struct ast_channel *chan, int num, const char ast_stopstream(chan); } - + } return res; } @@ -1774,7 +1774,7 @@ static int ast_say_number_full_no(struct ast_channel *chan, int num, const char num -= 100 * hundreds; if (num) playa++; - } else if (num < 1000000) { + } else if (num < 1000000) { res = ast_say_number_full_no(chan, num / 1000, ints, language, "n", audiofd, ctrlfd); if (res) return res; @@ -1782,7 +1782,7 @@ static int ast_say_number_full_no(struct ast_channel *chan, int num, const char num %= 1000; if (num && num < 100) playa++; - } else if (num < 1000000000) { + } else if (num < 1000000000) { int millions = num / 1000000; res = ast_say_number_full_no(chan, millions, ints, language, "c", audiofd, ctrlfd); if (res) @@ -1795,12 +1795,12 @@ static int ast_say_number_full_no(struct ast_channel *chan, int num, const char ast_debug(1, "Number '%d' is too big for me\n", num); res = -1; } - + if (!res) { if (!ast_streamfile(chan, fn, language)) { - if ((audiofd > -1) && (ctrlfd > -1)) + if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); - else + else res = ast_waitstream(chan, ints); } ast_stopstream(chan); @@ -1835,12 +1835,12 @@ static char *pl_rzad_na_tekst(odmiana *odm, int i, int rzad) static char* pl_append(char* buffer, char* str) { strcpy(buffer, str); - buffer += strlen(str); + buffer += strlen(str); return buffer; } static void pl_odtworz_plik(struct ast_channel *chan, const char *language, int audiofd, int ctrlfd, const char *ints, char *fn) -{ +{ char file_name[255] = "digits/"; strcat(file_name, fn); ast_debug(1, "Trying to play: %s\n", file_name); @@ -2269,7 +2269,7 @@ static int ast_say_number_full_se(struct ast_channel *chan, int num, const char num %= 1000000; ast_copy_string(fn, "digits/million", sizeof(fn)); } else { /* Miljarder - Billions */ - ast_log(LOG_DEBUG, "Number '%d' is too big for me\n", num); + ast_debug(1, "Number '%d' is too big for me\n", num); return -1; } @@ -2350,7 +2350,7 @@ static int ast_say_number_full_zh(struct ast_channel *chan, int num, const char snprintf(fn, sizeof(fn), "digits/%d", (num / 100)); playh++; snprintf(buf, 10, "%d", num); - ast_log(LOG_DEBUG, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length); + ast_debug(1, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length); last_length = strlen(buf); num -= ((num / 100) * 100); } else if (num < 10000){ @@ -2358,7 +2358,7 @@ static int ast_say_number_full_zh(struct ast_channel *chan, int num, const char snprintf(fn, sizeof(fn), "digits/%d", (num / 1000)); playt++; snprintf(buf, 10, "%d", num); - ast_log(LOG_DEBUG, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length); + ast_debug(1, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length); last_length = strlen(buf); num -= ((num / 1000) * 1000); } else if (num < 100000000) { /* 100,000,000 */ @@ -2366,7 +2366,7 @@ static int ast_say_number_full_zh(struct ast_channel *chan, int num, const char if (res) return res; snprintf(buf, 10, "%d", num); - ast_log(LOG_DEBUG, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length); + ast_debug(1, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length); num -= ((num / 10000) * 10000); last_length = strlen(buf); snprintf(fn, sizeof(fn), "digits/wan"); @@ -2376,7 +2376,7 @@ static int ast_say_number_full_zh(struct ast_channel *chan, int num, const char if (res) return res; snprintf(buf, 10, "%d", num); - ast_log(LOG_DEBUG, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length); + ast_debug(1, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length); last_length = strlen(buf); num -= ((num / 100000000) * 100000000); snprintf(fn, sizeof(fn), "digits/yi"); @@ -2443,7 +2443,7 @@ static int ast_say_number_full_ur(struct ast_channel *chan, int num, const char num = num % 10000000; snprintf(fn, sizeof(fn), "digits/crore"); } else { - ast_log(LOG_DEBUG, "Number '%d' is too big for me\n", num); + ast_debug(1, "Number '%d' is too big for me\n", num); res = -1; } @@ -2536,7 +2536,7 @@ static int ast_say_number_full_ru(struct ast_channel *chan, int num, const char ast_copy_string(fn, "digits/thousands", sizeof(fn)); } num %= 1000; - } else if (num < 1000000000) { /* 1,000,000,000 */ + } else if (num < 1000000000) { /* 1,000,000,000 */ lastdigits = get_lastdigits_ru(num / 1000000); /* say millions */ res = ast_say_number_full_ru(chan, num / 1000000, ints, language, NULL, audiofd, ctrlfd); @@ -2824,7 +2824,7 @@ static int ast_say_enumeration_full_en(struct ast_channel *chan, int num, const res = ast_say_number_full_en(chan, billions, ints, language, audiofd, ctrlfd); if (res) return res; - if (num) { + if (num) { ast_copy_string(fn, "digits/billion", sizeof(fn)); } else { ast_copy_string(fn, "digits/h-billion", sizeof(fn)); @@ -2994,7 +2994,7 @@ static int ast_say_enumeration_full_da(struct ast_channel *chan, int num, const res = ast_say_number_full_de(chan, billions, ints, language, options, audiofd, ctrlfd); if (res) return res; - if (num) { + if (num) { ast_copy_string(fn, "digits/milliards", sizeof(fna)); } else { snprintf(fn, sizeof(fna), "digits/h-milliard%s", gender); @@ -3011,9 +3011,9 @@ static int ast_say_enumeration_full_da(struct ast_channel *chan, int num, const if (!res) { if (!ast_streamfile(chan, fn, language)) { - if ((audiofd > -1) && (ctrlfd > -1)) + if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); - else + else res = ast_waitstream(chan, ints); } ast_stopstream(chan); @@ -3157,7 +3157,7 @@ static int ast_say_enumeration_full_de(struct ast_channel *chan, int num, const res = ast_say_number_full_de(chan, billions, ints, language, options, audiofd, ctrlfd); if (res) return res; - if (num) { + if (num) { ast_copy_string(fn, "digits/milliards", sizeof(fna)); } else { snprintf(fn, sizeof(fna), "digits/h-milliard%s", gender); @@ -3174,9 +3174,9 @@ static int ast_say_enumeration_full_de(struct ast_channel *chan, int num, const if (!res) { if (!ast_streamfile(chan, fn, language)) { - if ((audiofd > -1) && (ctrlfd > -1)) + if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); - else + else res = ast_waitstream(chan, ints); } ast_stopstream(chan); @@ -3267,7 +3267,7 @@ static int ast_say_enumeration_full_he(struct ast_channel *chan, int num, const snprintf(fn, sizeof(fn), "digits/1m"); num = num % 1000000; } else { - ast_log(LOG_DEBUG, "Number '%d' is too big for me\n", num); + ast_debug(1, "Number '%d' is too big for me\n", num); res = -1; } if (!res) { @@ -4349,7 +4349,7 @@ int ast_say_date_with_format_th(struct ast_channel *chan, time_t t, const char * ast_localtime(&when, &tm, tzone); for (offset=0 ; format[offset] != '\0' ; offset++) { - ast_log(LOG_DEBUG, "Parsing %c (offset %d) in %s\n", format[offset], offset, format); + ast_debug(1, "Parsing %c (offset %d) in %s\n", format[offset], offset, format); switch (format[offset]) { /* NOTE: if you add more options here, please try to be consistent with strftime(3) */ case '\'': @@ -7250,7 +7250,7 @@ static int gr_say_number_female(int num, struct ast_channel *chan, const char *i res = wait_file(chan, ints, fn, lang); } else if (num < 13) { res = ast_say_number(chan, num, ints, lang, (char *) NULL); - } else if (num <100 ) { + } else if (num <100 ) { tmp = (num/10) * 10; left = num - tmp; snprintf(fn, sizeof(fn), "digits/%d", tmp); @@ -7259,7 +7259,7 @@ static int gr_say_number_female(int num, struct ast_channel *chan, const char *i res = ast_waitstream(chan, ints); if (left) gr_say_number_female(left, chan, ints, lang); - + } else { return -1; } @@ -7318,7 +7318,7 @@ static int ast_say_number_full_gr(struct ast_channel *chan, int num, const char snprintf(fn, sizeof(fn), "digits/xilia"); num %= 1000; } else { - /* num > 1000 */ + /* num > 1000 */ if (num < 1000000) { res = ast_say_number_full_gr(chan, (num / 1000), ints, chan->language, audiofd, ctrlfd); if (res) @@ -7337,7 +7337,7 @@ static int ast_say_number_full_gr(struct ast_channel *chan, int num, const char res = -1; } } - } + } if (!res) { if (!ast_streamfile(chan, fn, language)) { if ((audiofd > -1) && (ctrlfd > -1)) @@ -7501,7 +7501,7 @@ static int ast_say_date_with_format_gr(struct ast_channel *chan, time_t t, const format = "AdBY 'digits/at' IMp"; ast_localtime(&when, &tm, tzone); - + for (offset=0 ; format[offset] != '\0' ; offset++) { ast_debug(1, "Parsing %c (offset %d) in %s\n", format[offset], offset, format); switch (format[offset]) { diff --git a/main/taskprocessor.c b/main/taskprocessor.c index e09944bf6..e0d7e5b94 100644 --- a/main/taskprocessor.c +++ b/main/taskprocessor.c @@ -346,13 +346,13 @@ static int tps_cmp_cb(void *obj, void *arg, int flags) static void tps_taskprocessor_destroy(void *tps) { struct ast_taskprocessor *t = tps; - + if (!tps) { ast_log(LOG_ERROR, "missing taskprocessor\n"); return; } - ast_log(LOG_DEBUG, "destroying taskprocessor '%s'\n", t->name); - /* kill it */ + ast_debug(1, "destroying taskprocessor '%s'\n", t->name); + /* kill it */ ast_mutex_lock(&t->taskprocessor_lock); t->poll_thread_run = 0; ast_cond_signal(&t->poll_cond); diff --git a/main/xmldoc.c b/main/xmldoc.c index d3597056e..bbbb590e4 100644 --- a/main/xmldoc.c +++ b/main/xmldoc.c @@ -1793,7 +1793,7 @@ static char *xmldoc_build_field(const char *type, const char *name, const char * node = ast_xml_find_element(ast_xml_node_get_children(node), var, NULL, NULL); if (!node || !ast_xml_node_get_children(node)) { - ast_log(LOG_DEBUG, "Cannot find variable '%s' in tree '%s'\n", var, name); + ast_debug(1, "Cannot find variable '%s' in tree '%s'\n", var, name); return ret; } |