]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Do a massive conversion for using the ast_verb() macro
authorRussell Bryant <russell@russellbryant.com>
Thu, 26 Jul 2007 15:49:18 +0000 (15:49 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 26 Jul 2007 15:49:18 +0000 (15:49 +0000)
(closes issue #10277, patches by mvanbaak)

Basically, this changes ...

if (option_verbose > 2)
   ast_verbose(VERBOSE_PREFIX_3, "Something\n");

to ...

ast_verb(3, "Something\n");

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77299 65c4cc65-6c06-0410-ace0-fbb531ad65f3

79 files changed:
apps/app_adsiprog.c
apps/app_alarmreceiver.c
apps/app_amd.c
apps/app_chanspy.c
apps/app_db.c
apps/app_dial.c
apps/app_flash.c
apps/app_followme.c
apps/app_getcpeid.c
apps/app_macro.c
apps/app_meetme.c
apps/app_parkandannounce.c
apps/app_queue.c
apps/app_read.c
apps/app_rpt.c
apps/app_sms.c
apps/app_voicemail.c
apps/app_waitforring.c
apps/app_waitforsilence.c
apps/app_while.c
apps/app_zapras.c
apps/app_zapscan.c
cdr/cdr_adaptive_odbc.c
cdr/cdr_odbc.c
channels/chan_agent.c
channels/chan_alsa.c
channels/chan_h323.c
channels/chan_iax2.c
channels/chan_mgcp.c
channels/chan_misdn.c
channels/chan_oss.c
channels/chan_phone.c
channels/chan_sip.c
channels/chan_skinny.c
channels/chan_vpb.cc
channels/chan_zap.c
channels/iax2-provision.c
codecs/codec_adpcm.c
codecs/codec_alaw.c
codecs/codec_g722.c
codecs/codec_g726.c
codecs/codec_gsm.c
codecs/codec_lpc10.c
codecs/codec_speex.c
codecs/codec_ulaw.c
codecs/codec_zap.c
funcs/func_odbc.c
funcs/func_timeout.c
main/abstract_jb.c
main/app.c
main/cdr.c
main/channel.c
main/config.c
main/dial.c
main/dnsmgr.c
main/file.c
main/image.c
main/indications.c
main/loader.c
main/manager.c
main/rtp.c
main/say.c
main/srv.c
main/translate.c
main/udptl.c
pbx/pbx_dundi.c
pbx/pbx_gtkconsole.c
pbx/pbx_realtime.c
pbx/pbx_spool.c
res/res_agi.c
res/res_config_odbc.c
res/res_config_pgsql.c
res/res_crypto.c
res/res_features.c
res/res_jabber.c
res/res_musiconhold.c
res/res_smdi.c
res/res_snmp.c
res/res_speech.c

index eee3b33026cad052da5a00aa61e419b3f3035fe7..b19ae471445cbd696af42c7dc5c1efa224e839ee 100644 (file)
@@ -1448,8 +1448,7 @@ static int adsi_prog(struct ast_channel *chan, char *script)
        /* Now begin the download attempt */
        if (ast_adsi_begin_download(chan, scr->desc, scr->fdn, scr->sec, scr->ver)) {
                /* User rejected us for some reason */
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "User rejected download attempt\n");
+               ast_verb(3, "User rejected download attempt\n");
                ast_log(LOG_NOTICE, "User rejected download on channel %s\n", chan->name);
                ast_free(scr);
                return -1;
@@ -1535,8 +1534,7 @@ static int adsi_prog(struct ast_channel *chan, char *script)
                return -1;
        if (ast_adsi_end_download(chan)) {
                /* Download failed for some reason */
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Download attempt failed\n");
+               ast_verb(3, "Download attempt failed\n");
                ast_log(LOG_NOTICE, "Download failed on %s\n", chan->name);
                ast_free(scr);
                return -1;
@@ -1554,11 +1552,9 @@ static int adsi_exec(struct ast_channel *chan, void *data)
                data = "asterisk.adsi";
        
        if (!ast_adsi_available(chan)) {
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "ADSI Unavailable on CPE.  Not bothering to try.\n");
+               ast_verb(3, "ADSI Unavailable on CPE.  Not bothering to try.\n");
        } else {
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "ADSI Available on CPE.  Attempting Upload.\n");
+               ast_verb(3, "ADSI Available on CPE.  Attempting Upload.\n");
                res = adsi_prog(chan, data);
        }
        
index 14f417dcbcced2e26d80dad3cc2b3cd806baaea3..b48c8dba3f7db11cdd39237a15fdd51c577fd3db 100644 (file)
@@ -118,8 +118,7 @@ static void database_increment( char *key )
        res = ast_db_get(db_family, key, value, sizeof(value) - 1);
        
        if(res){
-               if(option_verbose >= 4)
-                       ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Creating database entry %s and setting to 1\n", key);
+               ast_verb(4, "AlarmReceiver: Creating database entry %s and setting to 1\n", key);
                /* Guess we have to create it */
                res = ast_db_put(db_family, key, "1");
                return;
@@ -210,8 +209,7 @@ static int send_tone_burst(struct ast_channel *chan, float freq, int duration, i
                                break;
                        }
                        if (ast_write(chan, &wf)){
-                               if(option_verbose >= 4)
-                                       ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Failed to write frame on %s\n", chan->name);
+                               ast_verb(4, "AlarmReceiver: Failed to write frame on %s\n", chan->name);
                                ast_log(LOG_WARNING, "AlarmReceiver Failed to write frame on %s\n",chan->name);
                                res = -1;
                                ast_frfree(f);
@@ -523,8 +521,7 @@ static int receive_ademco_contact_id( struct ast_channel *chan, void *data, int
                
                got_some_digits = 1;
 
-               if (option_verbose >= 2)
-                       ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Received Event %s\n", event);
+               ast_verb(2, "AlarmReceiver: Received Event %s\n", event);
                ast_debug(1, "AlarmReceiver: Received event: %s\n", event);
                
                /* Calculate checksum */
@@ -542,8 +539,7 @@ static int receive_ademco_contact_id( struct ast_channel *chan, void *data, int
                }
                
                if(i == 16){
-                       if(option_verbose >= 2)
-                               ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Bad DTMF character %c, trying again\n", event[j]);
+                       ast_verb(2, "AlarmReceiver: Bad DTMF character %c, trying again\n", event[j]);
                        continue; /* Bad character */
                }
 
@@ -553,8 +549,7 @@ static int receive_ademco_contact_id( struct ast_channel *chan, void *data, int
 
                if (checksum) {
                        database_increment("checksum-errors");
-                       if (option_verbose >= 2)
-                               ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Nonzero checksum\n");
+                       ast_verb(2, "AlarmReceiver: Nonzero checksum\n");
                        ast_debug(1, "AlarmReceiver: Nonzero checksum\n");
                        continue;
                }
@@ -564,8 +559,7 @@ static int receive_ademco_contact_id( struct ast_channel *chan, void *data, int
                if(strncmp(event + 4, "18", 2)){
                        if(strncmp(event + 4, "98", 2)){
                                database_increment("format-errors");
-                               if(option_verbose >= 2)
-                                       ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Wrong message type\n");
+                               ast_verb(2, "AlarmReceiver: Wrong message type\n");
                                ast_debug(1, "AlarmReceiver: Wrong message type\n");
                        continue;
                        }
@@ -635,8 +629,7 @@ static int alarmreceiver_exec(struct ast_channel *chan, void *data)
 
        /* Set write and read formats to ULAW */
 
-       if(option_verbose >= 4)
-               ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Setting read and write formats to ULAW\n");
+       ast_verb(4, "AlarmReceiver: Setting read and write formats to ULAW\n");
 
        if (ast_set_write_format(chan,AST_FORMAT_ULAW)){
                ast_log(LOG_WARNING, "AlarmReceiver: Unable to set write format to Mu-law on %s\n",chan->name);
@@ -655,8 +648,7 @@ static int alarmreceiver_exec(struct ast_channel *chan, void *data)
 
        /* Answer the channel if it is not already */
 
-       if(option_verbose >= 4)
-               ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Answering channel\n");
+       ast_verb(4, "AlarmReceiver: Answering channel\n");
 
        if (chan->_state != AST_STATE_UP) {
                if ((res = ast_answer(chan)))
@@ -665,8 +657,7 @@ static int alarmreceiver_exec(struct ast_channel *chan, void *data)
 
        /* Wait for the connection to settle post-answer */
 
-       if(option_verbose >= 4)
-               ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Waiting for connection to stabilize\n");
+       ast_verb(4, "AlarmReceiver: Waiting for connection to stabilize\n");
 
        res = ast_safe_sleep(chan, 1250);
 
index 9a32f903251319d1dfc378d70b6fa94a3ae9f41e..c2190dc606ed1a70e90d5328df95ddb3657763b7 100644 (file)
@@ -136,8 +136,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
                             AST_APP_ARG(argSilenceThreshold);
        );
 
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "AMD: %s %s %s (Fmt: %d)\n", chan->name ,chan->cid.cid_ani, chan->cid.cid_rdnis, chan->readformat);
+       ast_verb(3, "AMD: %s %s %s (Fmt: %d)\n", chan->name ,chan->cid.cid_ani, chan->cid.cid_rdnis, chan->readformat);
 
        /* Lets parse the arguments. */
        if (!ast_strlen_zero(parse)) {
@@ -164,8 +163,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
        }
 
        /* Now we're ready to roll! */
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "AMD: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
+       ast_verb(3, "AMD: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
                "totalAnalysisTime [%d] minimumWordLength [%d] betweenWordsSilence [%d] maximumNumberOfWords [%d] silenceThreshold [%d] \n",
                                initialSilence, greeting, afterGreetingSilence, totalAnalysisTime,
                                minimumWordLength, betweenWordsSilence, maximumNumberOfWords, silenceThreshold );
@@ -194,8 +192,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
        while ((res = ast_waitfor(chan, totalAnalysisTime)) > -1) {
                /* If we fail to read in a frame, that means they hung up */
                if (!(f = ast_read(chan))) {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "AMD: HANGUP\n");
+                       ast_verb(3, "AMD: HANGUP\n");
                        ast_debug(1, "Got hangup\n");
                        strcpy(amdStatus, "HANGUP");
                        break;
@@ -241,8 +238,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
                                }
                                
                                if (silenceDuration >= afterGreetingSilence  &&  inGreeting == 1) {
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "AMD: HUMAN: silenceDuration:%d afterGreetingSilence:%d\n",
+                                       ast_verb(3, "AMD: HUMAN: silenceDuration:%d afterGreetingSilence:%d\n",
                                                            silenceDuration, afterGreetingSilence);
                                        ast_frfree(f);
                                        strcpy(amdStatus , "HUMAN");
@@ -274,8 +270,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
                                }
                                
                                if (inGreeting == 1 && voiceDuration >= greeting) {
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "AMD: ANSWERING MACHINE: voiceDuration:%d greeting:%d\n", voiceDuration, greeting);
+                                       ast_verb(3, "AMD: ANSWERING MACHINE: voiceDuration:%d greeting:%d\n", voiceDuration, greeting);
                                        ast_frfree(f);
                                        strcpy(amdStatus , "MACHINE");
                                        sprintf(amdCause , "LONGGREETING-%d-%d", voiceDuration, greeting);
@@ -295,8 +290,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
        
        if (!res) {
                /* It took too long to get a frame back. Giving up. */
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "AMD: Channel [%s]. Too long...\n", chan->name);
+               ast_verb(3, "AMD: Channel [%s]. Too long...\n", chan->name);
                strcpy(amdStatus , "NOTSURE");
                sprintf(amdCause , "TOOLONG-%d", iTotalTime);
        }
@@ -368,8 +362,7 @@ static void load_config(void)
 
        ast_config_destroy(cfg);
 
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "AMD defaults: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
+       ast_verb(3, "AMD defaults: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
                "totalAnalysisTime [%d] minimumWordLength [%d] betweenWordsSilence [%d] maximumNumberOfWords [%d] silenceThreshold [%d] \n",
                                dfltInitialSilence, dfltGreeting, dfltAfterGreetingSilence, dfltTotalAnalysisTime,
                                dfltMinimumWordLength, dfltBetweenWordsSilence, dfltMaximumNumberOfWords, dfltSilenceThreshold );
index 78817451594d9ce306c52da59f6910cefc70f355..4d6622c8b06caafdded1e8027d3b7cd0c359a66c 100644 (file)
@@ -277,8 +277,7 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
                return 0;
 
        name = ast_strdupa(spyee->name);
-       if (option_verbose >= 2)
-               ast_verbose(VERBOSE_PREFIX_2 "Spying on channel %s\n", name);
+       ast_verb(2, "Spying on channel %s\n", name);
 
        memset(&csth, 0, sizeof(csth));
        ast_set_flag(&csth.spy, CHANSPY_FORMAT_AUDIO);
@@ -401,8 +400,7 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
                        (*volfactor)++;
                        if (*volfactor > 4)
                                *volfactor = -4;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Setting spy volume on %s to %d\n", chan->name, *volfactor);
+                       ast_verb(3, "Setting spy volume on %s to %d\n", chan->name, *volfactor);
                        csth.volfactor = *volfactor;
                        set_volume(chan, &csth);
                        if (csth.volfactor) {
index b6cead56870d7738f3db3170de98fc7aa58dd5d2..f7d2ceaf52b821dd63f5164cfb3e9027a19a683e 100644 (file)
@@ -85,17 +85,13 @@ static int deltree_exec(struct ast_channel *chan, void *data)
                keytree = 0;
        }
 
-       if (option_verbose > 2) {
                if (keytree)
-                       ast_verbose(VERBOSE_PREFIX_3 "DBdeltree: family=%s, keytree=%s\n", family, keytree);
+               ast_verb(3, "DBdeltree: family=%s, keytree=%s\n", family, keytree);
                else
-                       ast_verbose(VERBOSE_PREFIX_3 "DBdeltree: family=%s\n", family);
-       }
+               ast_verb(3, "DBdeltree: family=%s\n", family);
 
-       if (ast_db_deltree(family, keytree)) {
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "DBdeltree: Error deleting key from database.\n");
-       }
+       if (ast_db_deltree(family, keytree))
+               ast_verb(3, "DBdeltree: Error deleting key from database.\n");
 
        return 0;
 }
@@ -119,12 +115,9 @@ static int del_exec(struct ast_channel *chan, void *data)
                        ast_debug(1, "Ignoring; Syntax error in argument\n");
                        return 0;
                }
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "DBdel: family=%s, key=%s\n", family, key);
-               if (ast_db_del(family, key)) {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "DBdel: Error deleting key from database.\n");
-               }
+               ast_verb(3, "DBdel: family=%s, key=%s\n", family, key);
+               if (ast_db_del(family, key))
+                       ast_verb(3, "DBdel: Error deleting key from database.\n");
        } else {
                ast_debug(1, "Ignoring, no parameters\n");
        }
index 0acdc1751d471a7e48286413cb270ef376cfe737..a302aa00a317e74817bf69e0893c0025aa731367 100644 (file)
@@ -474,12 +474,10 @@ static void do_forward(struct chanlist *o,
        /* Before processing channel, go ahead and check for forwarding */
        o->forwards++;
        if (o->forwards < AST_MAX_FORWARDS) {
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, c->name);
+               ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, c->name);
                /* If we have been told to ignore forwards, just set this channel to null and continue processing extensions normally */
                if (ast_test_flag64(peerflags, OPT_IGNORE_FORWARDING)) {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s/%s' prevented.\n", in->name, tech, stuff);
+                       ast_verb(3, "Forwarding %s to '%s/%s' prevented.\n", in->name, tech, stuff);
                        c = o->chan = NULL;
                        cause = AST_CAUSE_BUSY;
                } else {
@@ -493,8 +491,7 @@ static void do_forward(struct chanlist *o,
                                ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
                }
        } else {
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", c->name);
+               ast_verb(3, "Too many forwards from %s\n", c->name);
                cause = AST_CAUSE_CONGESTION;
                c = o->chan = NULL;
        }
@@ -588,8 +585,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                }
                if (pos == 1) { /* only the input channel is available */
                        if (numlines == (num.busy + num.congestion + num.nochan)) {
-                               if (option_verbose > 2)
-                                       ast_verbose( VERBOSE_PREFIX_2 "Everyone is busy/congested at this time (%d:%d/%d/%d)\n", numlines, num.busy, num.congestion, num.nochan);
+                               ast_verb(2, "Everyone is busy/congested at this time (%d:%d/%d/%d)\n", numlines, num.busy, num.congestion, num.nochan);
                                if (num.busy)
                                        strcpy(pa->status, "BUSY");     
                                else if (num.congestion)
@@ -597,8 +593,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                                else if (num.nochan)
                                        strcpy(pa->status, "CHANUNAVAIL");
                        } else {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "No one is available to answer at this time (%d:%d/%d/%d)\n", numlines, num.busy, num.congestion, num.nochan);
+                               ast_verb(3, "No one is available to answer at this time (%d:%d/%d/%d)\n", numlines, num.busy, num.congestion, num.nochan);
                        }
                        *to = 0;
                        return NULL;
@@ -612,8 +607,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                                continue;
                        if (ast_test_flag64(o, DIAL_STILLGOING) && c->_state == AST_STATE_UP) {
                                if (!peer) {
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "%s answered %s\n", c->name, in->name);
+                                       ast_verb(3, "%s answered %s\n", c->name, in->name);
                                        peer = c;
                                        ast_copy_flags64(peerflags, o,
                                                       OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
@@ -647,8 +641,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                                case AST_CONTROL_ANSWER:
                                        /* This is our guy if someone answered. */
                                        if (!peer) {
-                                               if (option_verbose > 2)
-                                                       ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", c->name, in->name);
+                                               ast_verb(3, "%s answered %s\n", c->name, in->name);
                                                peer = c;
                                                ast_copy_flags64(peerflags, o,
                                                               OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
@@ -666,8 +659,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                                        c->hangupcause = AST_CAUSE_NORMAL_CLEARING;
                                        break;
                                case AST_CONTROL_BUSY:
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "%s is busy\n", c->name);
+                                       ast_verb(3, "%s is busy\n", c->name);
                                        in->hangupcause = c->hangupcause;
                                        ast_hangup(c);
                                        c = o->chan = NULL;
@@ -675,8 +667,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                                        handle_cause(AST_CAUSE_BUSY, &num);
                                        break;
                                case AST_CONTROL_CONGESTION:
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "%s is circuit-busy\n", c->name);
+                                       ast_verb(3, "%s is circuit-busy\n", c->name);
                                        in->hangupcause = c->hangupcause;
                                        ast_hangup(c);
                                        c = o->chan = NULL;
@@ -684,8 +675,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                                        handle_cause(AST_CAUSE_CONGESTION, &num);
                                        break;
                                case AST_CONTROL_RINGING:
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "%s is ringing\n", c->name);
+                                       ast_verb(3, "%s is ringing\n", c->name);
                                        /* Setup early media if appropriate */
                                        if (single)
                                                ast_channel_early_bridge(in, c);
@@ -695,8 +685,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                                        }
                                        break;
                                case AST_CONTROL_PROGRESS:
-                                       if (option_verbose > 2)
-                                               ast_verbose (VERBOSE_PREFIX_3 "%s is making progress passing it to %s\n", c->name, in->name);
+                                       ast_verb(3, "%s is making progress passing it to %s\n", c->name, in->name);
                                        /* Setup early media if appropriate */
                                        if (single)
                                                ast_channel_early_bridge(in, c);
@@ -704,26 +693,22 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                                                ast_indicate(in, AST_CONTROL_PROGRESS);
                                        break;
                                case AST_CONTROL_VIDUPDATE:
-                                       if (option_verbose > 2)
-                                               ast_verbose (VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", c->name, in->name);
+                                       ast_verb(3, "%s requested a video update, passing it to %s\n", c->name, in->name);
                                        ast_indicate(in, AST_CONTROL_VIDUPDATE);
                                        break;
                                case AST_CONTROL_PROCEEDING:
-                                       if (option_verbose > 2)
-                                               ast_verbose (VERBOSE_PREFIX_3 "%s is proceeding passing it to %s\n", c->name, in->name);
+                                       ast_verb(3, "%s is proceeding passing it to %s\n", c->name, in->name);
                                        if (single)
                                                ast_channel_early_bridge(in, c);
                                        if (!ast_test_flag64(outgoing, OPT_RINGBACK))
                                                ast_indicate(in, AST_CONTROL_PROCEEDING);
                                        break;
                                case AST_CONTROL_HOLD:
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "Call on %s placed on hold\n", c->name);
+                                       ast_verb(3, "Call on %s placed on hold\n", c->name);
                                        ast_indicate(in, AST_CONTROL_HOLD);
                                        break;
                                case AST_CONTROL_UNHOLD:
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "Call on %s left from hold\n", c->name);
+                                       ast_verb(3, "Call on %s left from hold\n", c->name);
                                        ast_indicate(in, AST_CONTROL_UNHOLD);
                                        break;
                                case AST_CONTROL_OFFHOOK:
@@ -732,8 +717,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                                        break;
                                case -1:
                                        if (!ast_test_flag64(outgoing, OPT_RINGBACK | OPT_MUSICBACK)) {
-                                               if (option_verbose > 2)
-                                                       ast_verbose(VERBOSE_PREFIX_3 "%s stopped sounds\n", c->name);
+                                               ast_verb(3, "%s stopped sounds\n", c->name);
                                                ast_indicate(in, -1);
                                                pa->sentringing = 0;
                                        }
@@ -782,8 +766,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                                if (ast_test_flag64(peerflags, OPT_DTMF_EXIT)) {
                                        const char *context = pbx_builtin_getvar_helper(in, "EXITCONTEXT");
                                        if (onedigit_goto(in, context, (char) f->subclass, 1)) {
-                                               if (option_verbose > 2)
-                                                       ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
+                                               ast_verb(3, "User hit %c to disconnect call.\n", f->subclass);
                                                *to=0;
                                                ast_cdr_noanswer(in->cdr);
                                                *result = f->subclass;
@@ -795,8 +778,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
 
                                if (ast_test_flag64(peerflags, OPT_CALLER_HANGUP) && 
                                                  (f->subclass == '*')) { /* hmm it it not guaranteed to be '*' anymore. */
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
+                                       ast_verb(3, "User hit %c to disconnect call.\n", f->subclass);
                                        *to=0;
                                        strcpy(pa->status, "CANCEL");
                                        ast_cdr_noanswer(in->cdr);
@@ -819,14 +801,13 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                                ((f->subclass == AST_CONTROL_HOLD) || 
                                 (f->subclass == AST_CONTROL_UNHOLD) || 
                                 (f->subclass == AST_CONTROL_VIDUPDATE))) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "%s requested special control %d, passing it to %s\n", in->name, f->subclass, outgoing->chan->name);
+                               ast_verb(3, "%s requested special control %d, passing it to %s\n", in->name, f->subclass, outgoing->chan->name);
                                ast_indicate_data(outgoing->chan, f->subclass, f->data, f->datalen);
                        }
                        ast_frfree(f);
                }
-               if (!*to && (option_verbose > 2))
-                       ast_verbose(VERBOSE_PREFIX_3 "Nobody picked up in %d ms\n", orig);
+               if (!*to)
+                       ast_verb(3, "Nobody picked up in %d ms\n", orig);
                if (!*to || ast_check_hangup(in)) {
                        ast_cdr_noanswer(in->cdr);
                }
@@ -931,21 +912,20 @@ static int do_timelimit(struct ast_channel *chan, struct ast_bridge_config *conf
        /* more efficient to do it like S(x) does since no advanced opts */
        if (!config->play_warning && !config->start_sound && !config->end_sound && config->timelimit) {
                *calldurationlimit = config->timelimit / 1000;
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Setting call duration limit to %d seconds.\n",
+               ast_verb(3, "Setting call duration limit to %d seconds.\n",
                                *calldurationlimit);
                config->timelimit = play_to_caller = play_to_callee =
                config->play_warning = config->warning_freq = 0;
-       } else if (option_verbose > 2) {
-               ast_verbose(VERBOSE_PREFIX_3 "Limit Data for this call:\n");
-               ast_verbose(VERBOSE_PREFIX_4 "timelimit      = %ld\n", config->timelimit);
-               ast_verbose(VERBOSE_PREFIX_4 "play_warning   = %ld\n", config->play_warning);
-               ast_verbose(VERBOSE_PREFIX_4 "play_to_caller = %s\n", play_to_caller ? "yes" : "no");
-               ast_verbose(VERBOSE_PREFIX_4 "play_to_callee = %s\n", play_to_callee ? "yes" : "no");
-               ast_verbose(VERBOSE_PREFIX_4 "warning_freq   = %ld\n", config->warning_freq);
-               ast_verbose(VERBOSE_PREFIX_4 "start_sound    = %s\n", S_OR(config->start_sound, ""));
-               ast_verbose(VERBOSE_PREFIX_4 "warning_sound  = %s\n", config->warning_sound);
-               ast_verbose(VERBOSE_PREFIX_4 "end_sound      = %s\n", S_OR(config->end_sound, ""));
+       } else {
+               ast_verb(3, "Limit Data for this call:\n");
+               ast_verb(4, "timelimit      = %ld\n", config->timelimit);
+               ast_verb(4, "play_warning   = %ld\n", config->play_warning);
+               ast_verb(4, "play_to_caller = %s\n", play_to_caller ? "yes" : "no");
+               ast_verb(4, "play_to_callee = %s\n", play_to_callee ? "yes" : "no");
+               ast_verb(4, "warning_freq   = %ld\n", config->warning_freq);
+               ast_verb(4, "start_sound    = %s\n", S_OR(config->start_sound, ""));
+               ast_verb(4, "warning_sound  = %s\n", config->warning_sound);
+               ast_verb(4, "end_sound      = %s\n", S_OR(config->end_sound, ""));
        }
         if (play_to_caller)
                 ast_set_flag(&(config->features_caller), AST_FEATURE_PLAY_WARNING);
@@ -1039,8 +1019,7 @@ static int do_privacy(struct ast_channel *chan, struct ast_channel *peer,
                static const char *_val[] = { "ALLOW", "DENY", "TORTURE", "KILL", "ALLOW" };
                static const int _flag[] = { AST_PRIVACY_ALLOW, AST_PRIVACY_DENY, AST_PRIVACY_TORTURE, AST_PRIVACY_KILL, AST_PRIVACY_ALLOW};
                int i = res2 - '1';
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to %s\n",
+               ast_verb(3, "--Set privacy database entry %s/%s to %s\n",
                                             opt_args[OPT_ARG_PRIVACY], pa->privcid, _val[i]);
                ast_privacy_set(opt_args[OPT_ARG_PRIVACY], pa->privcid, _flag[i]);
        }
@@ -1079,8 +1058,8 @@ static int do_privacy(struct ast_channel *chan, struct ast_channel *peer,
                        ast_filedelete(pa->privintro, NULL);
                        if( ast_fileexists(pa->privintro, NULL, NULL ) > 0 )
                                ast_log(LOG_NOTICE, "privacy: ast_filedelete didn't do its job on %s\n", pa->privintro);
-                       else if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Successfully deleted %s intro file\n", pa->privintro);
+                       else
+                               ast_verb(3, "Successfully deleted %s intro file\n", pa->privintro);
                }
                return 0;       /* the good exit path */
        } else {
@@ -1101,13 +1080,11 @@ static int setup_privacy_args(struct privacy_args *pa,
                l = ast_strdupa(chan->cid.cid_num);
                ast_shrink_phone_number(l);
                if (ast_test_flag64(opts, OPT_PRIVACY) ) {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3  "Privacy DB is '%s', clid is '%s'\n",
+                       ast_verb(3, "Privacy DB is '%s', clid is '%s'\n",
                                             opt_args[OPT_ARG_PRIVACY], l);
                        pa->privdb_val = ast_privacy_check(opt_args[OPT_ARG_PRIVACY], l);
                } else {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3  "Privacy Screening, clid is '%s'\n", l);
+                       ast_verb(3,  "Privacy Screening, clid is '%s'\n", l);
                        pa->privdb_val = AST_PRIVACY_UNKNOWN;
                }
        } else {
@@ -1119,8 +1096,7 @@ static int setup_privacy_args(struct privacy_args *pa,
                        if (*tn2=='/')  /* any other chars to be afraid of? */
                                *tn2 = '=';
                }
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3  "Privacy-- callerid is empty\n");
+               ast_verb(3, "Privacy-- callerid is empty\n");
 
                snprintf(callerid, sizeof(callerid), "NOCALLERID_%s%s", chan->exten, tnam);
                l = callerid;
@@ -1184,8 +1160,8 @@ static int setup_privacy_args(struct privacy_args *pa,
                                ast_filedelete(pa->privintro, NULL);
                                if (ast_fileexists(pa->privintro,NULL,NULL ) > 0 )
                                        ast_log(LOG_NOTICE,"privacy: ast_filedelete didn't do its job on %s\n", pa->privintro);
-                               else if (option_verbose > 2)
-                                       ast_verbose( VERBOSE_PREFIX_3 "Successfully deleted %s intro file\n", pa->privintro);
+                               else
+                                       ast_verb(3, "Successfully deleted %s intro file\n", pa->privintro);
                                return -1;
                        }
                        if (!ast_streamfile(chan, "vm-dialout", chan->language) )
@@ -1256,8 +1232,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 
        if (ast_test_flag64(&opts, OPT_OPERMODE)) {
                opermode = ast_strlen_zero(opt_args[OPT_ARG_OPERMODE]) ? 1 : atoi(opt_args[OPT_ARG_OPERMODE]);
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Setting operator services mode to %d.\n", opermode);
+               ast_verb(3, "Setting operator services mode to %d.\n", opermode);
        }
        
        if (ast_test_flag64(&opts, OPT_DURATION_STOP) && !ast_strlen_zero(opt_args[OPT_ARG_DURATION_STOP])) {
@@ -1267,8 +1242,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                        pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
                        goto done;
                }
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Setting call duration limit to %d seconds.\n", calldurationlimit);
+               ast_verb(3, "Setting call duration limit to %d seconds.\n", calldurationlimit);
        }
 
        if (ast_test_flag64(&opts, OPT_SENDDTMF) && !ast_strlen_zero(opt_args[OPT_ARG_SENDDTMF])) {
@@ -1358,8 +1332,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                        }
                        tmp->forwards++;
                        if (tmp->forwards < AST_MAX_FORWARDS) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n",
+                               ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n",
                                        chan->name, tech, stuff, tc->name);
                                ast_hangup(tc);
                                /* If we have been told to ignore forwards, just set this channel to null
@@ -1367,8 +1340,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                                if (ast_test_flag64(&opts, OPT_IGNORE_FORWARDING)) {
                                        tc = NULL;
                                        cause = AST_CAUSE_BUSY;
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s/%s' prevented.\n",
+                                       ast_verb(3, "Forwarding %s to '%s/%s' prevented.\n",
                                                        chan->name, tech, stuff);
                                } else {
                                        tc = ast_request(tech, chan->nativeformats, stuff, &cause);
@@ -1378,8 +1350,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                                else
                                        ast_channel_inherit_variables(chan, tc);
                        } else {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", tc->name);
+                               ast_verb(3, "Too many forwards from %s\n", tc->name);
                                ast_hangup(tc);
                                tc = NULL;
                                cause = AST_CAUSE_CONGESTION;
@@ -1443,16 +1414,14 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                if (res) {
                        /* Again, keep going even if there's an error */
                        ast_debug(1, "ast call on peer returned %d\n", res);
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", numsubst);
+                       ast_verb(3, "Couldn't call %s\n", numsubst);
                        ast_hangup(tc);
                        tc = NULL;
                        ast_free(tmp);
                        continue;
                } else {
                        senddialevent(chan, tc);
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", numsubst);
+                       ast_verb(3, "Called %s\n", numsubst);
                        if (!ast_test_flag64(peerflags, OPT_ORIGINAL_CLID))
                                ast_set_callerid(tc, S_OR(chan->macroexten, chan->exten), get_cid_name(cidname, sizeof(cidname), chan), NULL);
                }
@@ -1808,8 +1777,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                                if ((res = ast_spawn_extension(peer, peer->context, peer->exten, peer->priority, peer->cid.cid_num))) {
                                        /* Something bad happened, or a hangup has been requested. */
                                        ast_debug(1, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, peer->name);
-                                       if (option_verbose > 1)
-                                               ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, peer->name);
+                                       ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, peer->name);
                                        break;
                                }
                                peer->priority++;
index d35988fd55b6b6e0cbdc103fa61bf789825afb80..32c2b7dced91572643f6f6f289e90503ab94e756 100644 (file)
@@ -92,8 +92,7 @@ static int flash_exec(struct ast_channel *chan, void *data)
                                        zt_wait_event(chan->fds[0]);
                                }
                                res = ast_safe_sleep(chan, 1000);
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Flashed channel %s\n", chan->name);
+                               ast_verb(3, "Flashed channel %s\n", chan->name);
                        } else
                                ast_log(LOG_WARNING, "Unable to flash channel %s: %s\n", chan->name, strerror(errno));
                } else
index b2b03e31f4d6ca117067b859974e30ce423a7bad..ac3807f3b1dca4421931a998f963296caa23c8f3 100644 (file)
@@ -487,8 +487,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
 
        if (!AST_LIST_EMPTY(findme_user_list)) {
                if (!caller) {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Original caller hungup. Cleanup.\n");
+                       ast_verb(3, "Original caller hungup. Cleanup.\n");
                        clear_calling_tree(findme_user_list);
                        return NULL;
                }
@@ -508,8 +507,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                        if (tmpuser->state == 3) 
                                                tmpuser->digts += (towas - wtd);
                                        if (tmpuser->digts && (tmpuser->digts > featuredigittimeout)) {
-                                               if (option_verbose > 2)
-                                                       ast_verbose(VERBOSE_PREFIX_3 "We've been waiting for digits longer than we should have.\n");
+                                               ast_verb(3, "We've been waiting for digits longer than we should have.\n");
                                                if (!ast_strlen_zero(namerecloc)) {
                                                        tmpuser->state = 1;
                                                        tmpuser->digts = 0;
@@ -538,8 +536,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                                else if (tmpto < 0 && !tmpuser->ochan->timingfunc) {
                                                        ast_stopstream(tmpuser->ochan);
                                                        if (tmpuser->state == 1) {
-                                                               if (option_verbose > 2)
-                                                                       ast_verbose(VERBOSE_PREFIX_3 "Playback of the call-from file appears to be done.\n");
+                                                               ast_verb(3, "Playback of the call-from file appears to be done.\n");
                                                                if (!ast_streamfile(tmpuser->ochan, namerecloc, tmpuser->ochan->language)) {
                                                                        tmpuser->state = 2;
                                                                } else {
@@ -554,8 +551,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                                                        } 
                                                                }
                                                        } else if (tmpuser->state == 2) {
-                                                               if (option_verbose > 2)
-                                                                       ast_verbose(VERBOSE_PREFIX_3 "Playback of name file appears to be done.\n");
+                                                               ast_verb(3, "Playback of name file appears to be done.\n");
                                                                memset(tmpuser->yn, 0, sizeof(tmpuser->yn));
                                                                tmpuser->ynidx = 0;
                                                                if (!ast_streamfile(tmpuser->ochan, pressbuttonname, tmpuser->ochan->language)) {
@@ -565,8 +561,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                                                        return NULL;
                                                                } 
                                                        } else if (tmpuser->state == 3) {
-                                                               if (option_verbose > 2)
-                                                                       ast_verbose(VERBOSE_PREFIX_3 "Playback of the next step file appears to be done.\n");
+                                                               ast_verb(3, "Playback of the next step file appears to be done.\n");
                                                                tmpuser->digts = 0;
                                                        }
                                                }
@@ -587,8 +582,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                        totalwait -= tmpto;
                        wtd = to;       
                        if (totalwait <= 0) {
-                               if (option_verbose > 2) 
-                                       ast_verbose(VERBOSE_PREFIX_3 "We've hit our timeout for this step. Drop everyone and move on to the next one. %ld\n", totalwait);
+                               ast_verb(3, "We've hit our timeout for this step. Drop everyone and move on to the next one. %ld\n", totalwait);
                                clear_calling_tree(findme_user_list);
                                return NULL;
                        }
@@ -606,22 +600,20 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                                switch(f->subclass) {
                                                case AST_CONTROL_HANGUP:
                                                        if (option_verbose > 2)
-                                                               ast_verbose( VERBOSE_PREFIX_3 "%s received a hangup frame.\n", winner->name);
+                                                               ast_verb(3, "%s received a hangup frame.\n", winner->name);
                                                        if (dg == 0) {
-                                                               if (option_verbose > 2)
-                                                                       ast_verbose( VERBOSE_PREFIX_3 "The calling channel hungup. Need to drop everyone else.\n");
+                                                               ast_verb(3, "The calling channel hungup. Need to drop everyone else.\n");
                                                                clear_calling_tree(findme_user_list);
                                                                ctstatus = -1;
                                                        }
                                                        break;
                                                case AST_CONTROL_ANSWER:
                                                        if (option_verbose > 2)
-                                                               ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", winner->name, caller->name);
+                                                               ast_verb(3, "%s answered %s\n", winner->name, caller->name);
                                                        /* If call has been answered, then the eventual hangup is likely to be normal hangup */ 
                                                        winner->hangupcause = AST_CAUSE_NORMAL_CLEARING;
                                                        caller->hangupcause = AST_CAUSE_NORMAL_CLEARING;
-                                                       if (option_verbose > 2)
-                                                               ast_verbose( VERBOSE_PREFIX_3 "Starting playback of %s\n", callfromname);
+                                                       ast_verb(3, "Starting playback of %s\n", callfromname);
                                                        if (dg > 0) {
                                                                if (!ast_strlen_zero(namerecloc)) {
                                                                        if (!ast_streamfile(winner, callfromname, winner->language)) {
@@ -645,44 +637,35 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                                        }
                                                        break;
                                                case AST_CONTROL_BUSY:
-                                                       if (option_verbose > 2)
-                                                               ast_verbose( VERBOSE_PREFIX_3 "%s is busy\n", winner->name);
+                                                       ast_verb(3, "%s is busy\n", winner->name);
                                                        break;
                                                case AST_CONTROL_CONGESTION:
-                                                       if (option_verbose > 2)
-                                                               ast_verbose( VERBOSE_PREFIX_3 "%s is circuit-busy\n", winner->name);
+                                                       ast_verb(3, "%s is circuit-busy\n", winner->name);
                                                        break;
                                                case AST_CONTROL_RINGING:
-                                                       if (option_verbose > 2)
-                                                               ast_verbose( VERBOSE_PREFIX_3 "%s is ringing\n", winner->name);
+                                                       ast_verb(3, "%s is ringing\n", winner->name);
                                                        break;
                                                case AST_CONTROL_PROGRESS:
-                                                       if (option_verbose > 2)
-                                                               ast_verbose ( VERBOSE_PREFIX_3 "%s is making progress passing it to %s\n", winner->name, caller->name);
+                                                       ast_verb(3, "%s is making progress passing it to %s\n", winner->name, caller->name);
                                                        break;
                                                case AST_CONTROL_VIDUPDATE:
-                                                       if (option_verbose > 2)
-                                                               ast_verbose ( VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", winner->name, caller->name);
+                                                       ast_verb(3, "%s requested a video update, passing it to %s\n", winner->name, caller->name);
                                                        break;
                                                case AST_CONTROL_PROCEEDING:
-                                                       if (option_verbose > 2)
-                                                               ast_verbose ( VERBOSE_PREFIX_3 "%s is proceeding passing it to %s\n", winner->name,caller->name);
+                                                       ast_verb(3, "%s is proceeding passing it to %s\n", winner->name,caller->name);
                                                        break;
                                                case AST_CONTROL_HOLD:
-                                                       if (option_verbose > 2)
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Call on %s placed on hold\n", winner->name);
+                                                       ast_verb(3, "Call on %s placed on hold\n", winner->name);
                                                        break;
                                                case AST_CONTROL_UNHOLD:
-                                                       if (option_verbose > 2)
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Call on %s left from hold\n", winner->name);
+                                                       ast_verb(3, "Call on %s left from hold\n", winner->name);
                                                        break;
                                                case AST_CONTROL_OFFHOOK:
                                                case AST_CONTROL_FLASH:
                                                        /* Ignore going off hook and flash */
                                                        break;
                                                case -1:
-                                                       if (option_verbose > 2)
-                                                               ast_verbose( VERBOSE_PREFIX_3 "%s stopped sounds\n", winner->name);
+                                                       ast_verb(3, "%s stopped sounds\n", winner->name);
                                                        break;
                                                default:
                                                        ast_debug(1, "Dunno what to do with control type %d\n", f->subclass);
@@ -727,8 +710,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                                        livechannels--;
                                                        ast_debug(1, "live channels left %d\n", livechannels);
                                                        if (!livechannels) {
-                                                               if (option_verbose > 2)
-                                                                       ast_verbose(VERBOSE_PREFIX_3 "no live channels left. exiting.\n");
+                                                               ast_verb(3, "no live channels left. exiting.\n");
                                                                return NULL;
                                                        }
                                                }
@@ -740,8 +722,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                }
                
        } else {
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "couldn't reach at this number.\n");
+               ast_verb(3, "couldn't reach at this number.\n");
        }
        
        /* --- WAIT FOR WINNER NUMBER END! -----------*/
@@ -809,8 +790,7 @@ static void findmeexec(struct fm_args *tpargs)
                        if (outbound) {
                                ast_set_callerid(outbound, caller->cid.cid_num, caller->cid.cid_name, caller->cid.cid_num);
                                ast_channel_inherit_variables(tpargs->chan, outbound);
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "calling %s\n", dialarg);
+                               ast_verb(3, "calling %s\n", dialarg);
                                if (!ast_call(outbound,dialarg,0)) {
                                        tmpuser->ochan = outbound;
                                        tmpuser->state = 0;
@@ -818,8 +798,7 @@ static void findmeexec(struct fm_args *tpargs)
                                        ast_copy_string(tmpuser->dialarg, dialarg, sizeof(dialarg));
                                        AST_LIST_INSERT_TAIL(findme_user_list, tmpuser, entry);
                                } else {
-                                       if (option_verbose > 2) 
-                                               ast_verbose(VERBOSE_PREFIX_3 "couldn't reach at this number.\n"); 
+                                       ast_verb(3, "couldn't reach at this number.\n"); 
                                        if (outbound) {
                                                if (!outbound->cdr) 
                                                        outbound->cdr = ast_cdr_alloc();
index 9342a58ede0a5311b8385492bf4830b0494432cd..ba67bd9b8f9a0766fa8c919cba3b7462208f2e07 100644 (file)
@@ -85,8 +85,7 @@ static int cpeid_exec(struct ast_channel *chan, void *idata)
                res = ast_adsi_get_cpeid(chan, cpeid, 0);
                if (res > 0) {
                        gotcpeid = 1;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Got CPEID of '%02x:%02x:%02x:%02x' on '%s'\n", cpeid[0], cpeid[1], cpeid[2], cpeid[3], chan->name);
+                       ast_verb(3, "Got CPEID of '%02x:%02x:%02x:%02x' on '%s'\n", cpeid[0], cpeid[1], cpeid[2], cpeid[3], chan->name);
                }
                if (res > -1) {
                        strcpy(data[1], "Measuring CPE...");
@@ -94,8 +93,7 @@ static int cpeid_exec(struct ast_channel *chan, void *idata)
                        cpeid_setstatus(chan, data, 0);
                        res = ast_adsi_get_cpeinfo(chan, &width, &height, &buttons, 0);
                        if (res > -1) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "CPE has %d lines, %d columns, and %d buttons on '%s'\n", height, width, buttons, chan->name);
+                               ast_verb(3, "CPE has %d lines, %d columns, and %d buttons on '%s'\n", height, width, buttons, chan->name);
                                gotgeometry = 1;
                        }
                }
index aa24dd94cbeeb0c5969b6344a039005478d02da2..923bd583fab35031529f576cc8fae4fd22c00720 100644 (file)
@@ -313,14 +313,12 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
                                goto out;
                        case AST_PBX_KEEPALIVE:
                                ast_debug(2, "Spawn extension (%s,%s,%d) exited KEEPALIVE in macro %s on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
-                               if (option_verbose > 1)
-                                       ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited KEEPALIVE in macro '%s' on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
+                               ast_verb(2, "Spawn extension (%s, %s, %d) exited KEEPALIVE in macro '%s' on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
                                goto out;
                                break;
                        default:
                                ast_debug(2, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
-                               if (option_verbose > 1)
-                                       ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
+                               ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
                                dead = 1;
                                goto out;
                        }
@@ -382,8 +380,7 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
                }
 
                if (gosub_level == 0 && strcasecmp(chan->context, fullmacro)) {
-                       if (option_verbose > 1)
-                               ast_verbose(VERBOSE_PREFIX_2 "Channel '%s' jumping out of macro '%s'\n", chan->name, macro);
+                       ast_verb(2, "Channel '%s' jumping out of macro '%s'\n", chan->name, macro);
                        break;
                }
 
index 207ddf61aa505ce3b5f08a11579b507e02b9e752..63e8be49d01db1d081d7e7c1a00d420737744a34 100644 (file)
@@ -826,8 +826,7 @@ static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin
        /* Fill the conference struct */
        cnf->start = time(NULL);
        cnf->isdynamic = dynamic ? 1 : 0;
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "Created MeetMe conference %d for conference '%s'\n", cnf->zapconf, cnf->confno);
+       ast_verb(3, "Created MeetMe conference %d for conference '%s'\n", cnf->zapconf, cnf->confno);
        AST_LIST_INSERT_HEAD(&confs, cnf, list);
 
        /* Reserve conference number in map */
@@ -1463,7 +1462,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
                                snprintf(recordingtmp, sizeof(recordingtmp), "wav");
                                conf->recordingformat = ast_strdupa(recordingtmp);
                        }
-                       ast_verbose(VERBOSE_PREFIX_4 "Starting recording of MeetMe Conference %s into file %s.%s.\n",
+                       ast_verb(4, "Starting recording of MeetMe Conference %s into file %s.%s.\n",
                                    conf->confno, conf->recordingfilename, conf->recordingformat);
                }
        }
index d7d5fc787ac84f1d2e5208ef21d524b43e112d40..235bde926588b3b1080f21bdab50e8830abb2bda 100644 (file)
@@ -109,26 +109,22 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data)
        }
 
        dialtech = strsep(&args.dial, "/");
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "Dial Tech,String: (%s,%s)\n", dialtech, args.dial);
+       ast_verb(3, "Dial Tech,String: (%s,%s)\n", dialtech, args.dial);
 
        if (!ast_strlen_zero(args.return_context))
                ast_parseable_goto(chan, args.return_context);
 
-       if (option_verbose > 2) {
-               ast_verbose(VERBOSE_PREFIX_3 "Return Context: (%s,%s,%d) ID: %s\n", chan->context, chan->exten, chan->priority, chan->cid.cid_num);
+       ast_verb(3, "Return Context: (%s,%s,%d) ID: %s\n", chan->context, chan->exten, chan->priority, chan->cid.cid_num);
                if (!ast_exists_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num)) {
-                       ast_verbose(VERBOSE_PREFIX_3 "Warning: Return Context Invalid, call will return to default|s\n");
+               ast_verb(3, "Warning: Return Context Invalid, call will return to default|s\n");
                }
-       }
 
        /* we are using masq_park here to protect * from touching the channel once we park it.  If the channel comes out of timeout
        before we are done announcing and the channel is messed with, Kablooeee.  So we use Masq to prevent this.  */
 
        ast_masq_park_call(chan, NULL, timeout, &lot);
 
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, args.return_context);
+       ast_verb(3, "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, args.return_context);
 
        /* Now place the call to the extension */
 
@@ -139,11 +135,9 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data)
 
        if (dchan) {
                if (dchan->_state == AST_STATE_UP) {
-                       if (option_verbose > 3)
-                               ast_verbose(VERBOSE_PREFIX_4 "Channel %s was answered.\n", dchan->name);
+                       ast_verb(4, "Channel %s was answered.\n", dchan->name);
                } else {
-                       if (option_verbose > 3)
-                               ast_verbose(VERBOSE_PREFIX_4 "Channel %s was never answered.\n", dchan->name);
+                       ast_verb(4, "Channel %s was never answered.\n", dchan->name);
                                ast_log(LOG_WARNING, "PARK: Channel %s was never answered for the announce.\n", dchan->name);
                        ast_hangup(dchan);
                        return -1;
@@ -157,16 +151,14 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data)
 
        /* now we have the call placed and are ready to play stuff to it */
 
-       if (option_verbose > 3)
-               ast_verbose(VERBOSE_PREFIX_4 "Announce Template:%s\n", args.template);
+       ast_verb(4, "Announce Template:%s\n", args.template);
 
        for (looptemp = 0, tmp[looptemp++] = strsep(&args.template, ":");
                 looptemp < sizeof(tmp) / sizeof(tmp[0]);
                 tmp[looptemp++] = strsep(&args.template, ":"));
 
        for (i = 0; i < looptemp; i++) {
-               if (option_verbose > 3)
-                       ast_verbose(VERBOSE_PREFIX_4 "Announce:%s\n", tmp[i]);
+               ast_verb(4, "Announce:%s\n", tmp[i]);
                if (!strcmp(tmp[i], "PARKED")) {
                        ast_say_digits(dchan, lot, "", dchan->language);
                } else {
index e5bfc9ccf5c23fdd32e65ac6566c449a29ee5c09..44faf22036042f8a215a534b03a2fa9492434780 100644 (file)
@@ -1420,8 +1420,7 @@ static int say_position(struct queue_ent *qe, int ringing)
                avgholdsecs = 0;
        }
 
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "Hold time for %s is %d minutes %d seconds\n", qe->parent->name, avgholdmins, avgholdsecs);
+       ast_verb(3, "Hold time for %s is %d minutes %d seconds\n", qe->parent->name, avgholdmins, avgholdsecs);
 
        /* If the hold time is >1 min, if it's enabled, and if it's not
           supposed to be only once and we have already said it, say it */
@@ -1463,8 +1462,7 @@ static int say_position(struct queue_ent *qe, int ringing)
        }
 
 posout:
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "Told %s in %s their queue position (which was %d)\n",
+       ast_verb(3, "Told %s in %s their queue position (which was %d)\n",
                        qe->chan->name, qe->parent->name, qe->pos);
        res = play_file(qe->chan, qe->parent->sound_thanks);
 
@@ -1768,8 +1766,7 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies
        if ((res = ast_call(tmp->chan, location, 0))) {
                /* Again, keep going even if there's an error */
                ast_debug(1, "ast call on peer returned %d\n", res);
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", tmp->interface);
+               ast_verb(3, "Couldn't call %s\n", tmp->interface);
                do_hang(tmp);
                (*busies)++;
                return 0;
@@ -1792,8 +1789,7 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies
                                        tmp->chan->cid.cid_name ? tmp->chan->cid.cid_name : "unknown",
                                        qe->chan->context, qe->chan->exten, qe->chan->priority,
                                        qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", tmp->interface);
+               ast_verb(3, "Called %s\n", tmp->interface);
        }
 
        return 1;
@@ -1887,8 +1883,7 @@ static int say_periodic_announcement(struct queue_ent *qe, int ringing)
        else
                ast_moh_stop(qe->chan);
 
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "Playing periodic announcement\n");
+       ast_verb(3, "Playing periodic announcement\n");
 
        /* Check to make sure we have a sound file. If not, reset to the first sound file */
        if (qe->last_periodic_announce_sound >= MAX_PERIODIC_ANNOUNCEMENTS || !strlen(qe->parent->sound_periodicannounce[qe->last_periodic_announce_sound])) {
@@ -1937,16 +1932,13 @@ static void record_abandoned(struct queue_ent *qe)
 /*! \brief RNA == Ring No Answer. Common code that is executed when we try a queue member and they don't answer. */
 static void rna(int rnatime, struct queue_ent *qe, char *interface, char *membername)
 {
-       if (option_verbose > 2)
-               ast_verbose( VERBOSE_PREFIX_3 "Nobody picked up in %d ms\n", rnatime);
+       ast_verb(3, "Nobody picked up in %d ms\n", rnatime);
        ast_queue_log(qe->parent->name, qe->chan->uniqueid, membername, "RINGNOANSWER", "%d", rnatime);
        if (qe->parent->autopause) {
                if (!set_member_paused(qe->parent->name, interface, 1)) {
-                       if (option_verbose > 2)
-                               ast_verbose( VERBOSE_PREFIX_3 "Auto-Pausing Queue Member %s in queue %s since they failed to answer.\n", interface, qe->parent->name);
+                       ast_verb(3, "Auto-Pausing Queue Member %s in queue %s since they failed to answer.\n", interface, qe->parent->name);
                } else {
-                       if (option_verbose > 2)
-                               ast_verbose( VERBOSE_PREFIX_3 "Failed to pause Queue Member %s in queue %s!\n", interface, qe->parent->name);
+                       ast_verb(3, "Failed to pause Queue Member %s in queue %s!\n", interface, qe->parent->name);
                }
        }
        return;
@@ -2011,8 +2003,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
                for (o = outgoing; o; o = o->q_next) {
                        if (o->stillgoing && (o->chan) &&  (o->chan->_state == AST_STATE_UP)) {
                                if (!peer) {
-                                       if (option_verbose > 2)
-                                               ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", o->chan->name, in->name);
+                                       ast_verb(3, "%s answered %s\n", o->chan->name, in->name);
                                        peer = o;
                                }
                        } else if (o->chan && (o->chan == winner)) {
@@ -2021,8 +2012,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
                                ast_copy_string(membername, o->member->membername, sizeof(membername));
 
                                if (!ast_strlen_zero(o->chan->call_forward) && !forwardsallowed) {
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s' prevented.\n", in->name, o->chan->call_forward);
+                                       ast_verb(3, "Forwarding %s to '%s' prevented.\n", in->name, o->chan->call_forward);
                                        numnochan++;
                                        do_hang(o);
                                        winner = NULL;
@@ -2042,8 +2032,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
                                                tech = "Local";
                                        }
                                        /* Before processing channel, go ahead and check for forwarding */
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, o->chan->name);
+                                       ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, o->chan->name);
                                        /* Setup parameters */
                                        o->chan = ast_request(tech, in->nativeformats, stuff, &status);
                                        if (status != o->oldstatus)
@@ -2090,14 +2079,12 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
                                                case AST_CONTROL_ANSWER:
                                                        /* This is our guy if someone answered. */
                                                        if (!peer) {
-                                                               if (option_verbose > 2)
-                                                                       ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", o->chan->name, in->name);
+                                                               ast_verb(3, "%s answered %s\n", o->chan->name, in->name);
                                                                peer = o;
                                                        }
                                                        break;
                                                case AST_CONTROL_BUSY:
-                                                       if (option_verbose > 2)
-                                                               ast_verbose( VERBOSE_PREFIX_3 "%s is busy\n", o->chan->name);
+                                                       ast_verb(3, "%s is busy\n", o->chan->name);
                                                        if (in->cdr)
                                                                ast_cdr_busy(in->cdr);
                                                        do_hang(o);
@@ -2112,8 +2099,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
                                                        numbusies++;
                                                        break;
                                                case AST_CONTROL_CONGESTION:
-                                                       if (option_verbose > 2)
-                                                               ast_verbose( VERBOSE_PREFIX_3 "%s is circuit-busy\n", o->chan->name);
+                                                       ast_verb(3, "%s is circuit-busy\n", o->chan->name);
                                                        if (in->cdr)
                                                                ast_cdr_busy(in->cdr);
                                                        endtime = (long) time(NULL);
@@ -2128,8 +2114,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
                                                        numbusies++;
                                                        break;
                                                case AST_CONTROL_RINGING:
-                                                       if (option_verbose > 2)
-                                                               ast_verbose( VERBOSE_PREFIX_3 "%s is ringing\n", o->chan->name);
+                                                       ast_verb(3, "%s is ringing\n", o->chan->name);
                                                        if (!sentringing) {
 #if 0
                                                                ast_indicate(in, AST_CONTROL_RINGING);
@@ -2167,15 +2152,13 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
                                return NULL;
                        }
                        if ((f->frametype == AST_FRAME_DTMF) && caller_disconnect && (f->subclass == '*')) {
-                               if (option_verbose > 3)
-                                       ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
+                               ast_verb(3, "User hit %c to disconnect call.\n", f->subclass);
                                *to = 0;
                                ast_frfree(f);
                                return NULL;
                        }
                        if ((f->frametype == AST_FRAME_DTMF) && valid_exit(qe, f->subclass)) {
-                               if (option_verbose > 3)
-                                       ast_verbose(VERBOSE_PREFIX_3 "User pressed digit: %c\n", f->subclass);
+                               ast_verb(3, "User pressed digit: %c\n", f->subclass);
                                *to = 0;
                                *digit = f->subclass;
                                ast_frfree(f);
@@ -3600,8 +3583,7 @@ check_turns:
 
                        /* exit after 'timeout' cycle if 'n' option enabled */
                        if (go_on >= qe.parent->membercount) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Exiting on time-out cycle\n");
+                               ast_verb(3, "Exiting on time-out cycle\n");
                                ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
                                record_abandoned(&qe);
                                reason = QUEUE_TIMEOUT;
index e6c364873163a3745216da97a41437ac8a0f2d2d..313cd497ea14e735159b70225ffeb20f25bd9581 100644 (file)
@@ -138,8 +138,8 @@ static int read_exec(struct ast_channel *chan, void *data)
                maxdigits = atoi(arglist.maxdigits);
                if ((maxdigits<1) || (maxdigits>255)) {
                        maxdigits = 255;
-               } else if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Accepting a maximum of %d digits.\n", maxdigits);
+               } else
+                       ast_verb(3, "Accepting a maximum of %d digits.\n", maxdigits);
        }
        if (ast_strlen_zero(arglist.variable)) {
                ast_log(LOG_WARNING, "Invalid! Usage: Read(variable[|filename][|maxdigits][|option][|attempts][|timeout])\n\n");
@@ -187,23 +187,19 @@ static int read_exec(struct ast_channel *chan, void *data)
                        if (res > -1) {
                                pbx_builtin_setvar_helper(chan, arglist.variable, tmp);
                                if (!ast_strlen_zero(tmp)) {
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "User entered '%s'\n", tmp);
+                                       ast_verb(3, "User entered '%s'\n", tmp);
                                        tries = 0;
                                } else {
                                        tries--;
-                                       if (option_verbose > 2) {
                                                if (tries)
-                                                       ast_verbose(VERBOSE_PREFIX_3 "User entered nothing, %d chance%s left\n", tries, (tries != 1) ? "s" : "");
+                                               ast_verb(3, "User entered nothing, %d chance%s left\n", tries, (tries != 1) ? "s" : "");
                                                else
-                                                       ast_verbose(VERBOSE_PREFIX_3 "User entered nothing.\n");
+                                               ast_verb(3, "User entered nothing.\n");
                                        }
-                               }
                                res = 0;
                        } else {
                                pbx_builtin_setvar_helper(chan, arglist.variable, tmp);
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "User disconnected\n");
+                               ast_verb(3, "User disconnected\n");
                        }
                }
        }
index 5ef62d9e5ff9b499547e900c6a450ea71a1c4ad5..9443bb151f14be0d413283f2a97a5cc0adc9e8ca 100644 (file)
@@ -924,8 +924,7 @@ static void load_rpt_vars(int n, int init)
        );
 #endif
 
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "%s config for repeater %s\n",
+       ast_verb(3, "%s config for repeater %s\n",
                        (init) ? "Loading initial" : "Re-Loading", rpt_vars[n].name);
        ast_mutex_lock(&rpt_vars[n].lock);
        if (rpt_vars[n].cfg)
@@ -2923,8 +2922,7 @@ static int function_ilink(struct rpt *myrpt, char *param, char *digits, int comm
                        l->chan->whentohangup = 0;
                        l->chan->appl = "Apprpt";
                        l->chan->data = "(Remote Rx)";
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "rpt (remote) initiating call to %s/%s on %s\n",
+                       ast_verb(3, "rpt (remote) initiating call to %s/%s on %s\n",
                                        deststr, tele, l->chan->name);
                        if (l->chan->cid.cid_num)
                                ast_free(l->chan->cid.cid_num);
@@ -2933,8 +2931,7 @@ static int function_ilink(struct rpt *myrpt, char *param, char *digits, int comm
                } else {
                        rpt_telemetry(myrpt, CONNFAIL, l);
                        ast_free(l);
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Unable to place call to %s/%s on %s\n",
+                       ast_verb(3, "Unable to place call to %s/%s on %s\n",
                                        deststr, tele, l->chan->name);
                        return DC_ERROR;
                }
@@ -3036,8 +3033,7 @@ static int function_ilink(struct rpt *myrpt, char *param, char *digits, int comm
                        l->chan->whentohangup = 0;
                        l->chan->appl = "Apprpt";
                        l->chan->data = "(Remote Rx)";
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "rpt (remote) initiating call to %s/%s on %s\n",
+                       ast_verb(3, "rpt (remote) initiating call to %s/%s on %s\n",
                                        deststr, tele, l->chan->name);
                        if (l->chan->cid.cid_num)
                                ast_free(l->chan->cid.cid_num);
@@ -3046,8 +3042,7 @@ static int function_ilink(struct rpt *myrpt, char *param, char *digits, int comm
                } else {
                        rpt_telemetry(myrpt, CONNFAIL, l);
                        ast_free(l);
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Unable to place call to %s/%s on %s\n",
+                       ast_verb(3, "Unable to place call to %s/%s on %s\n",
                                        deststr, tele, l->chan->name);
                        return DC_ERROR;
                }
@@ -5459,8 +5454,7 @@ static int attempt_reconnect(struct rpt *myrpt, struct rpt_link *l)
                l->chan->whentohangup = 0;
                l->chan->appl = "Apprpt";
                l->chan->data = "(Remote Rx)";
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "rpt (attempt_reconnect) initiating call to %s/%s on %s\n",
+               ast_verb(3, "rpt (attempt_reconnect) initiating call to %s/%s on %s\n",
                                deststr, tele, l->chan->name);
                if (l->chan->cid.cid_num)
                        ast_free(l->chan->cid.cid_num);
@@ -5468,8 +5462,7 @@ static int attempt_reconnect(struct rpt *myrpt, struct rpt_link *l)
                ast_call(l->chan, tele, 999); 
 
        } else {
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Unable to place call to %s/%s on %s\n",
+               ast_verb(3, "Unable to place call to %s/%s on %s\n",
                                deststr, tele, l->chan->name);
                return -1;
        }
@@ -5698,8 +5691,7 @@ static void *rpt(void *this)
                myrpt->rxchannel->whentohangup = 0;
                myrpt->rxchannel->appl = "Apprpt";
                myrpt->rxchannel->data = "(Repeater Rx)";
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "rpt (Rx) initiating call to %s/%s on %s\n",
+               ast_verb(3, "rpt (Rx) initiating call to %s/%s on %s\n",
                                tmpstr, tele, myrpt->rxchannel->name);
                ast_call(myrpt->rxchannel, tele, 999);
                if (myrpt->rxchannel->_state != AST_STATE_UP) {
@@ -5740,8 +5732,7 @@ static void *rpt(void *this)
                        myrpt->txchannel->whentohangup = 0;
                        myrpt->txchannel->appl = "Apprpt";
                        myrpt->txchannel->data = "(Repeater Tx)";
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "rpt (Tx) initiating call to %s/%s on %s\n",
+                       ast_verb(3, "rpt (Tx) initiating call to %s/%s on %s\n",
                                        tmpstr, tele, myrpt->txchannel->name);
                        ast_call(myrpt->txchannel, tele, 999);
                        if (myrpt->rxchannel->_state != AST_STATE_UP) {
@@ -6897,8 +6888,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
        
                if (!ast_strlen_zero(optionarg.return_context)) {
                        if (ast_parseable_goto(chan, optionarg.return_context)) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Warning: Return Context Invalid, call will return to default|s\n");
+                               ast_verb(3, "Warning: Return Context Invalid, call will return to default|s\n");
                        }
                }
 
@@ -6906,8 +6896,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
                before we are done announcing and the channel is messed with, Kablooeee.  So we use Masq to prevent this.  */
 
                ast_masq_park_call(chan, NULL, timeout, &lot);
-               if (option_verbose > 2)
-                       ast_verbose( VERBOSE_PREFIX_3 "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, optionarg.return_context);
+               ast_verb(3, "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, optionarg.return_context);
 
                snprintf(tmp, sizeof(tmp), "%d,%s", lot, optionarg.template + 1);
                rpt_telemetry(myrpt, REV_PATCH, tmp);
@@ -7112,8 +7101,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
                myrpt->rxchannel->whentohangup = 0;
                myrpt->rxchannel->appl = "Apprpt";
                myrpt->rxchannel->data = "(Link Rx)";
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "rpt (Rx) initiating call to %s/%s on %s\n",
+               ast_verb(3, "rpt (Rx) initiating call to %s/%s on %s\n",
                                myrpt->rxchanname, tele, myrpt->rxchannel->name);
                rpt_mutex_unlock(&myrpt->lock);
                ast_call(myrpt->rxchannel, tele, 999);
@@ -7140,8 +7128,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
                        myrpt->txchannel->whentohangup = 0;
                        myrpt->txchannel->appl = "Apprpt";
                        myrpt->txchannel->data = "(Link Tx)";
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "rpt (Tx) initiating call to %s/%s on %s\n",
+                       ast_verb(3, "rpt (Tx) initiating call to %s/%s on %s\n",
                                        myrpt->txchanname, tele, myrpt->txchannel->name);
                        rpt_mutex_unlock(&myrpt->lock);
                        ast_call(myrpt->txchannel, tele, 999);
index 9c645379bd154245c4ea47db5e9d40fb8660d696..21a96cb14888291902206f580dbe4404de3676ef 100644 (file)
@@ -1168,7 +1168,7 @@ static int sms_handleincoming_proto2(sms_t *h)
        char debug_buf[MAX_DEBUG_LEN * 3 + 1];
 
        sz = h->imsg[1] + 2;
-       /* ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Frame: %s\n", sms_hexdump(h->imsg, sz, debug_buf)); */
+       /* ast_verb(3, "SMS-P2 Frame: %s\n", sms_hexdump(h->imsg, sz, debug_buf)); */
 
        /* Parse message body (called payload) */
        tv.tv_sec = h->scts = time(NULL);
@@ -1178,8 +1178,7 @@ static int sms_handleincoming_proto2(sms_t *h)
                msgsz += (h->imsg[f++] * 256);
                switch (msg) {
                case 0x13:      /* Body */
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Body#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
+                       ast_verb(3, "SMS-P2 Body#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
                        if (msgsz >= sizeof(h->imsg))
                                msgsz = sizeof(h->imsg) - 1;
                        for (i = 0; i < msgsz; i++)
@@ -1195,30 +1194,25 @@ static int sms_handleincoming_proto2(sms_t *h)
                        tm.tm_min = ( (h->imsg[f + 6] * 10) + h->imsg[f + 7] );
                        tm.tm_sec = 0;
                        h->scts = ast_mktime(&tm, NULL);
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Date#%02X=%02d/%02d %02d:%02d\n", msg, tm.tm_mday, tm.tm_mon + 1, tm.tm_hour, tm.tm_min);
+                       ast_verb(3, "SMS-P2 Date#%02X=%02d/%02d %02d:%02d\n", msg, tm.tm_mday, tm.tm_mon + 1, tm.tm_hour, tm.tm_min);
                        break;
                case 0x15:      /* Calling line (from SMSC) */
                        if (msgsz >= 20)
                                msgsz = 20 - 1;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Origin#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
+                       ast_verb(3, "SMS-P2 Origin#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
                        ast_copy_string(h->oa, (char *)(&h->imsg[f]), msgsz + 1);
                        break;
                case 0x18:      /* Destination(from TE/phone) */
                        if (msgsz >= 20)
                                msgsz = 20 - 1;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Destination#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
+                       ast_verb(3, "SMS-P2 Destination#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
                        ast_copy_string(h->da, (char *)(&h->imsg[f]), msgsz + 1);
                        break;
                case 0x1C:      /* Notify */
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Notify#%02X=%s\n", msg, sms_hexdump(&h->imsg[f], 3, debug_buf));
+                       ast_verb(3, "SMS-P2 Notify#%02X=%s\n", msg, sms_hexdump(&h->imsg[f], 3, debug_buf));
                        break;
                default:
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Par#%02X [%d]: %s\n", msg, msgsz, sms_hexdump(&h->imsg[f], msgsz, debug_buf));
+                       ast_verb(3, "SMS-P2 Par#%02X [%d]: %s\n", msg, msgsz, sms_hexdump(&h->imsg[f], msgsz, debug_buf));
                        break;
                }
                f+=msgsz;       /* Skip to next */
@@ -1391,8 +1385,7 @@ static void sms_debug (int dir, sms_t *h)
        }
        if (q < n)
                sprintf(p, "...");
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "SMS %s%s\n", dir == DIR_RX ? "RX" : "TX", txt);
+       ast_verb(3, "SMS %s%s\n", dir == DIR_RX ? "RX" : "TX", txt);
 }
 
 
@@ -1675,8 +1668,7 @@ static void sms_process(sms_t * h, int samples, signed short *data)
                        /* Protocol 2: empty connnection ready (I am master) */
                        if (h->framenumber < 0 && h->ibytec >= 160 && !memcmp(h->imsg, "UUUUUUUUUUUUUUUUUUUU", 20)) {
                                h->framenumber = 1;
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "SMS protocol 2 detected\n");
+                               ast_verb(3, "SMS protocol 2 detected\n");
                                h->protocol = 2;
                                h->imsg[0] = 0xff;      /* special message (fake) */
                                h->imsg[1] = h->imsg[2] = 0x00;
@@ -1774,7 +1766,7 @@ static int sms_exec(struct ast_channel *chan, void *data)
        if (sms_args.argc > 1)
                ast_app_parse_options(sms_options, &sms_flags, sms_opts, sms_args.options);
 
-       ast_verbose("sms argc %d queue <%s> opts <%s> addr <%s> body <%s>\n",
+       ast_verb(1, "sms argc %d queue <%s> opts <%s> addr <%s> body <%s>\n",
                sms_args.argc, S_OR(sms_args.queue, ""),
                S_OR(sms_args.options, ""),
                S_OR(sms_args.addr, ""),
@@ -1806,7 +1798,7 @@ static int sms_exec(struct ast_channel *chan, void *data)
                h.opause_0 = atoi(sms_opts[OPTION_ARG_PAUSE]);
        if (h.opause_0 < 25 || h.opause_0 > 2000)
                h.opause_0 = 300;       /* default 300ms */
-       ast_verbose("initial delay %dms\n", h.opause_0);
+       ast_verb(1, "initial delay %dms\n", h.opause_0);
 
 
        /* the following apply if there is an arg3/4 and apply to the created message file */
index 83c0323bdd55acc7b769eebba99b5a61b1ed2c4f..e8c347fc997218a8153ee420bb57ccab7ce2e733 100644 (file)
@@ -4554,14 +4554,12 @@ static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms,
                                if (!ast_strlen_zero(prefile)) {
                                /* See if we can find a recorded name for this person instead of their extension number */
                                        if (ast_fileexists(prefile, NULL, NULL) > 0) {
-                                               if (option_verbose > 2)
-                                                       ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: CID number '%s' matches mailbox number, playing recorded name\n", callerid);
+                                               ast_verb(3, "Playing envelope info: CID number '%s' matches mailbox number, playing recorded name\n", callerid);
                                                if (!callback)
                                                        res = wait_file2(chan, vms, "vm-from");
                                                res = ast_stream_and_wait(chan, prefile, "");
                                        } else {
-                                               if (option_verbose > 2)
-                                                       ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: message from '%s'\n", callerid);
+                                               ast_verb(3, "Playing envelope info: message from '%s'\n", callerid);
                                                /* BB: Say "from extension" as one saying to sound smoother */
                                                if (!callback)
                                                        res = wait_file2(chan, vms, "vm-from-extension");
@@ -6691,8 +6689,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
                if (vmu && !strcmp(passptr, password))
                        valid++;
                else {
-                       if (option_verbose > 2)
-                               ast_verbose( VERBOSE_PREFIX_3 "Incorrect password '%s' for user '%s' (context = %s)\n", password, mailbox, context ? context : "default");
+                       ast_verb(3, "Incorrect password '%s' for user '%s' (context = %s)\n", password, mailbox, context ? context : "default");
                        if (!ast_strlen_zero(prefix))
                                mailbox[0] = '\0';
                }
@@ -6993,8 +6990,8 @@ static int vm_execmain(struct ast_channel *chan, void *data)
                                        cmd = 't';
                                        break;
                                case '2': /* Callback */
-                                       if (option_verbose > 2 && !vms.starting)
-                                               ast_verbose( VERBOSE_PREFIX_3 "Callback Requested\n");
+                                       if (!vms.starting)
+                                               ast_verb(3, "Callback Requested\n");
                                        if (!ast_strlen_zero(vmu->callback) && vms.lastmsg > -1 && !vms.starting) {
                                                cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 2, record_gain);
                                                if (cmd == 9) {
@@ -8525,8 +8522,7 @@ static int dialout(struct ast_channel *chan, struct ast_vm_user *vmu, char *num,
        int retries = 0;
 
        if (!num) {
-               if (option_verbose > 2)
-                       ast_verbose( VERBOSE_PREFIX_3 "Destination number will be entered manually\n");
+               ast_verb(3, "Destination number will be entered manually\n");
                while (retries < 3 && cmd != 't') {
                        destination[1] = '\0';
                        destination[0] = cmd = ast_play_and_wait(chan,"vm-enter-num-to-call");
@@ -8546,8 +8542,7 @@ static int dialout(struct ast_channel *chan, struct ast_vm_user *vmu, char *num,
                                if (cmd < 0)
                                        return 0;
                                if (cmd == '*') {
-                                       if (option_verbose > 2)
-                                               ast_verbose( VERBOSE_PREFIX_3 "User hit '*' to cancel outgoing call\n");
+                                       ast_verb(3, "User hit '*' to cancel outgoing call\n");
                                        return 0;
                                }
                                if ((cmd = ast_readstring(chan,destination + strlen(destination),sizeof(destination)-1,6000,10000,"#")) < 0) 
@@ -8700,8 +8695,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
                                                return 9;
                                        }
                                } else {
-                                       if (option_verbose > 2)
-                                               ast_verbose( VERBOSE_PREFIX_3 "Caller can not specify callback number - no dialout context available\n");
+                                       ast_verb(3, "Caller can not specify callback number - no dialout context available\n");
                                        res = ast_play_and_wait(chan, "vm-sorry");
                                }
                                ast_config_destroy(msg_cfg);
@@ -8723,8 +8717,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
                                break;
                        default:
                                if (num) {
-                                       if (option_verbose > 2)
-                                               ast_verbose( VERBOSE_PREFIX_3 "Confirm CID number '%s' is number to use for callback\n", num);
+                                       ast_verb(3, "Confirm CID number '%s' is number to use for callback\n", num);
                                        res = ast_play_and_wait(chan, "vm-num-i-have");
                                        if (!res)
                                                res = play_message_callerid(chan, vms, num, vmu->context, 1);
@@ -8768,8 +8761,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
 
                ast_callerid_parse(cid, &name, &num);
                if (!num) {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "No CID number available, no reply sent\n");
+                       ast_verb(3, "No CID number available, no reply sent\n");
                        if (!res)
                                res = ast_play_and_wait(chan, "vm-nonumber");
                        ast_config_destroy(msg_cfg);
@@ -8793,8 +8785,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
                                return res;
                        } else {
                                /* Sender has no mailbox, can't reply */
-                               if (option_verbose > 2)
-                                       ast_verbose( VERBOSE_PREFIX_3 "No mailbox number '%s' in context '%s', no reply sent\n", num, vmu->context);
+                               ast_verb(3, "No mailbox number '%s' in context '%s', no reply sent\n", num, vmu->context);
                                ast_play_and_wait(chan, "vm-nobox");
                                res = 't';
                                ast_config_destroy(msg_cfg);
@@ -8915,16 +8906,14 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
 #if 0                  
                        else if (vmu->review && (*duration < 5)) {
                                /* Message is too short */
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Message too short\n");
+                               ast_verb(3, "Message too short\n");
                                cmd = ast_play_and_wait(chan, "vm-tooshort");
                                cmd = ast_filedelete(tempfile, NULL);
                                break;
                        }
                        else if (vmu->review && (cmd == 2 && *duration < (maxsilence + 3))) {
                                /* Message is all silence */
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Nothing recorded\n");
+                               ast_verb(3, "Nothing recorded\n");
                                cmd = ast_filedelete(tempfile, NULL);
                                cmd = ast_play_and_wait(chan, "vm-nothingrecorded");
                                if (!cmd)
index dd1c98047713ed2878d21e3b76e0d8b26936038e..1378c3e5f5042613e5d4416a3c73bf40ce9b5103 100644 (file)
@@ -79,8 +79,7 @@ static int waitforring_exec(struct ast_channel *chan, void *data)
                                break;
                        }
                        if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_RING)) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Got a ring but still waiting for timeout\n");
+                               ast_verb(3, "Got a ring but still waiting for timeout\n");
                        }
                        ast_frfree(f);
                }
@@ -101,8 +100,7 @@ static int waitforring_exec(struct ast_channel *chan, void *data)
                                        break;
                                }
                                if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_RING)) {
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "Got a ring after the timeout\n");
+                                       ast_verb(3, "Got a ring after the timeout\n");
                                        ast_frfree(f);
                                        break;
                                }
index a6a7650c6f1cf4c3f0dd776b1e056375bbb0d71d..8aca886508412b146113c6ce25bc2006e65bea15 100644 (file)
@@ -126,12 +126,10 @@ static int do_waiting(struct ast_channel *chan, int silencereqd, time_t waitstar
                        }
                }
 
-               if (option_verbose > 6)
-                       ast_verbose(VERBOSE_PREFIX_3 "Got %dms silence< %dms required\n", dspsilence, silencereqd);
+               ast_verb(3, "Got %dms silence< %dms required\n", dspsilence, silencereqd);
 
                if (dspsilence >= silencereqd) {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Exiting with %dms silence >= %dms required\n", dspsilence, silencereqd);
+                       ast_verb(3, "Exiting with %dms silence >= %dms required\n", dspsilence, silencereqd);
                        /* Ended happily with silence */
                        res = 1;
                        pbx_builtin_setvar_helper(chan, "WAITSTATUS", "SILENCE");
@@ -171,8 +169,7 @@ static int waitforsilence_exec(struct ast_channel *chan, void *data)
                ast_log(LOG_WARNING, "Using default value of 1000ms, 1 iteration, no timeout\n");
        }
 
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "Waiting %d time(s) for %d ms silence with %d timeout\n", iterations, silencereqd, timeout);
+       ast_verb(3, "Waiting %d time(s) for %d ms silence with %d timeout\n", iterations, silencereqd, timeout);
 
        time(&waitstart);
        res = 1;
index f7da65b19443e1fa61cf59bbf190574a4b8e0443..12f5f63fe043ef1b2c1bb9dd51416de1d2a0669e 100644 (file)
@@ -229,8 +229,7 @@ static int _while_exec(struct ast_channel *chan, void *data, int end)
                } else {
                        int pri = find_matching_endwhile(chan);
                        if (pri > 0) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Jumping to priority %d\n", pri);
+                               ast_verb(3, "Jumping to priority %d\n", pri);
                                chan->priority = pri;
                        } else {
                                ast_log(LOG_WARNING, "Couldn't find matching EndWhile? (While at %s@%s priority %d)\n", chan->context, chan->exten, chan->priority);
index 95b34d8203f9e177f97eb85587af2741433ac2a6..448c45b7bbb1618c7c5ffd19d29593d1bc6e04dd 100644 (file)
@@ -214,20 +214,17 @@ static int zapras_exec(struct ast_channel *chan, void *data)
        if (strcasecmp(chan->tech->type, "Zap")) {
                /* If it's not a zap channel, we're done.  Wait a couple of
                   seconds and then hangup... */
-               if (option_verbose > 1)
-                       ast_verbose(VERBOSE_PREFIX_2 "Channel %s is not a Zap channel\n", chan->name);
+               ast_verb(2, "Channel %s is not a Zap channel\n", chan->name);
                sleep(2);
        } else {
                memset(&ztp, 0, sizeof(ztp));
                if (ioctl(chan->fds[0], ZT_GET_PARAMS, &ztp)) {
                        ast_log(LOG_WARNING, "Unable to get zaptel parameters\n");
                } else if (ztp.sigtype != ZT_SIG_CLEAR) {
-                       if (option_verbose > 1)
-                               ast_verbose(VERBOSE_PREFIX_2 "Channel %s is not a clear channel\n", chan->name);
+                       ast_verb(2, "Channel %s is not a clear channel\n", chan->name);
                } else {
                        /* Everything should be okay.  Run PPP. */
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Starting RAS on %s\n", chan->name);
+                       ast_verb(3, "Starting RAS on %s\n", chan->name);
                        /* Execute RAS */
                        run_ras(chan, args);
                }
index 76cfbe3b012dd6f045625c0cbad92e331fba5116..1530d7f7bb5ca44fdc4356e86459db6f65e3ae2a 100644 (file)
@@ -231,7 +231,7 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
                                                input[ic++] = '\0';
                                                ic=0;
                                                ret = atoi(input);
-                                               ast_verbose(VERBOSE_PREFIX_3 "Zapscan: change channel to %d\n",ret);
+                                               ast_verb(3, "Zapscan: change channel to %d\n",ret);
                                                break;
                                        }
                                }
@@ -300,7 +300,7 @@ static int conf_exec(struct ast_channel *chan, void *data)
        
        desired_group = ast_strdupa(data);
        if(!ast_strlen_zero(desired_group)) {
-               ast_verbose(VERBOSE_PREFIX_3 "Scanning for group %s\n", desired_group);
+               ast_verb(3, "Scanning for group %s\n", desired_group);
                search_group = 1;
        }
 
@@ -330,7 +330,7 @@ static int conf_exec(struct ast_channel *chan, void *data)
                if (tempchan && search_group) {
                        const char *mygroup;
                        if((mygroup = pbx_builtin_getvar_helper(tempchan, "GROUP")) && (!strcmp(mygroup, desired_group))) {
-                               ast_verbose(VERBOSE_PREFIX_3 "Found Matching Channel %s in group %s\n", tempchan->name, desired_group);
+                               ast_verb(3, "Found Matching Channel %s in group %s\n", tempchan->name, desired_group);
                        } else {
                                ast_mutex_unlock(&tempchan->lock);
                                lastchan = tempchan;
@@ -338,7 +338,7 @@ static int conf_exec(struct ast_channel *chan, void *data)
                        }
                }
                if (tempchan && (!strcmp(tempchan->tech->type, "Zap")) && (tempchan != chan) ) {
-                       ast_verbose(VERBOSE_PREFIX_3 "Zap channel %s is in-use, monitoring...\n", tempchan->name);
+                       ast_verb(3, "Zap channel %s is in-use, monitoring...\n", tempchan->name);
                        ast_copy_string(confstr, tempchan->name, sizeof(confstr));
                        ast_mutex_unlock(&tempchan->lock);
                        if ((tmp = strchr(confstr,'-'))) {
index 9814079a474b5f7ba914fa792d85bf5db0a89818..8c3b1e5ffefbc14f92a949e372695c36bc5b8ae6 100644 (file)
@@ -155,8 +155,7 @@ static int load_config(void)
                ast_copy_string(tableptr->connection, connection, lenconnection + 1);
                ast_copy_string(tableptr->table, table, lentable + 1);
 
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Found adaptive CDR table %s@%s.\n", tableptr->table, tableptr->connection);
+               ast_verb(3, "Found adaptive CDR table %s@%s.\n", tableptr->table, tableptr->connection);
 
                while ((res = SQLFetch(stmt)) != SQL_NO_DATA && res != SQL_ERROR) {
                        char *cdrvar = "";
@@ -173,8 +172,7 @@ static int load_config(void)
                                if (strcasecmp(var->value, columnname) == 0) {
                                        char *tmp = ast_strdupa(var->name + 5);
                                        cdrvar = ast_strip(tmp);
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "Found alias %s for column %s in %s@%s\n", cdrvar, columnname, tableptr->table, tableptr->connection);
+                                       ast_verb(3, "Found alias %s for column %s in %s@%s\n", cdrvar, columnname, tableptr->table, tableptr->connection);
                                        break;
                                }
                        }
@@ -541,8 +539,7 @@ static int odbc_log(struct ast_cdr *cdr)
                sql2[lensql2 - 1] = ')';
                strcat(sql + lensql, sql2);
 
-               if (option_verbose > 10)
-                       ast_verbose(VERBOSE_PREFIX_4 "[%s]\n", sql);
+               ast_verb(11, "[%s]\n", sql);
                /* No need to check the connection now; we'll handle any failure in prepare_and_execute */
                obj = ast_odbc_request_obj(tableptr->connection, 0);
                if (obj) {
index 6800027844435b3805fa84ee1b509c53ec37b6b9..1ba24f50a9150d5a6a1fcb76922b4af7aba19a7f 100644 (file)
@@ -126,8 +126,7 @@ static int odbc_log(struct ast_cdr *cdr)
        ODBC_res = SQLAllocHandle(SQL_HANDLE_STMT, ODBC_con, &ODBC_stmt);
 
        if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
-               if (option_verbose > 10)
-                       ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Failure in AllocStatement %d\n", ODBC_res);
+               ast_verb(11, "cdr_odbc: Failure in AllocStatement %d\n", ODBC_res);
                SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt);
                odbc_disconnect();
                ast_mutex_unlock(&odbc_lock);
@@ -141,8 +140,7 @@ static int odbc_log(struct ast_cdr *cdr)
        ODBC_res = SQLPrepare(ODBC_stmt, (unsigned char *)sqlcmd, SQL_NTS);
        
        if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
-               if (option_verbose > 10)
-                       ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error in PREPARE %d\n", ODBC_res);
+               ast_verb(11, "cdr_odbc: Error in PREPARE %d\n", ODBC_res);
                SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt);
                odbc_disconnect();
                ast_mutex_unlock(&odbc_lock);
@@ -175,29 +173,23 @@ static int odbc_log(struct ast_cdr *cdr)
        if (connected) {
                res = odbc_do_query();
                if (res < 0) {
-                       if (option_verbose > 10)                
-                               ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Query FAILED Call not logged!\n");
-                       if (option_verbose > 10)
-                               ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Reconnecting to dsn %s\n", dsn);
+                       ast_verb(11, "cdr_odbc: Query FAILED Call not logged!\n");
+                       ast_verb(11, "cdr_odbc: Reconnecting to dsn %s\n", dsn);
                        SQLDisconnect(ODBC_con);
                        res = odbc_init();
                        if (res < 0) {
-                               if (option_verbose > 10)
-                                       ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: %s has gone away!\n", dsn);
+                               ast_verb(11, "cdr_odbc: %s has gone away!\n", dsn);
                                odbc_disconnect();
                        } else {
-                               if (option_verbose > 10)
-                                       ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Trying Query again!\n");
+                               ast_verb(11, "cdr_odbc: Trying Query again!\n");
                                res = odbc_do_query();
                                if (res < 0) {
-                                       if (option_verbose > 10)
-                                               ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Query FAILED Call not logged!\n");
+                                       ast_verb(11, "cdr_odbc: Query FAILED Call not logged!\n");
                                }
                        }
                }
        } else {
-               if (option_verbose > 10)
-                       ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Query FAILED Call not logged!\n");
+               ast_verb(11, "cdr_odbc: Query FAILED Call not logged!\n");
        }
        SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt);
        ast_mutex_unlock(&odbc_lock);
@@ -208,29 +200,24 @@ static int odbc_unload_module(void)
 {
        ast_mutex_lock(&odbc_lock);
        if (connected) {
-               if (option_verbose > 10)
-                       ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Disconnecting from %s\n", dsn);
+               ast_verb(11, "cdr_odbc: Disconnecting from %s\n", dsn);
                SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt);
                odbc_disconnect();
        }
        if (dsn) {
-               if (option_verbose > 10)
-                       ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: free dsn\n");
+               ast_verb(11, "cdr_odbc: free dsn\n");
                ast_free(dsn);
        }
        if (username) {
-               if (option_verbose > 10)
-                       ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: free username\n");
+               ast_verb(11, "cdr_odbc: free username\n");
                ast_free(username);
        }
        if (password) {
-               if (option_verbose > 10)
-                       ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: free password\n");
+               ast_verb(11, "cdr_odbc: free password\n");
                ast_free(password);
        }
        if (table) {
-               if (option_verbose > 10)
-                       ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: free table\n");
+               ast_verb(11, "cdr_odbc: free table\n");
                ast_free(table);
        }
 
@@ -338,25 +325,19 @@ static int odbc_load_module(void)
                goto out;
        }
 
-       if (option_verbose > 2) {
-               ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: dsn is %s\n",dsn);
-               if (username)
-               {
-                       ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: username is %s\n",username);
-                       ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: password is [secret]\n");
-               }
-               else
-                       ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: retreiving username and password from odbc config\n");
-               ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: table is %s\n",table);
-       }
+       ast_verb(3, "cdr_odbc: dsn is %s\n",dsn);
+       if (username) {
+               ast_verb(3, "cdr_odbc: username is %s\n",username);
+               ast_verb(3, "cdr_odbc: password is [secret]\n");
+       } else
+               ast_verb(3, "cdr_odbc: retreiving username and password from odbc config\n");
+       ast_verb(3, "cdr_odbc: table is %s\n",table);
        
        res = odbc_init();
        if (res < 0) {
                ast_log(LOG_ERROR, "cdr_odbc: Unable to connect to datasource: %s\n", dsn);
-               if (option_verbose > 2) {
-                       ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: Unable to connect to datasource: %s\n", dsn);
+               ast_verb(3, "cdr_odbc: Unable to connect to datasource: %s\n", dsn);
                }
-       }
        res = ast_cdr_register(name, ast_module_info->description, odbc_log);
        if (res) {
                ast_log(LOG_ERROR, "cdr_odbc: Unable to register ODBC CDR handling\n");
@@ -375,14 +356,12 @@ static int odbc_do_query(void)
        ODBC_res = SQLExecute(ODBC_stmt);
        
        if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
-               if (option_verbose > 10)
-                       ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error in Query %d\n", ODBC_res);
+               ast_verb(11, "cdr_odbc: Error in Query %d\n", ODBC_res);
                SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt);
                odbc_disconnect();
                return -1;
        } else {
-               if (option_verbose > 10)
-                       ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Query Successful!\n");
+               ast_verb(11, "cdr_odbc: Query Successful!\n");
                connected = 1;
        }
        return 0;
@@ -395,8 +374,7 @@ static int odbc_init(void)
        if (ODBC_env == SQL_NULL_HANDLE || connected == 0) {
                ODBC_res = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &ODBC_env);
                if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
-                       if (option_verbose > 10)
-                               ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error AllocHandle\n");
+                       ast_verb(11, "cdr_odbc: Error AllocHandle\n");
                        connected = 0;
                        return -1;
                }
@@ -404,8 +382,7 @@ static int odbc_init(void)
                ODBC_res = SQLSetEnvAttr(ODBC_env, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0);
 
                if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
-                       if (option_verbose > 10)
-                               ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error SetEnv\n");
+                       ast_verb(11, "cdr_odbc: Error SetEnv\n");
                        SQLFreeHandle(SQL_HANDLE_ENV, ODBC_env);
                        connected = 0;
                        return -1;
@@ -414,8 +391,7 @@ static int odbc_init(void)
                ODBC_res = SQLAllocHandle(SQL_HANDLE_DBC, ODBC_env, &ODBC_con);
 
                if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
-                       if (option_verbose > 10)
-                               ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error AllocHDB %d\n", ODBC_res);
+                       ast_verb(11, "cdr_odbc: Error AllocHDB %d\n", ODBC_res);
                        SQLFreeHandle(SQL_HANDLE_ENV, ODBC_env);
                        connected = 0;
                        return -1;
@@ -428,15 +404,13 @@ static int odbc_init(void)
        ODBC_res = SQLConnect(ODBC_con, (SQLCHAR*)dsn, SQL_NTS, (SQLCHAR*)username, SQL_NTS, (SQLCHAR*)password, SQL_NTS);
 
        if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
-               if (option_verbose > 10)
-                       ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error SQLConnect %d\n", ODBC_res);
+               ast_verb(11, "cdr_odbc: Error SQLConnect %d\n", ODBC_res);
                SQLFreeHandle(SQL_HANDLE_DBC, ODBC_con);
                SQLFreeHandle(SQL_HANDLE_ENV, ODBC_env);
                connected = 0;
                return -1;
        } else {
-               if (option_verbose > 10)
-                       ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Connected to %s\n", dsn);
+               ast_verb(11, "cdr_odbc: Connected to %s\n", dsn);
                connected = 1;
        }
        return 0;
index 54840c53487f69fc7052ff51e1657ee728df40d1..6b3db5c93eb6f410098341aae20e7b44bd9e5496 100644 (file)
@@ -458,8 +458,7 @@ static struct ast_frame *agent_read(struct ast_channel *ast)
                case AST_FRAME_CONTROL:
                        if (f->subclass == AST_CONTROL_ANSWER) {
                                if (p->ackcall) {
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "%s answered, waiting for '#' to acknowledge\n", p->chan->name);
+                                       ast_verb(3, "%s answered, waiting for '#' to acknowledge\n", p->chan->name);
                                        /* Don't pass answer along */
                                        ast_frfree(f);
                                        f = &ast_null_frame;
@@ -475,8 +474,7 @@ static struct ast_frame *agent_read(struct ast_channel *ast)
                case AST_FRAME_DTMF_BEGIN:
                case AST_FRAME_DTMF_END:
                        if (!p->acknowledged && (f->subclass == '#')) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "%s acknowledged\n", p->chan->name);
+                               ast_verb(3, "%s acknowledged\n", p->chan->name);
                                p->acknowledged = 1;
                                ast_frfree(f);
                                f = &answer_frame;
@@ -628,8 +626,7 @@ static int agent_call(struct ast_channel *ast, char *dest, int timeout)
        } else if (!ast_strlen_zero(p->loginchan)) {
                time(&p->start);
                /* Call on this agent */
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "outgoing agentcall, to agent '%s', on '%s'\n", p->agent, p->chan->name);
+               ast_verb(3, "outgoing agentcall, to agent '%s', on '%s'\n", p->agent, p->chan->name);
                ast_set_callerid(p->chan,
                        ast->cid.cid_num, ast->cid.cid_name, NULL);
                ast_channel_inherit_variables(ast, p->chan);
@@ -638,7 +635,7 @@ static int agent_call(struct ast_channel *ast, char *dest, int timeout)
                ast_mutex_unlock(&p->lock);
                return res;
        }
-       ast_verbose( VERBOSE_PREFIX_3 "agent_call, call to agent '%s' call on '%s'\n", p->agent, p->chan->name);
+       ast_verb(3, "agent_call, call to agent '%s' call on '%s'\n", p->agent, p->chan->name);
        ast_debug(3, "Playing beep, lang '%s'\n", p->chan->language);
        res = ast_streamfile(p->chan, beep, p->chan->language);
        ast_debug(3, "Played beep, result '%d'\n", res);
@@ -1748,8 +1745,7 @@ static int login_exec(struct ast_channel *chan, void *data)
                if (max_login_tries < 0)
                        max_login_tries = 0;
                tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTMAXLOGINTRIES");
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTMAXLOGINTRIES=%s, setting max_login_tries to: %d on Channel '%s'.\n",tmpoptions,max_login_tries,chan->name);
+               ast_verb(3, "Saw variable AGENTMAXLOGINTRIES=%s, setting max_login_tries to: %d on Channel '%s'.\n",tmpoptions,max_login_tries,chan->name);
        }
        if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR"))) {
                if (ast_true(pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR")))
@@ -1757,14 +1753,12 @@ static int login_exec(struct ast_channel *chan, void *data)
                else
                        update_cdr = 0;
                tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR");
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTUPDATECDR=%s, setting update_cdr to: %d on Channel '%s'.\n",tmpoptions,update_cdr,chan->name);
+               ast_verb(3, "Saw variable AGENTUPDATECDR=%s, setting update_cdr to: %d on Channel '%s'.\n",tmpoptions,update_cdr,chan->name);
        }
        if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTGOODBYE"))) {
                strcpy(agent_goodbye, pbx_builtin_getvar_helper(chan, "AGENTGOODBYE"));
                tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTGOODBYE");
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTGOODBYE=%s, setting agent_goodbye to: %s on Channel '%s'.\n",tmpoptions,agent_goodbye,chan->name);
+               ast_verb(3, "Saw variable AGENTGOODBYE=%s, setting agent_goodbye to: %s on Channel '%s'.\n",tmpoptions,agent_goodbye,chan->name);
        }
        /* End Channel Specific Login Overrides */
        
@@ -1824,24 +1818,21 @@ static int login_exec(struct ast_channel *chan, void *data)
                                        else
                                                p->ackcall = 0;
                                        tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTACKCALL");
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTACKCALL=%s, setting ackcall to: %d for Agent '%s'.\n",tmpoptions,p->ackcall,p->agent);
+                                       ast_verb(3, "Saw variable AGENTACKCALL=%s, setting ackcall to: %d for Agent '%s'.\n",tmpoptions,p->ackcall,p->agent);
                                }
                                if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTAUTOLOGOFF"))) {
                                        p->autologoff = atoi(pbx_builtin_getvar_helper(chan, "AGENTAUTOLOGOFF"));
                                        if (p->autologoff < 0)
                                                p->autologoff = 0;
                                        tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTAUTOLOGOFF");
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTAUTOLOGOFF=%s, setting autologff to: %d for Agent '%s'.\n",tmpoptions,p->autologoff,p->agent);
+                                       ast_verb(3, "Saw variable AGENTAUTOLOGOFF=%s, setting autologff to: %d for Agent '%s'.\n",tmpoptions,p->autologoff,p->agent);
                                }
                                if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTWRAPUPTIME"))) {
                                        p->wrapuptime = atoi(pbx_builtin_getvar_helper(chan, "AGENTWRAPUPTIME"));
                                        if (p->wrapuptime < 0)
                                                p->wrapuptime = 0;
                                        tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTWRAPUPTIME");
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTWRAPUPTIME=%s, setting wrapuptime to: %d for Agent '%s'.\n",tmpoptions,p->wrapuptime,p->agent);
+                                       ast_verb(3, "Saw variable AGENTWRAPUPTIME=%s, setting wrapuptime to: %d for Agent '%s'.\n",tmpoptions,p->wrapuptime,p->agent);
                                }
                                /* End Channel Specific Agent Overrides */
                                if (!p->chan) {
@@ -1887,8 +1878,7 @@ static int login_exec(struct ast_channel *chan, void *data)
                                                if (update_cdr && chan->cdr)
                                                        snprintf(chan->cdr->channel, sizeof(chan->cdr->channel), "Agent/%s", p->agent);
                                                ast_queue_log("NONE", chan->uniqueid, agent, "AGENTLOGIN", "%s", chan->name);
-                                               if (option_verbose > 1)
-                                                       ast_verbose(VERBOSE_PREFIX_2 "Agent '%s' logged in (format %s/%s)\n", p->agent,
+                                               ast_verb(2, "Agent '%s' logged in (format %s/%s)\n", p->agent,
                                                                    ast_getformatname(chan->readformat), ast_getformatname(chan->writeformat));
                                                /* Login this channel and wait for it to go away */
                                                p->chan = chan;
@@ -1963,8 +1953,7 @@ static int login_exec(struct ast_channel *chan, void *data)
                                                              "Uniqueid: %s\r\n",
                                                              p->agent, logintime, chan->uniqueid);
                                                ast_queue_log("NONE", chan->uniqueid, agent, "AGENTLOGOFF", "%s|%ld", chan->name, logintime);
-                                               if (option_verbose > 1)
-                                                       ast_verbose(VERBOSE_PREFIX_2 "Agent '%s' logged out\n", p->agent);
+                                               ast_verb(2, "Agent '%s' logged out\n", p->agent);
                                                /* If there is no owner, go ahead and kill it now */
                                                ast_device_state_changed("Agent/%s", p->agent);
                                                if (p->dead && !p->owner) {
index de8f3ffef63530b6c1c13791459e2121fbea2195..d3decea0525e940c31a31c2040b914f327495797 100644 (file)
@@ -1124,10 +1124,8 @@ static int load_module(void)
        }
 
        if (soundcard_init() < 0) {
-               if (option_verbose > 1) {
-                       ast_verbose(VERBOSE_PREFIX_2 "No sound card detected -- console channel will be unavailable\n");
-                       ast_verbose(VERBOSE_PREFIX_2 "Turn off ALSA support by adding 'noload=chan_alsa.so' in /etc/asterisk/modules.conf\n");
-               }
+               ast_verb(2, "No sound card detected -- console channel will be unavailable\n");
+               ast_verb(2, "Turn off ALSA support by adding 'noload=chan_alsa.so' in /etc/asterisk/modules.conf\n");
                return AST_MODULE_LOAD_DECLINE;
        }
 
index d43fc772863d1cddd12635b5c64bb793263c53f9..4e38a4eb543ed8578793b73db6f2f052a79765cf 100644 (file)
@@ -656,8 +656,7 @@ static int oh323_call(struct ast_channel *c, char *dest, int timeout)
        /* indicate that this is an outgoing call */
        pvt->outgoing = 1;
 
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "Requested transfer capability: 0x%.2x - %s\n", c->transfercapability, ast_transfercapability2str(c->transfercapability));
+       ast_verb(3, "Requested transfer capability: 0x%.2x - %s\n", c->transfercapability, ast_transfercapability2str(c->transfercapability));
        if (h323debug)
                ast_debug(1, "Placing outgoing call to %s, %d/%d\n", called_addr, pvt->options.dtmfcodec[0], pvt->options.dtmfcodec[1]);
        ast_mutex_unlock(&pvt->lock);
@@ -2139,15 +2138,15 @@ static call_options_t *setup_incoming_call(call_details_t *cd)
        pvt->jointcapability = pvt->options.capability;
 
        if (h323debug) {
-               ast_verbose(VERBOSE_PREFIX_3 "Setting up Call\n");
-               ast_verbose(VERBOSE_PREFIX_3 " \tCall token:  [%s]\n", pvt->cd.call_token);
-               ast_verbose(VERBOSE_PREFIX_3 " \tCalling party name:  [%s]\n", pvt->cd.call_source_name);
-               ast_verbose(VERBOSE_PREFIX_3 " \tCalling party number:  [%s]\n", pvt->cd.call_source_e164);
-               ast_verbose(VERBOSE_PREFIX_3 " \tCalled party name:  [%s]\n", pvt->cd.call_dest_alias);
-               ast_verbose(VERBOSE_PREFIX_3 " \tCalled party number:  [%s]\n", pvt->cd.call_dest_e164);
+               ast_verb(3, "Setting up Call\n");
+               ast_verb(3, " \tCall token:  [%s]\n", pvt->cd.call_token);
+               ast_verb(3, " \tCalling party name:  [%s]\n", pvt->cd.call_source_name);
+               ast_verb(3, " \tCalling party number:  [%s]\n", pvt->cd.call_source_e164);
+               ast_verb(3, " \tCalled party name:  [%s]\n", pvt->cd.call_dest_alias);
+               ast_verb(3, " \tCalled party number:  [%s]\n", pvt->cd.call_dest_e164);
                if (pvt->cd.redirect_reason >= 0)
-                       ast_verbose(VERBOSE_PREFIX_3 " \tRedirecting party number:  [%s] (reason %d)\n", pvt->cd.redirect_number, pvt->cd.redirect_reason);
-               ast_verbose(VERBOSE_PREFIX_3 " \tCalling party IP:  [%s]\n", pvt->cd.sourceIp);
+                       ast_verb(3, " \tRedirecting party number:  [%s] (reason %d)\n", pvt->cd.redirect_number, pvt->cd.redirect_reason);
+               ast_verb(3, " \tCalling party IP:  [%s]\n", pvt->cd.sourceIp);
        }
 
        /* Decide if we are allowing Gatekeeper routed calls*/
@@ -2540,9 +2539,7 @@ static void *do_monitor(void *data)
                h323_reloading = 0;
                ast_mutex_unlock(&h323_reload_lock);
                if (reloading) {
-                       if (option_verbose > 0) {
-                               ast_verbose(VERBOSE_PREFIX_1 "Reloading H.323\n");
-                       }
+                       ast_verb(1, "Reloading H.323\n");
                        h323_do_reload();
                }
                /* Check for interfaces needing to be killed */
@@ -2691,9 +2688,9 @@ static int h323_ep_hangup(int fd, int argc, char *argv[])
                return RESULT_SHOWUSAGE;
        }
        if (h323_soft_hangup(argv[2])) {
-               ast_verbose(VERBOSE_PREFIX_3 "Hangup succeeded on %s\n", argv[2]);
+               ast_verb(3, "Hangup succeeded on %s\n", argv[2]);
        } else {
-               ast_verbose(VERBOSE_PREFIX_3 "Hangup failed for %s\n", argv[2]);
+               ast_verb(3, "Hangup failed for %s\n", argv[2]);
        }
        return RESULT_SUCCESS;
 }
@@ -2922,7 +2919,7 @@ static int reload_config(int is_reload)
                        gkroute = ast_true(v->value);
                } else if (!strcasecmp(v->name, "context")) {
                        ast_copy_string(default_context, v->value, sizeof(default_context));
-                       ast_verbose(VERBOSE_PREFIX_2 "Setting default context to %s\n", default_context);
+                       ast_verb(2, "Setting default context to %s\n", default_context);
                } else if (!strcasecmp(v->name, "UserByAlias")) {
                        userbyalias = ast_true(v->value);
                } else if (!strcasecmp(v->name, "AcceptAnonymous")) {
index dc77f1d7c180dc6d14fbf4137205e25bc35de016..1af35653997d962ed88f8e524550d3e65b8e6f33 100644 (file)
@@ -1736,8 +1736,7 @@ static void reload_firmware(void)
                        if (de->d_name[0] != '.') {
                                snprintf(fn, sizeof(fn), "%s/%s", dir, de->d_name);
                                if (!try_firmware(fn)) {
-                                       if (option_verbose > 1)
-                                               ast_verbose(VERBOSE_PREFIX_2 "Loaded firmware '%s'\n", de->d_name);
+                                       ast_verb(2, "Loaded firmware '%s'\n", de->d_name);
                                }
                        }
                }
@@ -3223,8 +3222,7 @@ static int iax2_hangup(struct ast_channel *c)
                }
        }
        ast_mutex_unlock(&iaxsl[callno]);
-       if (option_verbose > 2) 
-               ast_verbose(VERBOSE_PREFIX_3 "Hungup '%s'\n", c->name);
+       ast_verb(3, "Hungup '%s'\n", c->name);
        return 0;
 }
 
@@ -3333,8 +3331,7 @@ static enum ast_bridge_result iax2_bridge(struct ast_channel *c0, struct ast_cha
        for (/* ever */;;) {
                /* Check in case we got masqueraded into */
                if ((c0->tech != &iax2_tech) || (c1->tech != &iax2_tech)) {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Can't masquerade, we're different...\n");
+                       ast_verb(3, "Can't masquerade, we're different...\n");
                        /* Remove from native mode */
                        if (c0->tech == &iax2_tech) {
                                ast_mutex_lock(&iaxsl[callno0]);
@@ -3349,13 +3346,11 @@ static enum ast_bridge_result iax2_bridge(struct ast_channel *c0, struct ast_cha
                        return AST_BRIDGE_FAILED_NOWARN;
                }
                if (c0->nativeformats != c1->nativeformats) {
-                       if (option_verbose > 2) {
                                char buf0[255];
                                char buf1[255];
                                ast_getformatname_multiple(buf0, sizeof(buf0) -1, c0->nativeformats);
                                ast_getformatname_multiple(buf1, sizeof(buf1) -1, c1->nativeformats);
-                               ast_verbose(VERBOSE_PREFIX_3 "Operating with different codecs %d[%s] %d[%s] , can't native bridge...\n", c0->nativeformats, buf0, c1->nativeformats, buf1);
-                       }
+                       ast_verb(3, "Operating with different codecs %d[%s] %d[%s] , can't native bridge...\n", c0->nativeformats, buf0, c1->nativeformats, buf1);
                        /* Remove from native mode */
                        lock_both(callno0, callno1);
                        if (iaxs[callno0])
@@ -5772,7 +5767,6 @@ static int iax2_ack_registry(struct iax_ies *ies, struct sockaddr_in *sin, int c
                ast_sched_del(sched, reg->expire);
        reg->expire = ast_sched_add(sched, (5 * reg->refresh / 6) * 1000, iax2_do_register_s, reg);
        if (inaddrcmp(&oldus, &reg->us) || (reg->messages != oldmsgs)) {
-               if (option_verbose > 2) {
                        if (reg->messages > 255)
                                snprintf(msgstatus, sizeof(msgstatus), " with %d new and %d old messages waiting", reg->messages & 0xff, reg->messages >> 8);
                        else if (reg->messages > 1)
@@ -5782,8 +5776,7 @@ static int iax2_ack_registry(struct iax_ies *ies, struct sockaddr_in *sin, int c
                        else
                                snprintf(msgstatus, sizeof(msgstatus), " with no messages waiting\n");
                        snprintf(ourip, sizeof(ourip), "%s:%d", ast_inet_ntoa(reg->us.sin_addr), ntohs(reg->us.sin_port));
-                       ast_verbose(VERBOSE_PREFIX_3 "Registered IAX2 to '%s', who sees us as %s%s\n", ast_inet_ntoa(sin->sin_addr), ourip, msgstatus);
-               }
+               ast_verb(3, "Registered IAX2 to '%s', who sees us as %s%s\n", ast_inet_ntoa(sin->sin_addr), ourip, msgstatus);
                manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelType: IAX2\r\nDomain: %s\r\nStatus: Registered\r\n", ast_inet_ntoa(sin->sin_addr));
        }
        reg->regstate = REG_STATE_REGISTERED;
@@ -5942,8 +5935,7 @@ static void reg_source_db(struct iax2_peer *p)
                                if (d) {
                                        *d = '\0';
                                        d++;
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "Seeding '%s' at %s:%d for %d\n", p->name, 
+                                       ast_verb(3, "Seeding '%s' at %s:%d for %d\n", p->name,
                                                ast_inet_ntoa(in), atoi(c), atoi(d));
                                        iax2_poke_peer(p, 0);
                                        p->expiry = atoi(d);
@@ -5999,15 +5991,13 @@ static int update_registry(const char *name, struct sockaddr_in *sin, int callno
                snprintf(data, sizeof(data), "%s:%d:%d", ast_inet_ntoa(sin->sin_addr), ntohs(sin->sin_port), p->expiry);
                if (!ast_test_flag(p, IAX_TEMPONLY) && sin->sin_addr.s_addr) {
                        ast_db_put("IAX/Registry", p->name, data);
-                       if  (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Registered IAX2 '%s' (%s) at %s:%d\n", p->name, 
+                       ast_verb(3, "Registered IAX2 '%s' (%s) at %s:%d\n", p->name,
                                            ast_test_flag(&iaxs[callno]->state, IAX_STATE_AUTHENTICATED) ? "AUTHENTICATED" : "UNAUTHENTICATED", ast_inet_ntoa(sin->sin_addr), ntohs(sin->sin_port));
                        manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: IAX2/%s\r\nPeerStatus: Registered\r\n", p->name);
                        register_peer_exten(p, 1);
                        ast_device_state_changed("IAX2/%s", p->name); /* Activate notification */
                } else if (!ast_test_flag(p, IAX_TEMPONLY)) {
-                       if  (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Unregistered IAX2 '%s' (%s)\n", p->name, 
+                       ast_verb(3, "Unregistered IAX2 '%s' (%s)\n", p->name,
                                            ast_test_flag(&iaxs[callno]->state, IAX_STATE_AUTHENTICATED) ? "AUTHENTICATED" : "UNAUTHENTICATED");
                        manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: IAX2/%s\r\nPeerStatus: Unregistered\r\n", p->name);
                        register_peer_exten(p, 0);
@@ -7578,8 +7568,7 @@ retryowner:
                                                        send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACCEPT, 0, ied1.buf, ied1.pos, -1);
                                                        if (strcmp(iaxs[fr->callno]->exten, "TBD")) {
                                                                ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
-                                                               if (option_verbose > 2) 
-                                                                       ast_verbose(VERBOSE_PREFIX_3 "Accepting UNAUTHENTICATED call from %s:\n"
+                                                               ast_verb(3, "Accepting UNAUTHENTICATED call from %s:\n"
                                                                                                "%srequested format = %s,\n"
                                                                                                "%srequested prefs = %s,\n"
                                                                                                "%sactual format = %s,\n"
@@ -7602,8 +7591,7 @@ retryowner:
                                                        } else {
                                                                ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_TBD);
                                                                /* If this is a TBD call, we're ready but now what...  */
-                                                               if (option_verbose > 2)
-                                                                       ast_verbose(VERBOSE_PREFIX_3 "Accepted unauthenticated TBD call from %s\n", ast_inet_ntoa(sin.sin_addr));
+                                                               ast_verb(3, "Accepted unauthenticated TBD call from %s\n", ast_inet_ntoa(sin.sin_addr));
                                                        }
                                                }
                                        }
@@ -7701,8 +7689,7 @@ retryowner:
                                        else
                                                iaxs[fr->callno]->peerformat = iaxs[fr->callno]->capability;
                                }
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Call accepted by %s (format %s)\n", ast_inet_ntoa(iaxs[fr->callno]->addr.sin_addr), ast_getformatname(iaxs[fr->callno]->peerformat));
+                               ast_verb(3, "Call accepted by %s (format %s)\n", ast_inet_ntoa(iaxs[fr->callno]->addr.sin_addr), ast_getformatname(iaxs[fr->callno]->peerformat));
                                if (!(iaxs[fr->callno]->peerformat & iaxs[fr->callno]->capability)) {
                                        memset(&ied0, 0, sizeof(ied0));
                                        iax_ie_append_str(&ied0, IAX_IE_CAUSE, "Unable to negotiate codec");
@@ -7715,8 +7702,7 @@ retryowner:
                                        if (iaxs[fr->callno]->owner) {
                                                /* Switch us to use a compatible format */
                                                iaxs[fr->callno]->owner->nativeformats = iaxs[fr->callno]->peerformat;
-                                               if (option_verbose > 2)
-                                                       ast_verbose(VERBOSE_PREFIX_3 "Format for call is %s\n", ast_getformatname(iaxs[fr->callno]->owner->nativeformats));
+                                               ast_verb(3, "Format for call is %s\n", ast_getformatname(iaxs[fr->callno]->owner->nativeformats));
 retryowner2:
                                                if (ast_mutex_trylock(&iaxs[fr->callno]->owner->lock)) {
                                                        ast_mutex_unlock(&iaxsl[fr->callno]);
@@ -7957,8 +7943,7 @@ retryowner2:
                                                send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACCEPT, 0, ied1.buf, ied1.pos, -1);
                                                if (strcmp(iaxs[fr->callno]->exten, "TBD")) {
                                                        ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
-                                                       if (option_verbose > 2) 
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Accepting AUTHENTICATED call from %s:\n"
+                                                       ast_verb(3, "Accepting AUTHENTICATED call from %s:\n"
                                                                                        "%srequested format = %s,\n"
                                                                                        "%srequested prefs = %s,\n"
                                                                                        "%sactual format = %s,\n"
@@ -8016,8 +8001,7 @@ retryowner2:
                                                } else {
                                                        ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_TBD);
                                                        /* If this is a TBD call, we're ready but now what...  */
-                                                       if (option_verbose > 2)
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Accepted AUTHENTICATED TBD call from %s\n", ast_inet_ntoa(sin.sin_addr));
+                                                       ast_verb(3, "Accepted AUTHENTICATED TBD call from %s\n", ast_inet_ntoa(sin.sin_addr));
                                                }
                                        }
                                }
@@ -8035,8 +8019,7 @@ retryowner2:
                                                send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
                                        } else {
                                                ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
-                                               if (option_verbose > 2) 
-                                                       ast_verbose(VERBOSE_PREFIX_3 "Accepting DIAL from %s, formats = 0x%x\n", ast_inet_ntoa(sin.sin_addr), iaxs[fr->callno]->peerformat);
+                                               ast_verb(3, "Accepting DIAL from %s, formats = 0x%x\n", ast_inet_ntoa(sin.sin_addr), iaxs[fr->callno]->peerformat);
                                                ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
                                                send_command(iaxs[fr->callno], AST_FRAME_CONTROL, AST_CONTROL_PROGRESS, 0, NULL, 0, -1);
                                                if (!(c = ast_iax2_new(fr->callno, AST_STATE_RING, iaxs[fr->callno]->peerformat)))
@@ -8141,8 +8124,7 @@ retryowner2:
                                break;
                        case IAX_COMMAND_TXREJ:
                                iaxs[fr->callno]->transferring = 0;
-                               if (option_verbose > 2) 
-                                       ast_verbose(VERBOSE_PREFIX_3 "Channel '%s' unable to transfer\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
+                               ast_verb(3, "Channel '%s' unable to transfer\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
                                memset(&iaxs[fr->callno]->transfer, 0, sizeof(iaxs[fr->callno]->transfer));
                                if (iaxs[fr->callno]->bridgecallno) {
                                        if (iaxs[iaxs[fr->callno]->bridgecallno]->transferring) {
@@ -8158,15 +8140,13 @@ retryowner2:
                                                iaxs[fr->callno]->transferring = TRANSFER_MREADY;
                                        else
                                                iaxs[fr->callno]->transferring = TRANSFER_READY;
-                                       if (option_verbose > 2) 
-                                               ast_verbose(VERBOSE_PREFIX_3 "Channel '%s' ready to transfer\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
+                                       ast_verb(3, "Channel '%s' ready to transfer\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
                                        if (iaxs[fr->callno]->bridgecallno) {
                                                if ((iaxs[iaxs[fr->callno]->bridgecallno]->transferring == TRANSFER_READY) ||
                                                    (iaxs[iaxs[fr->callno]->bridgecallno]->transferring == TRANSFER_MREADY)) {
                                                        /* They're both ready, now release them. */
                                                        if (iaxs[fr->callno]->transferring == TRANSFER_MREADY) {
-                                                               if (option_verbose > 2) 
-                                                                       ast_verbose(VERBOSE_PREFIX_3 "Attempting media bridge of %s and %s\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>",
+                                                               ast_verb(3, "Attempting media bridge of %s and %s\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>",
                                                                                iaxs[iaxs[fr->callno]->bridgecallno]->owner ? iaxs[iaxs[fr->callno]->bridgecallno]->owner->name : "<Unknown>");
 
                                                                iaxs[iaxs[fr->callno]->bridgecallno]->transferring = TRANSFER_MEDIA;
@@ -8179,8 +8159,7 @@ retryowner2:
                                                                send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_TXMEDIA, 0, ied0.buf, ied0.pos, -1);
                                                                send_command(iaxs[iaxs[fr->callno]->bridgecallno], AST_FRAME_IAX, IAX_COMMAND_TXMEDIA, 0, ied1.buf, ied1.pos, -1);
                                                        } else {
-                                                               if (option_verbose > 2) 
-                                                                       ast_verbose(VERBOSE_PREFIX_3 "Releasing %s and %s\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>",
+                                                               ast_verb(3, "Releasing %s and %s\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>",
                                                                                iaxs[iaxs[fr->callno]->bridgecallno]->owner ? iaxs[iaxs[fr->callno]->bridgecallno]->owner->name : "<Unknown>");
 
                                                                iaxs[iaxs[fr->callno]->bridgecallno]->transferring = TRANSFER_RELEASED;
@@ -8604,8 +8583,7 @@ static int iax2_prov_app(struct ast_channel *chan, void *data)
                return -1;
        }
        res = iax2_provision(&iaxs[callno]->addr, iaxs[callno]->sockfd, NULL, sdata, force);
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "Provisioned IAXY at '%s' with '%s'= %d\n", 
+       ast_verb(3, "Provisioned IAXY at '%s' with '%s'= %d\n",
                ast_inet_ntoa(iaxs[callno]->addr.sin_addr),
                sdata, res);
        return res;
@@ -8923,8 +8901,7 @@ static int start_network_thread(void)
        }
        ast_pthread_create_background(&schedthreadid, NULL, sched_thread, NULL);
        ast_pthread_create_background(&netthreadid, NULL, network_thread, NULL);
-       if (option_verbose > 1)
-               ast_verbose(VERBOSE_PREFIX_2 "%d helper threaads started\n", threadcount);
+       ast_verb(2, "%d helper threaads started\n", threadcount);
        return 0;
 }
 
@@ -9764,12 +9741,10 @@ static int set_config(char *config_file, int reload)
                                if (!(ns = ast_netsock_bind(netsock, io, v->value, portno, tos, cos, socket_read, NULL))) {
                                        ast_log(LOG_WARNING, "Unable apply binding to '%s' at line %d\n", v->value, v->lineno);
                                } else {
-                                       if (option_verbose > 1) {
                                                if (strchr(v->value, ':'))
-                                                       ast_verbose(VERBOSE_PREFIX_2 "Binding IAX2 to '%s'\n", v->value);
+                                               ast_verb(2, "Binding IAX2 to '%s'\n", v->value);
                                                else
-                                                       ast_verbose(VERBOSE_PREFIX_2 "Binding IAX2 to '%s:%d'\n", v->value, portno);
-                                       }
+                                               ast_verb(2, "Binding IAX2 to '%s:%d'\n", v->value, portno);
                                        if (defaultsockfd < 0) 
                                                defaultsockfd = ast_netsock_sockfd(ns);
                                        ast_netsock_unref(ns);
@@ -9904,8 +9879,7 @@ static int set_config(char *config_file, int reload)
                if (!(ns = ast_netsock_bind(netsock, io, "0.0.0.0", portno, tos, cos, socket_read, NULL))) {
                        ast_log(LOG_ERROR, "Unable to create network socket: %s\n", strerror(errno));
                } else {
-                       if (option_verbose > 1)
-                               ast_verbose(VERBOSE_PREFIX_2 "Binding IAX2 to default address 0.0.0.0:%d\n", portno);
+                       ast_verb(2, "Binding IAX2 to default address 0.0.0.0:%d\n", portno);
                        defaultsockfd = ast_netsock_sockfd(ns);
                        ast_netsock_unref(ns);
                }
@@ -10367,8 +10341,7 @@ static int iax2_exec(struct ast_channel *chan, const char *context, const char *
                        } else {
                                snprintf(req, sizeof(req), "IAX2/%s/%s", odata, exten);
                        }
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Executing Dial('%s')\n", req);
+                       ast_verb(3, "Executing Dial('%s')\n", req);
                } else {
                        AST_LIST_UNLOCK(&dpcache);
                        ast_log(LOG_WARNING, "Can't execute nonexistent extension '%s[@%s]' in data '%s'\n", exten, context, data);
@@ -10957,8 +10930,8 @@ static int load_module(void)
                ast_log(LOG_ERROR, "Unable to start network thread\n");
                __unload_module();
                return AST_MODULE_LOAD_FAILURE;
-       } else if (option_verbose > 1)
-               ast_verbose(VERBOSE_PREFIX_2 "IAX Ready and Listening\n");
+       } else
+               ast_verb(2, "IAX Ready and Listening\n");
 
        AST_LIST_LOCK(&registrations);
        AST_LIST_TRAVERSE(&registrations, reg, entry)
index 76744cc109be75578387ae75faa1583ba6a2fbdb..2490cb1c080735bba08b77e29ec67d0c7fe221fb 100644 (file)
@@ -854,7 +854,7 @@ static int mgcp_call(struct ast_channel *ast, char *dest, int timeout)
        struct ast_var_t *current;
 
        if (mgcpdebug) {
-               ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_call(%s)\n", ast->name);
+               ast_verb(3, "MGCP mgcp_call(%s)\n", ast->name);
        }
        sub = ast->tech_pvt;
        p = sub->parent;
@@ -872,12 +872,12 @@ static int mgcp_call(struct ast_channel *ast, char *dest, int timeout)
                if (!ast_strlen_zero(distinctive_ring)) {
                        snprintf(tone, sizeof(tone), "L/wt%s", distinctive_ring);
                        if (mgcpdebug) {
-                               ast_verbose(VERBOSE_PREFIX_3 "MGCP distinctive callwait %s\n", tone);
+                               ast_verb(3, "MGCP distinctive callwait %s\n", tone);
                        }
                } else {
                        snprintf(tone, sizeof(tone), "L/wt");
                        if (mgcpdebug) {
-                               ast_verbose(VERBOSE_PREFIX_3 "MGCP normal callwait %s\n", tone);
+                               ast_verb(3, "MGCP normal callwait %s\n", tone);
                        }
                }
                break;
@@ -886,12 +886,12 @@ static int mgcp_call(struct ast_channel *ast, char *dest, int timeout)
                if (!ast_strlen_zero(distinctive_ring)) {
                        snprintf(tone, sizeof(tone), "L/r%s", distinctive_ring);
                        if (mgcpdebug) {
-                               ast_verbose(VERBOSE_PREFIX_3 "MGCP distinctive ring %s\n", tone);
+                               ast_verb(3, "MGCP distinctive ring %s\n", tone);
                        }
                } else {
                        snprintf(tone, sizeof(tone), "L/rg");
                        if (mgcpdebug) {
-                               ast_verbose(VERBOSE_PREFIX_3 "MGCP default ring\n");
+                               ast_verb(3, "MGCP default ring\n");
                        }
                }
                break;
@@ -952,7 +952,7 @@ static int mgcp_hangup(struct ast_channel *ast)
        }
        ast_mutex_lock(&sub->lock);
        if (mgcpdebug) {
-               ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_hangup(%s) on %s@%s\n", ast->name, p->name, p->parent->name);
+               ast_verb(3, "MGCP mgcp_hangup(%s) on %s@%s\n", ast->name, p->name, p->parent->name);
        }
 
        if ((p->dtmfmode & MGCP_DTMF_INBAND) && p->dsp) {
@@ -961,7 +961,7 @@ static int mgcp_hangup(struct ast_channel *ast)
                        if (p->dtmfmode & MGCP_DTMF_HYBRID)
                                p->dtmfmode &= ~MGCP_DTMF_INBAND;
                        if (mgcpdebug) {
-                               ast_verbose(VERBOSE_PREFIX_2 "MGCP free dsp on %s@%s\n", p->name, p->parent->name);
+                               ast_verb(2, "MGCP free dsp on %s@%s\n", p->name, p->parent->name);
                        }
                        ast_dsp_free(p->dsp);
                        p->dsp = NULL;
@@ -1013,19 +1013,18 @@ static int mgcp_hangup(struct ast_channel *ast)
        if ((p->hookstate == MGCP_ONHOOK) && (!sub->next->rtp)) {
                p->hidecallerid = 0;
                if (p->hascallwaiting && !p->callwaiting) {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Enabling call waiting on %s\n", ast->name);
+                       ast_verb(3, "Enabling call waiting on %s\n", ast->name);
                        p->callwaiting = -1;
                }
                if (has_voicemail(p)) {
                        if (mgcpdebug) {
-                               ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_hangup(%s) on %s@%s set vmwi(+)\n", 
+                               ast_verb(3, "MGCP mgcp_hangup(%s) on %s@%s set vmwi(+)\n",
                                        ast->name, p->name, p->parent->name);
                        }
                        transmit_notify_request(sub, "L/vmwi(+)");
                } else {
                        if (mgcpdebug) {
-                               ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_hangup(%s) on %s@%s set vmwi(-)\n", 
+                               ast_verb(3, "MGCP mgcp_hangup(%s) on %s@%s set vmwi(-)\n",
                                        ast->name, p->name, p->parent->name);
                        }
                        transmit_notify_request(sub, "L/vmwi(-)");
@@ -1192,11 +1191,8 @@ static int mgcp_answer(struct ast_channel *ast)
        } else {
                transmit_modify_request(sub);
        }
-       /* verbose level check */
-       if (option_verbose > 2) {
-               ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_answer(%s) on %s@%s-%d\n", 
+       ast_verb(3, "MGCP mgcp_answer(%s) on %s@%s-%d\n",
                        ast->name, p->name, p->parent->name, sub->id);
-       }
        if (ast->_state != AST_STATE_UP) {
                ast_setstate(ast, AST_STATE_UP);
                ast_debug(1, "mgcp_answer(%s)\n", ast->name);
@@ -1410,7 +1406,7 @@ static int mgcp_indicate(struct ast_channel *ast, int ind, const void *data, siz
        int res = 0;
 
        if (mgcpdebug) {
-               ast_verbose(VERBOSE_PREFIX_3 "MGCP asked to indicate %d '%s' condition on channel %s\n",
+               ast_verb(3, "MGCP asked to indicate %d '%s' condition on channel %s\n",
                        ind, control2str(ind), ast->name);
        }
        ast_mutex_lock(&sub->lock);
@@ -1508,11 +1504,8 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
                                tmp = NULL;
                        }
                }
-               /* verbose level check */
-               if (option_verbose > 2) {
-                       ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_new(%s) created in state: %s\n",
+               ast_verb(3, "MGCP mgcp_new(%s) created in state: %s\n",
                                tmp->name, ast_state2str(state));
-               }
        } else {
                ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
        }
@@ -1640,8 +1633,7 @@ static struct mgcp_subchannel *find_subchannel_and_lock(char *name, int msgid, s
                                        memcpy(&g->addr, sin, sizeof(g->addr));
                                        if (ast_ouraddrfor(&g->addr.sin_addr, &g->ourip))
                                                memcpy(&g->ourip, &__ourip, sizeof(g->ourip));
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "Registered MGCP gateway '%s' at %s port %d\n", g->name, ast_inet_ntoa(g->addr.sin_addr), ntohs(g->addr.sin_port));
+                                       ast_verb(3, "Registered MGCP gateway '%s' at %s port %d\n", g->name, ast_inet_ntoa(g->addr.sin_addr), ntohs(g->addr.sin_port));
                                }
                        }
                        /* not dynamic, check if the name matches */
@@ -2177,7 +2169,7 @@ static int transmit_connect_with_sdp(struct mgcp_subchannel *sub, struct ast_rtp
                }
        }
        if (mgcpdebug) {
-               ast_verbose(VERBOSE_PREFIX_3 "Creating connection for %s@%s-%d in cxmode: %s callid: %s\n", 
+               ast_verb(3, "Creating connection for %s@%s-%d in cxmode: %s callid: %s\n",
                        p->name, p->parent->name, sub->id, mgcp_cxmodes[sub->cxmode], sub->callid);
        }
        reqprep(&resp, p, "CRCX");
@@ -2200,7 +2192,7 @@ static int transmit_notify_request(struct mgcp_subchannel *sub, char *tone)
        struct mgcp_endpoint *p = sub->parent;
 
        if (mgcpdebug) {
-               ast_verbose(VERBOSE_PREFIX_3 "MGCP Asked to indicate tone: %s on  %s@%s-%d in cxmode: %s\n", 
+               ast_verb(3, "MGCP Asked to indicate tone: %s on  %s@%s-%d in cxmode: %s\n",
                        tone, p->name, p->parent->name, sub->id, mgcp_cxmodes[sub->cxmode]);
        }
        ast_copy_string(p->curtone, tone, sizeof(p->curtone));
@@ -2260,7 +2252,7 @@ static int transmit_notify_request_with_callerid(struct mgcp_subchannel *sub, ch
                add_header(&resp, "S", tone2);
        }
        if (mgcpdebug) {
-               ast_verbose(VERBOSE_PREFIX_3 "MGCP Asked to indicate tone: %s on  %s@%s-%d in cxmode: %s\n", 
+               ast_verb(3, "MGCP Asked to indicate tone: %s on  %s@%s-%d in cxmode: %s\n",
                        tone2, p->name, p->parent->name, sub->id, mgcp_cxmodes[sub->cxmode]);
        }
        /* fill in new fields */
@@ -2280,7 +2272,7 @@ static int transmit_modify_request(struct mgcp_subchannel *sub)
                return 0;
        }
        if (mgcpdebug) {
-               ast_verbose(VERBOSE_PREFIX_3 "Modified %s@%s-%d with new mode: %s on callid: %s\n", 
+               ast_verb(3, "Modified %s@%s-%d with new mode: %s on callid: %s\n",
                        p->name, p->parent->name, sub->id, mgcp_cxmodes[sub->cxmode], sub->callid);
        }
        reqprep(&resp, p, "MDCX");
@@ -2323,7 +2315,7 @@ static int transmit_connection_del(struct mgcp_subchannel *sub)
        struct mgcp_request resp;
 
        if (mgcpdebug) {
-               ast_verbose(VERBOSE_PREFIX_3 "Delete connection %s %s@%s-%d with new mode: %s on callid: %s\n", 
+               ast_verb(3, "Delete connection %s %s@%s-%d with new mode: %s on callid: %s\n",
                        sub->cxident, p->name, p->parent->name, sub->id, mgcp_cxmodes[sub->cxmode], sub->callid);
        }
        reqprep(&resp, p, "DLCX");
@@ -2346,7 +2338,7 @@ static int transmit_connection_del_w_params(struct mgcp_endpoint *p, char *calli
        struct mgcp_request resp;
 
        if (mgcpdebug) {
-               ast_verbose(VERBOSE_PREFIX_3 "Delete connection %s %s@%s on callid: %s\n", 
+               ast_verb(3, "Delete connection %s %s@%s on callid: %s\n",
                        cxident ? cxident : "", p->name, p->parent->name, callid ? callid : "");
        }
        reqprep(&resp, p, "DLCX");
@@ -2448,10 +2440,8 @@ static void handle_response(struct mgcp_endpoint *p, struct mgcp_subchannel *sub
                req = find_command(p, sub, &p->cmd_queue, &p->cmd_queue_lock, ident);
 
        if (!req) {
-               if (option_verbose > 2) {
-                       ast_verbose(VERBOSE_PREFIX_3 "No command found on [%s] for transaction %d. Ignoring...\n", 
+               ast_verb(3, "No command found on [%s] for transaction %d. Ignoring...\n",
                                gw->name, ident);
-               }
                return;
        }
 
@@ -2534,10 +2524,8 @@ static void handle_response(struct mgcp_endpoint *p, struct mgcp_subchannel *sub
                                                        if (len > (sizeof(cxident) - 1))
                                                                len = sizeof(cxident) - 1;
                                                        ast_copy_string(cxident, v, len);
-                                                       if (option_verbose > 2) {
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Non existing connection id %s on %s@%s \n", 
+                                                       ast_verb(3, "Non existing connection id %s on %s@%s \n",
                                                                            cxident, p->name, gw->name);
-                                                       }
                                                        transmit_connection_del_w_params(p, NULL, cxident);
                                                }
                                        }
@@ -2559,11 +2547,8 @@ static void handle_response(struct mgcp_endpoint *p, struct mgcp_subchannel *sub
                                                        /* update the requested events according to the new hookstate */
                                                        transmit_notify_request(p->sub, "");
 
-                                                       /* verbose level check */
-                                                       if (option_verbose > 2) {
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Setting hookstate of %s@%s to ONHOOK\n", p->name, gw->name);
+                                                       ast_verb(3, "Setting hookstate of %s@%s to ONHOOK\n", p->name, gw->name);
                                                        }
-                                               }
                                        } else if (strstr(c, "hd")) {
                                                if (p->hookstate != MGCP_OFFHOOK) {
                                                        p->hookstate = MGCP_OFFHOOK;
@@ -2571,15 +2556,12 @@ static void handle_response(struct mgcp_endpoint *p, struct mgcp_subchannel *sub
                                                        /* update the requested events according to the new hookstate */
                                                        transmit_notify_request(p->sub, "");
 
-                                                       /* verbose level check */
-                                                       if (option_verbose > 2) {
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Setting hookstate of %s@%s to OFFHOOK\n", p->name, gw->name);
+                                                       ast_verb(3, "Setting hookstate of %s@%s to OFFHOOK\n", p->name, gw->name);
                                                        }
                                                }
                                        }
                                }
                        }
-               }
 
                if (resp && resp->lines) {
                        /* do not process sdp if we are hanging up. this may be a late response */
@@ -2662,10 +2644,8 @@ static void *mgcp_ss(void *data)
                                if (getforward) {
                                        /* Record this as the forwarding extension */
                                        ast_copy_string(p->call_forward, p->dtmf_buf, sizeof(p->call_forward)); 
-                                       if (option_verbose > 2) {
-                                               ast_verbose(VERBOSE_PREFIX_3 "Setting call forward to '%s' on channel %s\n", 
+                                       ast_verb(3, "Setting call forward to '%s' on channel %s\n",
                                                        p->call_forward, chan->name);
-                                       }
                                        /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
                                        transmit_notify_request(sub, "L/sl");
                                        if (res)
@@ -2716,9 +2696,7 @@ static void *mgcp_ss(void *data)
                        ast_hangup(chan);
                        return NULL;
                } else if (p->hascallwaiting && p->callwaiting && !strcmp(p->dtmf_buf, "*70")) {
-                       if (option_verbose > 2) {
-                               ast_verbose(VERBOSE_PREFIX_3 "Disabling call waiting on %s\n", chan->name);
-                       }
+                       ast_verb(3, "Disabling call waiting on %s\n", chan->name);
                        /* Disable call waiting if enabled */
                        p->callwaiting = 0;
                        /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
@@ -2740,9 +2718,7 @@ static void *mgcp_ss(void *data)
                        ast_hangup(chan);
                        return NULL;
                } else if (!p->hidecallerid && !strcmp(p->dtmf_buf, "*67")) {
-                       if (option_verbose > 2) {
-                               ast_verbose(VERBOSE_PREFIX_3 "Disabling Caller*ID on %s\n", chan->name);
-                       }
+                       ast_verb(3, "Disabling Caller*ID on %s\n", chan->name);
                        /* Disable Caller*ID if enabled */
                        p->hidecallerid = 1;
                        ast_set_callerid(chan, "", "", NULL);
@@ -2762,9 +2738,7 @@ static void *mgcp_ss(void *data)
                        break;
                } else if (!strcmp(p->dtmf_buf, "*78")) {
                        /* Do not disturb */
-                       if (option_verbose > 2) {
-                               ast_verbose(VERBOSE_PREFIX_3 "Enabled DND on channel %s\n", chan->name);
-                       }
+                       ast_verb(3, "Enabled DND on channel %s\n", chan->name);
                        /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
                        transmit_notify_request(sub, "L/sl");
                        p->dnd = 1;
@@ -2773,9 +2747,7 @@ static void *mgcp_ss(void *data)
                        len = 0;
                } else if (!strcmp(p->dtmf_buf, "*79")) {
                        /* Do not disturb */
-                       if (option_verbose > 2) {
-                               ast_verbose(VERBOSE_PREFIX_3 "Disabled DND on channel %s\n", chan->name);
-                       }
+                       ast_verb(3, "Disabled DND on channel %s\n", chan->name);
                        /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
                        transmit_notify_request(sub, "L/sl");
                        p->dnd = 0;
@@ -2789,9 +2761,7 @@ static void *mgcp_ss(void *data)
                        memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
                        len = 0;
                } else if (p->cancallforward && !strcmp(p->dtmf_buf, "*73")) {
-                       if (option_verbose > 2) {
-                               ast_verbose(VERBOSE_PREFIX_3 "Cancelling call forwarding on channel %s\n", chan->name);
-                       }
+                       ast_verb(3, "Cancelling call forwarding on channel %s\n", chan->name);
                        /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
                        transmit_notify_request(sub, "L/sl");
                        memset(p->call_forward, 0, sizeof(p->call_forward));
@@ -2803,14 +2773,10 @@ static void *mgcp_ss(void *data)
                        /* This is a three way call, the main call being a real channel, 
                           and we're parking the first call. */
                        ast_masq_park_call(ast_bridged_channel(sub->next->owner), chan, 0, NULL);
-                       if (option_verbose > 2) {
-                               ast_verbose(VERBOSE_PREFIX_3 "Parking call to '%s'\n", chan->name);
-                       }
+                       ast_verb(3, "Parking call to '%s'\n", chan->name);
                        break;
                } else if (!ast_strlen_zero(p->lastcallerid) && !strcmp(p->dtmf_buf, "*60")) {
-                       if (option_verbose > 2) {
-                               ast_verbose(VERBOSE_PREFIX_3 "Blacklisting number %s\n", p->lastcallerid);
-                       }
+                       ast_verb(3, "Blacklisting number %s\n", p->lastcallerid);
                        res = ast_db_put("blacklist", p->lastcallerid, "1");
                        if (!res) {
                                /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
@@ -2819,9 +2785,7 @@ static void *mgcp_ss(void *data)
                                len = 0;
                        }
                } else if (p->hidecallerid && !strcmp(p->dtmf_buf, "*82")) {
-                       if (option_verbose > 2) {
-                               ast_verbose(VERBOSE_PREFIX_3 "Enabling Caller*ID on %s\n", chan->name);
-                       }
+                       ast_verb(3, "Enabling Caller*ID on %s\n", chan->name);
                        /* Enable Caller*ID if enabled */
                        p->hidecallerid = 0;
                        ast_set_callerid(chan, p->cid_num, p->cid_name, NULL);
@@ -2921,9 +2885,7 @@ static int attempt_transfer(struct mgcp_endpoint *p)
                        return -1;
                }
                /*swap_subs(p, SUB_THREEWAY, SUB_REAL);*/
-               if (option_verbose > 2) {
-                       ast_verbose(VERBOSE_PREFIX_3 "Swapping %d for %d on %s@%s\n", p->sub->id, p->sub->next->id, p->name, p->parent->name);
-               }
+               ast_verb(3, "Swapping %d for %d on %s@%s\n", p->sub->id, p->sub->next->id, p->name, p->parent->name);
                p->sub = p->sub->next;
                unalloc_sub(p->sub->next);
                /* Tell the caller not to hangup */
@@ -3037,15 +2999,14 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req,
        if (!strcasecmp(req->verb, "RSIP")) {
                /* Test if this RSIP request is just a keepalive */
                if(!strcasecmp( get_header(req, "RM"), "X-keepalive")) {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Received keepalive request from %s@%s\n", p->name, p->parent->name);
+                       ast_verb(3, "Received keepalive request from %s@%s\n", p->name, p->parent->name);
                        transmit_response(sub, "200", req, "OK");
                } else {
                        dump_queue(p->parent, p);
                        dump_cmd_queues(p, NULL);
                        
-                       if (option_verbose > 2 && (strcmp(p->name, p->parent->wcardep) != 0)) {
-                               ast_verbose(VERBOSE_PREFIX_3 "Resetting interface %s@%s\n", p->name, p->parent->name);
+                       if ((strcmp(p->name, p->parent->wcardep) != 0)) {
+                               ast_verb(3, "Resetting interface %s@%s\n", p->name, p->parent->name);
                        }
                        /* For RSIP on wildcard we reset all endpoints */
                        if (!strcmp(p->name, p->parent->wcardep)) {
@@ -3058,9 +3019,7 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req,
                                        /*if ((strcmp(tmp_ep->name, "*") != 0) && (strcmp(tmp_ep->name, "aaln/" "*") != 0)) {*/
                                        if (strcmp(tmp_ep->name, g->wcardep) != 0) {
                                                struct mgcp_subchannel *tmp_sub, *first_sub;
-                                               if (option_verbose > 2) {
-                                                       ast_verbose(VERBOSE_PREFIX_3 "Resetting interface %s@%s\n", tmp_ep->name, p->parent->name);
-                                               }
+                                               ast_verb(3, "Resetting interface %s@%s\n", tmp_ep->name, p->parent->name);
                                                
                                                first_sub = tmp_ep->sub;
                                                tmp_sub = tmp_ep->sub;
@@ -3116,18 +3075,14 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req,
                                return -1;
 
                        if (p->callwaiting || p->transfer || p->threewaycalling) {
-                               if (option_verbose > 2) {
-                                       ast_verbose(VERBOSE_PREFIX_3 "Swapping %d for %d on %s@%s\n", p->sub->id, p->sub->next->id, p->name, p->parent->name);
-                               }
+                               ast_verb(3, "Swapping %d for %d on %s@%s\n", p->sub->id, p->sub->next->id, p->name, p->parent->name);
                                p->sub = p->sub->next;
 
                                /* transfer control to our next subchannel */
                                if (!sub->next->owner) {
                                        /* plave the first call on hold and start up a new call */
                                        sub->cxmode = MGCP_CX_MUTE;
-                                       if (option_verbose > 2) {
-                                               ast_verbose(VERBOSE_PREFIX_3 "MGCP Muting %d on %s@%s\n", sub->id, p->name, p->parent->name);
-                                       }
+                                       ast_verb(3, "MGCP Muting %d on %s@%s\n", sub->id, p->name, p->parent->name);
                                        transmit_modify_request(sub);
                                        if (sub->owner && ast_bridged_channel(sub->owner))
                                                ast_queue_control(sub->owner, AST_CONTROL_HOLD);
@@ -3137,10 +3092,8 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req,
                                        /* We've got two active calls lets decide whether or not to conference or just flip flop */
                                        if ((!sub->outgoing) && (!sub->next->outgoing)) {
                                                /* We made both calls lets conferenct */
-                                               if (option_verbose > 2) {
-                                                       ast_verbose(VERBOSE_PREFIX_3 "MGCP Conferencing %d and %d on %s@%s\n", 
+                                               ast_verb(3, "MGCP Conferencing %d and %d on %s@%s\n",
                                                                sub->id, sub->next->id, p->name, p->parent->name);
-                                               }
                                                sub->cxmode = MGCP_CX_CONF;
                                                sub->next->cxmode = MGCP_CX_CONF;
                                                if (ast_bridged_channel(sub->next->owner))
@@ -3151,14 +3104,10 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req,
                                                /* Let's flipflop between calls */
                                                /* XXX Need to check for state up ??? */
                                                /* XXX Need a way to indicate the current call, or maybe the call that's waiting */
-                                               if (option_verbose > 2) {
-                                                       ast_verbose(VERBOSE_PREFIX_3 "We didn't make one of the calls FLIPFLOP %d and %d on %s@%s\n", 
+                                               ast_verb(3, "We didn't make one of the calls FLIPFLOP %d and %d on %s@%s\n",
                                                                sub->id, sub->next->id, p->name, p->parent->name);
-                                               }
                                                sub->cxmode = MGCP_CX_MUTE;
-                                               if (option_verbose > 2) {
-                                                       ast_verbose(VERBOSE_PREFIX_3 "MGCP Muting %d on %s@%s\n", sub->id, p->name, p->parent->name);
-                                               }
+                                               ast_verb(3, "MGCP Muting %d on %s@%s\n", sub->id, p->name, p->parent->name);
                                                transmit_modify_request(sub);
                                                if (ast_bridged_channel(sub->owner))
                                                        ast_queue_control(sub->owner, AST_CONTROL_HOLD);
@@ -3220,11 +3169,8 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req,
                                        sub->alreadygone = 1;
                                        mgcp_queue_hangup(sub);
                                } else {
-                                       /* verbose level check */
-                                       if (option_verbose > 2) {
-                                               ast_verbose(VERBOSE_PREFIX_3 "MGCP handle_request(%s@%s-%d) ast_channel already destroyed, resending DLCX.\n",
+                                       ast_verb(3, "MGCP handle_request(%s@%s-%d) ast_channel already destroyed, resending DLCX.\n",
                                                        p->name, p->parent->name, sub->id);
-                                       }
                                        /* Instruct the other side to remove the connection since it apparently *
                                         * still thinks the channel is active. *
                                         * For Cisco IAD2421 /BAK/ */
@@ -3234,19 +3180,14 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req,
                        if ((p->hookstate == MGCP_ONHOOK) && (!sub->rtp) && (!sub->next->rtp)) {
                                p->hidecallerid = 0;
                                if (p->hascallwaiting && !p->callwaiting) {
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "Enabling call waiting on MGCP/%s@%s-%d\n", p->name, p->parent->name, sub->id);
+                                       ast_verb(3, "Enabling call waiting on MGCP/%s@%s-%d\n", p->name, p->parent->name, sub->id);
                                        p->callwaiting = -1;
                                }
                                if (has_voicemail(p)) {
-                                       if (option_verbose > 2) {
-                                               ast_verbose(VERBOSE_PREFIX_3 "MGCP handle_request(%s@%s) set vmwi(+)\n", p->name, p->parent->name);
-                                       }
+                                       ast_verb(3, "MGCP handle_request(%s@%s) set vmwi(+)\n", p->name, p->parent->name);
                                        transmit_notify_request(sub, "L/vmwi(+)");
                                } else {
-                                       if (option_verbose > 2) {
-                                               ast_verbose(VERBOSE_PREFIX_3 "MGCP handle_request(%s@%s) set vmwi(-)\n", p->name, p->parent->name);
-                                       }
+                                       ast_verb(3, "MGCP handle_request(%s@%s) set vmwi(-)\n", p->name, p->parent->name);
                                        transmit_notify_request(sub, "L/vmwi(-)");
                                }
                        }
@@ -3432,8 +3373,7 @@ static void *do_monitor(void *data)
                mgcp_reloading = 0;
                ast_mutex_unlock(&mgcp_reload_lock);
                if (reloading) {
-                       if (option_verbose > 0)
-                               ast_verbose(VERBOSE_PREFIX_1 "Reloading MGCP\n");
+                       ast_verb(1, "Reloading MGCP\n");
                        mgcp_do_reload();
                        /* Add an I/O event to our UDP socket */
                        if (mgcpsock > -1) 
@@ -3551,11 +3491,9 @@ static struct ast_channel *mgcp_request(const char *type, int format, void *data
                return NULL;
        }
        
-       if (option_verbose > 2) {
-               ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_request(%s)\n", tmp);
-               ast_verbose(VERBOSE_PREFIX_3 "MGCP cw: %d, dnd: %d, so: %d, sno: %d\n", 
+       ast_verb(3, "MGCP mgcp_request(%s)\n", tmp);
+       ast_verb(3, "MGCP cw: %d, dnd: %d, so: %d, sno: %d\n",
                        sub->parent->callwaiting, sub->parent->dnd, sub->owner ? 1 : 0, sub->next->owner ? 1: 0);
-       }
        /* Must be busy */
        if (((sub->parent->callwaiting) && ((sub->owner) && (sub->next->owner))) ||
                ((!sub->parent->callwaiting) && (sub->owner)) ||
@@ -3789,7 +3727,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
                                                for (i = 0; i < MAX_SUBS; i++) {
                                                        sub = ast_calloc(1, sizeof(*sub));
                                                        if (sub) {
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Allocating subchannel '%d' on %s@%s\n", i, e->name, gw->name);
+                                                               ast_verb(3, "Allocating subchannel '%d' on %s@%s\n", i, e->name, gw->name);
                                                                ast_mutex_init(&sub->lock);
                                                                ast_mutex_init(&sub->cx_queue_lock);
                                                                sub->parent = e;
@@ -3856,7 +3794,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
                                        ast_copy_string(e->musicclass, musicclass, sizeof(e->musicclass));
                                        ast_copy_string(e->mailbox, mailbox, sizeof(e->mailbox));
                                        if (!ast_strlen_zero(mailbox)) {
-                                               ast_verbose(VERBOSE_PREFIX_3 "Setting mailbox '%s' on %s@%s\n", mailbox, gw->name, e->name);
+                                               ast_verb(3, "Setting mailbox '%s' on %s@%s\n", mailbox, gw->name, e->name);
                                        }
                                        if (!ep_reload) {
                                                /* XXX potential issue due to reload */
@@ -3903,7 +3841,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
 
                                                if (sub) {
                                                        if (!ep_reload) {
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Allocating subchannel '%d' on %s@%s\n", i, e->name, gw->name);
+                                                               ast_verb(3, "Allocating subchannel '%d' on %s@%s\n", i, e->name, gw->name);
                                                                ast_mutex_init(&sub->lock);
                                                                ast_mutex_init(&sub->cx_queue_lock);
                                                                ast_copy_string(sub->magic, MGCP_SUBCHANNEL_MAGIC, sizeof(sub->magic));
@@ -4184,9 +4122,7 @@ static int reload_config(void)
                        ast_mutex_lock(&gatelock);
                        g = build_gateway(cat, ast_variable_browse(cfg, cat));
                        if (g) {
-                               if (option_verbose > 2) {
-                                       ast_verbose(VERBOSE_PREFIX_3 "Added gateway '%s'\n", g->name);
-                               }
+                               ast_verb(3, "Added gateway '%s'\n", g->name);
                                g->next = gateways;
                                gateways = g;
                        }
@@ -4237,10 +4173,8 @@ static int reload_config(void)
                        close(mgcpsock);
                        mgcpsock = -1;
                } else {
-                       if (option_verbose > 1) {
-                               ast_verbose(VERBOSE_PREFIX_2 "MGCP Listening on %s:%d\n", 
+                       ast_verb(2, "MGCP Listening on %s:%d\n",
                                        ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
-                       }
                        ast_netsock_set_qos(mgcpsock, tos, cos);
                }
        }
@@ -4254,7 +4188,7 @@ static int reload_config(void)
                while (e && e->needaudit) {
                        e->needaudit = 0;
                        transmit_audit_endpoint(e);
-                       ast_verbose(VERBOSE_PREFIX_3 "MGCP Auditing endpoint %s@%s for hookstate\n", e->name, g->name);
+                       ast_verb(3, "MGCP Auditing endpoint %s@%s for hookstate\n", e->name, g->name);
                        e = e->next;
                }
                g = g->next;
index 9fac67d3e3ce0848d621578827f137e0132af60c..61a4198b1618523de30f57506673f200dd888ce8 100644 (file)
@@ -2506,8 +2506,7 @@ static struct ast_frame *process_ast_dsp(struct chan_list *tmp, struct ast_frame
                                        misdn_cfg_get(tmp->bc->port, MISDN_CFG_FAXDETECT_CONTEXT, &context_tmp, sizeof(context_tmp));
                                        context = ast_strlen_zero(context_tmp) ? (ast_strlen_zero(ast->macrocontext) ? ast->context : ast->macrocontext) : context_tmp;
                                        if (ast_exists_extension(ast, context, "fax", 1, ast->cid.cid_num)) {
-                                               if (option_verbose > 2)
-                                                       ast_verbose(VERBOSE_PREFIX_3 "Redirecting %s to fax extension (context:%s)\n", ast->name, context);
+                                               ast_verb(3, "Redirecting %s to fax extension (context:%s)\n", ast->name, context);
                                                /* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
                                                pbx_builtin_setvar_helper(ast,"FAXEXTEN",ast->exten);
                                                if (ast_async_goto(ast, context, "fax", 1))
@@ -2519,7 +2518,7 @@ static struct ast_frame *process_ast_dsp(struct chan_list *tmp, struct ast_frame
                                }
                                break;
                        case 2:
-                               ast_verbose(VERBOSE_PREFIX_3 "Not redirecting %s to fax extension, nojump is set.\n", ast->name);
+                               ast_verb(3, "Not redirecting %s to fax extension, nojump is set.\n", ast->name);
                                break;
                        }
                } else {
@@ -2745,8 +2744,7 @@ static enum ast_bridge_result  misdn_bridge (struct ast_channel *c0,
                misdn_lib_bridge(ch1->bc, ch2->bc);
        }
 
-       if (option_verbose > 2) 
-               ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name);
+       ast_verb(3, "Native bridging %s and %s\n", c0->name, c1->name);
 
        chan_misdn_log(1, ch1->bc->port, "* Making Native Bridge between %s and %s\n", ch1->bc->oad, ch2->bc->oad);
  
index b101ed8ff02dcb7d33024691b3c5f7cd7a3385fd..9dc2fca86896d2ddf9d8c5dde86e3954ab559e1d 100644 (file)
@@ -710,8 +710,7 @@ static int setformat(struct chan_oss_pvt *o, int mode)
                /* Check to see if duplex set (FreeBSD Bug) */
                res = ioctl(fd, SNDCTL_DSP_GETCAPS, &fmt);
                if (res == 0 && (fmt & DSP_CAP_DUPLEX)) {
-                       if (option_verbose > 1)
-                               ast_verbose(VERBOSE_PREFIX_2 "Console is full duplex\n");
+                       ast_verb(2, "Console is full duplex\n");
                        o->duplex = M_FULL;
                };
                break;
@@ -1551,10 +1550,8 @@ static struct chan_oss_pvt *store_config(struct ast_config *cfg, char *ctg)
   openit:
 #ifdef TRYOPEN
        if (setformat(o, O_RDWR) < 0) { /* open device */
-               if (option_verbose > 0) {
-                       ast_verbose(VERBOSE_PREFIX_2 "Device %s not detected\n", ctg);
-                       ast_verbose(VERBOSE_PREFIX_2 "Turn off OSS support by adding " "'noload=chan_oss.so' in /etc/asterisk/modules.conf\n");
-               }
+               ast_verb(1, "Device %s not detected\n", ctg);
+               ast_verb(1, "Turn off OSS support by adding " "'noload=chan_oss.so' in /etc/asterisk/modules.conf\n");
                goto error;
        }
        if (o->duplex != M_FULL)
index cf68d1d7fefde848039527e2018437e531733356..a3f82bb5b36b1b04f95db3391cb7749fb701b7d1 100644 (file)
@@ -382,8 +382,7 @@ static int phone_hangup(struct ast_channel *ast)
        memset(p->ext, 0, sizeof(p->ext));
        ((struct phone_pvt *)(ast->tech_pvt))->owner = NULL;
        ast_module_unref(ast_module_info->self);
-       if (option_verbose > 2) 
-               ast_verbose( VERBOSE_PREFIX_3 "Hungup '%s'\n", ast->name);
+       ast_verb(3, "Hungup '%s'\n", ast->name);
        ast->tech_pvt = NULL;
        ast_setstate(ast, AST_STATE_DOWN);
        restart_monitor();
index d3756577a1cc72307a20b6302951a0fc4e3a78a9..bbc6ea5f335078c92d6e5bef15f4c53162b2c407 100644 (file)
@@ -8601,8 +8601,7 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
                peer->sipoptions = 0;
                peer->lastms = 0;
 
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Unregistered SIP '%s'\n", peer->name);
+               ast_verb(3, "Unregistered SIP '%s'\n", peer->name);
                        manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: SIP/%s\r\nPeerStatus: Unregistered\r\n", peer->name);
                return PARSE_REGISTER_UPDATE;
        }
@@ -8659,8 +8658,7 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
        /* Is this a new IP address for us? */
        if (inaddrcmp(&peer->addr, &oldsin)) {
                sip_poke_peer(peer);
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Registered SIP '%s' at %s port %d expires %d\n", peer->name, ast_inet_ntoa(peer->addr.sin_addr), ntohs(peer->addr.sin_port), expiry);
+               ast_verb(3, "Registered SIP '%s' at %s port %d expires %d\n", peer->name, ast_inet_ntoa(peer->addr.sin_addr), ntohs(peer->addr.sin_port), expiry);
                register_peer_exten(peer, TRUE);
        }
        
@@ -8668,8 +8666,7 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
        useragent = get_header(req, "User-Agent");
        if (strcasecmp(useragent, peer->useragent)) {   /* XXX copy if they are different ? */
                ast_copy_string(peer->useragent, useragent, sizeof(peer->useragent));
-               if (option_verbose > 3)
-                       ast_verbose(VERBOSE_PREFIX_3 "Saved useragent \"%s\" for peer %s\n", peer->useragent, peer->name);  
+               ast_verb(4, "Saved useragent \"%s\" for peer %s\n", peer->useragent, peer->name);
        }
        return PARSE_REGISTER_UPDATE;
 }
@@ -9011,7 +9008,7 @@ static int cb_extensionstate(char *context, char* exten, int state, void *data)
                if (p->autokillid > -1)
                        sip_cancel_destroy(p);  /* Remove subscription expiry for renewals */
                sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);     /* Delete subscription in 32 secs */
-               ast_verbose(VERBOSE_PREFIX_2 "Extension state: Watcher for hint %s %s. Notify User %s\n", exten, state == AST_EXTENSION_DEACTIVATED ? "deactivated" : "removed", p->username);
+               ast_verb(2, "Extension state: Watcher for hint %s %s. Notify User %s\n", exten, state == AST_EXTENSION_DEACTIVATED ? "deactivated" : "removed", p->username);
                p->stateid = -1;
                p->subscribed = NONE;
                append_history(p, "Subscribestatus", "%s", state == AST_EXTENSION_REMOVED ? "HintRemoved" : "Deactivated");
@@ -9023,8 +9020,7 @@ static int cb_extensionstate(char *context, char* exten, int state, void *data)
        if (p->subscribed != NONE)      /* Only send state NOTIFY if we know the format */
                transmit_state_notify(p, state, 1, FALSE);
 
-       if (option_verbose > 1)
-               ast_verbose(VERBOSE_PREFIX_1 "Extension Changed %s new state %s for Notify User %s\n", exten, ast_extension_state2str(state), p->username);
+       ast_verb(2, "Extension Changed %s new state %s for Notify User %s\n", exten, ast_extension_state2str(state), p->username);
 
        sip_pvt_unlock(p);
 
@@ -13498,8 +13494,8 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
                default:
                        if ((resp >= 300) && (resp < 700)) {
                                /* Fatal response */
-                               if ((option_verbose > 2) && (resp != 487))
-                                       ast_verbose(VERBOSE_PREFIX_3 "Got SIP response %d \"%s\" back from %s\n", resp, rest, ast_inet_ntoa(p->sa.sin_addr));
+                               if ((resp != 487))
+                                       ast_verb(3, "Got SIP response %d \"%s\" back from %s\n", resp, rest, ast_inet_ntoa(p->sa.sin_addr));
        
                                if (sipmethod == SIP_INVITE)
                                        stop_media_flows(p); /* Immediately stop RTP, VRTP and UDPTL as applicable */
@@ -13662,8 +13658,8 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
                                }
                        }
                        if ((resp >= 300) && (resp < 700)) {
-                               if ((option_verbose > 2) && (resp != 487))
-                                       ast_verbose(VERBOSE_PREFIX_3 "Incoming call: Got SIP response %d \"%s\" back from %s\n", resp, rest, ast_inet_ntoa(p->sa.sin_addr));
+                               if ((resp != 487))
+                                       ast_verb(3, "Incoming call: Got SIP response %d \"%s\" back from %s\n", resp, rest, ast_inet_ntoa(p->sa.sin_addr));
                                switch(resp) {
                                case 488: /* Not acceptable here - codec error */
                                case 603: /* Decline */
@@ -16226,8 +16222,7 @@ static void *do_monitor(void *data)
                sip_reloading = FALSE;
                ast_mutex_unlock(&sip_reload_lock);
                if (reloading) {
-                       if (option_verbose > 0)
-                               ast_verbose(VERBOSE_PREFIX_1 "Reloading SIP\n");
+                       ast_verb(1, "Reloading SIP\n");
                        sip_do_reload(sip_reloadreason);
 
                        /* Change the I/O fd of our UDP socket */
@@ -16831,8 +16826,7 @@ static struct sip_auth *add_realm_authentication(struct sip_auth *authlist, char
        else
                authlist = auth;
 
-       if (option_verbose > 2)
-               ast_verbose("Added authentication for realm %s\n", realm);
+       ast_verb(3, "Added authentication for realm %s\n", realm);
 
        return authlist;
 
@@ -17866,8 +17860,7 @@ static int reload_config(enum channelreloadreason reason)
                                close(sipsock);
                                sipsock = -1;
                        } else {
-                               if (option_verbose > 1)
-                                       ast_verbose(VERBOSE_PREFIX_2 "SIP Listening on %s:%d\n", 
+                               ast_verb(2, "SIP Listening on %s:%d\n",
                                                ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
                                ast_netsock_set_qos(sipsock, global_tos_sip, global_cos_sip);
                        }
index 67ab62bc41b6e35e309d792d19c5ccf8c2dae059..258e1f6cee35330210e65ddfd4c0d7c16602e777 100644 (file)
@@ -1884,7 +1884,7 @@ static int skinny_extensionstate_cb(char *context, char *exten, int state, void
        switch (state) {
        case AST_EXTENSION_DEACTIVATED: /* Retry after a while */
        case AST_EXTENSION_REMOVED:     /* Extension is gone */
-               ast_verbose(VERBOSE_PREFIX_2 "Extension state: Watcher for hint %s %s. Notify Device %s\n", exten, state == AST_EXTENSION_DEACTIVATED ? "deactivated" : "removed", d->name);
+               ast_verb(2, "Extension state: Watcher for hint %s %s. Notify Device %s\n", exten, state == AST_EXTENSION_DEACTIVATED ? "deactivated" : "removed", d->name);
                sd->stateid = -1;
                callstate = SKINNY_ONHOOK;
                lamp = SKINNY_LAMP_OFF;
@@ -2072,8 +2072,7 @@ static int skinny_reset_device(int fd, int argc, char *argv[])
                        else
                                req->data.reset.resetType = 1;
 
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "%s device %s.\n", (fullrestart) ? "Restarting" : "Resetting", d->id);
+                       ast_verb(3, "%s device %s.\n", (fullrestart) ? "Restarting" : "Resetting", d->id);
                        transmit_response(d->session, req);
                }
        }
@@ -2404,10 +2403,8 @@ static struct skinny_device *build_device(const char *cat, struct ast_variable *
                                        ast_copy_string(l->mohsuggest, mohsuggest, sizeof(l->mohsuggest));
                                        ast_copy_string(l->regexten, regexten, sizeof(l->regexten));
                                        ast_copy_string(l->mailbox, mailbox, sizeof(l->mailbox));
-                                       if (!ast_strlen_zero(mailbox)) {
-                                               if (option_verbose > 2)
-                                                       ast_verbose(VERBOSE_PREFIX_3 "Setting mailbox '%s' on %s@%s\n", mailbox, d->name, l->name);
-                                       }
+                                       if (!ast_strlen_zero(mailbox))
+                                               ast_verb(3, "Setting mailbox '%s' on %s@%s\n", mailbox, d->name, l->name);
                                        if (!ast_strlen_zero(device_vmexten))
                                                ast_copy_string(l->vmexten, device_vmexten, sizeof(vmexten));
                                        l->msgstate = -1;
@@ -2536,8 +2533,7 @@ static void *skinny_ss(void *data)
        int getforward=0;
        int loop_pause = 100;
 
-       if (option_verbose > 2)
-               ast_verbose( VERBOSE_PREFIX_3 "Starting simple switch on '%s@%s'\n", l->name, d->name);
+       ast_verb(3, "Starting simple switch on '%s@%s'\n", l->name, d->name);
 
        len = strlen(d->exten);
 
@@ -2564,8 +2560,7 @@ static void *skinny_ss(void *data)
                                if (getforward) {
                                        /* Record this as the forwarding extension */
                                        ast_copy_string(l->call_forward, d->exten, sizeof(l->call_forward));
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "Setting call forward to '%s' on channel %s\n",
+                                       ast_verb(3, "Setting call forward to '%s' on channel %s\n",
                                                        l->call_forward, c->name);
                                        transmit_tone(s, SKINNY_DIALTONE);
                                        if (res) {
@@ -2643,7 +2638,7 @@ static int skinny_call(struct ast_channel *ast, char *dest, int timeout)
        }
 
        if (skinnydebug)
-               ast_verbose(VERBOSE_PREFIX_3 "skinny_call(%s)\n", ast->name);
+               ast_verb(3, "skinny_call(%s)\n", ast->name);
 
        if (l->dnd) {
                ast_queue_control(ast, AST_CONTROL_BUSY);
@@ -2923,7 +2918,7 @@ static int skinny_indicate(struct ast_channel *ast, int ind, const void *data, s
        struct skinnysession *s = d->session;
 
        if (skinnydebug)
-               ast_verbose(VERBOSE_PREFIX_3 "Asked to indicate '%s' condition on channel %s\n", control2str(ind), ast->name);
+               ast_verb(3, "Asked to indicate '%s' condition on channel %s\n", control2str(ind), ast->name);
        switch(ind) {
        case AST_CONTROL_RINGING:
                if (ast->_state != AST_STATE_UP) {
@@ -3170,8 +3165,7 @@ static int handle_register_message(struct skinny_req *req, struct skinnysession
                transmit_response(s, req);
                return 0;
        }
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "Device '%s' successfully registered\n", name);
+       ast_verb(3, "Device '%s' successfully registered\n", name);
 
        if (!(req = req_alloc(sizeof(struct register_ack_message), REGISTER_ACK_MESSAGE)))
                return -1;
@@ -3469,14 +3463,12 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
 
                /* Do not disturb */
                if (l->dnd != 0){
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Disabling DND on %s@%s\n", l->name, d->name);
+                       ast_verb(3, "Disabling DND on %s@%s\n", l->name, d->name);
                        l->dnd = 0;
                        transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_ON);
                        transmit_displaynotify(s, "DnD disabled", 10);
                } else {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Enabling DND on %s@%s\n", l->name, d->name);
+                       ast_verb(3, "Enabling DND on %s@%s\n", l->name, d->name);
                        l->dnd = 1;
                        transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_OFF);
                        transmit_displaynotify(s, "DnD enabled", 10);
@@ -4289,14 +4281,12 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
 
                /* Do not disturb */
                if (l->dnd != 0){
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Disabling DND on %s@%s\n", l->name, d->name);
+                       ast_verb(3, "Disabling DND on %s@%s\n", l->name, d->name);
                        l->dnd = 0;
                        transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_ON);
                        transmit_displaynotify(s, "DnD disabled", 10);
                } else {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Enabling DND on %s@%s\n", l->name, d->name);
+                       ast_verb(3, "Enabling DND on %s@%s\n", l->name, d->name);
                        l->dnd = 1;
                        transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_OFF);
                        transmit_displaynotify(s, "DnD enabled", 10);
@@ -4753,8 +4743,7 @@ static void *skinny_session(void *data)
        struct skinny_req *req;
        struct skinnysession *s = data;
 
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "Starting Skinny session from %s\n", ast_inet_ntoa(s->sin.sin_addr));
+       ast_verb(3, "Starting Skinny session from %s\n", ast_inet_ntoa(s->sin.sin_addr));
 
        for (;;) {
                res = get_input(s);
@@ -4907,9 +4896,7 @@ static struct ast_channel *skinny_request(const char *type, int format, void *da
                ast_log(LOG_NOTICE, "No available lines on: %s\n", dest);
                return NULL;
        }
-       if (option_verbose > 2) {
-               ast_verbose(VERBOSE_PREFIX_3 "skinny_request(%s)\n", tmp);
-       }
+       ast_verb(3, "skinny_request(%s)\n", tmp);
        tmpc = skinny_new(l, AST_STATE_DOWN);
        if (!tmpc) {
                ast_log(LOG_WARNING, "Unable to make channel for '%s'\n", tmp);
@@ -5062,8 +5049,7 @@ static int reload_config(void)
                } else {
                        d = build_device(cat, ast_variable_browse(cfg, cat));
                        if (d) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Added device '%s'\n", d->name);
+                               ast_verb(3, "Added device '%s'\n", d->name);
                                ast_mutex_lock(&devicelock);
                                d->next = devices;
                                devices = d;
@@ -5105,8 +5091,7 @@ static int reload_config(void)
                                        ast_config_destroy(cfg);
                                        return 0;
                        }
-                       if (option_verbose > 1)
-                               ast_verbose(VERBOSE_PREFIX_2 "Skinny listening on %s:%d\n",
+                       ast_verb(2, "Skinny listening on %s:%d\n",
                                        ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
                        ast_pthread_create_background(&accept_t,NULL, accept_thread, NULL);
                }
index 3cc76d66e71ed3f8635e768eef66fc37a65f3d6b..02c3faf4808bb3889a3648e3c9f2bf9c9aa28a23 100644 (file)
@@ -476,17 +476,14 @@ static enum ast_bridge_result ast_vpb_bridge(struct ast_channel *c0, struct ast_
                        p1->bridge = &bridges[i];
                } ast_mutex_unlock(&p1->lock);
 
-               if (option_verbose>1) 
-                       ast_verbose(VERBOSE_PREFIX_2 "%s: vpb_bridge: Bridging call entered with [%s, %s]\n",p0->dev, c0->name, c1->name);
+               ast_verb(2, "%s: vpb_bridge: Bridging call entered with [%s, %s]\n",p0->dev, c0->name, c1->name);
        }
 
-       if (option_verbose > 2) 
-               ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name);
+       ast_verb(3, "Native bridging %s and %s\n", c0->name, c1->name);
 
        #ifdef HALF_DUPLEX_BRIDGE
 
-       if (option_verbose>1) 
-               ast_verbose(VERBOSE_PREFIX_2 "%s: vpb_bridge: Starting half-duplex bridge [%s, %s]\n",p0->dev, c0->name, c1->name);
+       ast_verb(2, "%s: vpb_bridge: Starting half-duplex bridge [%s, %s]\n",p0->dev, c0->name, c1->name);
 
        int dir = 0;
 
@@ -518,8 +515,7 @@ static enum ast_bridge_result ast_vpb_bridge(struct ast_channel *c0, struct ast_
        vpb_play_buf_finish(p0->handle);
        vpb_play_buf_finish(p1->handle);
 
-       if (option_verbose>1) 
-               ast_verbose(VERBOSE_PREFIX_2 "%s: vpb_bridge: Finished half-duplex bridge [%s, %s]\n",p0->dev, c0->name, c1->name);
+       ast_verb(2, "%s: vpb_bridge: Finished half-duplex bridge [%s, %s]\n",p0->dev, c0->name, c1->name);
 
        res = VPB_OK;
 
@@ -602,8 +598,7 @@ static enum ast_bridge_result ast_vpb_bridge(struct ast_channel *c0, struct ast_
        p1->bridge = NULL;
 
 
-       if (option_verbose>1) 
-               ast_verbose(VERBOSE_PREFIX_2 "Bridging call done with [%s, %s] => %d\n", c0->name, c1->name, res);
+       ast_verb(2, "Bridging call done with [%s, %s] => %d\n", c0->name, c1->name, res);
 
 /*
        ast_mutex_unlock(&p0->lock);
@@ -638,16 +633,14 @@ static void get_callerid(struct vpb_pvt *p)
        if( ast_mutex_trylock(&p->record_lock) == 0 ) {
 
                cid_record_time = ast_tvnow();
-               if (option_verbose>3) 
-                       ast_verbose(VERBOSE_PREFIX_4 "CID record - start\n");
+               ast_verb(4, "CID record - start\n");
 
                /* Skip any trailing ringtone */
                if (UsePolarityCID != 1){
                        vpb_sleep(RING_SKIP);
                }
 
-               if (option_verbose>3) 
-                       ast_verbose(VERBOSE_PREFIX_4 "CID record - skipped %dms trailing ring\n",
+               ast_verb(4, "CID record - skipped %dms trailing ring\n",
                                 ast_tvdiff_ms(ast_tvnow(), cid_record_time));
                cid_record_time = ast_tvnow();
 
@@ -661,8 +654,7 @@ static void get_callerid(struct vpb_pvt *p)
                vpb_wave_close_write(ws);
 #endif
 
-               if (option_verbose>3) 
-                       ast_verbose(VERBOSE_PREFIX_4 "CID record - recorded %dms between rings\n", 
+               ast_verb(4, "CID record - recorded %dms between rings\n",
                                 ast_tvdiff_ms(ast_tvnow(), cid_record_time));
 
                ast_mutex_unlock(&p->record_lock);
@@ -698,8 +690,7 @@ static void get_callerid(struct vpb_pvt *p)
                                        strcpy(p->cid_name, cli_struct->cn);
 
                                }
-                               if (option_verbose>3) 
-                                       ast_verbose(VERBOSE_PREFIX_4 "CID record - got [%s] [%s]\n",owner->cid.cid_num,owner->cid.cid_name );
+                               ast_verb(4, "CID record - got [%s] [%s]\n",owner->cid.cid_num,owner->cid.cid_name );
                                snprintf(p->callerid,sizeof(p->callerid)-1,"%s %s",cli_struct->cldn,cli_struct->cn);
                        }
                        else {
@@ -735,20 +726,19 @@ static void get_callerid_ast(struct vpb_pvt *p)
 #endif
 
        if(p->callerid_type == 1) {
-       if (option_verbose>3) ast_verbose(VERBOSE_PREFIX_4 "Collected caller ID already\n");
+               ast_verb(4, "Collected caller ID already\n");
                return;
        }
        else if(p->callerid_type == 2 ) {
                which_cid=CID_SIG_V23;
-       if (option_verbose>3) ast_verbose(VERBOSE_PREFIX_4 "Collecting Caller ID v23...\n");
+               ast_verb(4, "Collecting Caller ID v23...\n");
        }
        else if(p->callerid_type == 3) {
                which_cid=CID_SIG_BELL;
-       if (option_verbose>3) ast_verbose(VERBOSE_PREFIX_4 "Collecting Caller ID bell...\n");
+               ast_verb(4, "Collecting Caller ID bell...\n");
        }
        else {
-               if (option_verbose>3) 
-                       ast_verbose(VERBOSE_PREFIX_4 "Caller ID disabled\n");
+               ast_verb(4, "Caller ID disabled\n");
                return;
        }
 /*     vpb_sleep(RING_SKIP); */
@@ -770,7 +760,7 @@ static void get_callerid_ast(struct vpb_pvt *p)
                        vpb_wave_write(ws,(char*)buf,sizeof(buf)); 
 #endif
                        sam_count+=sizeof(buf);
-                       if (option_verbose>3) ast_verbose(VERBOSE_PREFIX_4 "Collecting Caller ID samples [%d][%d]...\n",sam_count,rc);
+                       ast_verb(4, "Collecting Caller ID samples [%d][%d]...\n",sam_count,rc);
                }
                vpb_record_buf_finish(p->handle);
 #ifdef ANALYSE_CID
@@ -778,8 +768,7 @@ static void get_callerid_ast(struct vpb_pvt *p)
 #endif
                if (rc == 1){
                        callerid_get(cs, &name, &number, &flags);
-                       if (option_verbose>0) 
-                               ast_verbose(VERBOSE_PREFIX_1 "%s: Caller ID name [%s] number [%s] flags [%d]\n",p->dev,name, number,flags);
+                       ast_verb(1, "%s: Caller ID name [%s] number [%s] flags [%d]\n",p->dev,name, number,flags);
                }
                else {
                        ast_log(LOG_ERROR, "%s: Failed to decode Caller ID \n", p->dev );
@@ -821,9 +810,7 @@ static void stoptone( int handle)
                vpb_tone_terminate(handle);
                ret = vpb_get_event_ch_async(handle,&je);
                if ((ret == VPB_OK)&&(je.type != VPB_DIALEND)){
-                       if (option_verbose > 3){
-                                       ast_verbose(VERBOSE_PREFIX_4 "Stop tone collected a wrong event!![%d]\n",je.type);
-                       }
+                       ast_verb(4, "Stop tone collected a wrong event!![%d]\n",je.type);
 /*                     vpb_put_event(&je); */
                }
                vpb_sleep(10);
@@ -835,8 +822,7 @@ static int playtone( int handle, VPB_TONE *tone)
 {
        int ret=VPB_OK;
        stoptone(handle);
-       if (option_verbose > 3) 
-               ast_verbose(VERBOSE_PREFIX_4 "[%02d]: Playing tone\n", handle);
+       ast_verb(4, "[%02d]: Playing tone\n", handle);
        ret = vpb_playtone_async(handle, tone);
        return ret;
 }
@@ -847,8 +833,7 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e)
        int endbridge = 0;
        int res=0;
 
-       if (option_verbose > 3) 
-               ast_verbose(VERBOSE_PREFIX_4 "%s: handle_owned: got event: [%d=>%d]\n", p->dev, e->type, e->data);
+       ast_verb(4, "%s: handle_owned: got event: [%d=>%d]\n", p->dev, e->type, e->data);
 
        f.src = "vpb";
        switch (e->type) {
@@ -906,8 +891,7 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e)
 
                case VPB_TONEDETECT:
                        if (e->data == VPB_BUSY || e->data == VPB_BUSY_308 || e->data == VPB_BUSY_AUST ) {
-                               if (option_verbose > 3) 
-                                       ast_verbose(VERBOSE_PREFIX_4 "%s: handle_owned: got event: BUSY\n", p->dev);
+                               ast_verb(4, "%s: handle_owned: got event: BUSY\n", p->dev);
                                if (p->owner->_state == AST_STATE_UP) {
                                        f.subclass = AST_CONTROL_HANGUP;
                                }
@@ -921,8 +905,7 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e)
                                                const char *target_context = S_OR(p->owner->macrocontext, p->owner->context);
                                                
                                                if (ast_exists_extension(p->owner, target_context, "fax", 1, p->owner->cid.cid_num)) {
-                                                       if (option_verbose > 2)
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Redirecting %s to fax extension\n", p->owner->name);
+                                                       ast_verb(3, "Redirecting %s to fax extension\n", p->owner->name);
                                                        /* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
                                                        pbx_builtin_setvar_helper(p->owner, "FAXEXTEN", p->owner->exten);
                                                        if (ast_async_goto(p->owner, target_context, "fax", 1))
@@ -939,8 +922,7 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e)
                                if ( ast_tvdiff_ms(ast_tvnow(), p->lastgrunt) > gruntdetect_timeout ) {
                                        /* Nothing heard on line for a very long time
                                         * Timeout connection */
-                                       if (option_verbose > 2) 
-                                               ast_verbose(VERBOSE_PREFIX_3 "grunt timeout\n");
+                                       ast_verb(3, "grunt timeout\n");
                                        ast_log(LOG_NOTICE,"%s: Line hangup due of lack of conversation\n",p->dev); 
                                        f.subclass = AST_CONTROL_HANGUP;
                                } else {
@@ -1001,8 +983,7 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e)
                case VPB_DIALEND:
                        if (p->state < 5){
                                f.subclass = AST_CONTROL_ANSWER;
-                               if (option_verbose > 1) 
-                                       ast_verbose(VERBOSE_PREFIX_2 "%s: Dialend\n", p->dev);
+                               ast_verb(2, "%s: Dialend\n", p->dev);
                        } else {
                                f.frametype = AST_FRAME_NULL;
                        }
@@ -1024,9 +1005,9 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e)
        }
 
 /*
-       if (option_verbose > 3) ast_verbose("%s: LOCKING in handle_owned [%d]\n", p->dev,res);
+       ast_verb(4, "%s: LOCKING in handle_owned [%d]\n", p->dev,res);
        res = ast_mutex_lock(&p->lock); 
-       if (option_verbose > 3) ast_verbose("%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+       ast_verb(4, "%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
 */
        {
                if (p->bridge) { /* Check what happened, see if we need to report it. */
@@ -1071,13 +1052,12 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e)
        if (endbridge){
                res = ast_mutex_unlock(&p->lock);
 /*
-               if (option_verbose > 3) ast_verbose("%s: unLOCKING in handle_owned [%d]\n", p->dev,res);
+               ast_verb(4, "%s: unLOCKING in handle_owned [%d]\n", p->dev,res);
 */
                return 0;
        }
 
-       if (option_verbose > 3) 
-               ast_verbose(VERBOSE_PREFIX_4 "%s: handle_owned: Prepared frame type[%d]subclass[%d], bridge=%p owner=[%s]\n",
+       ast_verb(4, "%s: handle_owned: Prepared frame type[%d]subclass[%d], bridge=%p owner=[%s]\n",
                        p->dev, f.frametype, f.subclass, (void *)p->bridge, p->owner->name);
 
        /* Trylock used here to avoid deadlock that can occur if we
@@ -1088,8 +1068,7 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e)
                if (ast_mutex_trylock(&p->owner->lock)==0)  {
                        ast_queue_frame(p->owner, &f);
                        ast_mutex_unlock(&p->owner->lock);
-                       if (option_verbose > 3) 
-                               ast_verbose(VERBOSE_PREFIX_4 "%s: handled_owned: Queued Frame to [%s]\n", p->dev,p->owner->name);
+                       ast_verb(4, "%s: handled_owned: Queued Frame to [%s]\n", p->dev,p->owner->name);
                } else {
                        ast_verbose("%s: handled_owned: Missed event %d/%d \n",
                                p->dev,f.frametype, f.subclass);
@@ -1097,7 +1076,7 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e)
        }
        res = ast_mutex_unlock(&p->lock);
 /*
-       if (option_verbose > 3) ast_verbose("%s: unLOCKING in handle_owned [%d]\n", p->dev,res);
+       ast_verb(4, "%s: unLOCKING in handle_owned [%d]\n", p->dev,res);
 */
 
        return 0;
@@ -1113,22 +1092,17 @@ static inline int monitor_handle_notowned(struct vpb_pvt *p, VPB_EVENT *e)
        struct ast_channel *c;
 */
 
-       if (option_verbose > 3) {
                char str[VPB_MAX_STR];
                vpb_translate_event(e, str);
-               ast_verbose(VERBOSE_PREFIX_4 "%s: handle_notowned: mode=%d, event[%d][%s]=[%d]\n",
-                       p->dev, p->mode, e->type,str, e->data);
-       }
+       ast_verb(4, "%s: handle_notowned: mode=%d, event[%d][%s]=[%d]\n", p->dev, p->mode, e->type,str, e->data);
 
        switch(e->type) {
                case VPB_LOOP_ONHOOK:
                case VPB_LOOP_POLARITY:
                        if (UsePolarityCID == 1){
-                               if (option_verbose>3)
-                                       ast_verbose(VERBOSE_PREFIX_4 "Polarity reversal\n");
+                               ast_verb(4, "Polarity reversal\n");
                                if(p->callerid_type == 1) {
-                                       if (option_verbose>3)
-                                               ast_verbose(VERBOSE_PREFIX_4 "Using VPB Caller ID\n");
+                                       ast_verb(4, "Using VPB Caller ID\n");
                                        get_callerid(p);        /* UK CID before 1st ring*/
                                }
 /*                             get_callerid_ast(p); */   /* Caller ID using the ast functions */
@@ -1139,8 +1113,7 @@ static inline int monitor_handle_notowned(struct vpb_pvt *p, VPB_EVENT *e)
                                vpb_new(p, AST_STATE_RING, p->context);
                                if (UsePolarityCID != 1){
                                        if(p->callerid_type == 1) {
-                                               if (option_verbose>3)
-                                                       ast_verbose(VERBOSE_PREFIX_4 "Using VPB Caller ID\n");
+                                               ast_verb(4, "Using VPB Caller ID\n");
                                                get_callerid(p);        /* Australian CID only between 1st and 2nd ring  */
                                        }
                                        get_callerid_ast(p);    /* Caller ID using the ast functions */
@@ -1164,7 +1137,7 @@ static inline int monitor_handle_notowned(struct vpb_pvt *p, VPB_EVENT *e)
                        if (p->mode == MODE_IMMEDIATE) 
                                vpb_new(p,AST_STATE_RING, p->context);
                        else {
-                               ast_verbose(VERBOSE_PREFIX_4 "%s: handle_notowned: playing dialtone\n",p->dev);
+                               ast_verb(4, "%s: handle_notowned: playing dialtone\n",p->dev);
                                playtone(p->handle, &Dialtone);
                                p->state=VPB_STATE_PLAYDIAL;
                                p->wantdtmf = 1;
@@ -1192,7 +1165,7 @@ static inline int monitor_handle_notowned(struct vpb_pvt *p, VPB_EVENT *e)
                                }
                                */
                        } else {
-                               ast_verbose(VERBOSE_PREFIX_4 "%s: handle_notowned: Got a DIALEND when not really expected\n",p->dev);
+                               ast_verb(4, "%s: handle_notowned: Got a DIALEND when not really expected\n",p->dev);
                        }
                        break;
 
@@ -1205,8 +1178,7 @@ static inline int monitor_handle_notowned(struct vpb_pvt *p, VPB_EVENT *e)
                case VPB_TIMEREXP:
                        if (e->data == p->dtmfidd_timer_id) {
                                if (ast_exists_extension(NULL, p->context, p->ext, 1, p->callerid)){
-                                       if (option_verbose > 3)
-                                               ast_verbose(VERBOSE_PREFIX_4 "%s: handle_notowned: DTMF IDD timer out, matching on [%s] in [%s]\n", p->dev,p->ext , p->context);
+                                       ast_verb(4, "%s: handle_notowned: DTMF IDD timer out, matching on [%s] in [%s]\n", p->dev,p->ext , p->context);
 
                                        vpb_new(p,AST_STATE_RING, p->context);
                                }
@@ -1234,8 +1206,7 @@ static inline int monitor_handle_notowned(struct vpb_pvt *p, VPB_EVENT *e)
                                        }
                                        else if ( e->data == DTMF_CID_STOP ) { /* CallerID End signal */
                                                p->callerid[p->dtmf_caller_pos] = '\0';
-                                               if (option_verbose > 2)
-                                                       ast_verbose(VERBOSE_PREFIX_3 " %s: DTMF CallerID %s\n",p->dev,p->callerid);
+                                               ast_verb(3, " %s: DTMF CallerID %s\n",p->dev,p->callerid);
                                                if (owner){
                                                        /*
                                                        if (owner->cid.cid_num)
@@ -1251,11 +1222,8 @@ static inline int monitor_handle_notowned(struct vpb_pvt *p, VPB_EVENT *e)
                                                        ast_callerid_split(p->callerid, cid_name, sizeof(cid_name), cid_num, sizeof(cid_num));
                                                        ast_set_callerid(owner, cid_num, cid_name, cid_num);
 
-                                               }
-                                               else {
-                                                       if (option_verbose > 2)
-                                                               ast_verbose(VERBOSE_PREFIX_3 " %s: DTMF CallerID: no owner to assign CID \n",p->dev);
-                                               }
+                                               } else
+                                                       ast_verb(3, " %s: DTMF CallerID: no owner to assign CID \n",p->dev);
                                        } else if ( p->dtmf_caller_pos < AST_MAX_EXTENSION ) {
                                                if ( p->dtmf_caller_pos >= 0 )
                                                        p->callerid[p->dtmf_caller_pos] = e->data;
@@ -1282,24 +1250,20 @@ static inline int monitor_handle_notowned(struct vpb_pvt *p, VPB_EVENT *e)
                        #endif
                        if (ast_exists_extension(NULL, p->context, p->ext, 1, p->callerid)){
                                if ( ast_canmatch_extension(NULL, p->context, p->ext, 1, p->callerid)){
-                                       if (option_verbose > 3)
-                                               ast_verbose(VERBOSE_PREFIX_4 "%s: handle_notowned: Multiple matches on [%s] in [%s]\n", p->dev,p->ext , p->context);
+                                       ast_verb(4, "%s: handle_notowned: Multiple matches on [%s] in [%s]\n", p->dev,p->ext , p->context);
                                        /* Start DTMF IDD timer */
                                        vpb_timer_stop(p->dtmfidd_timer);
                                        vpb_timer_start(p->dtmfidd_timer);
                                }
                                else {
-                                       if (option_verbose > 3)
-                                               ast_verbose(VERBOSE_PREFIX_4 "%s: handle_notowned: Matched on [%s] in [%s]\n", p->dev,p->ext , p->context);
+                                       ast_verb(4, "%s: handle_notowned: Matched on [%s] in [%s]\n", p->dev,p->ext , p->context);
                                        vpb_new(p,AST_STATE_UP, p->context);
                                }
                        } else if (!ast_canmatch_extension(NULL, p->context, p->ext, 1, p->callerid)){
                                if (ast_exists_extension(NULL, "default", p->ext, 1, p->callerid)) {
                                        vpb_new(p,AST_STATE_UP, "default");           
                                } else if (!ast_canmatch_extension(NULL, "default", p->ext, 1, p->callerid)) {
-                                       if (option_verbose > 3) {
-                                               ast_verbose(VERBOSE_PREFIX_4 "%s: handle_notowned: can't match anything in %s or default\n", p->dev, p->context);
-                                       }
+                                       ast_verb(4, "%s: handle_notowned: can't match anything in %s or default\n", p->dev, p->context);
                                        playtone(p->handle, &Busytone);
                                        vpb_timer_stop(p->busy_timer);
                                        vpb_timer_start(p->busy_timer);
@@ -1313,9 +1277,7 @@ static inline int monitor_handle_notowned(struct vpb_pvt *p, VPB_EVENT *e)
                        break;
        }
 
-       if (option_verbose > 3) 
-               ast_verbose(VERBOSE_PREFIX_4 "%s: handle_notowned: mode=%d, [%d=>%d]\n",
-                       p->dev, p->mode, e->type, e->data);
+       ast_verb(4, "%s: handle_notowned: mode=%d, [%d=>%d]\n", p->dev, p->mode, e->type, e->data);
 
        return 0;
 }
@@ -1325,8 +1287,7 @@ static void *do_monitor(void *unused)
 
        /* Monitor thread, doesn't die until explicitly killed. */
 
-       if (option_verbose > 1) 
-               ast_verbose(VERBOSE_PREFIX_2 "Starting vpb monitor thread[%ld]\n",
+       ast_verb(2, "Starting vpb monitor thread[%ld]\n",
        pthread_self());
 
        pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
@@ -1338,20 +1299,17 @@ static void *do_monitor(void *unused)
                struct vpb_pvt *p;
 
                /*
-               if (option_verbose > 3)
-                    ast_verbose(VERBOSE_PREFIX_4 "Monitor waiting for event\n");
+               ast_verb(4, "Monitor waiting for event\n");
                */
 
                int res = vpb_get_event_sync(&e, VPB_WAIT_TIMEOUT);
                if( (res==VPB_NO_EVENTS) || (res==VPB_TIME_OUT) ){
                        /*
-                       if (option_verbose > 3){
                                if (res ==  VPB_NO_EVENTS){
-                                       ast_verbose(VERBOSE_PREFIX_4 "No events....\n");
+                               ast_verb(4, "No events....\n");
                                } else {
-                                       ast_verbose(VERBOSE_PREFIX_4 "No events, timed out....\n");
+                               ast_verb(4, "No events, timed out....\n");
                                }
-                       }
                        */
                        continue;
                }
@@ -1367,11 +1325,9 @@ static void *do_monitor(void *unused)
                p = NULL;
 
                ast_mutex_lock(&monlock); {
-
-                       if (e.type == VPB_NULL_EVENT) {
-                               if (option_verbose > 3)
-                                       ast_verbose(VERBOSE_PREFIX_4 "Monitor got null event\n");
-                       }
+               //XXX useless braces, remove them and fix indenting
+                       if (e.type == VPB_NULL_EVENT)
+                               ast_verb(4, "Monitor got null event\n");
                        else {
                                vpb_translate_event(&e, str);
                                if (strlen(str)>1){
@@ -1384,8 +1340,8 @@ static void *do_monitor(void *unused)
                                                p = p->next;
                                } ast_mutex_unlock(&iflock);
 
-                               if (p && (option_verbose > 3))
-                                       ast_verbose(VERBOSE_PREFIX_4 "%s: Event [%d=>%s] \n", 
+                               if (p)
+                                       ast_verb(4, "%s: Event [%d=>%s] \n",
                                                p ? p->dev : "null", e.type, str );
                        }
 
@@ -1394,19 +1350,15 @@ static void *do_monitor(void *unused)
                if (!p) {
                        if (e.type != VPB_NULL_EVENT){
                                ast_log(LOG_WARNING, "Got event [%s][%d], no matching iface!\n", str,e.type);    
-                               if (option_verbose > 3){
-                                       ast_verbose(VERBOSE_PREFIX_4 "vpb/ERR: No interface for Event [%d=>%s] \n",e.type,str );
+                               ast_verb(4, "vpb/ERR: No interface for Event [%d=>%s] \n",e.type,str );
                                }
-                       }
                        continue;
                } 
 
                /* flush the event from the channel event Q */
                vpb_get_event_ch_async(e.handle,&je);
-               if (option_verbose > 4){
                        vpb_translate_event(&je, str);
-                       ast_verbose("%s: Flushing event [%d]=>%s\n",p->dev,je.type,str);
-               }
+               ast_verb(5, "%s: Flushing event [%d]=>%s\n",p->dev,je.type,str);
 
                /* Check for ownership and locks */
                if ((p->owner)&&(!p->golock)){
@@ -1451,15 +1403,13 @@ static int restart_monitor(void)
        if (mthreadactive == -2)
                return 0;
 
-       if (option_verbose > 3)
-               ast_verbose(VERBOSE_PREFIX_4 "Restarting monitor\n");
+       ast_verb(4, "Restarting monitor\n");
 
        ast_mutex_lock(&monlock); {
                if (monitor_thread == pthread_self()) {
                        ast_log(LOG_WARNING, "Cannot kill myself\n");
                        error = -1;
-                       if (option_verbose > 3)
-                               ast_verbose(VERBOSE_PREFIX_4 "Monitor trying to kill monitor\n");
+                       ast_verb(4, "Monitor trying to kill monitor\n");
                }
                else {
                        if (mthreadactive != -1) {
@@ -1469,15 +1419,13 @@ static int restart_monitor(void)
                                e.type = VPB_NULL_EVENT;
                                e.data = 0;
 
-                               if (option_verbose > 3)
-                                       ast_verbose(VERBOSE_PREFIX_4 "Trying to reawake monitor\n");
+                               ast_verb(4, "Trying to reawake monitor\n");
 
                                vpb_put_event(&e);
                        } else {
                                /* Start a new monitor */
                                int pid = ast_pthread_create(&monitor_thread, NULL, do_monitor, NULL); 
-                               if (option_verbose > 3)
-                                       ast_verbose(VERBOSE_PREFIX_4 "Created new monitor thread %d\n",pid);
+                               ast_verb(4, "Created new monitor thread %d\n",pid);
                                if (pid < 0) {
                                        ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
                                        error = -1;
@@ -1487,8 +1435,7 @@ static int restart_monitor(void)
                }
        } ast_mutex_unlock(&monlock);
 
-       if (option_verbose > 3)
-               ast_verbose(VERBOSE_PREFIX_4 "Monitor restarted\n");
+       ast_verb(4, "Monitor restarted\n");
 
        return error;
 }
@@ -1718,23 +1665,21 @@ static int vpb_indicate(struct ast_channel *ast, int condition, const void *data
        int tmp = 0;
 
        if (use_ast_ind == 1) {
-               if (option_verbose > 3)
-                       ast_verbose(VERBOSE_PREFIX_4 "%s: vpb_indicate called when using Ast Indications !?!\n", p->dev);
+               ast_verb(4, "%s: vpb_indicate called when using Ast Indications !?!\n", p->dev);
                return 0;
        }
 
-       if (option_verbose > 3)
-               ast_verbose(VERBOSE_PREFIX_4 "%s: vpb_indicate [%d] state[%d]\n", p->dev, condition,ast->_state);
+       ast_verb(4, "%s: vpb_indicate [%d] state[%d]\n", p->dev, condition,ast->_state);
 /*
        if (ast->_state != AST_STATE_UP) {
-               ast_verbose(VERBOSE_PREFIX_4 "%s: vpb_indicate Not in AST_STATE_UP\n", p->dev, condition,ast->_state);
+               ast_verb(4, "%s: vpb_indicate Not in AST_STATE_UP\n", p->dev, condition,ast->_state);
                return res;
        }
 */
 
 /*
-       if (option_verbose > 3) ast_verbose("%s: LOCKING in indicate \n", p->dev);
-       if (option_verbose > 3) ast_verbose("%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+       ast_verb(4, "%s: LOCKING in indicate \n", p->dev);
+       ast_verb(4, "%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
 */
        ast_mutex_lock(&p->lock);
        switch(condition) {
@@ -1751,8 +1696,7 @@ static int vpb_indicate(struct ast_channel *ast, int condition, const void *data
                        if (ast->_state == AST_STATE_UP) {
                                playtone(p->handle, &Ringbacktone);
                                p->state = VPB_STATE_PLAYRING;
-                               if (option_verbose > 3)
-                                       ast_verbose(VERBOSE_PREFIX_4 "%s: vpb indicate: setting ringback timer [%d]\n", p->dev,p->ringback_timer_id);
+                               ast_verb(4, "%s: vpb indicate: setting ringback timer [%d]\n", p->dev,p->ringback_timer_id);
                                
                                vpb_timer_stop(p->ringback_timer);
                                vpb_timer_start(p->ringback_timer);
@@ -1784,7 +1728,7 @@ static int vpb_indicate(struct ast_channel *ast, int condition, const void *data
        }
        tmp = ast_mutex_unlock(&p->lock);
 /*
-       if (option_verbose > 3) ast_verbose("%s: unLOCKING in indicate [%d]\n", p->dev,tmp);
+       ast_verb(4, "%s: unLOCKING in indicate [%d]\n", p->dev,tmp);
 */
        return res;
 }
@@ -1795,8 +1739,8 @@ static int vpb_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
        int res = 0;
 
 /*
-       if (option_verbose > 3) ast_verbose("%s: LOCKING in fixup \n", p->dev);
-       if (option_verbose > 3) ast_verbose("%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+       ast_verb(4, "%s: LOCKING in fixup \n", p->dev);
+       ast_verb(4, "%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
 */
        ast_mutex_lock(&p->lock);
        ast_debug(1, "New owner for channel %s is %s\n", p->dev, newchan->name);
@@ -1807,20 +1751,18 @@ static int vpb_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
 
        if (newchan->_state == AST_STATE_RINGING){
                if (use_ast_ind == 1) {
-                       if (option_verbose > 3)
-                               ast_verbose(VERBOSE_PREFIX_4 "%s: vpb_fixup Calling ast_indicate\n", p->dev);
+                       ast_verb(4, "%s: vpb_fixup Calling ast_indicate\n", p->dev);
                        ast_indicate(newchan, AST_CONTROL_RINGING);
                }
                else {
-                       if (option_verbose > 3)
-                               ast_verbose(VERBOSE_PREFIX_4 "%s: vpb_fixup Calling vpb_indicate\n", p->dev);
+                       ast_verb(4, "%s: vpb_fixup Calling vpb_indicate\n", p->dev);
                        vpb_indicate(newchan, AST_CONTROL_RINGING, NULL, 0);
                }
        }
 
        res= ast_mutex_unlock(&p->lock);
 /*
-       if (option_verbose > 3) ast_verbose("%s: unLOCKING in fixup [%d]\n", p->dev,res);
+       ast_verb(4, "%s: unLOCKING in fixup [%d]\n", p->dev,res);
 */
        return 0;
 }
@@ -1837,14 +1779,13 @@ static int vpb_digit_end(struct ast_channel *ast, char digit, unsigned int durat
        int res = 0;
 
        if (use_ast_dtmf){
-               if (option_verbose > 3)
-                       ast_verbose(VERBOSE_PREFIX_4 "%s: vpb_digit: asked to play digit[%c] but we are using asterisk dtmf play back?!\n", p->dev, digit);
+               ast_verb(4, "%s: vpb_digit: asked to play digit[%c] but we are using asterisk dtmf play back?!\n", p->dev, digit);
                return 0;
        }
 
 /*
-       if (option_verbose > 3) ast_verbose("%s: LOCKING in digit \n", p->dev);
-       if (option_verbose > 3) ast_verbose("%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+       ast_verb(4, "%s: LOCKING in digit \n", p->dev);
+       ast_verb(4, "%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
 */
        ast_mutex_lock(&p->lock);
 
@@ -1852,8 +1793,7 @@ static int vpb_digit_end(struct ast_channel *ast, char digit, unsigned int durat
        s[0] = digit;
        s[1] = '\0';
 
-       if (option_verbose > 3)
-               ast_verbose(VERBOSE_PREFIX_4 "%s: vpb_digit: asked to play digit[%s]\n", p->dev, s);
+       ast_verb(4, "%s: vpb_digit: asked to play digit[%s]\n", p->dev, s);
 
        ast_mutex_lock(&p->play_dtmf_lock);
        strncat(p->play_dtmf,s,sizeof(*p->play_dtmf));
@@ -1861,7 +1801,7 @@ static int vpb_digit_end(struct ast_channel *ast, char digit, unsigned int durat
 
        res = ast_mutex_unlock(&p->lock);
 /*
-       if (option_verbose > 3) ast_verbose("%s: unLOCKING in digit [%d]\n", p->dev,res);
+       ast_verb(4, "%s: unLOCKING in digit [%d]\n", p->dev,res);
 */
        return 0;
 }
@@ -1876,12 +1816,11 @@ static int vpb_call(struct ast_channel *ast, char *dest, int timeout)
        int tmp = 0;
 
 /*
-       if (option_verbose > 3) ast_verbose("%s: LOCKING in call \n", p->dev);
-       if (option_verbose > 3) ast_verbose("%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+       ast_verb(4, "%s: LOCKING in call \n", p->dev);
+       ast_verb(4, "%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
 */
        ast_mutex_lock(&p->lock);
-       if (option_verbose > 3)
-               ast_verbose(VERBOSE_PREFIX_4 "%s: starting call to [%s]\n", p->dev,dest);
+       ast_verb(4, "%s: starting call to [%s]\n", p->dev,dest);
 
        if (s)
                s = s + 1;
@@ -1899,7 +1838,7 @@ static int vpb_call(struct ast_channel *ast, char *dest, int timeout)
                ast_log(LOG_WARNING, "vpb_call on %s neither down nor reserved!\n", ast->name);
                tmp = ast_mutex_unlock(&p->lock);
 /*
-               if (option_verbose > 3) ast_verbose("%s: unLOCKING in call [%d]\n", p->dev,tmp);
+               ast_verb(4, "%s: unLOCKING in call [%d]\n", p->dev,tmp);
 */
                return -1;
        }
@@ -1923,35 +1862,29 @@ static int vpb_call(struct ast_channel *ast, char *dest, int timeout)
                memcpy( &call.tone_map,  DialToneMap, sizeof(DialToneMap) );
                vpb_set_call(p->handle, &call);
 
-               if (option_verbose > 1)
-                       ast_verbose(VERBOSE_PREFIX_2 "%s: Calling %s on %s \n",p->dev, dialstring, ast->name); 
+               ast_verb(2, "%s: Calling %s on %s \n",p->dev, dialstring, ast->name);
 
-               if (option_verbose > 2) {
                        int j;
-                       ast_verbose(VERBOSE_PREFIX_2 "%s: Dial parms for %s %d/%dms/%dms/%dms/%dms\n", p->dev
+               ast_verb(2, "%s: Dial parms for %s %d/%dms/%dms/%dms/%dms\n", p->dev
                                , ast->name, call.dialtones, call.dialtone_timeout
                                , call.ringback_timeout, call.inter_ringback_timeout
                                , call.answer_timeout );
                        for( j=0; !call.tone_map[j].terminate; j++ )
-                               ast_verbose(VERBOSE_PREFIX_2 "%s: Dial parms for %s tone %d->%d\n", p->dev,
+                       ast_verb(2, "%s: Dial parms for %s tone %d->%d\n", p->dev,
                                        ast->name, call.tone_map[j].tone_id, call.tone_map[j].call_id); 
-               }
 
-               if (option_verbose > 3)
-                               ast_verbose("%s: Disabling Loop Drop detection\n",p->dev);
+               ast_verb(4, "%s: Disabling Loop Drop detection\n",p->dev);
                vpb_disable_event(p->handle, VPB_MDROP);
                vpb_sethook_sync(p->handle,VPB_OFFHOOK);
                p->state=VPB_STATE_OFFHOOK;
 
                #ifndef DIAL_WITH_CALL_PROGRESS
                vpb_sleep(300);
-               if (option_verbose > 3)
-                               ast_verbose("%s: Enabling Loop Drop detection\n",p->dev);
+               ast_verb(4, "%s: Enabling Loop Drop detection\n",p->dev);
                vpb_enable_event(p->handle, VPB_MDROP);
                res = vpb_dial_async(p->handle, dialstring);
                #else
-               if (option_verbose > 3)
-                               ast_verbose("%s: Enabling Loop Drop detection\n",p->dev);
+               ast_verb(4, "%s: Enabling Loop Drop detection\n",p->dev);
                vpb_enable_event(p->handle, VPB_MDROP);
                res = vpb_call_async(p->handle, dialstring);
                #endif
@@ -1963,8 +1896,7 @@ static int vpb_call(struct ast_channel *ast, char *dest, int timeout)
                        res = 0;
        }
 
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "%s: VPB Calling %s [t=%d] on %s returned %d\n",p->dev , s, timeout, ast->name, res); 
+       ast_verb(3, "%s: VPB Calling %s [t=%d] on %s returned %d\n",p->dev , s, timeout, ast->name, res);
        if (res == 0) {
                ast_setstate(ast, AST_STATE_RINGING);
                ast_queue_control(ast,AST_CONTROL_RINGING);             
@@ -1976,7 +1908,7 @@ static int vpb_call(struct ast_channel *ast, char *dest, int timeout)
 
        tmp = ast_mutex_unlock(&p->lock);
 /*
-       if (option_verbose > 3) ast_verbose("%s: unLOCKING in call [%d]\n", p->dev,tmp);
+       ast_verb(4, "%s: unLOCKING in call [%d]\n", p->dev,tmp);
 */
        return res;
 }
@@ -1989,19 +1921,18 @@ static int vpb_hangup(struct ast_channel *ast)
        int res =0 ;
 
 /*
-       if (option_verbose > 3) ast_verbose("%s: LOCKING in hangup \n", p->dev);
-       if (option_verbose > 3) ast_verbose("%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
-       if (option_verbose > 3) ast_verbose("%s: LOCKING pthread_self(%d)\n", p->dev,pthread_self());
+       ast_verb(4, "%s: LOCKING in hangup \n", p->dev);
+       ast_verb(4, "%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+       ast_verb(4, "%s: LOCKING pthread_self(%d)\n", p->dev,pthread_self());
        ast_mutex_lock(&p->lock);
 */
-       if (option_verbose > 1) 
-               ast_verbose(VERBOSE_PREFIX_2 "%s: Hangup requested\n", ast->name);
+       ast_verb(2, "%s: Hangup requested\n", ast->name);
 
        if (!ast->tech || !ast->tech_pvt) {
                ast_log(LOG_WARNING, "%s: channel not connected?\n", ast->name);
                res = ast_mutex_unlock(&p->lock);
 /*
-               if (option_verbose > 3) ast_verbose("%s: unLOCKING in hangup [%d]\n", p->dev,res);
+               ast_verb(4, "%s: unLOCKING in hangup [%d]\n", p->dev,res);
 */
                /* Free up ast dsp if we have one */
                if ((use_ast_dtmfdet)&&(p->vad)) {
@@ -2017,29 +1948,26 @@ static int vpb_hangup(struct ast_channel *ast)
        p->stopreads = 1;
        if( p->readthread ){
                pthread_join(p->readthread, NULL); 
-               if(option_verbose>3) 
-                       ast_verbose( VERBOSE_PREFIX_4 "%s: stopped record thread \n",ast->name);
+               ast_verb(4, "%s: stopped record thread \n",ast->name);
        }
 
        /* Stop play */
        if (p->lastoutput != -1) {
-               if(option_verbose>1) 
-                       ast_verbose( VERBOSE_PREFIX_2 "%s: Ending play mode \n",ast->name);
+               ast_verb(2, "%s: Ending play mode \n",ast->name);
                vpb_play_terminate(p->handle);
                ast_mutex_lock(&p->play_lock); {
                        vpb_play_buf_finish(p->handle);
                } ast_mutex_unlock(&p->play_lock);
        }
 
-       if(option_verbose>3) 
-               ast_verbose( VERBOSE_PREFIX_4 "%s: Setting state down\n",ast->name);
+       ast_verb(4, "%s: Setting state down\n",ast->name);
        ast_setstate(ast,AST_STATE_DOWN);
 
 
 /*
-       if (option_verbose > 3) ast_verbose("%s: LOCKING in hangup \n", p->dev);
-       if (option_verbose > 3) ast_verbose("%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
-       if (option_verbose > 3) ast_verbose("%s: LOCKING pthread_self(%d)\n", p->dev,pthread_self());
+       ast_verb(4, "%s: LOCKING in hangup \n", p->dev);
+       ast_verb(4, "%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+       ast_verb(4, "%s: LOCKING pthread_self(%d)\n", p->dev,pthread_self());
 */
        ast_mutex_lock(&p->lock);
 
@@ -2050,8 +1978,7 @@ static int vpb_hangup(struct ast_channel *ast)
                        /* This is causing a "dial end" "play tone" loop
                        playtone(p->handle, &Busytone); 
                        p->state = VPB_STATE_PLAYBUSY;
-                       if(option_verbose>4) 
-                               ast_verbose( VERBOSE_PREFIX_4 "%s: Station offhook[%d], playing busy tone\n",
+                       ast_verb(5, "%s: Station offhook[%d], playing busy tone\n",
                                                                ast->name,p->state);
                        */
                }
@@ -2069,11 +1996,9 @@ static int vpb_hangup(struct ast_channel *ast)
                p->state=VPB_STATE_ONHOOK;
        }
        while (VPB_OK==vpb_get_event_ch_async(p->handle,&je)){
-               if(option_verbose>3) {
                        vpb_translate_event(&je, str);
-                       ast_verbose( VERBOSE_PREFIX_4 "%s: Flushing event [%d]=>%s\n",ast->name,je.type,str);
+               ast_verb(4, "%s: Flushing event [%d]=>%s\n",ast->name,je.type,str);
                }
-       }
 
        p->readthread = 0;
        p->lastoutput = -1;
@@ -2091,17 +2016,16 @@ static int vpb_hangup(struct ast_channel *ast)
                p->vad = NULL;
        }
 
-       if (option_verbose > 1)
-               ast_verbose(VERBOSE_PREFIX_2 "%s: Hangup complete\n", ast->name);
+       ast_verb(2, "%s: Hangup complete\n", ast->name);
 
        restart_monitor();
 /*
-       if (option_verbose > 3) ast_verbose("%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+       ast_verb(4, "%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
 */
        res = ast_mutex_unlock(&p->lock);
 /*
-       if (option_verbose > 3) ast_verbose("%s: unLOCKING in hangup [%d]\n", p->dev,res);
-       if (option_verbose > 3) ast_verbose("%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+       ast_verb(4, "%s: unLOCKING in hangup [%d]\n", p->dev,res);
+       ast_verb(4, "%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
 */
        return 0;
 }
@@ -2113,17 +2037,15 @@ static int vpb_answer(struct ast_channel *ast)
 /*
        VPB_EVENT je;
        int ret;
-       if (option_verbose > 3) ast_verbose("%s: LOCKING in answer \n", p->dev);
-       if (option_verbose > 3) ast_verbose("%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+       ast_verb(4, "%s: LOCKING in answer \n", p->dev);
+       ast_verb(4, "%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
 */
        ast_mutex_lock(&p->lock);
 
-       if (option_verbose > 3)
-                       ast_verbose(VERBOSE_PREFIX_4 "%s: Answering channel\n",p->dev);
+       ast_verb(4, "%s: Answering channel\n",p->dev);
 
        if (p->mode == MODE_FXO){
-               if (option_verbose > 3)
-                               ast_verbose("%s: Disabling Loop Drop detection\n",p->dev);
+               ast_verb(4, "%s: Disabling Loop Drop detection\n",p->dev);
                vpb_disable_event(p->handle, VPB_MDROP);
        }
 
@@ -2134,21 +2056,14 @@ static int vpb_answer(struct ast_channel *ast)
 /*                     vpb_sleep(500);
                        ret = vpb_get_event_ch_async(p->handle,&je);
                        if ((ret == VPB_OK)&&((je.type != VPB_DROP)&&(je.type != VPB_RING))){
-                               if (option_verbose > 3){
-                                               ast_verbose(VERBOSE_PREFIX_4 "%s: Answer collected a wrong event!!\n",p->dev);
-                               }
+                               ast_verb(4, "%s: Answer collected a wrong event!!\n",p->dev);
                                vpb_put_event(&je);
                        }
 */
                }
                ast_setstate(ast, AST_STATE_UP);
 
-               if(option_verbose>1) 
-/*
-                       ast_verbose( VERBOSE_PREFIX_2 "%s: Answered call from %s on %s [%s]\n", p->dev, 
-                                       p->owner->callerid, ast->name,(p->mode == MODE_FXO)?"FXO":"FXS"); 
-*/
-                       ast_verbose( VERBOSE_PREFIX_2 "%s: Answered call on %s [%s]\n", p->dev,
+               ast_verb(2, "%s: Answered call on %s [%s]\n", p->dev,
                                         ast->name,(p->mode == MODE_FXO)?"FXO":"FXS");
 
                ast->rings = 0;
@@ -2157,25 +2072,21 @@ static int vpb_answer(struct ast_channel *ast)
        /*              ast_verbose("%s: unLOCKING in answer [%d]\n", p->dev,res); */
                        ast_pthread_create(&p->readthread, NULL, do_chanreads, (void *)p);
                } else {
-                       if(option_verbose>3) 
-                               ast_verbose(VERBOSE_PREFIX_4 "%s: Record thread already running!!\n",p->dev);
+                       ast_verb(4, "%s: Record thread already running!!\n",p->dev);
                }
        } else {
-               if(option_verbose>3) {
-                       ast_verbose(VERBOSE_PREFIX_4 "%s: Answered state is up\n",p->dev);
-               }
+               ast_verb(4, "%s: Answered state is up\n",p->dev);
        /*      res = ast_mutex_unlock(&p->lock); */
        /*      ast_verbose("%s: unLOCKING in answer [%d]\n", p->dev,res); */
        }
        vpb_sleep(500);
        if (p->mode == MODE_FXO){
-               if (option_verbose > 3)
-                               ast_verbose("%s: Re-enabling Loop Drop detection\n",p->dev);
+               ast_verb(4, "%s: Re-enabling Loop Drop detection\n",p->dev);
                vpb_enable_event(p->handle,VPB_MDROP);
        }
        res = ast_mutex_unlock(&p->lock);
 /*
-       if(option_verbose>3) ast_verbose("%s: unLOCKING in answer [%d]\n", p->dev,res);
+       ast_verb(4, "%s: unLOCKING in answer [%d]\n", p->dev,res);
 */
        return 0;
 }
@@ -2263,17 +2174,14 @@ static int vpb_write(struct ast_channel *ast, struct ast_frame *frame)
        int tdiff;
 
 /*     ast_mutex_lock(&p->lock); */
-       if(option_verbose>5) 
-               ast_verbose("%s: vpb_write: Writing to channel\n", p->dev);
+       ast_verb(6, "%s: vpb_write: Writing to channel\n", p->dev);
 
        if (frame->frametype != AST_FRAME_VOICE) {
-               if(option_verbose>3) 
-                       ast_verbose("%s: vpb_write: Don't know how to handle from type %d\n", ast->name, frame->frametype);
+               ast_verb(4, "%s: vpb_write: Don't know how to handle from type %d\n", ast->name, frame->frametype);
 /*             ast_mutex_unlock(&p->lock); */
                return 0;
        } else if (ast->_state != AST_STATE_UP) {
-               if(option_verbose>3) 
-                       ast_verbose("%s: vpb_write: Attempt to Write frame type[%d]subclass[%d] on not up chan(state[%d])\n",ast->name, frame->frametype, frame->subclass,ast->_state);
+               ast_verb(4, "%s: vpb_write: Attempt to Write frame type[%d]subclass[%d] on not up chan(state[%d])\n",ast->name, frame->frametype, frame->subclass,ast->_state);
                p->lastoutput = -1;
 /*             ast_mutex_unlock(&p->lock); */
                return 0;
@@ -2307,17 +2215,14 @@ static int vpb_write(struct ast_channel *ast, struct ast_frame *frame)
        /* Check if we have set up the play_buf */
        if (p->lastoutput == -1) {
                vpb_play_buf_start(p->handle, fmt);
-               if(option_verbose>1) {
-                       ast_verbose("%s: vpb_write: Starting play mode (codec=%d)[%s]\n",p->dev,fmt,ast2vpbformatname(frame->subclass));
-               }
+               ast_verb(2, "%s: vpb_write: Starting play mode (codec=%d)[%s]\n",p->dev,fmt,ast2vpbformatname(frame->subclass));
                p->lastoutput = fmt;
                ast_mutex_unlock(&p->play_lock);
                return 0;
        } else if (p->lastoutput != fmt) {
                vpb_play_buf_finish(p->handle);
                vpb_play_buf_start(p->handle, fmt);
-               if(option_verbose>1) 
-                       ast_verbose("%s: vpb_write: Changed play format (%d=>%d)\n",p->dev,p->lastoutput,fmt);
+               ast_verb(2, "%s: vpb_write: Changed play format (%d=>%d)\n",p->dev,p->lastoutput,fmt);
                ast_mutex_unlock(&p->play_lock);
                return 0;
        }
@@ -2336,9 +2241,9 @@ static int vpb_write(struct ast_channel *ast, struct ast_frame *frame)
                play_buf_time_start = ast_tvnow();
 /*             res = vpb_play_buf_sync(p->handle, (char*)frame->data, tdiff*8*2); */
                res = vpb_play_buf_sync(p->handle, (char*)frame->data, frame->datalen);
-               if( res == VPB_OK && option_verbose > 5 ) {
+               if(res == VPB_OK) {
                        short * data = (short*)frame->data;
-                       ast_verbose("%s: vpb_write: Wrote chan (codec=%d) %d %d\n", p->dev, fmt, data[0],data[1]);
+                       ast_verb(6, "%s: vpb_write: Wrote chan (codec=%d) %d %d\n", p->dev, fmt, data[0],data[1]);
                }
                p->play_buf_time = ast_tvdiff_ms(ast_tvnow(), play_buf_time_start);
        }
@@ -2350,8 +2255,7 @@ static int vpb_write(struct ast_channel *ast, struct ast_frame *frame)
 
        ast_mutex_unlock(&p->play_lock);
 /*     ast_mutex_unlock(&p->lock); */
-       if(option_verbose>5) 
-               ast_verbose("%s: vpb_write: Done Writing to channel\n", p->dev);
+       ast_verb(6, "%s: vpb_write: Done Writing to channel\n", p->dev);
        return 0;
 }
 
@@ -2375,19 +2279,15 @@ static void *do_chanreads(void *pvt)
        fr->offset = AST_FRIENDLY_OFFSET;
        memset(p->buf, 0, sizeof p->buf);
 
-       if (option_verbose > 2) {
-               ast_verbose("%s: chanreads: starting thread\n", p->dev);
-       }  
+       ast_verb(3, "%s: chanreads: starting thread\n", p->dev);
        ast_mutex_lock(&p->record_lock);
 
        p->stopreads = 0; 
        p->read_state = 1;
        while (!p->stopreads && p->owner) {
 
-               if (option_verbose > 4)
-                       ast_verbose("%s: chanreads: Starting cycle ...\n", p->dev);
-               if (option_verbose > 4)
-                       ast_verbose("%s: chanreads: Checking bridge \n", p->dev);
+               ast_verb(5, "%s: chanreads: Starting cycle ...\n", p->dev);
+               ast_verb(5, "%s: chanreads: Checking bridge \n", p->dev);
                if (p->bridge) {
                        if (p->bridge->c0 == p->owner && (p->bridge->flags & AST_BRIDGE_REC_CHANNEL_0))
                                bridgerec = 1;
@@ -2396,12 +2296,9 @@ static void *do_chanreads(void *pvt)
                        else 
                                bridgerec = 0;
                } else {
-                       if (option_verbose > 4)
-                               ast_verbose("%s: chanreads: No native bridge.\n", p->dev);
+                       ast_verb(5, "%s: chanreads: No native bridge.\n", p->dev);
                        if (p->owner->_bridge){
-                               if (option_verbose > 4){
-                                       ast_verbose("%s: chanreads: Got Asterisk bridge with [%s].\n", p->dev,p->owner->_bridge->name);
-                               }
+                               ast_verb(5, "%s: chanreads: Got Asterisk bridge with [%s].\n", p->dev,p->owner->_bridge->name);
                                bridgerec = 1;
                        }
                        else {
@@ -2412,12 +2309,10 @@ static void *do_chanreads(void *pvt)
 /*             if ( (p->owner->_state != AST_STATE_UP) || !bridgerec) */
                if ( (p->owner->_state != AST_STATE_UP) ) 
                {
-                       if (option_verbose > 4) {
                                if (p->owner->_state != AST_STATE_UP)
-                                       ast_verbose("%s: chanreads: Im not up[%d]\n", p->dev,p->owner->_state);
+                               ast_verb(5, "%s: chanreads: Im not up[%d]\n", p->dev,p->owner->_state);
                                else
-                                       ast_verbose("%s: chanreads: No bridgerec[%d]\n", p->dev,bridgerec);
-                       }  
+                               ast_verb(5, "%s: chanreads: No bridgerec[%d]\n", p->dev,bridgerec);
                        vpb_sleep(10);
                        continue;
                }
@@ -2433,8 +2328,7 @@ static void *do_chanreads(void *pvt)
                        ignore_dtmf = 0;
 
                if(( ignore_dtmf != p->last_ignore_dtmf ) &&(!use_ast_dtmfdet)){
-                       if(option_verbose>1) 
-                               ast_verbose( VERBOSE_PREFIX_2 "%s:Now %s DTMF \n",
+                       ast_verb(2, "%s:Now %s DTMF \n",
                                        p->dev, ignore_dtmf ? "ignoring" : "listening for");
                        vpb_set_event_mask(p->handle, ignore_dtmf ? VPB_EVENTS_NODTMF : VPB_EVENTS_ALL );
                }
@@ -2443,9 +2337,7 @@ static void *do_chanreads(void *pvt)
                /* Play DTMF digits here to avoid problem you get if playing a digit during 
                 * a record operation
                 */
-               if (option_verbose > 5) {
-                       ast_verbose("%s: chanreads: Checking dtmf's \n", p->dev);
-               }  
+               ast_verb(6, "%s: chanreads: Checking dtmf's \n", p->dev);
                ast_mutex_lock(&p->play_dtmf_lock);
                if( p->play_dtmf[0] ) {
                        /* Try to ignore DTMF event we get after playing digit */
@@ -2454,12 +2346,10 @@ static void *do_chanreads(void *pvt)
                                vpb_set_event_mask(p->handle, VPB_EVENTS_NODTMF );
                        if (p->bridge == NULL){
                                vpb_dial_sync(p->handle,p->play_dtmf);
-                               if(option_verbose>1) 
-                                       ast_verbose( VERBOSE_PREFIX_2 "%s: chanreads: Played DTMF %s\n",p->dev,p->play_dtmf);
+                               ast_verb(2, "%s: chanreads: Played DTMF %s\n",p->dev,p->play_dtmf);
                        }
                        else {
-                               if (option_verbose > 1) 
-                                       ast_verbose(VERBOSE_PREFIX_2 "%s: chanreads: Not playing DTMF frame on native bridge\n", p->dev);
+                               ast_verb(2, "%s: chanreads: Not playing DTMF frame on native bridge\n", p->dev);
                        }
                        p->play_dtmf[0] = '\0';
                        ast_mutex_unlock(&p->play_dtmf_lock);
@@ -2490,32 +2380,24 @@ static void *do_chanreads(void *pvt)
                        vpb_record_buf_start(p->handle, fmt);
                        vpb_reset_record_fifo_alarm(p->handle);
                        p->lastinput = fmt;
-                       if(option_verbose>1) 
-                               ast_verbose( VERBOSE_PREFIX_2 "%s: Starting record mode (codec=%d)[%s]\n",p->dev,fmt,ast2vpbformatname(afmt));
+                       ast_verb(2, "%s: Starting record mode (codec=%d)[%s]\n",p->dev,fmt,ast2vpbformatname(afmt));
                        continue;
                } else if (p->lastinput != fmt) {
                        vpb_record_buf_finish(p->handle);
                        vpb_record_buf_start(p->handle, fmt);
                        p->lastinput = fmt;
-                       if(option_verbose>1) 
-                               ast_verbose( VERBOSE_PREFIX_2 "%s: Changed record format (%d=>%d)\n",p->dev,p->lastinput,fmt);
+                       ast_verb(2, "%s: Changed record format (%d=>%d)\n",p->dev,p->lastinput,fmt);
                        continue;
                }
 
                /* Read only if up and not bridged, or a bridge for which we can read. */
-               if (option_verbose > 5) {
-                       ast_verbose("%s: chanreads: getting buffer!\n", p->dev);
-               }  
+               ast_verb(6, "%s: chanreads: getting buffer!\n", p->dev);
                if( (res = vpb_record_buf_sync(p->handle, readbuf, readlen) ) == VPB_OK ) {
-                       if (option_verbose > 5) {
-                               ast_verbose("%s: chanreads: got buffer!\n", p->dev);
-                       }  
+                       ast_verb(6, "%s: chanreads: got buffer!\n", p->dev);
                        /* Apply extra gain ! */
                        if( p->rxswgain > MAX_VPB_GAIN )
                                a_gain_vector(p->rxswgain - MAX_VPB_GAIN , (short*)readbuf, readlen/sizeof(short));
-                       if (option_verbose > 5) {
-                               ast_verbose("%s: chanreads: applied gain\n", p->dev);
-                       }  
+                       ast_verb(6, "%s: chanreads: applied gain\n", p->dev);
 
                        fr->subclass = afmt;
                        fr->data = readbuf;
@@ -2543,9 +2425,7 @@ static void *do_chanreads(void *pvt)
                         * (ast_hangup() immediately gets lock)
                         */
                        if (p->owner && !p->stopreads ) {
-                               if (option_verbose > 5) {
-                                       ast_verbose("%s: chanreads: queueing buffer on read frame q (state[%d])\n", p->dev,p->owner->_state);
-                               }  
+                               ast_verb(6, "%s: chanreads: queueing buffer on read frame q (state[%d])\n", p->dev,p->owner->_state);
                                do {
                                        res = ast_mutex_trylock(&p->owner->lock);
                                        trycnt++;
@@ -2554,8 +2434,7 @@ static void *do_chanreads(void *pvt)
                                        ast_queue_frame(p->owner, fr);
                                        ast_mutex_unlock(&p->owner->lock);
                                } else {
-                                       if (option_verbose > 4) 
-                                               ast_verbose("%s: chanreads: Couldnt get lock after %d tries!\n", p->dev,trycnt);
+                                       ast_verb(5, "%s: chanreads: Couldnt get lock after %d tries!\n", p->dev,trycnt);
                                }
                                trycnt=0;
                                
@@ -2566,9 +2445,9 @@ static void *do_chanreads(void *pvt)
                                        ast_mutex_unlock(&p->owner->lock);
                                } else {
                                        if (res == EINVAL )
-                                               if (option_verbose > 4) ast_verbose("%s: chanreads: try owner->lock gave me EINVAL[%d]\n", p->dev,res);
+                                               ast_verb(5, "%s: chanreads: try owner->lock gave me EINVAL[%d]\n", p->dev,res);
                                        else if (res == EBUSY )
-                                               if (option_verbose > 4) ast_verbose("%s: chanreads: try owner->lock gave me EBUSY[%d]\n", p->dev,res);
+                                               ast_verb(5, "%s: chanreads: try owner->lock gave me EBUSY[%d]\n", p->dev,res);
                                        while(res !=0){
                                        res = ast_mutex_trylock(&p->owner->lock);
                                        }
@@ -2578,27 +2457,22 @@ static void *do_chanreads(void *pvt)
                                        }
                                        else {
                                                if (res == EINVAL )
-                                                       if (option_verbose > 4) ast_verbose("%s: chanreads: try owner->lock gave me EINVAL[%d]\n", p->dev,res);
+                                                       ast_verb(5, "%s: chanreads: try owner->lock gave me EINVAL[%d]\n", p->dev,res);
                                                else if (res == EBUSY )
-                                                       if (option_verbose > 4) ast_verbose("%s: chanreads: try owner->lock gave me EBUSY[%d]\n", p->dev,res);
-                                               if (option_verbose > 4) ast_verbose("%s: chanreads: Couldnt get lock on owner[%s][%d][%d] channel to send frame!\n", p->dev,p->owner->name,(int)p->owner->lock.__m_owner,(int)p->owner->lock.__m_count);
+                                                       ast_verb(5, "%s: chanreads: try owner->lock gave me EBUSY[%d]\n", p->dev,res);
+                                               ast_verb(5, "%s: chanreads: Couldnt get lock on owner[%s][%d][%d] channel to send frame!\n", p->dev,p->owner->name,(int)p->owner->lock.__m_owner,(int)p->owner->lock.__m_count);
                                        }
                                }
 */
-                               if (option_verbose > 6) {
                                        short * data = (short*)readbuf;
-                                       ast_verbose("%s: Read channel (codec=%d) %d %d\n", p->dev, fmt, data[0], data[1] );
+                               ast_verb(7, "%s: Read channel (codec=%d) %d %d\n", p->dev, fmt, data[0], data[1] );
                                }  
-                       }
                        else {
-                               if (option_verbose > 4) {
-                                       ast_verbose("%s: p->stopreads[%d] p->owner[%p]\n", p->dev, p->stopreads,(void *)p->owner);
+                               ast_verb(5, "%s: p->stopreads[%d] p->owner[%p]\n", p->dev, p->stopreads,(void *)p->owner);
                                }  
                        }
+               ast_verb(5, "%s: chanreads: Finished cycle...\n", p->dev);
                }
-               if (option_verbose > 4)
-                       ast_verbose("%s: chanreads: Finished cycle...\n", p->dev);
-       }
        p->read_state=0;
 
        /* When stopreads seen, go away! */
@@ -2606,8 +2480,7 @@ static void *do_chanreads(void *pvt)
        p->read_state=0;
        ast_mutex_unlock(&p->record_lock);
 
-       if (option_verbose > 1)
-               ast_verbose(VERBOSE_PREFIX_2 "%s: Ending record mode (%d/%s)\n",
+       ast_verb(2, "%s: Ending record mode (%d/%s)\n",
                         p->dev, p->stopreads, p->owner? "yes" : "no");     
        return NULL;
 }
@@ -2622,8 +2495,7 @@ static struct ast_channel *vpb_new(struct vpb_pvt *me, enum ast_channel_state st
            ast_log(LOG_WARNING, "Called vpb_new on owned channel (%s) ?!\n", me->dev);
            return NULL;
        }
-       if (option_verbose > 3)
-               ast_verbose("%s: New call for context [%s]\n",me->dev,context);
+       ast_verb(4, "%s: New call for context [%s]\n",me->dev,context);
            
        tmp = ast_channel_alloc(1, state, 0, 0, "", me->ext, me->context, 0, me->dev);
        if (tmp) {
@@ -2736,9 +2608,7 @@ static struct ast_channel *vpb_request(const char *type, int format, void *data,
        } ast_mutex_unlock(&iflock);
 
 
-       if (option_verbose > 1) 
-               ast_verbose(VERBOSE_PREFIX_2 " %s requested, got: [%s]\n",
-               name, tmp ? tmp->name : "None");
+       ast_verb(2, " %s requested, got: [%s]\n", name, tmp ? tmp->name : "None");
 
        ast_free(name);
 
index 182eb5559f3d944b4f4a114afd9123f97ef430cb..323a7f08e80aadab01f50af0a9d08b5c21dacfa8 100644 (file)
@@ -1848,8 +1848,7 @@ static int send_cwcidspill(struct zt_pvt *p)
        p->cidlen += READ_SIZE * 4;
        p->cidpos = 0;
        send_callerid(p);
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "CPE supports Call Waiting Caller*ID.  Sending '%s/%s'\n", p->callwait_name, p->callwait_num);
+       ast_verb(3, "CPE supports Call Waiting Caller*ID.  Sending '%s/%s'\n", p->callwait_name, p->callwait_num);
        return 0;
 }
 
@@ -2385,8 +2384,7 @@ static int zt_call(struct ast_channel *ast, char *rdest, int timeout)
                if (p->pri->facilityenable)
                        pri_facility_enable(p->pri->pri);
 
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Requested transfer capability: 0x%.2x - %s\n", ast->transfercapability, ast_transfercapability2str(ast->transfercapability));
+               ast_verb(3, "Requested transfer capability: 0x%.2x - %s\n", ast->transfercapability, ast_transfercapability2str(ast->transfercapability));
                dp_strip = 0;
                pridialplan = p->pri->dialplan - 1;
                if (pridialplan == -2 || pridialplan == -3) { /* compute dynamically */
@@ -2995,8 +2993,7 @@ static int zt_hangup(struct ast_channel *ast)
        ast->tech_pvt = NULL;
        ast_mutex_unlock(&p->lock);
        ast_module_unref(ast_module_info->self);
-       if (option_verbose > 2) 
-               ast_verbose( VERBOSE_PREFIX_3 "Hungup '%s'\n", ast->name);
+       ast_verb(3, "Hungup '%s'\n", ast->name);
 
        ast_mutex_lock(&iflock);
        tmp = iflist;
@@ -3613,8 +3610,7 @@ static enum ast_bridge_result zt_bridge(struct ast_channel *c0, struct ast_chann
                return AST_BRIDGE_FAILED;
        }
        
-       if (option_verbose > 2) 
-               ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name);
+       ast_verb(3, "Native bridging %s and %s\n", c0->name, c1->name);
 
        if (!(flags & AST_BRIDGE_DTMF_CHANNEL_0) && (oi0 == SUB_REAL))
                disable_dtmf_detect(op0);
@@ -3865,8 +3861,7 @@ static int check_for_conference(struct zt_pvt *p)
           if we're in a conference, it's probably a MeetMe room or
           some such, so don't let us 3-way out! */
        if ((p->subs[SUB_REAL].curconf.confno != ci.confno) || (p->subs[SUB_REAL].curconf.confmode != ci.confmode)) {
-               if (option_verbose > 2) 
-                       ast_verbose(VERBOSE_PREFIX_3 "Avoiding 3-way call when in an external conference\n");
+               ast_verb(3, "Avoiding 3-way call when in an external conference\n");
                return 1;
        }
        return 0;
@@ -3922,8 +3917,7 @@ static void zt_handle_dtmfup(struct ast_channel *ast, int index, struct ast_fram
                                const char *target_context = S_OR(ast->macrocontext, ast->context);
 
                                if (ast_exists_extension(ast, target_context, "fax", 1, ast->cid.cid_num)) {
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "Redirecting %s to fax extension\n", ast->name);
+                                       ast_verb(3, "Redirecting %s to fax extension\n", ast->name);
                                        /* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
                                        pbx_builtin_setvar_helper(ast, "FAXEXTEN", ast->exten);
                                        if (ast_async_goto(ast, target_context, "fax", 1))
@@ -4017,8 +4011,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
        switch (res) {
 #ifdef ZT_EVENT_EC_DISABLED
                case ZT_EVENT_EC_DISABLED:
-                       if (option_verbose > 2) 
-                               ast_verbose(VERBOSE_PREFIX_3 "Channel %d echo canceler disabled due to CED detection\n", p->channel);
+                       ast_verb(3, "Channel %d echo canceler disabled due to CED detection\n", p->channel);
                        p->echocanon = 0;
                        break;
 #endif
@@ -4140,8 +4133,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
                                        if (p->subs[SUB_CALLWAIT].owner) {
                                                /* There's a call waiting call, so ring the phone, but make it unowned in the mean time */
                                                swap_subs(p, SUB_CALLWAIT, SUB_REAL);
-                                               if (option_verbose > 2) 
-                                                       ast_verbose(VERBOSE_PREFIX_3 "Channel %d still has (callwait) call, ringing phone\n", p->channel);
+                                               ast_verb(3, "Channel %d still has (callwait) call, ringing phone\n", p->channel);
                                                unalloc_sub(p, SUB_CALLWAIT);   
 #if 0
                                                p->subs[index].needanswer = 0;
@@ -4555,8 +4547,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
                                                        zt_enable_ec(p);
                                                        ast_hangup(chan);
                                                } else {
-                                                       if (option_verbose > 2) 
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Started three way call on channel %d\n", p->channel);
+                                                       ast_verb(3, "Started three way call on channel %d\n", p->channel);
                                                        /* Start music on hold if appropriate */
                                                        if (ast_bridged_channel(p->subs[SUB_THREEWAY].owner)) {
                                                                ast_queue_control_data(p->subs[SUB_THREEWAY].owner, AST_CONTROL_HOLD,
@@ -4578,8 +4569,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
                                                        p->owner = p->subs[SUB_REAL].owner;
                                                }
                                                /* Drop the last call and stop the conference */
-                                               if (option_verbose > 2)
-                                                       ast_verbose(VERBOSE_PREFIX_3 "Dropping three-way call on %s\n", p->subs[SUB_THREEWAY].owner->name);
+                                               ast_verb(3, "Dropping three-way call on %s\n", p->subs[SUB_THREEWAY].owner->name);
                                                p->subs[SUB_THREEWAY].owner->_softhangup |= AST_SOFTHANGUP_DEV;
                                                p->subs[SUB_REAL].inthreeway = 0;
                                                p->subs[SUB_THREEWAY].inthreeway = 0;
@@ -4589,8 +4579,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
                                                    (p->transfertobusy || (ast->_state != AST_STATE_BUSY))) {
                                                        int otherindex = SUB_THREEWAY;
 
-                                                       if (option_verbose > 2)
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Building conference on call on %s and %s\n", p->subs[SUB_THREEWAY].owner->name, p->subs[SUB_REAL].owner->name);
+                                                       ast_verb(3, "Building conference on call on %s and %s\n", p->subs[SUB_THREEWAY].owner->name, p->subs[SUB_REAL].owner->name);
                                                        /* Put them in the threeway, and flip */
                                                        p->subs[SUB_THREEWAY].inthreeway = 1;
                                                        p->subs[SUB_REAL].inthreeway = 1;
@@ -4608,8 +4597,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
                                                                res = tone_zone_play_tone(p->subs[SUB_THREEWAY].zfd, ZT_TONE_RINGTONE);
                                                        }
                                                } else {
-                                                       if (option_verbose > 2)
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Dumping incomplete call on on %s\n", p->subs[SUB_THREEWAY].owner->name);
+                                                       ast_verb(3, "Dumping incomplete call on on %s\n", p->subs[SUB_THREEWAY].owner->name);
                                                        swap_subs(p, SUB_THREEWAY, SUB_REAL);
                                                        p->subs[SUB_THREEWAY].owner->_softhangup |= AST_SOFTHANGUP_DEV;
                                                        p->owner = p->subs[SUB_REAL].owner;
@@ -4814,8 +4802,7 @@ static struct ast_frame *__zt_exception(struct ast_channel *ast)
                case ZT_EVENT_ONHOOK:
                        zt_disable_ec(p);
                        if (p->owner) {
-                               if (option_verbose > 2) 
-                                       ast_verbose(VERBOSE_PREFIX_3 "Channel %s still has call, ringing phone\n", p->owner->name);
+                               ast_verb(3, "Channel %s still has call, ringing phone\n", p->owner->name);
                                zt_ring_phone(p);
                                p->callwaitingrepeat = 0;
                                p->cidcwexpire = 0;
@@ -4838,8 +4825,7 @@ static struct ast_frame *__zt_exception(struct ast_channel *ast)
                case ZT_EVENT_WINKFLASH:
                        p->flashtime = ast_tvnow();
                        if (p->owner) {
-                               if (option_verbose > 2) 
-                                       ast_verbose(VERBOSE_PREFIX_3 "Channel %d flashed to other channel %s\n", p->channel, p->owner->name);
+                               ast_verb(3, "Channel %d flashed to other channel %s\n", p->channel, p->owner->name);
                                if (p->owner->_state != AST_STATE_UP) {
                                        /* Answer if necessary */
                                        usedindex = zt_get_index(p->owner, p, 0);
@@ -5099,8 +5085,7 @@ static struct ast_frame  *zt_read(struct ast_channel *ast)
        }
        /* Expire CID/CW */
        if (p->cidcwexpire == 1) {
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "CPE does not support Call Waiting Caller*ID.\n");
+               ast_verb(3, "CPE does not support Call Waiting Caller*ID.\n");
                restore_conference(p);
        }
        if (p->subs[index].linear) {
@@ -5745,8 +5730,7 @@ static void *ss_thread(void *data)
                return NULL;
        }
 
-       if (option_verbose > 2) 
-               ast_verbose( VERBOSE_PREFIX_3 "Starting simple switch on '%s'\n", chan->name);
+       ast_verb(3, "Starting simple switch on '%s'\n", chan->name);
        index = zt_get_index(chan, p, 1);
        if (index < 0) {
                ast_log(LOG_WARNING, "Huh?\n");
@@ -5784,8 +5768,7 @@ static void *ss_thread(void *data)
                }
                /* if no extension was received ('unspecified') on overlap call, use the 's' extension */
                if (ast_strlen_zero(exten)) {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Going to extension s|1 because of empty extension received on overlap call\n");
+                       ast_verb(3, "Going to extension s|1 because of empty extension received on overlap call\n");
                        exten[0] = 's';
                        exten[1] = '\0';
                }
@@ -6061,8 +6044,7 @@ static void *ss_thread(void *data)
                        }
                        return NULL;
                } else {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_2 "Unknown extension '%s' in context '%s' requested\n", exten, chan->context);
+                       ast_verb(2, "Unknown extension '%s' in context '%s' requested\n", exten, chan->context);
                        sleep(2);
                        res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_INFO);
                        if (res < 0)
@@ -6112,8 +6094,7 @@ static void *ss_thread(void *data)
                                        if (getforward) {
                                                /* Record this as the forwarding extension */
                                                ast_copy_string(p->call_forward, exten, sizeof(p->call_forward)); 
-                                               if (option_verbose > 2)
-                                                       ast_verbose(VERBOSE_PREFIX_3 "Setting call forward to '%s' on channel %d\n", p->call_forward, p->channel);
+                                               ast_verb(3, "Setting call forward to '%s' on channel %d\n", p->call_forward, p->channel);
                                                res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
                                                if (res)
                                                        break;
@@ -6158,8 +6139,7 @@ static void *ss_thread(void *data)
                                ast_hangup(chan);
                                return NULL;
                        } else if (p->callwaiting && !strcmp(exten, "*70")) {
-                               if (option_verbose > 2) 
-                                       ast_verbose(VERBOSE_PREFIX_3 "Disabling call waiting on %s\n", chan->name);
+                               ast_verb(3, "Disabling call waiting on %s\n", chan->name);
                                /* Disable call waiting if enabled */
                                p->callwaiting = 0;
                                res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
@@ -6201,8 +6181,7 @@ static void *ss_thread(void *data)
                                }
                                
                        } else if (!p->hidecallerid && !strcmp(exten, "*67")) {
-                               if (option_verbose > 2) 
-                                       ast_verbose(VERBOSE_PREFIX_3 "Disabling Caller*ID on %s\n", chan->name);
+                               ast_verb(3, "Disabling Caller*ID on %s\n", chan->name);
                                /* Disable Caller*ID if enabled */
                                p->hidecallerid = 1;
                                if (chan->cid.cid_num)
@@ -6229,8 +6208,7 @@ static void *ss_thread(void *data)
                                break;
                        } else if (!strcmp(exten, "*78")) {
                                /* Do not disturb */
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Enabled DND on channel %d\n", p->channel);
+                               ast_verb(3, "Enabled DND on channel %d\n", p->channel);
                                manager_event(EVENT_FLAG_SYSTEM, "DNDState",
                                                        "Channel: Zap/%d\r\n"
                                                        "Status: enabled\r\n", p->channel);
@@ -6241,8 +6219,7 @@ static void *ss_thread(void *data)
                                len = 0;
                        } else if (!strcmp(exten, "*79")) {
                                /* Do not disturb */
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Disabled DND on channel %d\n", p->channel);
+                               ast_verb(3, "Disabled DND on channel %d\n", p->channel);
                                manager_event(EVENT_FLAG_SYSTEM, "DNDState",
                                                        "Channel: Zap/%d\r\n"
                                                        "Status: disabled\r\n", p->channel);
@@ -6257,8 +6234,7 @@ static void *ss_thread(void *data)
                                memset(exten, 0, sizeof(exten));
                                len = 0;
                        } else if (p->cancallforward && !strcmp(exten, "*73")) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Cancelling call forwarding on channel %d\n", p->channel);
+                               ast_verb(3, "Cancelling call forwarding on channel %d\n", p->channel);
                                res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
                                memset(p->call_forward, 0, sizeof(p->call_forward));
                                getforward = 0;
@@ -6270,12 +6246,10 @@ static void *ss_thread(void *data)
                                /* This is a three way call, the main call being a real channel, 
                                        and we're parking the first call. */
                                ast_masq_park_call(ast_bridged_channel(p->subs[SUB_THREEWAY].owner), chan, 0, NULL);
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Parking call to '%s'\n", chan->name);
+                               ast_verb(3, "Parking call to '%s'\n", chan->name);
                                break;
                        } else if (!ast_strlen_zero(p->lastcid_num) && !strcmp(exten, "*60")) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Blacklisting number %s\n", p->lastcid_num);
+                               ast_verb(3, "Blacklisting number %s\n", p->lastcid_num);
                                res = ast_db_put("blacklist", p->lastcid_num, "1");
                                if (!res) {
                                        res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
@@ -6283,8 +6257,7 @@ static void *ss_thread(void *data)
                                        len = 0;
                                }
                        } else if (p->hidecallerid && !strcmp(exten, "*82")) {
-                               if (option_verbose > 2) 
-                                       ast_verbose(VERBOSE_PREFIX_3 "Enabling Caller*ID on %s\n", chan->name);
+                               ast_verb(3, "Enabling Caller*ID on %s\n", chan->name);
                                /* Enable Caller*ID if enabled */
                                p->hidecallerid = 0;
                                if (chan->cid.cid_num)
@@ -6603,23 +6576,22 @@ static void *ss_thread(void *data)
                                                                }
                                                        }
                                                }
-                                               if (option_verbose > 2)
                                                        /* this only shows up if you have n of the dring patterns filled in */
-                                                       ast_verbose( VERBOSE_PREFIX_3 "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
+                                               ast_verb(3, "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
                                                for (counter = 0; counter < 3; counter++) {
                                                        /* Check to see if the rings we received match any of the ones in zapata.conf for this
                                                        channel */
                                                        distMatches = 0;
                                                        for (counter1 = 0; counter1 < 3; counter1++) {
-                                                               ast_verbose( VERBOSE_PREFIX_3 "Ring pattern check range: %d\n", p->drings.ringnum[counter].range);
+                                                               ast_verb(3, "Ring pattern check range: %d\n", p->drings.ringnum[counter].range);
                                                                if (p->drings.ringnum[counter].ring[counter1] == -1) {
-                                                                       ast_verbose( VERBOSE_PREFIX_3 "Pattern ignore (-1) detected, so matching pattern %d regardless.\n",
+                                                                       ast_verb(3, "Pattern ignore (-1) detected, so matching pattern %d regardless.\n",
                                                                        curRingData[counter1]);
                                                                        distMatches++;
                                                                }
                                                                else if (curRingData[counter1] <= (p->drings.ringnum[counter].ring[counter1] + p->drings.ringnum[counter].range) &&
                                                                    curRingData[counter1] >= (p->drings.ringnum[counter].ring[counter1] - p->drings.ringnum[counter].range)) {
-                                                                       ast_verbose( VERBOSE_PREFIX_3 "Ring pattern matched in range: %d to %d\n",
+                                                                       ast_verb(3, "Ring pattern matched in range: %d to %d\n",
                                                                        (p->drings.ringnum[counter].ring[counter1] - p->drings.ringnum[counter].range),
                                                                        (p->drings.ringnum[counter].ring[counter1] + p->drings.ringnum[counter].range));
                                                                        distMatches++;
@@ -6630,8 +6602,7 @@ static void *ss_thread(void *data)
                                                                /* The ring matches, set the context to whatever is for distinctive ring.. */
                                                                ast_copy_string(p->context, p->drings.ringContext[counter].contextData, sizeof(p->context));
                                                                ast_copy_string(chan->context, p->drings.ringContext[counter].contextData, sizeof(chan->context));
-                                                               if (option_verbose > 2)
-                                                                       ast_verbose( VERBOSE_PREFIX_3 "Distinctive Ring matched context %s\n",p->context);
+                                                               ast_verb(3, "Distinctive Ring matched context %s\n",p->context);
                                                                break;
                                                        }
                                                }
@@ -6775,8 +6746,7 @@ static void *ss_thread(void *data)
                                                curRingData[receivedRingT] = 0;
                                        }
                                        receivedRingT = 0;
-                                       if (option_verbose > 2)
-                                               ast_verbose( VERBOSE_PREFIX_3 "Detecting post-CID distinctive ring\n");
+                                       ast_verb(3, "Detecting post-CID distinctive ring\n");
                                        for (;;) {
                                                i = ZT_IOMUX_READ | ZT_IOMUX_SIGEVENT;
                                                if ((res = ioctl(p->subs[index].zfd, ZT_IOMUX, &i)))    {
@@ -6820,30 +6790,28 @@ static void *ss_thread(void *data)
                                        }
                                }
                                if (p->usedistinctiveringdetection == 1) {
-                                       if (option_verbose > 2)
                                                /* this only shows up if you have n of the dring patterns filled in */
-                                               ast_verbose( VERBOSE_PREFIX_3 "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
+                                       ast_verb(3, "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
 
                                        for (counter = 0; counter < 3; counter++) {
                                                /* Check to see if the rings we received match any of the ones in zapata.conf for this
                                                channel */
-                                               if (option_verbose > 2)
                                                        /* this only shows up if you have n of the dring patterns filled in */
-                                                       ast_verbose( VERBOSE_PREFIX_3 "Checking %d,%d,%d\n",
+                                               ast_verb(3, "Checking %d,%d,%d\n",
                                                                p->drings.ringnum[counter].ring[0],
                                                                p->drings.ringnum[counter].ring[1],
                                                                p->drings.ringnum[counter].ring[2]);
                                                distMatches = 0;
                                                for (counter1 = 0; counter1 < 3; counter1++) {
-                                                       ast_verbose( VERBOSE_PREFIX_3 "Ring pattern check range: %d\n", p->drings.ringnum[counter].range);
+                                                       ast_verb(3, "Ring pattern check range: %d\n", p->drings.ringnum[counter].range);
                                                        if (p->drings.ringnum[counter].ring[counter1] == -1) {
-                                                               ast_verbose( VERBOSE_PREFIX_3 "Pattern ignore (-1) detected, so matching pattern %d regardless.\n",
+                                                               ast_verb(3, "Pattern ignore (-1) detected, so matching pattern %d regardless.\n",
                                                                curRingData[counter1]);
                                                                distMatches++;
                                                        }
                                                        else if (curRingData[counter1] <= (p->drings.ringnum[counter].ring[counter1] + p->drings.ringnum[counter].range) &&
                                                            curRingData[counter1] >= (p->drings.ringnum[counter].ring[counter1] - p->drings.ringnum[counter].range)) {
-                                                               ast_verbose( VERBOSE_PREFIX_3 "Ring pattern matched in range: %d to %d\n",
+                                                               ast_verb(3, "Ring pattern matched in range: %d to %d\n",
                                                                (p->drings.ringnum[counter].ring[counter1] - p->drings.ringnum[counter].range),
                                                                (p->drings.ringnum[counter].ring[counter1] + p->drings.ringnum[counter].range));
                                                                distMatches++;
@@ -6853,8 +6821,7 @@ static void *ss_thread(void *data)
                                                        /* The ring matches, set the context to whatever is for distinctive ring.. */
                                                        ast_copy_string(p->context, p->drings.ringContext[counter].contextData, sizeof(p->context));
                                                        ast_copy_string(chan->context, p->drings.ringContext[counter].contextData, sizeof(chan->context));
-                                                       if (option_verbose > 2)
-                                                               ast_verbose( VERBOSE_PREFIX_3 "Distinctive Ring matched context %s\n",p->context);
+                                                       ast_verb(3, "Distinctive Ring matched context %s\n",p->context);
                                                        break;
                                                }
                                        }
@@ -7102,7 +7069,7 @@ static int handle_init_event(struct zt_pvt *i, int event)
                case SIG_FXSGS:
                        if (i->cid_start == CID_START_POLARITY || i->cid_start == CID_START_POLARITY_IN) {
                                i->polarity = POLARITY_REV;
-                               ast_verbose(VERBOSE_PREFIX_2 "Starting post polarity "
+                               ast_verb(2, "Starting post polarity "
                                            "CID detection on channel %d\n",
                                            i->channel);
                                chan = zt_new(i, AST_STATE_PRERING, 0, SUB_REAL, 0, 0);
@@ -8490,7 +8457,7 @@ static void ss7_start_call(struct zt_pvt *p, struct zt_ss7 *linkset)
        c = zt_new(p, AST_STATE_RING, 1, SUB_REAL, law, 0);
        ast_mutex_lock(&linkset->lock);
        if (c)
-               ast_verbose(VERBOSE_PREFIX_3 "Accepting call to '%s' on CIC %d\n", p->exten, p->cic);
+               ast_verb(3, "Accepting call to '%s' on CIC %d\n", p->exten, p->cic);
        else
                ast_log(LOG_WARNING, "Unable to start PBX on CIC %d\n", p->cic);
 }
@@ -9002,8 +8969,7 @@ static int pri_fixup_principle(struct zt_pri *pri, int principle, q931_call *c)
                if (pri->pvts[x]->call == c) {
                        /* Found our call */
                        if (principle != x) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Moving call from channel %d to channel %d\n",
+                               ast_verb(3, "Moving call from channel %d to channel %d\n",
                                                pri->pvts[x]->channel, pri->pvts[principle]->channel);
                                if (pri->pvts[principle]->owner) {
                                        ast_log(LOG_WARNING, "Can't fix up channel from %d to %d because %d is already in use\n",
@@ -9066,8 +9032,7 @@ static void *do_idle_thread(void *vchan)
        char ex[80];
        /* Wait up to 30 seconds for an answer */
        int newms, ms = 30000;
-       if (option_verbose > 2) 
-               ast_verbose(VERBOSE_PREFIX_3 "Initiating idle call on channel %s\n", chan->name);
+       ast_verb(3, "Initiating idle call on channel %s\n", chan->name);
        snprintf(ex, sizeof(ex), "%d/%s", pvt->channel, pvt->pri->idledial);
        if (ast_call(chan, ex, 0)) {
                ast_log(LOG_WARNING, "Idle dial failed on '%s' to '%s'\n", chan->name, ex);
@@ -9087,18 +9052,15 @@ static void *do_idle_thread(void *vchan)
                                ast_copy_string(chan->exten, pvt->pri->idleext, sizeof(chan->exten));
                                ast_copy_string(chan->context, pvt->pri->idlecontext, sizeof(chan->context));
                                chan->priority = 1;
-                               if (option_verbose > 3) 
-                                       ast_verbose(VERBOSE_PREFIX_3 "Idle channel '%s' answered, sending to %s@%s\n", chan->name, chan->exten, chan->context);
+                               ast_verb(4, "Idle channel '%s' answered, sending to %s@%s\n", chan->name, chan->exten, chan->context);
                                ast_pbx_run(chan);
                                /* It's already hungup, return immediately */
                                return NULL;
                        case AST_CONTROL_BUSY:
-                               if (option_verbose > 3) 
-                                       ast_verbose(VERBOSE_PREFIX_3 "Idle channel '%s' busy, waiting...\n", chan->name);
+                               ast_verb(4, "Idle channel '%s' busy, waiting...\n", chan->name);
                                break;
                        case AST_CONTROL_CONGESTION:
-                               if (option_verbose > 3) 
-                                       ast_verbose(VERBOSE_PREFIX_3 "Idle channel '%s' congested, waiting...\n", chan->name);
+                               ast_verb(4, "Idle channel '%s' congested, waiting...\n", chan->name);
                                break;
                        };
                }
@@ -9497,8 +9459,7 @@ static void *pri_dchannel(void *vpri)
 
                        switch (e->e) {
                        case PRI_EVENT_DCHAN_UP:
-                               if (option_verbose > 1) 
-                                       ast_verbose(VERBOSE_PREFIX_2 "%s D-Channel on span %d up\n", pri_order(which), pri->span);
+                               ast_verb(2, "%s D-Channel on span %d up\n", pri_order(which), pri->span);
                                pri->dchanavail[which] |= DCHAN_UP;
                                if (!pri->pri) pri_find_dchan(pri);
 
@@ -9518,8 +9479,7 @@ static void *pri_dchannel(void *vpri)
                                        }
                                break;
                        case PRI_EVENT_DCHAN_DOWN:
-                               if (option_verbose > 1) 
-                                       ast_verbose(VERBOSE_PREFIX_2 "%s D-Channel on span %d down\n", pri_order(which), pri->span);
+                               ast_verb(2, "%s D-Channel on span %d down\n", pri_order(which), pri->span);
                                pri->dchanavail[which] &= ~DCHAN_UP;
                                pri_find_dchan(pri);
                                if (!pri_is_up(pri)) {
@@ -9555,8 +9515,7 @@ static void *pri_dchannel(void *vpri)
                                                ast_log(LOG_WARNING, "Restart requested on odd/unavailable channel number %d/%d on span %d\n", 
                                                        PRI_SPAN(e->restart.channel), PRI_CHANNEL(e->restart.channel), pri->span);
                                        else {
-                                               if (option_verbose > 2)
-                                                       ast_verbose(VERBOSE_PREFIX_3 "B-channel %d/%d restarted on span %d\n", 
+                                               ast_verb(3, "B-channel %d/%d restarted on span %d\n",
                                                                PRI_SPAN(e->restart.channel), PRI_CHANNEL(e->restart.channel), pri->span);
                                                ast_mutex_lock(&pri->pvts[chanpos]->lock);
                                                if (pri->pvts[chanpos]->call) {
@@ -9571,8 +9530,7 @@ static void *pri_dchannel(void *vpri)
                                                ast_mutex_unlock(&pri->pvts[chanpos]->lock);
                                        }
                                } else {
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_2 "Restart on requested on entire span %d\n", pri->span);
+                                       ast_verb(3, "Restart on requested on entire span %d\n", pri->span);
                                        for (x = 0; x < pri->numchans; x++)
                                                if (pri->pvts[x]) {
                                                        ast_mutex_lock(&pri->pvts[x]->lock);
@@ -9721,8 +9679,7 @@ static void *pri_dchannel(void *vpri)
                                                             e->ring.redirectingnum, e->ring.callingplanrdnis);
                                        /* If immediate=yes go to s|1 */
                                        if (pri->pvts[chanpos]->immediate) {
-                                               if (option_verbose > 2)
-                                                       ast_verbose(VERBOSE_PREFIX_3 "Going to extension s|1 because of immediate=yes\n");
+                                               ast_verb(3, "Going to extension s|1 because of immediate=yes\n");
                                                pri->pvts[chanpos]->exten[0] = 's';
                                                pri->pvts[chanpos]->exten[1] = '\0';
                                        }
@@ -9737,8 +9694,7 @@ static void *pri_dchannel(void *vpri)
                                                ast_copy_string(pri->pvts[chanpos]->dnid, e->ring.callednum, sizeof(pri->pvts[chanpos]->dnid));
                                        /* No number yet, but received "sending complete"? */
                                        if (e->ring.complete && (ast_strlen_zero(e->ring.callednum))) {
-                                               if (option_verbose > 2)
-                                                       ast_verbose(VERBOSE_PREFIX_3 "Going to extension s|1 because of Complete received\n");
+                                               ast_verb(3, "Going to extension s|1 because of Complete received\n");
                                                pri->pvts[chanpos]->exten[0] = 's';
                                                pri->pvts[chanpos]->exten[1] = '\0';
                                        }
@@ -9810,8 +9766,7 @@ static void *pri_dchannel(void *vpri)
                                                        
                                                        ast_mutex_lock(&pri->lock);
                                                        if (c && !ast_pthread_create_detached(&threadid, NULL, ss_thread, c)) {
-                                                               if (option_verbose > 2)
-                                                                       ast_verbose(VERBOSE_PREFIX_3 "Accepting overlap call from '%s' to '%s' on channel %d/%d, span %d\n",
+                                                               ast_verb(3, "Accepting overlap call from '%s' to '%s' on channel %d/%d, span %d\n",
                                                                                plancallingnum, S_OR(pri->pvts[chanpos]->exten, "<unspecified>"),
                                                                                pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span);
                                                        } else {
@@ -9847,8 +9802,7 @@ static void *pri_dchannel(void *vpri)
                                                        
                                                                snprintf(calledtonstr, sizeof(calledtonstr)-1, "%d", e->ring.calledplan);
                                                                pbx_builtin_setvar_helper(c, "CALLEDTON", calledtonstr);
-                                                               if (option_verbose > 2)
-                                                                       ast_verbose(VERBOSE_PREFIX_3 "Accepting call from '%s' to '%s' on channel %d/%d, span %d\n",
+                                                               ast_verb(3, "Accepting call from '%s' to '%s' on channel %d/%d, span %d\n",
                                                                                plancallingnum, pri->pvts[chanpos]->exten, 
                                                                                        pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span);
                                                                zt_enable_ec(pri->pvts[chanpos]);
@@ -9860,8 +9814,7 @@ static void *pri_dchannel(void *vpri)
                                                        }
                                                }
                                        } else {
-                                               if (option_verbose > 2)
-                                                       ast_verbose(VERBOSE_PREFIX_3 "Extension '%s' in context '%s' from '%s' does not exist.  Rejecting call on channel %d/%d, span %d\n",
+                                               ast_verb(3, "Extension '%s' in context '%s' from '%s' does not exist.  Rejecting call on channel %d/%d, span %d\n",
                                                                pri->pvts[chanpos]->exten, pri->pvts[chanpos]->context, pri->pvts[chanpos]->cid_num, pri->pvts[chanpos]->logicalspan, 
                                                                        pri->pvts[chanpos]->prioffset, pri->span);
                                                pri_hangup(pri->pri, e->ring.call, PRI_CAUSE_UNALLOCATED);
@@ -9932,14 +9885,12 @@ static void *pri_dchannel(void *vpri)
                                                struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_PROGRESS, };
 
                                                if (e->proceeding.cause > -1) {
-                                                       if (option_verbose > 2)
-                                                               ast_verbose(VERBOSE_PREFIX_3 "PROGRESS with cause code %d received\n", e->proceeding.cause);
+                                                       ast_verb(3, "PROGRESS with cause code %d received\n", e->proceeding.cause);
 
                                                        /* Work around broken, out of spec USER_BUSY cause in a progress message */
                                                        if (e->proceeding.cause == AST_CAUSE_USER_BUSY) {
                                                                if (pri->pvts[chanpos]->owner) {
-                                                                       if (option_verbose > 2)
-                                                                               ast_verbose(VERBOSE_PREFIX_3 "PROGRESS with 'user busy' received, signaling AST_CONTROL_BUSY instead of AST_CONTROL_PROGRESS\n");
+                                                                       ast_verb(3, "PROGRESS with 'user busy' received, signaling AST_CONTROL_BUSY instead of AST_CONTROL_PROGRESS\n");
 
                                                                        pri->pvts[chanpos]->owner->hangupcause = e->proceeding.cause;
                                                                        f.subclass = AST_CONTROL_BUSY;
@@ -10113,23 +10064,20 @@ static void *pri_dchannel(void *vpri)
                                                                        }
                                                                }
                                                        }
-                                                       if (option_verbose > 2) 
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup, cause %d\n", 
+                                                       ast_verb(3, "Channel %d/%d, span %d got hangup, cause %d\n",
                                                                        pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, e->hangup.cause);
                                                } else {
                                                        pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause);
                                                        pri->pvts[chanpos]->call = NULL;
                                                }
                                                if (e->hangup.cause == PRI_CAUSE_REQUESTED_CHAN_UNAVAIL) {
-                                                       if (option_verbose > 2)
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Forcing restart of channel %d/%d on span %d since channel reported in use\n", 
+                                                       ast_verb(3, "Forcing restart of channel %d/%d on span %d since channel reported in use\n",
                                                                        PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
                                                        pri_reset(pri->pri, PVT_TO_CHANNEL(pri->pvts[chanpos]));
                                                        pri->pvts[chanpos]->resetting = 1;
                                                }
                                                if (e->hangup.aoc_units > -1)
-                                                       if (option_verbose > 2)
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
+                                                       ast_verb(3, "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
                                                                        pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, (int)e->hangup.aoc_units, (e->hangup.aoc_units == 1) ? "" : "s");
 
 #ifdef SUPPORT_USERUSER
@@ -10180,19 +10128,16 @@ static void *pri_dchannel(void *vpri)
                                                                                pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
                                                                }
                                                        }
-                                                       if (option_verbose > 2) 
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup request, cause %d\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span, e->hangup.cause);
+                                                       ast_verb(3, "Channel %d/%d, span %d got hangup request, cause %d\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span, e->hangup.cause);
                                                        if (e->hangup.aoc_units > -1)
-                                                               if (option_verbose > 2)
-                                                                       ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
+                                                               ast_verb(3, "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
                                                                                pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, (int)e->hangup.aoc_units, (e->hangup.aoc_units == 1) ? "" : "s");
                                                } else {
                                                        pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause);
                                                        pri->pvts[chanpos]->call = NULL;
                                                }
                                                if (e->hangup.cause == PRI_CAUSE_REQUESTED_CHAN_UNAVAIL) {
-                                                       if (option_verbose > 2)
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Forcing restart of channel %d/%d span %d since channel reported in use\n", 
+                                                       ast_verb(3, "Forcing restart of channel %d/%d span %d since channel reported in use\n",
                                                                        PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
                                                        pri_reset(pri->pri, PVT_TO_CHANNEL(pri->pvts[chanpos]));
                                                        pri->pvts[chanpos]->resetting = 1;
@@ -10222,8 +10167,7 @@ static void *pri_dchannel(void *vpri)
                                                pri->pvts[chanpos]->call = NULL;
                                                pri->pvts[chanpos]->resetting = 0;
                                                if (pri->pvts[chanpos]->owner) {
-                                                       if (option_verbose > 2) 
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup ACK\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
+                                                       ast_verb(3, "Channel %d/%d, span %d got hangup ACK\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
                                                }
 
 #ifdef SUPPORT_USERUSER
@@ -10259,8 +10203,7 @@ static void *pri_dchannel(void *vpri)
                                                                pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
                                                        }
                                                        pri->pvts[chanpos]->resetting = 0;
-                                                       if (option_verbose > 2)
-                                                               ast_verbose(VERBOSE_PREFIX_3 "B-channel %d/%d successfully restarted on span %d\n", pri->pvts[chanpos]->logicalspan, 
+                                                       ast_verb(3, "B-channel %d/%d successfully restarted on span %d\n", pri->pvts[chanpos]->logicalspan,
                                                                        pri->pvts[chanpos]->prioffset, pri->span);
                                                        ast_mutex_unlock(&pri->pvts[chanpos]->lock);
                                                        if (pri->resetting)
@@ -10284,8 +10227,7 @@ static void *pri_dchannel(void *vpri)
                                                }
                                                pri->pvts[chanpos]->resetting = 0;
                                                pri->pvts[chanpos]->inservice = 1;
-                                               if (option_verbose > 2)
-                                                       ast_verbose(VERBOSE_PREFIX_3 "B-channel %d/%d successfully restarted on span %d\n", pri->pvts[chanpos]->logicalspan, 
+                                               ast_verb(3, "B-channel %d/%d successfully restarted on span %d\n", pri->pvts[chanpos]->logicalspan,
                                                                        pri->pvts[chanpos]->prioffset, pri->span);
                                                ast_mutex_unlock(&pri->pvts[chanpos]->lock);
                                                if (pri->resetting)
@@ -10757,8 +10699,7 @@ static int zap_destroy_channel(int fd, int argc, char **argv)
 static int setup_zap(int reload);
 static int zap_restart(void)
 {
-       if (option_verbose > 0)
-               ast_verbose(VERBOSE_PREFIX_1 "Destroying channels and reloading zaptel configuration.\n");
+       ast_verb(1, "Destroying channels and reloading zaptel configuration.\n");
        while (iflist) {
                ast_debug(1, "Destroying zaptel channel no. %d\n", iflist->channel);
                /* Also updates iflist: */
@@ -11453,7 +11394,7 @@ static int __unload_module(void)
                /* Free associated memory */
                if (pl)
                        destroy_zt_pvt(&pl);
-               ast_verbose(VERBOSE_PREFIX_3 "Unregistered channel %d\n", x);
+               ast_verb(3, "Unregistered channel %d\n", x);
        }
        iflist = NULL;
        ifcount = 0;
@@ -11879,14 +11820,12 @@ static int build_channels(struct zt_chan_conf conf, int iscrv, const char *value
 #endif                 
 
                        if (tmp) {
-                               if (option_verbose > 2) {
 #ifdef HAVE_PRI
                                        if (pri)
-                                               ast_verbose(VERBOSE_PREFIX_3 "%s CRV %d:%d, %s signalling\n", reload ? "Reconfigured" : "Registered", trunkgroup, x, sig2str(tmp->sig));
+                                       ast_verb(3, "%s CRV %d:%d, %s signalling\n", reload ? "Reconfigured" : "Registered", trunkgroup, x, sig2str(tmp->sig));
                                        else
 #endif
-                                               ast_verbose(VERBOSE_PREFIX_3 "%s channel %d, %s signalling\n", reload ? "Reconfigured" : "Registered", x, sig2str(tmp->sig));
-                               }
+                                       ast_verb(3, "%s channel %d, %s signalling\n", reload ? "Reconfigured" : "Registered", x, sig2str(tmp->sig));
                        } else {
                                ast_log(LOG_ERROR, "Unable to %s channel '%s'\n",
                                        (reload == 1) ? "reconfigure" : "register", value);
@@ -12598,8 +12537,7 @@ static int process_zap(struct zt_chan_conf *confp, struct ast_variable *v, int r
                                                else {
                                                        cadences[num_cadence] = new_cadence;
                                                        cidrings[num_cadence++] = cid_location;
-                                                       if (option_verbose > 2)
-                                                               ast_verbose(VERBOSE_PREFIX_3 "cadence 'r%d' added: %s\n",num_cadence,original_args);
+                                                       ast_verb(3, "cadence 'r%d' added: %s\n",num_cadence,original_args);
                                                }
                                        }
                                }
@@ -12671,8 +12609,7 @@ static int process_zap(struct zt_chan_conf *confp, struct ast_variable *v, int r
                tmp = mkintf(CHAN_PSEUDO, *confp, NULL, reload);
 
                if (tmp) {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Automatically generated pseudo channel\n");
+                       ast_verb(3, "Automatically generated pseudo channel\n");
                } else {
                        ast_log(LOG_WARNING, "Unable to register pseudo channel!\n");
                }
@@ -12729,8 +12666,8 @@ static int setup_zap(int reload)
                                                if (i) {
                                                        if (pri_create_trunkgroup(trunkgroup, dchannels)) {
                                                                ast_log(LOG_WARNING, "Unable to create trunk group %d with Primary D-channel %d at line %d of zapata.conf\n", trunkgroup, dchannels[0], v->lineno);
-                                                       } else if (option_verbose > 1)
-                                                               ast_verbose(VERBOSE_PREFIX_2 "Created trunk group %d with Primary D-channel %d and %d backup%s\n", trunkgroup, dchannels[0], i - 1, (i == 1) ? "" : "s");
+                                               } else
+                                                               ast_verb(2, "Created trunk group %d with Primary D-channel %d and %d backup%s\n", trunkgroup, dchannels[0], i - 1, (i == 1) ? "" : "s");
                                                } else
                                                        ast_log(LOG_WARNING, "Trunk group %d lacks any valid D-channels at line %d of zapata.conf\n", trunkgroup, v->lineno);
                                        } else
@@ -12750,8 +12687,8 @@ static int setup_zap(int reload)
                                                        if (logicalspan >= 0) {
                                                                if (pri_create_spanmap(spanno - 1, trunkgroup, logicalspan)) {
                                                                        ast_log(LOG_WARNING, "Failed to map span %d to trunk group %d (logical span %d)\n", spanno, trunkgroup, logicalspan);
-                                                               } else if (option_verbose > 1) 
-                                                                       ast_verbose(VERBOSE_PREFIX_2 "Mapped span %d to trunk group %d (logical span %d)\n", spanno, trunkgroup, logicalspan);
+                                                       } else
+                                                                       ast_verb(2, "Mapped span %d to trunk group %d (logical span %d)\n", spanno, trunkgroup, logicalspan);
                                                        } else
                                                                ast_log(LOG_WARNING, "Logical span must be a postive number, or '0' (for unspecified) at line %d of zapata.conf\n", v->lineno);
                                                } else
@@ -12804,8 +12741,8 @@ static int setup_zap(int reload)
                                if (start_pri(pris + x)) {
                                        ast_log(LOG_ERROR, "Unable to start D-channel on span %d\n", x + 1);
                                        return -1;
-                               } else if (option_verbose > 1)
-                                       ast_verbose(VERBOSE_PREFIX_2 "Starting D-Channel on span %d\n", x + 1);
+                               } else
+                                       ast_verb(2, "Starting D-Channel on span %d\n", x + 1);
                        }
                }
        }
@@ -12817,8 +12754,8 @@ static int setup_zap(int reload)
                                if (ast_pthread_create(&linksets[x].master, NULL, ss7_linkset, &linksets[x])) {
                                        ast_log(LOG_ERROR, "Unable to start SS7 linkset on span %d\n", x + 1);
                                        return -1;
-                               } else if (option_verbose > 1)
-                                       ast_verbose(VERBOSE_PREFIX_2 "Starting SS7 linkset on span %d\n", x + 1);
+                               } else
+                                       ast_verb(2, "Starting SS7 linkset on span %d\n", x + 1);
                        }
                }
        }
index 962e6d9582b36e772dfa0da0f24b53cf04462577..dd3419a9e58ba82bb44813a176fac9e2b6c9278b 100644 (file)
@@ -507,8 +507,7 @@ int iax_provision_reload(void)
                        if (strcasecmp(cat, "general")) {
                                iax_process_template(cfg, cat, found ? "default" : NULL);
                                found++;
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Loaded provisioning template '%s'\n", cat);
+                               ast_verb(3, "Loaded provisioning template '%s'\n", cat);
                        }
                        cat = ast_category_browse(cfg, cat);
                }
index 7469f056c595f47726bbe91108693bb7c6d20036..fb4bb8bd7044e8edd4cbd6d6d80f1fee85f3429c 100644 (file)
@@ -359,8 +359,7 @@ static void parse_config(void)
        for (var = ast_variable_browse(cfg, "plc"); var ; var = var->next) {
                if (!strcasecmp(var->name, "genericplc")) {
                        adpcmtolin.useplc = ast_true(var->value) ? 1 : 0;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "codec_adpcm: %susing generic PLC\n", adpcmtolin.useplc ? "" : "not ");
+                       ast_verb(3, "codec_adpcm: %susing generic PLC\n", adpcmtolin.useplc ? "" : "not ");
                }
        }
        ast_config_destroy(cfg);
index de106168733e6fdd0aa39557c6d8e64dba02d9fb..9edae5130e47d783ce338f4e09e32dd3d450d1d4 100644 (file)
@@ -143,8 +143,7 @@ static void parse_config(void)
        for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
                if (!strcasecmp(var->name, "genericplc")) {
                        alawtolin.useplc = ast_true(var->value) ? 1 : 0;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "codec_alaw: %susing generic PLC\n", alawtolin.useplc ? "" : "not ");
+                       ast_verb(3, "codec_alaw: %susing generic PLC\n", alawtolin.useplc ? "" : "not ");
                }
        }
        ast_config_destroy(cfg);
index e046b9337e28c440f97297b6ece0a0f997a38a93..46d34f1babee550a666de28e748f4968e3a46901 100644 (file)
@@ -174,8 +174,7 @@ static void parse_config(void)
        for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
                if (!strcasecmp(var->name, "genericplc")) {
                        g722tolin.useplc = ast_true(var->value) ? 1 : 0;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "codec_g722: %susing generic PLC\n",
+                       ast_verb(3, "codec_g722: %susing generic PLC\n",
                                        g722tolin.useplc ? "" : "not ");
                }
        }
index bfc49ad9c8e3cb592a0b44132299ecafff7057ae..425ba9bef628c7d0fb65c75f7965ed33db4a7d6f 100644 (file)
@@ -904,8 +904,7 @@ static void parse_config(void)
        for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
                if (!strcasecmp(var->name, "genericplc")) {
                        g726tolin.useplc = ast_true(var->value) ? 1 : 0;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "codec_g726: %susing generic PLC\n",
+                       ast_verb(3, "codec_g726: %susing generic PLC\n",
                                        g726tolin.useplc ? "" : "not ");
                }
        }
index 8a37493190655e540ddf113ce035d3fdb54c9795..c346f24cf7d4efe1a04e4a72a5a5be48c65f6c32 100644 (file)
@@ -244,8 +244,7 @@ static void parse_config(void)
        for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
               if (!strcasecmp(var->name, "genericplc")) {
                       gsmtolin.useplc = ast_true(var->value) ? 1 : 0;
-                      if (option_verbose > 2)
-                              ast_verbose(VERBOSE_PREFIX_3 "codec_gsm: %susing generic PLC\n", gsmtolin.useplc ? "" : "not ");
+                          ast_verb(3, "codec_gsm: %susing generic PLC\n", gsmtolin.useplc ? "" : "not ");
               }
        }
        ast_config_destroy(cfg);
index 723c5d8ce65b138a23364994e72c3b5e300ac273..d4688cd9b098fc20ac3f3b833ab0b6c8ac011d0b 100644 (file)
@@ -270,8 +270,7 @@ static void parse_config(void)
        for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
               if (!strcasecmp(var->name, "genericplc")) {
                        lpc10tolin.useplc = ast_true(var->value) ? 1 : 0;
-                       if (option_verbose > 2)
-                              ast_verbose(VERBOSE_PREFIX_3 "codec_lpc10: %susing generic PLC\n",
+                       ast_verb(3, "codec_lpc10: %susing generic PLC\n",
                                        lpc10tolin.useplc ? "" : "not ");
                }
         }
index 182b33eb980fc8e44b94208dca75d62cca612558..1cbd5d9fb5b8debc16a2e862489fa97198d9dd43 100644 (file)
@@ -389,23 +389,20 @@ static void parse_config(void)
                if (!strcasecmp(var->name, "quality")) {
                        res = abs(atoi(var->value));
                        if (res > -1 && res < 11) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting Quality to %d\n",res);
+                               ast_verb(3, "CODEC SPEEX: Setting Quality to %d\n",res);
                                quality = res;
                        } else 
                                ast_log(LOG_ERROR,"Error Quality must be 0-10\n");
                } else if (!strcasecmp(var->name, "complexity")) {
                        res = abs(atoi(var->value));
                        if (res > -1 && res < 11) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting Complexity to %d\n",res);
+                               ast_verb(3, "CODEC SPEEX: Setting Complexity to %d\n",res);
                                complexity = res;
                        } else 
                                ast_log(LOG_ERROR,"Error! Complexity must be 0-10\n");
                } else if (!strcasecmp(var->name, "vbr_quality")) {
                        if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0 && res_f <= 10) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting VBR Quality to %f\n",res_f);
+                               ast_verb(3, "CODEC SPEEX: Setting VBR Quality to %f\n",res_f);
                                vbr_quality = res_f;
                        } else
                                ast_log(LOG_ERROR,"Error! VBR Quality must be 0-10\n");
@@ -413,70 +410,56 @@ static void parse_config(void)
                        ast_log(LOG_ERROR,"Error! ABR Quality setting obsolete, set ABR to desired bitrate\n");
                } else if (!strcasecmp(var->name, "enhancement")) {
                        enhancement = ast_true(var->value) ? 1 : 0;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Perceptual Enhancement Mode. [%s]\n",enhancement ? "on" : "off");
+                       ast_verb(3, "CODEC SPEEX: Perceptual Enhancement Mode. [%s]\n",enhancement ? "on" : "off");
                } else if (!strcasecmp(var->name, "vbr")) {
                        vbr = ast_true(var->value) ? 1 : 0;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: VBR Mode. [%s]\n",vbr ? "on" : "off");
+                       ast_verb(3, "CODEC SPEEX: VBR Mode. [%s]\n",vbr ? "on" : "off");
                } else if (!strcasecmp(var->name, "abr")) {
                        res = abs(atoi(var->value));
                        if (res >= 0) {
-                               if (option_verbose > 2) {
                                        if (res > 0)
-                                               ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting ABR target bitrate to %d\n",res);
+                                       ast_verb(3, "CODEC SPEEX: Setting ABR target bitrate to %d\n",res);
                                        else
-                                               ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Disabling ABR\n");
-                               }
+                                       ast_verb(3, "CODEC SPEEX: Disabling ABR\n");
                                abr = res;
                        } else 
                                ast_log(LOG_ERROR,"Error! ABR target bitrate must be >= 0\n");
                } else if (!strcasecmp(var->name, "vad")) {
                        vad = ast_true(var->value) ? 1 : 0;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: VAD Mode. [%s]\n",vad ? "on" : "off");
+                       ast_verb(3, "CODEC SPEEX: VAD Mode. [%s]\n",vad ? "on" : "off");
                } else if (!strcasecmp(var->name, "dtx")) {
                        dtx = ast_true(var->value) ? 1 : 0;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: DTX Mode. [%s]\n",dtx ? "on" : "off");
+                       ast_verb(3, "CODEC SPEEX: DTX Mode. [%s]\n",dtx ? "on" : "off");
                } else if (!strcasecmp(var->name, "preprocess")) {
                        preproc = ast_true(var->value) ? 1 : 0;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessing. [%s]\n",preproc ? "on" : "off");
+                       ast_verb(3, "CODEC SPEEX: Preprocessing. [%s]\n",preproc ? "on" : "off");
                } else if (!strcasecmp(var->name, "pp_vad")) {
                        pp_vad = ast_true(var->value) ? 1 : 0;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessor VAD. [%s]\n",pp_vad ? "on" : "off");
+                       ast_verb(3, "CODEC SPEEX: Preprocessor VAD. [%s]\n",pp_vad ? "on" : "off");
                } else if (!strcasecmp(var->name, "pp_agc")) {
                        pp_agc = ast_true(var->value) ? 1 : 0;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessor AGC. [%s]\n",pp_agc ? "on" : "off");
+                       ast_verb(3, "CODEC SPEEX: Preprocessor AGC. [%s]\n",pp_agc ? "on" : "off");
                } else if (!strcasecmp(var->name, "pp_agc_level")) {
                        if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting preprocessor AGC Level to %f\n",res_f);
+                               ast_verb(3, "CODEC SPEEX: Setting preprocessor AGC Level to %f\n",res_f);
                                pp_agc_level = res_f;
                        } else
                                ast_log(LOG_ERROR,"Error! Preprocessor AGC Level must be >= 0\n");
                } else if (!strcasecmp(var->name, "pp_denoise")) {
                        pp_denoise = ast_true(var->value) ? 1 : 0;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessor Denoise. [%s]\n",pp_denoise ? "on" : "off");
+                       ast_verb(3, "CODEC SPEEX: Preprocessor Denoise. [%s]\n",pp_denoise ? "on" : "off");
                } else if (!strcasecmp(var->name, "pp_dereverb")) {
                        pp_dereverb = ast_true(var->value) ? 1 : 0;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessor Dereverb. [%s]\n",pp_dereverb ? "on" : "off");
+                       ast_verb(3, "CODEC SPEEX: Preprocessor Dereverb. [%s]\n",pp_dereverb ? "on" : "off");
                } else if (!strcasecmp(var->name, "pp_dereverb_decay")) {
                        if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting preprocessor Dereverb Decay to %f\n",res_f);
+                               ast_verb(3, "CODEC SPEEX: Setting preprocessor Dereverb Decay to %f\n",res_f);
                                pp_dereverb_decay = res_f;
                        } else
                                ast_log(LOG_ERROR,"Error! Preprocessor Dereverb Decay must be >= 0\n");
                } else if (!strcasecmp(var->name, "pp_dereverb_level")) {
                        if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) {
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting preprocessor Dereverb Level to %f\n",res_f);
+                               ast_verb(3, "CODEC SPEEX: Setting preprocessor Dereverb Level to %f\n",res_f);
                                pp_dereverb_level = res_f;
                        } else
                                ast_log(LOG_ERROR,"Error! Preprocessor Dereverb Level must be >= 0\n");
index 334f8d9ad7638cfe7489003135cb5656466a7c93..ce248f1c1c8edda7c8c96e685a6e0f2e3059b0c6 100644 (file)
@@ -156,8 +156,7 @@ static void parse_config(void)
        for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
                if (!strcasecmp(var->name, "genericplc")) {
                        ulawtolin.useplc = ast_true(var->value) ? 1 : 0;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "codec_ulaw: %susing generic PLC\n", ulawtolin.useplc ? "" : "not ");
+                       ast_verb(3, "codec_ulaw: %susing generic PLC\n", ulawtolin.useplc ? "" : "not ");
                }
        }
        ast_config_destroy(cfg);
index 9073f95455ade01a005e7e33b61effd7ff3a3d7e..9204baad77d06b1bb81f160351bd7eb27a347c5e 100644 (file)
@@ -323,8 +323,7 @@ static void parse_config(void)
        for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
               if (!strcasecmp(var->name, "genericplc")) {
                       global_useplc = ast_true(var->value);
-                      if (option_verbose > 2)
-                              ast_verbose(VERBOSE_PREFIX_3 "codec_zap: %susing generic PLC\n",
+                          ast_verb(3, "codec_zap: %susing generic PLC\n",
                                           global_useplc ? "" : "not ");
               }
        }
@@ -366,14 +365,13 @@ static int find_transcoders(void)
                return 0;
        }
        for (info.tcnum = 0; !(res = ioctl(fd, ZT_TRANSCODE_OP, &info)); info.tcnum++) {
-               if (option_verbose > 1)
-                       ast_verbose(VERBOSE_PREFIX_2 "Found transcoder '%s'.\n", info.name);
+               ast_verb(2, "Found transcoder '%s'.\n", info.name);
                build_translators(&map, info.dstfmts, info.srcfmts);
        }
        close(fd);
 
-       if (!info.tcnum && (option_verbose > 1))
-               ast_verbose(VERBOSE_PREFIX_2 "No hardware transcoders found.\n");
+       if (!info.tcnum)
+               ast_verb(2, "No hardware transcoders found.\n");
 
        for (x = 0; x < 32; x++) {
                for (y = 0; y < 32; y++) {
index 2eac1eeb9f89e51146e419e023de57ab6ed2a3ec..1c39326f86c4669ea965e221f2d89e93b9d2f744 100644 (file)
@@ -324,8 +324,7 @@ static int acf_odbc_read(struct ast_channel *chan, const char *cmd, char *s, cha
        if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
                int res1 = -1;
                if (res == SQL_NO_DATA) {
-                       if (option_verbose > 3)
-                               ast_verbose(VERBOSE_PREFIX_4 "Found no rows [%s]\n", sql);
+                       ast_verb(4, "Found no rows [%s]\n", sql);
                        res1 = 0;
                        ast_copy_string(rowcount, "0", sizeof(rowcount));
                } else {
index ec730c81985c7c72bca75bc99b42d3d9d6e76f3e..51d2a47d9b1d4f0ea51b7f1391cd614504a0f005 100644 (file)
@@ -111,26 +111,21 @@ static int timeout_write(struct ast_channel *chan, const char *cmd, char *data,
        case 'a':
        case 'A':
                ast_channel_setwhentohangup(chan, x);
-               if (option_verbose > 2) {
                        if (chan->whentohangup) {
                                struct timeval tv = { chan->whentohangup, 0 };
                                ast_strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S.%3q %Z",
                                        ast_localtime(&tv, &myt, NULL));
-                               ast_verbose(VERBOSE_PREFIX_3 "Channel will hangup at %s.\n",
-                                           timestr);
+                       ast_verb(3, "Channel will hangup at %s.\n", timestr);
                        } else {
-                               ast_verbose(VERBOSE_PREFIX_3 "Channel hangup cancelled.\n");
+                       ast_verb(3, "Channel hangup cancelled.\n");
                        }
-               }
                break;
 
        case 'r':
        case 'R':
                if (chan->pbx) {
                        chan->pbx->rtimeout = x;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Response timeout set to %d\n",
-                                           chan->pbx->rtimeout);
+                       ast_verb(3, "Response timeout set to %d\n", chan->pbx->rtimeout);
                }
                break;
 
@@ -138,9 +133,7 @@ static int timeout_write(struct ast_channel *chan, const char *cmd, char *data,
        case 'D':
                if (chan->pbx) {
                        chan->pbx->dtimeout = x;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Digit timeout set to %d\n",
-                                           chan->pbx->dtimeout);
+                       ast_verb(3, "Digit timeout set to %d\n", chan->pbx->dtimeout);
                }
                break;
 
index 64c7f77ab89061b6c08d273f8594097fff7c6686..e108aa92c7b1ad61c052886561d6aff2e6eb0d95 100644 (file)
@@ -511,8 +511,7 @@ static int create_jb(struct ast_channel *chan, struct ast_frame *frr)
                                now, frr->ts, frr->len);
        }
 
-       if (option_verbose > 2) 
-               ast_verbose(VERBOSE_PREFIX_3 "%s jitterbuffer created on channel %s\n", jbimpl->name, chan->name);
+       ast_verb(3, "%s jitterbuffer created on channel %s\n", jbimpl->name, chan->name);
        
        /* Free the frame if it has not been queued in the jb */
        if (res != JB_IMPL_OK)
@@ -545,8 +544,7 @@ void ast_jb_destroy(struct ast_channel *chan)
                
                ast_clear_flag(jb, JB_CREATED);
 
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "%s jitterbuffer destroyed on channel %s\n", jbimpl->name, chan->name);
+               ast_verb(3, "%s jitterbuffer destroyed on channel %s\n", jbimpl->name, chan->name);
        }
 }
 
index f46cb9b9a582b9af3381eb1e228df3a10541889e..41bbe1c50d094460869ebca6a40734c1afc5f675 100644 (file)
@@ -205,8 +205,8 @@ int ast_app_has_voicemail(const char *mailbox, const char *folder)
        if (ast_has_voicemail_func)
                return ast_has_voicemail_func(mailbox, folder);
 
-       if ((option_verbose > 2) && !warned) {
-               ast_verbose(VERBOSE_PREFIX_3 "Message check requested for mailbox %s/folder %s but voicemail not loaded.\n", mailbox, folder ? folder : "INBOX");
+       if (!warned) {
+               ast_verb(3, "Message check requested for mailbox %s/folder %s but voicemail not loaded.\n", mailbox, folder ? folder : "INBOX");
                warned++;
        }
        return 0;
@@ -223,9 +223,9 @@ int ast_app_inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
        if (ast_inboxcount_func)
                return ast_inboxcount_func(mailbox, newmsgs, oldmsgs);
 
-       if (!warned && (option_verbose > 2)) {
+       if (!warned) {
                warned++;
-               ast_verbose(VERBOSE_PREFIX_3 "Message count requested for mailbox %s but voicemail not loaded.\n", mailbox);
+               ast_verb(3, "Message count requested for mailbox %s but voicemail not loaded.\n", mailbox);
        }
 
        return 0;
@@ -237,9 +237,9 @@ int ast_app_messagecount(const char *context, const char *mailbox, const char *f
        if (ast_messagecount_func)
                return ast_messagecount_func(context, mailbox, folder);
 
-       if (!warned && (option_verbose > 2)) {
+       if (!warned) {
                warned++;
-               ast_verbose(VERBOSE_PREFIX_3 "Message count requested for mailbox %s@%s/%s but voicemail not loaded.\n", mailbox, context, folder);
+               ast_verb(3, "Message count requested for mailbox %s@%s/%s but voicemail not loaded.\n", mailbox, context, folder);
        }
 
        return 0;
@@ -454,13 +454,13 @@ int ast_control_streamfile(struct ast_channel *chan, const char *file,
                        else if (end || offset < 0) {
                                if (offset == -8) 
                                        offset = 0;
-                               ast_verbose(VERBOSE_PREFIX_3 "ControlPlayback seek to offset %ld from end\n", offset);
+                               ast_verb(3, "ControlPlayback seek to offset %ld from end\n", offset);
 
                                ast_seekstream(chan->stream, offset, SEEK_END);
                                end = NULL;
                                offset = 0;
                        } else if (offset) {
-                               ast_verbose(VERBOSE_PREFIX_3 "ControlPlayback seek to offset %ld\n", offset);
+                               ast_verb(3, "ControlPlayback seek to offset %ld\n", offset);
                                ast_seekstream(chan->stream, offset, SEEK_SET);
                                offset = 0;
                        };
@@ -615,8 +615,7 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile,
        end = start = time(NULL);  /* pre-initialize end to be same as start in case we never get into loop */
        for (x = 0; x < fmtcnt; x++) {
                others[x] = ast_writefile(prepend ? prependfile : recordfile, sfmt[x], comment, O_TRUNC, 0, AST_FILE_MODE);
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "x=%d, open writing:  %s format: %s, %p\n", x, prepend ? prependfile : recordfile, sfmt[x], others[x]);
+               ast_verb(3, "x=%d, open writing:  %s format: %s, %p\n", x, prepend ? prependfile : recordfile, sfmt[x], others[x]);
 
                if (!others[x])
                        break;
@@ -691,8 +690,7 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile,
 
                                        if (totalsilence > maxsilence) {
                                                /* Ended happily with silence */
-                                               if (option_verbose > 2)
-                                                       ast_verbose( VERBOSE_PREFIX_3 "Recording automatically stopped after a silence of %d seconds\n", totalsilence/1000);
+                                               ast_verb(3, "Recording automatically stopped after a silence of %d seconds\n", totalsilence/1000);
                                                res = 'S';
                                                outmsg = 2;
                                                break;
@@ -709,22 +707,19 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile,
                        } else if (f->frametype == AST_FRAME_DTMF) {
                                if (prepend) {
                                /* stop recording with any digit */
-                                       if (option_verbose > 2) 
-                                               ast_verbose(VERBOSE_PREFIX_3 "User ended message by pressing %c\n", f->subclass);
+                                       ast_verb(3, "User ended message by pressing %c\n", f->subclass);
                                        res = 't';
                                        outmsg = 2;
                                        break;
                                }
                                if (strchr(acceptdtmf, f->subclass)) {
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "User ended message by pressing %c\n", f->subclass);
+                                       ast_verb(3, "User ended message by pressing %c\n", f->subclass);
                                        res = f->subclass;
                                        outmsg = 2;
                                        break;
                                }
                                if (strchr(canceldtmf, f->subclass)) {
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "User cancelled message by pressing %c\n", f->subclass);
+                                       ast_verb(3, "User cancelled message by pressing %c\n", f->subclass);
                                        res = f->subclass;
                                        outmsg = 0;
                                        break;
@@ -733,8 +728,7 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile,
                        if (maxtime) {
                                end = time(NULL);
                                if (maxtime < (end - start)) {
-                                       if (option_verbose > 2)
-                                               ast_verbose(VERBOSE_PREFIX_3 "Took too long, cutting it short...\n");
+                                       ast_verb(3, "Took too long, cutting it short...\n");
                                        res = 't';
                                        outmsg = 2;
                                        break;
@@ -743,8 +737,7 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile,
                        ast_frfree(f);
                }
                if (!f) {
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "User hung up\n");
+                       ast_verb(3, "User hung up\n");
                        res = -1;
                        outmsg = 1;
                } else {
@@ -792,8 +785,7 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile,
                        ast_closestream(others[x]);
                        ast_closestream(realfiles[x]);
                        ast_filerename(prependfile, recordfile, sfmt[x]);
-                       if (option_verbose > 3)
-                               ast_verbose(VERBOSE_PREFIX_4 "Recording Format: sfmts=%s, prependfile %s, recordfile %s\n", sfmt[x], prependfile, recordfile);
+                       ast_verb(4, "Recording Format: sfmts=%s, prependfile %s, recordfile %s\n", sfmt[x], prependfile, recordfile);
                        ast_filedelete(prependfile, sfmt[x]);
                }
        }
@@ -1127,16 +1119,16 @@ int ast_record_review(struct ast_channel *chan, const char *playfile, const char
                        }
                case '2':
                        /* Review */
-                       ast_verbose(VERBOSE_PREFIX_3 "Reviewing the recording\n");
+                       ast_verb(3, "Reviewing the recording\n");
                        cmd = ast_stream_and_wait(chan, recordfile, AST_DIGIT_ANY);
                        break;
                case '3':
                        message_exists = 0;
                        /* Record */
                        if (recorded == 1)
-                               ast_verbose(VERBOSE_PREFIX_3 "Re-recording\n");
+                               ast_verb(3, "Re-recording\n");
                        else    
-                               ast_verbose(VERBOSE_PREFIX_3 "Recording\n");
+                               ast_verb(3, "Recording\n");
                        recorded = 1;
                        cmd = ast_play_and_record(chan, playfile, recordfile, maxtime, fmt, duration, silencethreshold, maxsilence, path);
                        if (cmd == -1) {
index 9a61e0a0d4e31ec730ded424e4ca331bbb3674ba..b337ededfb9c63c8eb5b586288d6c1250805bc4f 100644 (file)
@@ -152,8 +152,7 @@ void ast_cdr_unregister(const char *name)
        AST_RWLIST_TRAVERSE_SAFE_BEGIN(&be_list, i, list) {
                if (!strcasecmp(name, i->name)) {
                        AST_RWLIST_REMOVE_CURRENT(&be_list, list);
-                       if (option_verbose > 1)
-                               ast_verbose(VERBOSE_PREFIX_2 "Unregistered '%s' CDR backend\n", name);
+                       ast_verb(2, "Unregistered '%s' CDR backend\n", name);
                        ast_free(i);
                        break;
                }
index 453b287361b8dd68ae717658617b7881605ff00f..bc47e0a607fd7b5c9ac72280a2845fe2b52dbe39 100644 (file)
@@ -435,9 +435,7 @@ int ast_channel_register(const struct ast_channel_tech *tech)
 
        ast_debug(1, "Registered handler for '%s' (%s)\n", chan->tech->type, chan->tech->description);
 
-       if (option_verbose > 1)
-               ast_verbose(VERBOSE_PREFIX_2 "Registered channel type '%s' (%s)\n", chan->tech->type,
-                           chan->tech->description);
+       ast_verb(2, "Registered channel type '%s' (%s)\n", chan->tech->type, chan->tech->description);
 
        AST_RWLIST_UNLOCK(&channels);
        return 0;
@@ -456,8 +454,7 @@ void ast_channel_unregister(const struct ast_channel_tech *tech)
                if (chan->tech == tech) {
                        AST_LIST_REMOVE_CURRENT(&backends, list);
                        ast_free(chan);
-                       if (option_verbose > 1)
-                               ast_verbose(VERBOSE_PREFIX_2 "Unregistered channel type '%s'\n", tech->type);
+                       ast_verb(2, "Unregistered channel type '%s'\n", tech->type);
                        break;  
                }
        }
@@ -4169,9 +4166,7 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
                        case AST_BRIDGE_RETRY:
                                continue;
                        default:
-                               if (option_verbose > 2)
-                                       ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s ended\n",
-                                                   c0->name, c1->name);
+                               ast_verb(3, "Native bridging %s and %s ended\n", c0->name, c1->name);
                                /* fallthrough */
                        case AST_BRIDGE_FAILED_NOWARN:
                                nativefailed++;
@@ -4452,10 +4447,7 @@ int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *inte
        if (ast_moh_start_ptr)
                return ast_moh_start_ptr(chan, mclass, interpclass);
 
-       if (option_verbose > 2) {
-               ast_verbose(VERBOSE_PREFIX_3 "Music class %s requested but no musiconhold loaded.\n", 
-                       mclass ? mclass : (interpclass ? interpclass : "default"));
-       }
+       ast_verb(3, "Music class %s requested but no musiconhold loaded.\n", mclass ? mclass : (interpclass ? interpclass : "default"));
 
        return 0;
 }
index e9ba97fcc891dc6e09054e5beab150c45e47a013..4ce77798cb88d2b60babff0d1e7c4b28fc612f8f 100644 (file)
@@ -825,20 +825,16 @@ static struct ast_config *config_text_file_load(const char *database, const char
                        ast_log(LOG_WARNING, "'%s' is not a regular file, ignoring\n", fn);
                        continue;
                }
-               if (option_verbose > 1) {
-                       ast_verbose(VERBOSE_PREFIX_2 "Parsing '%s': ", fn);
+               ast_verb(2, "Parsing '%s': ", fn);
                        fflush(stdout);
-               }
                if (!(f = fopen(fn, "r"))) {
                        ast_debug(1, "No file to parse: %s\n", fn);
-                       if (option_verbose > 1)
-                               ast_verbose( "Not found (%s)\n", strerror(errno));
+                       ast_verb(2, "Not found (%s)\n", strerror(errno));
                        continue;
                }
                count++;
                ast_debug(1, "Parsing %s\n", fn);
-               if (option_verbose > 1)
-                       ast_verbose("Found\n");
+               ast_verb(2, "Found\n");
                while (!feof(f)) {
                        lineno++;
                        if (fgets(buf, sizeof(buf), f)) {
@@ -971,8 +967,7 @@ int config_text_file_save(const char *configfile, const struct ast_config *cfg,
 #else
        if ((f = fopen(fn, "w"))) {
 #endif     
-               if (option_verbose > 1)
-                       ast_verbose(VERBOSE_PREFIX_2 "Saving '%s': ", fn);
+               ast_verb(2, "Saving '%s': ", fn);
                fprintf(f, ";!\n");
                fprintf(f, ";! Automatically generated configuration file\n");
                if (strcmp(configfile, fn))
@@ -1024,12 +1019,11 @@ int config_text_file_save(const char *configfile, const struct ast_config *cfg,
 #endif
                        cat = cat->next;
                }
-               if ((option_verbose > 1) && !option_debug)
-                       ast_verbose("Saved\n");
+               if (!option_debug)
+                       ast_verb(2, "Saved\n");
        } else {
                ast_debug(1, "Unable to open for writing: %s\n", fn);
-               if (option_verbose > 1)
-                       ast_verbose(VERBOSE_PREFIX_2 "Unable to write (%s)", strerror(errno));
+               ast_verb(2, "Unable to write (%s)", strerror(errno));
                return -1;
        }
        fclose(f);
@@ -1078,9 +1072,7 @@ static int append_mapping(char *name, char *driver, char *database, char *table)
        }
        map->next = config_maps;
 
-       if (option_verbose > 1)
-               ast_verbose(VERBOSE_PREFIX_2 "Binding %s to %s/%s/%s\n",
-                           map->name, map->driver, map->database, map->table ? map->table : map->name);
+       ast_verb(2, "Binding %s to %s/%s/%s\n", map->name, map->driver, map->database, map->table ? map->table : map->name);
 
        config_maps = map;
        return 0;
index de30419baaef17fce604dfb087ee89ac39dbd95a..bde61ccb63c518ae86c41f5141b20563694dfdff 100644 (file)
@@ -284,8 +284,7 @@ static int begin_dial(struct ast_dial *dial, struct ast_channel *chan)
                        channel->owner = NULL;
                } else {
                        success++;
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", numsubst);
+                       ast_verb(3, "Called %s\n", numsubst);
                }
        }
 
@@ -320,56 +319,47 @@ static void handle_frame(struct ast_dial *dial, struct ast_dial_channel *channel
        if (fr->frametype == AST_FRAME_CONTROL) {
                switch (fr->subclass) {
                case AST_CONTROL_ANSWER:
-                       if (option_verbose > 2)
-                               ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", channel->owner->name, chan->name);
+                       ast_verb(3, "%s answered %s\n", channel->owner->name, chan->name);
                        AST_LIST_REMOVE(&dial->channels, channel, list);
                        AST_LIST_INSERT_HEAD(&dial->channels, channel, list);
                        set_state(dial, AST_DIAL_RESULT_ANSWERED);
                        break;
                case AST_CONTROL_BUSY:
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "%s is busy\n", channel->owner->name);
+                       ast_verb(3, "%s is busy\n", channel->owner->name);
                        ast_hangup(channel->owner);
                        channel->owner = NULL;
                        break;
                case AST_CONTROL_CONGESTION:
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "%s is circuit-busy\n", channel->owner->name);
+                       ast_verb(3, "%s is circuit-busy\n", channel->owner->name);
                        ast_hangup(channel->owner);
                        channel->owner = NULL;
                        break;
                case AST_CONTROL_RINGING:
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "%s is ringing\n", channel->owner->name);
+                       ast_verb(3, "%s is ringing\n", channel->owner->name);
                        if (!dial->options[AST_DIAL_OPTION_MUSIC])
                                ast_indicate(chan, AST_CONTROL_RINGING);
                        set_state(dial, AST_DIAL_RESULT_RINGING);
                        break;
                case AST_CONTROL_PROGRESS:
-                       if (option_verbose > 2)
-                               ast_verbose (VERBOSE_PREFIX_3 "%s is making progress, passing it to %s\n", channel->owner->name, chan->name);
+                       ast_verb(3, "%s is making progress, passing it to %s\n", channel->owner->name, chan->name);
                        ast_indicate(chan, AST_CONTROL_PROGRESS);
                        set_state(dial, AST_DIAL_RESULT_PROGRESS);
                        break;
                case AST_CONTROL_VIDUPDATE:
-                       if (option_verbose > 2)
-                               ast_verbose (VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", channel->owner->name, chan->name);
+                       ast_verb(3, "%s requested a video update, passing it to %s\n", channel->owner->name, chan->name);
                        ast_indicate(chan, AST_CONTROL_VIDUPDATE);
                        break;
                case AST_CONTROL_PROCEEDING:
-                       if (option_verbose > 2)
-                               ast_verbose (VERBOSE_PREFIX_3 "%s is proceeding, passing it to %s\n", channel->owner->name, chan->name);
+                       ast_verb(3, "%s is proceeding, passing it to %s\n", channel->owner->name, chan->name);
                        ast_indicate(chan, AST_CONTROL_PROCEEDING);
                        set_state(dial, AST_DIAL_RESULT_PROCEEDING);
                        break;
                case AST_CONTROL_HOLD:
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Call on %s placed on hold\n", chan->name);
+                       ast_verb(3, "Call on %s placed on hold\n", chan->name);
                        ast_indicate(chan, AST_CONTROL_HOLD);
                        break;
                case AST_CONTROL_UNHOLD:
-                       if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Call on %s left from hold\n", chan->name);
+                       ast_verb(3, "Call on %s left from hold\n", chan->name);
                        ast_indicate(chan, AST_CONTROL_UNHOLD);
                        break;
                case AST_CONTROL_OFFHOOK:
@@ -396,37 +386,31 @@ static void handle_frame_ownerless(struct ast_dial *dial, struct ast_dial_channe
 
        switch (fr->subclass) {
        case AST_CONTROL_ANSWER:
-               if (option_verbose > 2)
-                       ast_verbose( VERBOSE_PREFIX_3 "%s answered\n", channel->owner->name);
+               ast_verb(3, "%s answered\n", channel->owner->name);
                AST_LIST_REMOVE(&dial->channels, channel, list);
                AST_LIST_INSERT_HEAD(&dial->channels, channel, list);
                set_state(dial, AST_DIAL_RESULT_ANSWERED);
                break;
        case AST_CONTROL_BUSY:
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "%s is busy\n", channel->owner->name);
+               ast_verb(3, "%s is busy\n", channel->owner->name);
                ast_hangup(channel->owner);
                channel->owner = NULL;
                break;
        case AST_CONTROL_CONGESTION:
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "%s is circuit-busy\n", channel->owner->name);
+               ast_verb(3, "%s is circuit-busy\n", channel->owner->name);
                ast_hangup(channel->owner);
                channel->owner = NULL;
                break;
        case AST_CONTROL_RINGING:
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "%s is ringing\n", channel->owner->name);
+               ast_verb(3, "%s is ringing\n", channel->owner->name);
                set_state(dial, AST_DIAL_RESULT_RINGING);
                break;
        case AST_CONTROL_PROGRESS:
-               if (option_verbose > 2)
-                       ast_verbose (VERBOSE_PREFIX_3 "%s is making progress\n", channel->owner->name);
+               ast_verb(3, "%s is making progress\n", channel->owner->name);
                set_state(dial, AST_DIAL_RESULT_PROGRESS);
                break;
        case AST_CONTROL_PROCEEDING:
-               if (option_verbose > 2)
-                       ast_verbose (VERBOSE_PREFIX_3 "%s is proceeding\n", channel->owner->name);
+               ast_verb(3, "%s is proceeding\n", channel->owner->name);
                set_state(dial, AST_DIAL_RESULT_PROCEEDING);
                break;
        default:
index 4270bb0c6308c784dc8a9b8a733073334f2ca5f9..d3eb9a50f775a5909ddb2562748f6e71b84de926 100644 (file)
@@ -113,8 +113,7 @@ void ast_dnsmgr_release(struct ast_dnsmgr_entry *entry)
        AST_RWLIST_WRLOCK(&entry_list);
        AST_RWLIST_REMOVE(&entry_list, entry, list);
        AST_RWLIST_UNLOCK(&entry_list);
-       if (option_verbose > 3)
-               ast_verbose(VERBOSE_PREFIX_4 "removing dns manager for '%s'\n", entry->name);
+       ast_verb(4, "removing dns manager for '%s'\n", entry->name);
 
        ast_mutex_destroy(&entry->lock);
        ast_free(entry);
@@ -131,8 +130,7 @@ int ast_dnsmgr_lookup(const char *name, struct in_addr *result, struct ast_dnsmg
        if (*dnsmgr && !strcasecmp((*dnsmgr)->name, name))
                return 0;
 
-       if (option_verbose > 3)
-               ast_verbose(VERBOSE_PREFIX_4 "doing dnsmgr_lookup for '%s'\n", name);
+       ast_verb(4, "doing dnsmgr_lookup for '%s'\n", name);
 
        /* if it's actually an IP address and not a name,
           there's no need for a managed lookup */
@@ -147,8 +145,7 @@ int ast_dnsmgr_lookup(const char *name, struct in_addr *result, struct ast_dnsmg
        if (!enabled)
                return 0;
        
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_2 "adding dns manager for '%s'\n", name);
+       ast_verb(3, "adding dns manager for '%s'\n", name);
        *dnsmgr = ast_dnsmgr_get(name, result);
        return !*dnsmgr;
 }
@@ -166,8 +163,8 @@ static int dnsmgr_refresh(struct ast_dnsmgr_entry *entry, int verbose)
        int changed = 0;
         
        ast_mutex_lock(&entry->lock);
-       if (verbose && (option_verbose > 2))
-               ast_verbose(VERBOSE_PREFIX_2 "refreshing '%s'\n", entry->name);
+       if (verbose)
+               ast_verb(3, "refreshing '%s'\n", entry->name);
 
        if ((hp = ast_gethostbyname(entry->name, &ahp))) {
                /* check to see if it has changed, do callback if requested (where de callback is defined ????) */
@@ -232,8 +229,7 @@ static int refresh_list(void *data)
                return -1;
        }
 
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_2 "Refreshing DNS lookups.\n");
+       ast_verb(3, "Refreshing DNS lookups.\n");
        AST_RWLIST_RDLOCK(info->entries);
        AST_RWLIST_TRAVERSE(info->entries, entry, list) {
                if (info->regex_present && regexec(&info->filter, entry->name, 0, NULL, 0))
index 699df5aa960dbc9e8f6db0eb5ec69c939a4fcfba..94760b89cb31448a22ef28cf0dc29b19431ef6d7 100644 (file)
@@ -97,8 +97,7 @@ int __ast_format_register(const struct ast_format *f, struct ast_module *mod)
 
        AST_RWLIST_INSERT_HEAD(&formats, tmp, list);
        AST_RWLIST_UNLOCK(&formats);
-       if (option_verbose > 1)
-               ast_verbose( VERBOSE_PREFIX_2 "Registered file format %s, extension(s) %s\n", f->name, f->exts);
+       ast_verb(2, "Registered file format %s, extension(s) %s\n", f->name, f->exts);
 
        return 0;
 }
@@ -119,10 +118,9 @@ int ast_format_unregister(const char *name)
        AST_RWLIST_TRAVERSE_SAFE_END
        AST_RWLIST_UNLOCK(&formats);
 
-       if (!res) {
-               if (option_verbose > 1)
-                       ast_verbose( VERBOSE_PREFIX_2 "Unregistered format %s\n", name);
-       } else
+       if (!res)
+               ast_verb(2, "Unregistered format %s\n", name);
+       else
                ast_log(LOG_WARNING, "Tried to unregister format %s, already unregistered\n", name);
 
        return res;
@@ -797,8 +795,7 @@ int ast_streamfile(struct ast_channel *chan, const char *filename, const char *p
                ast_playstream(fs);
                if (vfs)
                        ast_playstream(vfs);
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "<%s> Playing '%s.%s' (language '%s')\n", chan->name, filename, ast_getformatname(chan->writeformat), preflang ? preflang : "default");
+               ast_verb(3, "<%s> Playing '%s.%s' (language '%s')\n", chan->name, filename, ast_getformatname(chan->writeformat), preflang ? preflang : "default");
 
                return 0;
        }
index a0a410048bb6f44b1cd4b45e26b7d9b55ea8d956..718d463a98fb6d5892251f888dd2d03508bc8794 100644 (file)
@@ -51,8 +51,7 @@ static AST_RWLIST_HEAD_STATIC(imagers, ast_imager);
 
 int ast_image_register(struct ast_imager *img)
 {
-       if (option_verbose > 1)
-               ast_verbose(VERBOSE_PREFIX_2 "Registered format '%s' (%s)\n", img->name, img->desc);
+       ast_verb(2, "Registered format '%s' (%s)\n", img->name, img->desc);
        AST_RWLIST_WRLOCK(&imagers);
        AST_RWLIST_INSERT_HEAD(&imagers, img, list);
        AST_RWLIST_UNLOCK(&imagers);
@@ -72,8 +71,8 @@ void ast_image_unregister(struct ast_imager *img)
        }
        AST_RWLIST_TRAVERSE_SAFE_END
        AST_RWLIST_UNLOCK(&imagers);
-       if (i && (option_verbose > 1))
-               ast_verbose(VERBOSE_PREFIX_2 "Unregistered format '%s' (%s)\n", img->name, img->desc);
+       if (i)
+               ast_verb(2, "Unregistered format '%s' (%s)\n", img->name, img->desc);
 }
 
 int ast_supports_images(struct ast_channel *chan)
index cc714707f5f3b35e095341b8118d08b91ea6f079..61f3328b53a36129aa89604db97e7de03158516b 100644 (file)
@@ -369,8 +369,7 @@ int ast_set_indication_country(const char *country)
        if (!country || !(zone = ast_get_indication_zone(country)))
                return 1;
        
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "Setting default indication country to '%s'\n", country);
+       ast_verb(3, "Setting default indication country to '%s'\n", country);
 
        /* Protect the current tonezone using the tone_zones lock as well */
        AST_RWLIST_WRLOCK(&tone_zones);
@@ -494,8 +493,7 @@ int ast_register_indication_country(struct ind_tone_zone *zone)
        /* It's all over. */
        AST_RWLIST_UNLOCK(&tone_zones);
 
-       if (option_verbose > 2)
-               ast_verbose(VERBOSE_PREFIX_3 "Registered indication country '%s'\n", zone->country);
+       ast_verb(3, "Registered indication country '%s'\n", zone->country);
 
        return 0;
 }
@@ -518,8 +516,7 @@ int ast_unregister_indication_country(const char *country)
                }
                /* Remove from the list */
                AST_RWLIST_REMOVE_CURRENT(&tone_zones, list);
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Unregistered indication country '%s'\n", tz->country);
+               ast_verb(3, "Unregistered indication country '%s'\n", tz->country);
                free_zone(tz);
                res = 0;
        }
index 2e6457285274319aa9d8ab72b11ade83fe2efc4c..f3db6841cfeeb003db70520dd72e43ea4b6fd2e7 100644 (file)
@@ -583,8 +583,7 @@ int ast_module_reload(const char *name)
                }
 
                res = 2;
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Reloading module '%s' (%s)\n", cur->resource, info->description);
+               ast_verb(3, "Reloading module '%s' (%s)\n", cur->resource, info->description);
                info->reload();
        }
        AST_LIST_UNLOCK(&module_list);
@@ -665,13 +664,11 @@ static enum ast_module_load_result load_resource(const char *resource_name, unsi
        switch (res) {
        case AST_MODULE_LOAD_SUCCESS:
                if (!ast_fully_booted) {
-                       if (option_verbose)
-                               ast_verbose("%s => (%s)\n", resource_name, term_color(tmp, mod->info->description, COLOR_BROWN, COLOR_BLACK, sizeof(tmp)));
+                       ast_verb(1, "%s => (%s)\n", resource_name, term_color(tmp, mod->info->description, COLOR_BROWN, COLOR_BLACK, sizeof(tmp)));
                        if (ast_opt_console && !option_verbose)
                                ast_verbose( ".");
                } else {
-                       if (option_verbose)
-                               ast_verbose(VERBOSE_PREFIX_1 "Loaded %s => (%s)\n", resource_name, mod->info->description);
+                       ast_verb(1, "Loaded %s => (%s)\n", resource_name, mod->info->description);
                }
 
                mod->flags.running = 1;
@@ -742,8 +739,7 @@ int load_modules(unsigned int preload_only)
        /* all embedded modules have registered themselves by now */
        embedding = 0;
 
-       if (option_verbose)
-               ast_verbose("Asterisk Dynamic Loader Starting:\n");
+       ast_verb(1, "Asterisk Dynamic Loader Starting:\n");
 
        AST_LIST_HEAD_INIT_NOLOCK(&load_order);
 
index 6f09975192d46029f70db267881b11023d9198d4..9bddd48720628f2cc0b1d9e4eae0c6857fc68377 100644 (file)
@@ -1482,11 +1482,8 @@ static int action_login(struct mansession *s, const struct message *m)
                return -1;
        }
        s->authenticated = 1;
-       if (option_verbose > 1) {
-               if (manager_displayconnects(s)) {
-                       ast_verbose(VERBOSE_PREFIX_2 "%sManager '%s' logged on from %s\n", (s->managerid ? "HTTP " : ""), s->username, ast_inet_ntoa(s->sin.sin_addr));
-               }
-       }
+       if (manager_displayconnects(s))
+               ast_verb(2, "%sManager '%s' logged on from %s\n", (s->managerid ? "HTTP " : ""), s->username, ast_inet_ntoa(s->sin.sin_addr));
        ast_log(LOG_EVENT, "%sManager '%s' logged on from %s\n", (s->managerid ? "HTTP " : ""), s->username, ast_inet_ntoa(s->sin.sin_addr));
        astman_send_ack(s, m, "Authentication accepted");
        return 0;
@@ -2526,16 +2523,12 @@ static void *session_do(void *data)
        }
        /* session is over, explain why and terminate */
        if (s->authenticated) {
-               if (option_verbose > 1) {
                        if (manager_displayconnects(s))
-                               ast_verbose(VERBOSE_PREFIX_2 "Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr));
-               }
+                       ast_verb(2, "Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr));
                ast_log(LOG_EVENT, "Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr));
        } else {
-               if (option_verbose > 1) {
                        if (displayconnects)
-                               ast_verbose(VERBOSE_PREFIX_2 "Connect attempt from '%s' unable to authenticate\n", ast_inet_ntoa(s->sin.sin_addr));
-               }
+                       ast_verb(2, "Connect attempt from '%s' unable to authenticate\n", ast_inet_ntoa(s->sin.sin_addr));
                ast_log(LOG_EVENT, "Failed attempt from %s\n", ast_inet_ntoa(s->sin.sin_addr));
        }
        destroy_session(s);
@@ -2557,7 +2550,7 @@ static void purge_sessions(int n_max)
                        AST_LIST_REMOVE_CURRENT(&sessions, list);
                        ast_atomic_fetchadd_int(&num_sessions, -1);
                        if (s->authenticated && (option_verbose > 1) && manager_displayconnects(s)) {
-                               ast_verbose(VERBOSE_PREFIX_2 "HTTP Manager '%s' timed out from %s\n",
+                               ast_verb(2, "HTTP Manager '%s' timed out from %s\n",
                                        s->username, ast_inet_ntoa(s->sin.sin_addr));
                        }
                        free_session(s);        /* XXX outside ? */
@@ -2680,8 +2673,7 @@ int ast_manager_unregister(char *action)
                        else
                                first_action = cur->next;
                        ast_free(cur);
-                       if (option_verbose > 1)
-                               ast_verbose(VERBOSE_PREFIX_2 "Manager unregistered action %s\n", action);
+                       ast_verb(2, "Manager unregistered action %s\n", action);
                        break;
                }
        }
@@ -2721,8 +2713,7 @@ static int ast_manager_register_struct(struct manager_action *act)
                first_action = act;
        act->next = cur;
 
-       if (option_verbose > 1)
-               ast_verbose(VERBOSE_PREFIX_2 "Manager registered action %s\n", act->action);
+       ast_verb(2, "Manager registered action %s\n", act->action);
        ast_rwlock_unlock(&actionlock);
        return 0;
 }
@@ -3091,16 +3082,12 @@ static struct ast_str *generic_http_callback(enum output_format format,
 
        if (process_message(s, &m)) {
                if (s->authenticated) {
-                       if (option_verbose > 1) {
                                if (manager_displayconnects(s))
-                                       ast_verbose(VERBOSE_PREFIX_2 "HTTP Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr));
-                       }
+                               ast_verb(2, "HTTP Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr));
                        ast_log(LOG_EVENT, "HTTP Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr));
                } else {
-                       if (option_verbose > 1) {
                                if (displayconnects)
-                                       ast_verbose(VERBOSE_PREFIX_2 "HTTP Connect attempt from '%s' unable to authenticate\n", ast_inet_ntoa(s->sin.sin_addr));
-                       }
+                               ast_verb(2, "HTTP Connect attempt from '%s' unable to authenticate\n", ast_inet_ntoa(s->sin.sin_addr));
                        ast_log(LOG_EVENT, "HTTP Failed attempt from %s\n", ast_inet_ntoa(s->sin.sin_addr));
                }
                s->needdestroy = 1;
index 52b0dcaac675804ab7c0eab1e1105c8819d628d4..c3c7acaedc3faccf3e8790abac212da0ed15d076 100644 (file)
@@ -3761,12 +3761,10 @@ enum ast_bridge_result ast_rtp_bridge(struct ast_channel *c0, struct ast_channel
                        return AST_BRIDGE_FAILED_NOWARN;
                }
 
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Packet2Packet bridging %s and %s\n", c0->name, c1->name);
+               ast_verb(3, "Packet2Packet bridging %s and %s\n", c0->name, c1->name);
                res = bridge_p2p_loop(c0, c1, p0, p1, timeoutms, flags, fo, rc, pvt0, pvt1);
        } else {
-               if (option_verbose > 2) 
-                       ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name);
+               ast_verb(3, "Native bridging %s and %s\n", c0->name, c1->name);
                res = bridge_native_loop(c0, c1, p0, p1, vp0, vp1, tp0, tp1, pr0, pr1, codec0, codec1, timeoutms, flags, fo, rc, pvt0, pvt1);
        }
 
@@ -4046,8 +4044,7 @@ int ast_rtp_reload(void)
                rtpstart = 5000;
                rtpend = 31000;
        }
-       if (option_verbose > 1)
-               ast_verbose(VERBOSE_PREFIX_2 "RTP Allocating from port range %d -> %d\n", rtpstart, rtpend);
+       ast_verb(2, "RTP Allocating from port range %d -> %d\n", rtpstart, rtpend);
        return 0;
 }
 
index 85fa93abcd47c7b54b2c499b01370a010562cb23..3ad8e7327b0891a460227d70aa9b8000a6244431 100644 (file)
@@ -1234,7 +1234,7 @@ static int ast_say_number_full_he(struct ast_channel *chan, int num,
        int state = 0; /* no need to save anything */
        int mf = 1;    /* +1 = Masculin; -1 = Feminin */
        char fn[SAY_NUM_BUF_SIZE] = "";
-       ast_verbose(VERBOSE_PREFIX_3 "ast_say_digits_full: started. "
+       ast_verb(3, "ast_say_digits_full: started. "
                "num: %d, options=\"%s\"\n",
                num, options
        );
@@ -1253,7 +1253,7 @@ static int ast_say_number_full_he(struct ast_channel *chan, int num,
                 * state==0 is the normal mode and it means that we continue
                 * to check if the number num has yet anything left.
                 */
-               ast_verbose(VERBOSE_PREFIX_3 "ast_say_digits_full: num: %d, "
+               ast_verb(3, "ast_say_digits_full: num: %d, "
                        "state=%d, options=\"%s\", mf=%d\n",
                        num, state, options, mf
                );
index 7cf072cda712896c5101e57a00458b4b710201fc..4fe85a070ed6b1715ead8559f16668acb0868126 100644 (file)
@@ -82,8 +82,7 @@ static int parse_srv(char *host, int hostlen, int *portno, unsigned char *answer
                return -1;
        }
        if (res && strcmp(repl, ".")) {
-               if (option_verbose > 3)
-                       ast_verbose( VERBOSE_PREFIX_3 "parse_srv: SRV mapped to host %s, port %d\n", repl, ntohs(srv->portnum));
+               ast_verb(3, "parse_srv: SRV mapped to host %s, port %d\n", repl, ntohs(srv->portnum));
                if (host) {
                        ast_copy_string(host, repl, hostlen);
                        host[hostlen-1] = '\0';
index 49ac519be93f844714e00dc6391b60310f186f6d..3f9ffd764819dc05e8c00ee3c3c265d8700a0d4a 100644 (file)
@@ -573,6 +573,7 @@ int __ast_register_translator(struct ast_translator *t, struct ast_module *mod)
 {
        static int added_cli = 0;
        struct ast_translator *u;
+       char tmp[80];
 
        if (!mod) {
                ast_log(LOG_WARNING, "Missing module pointer, you need to supply one\n");
@@ -626,13 +627,9 @@ int __ast_register_translator(struct ast_translator *t, struct ast_module *mod)
   
        calc_cost(t, 1);
 
-       if (option_verbose > 1) {
-               char tmp[80];
-
-               ast_verbose(VERBOSE_PREFIX_2 "Registered translator '%s' from format %s to %s, cost %d\n",
+       ast_verb(2, "Registered translator '%s' from format %s to %s, cost %d\n",
                            term_color(tmp, t->name, COLOR_MAGENTA, COLOR_BLACK, sizeof(tmp)),
                            ast_getformatname(1 << t->srcfmt), ast_getformatname(1 << t->dstfmt), t->cost);
-       }
 
        if (!added_cli) {
                ast_cli_register_multiple(cli_translate, sizeof(cli_translate) / sizeof(struct ast_cli_entry));
@@ -676,8 +673,7 @@ int ast_unregister_translator(struct ast_translator *t)
        AST_RWLIST_TRAVERSE_SAFE_BEGIN(&translators, u, list) {
                if (u == t) {
                        AST_RWLIST_REMOVE_CURRENT(&translators, list);
-                       if (option_verbose > 1)
-                               ast_verbose(VERBOSE_PREFIX_2 "Unregistered translator '%s' from format %s to %s\n", term_color(tmp, t->name, COLOR_MAGENTA, COLOR_BLACK, sizeof(tmp)), ast_getformatname(1 << t->srcfmt), ast_getformatname(1 << t->dstfmt));
+                       ast_verb(2, "Unregistered translator '%s' from format %s to %s\n", term_color(tmp, t->name, COLOR_MAGENTA, COLOR_BLACK, sizeof(tmp)), ast_getformatname(1 << t->srcfmt), ast_getformatname(1 << t->dstfmt));
                        found = 1;
                        break;
                }
index 75edfcabd73ae3fa5b8d58215528ca507fa38d62..2385679a8ab5398dd67b30ad02929f19718fc91a 100644 (file)
@@ -702,8 +702,7 @@ struct ast_frame *ast_udptl_read(struct ast_udptl *udptl)
        }
 
        if (udptl_debug_test_addr(&sin)) {
-               if (option_verbose)
-                       ast_verbose("Got UDPTL packet from %s:%d (type %d, seq %d, len %d)\n",
+               ast_verb(1, "Got UDPTL packet from %s:%d (type %d, seq %d, len %d)\n",
                                ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port), 0, seqno, res);
        }
 #if 0
@@ -1256,8 +1255,7 @@ void ast_udptl_reload(void)
                udptlstart = 4500;
                udptlend = 4999;
        }
-       if (option_verbose > 1)
-               ast_verbose(VERBOSE_PREFIX_2 "UDPTL allocating from port range %d -> %d\n", udptlstart, udptlend);
+       ast_verb(2, "UDPTL allocating from port range %d -> %d\n", udptlstart, udptlend);
 }
 
 void ast_udptl_init(void)
index 9f0df3a81c6ebb38e656ac8d833754c61769b204..b37c4ed290346c216ff1593430bae52ae4a8564b 100644 (file)
@@ -1634,11 +1634,9 @@ static int handle_command_response(struct dundi_transaction *trans, struct dundi
                                        ntohs(trans->addr.sin_port), expire);
                                ast_db_put("dundi/dpeers", dundi_eid_to_str_short(eid_str, sizeof(eid_str), &peer->eid), data);
                                if (inaddrcmp(&peer->addr, &trans->addr)) {
-                                       if (option_verbose > 2) {
-                                               ast_verbose(VERBOSE_PREFIX_3 "Registered DUNDi peer '%s' at '%s:%d'\n", 
+                                       ast_verb(3, "Registered DUNDi peer '%s' at '%s:%d'\n",
                                                        dundi_eid_to_str(eid_str, sizeof(eid_str), &peer->eid), 
                                                        ast_inet_ntoa(trans->addr.sin_addr), ntohs(trans->addr.sin_port));
-                                       }
                                        needqual = 1;
                                }
                                        
@@ -4796,10 +4794,7 @@ static int load_module(void)
        ast_custom_function_register(&dundi_query_function);
        ast_custom_function_register(&dundi_result_function);
        
-       if (option_verbose > 1) {
-               ast_verbose(VERBOSE_PREFIX_2 "DUNDi Ready and Listening on %s port %d\n", 
-                       ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
-       }
+       ast_verb(2, "DUNDi Ready and Listening on %s port %d\n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
 
        return AST_MODULE_LOAD_SUCCESS;
 }
index 9f9a1899efe9d49d22afa2f26b29652875fe49e8..e1cb6dc5a24e81c0c06e985ef6435734c94d462d 100644 (file)
@@ -313,8 +313,7 @@ static void exit_now(GtkWidget *widget, gpointer data)
        ast_update_use_count();
        ast_unregister_verbose(verboser);
        ast_unload_resource("pbx_gtkconsole", 0);
-       if (option_verbose > 1)
-               ast_verbose(VERBOSE_PREFIX_2 "GTK Console Monitor Exiting\n");
+       ast_verb(2, "GTK Console Monitor Exiting\n");
        /* XXX Trying to quit after calling this makes asterisk segfault XXX */
 }
 
@@ -488,15 +487,14 @@ static int load_module(void *mod)
                if (!show_console()) {
                        inuse++;
                        ast_update_use_count();
-                       if (option_verbose > 1)
-                               ast_verbose( VERBOSE_PREFIX_2 "Launched GTK Console monitor\n");                
+                       ast_verb(2, "Launched GTK Console monitor\n");
                } else
                        ast_log(LOG_WARNING, "Unable to start GTK console\n");
        } else {
                if (option_debug)
                        ast_log(LOG_DEBUG, "Unable to start GTK console monitor -- ignoring\n");
-               else if (option_verbose > 1)
-                       ast_verbose( VERBOSE_PREFIX_2 "GTK is not available -- skipping monitor\n");
+               else
+                       ast_verb(2, "GTK is not available -- skipping monitor\n");
        }
        return 0;
 }
index d1011fe8ebb159c3a7aaf31305c1b3c171bcb39e..10737985130aa2193d060ede75890fdc284a28d2 100644 (file)
@@ -198,8 +198,7 @@ static int realtime_exec(struct ast_channel *chan, const char *context, const ch
 
                                if(!ast_strlen_zero(tmp))
                                        pbx_substitute_variables_helper(chan, tmp, appdata, sizeof(appdata) - 1);
-                               if (option_verbose > 2)
-                                       ast_verbose( VERBOSE_PREFIX_3 "Executing %s(\"%s\", \"%s\")\n",
+                               ast_verb(3, "Executing %s(\"%s\", \"%s\")\n",
                                                 term_color(tmp1, app, COLOR_BRCYAN, 0, sizeof(tmp1)),
                                                 term_color(tmp2, chan->name, COLOR_BRMAGENTA, 0, sizeof(tmp2)),
                                                 term_color(tmp3, S_OR(appdata, ""), COLOR_BRMAGENTA, 0, sizeof(tmp3)));
index 00e97e4db0181b23f5bfb8c2cd2528c74ea355ba..e5ccddb474b55da0189ec4ca1ca37c984e556fcd 100644 (file)
@@ -329,12 +329,10 @@ static void *attempt_thread(void *data)
        struct outgoing *o = data;
        int res, reason;
        if (!ast_strlen_zero(o->app)) {
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Attempting call on %s/%s for application %s(%s) (Retry %d)\n", o->tech, o->dest, o->app, o->data, o->retries);
+               ast_verb(3, "Attempting call on %s/%s for application %s(%s) (Retry %d)\n", o->tech, o->dest, o->app, o->data, o->retries);
                res = ast_pbx_outgoing_app(o->tech, AST_FORMAT_SLINEAR, o->dest, o->waittime * 1000, o->app, o->data, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
        } else {
-               if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Attempting call on %s/%s for %s@%s:%d (Retry %d)\n", o->tech, o->dest, o->exten, o->context,o->priority, o->retries);
+               ast_verb(3, "Attempting call on %s/%s for %s@%s:%d (Retry %d)\n", o->tech, o->dest, o->exten, o->context,o->priority, o->retries);
                res = ast_pbx_outgoing_exten(o->tech, AST_FORMAT_SLINEAR, o->dest, o->waittime * 1000, o->context, o->exten, o->priority, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
        }
        if (res) {
index 44ff18d435276a3fc7c7f8ef9b3a832b9040c6d3..eedad42138b8ef23051a73623a7c247f001d664b 100644 (file)
@@ -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 */
index 2c8b90e3d34cc9f1ed3503f0bc4599d879cf74d9..a5294eb02b41e79968118731a39425f9b3016214 100644 (file)
@@ -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;
 }
 
index 4b9c1898f4b77c4726044d092c14d3febe87ce4f..2fb0a0e38fc4de4642b4d001e820f95b651a5730 100644 (file)
@@ -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);
index cdb027acba515eeaf6d6a87fe2018fab76d37d6b..65c5b768dbbfada5b4925d1440c8712f6b49c01f 100644 (file)
@@ -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
index 3f71bfadfeb380be78292a5bbc3ba5392b58f82d..ef8e81b69f521d482d1459e3a5c11796568921fa 100644 (file)
@@ -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();
index 2520f02abababb75108c6b35ca0d846d5c2317d5..df8c1c635adcfeef26b5f00119c75663443bc600 100644 (file)
@@ -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);
index 84a44f3b75e1b816f3267f6a3312de64ee4e5af1..8f51e77afac872a415a2316d757b91efbc3af81d 100644 (file)
@@ -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))) {
index 951c2835eb4c43daeee87e40df6a5b5b474ad6aa..f1f1b193e7c0e8940da43c53e112671c6efe84a8 100644 (file)
@@ -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);
index b820c98acbf277b0887cfa15bc54a01bdfe12127..05c483ec56686c3966a42f0cd659e3879f14af02 100644 (file)
@@ -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);
index 9047ad254d7f689f16b8ebf931a9f9d37ac3b5c5..cf830344f8e943e6eceeacad154b2404f64fc4a5 100644 (file)
@@ -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;