aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-26 15:49:18 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-26 15:49:18 +0000
commit4f3c4dc7f238b64a21172be86266311c9c645c77 (patch)
treede4bd130dafa592858306d2ac6bcc5f85fd51cc8 /apps
parent07772bc9e3ef6636a3e99e07d2aea3a06988f0c9 (diff)
Do a massive conversion for using the ast_verb() macro
(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: http://svn.digium.com/svn/asterisk/trunk@77299 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_adsiprog.c12
-rw-r--r--apps/app_alarmreceiver.c27
-rw-r--r--apps/app_amd.c21
-rw-r--r--apps/app_chanspy.c6
-rw-r--r--apps/app_db.c21
-rw-r--r--apps/app_dial.c128
-rw-r--r--apps/app_flash.c3
-rw-r--r--apps/app_followme.c67
-rw-r--r--apps/app_getcpeid.c6
-rw-r--r--apps/app_macro.c9
-rw-r--r--apps/app_meetme.c5
-rw-r--r--apps/app_parkandannounce.c24
-rw-r--r--apps/app_queue.c54
-rw-r--r--apps/app_read.c16
-rw-r--r--apps/app_rpt.c39
-rw-r--r--apps/app_sms.c30
-rw-r--r--apps/app_voicemail.c37
-rw-r--r--apps/app_waitforring.c6
-rw-r--r--apps/app_waitforsilence.c9
-rw-r--r--apps/app_while.c3
-rw-r--r--apps/app_zapras.c9
-rw-r--r--apps/app_zapscan.c8
22 files changed, 190 insertions, 350 deletions
diff --git a/apps/app_adsiprog.c b/apps/app_adsiprog.c
index eee3b3302..b19ae4714 100644
--- a/apps/app_adsiprog.c
+++ b/apps/app_adsiprog.c
@@ -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);
}
diff --git a/apps/app_alarmreceiver.c b/apps/app_alarmreceiver.c
index 14f417dcb..b48c8dba3 100644
--- a/apps/app_alarmreceiver.c
+++ b/apps/app_alarmreceiver.c
@@ -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);
diff --git a/apps/app_amd.c b/apps/app_amd.c
index 9a32f9032..c2190dc60 100644
--- a/apps/app_amd.c
+++ b/apps/app_amd.c
@@ -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 );
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 788174515..4d6622c8b 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -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) {
diff --git a/apps/app_db.c b/apps/app_db.c
index b6cead568..f7d2ceaf5 100644
--- a/apps/app_db.c
+++ b/apps/app_db.c
@@ -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");
}
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 0acdc1751..a302aa00a 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -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++;
diff --git a/apps/app_flash.c b/apps/app_flash.c
index d35988fd5..32c2b7dce 100644
--- a/apps/app_flash.c
+++ b/apps/app_flash.c
@@ -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
diff --git a/apps/app_followme.c b/apps/app_followme.c
index b2b03e31f..ac3807f3b 100644
--- a/apps/app_followme.c
+++ b/apps/app_followme.c
@@ -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();
diff --git a/apps/app_getcpeid.c b/apps/app_getcpeid.c
index 9342a58ed..ba67bd9b8 100644
--- a/apps/app_getcpeid.c
+++ b/apps/app_getcpeid.c
@@ -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;
}
}
diff --git a/apps/app_macro.c b/apps/app_macro.c
index aa24dd94c..923bd583f 100644
--- a/apps/app_macro.c
+++ b/apps/app_macro.c
@@ -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;
}
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index 207ddf61a..63e8be49d 100644
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -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);
}
}
diff --git a/apps/app_parkandannounce.c b/apps/app_parkandannounce.c
index d7d5fc787..235bde926 100644
--- a/apps/app_parkandannounce.c
+++ b/apps/app_parkandannounce.c
@@ -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 {
diff --git a/apps/app_queue.c b/apps/app_queue.c
index e5bfc9ccf..44faf2203 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -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;
diff --git a/apps/app_read.c b/apps/app_read.c
index e6c364873..313cd497e 100644
--- a/apps/app_read.c
+++ b/apps/app_read.c
@@ -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");
}
}
}
diff --git a/apps/app_rpt.c b/apps/app_rpt.c
index 5ef62d9e5..9443bb151 100644
--- a/apps/app_rpt.c
+++ b/apps/app_rpt.c
@@ -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);
diff --git a/apps/app_sms.c b/apps/app_sms.c
index 9c645379b..21a96cb14 100644
--- a/apps/app_sms.c
+++ b/apps/app_sms.c
@@ -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 */
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 83c0323bd..e8c347fc9 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -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)
diff --git a/apps/app_waitforring.c b/apps/app_waitforring.c
index dd1c98047..1378c3e5f 100644
--- a/apps/app_waitforring.c
+++ b/apps/app_waitforring.c
@@ -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;
}
diff --git a/apps/app_waitforsilence.c b/apps/app_waitforsilence.c
index a6a7650c6..8aca88650 100644
--- a/apps/app_waitforsilence.c
+++ b/apps/app_waitforsilence.c
@@ -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;
diff --git a/apps/app_while.c b/apps/app_while.c
index f7da65b19..12f5f63fe 100644
--- a/apps/app_while.c
+++ b/apps/app_while.c
@@ -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);
diff --git a/apps/app_zapras.c b/apps/app_zapras.c
index 95b34d820..448c45b7b 100644
--- a/apps/app_zapras.c
+++ b/apps/app_zapras.c
@@ -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);
}
diff --git a/apps/app_zapscan.c b/apps/app_zapscan.c
index 76cfbe3b0..1530d7f7b 100644
--- a/apps/app_zapscan.c
+++ b/apps/app_zapscan.c
@@ -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,'-'))) {