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 eee3b33..b19ae47 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 14f417d..b48c8db 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 9a32f90..c2190dc 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 7881745..4d6622c 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 b6cead5..f7d2cea 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 0acdc17..a302aa0 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 d35988f..32c2b7d 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 b2b03e3..ac3807f 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 9342a58..ba67bd9 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 aa24dd9..923bd58 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 207ddf6..63e8be4 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 d7d5fc7..235bde9 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 e5bfc9c..44faf22 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 e6c3648..313cd49 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 5ef62d9..9443bb1 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 9c64537..21a96cb 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 83c0323..e8c347f 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 dd1c980..1378c3e 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 a6a7650..8aca886 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 f7da65b..12f5f63 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 95b34d8..448c45b 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 76cfbe3..1530d7f 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 9814079..8c3b1e5 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 6800027..1ba24f5 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 54840c5..6b3db5c 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 de8f3ff..d3decea 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 d43fc77..4e38a4e 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 dc77f1d..1af3565 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 76744cc..2490cb1 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 9fac67d..61a4198 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 b101ed8..9dc2fca 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 cf68d1d..a3f82bb 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 d375657..bbc6ea5 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 67ab62b..258e1f6 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 3cc76d6..02c3faf 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&