diff options
Diffstat (limited to 'res')
-rw-r--r-- | res/res_agi.c | 15 | ||||
-rw-r--r-- | res/res_config_odbc.c | 12 | ||||
-rw-r--r-- | res/res_config_pgsql.c | 10 | ||||
-rw-r--r-- | res/res_crypto.c | 3 | ||||
-rw-r--r-- | res/res_features.c | 54 | ||||
-rw-r--r-- | res/res_jabber.c | 40 | ||||
-rw-r--r-- | res/res_musiconhold.c | 15 | ||||
-rw-r--r-- | res/res_smdi.c | 3 | ||||
-rw-r--r-- | res/res_snmp.c | 4 | ||||
-rw-r--r-- | res/res_speech.c | 9 |
10 files changed, 59 insertions, 106 deletions
diff --git a/res/res_agi.c b/res/res_agi.c index 44ff18d43..eedad4213 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -346,8 +346,7 @@ static enum agi_result launch_script(char *script, char *argv[], int *fds, int * _exit(1); } pthread_sigmask(SIG_SETMASK, &old_set, NULL); - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Launched AGI Script %s\n", script); + ast_verb(3, "Launched AGI Script %s\n", script); fds[0] = toast[0]; fds[1] = fromast[1]; if (efd) @@ -584,8 +583,7 @@ static int handle_streamfile(struct ast_channel *chan, AGI *agi, int argc, char vfs = ast_openvstream(chan, argv[2], chan->language); ast_debug(vfs && 1, "Ooh, found a video stream, too\n"); - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Playing '%s' (escape_digits=%s) (sample_offset %ld)\n", argv[2], edigits, sample_offset); + ast_verb(3, "Playing '%s' (escape_digits=%s) (sample_offset %ld)\n", argv[2], edigits, sample_offset); ast_seekstream(fs, 0, SEEK_END); max_length = ast_tellstream(fs); @@ -640,8 +638,7 @@ static int handle_getoption(struct ast_channel *chan, AGI *agi, int argc, char * vfs = ast_openvstream(chan, argv[2], chan->language); ast_debug(vfs && 1, "Ooh, found a video stream, too\n"); - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Playing '%s' (escape_digits=%s) (timeout %d)\n", argv[2], edigits, timeout); + ast_verb(3, "Playing '%s' (escape_digits=%s) (timeout %d)\n", argv[2], edigits, timeout); ast_seekstream(fs, 0, SEEK_END); max_length = ast_tellstream(fs); @@ -1096,8 +1093,7 @@ static int handle_exec(struct ast_channel *chan, AGI *agi, int argc, char **argv if (argc < 2) return RESULT_SHOWUSAGE; - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "AGI Script Executing Application: (%s) Options: (%s)\n", argv[1], argv[2]); + ast_verb(3, "AGI Script Executing Application: (%s) Options: (%s)\n", argv[1], argv[2]); if ((app = pbx_findapp(argv[1]))) { res = pbx_exec(chan, app, argv[2]); @@ -1870,8 +1866,7 @@ static enum agi_result run_agi(struct ast_channel *chan, char *request, AGI *agi /* Program terminated */ if (returnstatus && returnstatus != AST_PBX_KEEPALIVE) returnstatus = -1; - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "AGI Script %s completed, returning %d\n", request, returnstatus); + ast_verb(3, "AGI Script %s completed, returning %d\n", request, returnstatus); if (pid > 0) waitpid(pid, status, 0); /* No need to kill the pid anymore, since they closed us */ diff --git a/res/res_config_odbc.c b/res/res_config_odbc.c index 2c8b90e3d..a5294eb02 100644 --- a/res/res_config_odbc.c +++ b/res/res_config_odbc.c @@ -500,15 +500,13 @@ static SQLHSTMT config_odbc_prepare(struct odbc_obj *obj, void *data) res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &sth); if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) { - if (option_verbose > 3) - ast_verbose( VERBOSE_PREFIX_4 "Failure in AllocStatement %d\n", res); + ast_verb(4, "Failure in AllocStatement %d\n", res); return NULL; } res = SQLPrepare(sth, (unsigned char *)q->sql, SQL_NTS); if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) { - if (option_verbose > 3) - ast_verbose( VERBOSE_PREFIX_4 "Error in PREPARE %d\n", res); + ast_verb(4, "Error in PREPARE %d\n", res); SQLFreeHandle(SQL_HANDLE_STMT, sth); return NULL; } @@ -615,16 +613,14 @@ static struct ast_config_engine odbc_engine = { static int unload_module (void) { ast_config_engine_deregister(&odbc_engine); - if (option_verbose) - ast_verbose("res_config_odbc unloaded.\n"); + ast_verb(1, "res_config_odbc unloaded.\n"); return 0; } static int load_module (void) { ast_config_engine_register(&odbc_engine); - if (option_verbose) - ast_verbose("res_config_odbc loaded.\n"); + ast_verb(1, "res_config_odbc loaded.\n"); return 0; } diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c index 4b9c1898f..2fb0a0e38 100644 --- a/res/res_config_pgsql.c +++ b/res/res_config_pgsql.c @@ -548,9 +548,7 @@ static int load_module(void) } ast_config_engine_register(&pgsql_engine); - if (option_verbose) { - ast_verbose("Postgresql RealTime driver loaded.\n"); - } + ast_verb(1, "Postgresql RealTime driver loaded.\n"); ast_cli_register_multiple(cli_realtime, sizeof(cli_realtime) / sizeof(struct ast_cli_entry)); ast_mutex_unlock(&pgsql_lock); @@ -569,9 +567,7 @@ static int unload_module(void) }; ast_cli_unregister_multiple(cli_realtime, sizeof(cli_realtime) / sizeof(struct ast_cli_entry)); ast_config_engine_deregister(&pgsql_engine); - if (option_verbose) { - ast_verbose("Postgresql RealTime unloaded.\n"); - } + ast_verb(1, "Postgresql RealTime unloaded.\n"); /* Unlock so something else can destroy the lock. */ ast_mutex_unlock(&pgsql_lock); @@ -596,7 +592,7 @@ static int reload(void) ast_debug(1, "Postgresql RealTime: Cannot Connect: %s\n", PQerrorMessage(pgsqlConn)); } - ast_verbose(VERBOSE_PREFIX_2 "Postgresql RealTime reloaded.\n"); + ast_verb(2, "Postgresql RealTime reloaded.\n"); /* Done reloading. Release lock so others can now use driver. */ ast_mutex_unlock(&pgsql_lock); diff --git a/res/res_crypto.c b/res/res_crypto.c index cdb027acb..65c5b768d 100644 --- a/res/res_crypto.c +++ b/res/res_crypto.c @@ -247,8 +247,7 @@ static struct ast_key *try_load_key(char *dir, char *fname, int ifd, int ofd, in if (RSA_size(key->rsa) == 128) { /* Key loaded okay */ key->ktype &= ~KEY_NEEDS_PASSCODE; - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Loaded %s key '%s'\n", key->ktype == AST_KEY_PUBLIC ? "PUBLIC" : "PRIVATE", key->name); + ast_verb(3, "Loaded %s key '%s'\n", key->ktype == AST_KEY_PUBLIC ? "PUBLIC" : "PRIVATE", key->name); ast_debug(1, "Key '%s' loaded OK\n", key->name); key->delme = 0; } else diff --git a/res/res_features.c b/res/res_features.c index 3f71bfadf..ef8e81b69 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -434,8 +434,7 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou AST_LIST_UNLOCK(&parkinglot); /* Wake up the (presumably select()ing) thread */ pthread_kill(parking_thread, SIGURG); - if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "Parked %s on %d@%s. Will timeout back to extension [%s] %s, %d in %d seconds\n", pu->chan->name, pu->parkingnum, parking_con, pu->context, pu->exten, pu->priority, (pu->parkingtime/1000)); + ast_verb(2, "Parked %s on %d@%s. Will timeout back to extension [%s] %s, %d in %d seconds\n", pu->chan->name, pu->parkingnum, parking_con, pu->context, pu->exten, pu->priority, (pu->parkingtime/1000)); if (pu->parkingnum != -1) snprintf(pu->parkingexten, sizeof(pu->parkingexten), "%d", x); @@ -602,8 +601,7 @@ static int builtin_automonitor(struct ast_channel *chan, struct ast_channel *pee } if (callee_chan->monitor) { - if (option_verbose > 3) - ast_verbose(VERBOSE_PREFIX_3 "User hit '%s' to stop recording call.\n", code); + ast_verb(4, "User hit '%s' to stop recording call.\n", code); ast_monitor_stop(callee_chan, 1); return FEATURE_RETURN_SUCCESS; } @@ -639,8 +637,7 @@ static int builtin_automonitor(struct ast_channel *chan, struct ast_channel *pee args[x] = '-'; } - if (option_verbose > 3) - ast_verbose(VERBOSE_PREFIX_3 "User hit '%s' to record call. filename: %s\n", code, args); + ast_verb(4, "User hit '%s' to record call. filename: %s\n", code, args); pbx_exec(callee_chan, monitor_app, args); pbx_builtin_setvar_helper(callee_chan, "TOUCH_MONITOR_OUTPUT", touch_filename); @@ -655,8 +652,7 @@ static int builtin_automonitor(struct ast_channel *chan, struct ast_channel *pee static int builtin_disconnect(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense) { - if (option_verbose > 3) - ast_verbose(VERBOSE_PREFIX_3 "User hit '%s' to disconnect call.\n", code); + ast_verb(4, "User hit '%s' to disconnect call.\n", code); return FEATURE_RETURN_HANGUP; } @@ -742,8 +738,7 @@ static int builtin_blindtransfer(struct ast_channel *chan, struct ast_channel *p } if (!transferee->pbx) { /* Doh! Use our handy async_goto functions */ - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Transferring %s to '%s' (context %s) priority 1\n" + ast_verb(3, "Transferring %s to '%s' (context %s) priority 1\n" ,transferee->name, xferto, transferer_real_context); if (ast_async_goto(transferee, transferer_real_context, xferto, 1)) ast_log(LOG_WARNING, "Async goto failed :-(\n"); @@ -755,8 +750,7 @@ static int builtin_blindtransfer(struct ast_channel *chan, struct ast_channel *p check_goto_on_transfer(transferer); return res; } else { - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Unable to find extension '%s' in context '%s'\n", xferto, transferer_real_context); + ast_verb(3, "Unable to find extension '%s' in context '%s'\n", xferto, transferer_real_context); } if (ast_stream_and_wait(transferer, xferfailsound, AST_DIGIT_ANY) < 0) { finishup(transferee); @@ -765,8 +759,7 @@ static int builtin_blindtransfer(struct ast_channel *chan, struct ast_channel *p ast_stopstream(transferer); res = finishup(transferee); if (res) { - if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "Hungup during autoservice stop on '%s'\n", transferee->name); + ast_verb(2, "Hungup during autoservice stop on '%s'\n", transferee->name); return res; } return FEATURE_RETURN_SUCCESS; @@ -1040,8 +1033,7 @@ void ast_register_feature(struct ast_call_feature *feature) AST_LIST_INSERT_HEAD(&feature_list,feature,feature_entry); AST_LIST_UNLOCK(&feature_list); - if (option_verbose >= 2) - ast_verbose(VERBOSE_PREFIX_2 "Registered Feature '%s'\n",feature->sname); + ast_verb(2, "Registered Feature '%s'\n",feature->sname); } /*! \brief This function must be called while feature_groups is locked... */ @@ -1066,8 +1058,7 @@ static struct feature_group* register_group(const char *fgname) AST_LIST_INSERT_HEAD(&feature_groups, fg, entry); - if (option_verbose >= 2) - ast_verbose(VERBOSE_PREFIX_2 "Registered group '%s'\n", fg->gname); + ast_verb(2, "Registered group '%s'\n", fg->gname); return fg; } @@ -1102,8 +1093,7 @@ static void register_group_feature(struct feature_group *fg, const char *exten, AST_LIST_INSERT_HEAD(&fg->features, fge, entry); - if (option_verbose >= 2) - ast_verbose(VERBOSE_PREFIX_2 "Registered feature '%s' for group '%s' at exten '%s'\n", + ast_verb(2, "Registered feature '%s' for group '%s' at exten '%s'\n", feature->sname, fg->gname, exten); } @@ -1362,8 +1352,7 @@ static int ast_feature_interpret(struct ast_channel *chan, struct ast_channel *p /* Feature is up for consideration */ if (!strcmp(feature->exten, code)) { - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 " Feature Found: %s exten: %s\n",feature->sname, tok); + ast_verb(3, " Feature Found: %s exten: %s\n",feature->sname, tok); res = feature->operation(chan, peer, config, code, sense); AST_LIST_UNLOCK(&feature_list); break; @@ -1491,13 +1480,11 @@ static struct ast_channel *ast_feature_request_and_dial(struct ast_channel *call if (f->frametype == AST_FRAME_CONTROL || f->frametype == AST_FRAME_DTMF || f->frametype == AST_FRAME_TEXT) { if (f->subclass == AST_CONTROL_RINGING) { state = f->subclass; - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "%s is ringing\n", chan->name); + ast_verb(3, "%s is ringing\n", chan->name); ast_indicate(caller, AST_CONTROL_RINGING); } else if ((f->subclass == AST_CONTROL_BUSY) || (f->subclass == AST_CONTROL_CONGESTION)) { state = f->subclass; - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "%s is busy\n", chan->name); + ast_verb(3, "%s is busy\n", chan->name); ast_indicate(caller, AST_CONTROL_BUSY); ast_frfree(f); f = NULL; @@ -1955,8 +1942,7 @@ static void *do_parking_thread(void *ignore) post_manager_event("ParkedCallTimeOut", pu); - if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "Timeout for %s parked on %d. Returning to %s,%s,%d\n", chan->name, pu->parkingnum, chan->context, chan->exten, chan->priority); + ast_verb(2, "Timeout for %s parked on %d. Returning to %s,%s,%d\n", chan->name, pu->parkingnum, chan->context, chan->exten, chan->priority); /* Start up the PBX, or hang them up */ if (ast_pbx_start(chan)) { ast_log(LOG_WARNING, "Unable to restart the PBX for user on '%s', hanging them up...\n", chan->name); @@ -1994,8 +1980,7 @@ static void *do_parking_thread(void *ignore) post_manager_event("ParkedCallGiveUp", pu); /* There's a problem, hang them up*/ - if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "%s got tired of being parked\n", chan->name); + ast_verb(2, "%s got tired of being parked\n", chan->name); ast_hangup(chan); /* And take them out of the parking lot */ AST_LIST_REMOVE_CURRENT(&parkinglot, list); @@ -2177,8 +2162,7 @@ static int park_exec(struct ast_channel *chan, void *data) } /* This runs sorta backwards, since we give the incoming channel control, as if it were the person called. */ - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Channel %s connected to parked call %d\n", chan->name, park); + ast_verb(3, "Channel %s connected to parked call %d\n", chan->name, park); pbx_builtin_setvar_helper(chan, "PARKEDCHANNEL", peer->name); ast_cdr_setdestchan(chan->cdr, peer->name); @@ -2204,8 +2188,7 @@ static int park_exec(struct ast_channel *chan, void *data) /*! \todo XXX Play a message XXX */ if (ast_stream_and_wait(chan, "pbx-invalidpark", "")) ast_log(LOG_WARNING, "ast_streamfile of %s failed on %s\n", "pbx-invalidpark", chan->name); - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Channel %s tried to talk to nonexistent parked call %d\n", chan->name, park); + ast_verb(3, "Channel %s tried to talk to nonexistent parked call %d\n", chan->name, park); res = -1; } @@ -2810,8 +2793,7 @@ static int load_config(void) ast_register_feature(feature); - if (option_verbose >= 1) - ast_verbose(VERBOSE_PREFIX_2 "Mapping Feature '%s' to app '%s(%s)' with code '%s'\n", var->name, app, app_args, exten); + ast_verb(2, "Mapping Feature '%s' to app '%s(%s)' with code '%s'\n", var->name, app, app_args, exten); } ast_unregister_groups(); diff --git a/res/res_jabber.c b/res/res_jabber.c index 2520f02ab..df8c1c635 100644 --- a/res/res_jabber.c +++ b/res/res_jabber.c @@ -1389,41 +1389,39 @@ static void aji_handle_presence(struct aji_client *client, ikspak *pak) iks_delete(iq); } } - if (option_verbose > 4) { switch (pak->subtype) { case IKS_TYPE_AVAILABLE: - ast_verbose(VERBOSE_PREFIX_3 "JABBER: I am available ^_* %i\n", pak->subtype); + ast_verb(5, "JABBER: I am available ^_* %i\n", pak->subtype); break; case IKS_TYPE_UNAVAILABLE: - ast_verbose(VERBOSE_PREFIX_3 "JABBER: I am unavailable ^_* %i\n", pak->subtype); + ast_verb(5, "JABBER: I am unavailable ^_* %i\n", pak->subtype); break; default: - ast_verbose(VERBOSE_PREFIX_3 "JABBER: Ohh sexy and the wrong type: %i\n", pak->subtype); + ast_verb(5, "JABBER: Ohh sexy and the wrong type: %i\n", pak->subtype); } switch (pak->show) { case IKS_SHOW_UNAVAILABLE: - ast_verbose(VERBOSE_PREFIX_3 "JABBER: type: %i subtype %i\n", pak->subtype, pak->show); + ast_verb(5, "JABBER: type: %i subtype %i\n", pak->subtype, pak->show); break; case IKS_SHOW_AVAILABLE: - ast_verbose(VERBOSE_PREFIX_3 "JABBER: type is available\n"); + ast_verb(5, "JABBER: type is available\n"); break; case IKS_SHOW_CHAT: - ast_verbose(VERBOSE_PREFIX_3 "JABBER: type: %i subtype %i\n", pak->subtype, pak->show); + ast_verb(5, "JABBER: type: %i subtype %i\n", pak->subtype, pak->show); break; case IKS_SHOW_AWAY: - ast_verbose(VERBOSE_PREFIX_3 "JABBER: type is away\n"); + ast_verb(5, "JABBER: type is away\n"); break; case IKS_SHOW_XA: - ast_verbose(VERBOSE_PREFIX_3 "JABBER: type: %i subtype %i\n", pak->subtype, pak->show); + ast_verb(5, "JABBER: type: %i subtype %i\n", pak->subtype, pak->show); break; case IKS_SHOW_DND: - ast_verbose(VERBOSE_PREFIX_3 "JABBER: type: %i subtype %i\n", pak->subtype, pak->show); + ast_verb(5, "JABBER: type: %i subtype %i\n", pak->subtype, pak->show); break; default: - ast_verbose(VERBOSE_PREFIX_3 "JABBER: Kinky! how did that happen %i\n", pak->show); + ast_verb(5, "JABBER: Kinky! how did that happen %i\n", pak->show); } } -} /*! * \brief handles subscription requests. @@ -1455,26 +1453,24 @@ static void aji_handle_subscribe(struct aji_client *client, ikspak *pak) if(client->component) aji_set_presence(client, pak->from->full, iks_find_attrib(pak->x, "to"), 1, client->statusmessage); } - if (option_verbose > 4) { switch (pak->subtype) { case IKS_TYPE_SUBSCRIBE: - ast_verbose(VERBOSE_PREFIX_3 "JABBER: This is a subcription of type %i\n", pak->subtype); + ast_verb(5, "JABBER: This is a subcription of type %i\n", pak->subtype); break; case IKS_TYPE_SUBSCRIBED: - ast_verbose(VERBOSE_PREFIX_3 "JABBER: This is a subcription of type %i\n", pak->subtype); + ast_verb(5, "JABBER: This is a subcription of type %i\n", pak->subtype); break; case IKS_TYPE_UNSUBSCRIBE: - ast_verbose(VERBOSE_PREFIX_3 "JABBER: This is a subcription of type %i\n", pak->subtype); + ast_verb(5, "JABBER: This is a subcription of type %i\n", pak->subtype); break; case IKS_TYPE_UNSUBSCRIBED: - ast_verbose(VERBOSE_PREFIX_3 "JABBER: This is a subcription of type %i\n", pak->subtype); + ast_verb(5, "JABBER: This is a subcription of type %i\n", pak->subtype); break; default: /*IKS_TYPE_ERROR: */ - ast_verbose(VERBOSE_PREFIX_3 "JABBER: This is a subcription of type %i\n", pak->subtype); + ast_verb(5, "JABBER: This is a subcription of type %i\n", pak->subtype); break; } } -} /*! * \brief sends messages. @@ -1605,8 +1601,7 @@ static void *aji_recv_loop(void *data) do { if (res != IKS_OK) { while(res != IKS_OK) { - if(option_verbose > 3) - ast_verbose("JABBER: reconnecting.\n"); + ast_verb(4, "JABBER: reconnecting.\n"); res = aji_reconnect(client); sleep(4); } @@ -1968,8 +1963,7 @@ static int aji_initialize(struct aji_client *client) int ast_aji_disconnect(struct aji_client *client) { if (client) { - if (option_verbose > 3) - ast_verbose(VERBOSE_PREFIX_3 "JABBER: Disconnecting\n"); + ast_verb(4, "JABBER: Disconnecting\n"); iks_disconnect(client->p); iks_parser_delete(client->p); ASTOBJ_UNREF(client, aji_client_destroy); diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 84a44f3b7..8f51e77af 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -202,8 +202,7 @@ static void moh_files_release(struct ast_channel *chan, void *data) ast_closestream(chan->stream); chan->stream = NULL; } - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Stopped music on hold on %s\n", chan->name); + ast_verb(3, "Stopped music on hold on %s\n", chan->name); if (state->origwfmt && ast_set_write_format(chan, state->origwfmt)) { ast_log(LOG_WARNING, "Unable to restore channel '%s' to format '%d'\n", chan->name, state->origwfmt); @@ -318,8 +317,7 @@ static void *moh_files_alloc(struct ast_channel *chan, void *params) state->origwfmt = chan->writeformat; - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Started music on hold, class '%s', on %s\n", class->name, chan->name); + ast_verb(3, "Started music on hold, class '%s', on %s\n", class->name, chan->name); } return chan->music_state; @@ -719,8 +717,7 @@ static void moh_release(struct ast_channel *chan, void *data) if (chan) { if (oldwfmt && ast_set_write_format(chan, oldwfmt)) ast_log(LOG_WARNING, "Unable to restore channel '%s' to format %s\n", chan->name, ast_getformatname(oldwfmt)); - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Stopped music on hold on %s\n", chan->name); + ast_verb(3, "Stopped music on hold on %s\n", chan->name); } } @@ -736,8 +733,7 @@ static void *moh_alloc(struct ast_channel *chan, void *params) moh_release(NULL, res); res = NULL; } - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Started music on hold, class '%s', on channel '%s'\n", class->name, chan->name); + ast_verb(3, "Started music on hold, class '%s', on channel '%s'\n", class->name, chan->name); } return res; } @@ -1091,8 +1087,7 @@ static void ast_moh_destroy(void) char buff[8192]; int bytes, tbytes = 0, stime = 0, pid = 0; - if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "Destroying musiconhold processes\n"); + ast_verb(2, "Destroying musiconhold processes\n"); AST_RWLIST_WRLOCK(&mohclasses); while ((moh = AST_RWLIST_REMOVE_HEAD(&mohclasses, list))) { diff --git a/res/res_smdi.c b/res/res_smdi.c index 951c2835e..f1f1b193e 100644 --- a/res/res_smdi.c +++ b/res/res_smdi.c @@ -668,8 +668,7 @@ static int smdi_load(int reload) iface->msg_expiry = msg_expiry; /* start the listner thread */ - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Starting SMDI monitor thread for %s\n", iface->name); + ast_verb(3, "Starting SMDI monitor thread for %s\n", iface->name); if (ast_pthread_create_background(&iface->thread, NULL, smdi_read, iface)) { ast_log(LOG_ERROR, "Error starting SMDI monitor thread for %s\n", iface->name); ASTOBJ_UNREF(iface, ast_smdi_interface_destroy); diff --git a/res/res_snmp.c b/res/res_snmp.c index b820c98ac..05c483ec5 100644 --- a/res/res_snmp.c +++ b/res/res_snmp.c @@ -99,7 +99,7 @@ static int load_module(void) if(!load_config()) return AST_MODULE_LOAD_DECLINE; - ast_verbose(VERBOSE_PREFIX_1 "Loading [Sub]Agent Module\n"); + ast_verb(1, "Loading [Sub]Agent Module\n"); res_snmp_dont_stop = 1; if (res_snmp_enabled) @@ -110,7 +110,7 @@ static int load_module(void) static int unload_module(void) { - ast_verbose(VERBOSE_PREFIX_1 "Unloading [Sub]Agent Module\n"); + ast_verb(1, "Unloading [Sub]Agent Module\n"); res_snmp_dont_stop = 0; return ((thread != AST_PTHREADT_NULL) ? pthread_join(thread, NULL) : 0); diff --git a/res/res_speech.c b/res/res_speech.c index 9047ad254..cf830344f 100644 --- a/res/res_speech.c +++ b/res/res_speech.c @@ -274,16 +274,14 @@ int ast_speech_register(struct ast_speech_engine *engine) return -1; } - if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "Registered speech recognition engine '%s'\n", engine->name); + ast_verb(2, "Registered speech recognition engine '%s'\n", engine->name); /* Add to the engine linked list and make default if needed */ AST_RWLIST_WRLOCK(&engines); AST_RWLIST_INSERT_HEAD(&engines, engine, list); if (!default_engine) { default_engine = engine; - if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "Made '%s' the default speech recognition engine\n", engine->name); + ast_verb(2, "Made '%s' the default speech recognition engine\n", engine->name); } AST_RWLIST_UNLOCK(&engines); @@ -307,8 +305,7 @@ int ast_speech_unregister(char *engine_name) /* If this was the default engine, we need to pick a new one */ if (!default_engine) default_engine = AST_RWLIST_FIRST(&engines); - if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "Unregistered speech recognition engine '%s'\n", engine_name); + ast_verb(2, "Unregistered speech recognition engine '%s'\n", engine_name); /* All went well */ res = 0; break; |