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: https://origsvn.digium.com/svn/asterisk/trunk@77299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant 2007-07-26 15:49:18 +00:00
parent 51e7035dfe
commit f8483a0d04
79 changed files with 791 additions and 1483 deletions

View File

@ -1448,8 +1448,7 @@ static int adsi_prog(struct ast_channel *chan, char *script)
/* Now begin the download attempt */ /* Now begin the download attempt */
if (ast_adsi_begin_download(chan, scr->desc, scr->fdn, scr->sec, scr->ver)) { if (ast_adsi_begin_download(chan, scr->desc, scr->fdn, scr->sec, scr->ver)) {
/* User rejected us for some reason */ /* User rejected us for some reason */
if (option_verbose > 2) ast_verb(3, "User rejected download attempt\n");
ast_verbose(VERBOSE_PREFIX_3 "User rejected download attempt\n");
ast_log(LOG_NOTICE, "User rejected download on channel %s\n", chan->name); ast_log(LOG_NOTICE, "User rejected download on channel %s\n", chan->name);
ast_free(scr); ast_free(scr);
return -1; return -1;
@ -1535,8 +1534,7 @@ static int adsi_prog(struct ast_channel *chan, char *script)
return -1; return -1;
if (ast_adsi_end_download(chan)) { if (ast_adsi_end_download(chan)) {
/* Download failed for some reason */ /* Download failed for some reason */
if (option_verbose > 2) ast_verb(3, "Download attempt failed\n");
ast_verbose(VERBOSE_PREFIX_3 "Download attempt failed\n");
ast_log(LOG_NOTICE, "Download failed on %s\n", chan->name); ast_log(LOG_NOTICE, "Download failed on %s\n", chan->name);
ast_free(scr); ast_free(scr);
return -1; return -1;
@ -1554,11 +1552,9 @@ static int adsi_exec(struct ast_channel *chan, void *data)
data = "asterisk.adsi"; data = "asterisk.adsi";
if (!ast_adsi_available(chan)) { if (!ast_adsi_available(chan)) {
if (option_verbose > 2) ast_verb(3, "ADSI Unavailable on CPE. Not bothering to try.\n");
ast_verbose(VERBOSE_PREFIX_3 "ADSI Unavailable on CPE. Not bothering to try.\n");
} else { } else {
if (option_verbose > 2) ast_verb(3, "ADSI Available on CPE. Attempting Upload.\n");
ast_verbose(VERBOSE_PREFIX_3 "ADSI Available on CPE. Attempting Upload.\n");
res = adsi_prog(chan, data); res = adsi_prog(chan, data);
} }

View File

@ -118,8 +118,7 @@ static void database_increment( char *key )
res = ast_db_get(db_family, key, value, sizeof(value) - 1); res = ast_db_get(db_family, key, value, sizeof(value) - 1);
if(res){ if(res){
if(option_verbose >= 4) ast_verb(4, "AlarmReceiver: Creating database entry %s and setting to 1\n", key);
ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Creating database entry %s and setting to 1\n", key);
/* Guess we have to create it */ /* Guess we have to create it */
res = ast_db_put(db_family, key, "1"); res = ast_db_put(db_family, key, "1");
return; return;
@ -210,8 +209,7 @@ static int send_tone_burst(struct ast_channel *chan, float freq, int duration, i
break; break;
} }
if (ast_write(chan, &wf)){ if (ast_write(chan, &wf)){
if(option_verbose >= 4) ast_verb(4, "AlarmReceiver: Failed to write frame on %s\n", chan->name);
ast_verbose(VERBOSE_PREFIX_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); ast_log(LOG_WARNING, "AlarmReceiver Failed to write frame on %s\n",chan->name);
res = -1; res = -1;
ast_frfree(f); ast_frfree(f);
@ -523,8 +521,7 @@ static int receive_ademco_contact_id( struct ast_channel *chan, void *data, int
got_some_digits = 1; got_some_digits = 1;
if (option_verbose >= 2) ast_verb(2, "AlarmReceiver: Received Event %s\n", event);
ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Received Event %s\n", event);
ast_debug(1, "AlarmReceiver: Received event: %s\n", event); ast_debug(1, "AlarmReceiver: Received event: %s\n", event);
/* Calculate checksum */ /* Calculate checksum */
@ -542,8 +539,7 @@ static int receive_ademco_contact_id( struct ast_channel *chan, void *data, int
} }
if(i == 16){ if(i == 16){
if(option_verbose >= 2) ast_verb(2, "AlarmReceiver: Bad DTMF character %c, trying again\n", event[j]);
ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Bad DTMF character %c, trying again\n", event[j]);
continue; /* Bad character */ continue; /* Bad character */
} }
@ -553,8 +549,7 @@ static int receive_ademco_contact_id( struct ast_channel *chan, void *data, int
if (checksum) { if (checksum) {
database_increment("checksum-errors"); database_increment("checksum-errors");
if (option_verbose >= 2) ast_verb(2, "AlarmReceiver: Nonzero checksum\n");
ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Nonzero checksum\n");
ast_debug(1, "AlarmReceiver: Nonzero checksum\n"); ast_debug(1, "AlarmReceiver: Nonzero checksum\n");
continue; 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, "18", 2)){
if(strncmp(event + 4, "98", 2)){ if(strncmp(event + 4, "98", 2)){
database_increment("format-errors"); database_increment("format-errors");
if(option_verbose >= 2) ast_verb(2, "AlarmReceiver: Wrong message type\n");
ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Wrong message type\n");
ast_debug(1, "AlarmReceiver: Wrong message type\n"); ast_debug(1, "AlarmReceiver: Wrong message type\n");
continue; continue;
} }
@ -635,8 +629,7 @@ static int alarmreceiver_exec(struct ast_channel *chan, void *data)
/* Set write and read formats to ULAW */ /* Set write and read formats to ULAW */
if(option_verbose >= 4) ast_verb(4, "AlarmReceiver: Setting read and write formats to ULAW\n");
ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Setting read and write formats to ULAW\n");
if (ast_set_write_format(chan,AST_FORMAT_ULAW)){ 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); 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 */ /* Answer the channel if it is not already */
if(option_verbose >= 4) ast_verb(4, "AlarmReceiver: Answering channel\n");
ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Answering channel\n");
if (chan->_state != AST_STATE_UP) { if (chan->_state != AST_STATE_UP) {
if ((res = ast_answer(chan))) 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 */ /* Wait for the connection to settle post-answer */
if(option_verbose >= 4) ast_verb(4, "AlarmReceiver: Waiting for connection to stabilize\n");
ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Waiting for connection to stabilize\n");
res = ast_safe_sleep(chan, 1250); res = ast_safe_sleep(chan, 1250);

View File

@ -136,8 +136,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
AST_APP_ARG(argSilenceThreshold); AST_APP_ARG(argSilenceThreshold);
); );
if (option_verbose > 2) ast_verb(3, "AMD: %s %s %s (Fmt: %d)\n", chan->name ,chan->cid.cid_ani, chan->cid.cid_rdnis, chan->readformat);
ast_verbose(VERBOSE_PREFIX_3 "AMD: %s %s %s (Fmt: %d)\n", chan->name ,chan->cid.cid_ani, chan->cid.cid_rdnis, chan->readformat);
/* Lets parse the arguments. */ /* Lets parse the arguments. */
if (!ast_strlen_zero(parse)) { if (!ast_strlen_zero(parse)) {
@ -164,8 +163,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
} }
/* Now we're ready to roll! */ /* Now we're ready to roll! */
if (option_verbose > 2) ast_verb(3, "AMD: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
ast_verbose(VERBOSE_PREFIX_3 "AMD: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
"totalAnalysisTime [%d] minimumWordLength [%d] betweenWordsSilence [%d] maximumNumberOfWords [%d] silenceThreshold [%d] \n", "totalAnalysisTime [%d] minimumWordLength [%d] betweenWordsSilence [%d] maximumNumberOfWords [%d] silenceThreshold [%d] \n",
initialSilence, greeting, afterGreetingSilence, totalAnalysisTime, initialSilence, greeting, afterGreetingSilence, totalAnalysisTime,
minimumWordLength, betweenWordsSilence, maximumNumberOfWords, silenceThreshold ); minimumWordLength, betweenWordsSilence, maximumNumberOfWords, silenceThreshold );
@ -194,8 +192,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
while ((res = ast_waitfor(chan, totalAnalysisTime)) > -1) { while ((res = ast_waitfor(chan, totalAnalysisTime)) > -1) {
/* If we fail to read in a frame, that means they hung up */ /* If we fail to read in a frame, that means they hung up */
if (!(f = ast_read(chan))) { if (!(f = ast_read(chan))) {
if (option_verbose > 2) ast_verb(3, "AMD: HANGUP\n");
ast_verbose(VERBOSE_PREFIX_3 "AMD: HANGUP\n");
ast_debug(1, "Got hangup\n"); ast_debug(1, "Got hangup\n");
strcpy(amdStatus, "HANGUP"); strcpy(amdStatus, "HANGUP");
break; break;
@ -241,8 +238,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
} }
if (silenceDuration >= afterGreetingSilence && inGreeting == 1) { if (silenceDuration >= afterGreetingSilence && inGreeting == 1) {
if (option_verbose > 2) ast_verb(3, "AMD: HUMAN: silenceDuration:%d afterGreetingSilence:%d\n",
ast_verbose(VERBOSE_PREFIX_3 "AMD: HUMAN: silenceDuration:%d afterGreetingSilence:%d\n",
silenceDuration, afterGreetingSilence); silenceDuration, afterGreetingSilence);
ast_frfree(f); ast_frfree(f);
strcpy(amdStatus , "HUMAN"); strcpy(amdStatus , "HUMAN");
@ -274,8 +270,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
} }
if (inGreeting == 1 && voiceDuration >= greeting) { if (inGreeting == 1 && voiceDuration >= greeting) {
if (option_verbose > 2) ast_verb(3, "AMD: ANSWERING MACHINE: voiceDuration:%d greeting:%d\n", voiceDuration, greeting);
ast_verbose(VERBOSE_PREFIX_3 "AMD: ANSWERING MACHINE: voiceDuration:%d greeting:%d\n", voiceDuration, greeting);
ast_frfree(f); ast_frfree(f);
strcpy(amdStatus , "MACHINE"); strcpy(amdStatus , "MACHINE");
sprintf(amdCause , "LONGGREETING-%d-%d", voiceDuration, greeting); sprintf(amdCause , "LONGGREETING-%d-%d", voiceDuration, greeting);
@ -295,8 +290,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
if (!res) { if (!res) {
/* It took too long to get a frame back. Giving up. */ /* It took too long to get a frame back. Giving up. */
if (option_verbose > 2) ast_verb(3, "AMD: Channel [%s]. Too long...\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "AMD: Channel [%s]. Too long...\n", chan->name);
strcpy(amdStatus , "NOTSURE"); strcpy(amdStatus , "NOTSURE");
sprintf(amdCause , "TOOLONG-%d", iTotalTime); sprintf(amdCause , "TOOLONG-%d", iTotalTime);
} }
@ -368,8 +362,7 @@ static void load_config(void)
ast_config_destroy(cfg); ast_config_destroy(cfg);
if (option_verbose > 2) ast_verb(3, "AMD defaults: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
ast_verbose(VERBOSE_PREFIX_3 "AMD defaults: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
"totalAnalysisTime [%d] minimumWordLength [%d] betweenWordsSilence [%d] maximumNumberOfWords [%d] silenceThreshold [%d] \n", "totalAnalysisTime [%d] minimumWordLength [%d] betweenWordsSilence [%d] maximumNumberOfWords [%d] silenceThreshold [%d] \n",
dfltInitialSilence, dfltGreeting, dfltAfterGreetingSilence, dfltTotalAnalysisTime, dfltInitialSilence, dfltGreeting, dfltAfterGreetingSilence, dfltTotalAnalysisTime,
dfltMinimumWordLength, dfltBetweenWordsSilence, dfltMaximumNumberOfWords, dfltSilenceThreshold ); dfltMinimumWordLength, dfltBetweenWordsSilence, dfltMaximumNumberOfWords, dfltSilenceThreshold );

View File

@ -277,8 +277,7 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
return 0; return 0;
name = ast_strdupa(spyee->name); name = ast_strdupa(spyee->name);
if (option_verbose >= 2) ast_verb(2, "Spying on channel %s\n", name);
ast_verbose(VERBOSE_PREFIX_2 "Spying on channel %s\n", name);
memset(&csth, 0, sizeof(csth)); memset(&csth, 0, sizeof(csth));
ast_set_flag(&csth.spy, CHANSPY_FORMAT_AUDIO); 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)++; (*volfactor)++;
if (*volfactor > 4) if (*volfactor > 4)
*volfactor = -4; *volfactor = -4;
if (option_verbose > 2) ast_verb(3, "Setting spy volume on %s to %d\n", chan->name, *volfactor);
ast_verbose(VERBOSE_PREFIX_3 "Setting spy volume on %s to %d\n", chan->name, *volfactor);
csth.volfactor = *volfactor; csth.volfactor = *volfactor;
set_volume(chan, &csth); set_volume(chan, &csth);
if (csth.volfactor) { if (csth.volfactor) {

View File

@ -85,17 +85,13 @@ static int deltree_exec(struct ast_channel *chan, void *data)
keytree = 0; keytree = 0;
} }
if (option_verbose > 2) {
if (keytree) 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 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 (ast_db_deltree(family, keytree))
if (option_verbose > 2) ast_verb(3, "DBdeltree: Error deleting key from database.\n");
ast_verbose(VERBOSE_PREFIX_3 "DBdeltree: Error deleting key from database.\n");
}
return 0; 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"); ast_debug(1, "Ignoring; Syntax error in argument\n");
return 0; return 0;
} }
if (option_verbose > 2) ast_verb(3, "DBdel: family=%s, key=%s\n", family, key);
ast_verbose(VERBOSE_PREFIX_3 "DBdel: family=%s, key=%s\n", family, key); if (ast_db_del(family, key))
if (ast_db_del(family, key)) { ast_verb(3, "DBdel: Error deleting key from database.\n");
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "DBdel: Error deleting key from database.\n");
}
} else { } else {
ast_debug(1, "Ignoring, no parameters\n"); ast_debug(1, "Ignoring, no parameters\n");
} }

View File

@ -474,12 +474,10 @@ static void do_forward(struct chanlist *o,
/* Before processing channel, go ahead and check for forwarding */ /* Before processing channel, go ahead and check for forwarding */
o->forwards++; o->forwards++;
if (o->forwards < AST_MAX_FORWARDS) { if (o->forwards < AST_MAX_FORWARDS) {
if (option_verbose > 2) ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, c->name);
ast_verbose(VERBOSE_PREFIX_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 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 (ast_test_flag64(peerflags, OPT_IGNORE_FORWARDING)) {
if (option_verbose > 2) ast_verb(3, "Forwarding %s to '%s/%s' prevented.\n", in->name, tech, stuff);
ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s/%s' prevented.\n", in->name, tech, stuff);
c = o->chan = NULL; c = o->chan = NULL;
cause = AST_CAUSE_BUSY; cause = AST_CAUSE_BUSY;
} else { } 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); ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
} }
} else { } else {
if (option_verbose > 2) ast_verb(3, "Too many forwards from %s\n", c->name);
ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", c->name);
cause = AST_CAUSE_CONGESTION; cause = AST_CAUSE_CONGESTION;
c = o->chan = NULL; 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 (pos == 1) { /* only the input channel is available */
if (numlines == (num.busy + num.congestion + num.nochan)) { if (numlines == (num.busy + num.congestion + num.nochan)) {
if (option_verbose > 2) ast_verb(2, "Everyone is busy/congested at this time (%d:%d/%d/%d)\n", numlines, num.busy, num.congestion, num.nochan);
ast_verbose( VERBOSE_PREFIX_2 "Everyone is busy/congested at this time (%d:%d/%d/%d)\n", numlines, num.busy, num.congestion, num.nochan);
if (num.busy) if (num.busy)
strcpy(pa->status, "BUSY"); strcpy(pa->status, "BUSY");
else if (num.congestion) else if (num.congestion)
@ -597,8 +593,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
else if (num.nochan) else if (num.nochan)
strcpy(pa->status, "CHANUNAVAIL"); strcpy(pa->status, "CHANUNAVAIL");
} else { } else {
if (option_verbose > 2) ast_verb(3, "No one is available to answer at this time (%d:%d/%d/%d)\n", numlines, num.busy, num.congestion, num.nochan);
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);
} }
*to = 0; *to = 0;
return NULL; return NULL;
@ -612,8 +607,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
continue; continue;
if (ast_test_flag64(o, DIAL_STILLGOING) && c->_state == AST_STATE_UP) { if (ast_test_flag64(o, DIAL_STILLGOING) && c->_state == AST_STATE_UP) {
if (!peer) { if (!peer) {
if (option_verbose > 2) ast_verb(3, "%s answered %s\n", c->name, in->name);
ast_verbose(VERBOSE_PREFIX_3 "%s answered %s\n", c->name, in->name);
peer = c; peer = c;
ast_copy_flags64(peerflags, o, ast_copy_flags64(peerflags, o,
OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER | 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: case AST_CONTROL_ANSWER:
/* This is our guy if someone answered. */ /* This is our guy if someone answered. */
if (!peer) { if (!peer) {
if (option_verbose > 2) ast_verb(3, "%s answered %s\n", c->name, in->name);
ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", c->name, in->name);
peer = c; peer = c;
ast_copy_flags64(peerflags, o, ast_copy_flags64(peerflags, o,
OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER | 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; c->hangupcause = AST_CAUSE_NORMAL_CLEARING;
break; break;
case AST_CONTROL_BUSY: case AST_CONTROL_BUSY:
if (option_verbose > 2) ast_verb(3, "%s is busy\n", c->name);
ast_verbose(VERBOSE_PREFIX_3 "%s is busy\n", c->name);
in->hangupcause = c->hangupcause; in->hangupcause = c->hangupcause;
ast_hangup(c); ast_hangup(c);
c = o->chan = NULL; 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); handle_cause(AST_CAUSE_BUSY, &num);
break; break;
case AST_CONTROL_CONGESTION: case AST_CONTROL_CONGESTION:
if (option_verbose > 2) ast_verb(3, "%s is circuit-busy\n", c->name);
ast_verbose(VERBOSE_PREFIX_3 "%s is circuit-busy\n", c->name);
in->hangupcause = c->hangupcause; in->hangupcause = c->hangupcause;
ast_hangup(c); ast_hangup(c);
c = o->chan = NULL; 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); handle_cause(AST_CAUSE_CONGESTION, &num);
break; break;
case AST_CONTROL_RINGING: case AST_CONTROL_RINGING:
if (option_verbose > 2) ast_verb(3, "%s is ringing\n", c->name);
ast_verbose(VERBOSE_PREFIX_3 "%s is ringing\n", c->name);
/* Setup early media if appropriate */ /* Setup early media if appropriate */
if (single) if (single)
ast_channel_early_bridge(in, c); ast_channel_early_bridge(in, c);
@ -695,8 +685,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
} }
break; break;
case AST_CONTROL_PROGRESS: case AST_CONTROL_PROGRESS:
if (option_verbose > 2) ast_verb(3, "%s is making progress passing it to %s\n", c->name, in->name);
ast_verbose (VERBOSE_PREFIX_3 "%s is making progress passing it to %s\n", c->name, in->name);
/* Setup early media if appropriate */ /* Setup early media if appropriate */
if (single) if (single)
ast_channel_early_bridge(in, c); 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); ast_indicate(in, AST_CONTROL_PROGRESS);
break; break;
case AST_CONTROL_VIDUPDATE: case AST_CONTROL_VIDUPDATE:
if (option_verbose > 2) ast_verb(3, "%s requested a video update, passing it to %s\n", c->name, in->name);
ast_verbose (VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", c->name, in->name);
ast_indicate(in, AST_CONTROL_VIDUPDATE); ast_indicate(in, AST_CONTROL_VIDUPDATE);
break; break;
case AST_CONTROL_PROCEEDING: case AST_CONTROL_PROCEEDING:
if (option_verbose > 2) ast_verb(3, "%s is proceeding passing it to %s\n", c->name, in->name);
ast_verbose (VERBOSE_PREFIX_3 "%s is proceeding passing it to %s\n", c->name, in->name);
if (single) if (single)
ast_channel_early_bridge(in, c); ast_channel_early_bridge(in, c);
if (!ast_test_flag64(outgoing, OPT_RINGBACK)) if (!ast_test_flag64(outgoing, OPT_RINGBACK))
ast_indicate(in, AST_CONTROL_PROCEEDING); ast_indicate(in, AST_CONTROL_PROCEEDING);
break; break;
case AST_CONTROL_HOLD: case AST_CONTROL_HOLD:
if (option_verbose > 2) ast_verb(3, "Call on %s placed on hold\n", c->name);
ast_verbose(VERBOSE_PREFIX_3 "Call on %s placed on hold\n", c->name);
ast_indicate(in, AST_CONTROL_HOLD); ast_indicate(in, AST_CONTROL_HOLD);
break; break;
case AST_CONTROL_UNHOLD: case AST_CONTROL_UNHOLD:
if (option_verbose > 2) ast_verb(3, "Call on %s left from hold\n", c->name);
ast_verbose(VERBOSE_PREFIX_3 "Call on %s left from hold\n", c->name);
ast_indicate(in, AST_CONTROL_UNHOLD); ast_indicate(in, AST_CONTROL_UNHOLD);
break; break;
case AST_CONTROL_OFFHOOK: case AST_CONTROL_OFFHOOK:
@ -732,8 +717,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
break; break;
case -1: case -1:
if (!ast_test_flag64(outgoing, OPT_RINGBACK | OPT_MUSICBACK)) { if (!ast_test_flag64(outgoing, OPT_RINGBACK | OPT_MUSICBACK)) {
if (option_verbose > 2) ast_verb(3, "%s stopped sounds\n", c->name);
ast_verbose(VERBOSE_PREFIX_3 "%s stopped sounds\n", c->name);
ast_indicate(in, -1); ast_indicate(in, -1);
pa->sentringing = 0; 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)) { if (ast_test_flag64(peerflags, OPT_DTMF_EXIT)) {
const char *context = pbx_builtin_getvar_helper(in, "EXITCONTEXT"); const char *context = pbx_builtin_getvar_helper(in, "EXITCONTEXT");
if (onedigit_goto(in, context, (char) f->subclass, 1)) { if (onedigit_goto(in, context, (char) f->subclass, 1)) {
if (option_verbose > 2) ast_verb(3, "User hit %c to disconnect call.\n", f->subclass);
ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
*to=0; *to=0;
ast_cdr_noanswer(in->cdr); ast_cdr_noanswer(in->cdr);
*result = f->subclass; *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) && if (ast_test_flag64(peerflags, OPT_CALLER_HANGUP) &&
(f->subclass == '*')) { /* hmm it it not guaranteed to be '*' anymore. */ (f->subclass == '*')) { /* hmm it it not guaranteed to be '*' anymore. */
if (option_verbose > 2) ast_verb(3, "User hit %c to disconnect call.\n", f->subclass);
ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
*to=0; *to=0;
strcpy(pa->status, "CANCEL"); strcpy(pa->status, "CANCEL");
ast_cdr_noanswer(in->cdr); 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_HOLD) ||
(f->subclass == AST_CONTROL_UNHOLD) || (f->subclass == AST_CONTROL_UNHOLD) ||
(f->subclass == AST_CONTROL_VIDUPDATE))) { (f->subclass == AST_CONTROL_VIDUPDATE))) {
if (option_verbose > 2) ast_verb(3, "%s requested special control %d, passing it to %s\n", in->name, f->subclass, outgoing->chan->name);
ast_verbose(VERBOSE_PREFIX_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_indicate_data(outgoing->chan, f->subclass, f->data, f->datalen);
} }
ast_frfree(f); ast_frfree(f);
} }
if (!*to && (option_verbose > 2)) if (!*to)
ast_verbose(VERBOSE_PREFIX_3 "Nobody picked up in %d ms\n", orig); ast_verb(3, "Nobody picked up in %d ms\n", orig);
if (!*to || ast_check_hangup(in)) { if (!*to || ast_check_hangup(in)) {
ast_cdr_noanswer(in->cdr); 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 */ /* 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) { if (!config->play_warning && !config->start_sound && !config->end_sound && config->timelimit) {
*calldurationlimit = config->timelimit / 1000; *calldurationlimit = config->timelimit / 1000;
if (option_verbose > 2) ast_verb(3, "Setting call duration limit to %d seconds.\n",
ast_verbose(VERBOSE_PREFIX_3 "Setting call duration limit to %d seconds.\n",
*calldurationlimit); *calldurationlimit);
config->timelimit = play_to_caller = play_to_callee = config->timelimit = play_to_caller = play_to_callee =
config->play_warning = config->warning_freq = 0; config->play_warning = config->warning_freq = 0;
} else if (option_verbose > 2) { } else {
ast_verbose(VERBOSE_PREFIX_3 "Limit Data for this call:\n"); ast_verb(3, "Limit Data for this call:\n");
ast_verbose(VERBOSE_PREFIX_4 "timelimit = %ld\n", config->timelimit); ast_verb(4, "timelimit = %ld\n", config->timelimit);
ast_verbose(VERBOSE_PREFIX_4 "play_warning = %ld\n", config->play_warning); ast_verb(4, "play_warning = %ld\n", config->play_warning);
ast_verbose(VERBOSE_PREFIX_4 "play_to_caller = %s\n", play_to_caller ? "yes" : "no"); ast_verb(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_verb(4, "play_to_callee = %s\n", play_to_callee ? "yes" : "no");
ast_verbose(VERBOSE_PREFIX_4 "warning_freq = %ld\n", config->warning_freq); ast_verb(4, "warning_freq = %ld\n", config->warning_freq);
ast_verbose(VERBOSE_PREFIX_4 "start_sound = %s\n", S_OR(config->start_sound, "")); ast_verb(4, "start_sound = %s\n", S_OR(config->start_sound, ""));
ast_verbose(VERBOSE_PREFIX_4 "warning_sound = %s\n", config->warning_sound); ast_verb(4, "warning_sound = %s\n", config->warning_sound);
ast_verbose(VERBOSE_PREFIX_4 "end_sound = %s\n", S_OR(config->end_sound, "")); ast_verb(4, "end_sound = %s\n", S_OR(config->end_sound, ""));
} }
if (play_to_caller) if (play_to_caller)
ast_set_flag(&(config->features_caller), AST_FEATURE_PLAY_WARNING); 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 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}; static const int _flag[] = { AST_PRIVACY_ALLOW, AST_PRIVACY_DENY, AST_PRIVACY_TORTURE, AST_PRIVACY_KILL, AST_PRIVACY_ALLOW};
int i = res2 - '1'; int i = res2 - '1';
if (option_verbose > 2) ast_verb(3, "--Set privacy database entry %s/%s to %s\n",
ast_verbose(VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to %s\n",
opt_args[OPT_ARG_PRIVACY], pa->privcid, _val[i]); opt_args[OPT_ARG_PRIVACY], pa->privcid, _val[i]);
ast_privacy_set(opt_args[OPT_ARG_PRIVACY], pa->privcid, _flag[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); ast_filedelete(pa->privintro, NULL);
if( ast_fileexists(pa->privintro, NULL, NULL ) > 0 ) 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); ast_log(LOG_NOTICE, "privacy: ast_filedelete didn't do its job on %s\n", pa->privintro);
else if (option_verbose > 2) else
ast_verbose(VERBOSE_PREFIX_3 "Successfully deleted %s intro file\n", pa->privintro); ast_verb(3, "Successfully deleted %s intro file\n", pa->privintro);
} }
return 0; /* the good exit path */ return 0; /* the good exit path */
} else { } else {
@ -1101,13 +1080,11 @@ static int setup_privacy_args(struct privacy_args *pa,
l = ast_strdupa(chan->cid.cid_num); l = ast_strdupa(chan->cid.cid_num);
ast_shrink_phone_number(l); ast_shrink_phone_number(l);
if (ast_test_flag64(opts, OPT_PRIVACY) ) { if (ast_test_flag64(opts, OPT_PRIVACY) ) {
if (option_verbose > 2) ast_verb(3, "Privacy DB is '%s', clid is '%s'\n",
ast_verbose(VERBOSE_PREFIX_3 "Privacy DB is '%s', clid is '%s'\n",
opt_args[OPT_ARG_PRIVACY], l); opt_args[OPT_ARG_PRIVACY], l);
pa->privdb_val = ast_privacy_check(opt_args[OPT_ARG_PRIVACY], l); pa->privdb_val = ast_privacy_check(opt_args[OPT_ARG_PRIVACY], l);
} else { } else {
if (option_verbose > 2) ast_verb(3, "Privacy Screening, clid is '%s'\n", l);
ast_verbose(VERBOSE_PREFIX_3 "Privacy Screening, clid is '%s'\n", l);
pa->privdb_val = AST_PRIVACY_UNKNOWN; pa->privdb_val = AST_PRIVACY_UNKNOWN;
} }
} else { } else {
@ -1119,8 +1096,7 @@ static int setup_privacy_args(struct privacy_args *pa,
if (*tn2=='/') /* any other chars to be afraid of? */ if (*tn2=='/') /* any other chars to be afraid of? */
*tn2 = '='; *tn2 = '=';
} }
if (option_verbose > 2) ast_verb(3, "Privacy-- callerid is empty\n");
ast_verbose(VERBOSE_PREFIX_3 "Privacy-- callerid is empty\n");
snprintf(callerid, sizeof(callerid), "NOCALLERID_%s%s", chan->exten, tnam); snprintf(callerid, sizeof(callerid), "NOCALLERID_%s%s", chan->exten, tnam);
l = callerid; l = callerid;
@ -1184,8 +1160,8 @@ static int setup_privacy_args(struct privacy_args *pa,
ast_filedelete(pa->privintro, NULL); ast_filedelete(pa->privintro, NULL);
if (ast_fileexists(pa->privintro,NULL,NULL ) > 0 ) 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); ast_log(LOG_NOTICE,"privacy: ast_filedelete didn't do its job on %s\n", pa->privintro);
else if (option_verbose > 2) else
ast_verbose( VERBOSE_PREFIX_3 "Successfully deleted %s intro file\n", pa->privintro); ast_verb(3, "Successfully deleted %s intro file\n", pa->privintro);
return -1; return -1;
} }
if (!ast_streamfile(chan, "vm-dialout", chan->language) ) 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)) { if (ast_test_flag64(&opts, OPT_OPERMODE)) {
opermode = ast_strlen_zero(opt_args[OPT_ARG_OPERMODE]) ? 1 : atoi(opt_args[OPT_ARG_OPERMODE]); opermode = ast_strlen_zero(opt_args[OPT_ARG_OPERMODE]) ? 1 : atoi(opt_args[OPT_ARG_OPERMODE]);
if (option_verbose > 2) ast_verb(3, "Setting operator services mode to %d.\n", opermode);
ast_verbose(VERBOSE_PREFIX_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])) { 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); pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
goto done; goto done;
} }
if (option_verbose > 2) ast_verb(3, "Setting call duration limit to %d seconds.\n", calldurationlimit);
ast_verbose(VERBOSE_PREFIX_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])) { 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++; tmp->forwards++;
if (tmp->forwards < AST_MAX_FORWARDS) { if (tmp->forwards < AST_MAX_FORWARDS) {
if (option_verbose > 2) ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n",
ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n",
chan->name, tech, stuff, tc->name); chan->name, tech, stuff, tc->name);
ast_hangup(tc); ast_hangup(tc);
/* If we have been told to ignore forwards, just set this channel to null /* 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)) { if (ast_test_flag64(&opts, OPT_IGNORE_FORWARDING)) {
tc = NULL; tc = NULL;
cause = AST_CAUSE_BUSY; cause = AST_CAUSE_BUSY;
if (option_verbose > 2) ast_verb(3, "Forwarding %s to '%s/%s' prevented.\n",
ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s/%s' prevented.\n",
chan->name, tech, stuff); chan->name, tech, stuff);
} else { } else {
tc = ast_request(tech, chan->nativeformats, stuff, &cause); 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 else
ast_channel_inherit_variables(chan, tc); ast_channel_inherit_variables(chan, tc);
} else { } else {
if (option_verbose > 2) ast_verb(3, "Too many forwards from %s\n", tc->name);
ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", tc->name);
ast_hangup(tc); ast_hangup(tc);
tc = NULL; tc = NULL;
cause = AST_CAUSE_CONGESTION; cause = AST_CAUSE_CONGESTION;
@ -1443,16 +1414,14 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
if (res) { if (res) {
/* Again, keep going even if there's an error */ /* Again, keep going even if there's an error */
ast_debug(1, "ast call on peer returned %d\n", res); ast_debug(1, "ast call on peer returned %d\n", res);
if (option_verbose > 2) ast_verb(3, "Couldn't call %s\n", numsubst);
ast_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", numsubst);
ast_hangup(tc); ast_hangup(tc);
tc = NULL; tc = NULL;
ast_free(tmp); ast_free(tmp);
continue; continue;
} else { } else {
senddialevent(chan, tc); senddialevent(chan, tc);
if (option_verbose > 2) ast_verb(3, "Called %s\n", numsubst);
ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", numsubst);
if (!ast_test_flag64(peerflags, OPT_ORIGINAL_CLID)) 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); 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))) { 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. */ /* 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); 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_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, peer->name);
ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, peer->name);
break; break;
} }
peer->priority++; peer->priority++;

View File

@ -92,8 +92,7 @@ static int flash_exec(struct ast_channel *chan, void *data)
zt_wait_event(chan->fds[0]); zt_wait_event(chan->fds[0]);
} }
res = ast_safe_sleep(chan, 1000); res = ast_safe_sleep(chan, 1000);
if (option_verbose > 2) ast_verb(3, "Flashed channel %s\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Flashed channel %s\n", chan->name);
} else } else
ast_log(LOG_WARNING, "Unable to flash channel %s: %s\n", chan->name, strerror(errno)); ast_log(LOG_WARNING, "Unable to flash channel %s: %s\n", chan->name, strerror(errno));
} else } else

View 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 (!AST_LIST_EMPTY(findme_user_list)) {
if (!caller) { if (!caller) {
if (option_verbose > 2) ast_verb(3, "Original caller hungup. Cleanup.\n");
ast_verbose(VERBOSE_PREFIX_3 "Original caller hungup. Cleanup.\n");
clear_calling_tree(findme_user_list); clear_calling_tree(findme_user_list);
return NULL; return NULL;
} }
@ -508,8 +507,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
if (tmpuser->state == 3) if (tmpuser->state == 3)
tmpuser->digts += (towas - wtd); tmpuser->digts += (towas - wtd);
if (tmpuser->digts && (tmpuser->digts > featuredigittimeout)) { if (tmpuser->digts && (tmpuser->digts > featuredigittimeout)) {
if (option_verbose > 2) ast_verb(3, "We've been waiting for digits longer than we should have.\n");
ast_verbose(VERBOSE_PREFIX_3 "We've been waiting for digits longer than we should have.\n");
if (!ast_strlen_zero(namerecloc)) { if (!ast_strlen_zero(namerecloc)) {
tmpuser->state = 1; tmpuser->state = 1;
tmpuser->digts = 0; 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) { else if (tmpto < 0 && !tmpuser->ochan->timingfunc) {
ast_stopstream(tmpuser->ochan); ast_stopstream(tmpuser->ochan);
if (tmpuser->state == 1) { if (tmpuser->state == 1) {
if (option_verbose > 2) ast_verb(3, "Playback of the call-from file appears to be done.\n");
ast_verbose(VERBOSE_PREFIX_3 "Playback of the call-from file appears to be done.\n");
if (!ast_streamfile(tmpuser->ochan, namerecloc, tmpuser->ochan->language)) { if (!ast_streamfile(tmpuser->ochan, namerecloc, tmpuser->ochan->language)) {
tmpuser->state = 2; tmpuser->state = 2;
} else { } else {
@ -554,8 +551,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
} }
} }
} else if (tmpuser->state == 2) { } else if (tmpuser->state == 2) {
if (option_verbose > 2) ast_verb(3, "Playback of name file appears to be done.\n");
ast_verbose(VERBOSE_PREFIX_3 "Playback of name file appears to be done.\n");
memset(tmpuser->yn, 0, sizeof(tmpuser->yn)); memset(tmpuser->yn, 0, sizeof(tmpuser->yn));
tmpuser->ynidx = 0; tmpuser->ynidx = 0;
if (!ast_streamfile(tmpuser->ochan, pressbuttonname, tmpuser->ochan->language)) { 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; return NULL;
} }
} else if (tmpuser->state == 3) { } else if (tmpuser->state == 3) {
if (option_verbose > 2) ast_verb(3, "Playback of the next step file appears to be done.\n");
ast_verbose(VERBOSE_PREFIX_3 "Playback of the next step file appears to be done.\n");
tmpuser->digts = 0; tmpuser->digts = 0;
} }
} }
@ -587,8 +582,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
totalwait -= tmpto; totalwait -= tmpto;
wtd = to; wtd = to;
if (totalwait <= 0) { if (totalwait <= 0) {
if (option_verbose > 2) ast_verb(3, "We've hit our timeout for this step. Drop everyone and move on to the next one. %ld\n", totalwait);
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);
clear_calling_tree(findme_user_list); clear_calling_tree(findme_user_list);
return NULL; return NULL;
} }
@ -606,22 +600,20 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
switch(f->subclass) { switch(f->subclass) {
case AST_CONTROL_HANGUP: case AST_CONTROL_HANGUP:
if (option_verbose > 2) 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 (dg == 0) {
if (option_verbose > 2) ast_verb(3, "The calling channel hungup. Need to drop everyone else.\n");
ast_verbose( VERBOSE_PREFIX_3 "The calling channel hungup. Need to drop everyone else.\n");
clear_calling_tree(findme_user_list); clear_calling_tree(findme_user_list);
ctstatus = -1; ctstatus = -1;
} }
break; break;
case AST_CONTROL_ANSWER: case AST_CONTROL_ANSWER:
if (option_verbose > 2) 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 */ /* If call has been answered, then the eventual hangup is likely to be normal hangup */
winner->hangupcause = AST_CAUSE_NORMAL_CLEARING; winner->hangupcause = AST_CAUSE_NORMAL_CLEARING;
caller->hangupcause = AST_CAUSE_NORMAL_CLEARING; caller->hangupcause = AST_CAUSE_NORMAL_CLEARING;
if (option_verbose > 2) ast_verb(3, "Starting playback of %s\n", callfromname);
ast_verbose( VERBOSE_PREFIX_3 "Starting playback of %s\n", callfromname);
if (dg > 0) { if (dg > 0) {
if (!ast_strlen_zero(namerecloc)) { if (!ast_strlen_zero(namerecloc)) {
if (!ast_streamfile(winner, callfromname, winner->language)) { 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; break;
case AST_CONTROL_BUSY: case AST_CONTROL_BUSY:
if (option_verbose > 2) ast_verb(3, "%s is busy\n", winner->name);
ast_verbose( VERBOSE_PREFIX_3 "%s is busy\n", winner->name);
break; break;
case AST_CONTROL_CONGESTION: case AST_CONTROL_CONGESTION:
if (option_verbose > 2) ast_verb(3, "%s is circuit-busy\n", winner->name);
ast_verbose( VERBOSE_PREFIX_3 "%s is circuit-busy\n", winner->name);
break; break;
case AST_CONTROL_RINGING: case AST_CONTROL_RINGING:
if (option_verbose > 2) ast_verb(3, "%s is ringing\n", winner->name);
ast_verbose( VERBOSE_PREFIX_3 "%s is ringing\n", winner->name);
break; break;
case AST_CONTROL_PROGRESS: case AST_CONTROL_PROGRESS:
if (option_verbose > 2) ast_verb(3, "%s is making progress passing it to %s\n", winner->name, caller->name);
ast_verbose ( VERBOSE_PREFIX_3 "%s is making progress passing it to %s\n", winner->name, caller->name);
break; break;
case AST_CONTROL_VIDUPDATE: case AST_CONTROL_VIDUPDATE:
if (option_verbose > 2) ast_verb(3, "%s requested a video update, passing it to %s\n", winner->name, caller->name);
ast_verbose ( VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", winner->name, caller->name);
break; break;
case AST_CONTROL_PROCEEDING: case AST_CONTROL_PROCEEDING:
if (option_verbose > 2) ast_verb(3, "%s is proceeding passing it to %s\n", winner->name,caller->name);
ast_verbose ( VERBOSE_PREFIX_3 "%s is proceeding passing it to %s\n", winner->name,caller->name);
break; break;
case AST_CONTROL_HOLD: case AST_CONTROL_HOLD:
if (option_verbose > 2) ast_verb(3, "Call on %s placed on hold\n", winner->name);
ast_verbose(VERBOSE_PREFIX_3 "Call on %s placed on hold\n", winner->name);
break; break;
case AST_CONTROL_UNHOLD: case AST_CONTROL_UNHOLD:
if (option_verbose > 2) ast_verb(3, "Call on %s left from hold\n", winner->name);
ast_verbose(VERBOSE_PREFIX_3 "Call on %s left from hold\n", winner->name);
break; break;
case AST_CONTROL_OFFHOOK: case AST_CONTROL_OFFHOOK:
case AST_CONTROL_FLASH: case AST_CONTROL_FLASH:
/* Ignore going off hook and flash */ /* Ignore going off hook and flash */
break; break;
case -1: case -1:
if (option_verbose > 2) ast_verb(3, "%s stopped sounds\n", winner->name);
ast_verbose( VERBOSE_PREFIX_3 "%s stopped sounds\n", winner->name);
break; break;
default: default:
ast_debug(1, "Dunno what to do with control type %d\n", f->subclass); 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--; livechannels--;
ast_debug(1, "live channels left %d\n", livechannels); ast_debug(1, "live channels left %d\n", livechannels);
if (!livechannels) { if (!livechannels) {
if (option_verbose > 2) ast_verb(3, "no live channels left. exiting.\n");
ast_verbose(VERBOSE_PREFIX_3 "no live channels left. exiting.\n");
return NULL; return NULL;
} }
} }
@ -740,8 +722,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
} }
} else { } else {
if (option_verbose > 2) ast_verb(3, "couldn't reach at this number.\n");
ast_verbose(VERBOSE_PREFIX_3 "couldn't reach at this number.\n");
} }
/* --- WAIT FOR WINNER NUMBER END! -----------*/ /* --- WAIT FOR WINNER NUMBER END! -----------*/
@ -809,8 +790,7 @@ static void findmeexec(struct fm_args *tpargs)
if (outbound) { if (outbound) {
ast_set_callerid(outbound, caller->cid.cid_num, caller->cid.cid_name, caller->cid.cid_num); ast_set_callerid(outbound, caller->cid.cid_num, caller->cid.cid_name, caller->cid.cid_num);
ast_channel_inherit_variables(tpargs->chan, outbound); ast_channel_inherit_variables(tpargs->chan, outbound);
if (option_verbose > 2) ast_verb(3, "calling %s\n", dialarg);
ast_verbose(VERBOSE_PREFIX_3 "calling %s\n", dialarg);
if (!ast_call(outbound,dialarg,0)) { if (!ast_call(outbound,dialarg,0)) {
tmpuser->ochan = outbound; tmpuser->ochan = outbound;
tmpuser->state = 0; tmpuser->state = 0;
@ -818,8 +798,7 @@ static void findmeexec(struct fm_args *tpargs)
ast_copy_string(tmpuser->dialarg, dialarg, sizeof(dialarg)); ast_copy_string(tmpuser->dialarg, dialarg, sizeof(dialarg));
AST_LIST_INSERT_TAIL(findme_user_list, tmpuser, entry); AST_LIST_INSERT_TAIL(findme_user_list, tmpuser, entry);
} else { } else {
if (option_verbose > 2) ast_verb(3, "couldn't reach at this number.\n");
ast_verbose(VERBOSE_PREFIX_3 "couldn't reach at this number.\n");
if (outbound) { if (outbound) {
if (!outbound->cdr) if (!outbound->cdr)
outbound->cdr = ast_cdr_alloc(); outbound->cdr = ast_cdr_alloc();

View File

@ -85,8 +85,7 @@ static int cpeid_exec(struct ast_channel *chan, void *idata)
res = ast_adsi_get_cpeid(chan, cpeid, 0); res = ast_adsi_get_cpeid(chan, cpeid, 0);
if (res > 0) { if (res > 0) {
gotcpeid = 1; gotcpeid = 1;
if (option_verbose > 2) ast_verb(3, "Got CPEID of '%02x:%02x:%02x:%02x' on '%s'\n", cpeid[0], cpeid[1], cpeid[2], cpeid[3], chan->name);
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);
} }
if (res > -1) { if (res > -1) {
strcpy(data[1], "Measuring CPE..."); strcpy(data[1], "Measuring CPE...");
@ -94,8 +93,7 @@ static int cpeid_exec(struct ast_channel *chan, void *idata)
cpeid_setstatus(chan, data, 0); cpeid_setstatus(chan, data, 0);
res = ast_adsi_get_cpeinfo(chan, &width, &height, &buttons, 0); res = ast_adsi_get_cpeinfo(chan, &width, &height, &buttons, 0);
if (res > -1) { if (res > -1) {
if (option_verbose > 2) ast_verb(3, "CPE has %d lines, %d columns, and %d buttons on '%s'\n", height, width, buttons, chan->name);
ast_verbose(VERBOSE_PREFIX_3 "CPE has %d lines, %d columns, and %d buttons on '%s'\n", height, width, buttons, chan->name);
gotgeometry = 1; gotgeometry = 1;
} }
} }

View File

@ -313,14 +313,12 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
goto out; goto out;
case AST_PBX_KEEPALIVE: 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); 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_verb(2, "Spawn extension (%s, %s, %d) exited KEEPALIVE in macro '%s' on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
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);
goto out; goto out;
break; break;
default: 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); 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_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);
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);
dead = 1; dead = 1;
goto out; 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 (gosub_level == 0 && strcasecmp(chan->context, fullmacro)) {
if (option_verbose > 1) ast_verb(2, "Channel '%s' jumping out of macro '%s'\n", chan->name, macro);
ast_verbose(VERBOSE_PREFIX_2 "Channel '%s' jumping out of macro '%s'\n", chan->name, macro);
break; break;
} }

View File

@ -826,8 +826,7 @@ static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin
/* Fill the conference struct */ /* Fill the conference struct */
cnf->start = time(NULL); cnf->start = time(NULL);
cnf->isdynamic = dynamic ? 1 : 0; cnf->isdynamic = dynamic ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "Created MeetMe conference %d for conference '%s'\n", cnf->zapconf, cnf->confno);
ast_verbose(VERBOSE_PREFIX_3 "Created MeetMe conference %d for conference '%s'\n", cnf->zapconf, cnf->confno);
AST_LIST_INSERT_HEAD(&confs, cnf, list); AST_LIST_INSERT_HEAD(&confs, cnf, list);
/* Reserve conference number in map */ /* 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"); snprintf(recordingtmp, sizeof(recordingtmp), "wav");
conf->recordingformat = ast_strdupa(recordingtmp); 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); conf->confno, conf->recordingfilename, conf->recordingformat);
} }
} }

View File

@ -109,17 +109,14 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data)
} }
dialtech = strsep(&args.dial, "/"); dialtech = strsep(&args.dial, "/");
if (option_verbose > 2) ast_verb(3, "Dial Tech,String: (%s,%s)\n", dialtech, args.dial);
ast_verbose(VERBOSE_PREFIX_3 "Dial Tech,String: (%s,%s)\n", dialtech, args.dial);
if (!ast_strlen_zero(args.return_context)) if (!ast_strlen_zero(args.return_context))
ast_parseable_goto(chan, args.return_context); ast_parseable_goto(chan, args.return_context);
if (option_verbose > 2) { ast_verb(3, "Return Context: (%s,%s,%d) ID: %s\n", chan->context, chan->exten, chan->priority, chan->cid.cid_num);
ast_verbose(VERBOSE_PREFIX_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)) { 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 /* we are using masq_park here to protect * from touching the channel once we park it. If the channel comes out of timeout
@ -127,8 +124,7 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data)
ast_masq_park_call(chan, NULL, timeout, &lot); ast_masq_park_call(chan, NULL, timeout, &lot);
if (option_verbose > 2) ast_verb(3, "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, args.return_context);
ast_verbose(VERBOSE_PREFIX_3 "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, args.return_context);
/* Now place the call to the extension */ /* 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) {
if (dchan->_state == AST_STATE_UP) { if (dchan->_state == AST_STATE_UP) {
if (option_verbose > 3) ast_verb(4, "Channel %s was answered.\n", dchan->name);
ast_verbose(VERBOSE_PREFIX_4 "Channel %s was answered.\n", dchan->name);
} else { } else {
if (option_verbose > 3) ast_verb(4, "Channel %s was never answered.\n", dchan->name);
ast_verbose(VERBOSE_PREFIX_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_log(LOG_WARNING, "PARK: Channel %s was never answered for the announce.\n", dchan->name);
ast_hangup(dchan); ast_hangup(dchan);
return -1; 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 */ /* now we have the call placed and are ready to play stuff to it */
if (option_verbose > 3) ast_verb(4, "Announce Template:%s\n", args.template);
ast_verbose(VERBOSE_PREFIX_4 "Announce Template:%s\n", args.template);
for (looptemp = 0, tmp[looptemp++] = strsep(&args.template, ":"); for (looptemp = 0, tmp[looptemp++] = strsep(&args.template, ":");
looptemp < sizeof(tmp) / sizeof(tmp[0]); looptemp < sizeof(tmp) / sizeof(tmp[0]);
tmp[looptemp++] = strsep(&args.template, ":")); tmp[looptemp++] = strsep(&args.template, ":"));
for (i = 0; i < looptemp; i++) { for (i = 0; i < looptemp; i++) {
if (option_verbose > 3) ast_verb(4, "Announce:%s\n", tmp[i]);
ast_verbose(VERBOSE_PREFIX_4 "Announce:%s\n", tmp[i]);
if (!strcmp(tmp[i], "PARKED")) { if (!strcmp(tmp[i], "PARKED")) {
ast_say_digits(dchan, lot, "", dchan->language); ast_say_digits(dchan, lot, "", dchan->language);
} else { } else {

View File

@ -1420,8 +1420,7 @@ static int say_position(struct queue_ent *qe, int ringing)
avgholdsecs = 0; avgholdsecs = 0;
} }
if (option_verbose > 2) ast_verb(3, "Hold time for %s is %d minutes %d seconds\n", qe->parent->name, avgholdmins, avgholdsecs);
ast_verbose(VERBOSE_PREFIX_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 /* 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 */ 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: posout:
if (option_verbose > 2) ast_verb(3, "Told %s in %s their queue position (which was %d)\n",
ast_verbose(VERBOSE_PREFIX_3 "Told %s in %s their queue position (which was %d)\n",
qe->chan->name, qe->parent->name, qe->pos); qe->chan->name, qe->parent->name, qe->pos);
res = play_file(qe->chan, qe->parent->sound_thanks); 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))) { if ((res = ast_call(tmp->chan, location, 0))) {
/* Again, keep going even if there's an error */ /* Again, keep going even if there's an error */
ast_debug(1, "ast call on peer returned %d\n", res); ast_debug(1, "ast call on peer returned %d\n", res);
if (option_verbose > 2) ast_verb(3, "Couldn't call %s\n", tmp->interface);
ast_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", tmp->interface);
do_hang(tmp); do_hang(tmp);
(*busies)++; (*busies)++;
return 0; 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", tmp->chan->cid.cid_name ? tmp->chan->cid.cid_name : "unknown",
qe->chan->context, qe->chan->exten, qe->chan->priority, qe->chan->context, qe->chan->exten, qe->chan->priority,
qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : ""); qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
if (option_verbose > 2) ast_verb(3, "Called %s\n", tmp->interface);
ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", tmp->interface);
} }
return 1; return 1;
@ -1887,8 +1883,7 @@ static int say_periodic_announcement(struct queue_ent *qe, int ringing)
else else
ast_moh_stop(qe->chan); ast_moh_stop(qe->chan);
if (option_verbose > 2) ast_verb(3, "Playing periodic announcement\n");
ast_verbose(VERBOSE_PREFIX_3 "Playing periodic announcement\n");
/* Check to make sure we have a sound file. If not, reset to the first sound file */ /* 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])) { 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. */ /*! \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) static void rna(int rnatime, struct queue_ent *qe, char *interface, char *membername)
{ {
if (option_verbose > 2) ast_verb(3, "Nobody picked up in %d ms\n", rnatime);
ast_verbose( VERBOSE_PREFIX_3 "Nobody picked up in %d ms\n", rnatime);
ast_queue_log(qe->parent->name, qe->chan->uniqueid, membername, "RINGNOANSWER", "%d", rnatime); ast_queue_log(qe->parent->name, qe->chan->uniqueid, membername, "RINGNOANSWER", "%d", rnatime);
if (qe->parent->autopause) { if (qe->parent->autopause) {
if (!set_member_paused(qe->parent->name, interface, 1)) { if (!set_member_paused(qe->parent->name, interface, 1)) {
if (option_verbose > 2) ast_verb(3, "Auto-Pausing Queue Member %s in queue %s since they failed to answer.\n", interface, qe->parent->name);
ast_verbose( VERBOSE_PREFIX_3 "Auto-Pausing Queue Member %s in queue %s since they failed to answer.\n", interface, qe->parent->name);
} else { } else {
if (option_verbose > 2) ast_verb(3, "Failed to pause Queue Member %s in queue %s!\n", interface, qe->parent->name);
ast_verbose( VERBOSE_PREFIX_3 "Failed to pause Queue Member %s in queue %s!\n", interface, qe->parent->name);
} }
} }
return; 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) { for (o = outgoing; o; o = o->q_next) {
if (o->stillgoing && (o->chan) && (o->chan->_state == AST_STATE_UP)) { if (o->stillgoing && (o->chan) && (o->chan->_state == AST_STATE_UP)) {
if (!peer) { if (!peer) {
if (option_verbose > 2) ast_verb(3, "%s answered %s\n", o->chan->name, in->name);
ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", o->chan->name, in->name);
peer = o; peer = o;
} }
} else if (o->chan && (o->chan == winner)) { } 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)); ast_copy_string(membername, o->member->membername, sizeof(membername));
if (!ast_strlen_zero(o->chan->call_forward) && !forwardsallowed) { if (!ast_strlen_zero(o->chan->call_forward) && !forwardsallowed) {
if (option_verbose > 2) ast_verb(3, "Forwarding %s to '%s' prevented.\n", in->name, o->chan->call_forward);
ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s' prevented.\n", in->name, o->chan->call_forward);
numnochan++; numnochan++;
do_hang(o); do_hang(o);
winner = NULL; winner = NULL;
@ -2042,8 +2032,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
tech = "Local"; tech = "Local";
} }
/* Before processing channel, go ahead and check for forwarding */ /* Before processing channel, go ahead and check for forwarding */
if (option_verbose > 2) ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, o->chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, o->chan->name);
/* Setup parameters */ /* Setup parameters */
o->chan = ast_request(tech, in->nativeformats, stuff, &status); o->chan = ast_request(tech, in->nativeformats, stuff, &status);
if (status != o->oldstatus) if (status != o->oldstatus)
@ -2090,14 +2079,12 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
case AST_CONTROL_ANSWER: case AST_CONTROL_ANSWER:
/* This is our guy if someone answered. */ /* This is our guy if someone answered. */
if (!peer) { if (!peer) {
if (option_verbose > 2) ast_verb(3, "%s answered %s\n", o->chan->name, in->name);
ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", o->chan->name, in->name);
peer = o; peer = o;
} }
break; break;
case AST_CONTROL_BUSY: case AST_CONTROL_BUSY:
if (option_verbose > 2) ast_verb(3, "%s is busy\n", o->chan->name);
ast_verbose( VERBOSE_PREFIX_3 "%s is busy\n", o->chan->name);
if (in->cdr) if (in->cdr)
ast_cdr_busy(in->cdr); ast_cdr_busy(in->cdr);
do_hang(o); do_hang(o);
@ -2112,8 +2099,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
numbusies++; numbusies++;
break; break;
case AST_CONTROL_CONGESTION: case AST_CONTROL_CONGESTION:
if (option_verbose > 2) ast_verb(3, "%s is circuit-busy\n", o->chan->name);
ast_verbose( VERBOSE_PREFIX_3 "%s is circuit-busy\n", o->chan->name);
if (in->cdr) if (in->cdr)
ast_cdr_busy(in->cdr); ast_cdr_busy(in->cdr);
endtime = (long) time(NULL); endtime = (long) time(NULL);
@ -2128,8 +2114,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
numbusies++; numbusies++;
break; break;
case AST_CONTROL_RINGING: case AST_CONTROL_RINGING:
if (option_verbose > 2) ast_verb(3, "%s is ringing\n", o->chan->name);
ast_verbose( VERBOSE_PREFIX_3 "%s is ringing\n", o->chan->name);
if (!sentringing) { if (!sentringing) {
#if 0 #if 0
ast_indicate(in, AST_CONTROL_RINGING); ast_indicate(in, AST_CONTROL_RINGING);
@ -2167,15 +2152,13 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
return NULL; return NULL;
} }
if ((f->frametype == AST_FRAME_DTMF) && caller_disconnect && (f->subclass == '*')) { if ((f->frametype == AST_FRAME_DTMF) && caller_disconnect && (f->subclass == '*')) {
if (option_verbose > 3) ast_verb(3, "User hit %c to disconnect call.\n", f->subclass);
ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
*to = 0; *to = 0;
ast_frfree(f); ast_frfree(f);
return NULL; return NULL;
} }
if ((f->frametype == AST_FRAME_DTMF) && valid_exit(qe, f->subclass)) { if ((f->frametype == AST_FRAME_DTMF) && valid_exit(qe, f->subclass)) {
if (option_verbose > 3) ast_verb(3, "User pressed digit: %c\n", f->subclass);
ast_verbose(VERBOSE_PREFIX_3 "User pressed digit: %c\n", f->subclass);
*to = 0; *to = 0;
*digit = f->subclass; *digit = f->subclass;
ast_frfree(f); ast_frfree(f);
@ -3600,8 +3583,7 @@ check_turns:
/* exit after 'timeout' cycle if 'n' option enabled */ /* exit after 'timeout' cycle if 'n' option enabled */
if (go_on >= qe.parent->membercount) { if (go_on >= qe.parent->membercount) {
if (option_verbose > 2) ast_verb(3, "Exiting on time-out cycle\n");
ast_verbose(VERBOSE_PREFIX_3 "Exiting on time-out cycle\n");
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos); ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
record_abandoned(&qe); record_abandoned(&qe);
reason = QUEUE_TIMEOUT; reason = QUEUE_TIMEOUT;

View File

@ -138,8 +138,8 @@ static int read_exec(struct ast_channel *chan, void *data)
maxdigits = atoi(arglist.maxdigits); maxdigits = atoi(arglist.maxdigits);
if ((maxdigits<1) || (maxdigits>255)) { if ((maxdigits<1) || (maxdigits>255)) {
maxdigits = 255; maxdigits = 255;
} else if (option_verbose > 2) } else
ast_verbose(VERBOSE_PREFIX_3 "Accepting a maximum of %d digits.\n", maxdigits); ast_verb(3, "Accepting a maximum of %d digits.\n", maxdigits);
} }
if (ast_strlen_zero(arglist.variable)) { if (ast_strlen_zero(arglist.variable)) {
ast_log(LOG_WARNING, "Invalid! Usage: Read(variable[|filename][|maxdigits][|option][|attempts][|timeout])\n\n"); 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) { if (res > -1) {
pbx_builtin_setvar_helper(chan, arglist.variable, tmp); pbx_builtin_setvar_helper(chan, arglist.variable, tmp);
if (!ast_strlen_zero(tmp)) { if (!ast_strlen_zero(tmp)) {
if (option_verbose > 2) ast_verb(3, "User entered '%s'\n", tmp);
ast_verbose(VERBOSE_PREFIX_3 "User entered '%s'\n", tmp);
tries = 0; tries = 0;
} else { } else {
tries--; tries--;
if (option_verbose > 2) {
if (tries) 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 else
ast_verbose(VERBOSE_PREFIX_3 "User entered nothing.\n"); ast_verb(3, "User entered nothing.\n");
}
} }
res = 0; res = 0;
} else { } else {
pbx_builtin_setvar_helper(chan, arglist.variable, tmp); pbx_builtin_setvar_helper(chan, arglist.variable, tmp);
if (option_verbose > 2) ast_verb(3, "User disconnected\n");
ast_verbose(VERBOSE_PREFIX_3 "User disconnected\n");
} }
} }
} }

View File

@ -924,8 +924,7 @@ static void load_rpt_vars(int n, int init)
); );
#endif #endif
if (option_verbose > 2) ast_verb(3, "%s config for repeater %s\n",
ast_verbose(VERBOSE_PREFIX_3 "%s config for repeater %s\n",
(init) ? "Loading initial" : "Re-Loading", rpt_vars[n].name); (init) ? "Loading initial" : "Re-Loading", rpt_vars[n].name);
ast_mutex_lock(&rpt_vars[n].lock); ast_mutex_lock(&rpt_vars[n].lock);
if (rpt_vars[n].cfg) 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->whentohangup = 0;
l->chan->appl = "Apprpt"; l->chan->appl = "Apprpt";
l->chan->data = "(Remote Rx)"; l->chan->data = "(Remote Rx)";
if (option_verbose > 2) ast_verb(3, "rpt (remote) initiating call to %s/%s on %s\n",
ast_verbose(VERBOSE_PREFIX_3 "rpt (remote) initiating call to %s/%s on %s\n",
deststr, tele, l->chan->name); deststr, tele, l->chan->name);
if (l->chan->cid.cid_num) if (l->chan->cid.cid_num)
ast_free(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 { } else {
rpt_telemetry(myrpt, CONNFAIL, l); rpt_telemetry(myrpt, CONNFAIL, l);
ast_free(l); ast_free(l);
if (option_verbose > 2) ast_verb(3, "Unable to place call to %s/%s on %s\n",
ast_verbose(VERBOSE_PREFIX_3 "Unable to place call to %s/%s on %s\n",
deststr, tele, l->chan->name); deststr, tele, l->chan->name);
return DC_ERROR; 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->whentohangup = 0;
l->chan->appl = "Apprpt"; l->chan->appl = "Apprpt";
l->chan->data = "(Remote Rx)"; l->chan->data = "(Remote Rx)";
if (option_verbose > 2) ast_verb(3, "rpt (remote) initiating call to %s/%s on %s\n",
ast_verbose(VERBOSE_PREFIX_3 "rpt (remote) initiating call to %s/%s on %s\n",
deststr, tele, l->chan->name); deststr, tele, l->chan->name);
if (l->chan->cid.cid_num) if (l->chan->cid.cid_num)
ast_free(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 { } else {
rpt_telemetry(myrpt, CONNFAIL, l); rpt_telemetry(myrpt, CONNFAIL, l);
ast_free(l); ast_free(l);
if (option_verbose > 2) ast_verb(3, "Unable to place call to %s/%s on %s\n",
ast_verbose(VERBOSE_PREFIX_3 "Unable to place call to %s/%s on %s\n",
deststr, tele, l->chan->name); deststr, tele, l->chan->name);
return DC_ERROR; return DC_ERROR;
} }
@ -5459,8 +5454,7 @@ static int attempt_reconnect(struct rpt *myrpt, struct rpt_link *l)
l->chan->whentohangup = 0; l->chan->whentohangup = 0;
l->chan->appl = "Apprpt"; l->chan->appl = "Apprpt";
l->chan->data = "(Remote Rx)"; l->chan->data = "(Remote Rx)";
if (option_verbose > 2) ast_verb(3, "rpt (attempt_reconnect) initiating call to %s/%s on %s\n",
ast_verbose(VERBOSE_PREFIX_3 "rpt (attempt_reconnect) initiating call to %s/%s on %s\n",
deststr, tele, l->chan->name); deststr, tele, l->chan->name);
if (l->chan->cid.cid_num) if (l->chan->cid.cid_num)
ast_free(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); ast_call(l->chan, tele, 999);
} else { } else {
if (option_verbose > 2) ast_verb(3, "Unable to place call to %s/%s on %s\n",
ast_verbose(VERBOSE_PREFIX_3 "Unable to place call to %s/%s on %s\n",
deststr, tele, l->chan->name); deststr, tele, l->chan->name);
return -1; return -1;
} }
@ -5698,8 +5691,7 @@ static void *rpt(void *this)
myrpt->rxchannel->whentohangup = 0; myrpt->rxchannel->whentohangup = 0;
myrpt->rxchannel->appl = "Apprpt"; myrpt->rxchannel->appl = "Apprpt";
myrpt->rxchannel->data = "(Repeater Rx)"; myrpt->rxchannel->data = "(Repeater Rx)";
if (option_verbose > 2) ast_verb(3, "rpt (Rx) initiating call to %s/%s on %s\n",
ast_verbose(VERBOSE_PREFIX_3 "rpt (Rx) initiating call to %s/%s on %s\n",
tmpstr, tele, myrpt->rxchannel->name); tmpstr, tele, myrpt->rxchannel->name);
ast_call(myrpt->rxchannel, tele, 999); ast_call(myrpt->rxchannel, tele, 999);
if (myrpt->rxchannel->_state != AST_STATE_UP) { if (myrpt->rxchannel->_state != AST_STATE_UP) {
@ -5740,8 +5732,7 @@ static void *rpt(void *this)
myrpt->txchannel->whentohangup = 0; myrpt->txchannel->whentohangup = 0;
myrpt->txchannel->appl = "Apprpt"; myrpt->txchannel->appl = "Apprpt";
myrpt->txchannel->data = "(Repeater Tx)"; myrpt->txchannel->data = "(Repeater Tx)";
if (option_verbose > 2) ast_verb(3, "rpt (Tx) initiating call to %s/%s on %s\n",
ast_verbose(VERBOSE_PREFIX_3 "rpt (Tx) initiating call to %s/%s on %s\n",
tmpstr, tele, myrpt->txchannel->name); tmpstr, tele, myrpt->txchannel->name);
ast_call(myrpt->txchannel, tele, 999); ast_call(myrpt->txchannel, tele, 999);
if (myrpt->rxchannel->_state != AST_STATE_UP) { 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_strlen_zero(optionarg.return_context)) {
if (ast_parseable_goto(chan, optionarg.return_context)) { if (ast_parseable_goto(chan, optionarg.return_context)) {
if (option_verbose > 2) ast_verb(3, "Warning: Return Context Invalid, call will return to default|s\n");
ast_verbose(VERBOSE_PREFIX_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. */ 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); ast_masq_park_call(chan, NULL, timeout, &lot);
if (option_verbose > 2) ast_verb(3, "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, optionarg.return_context);
ast_verbose( VERBOSE_PREFIX_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); snprintf(tmp, sizeof(tmp), "%d,%s", lot, optionarg.template + 1);
rpt_telemetry(myrpt, REV_PATCH, tmp); 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->whentohangup = 0;
myrpt->rxchannel->appl = "Apprpt"; myrpt->rxchannel->appl = "Apprpt";
myrpt->rxchannel->data = "(Link Rx)"; myrpt->rxchannel->data = "(Link Rx)";
if (option_verbose > 2) ast_verb(3, "rpt (Rx) initiating call to %s/%s on %s\n",
ast_verbose(VERBOSE_PREFIX_3 "rpt (Rx) initiating call to %s/%s on %s\n",
myrpt->rxchanname, tele, myrpt->rxchannel->name); myrpt->rxchanname, tele, myrpt->rxchannel->name);
rpt_mutex_unlock(&myrpt->lock); rpt_mutex_unlock(&myrpt->lock);
ast_call(myrpt->rxchannel, tele, 999); 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->whentohangup = 0;
myrpt->txchannel->appl = "Apprpt"; myrpt->txchannel->appl = "Apprpt";
myrpt->txchannel->data = "(Link Tx)"; myrpt->txchannel->data = "(Link Tx)";
if (option_verbose > 2) ast_verb(3, "rpt (Tx) initiating call to %s/%s on %s\n",
ast_verbose(VERBOSE_PREFIX_3 "rpt (Tx) initiating call to %s/%s on %s\n",
myrpt->txchanname, tele, myrpt->txchannel->name); myrpt->txchanname, tele, myrpt->txchannel->name);
rpt_mutex_unlock(&myrpt->lock); rpt_mutex_unlock(&myrpt->lock);
ast_call(myrpt->txchannel, tele, 999); ast_call(myrpt->txchannel, tele, 999);

View File

@ -1168,7 +1168,7 @@ static int sms_handleincoming_proto2(sms_t *h)
char debug_buf[MAX_DEBUG_LEN * 3 + 1]; char debug_buf[MAX_DEBUG_LEN * 3 + 1];
sz = h->imsg[1] + 2; 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) */ /* Parse message body (called payload) */
tv.tv_sec = h->scts = time(NULL); tv.tv_sec = h->scts = time(NULL);
@ -1178,8 +1178,7 @@ static int sms_handleincoming_proto2(sms_t *h)
msgsz += (h->imsg[f++] * 256); msgsz += (h->imsg[f++] * 256);
switch (msg) { switch (msg) {
case 0x13: /* Body */ case 0x13: /* Body */
if (option_verbose > 2) ast_verb(3, "SMS-P2 Body#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Body#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
if (msgsz >= sizeof(h->imsg)) if (msgsz >= sizeof(h->imsg))
msgsz = sizeof(h->imsg) - 1; msgsz = sizeof(h->imsg) - 1;
for (i = 0; i < msgsz; i++) 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_min = ( (h->imsg[f + 6] * 10) + h->imsg[f + 7] );
tm.tm_sec = 0; tm.tm_sec = 0;
h->scts = ast_mktime(&tm, NULL); h->scts = ast_mktime(&tm, NULL);
if (option_verbose > 2) 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);
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);
break; break;
case 0x15: /* Calling line (from SMSC) */ case 0x15: /* Calling line (from SMSC) */
if (msgsz >= 20) if (msgsz >= 20)
msgsz = 20 - 1; msgsz = 20 - 1;
if (option_verbose > 2) ast_verb(3, "SMS-P2 Origin#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Origin#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
ast_copy_string(h->oa, (char *)(&h->imsg[f]), msgsz + 1); ast_copy_string(h->oa, (char *)(&h->imsg[f]), msgsz + 1);
break; break;
case 0x18: /* Destination(from TE/phone) */ case 0x18: /* Destination(from TE/phone) */
if (msgsz >= 20) if (msgsz >= 20)
msgsz = 20 - 1; msgsz = 20 - 1;
if (option_verbose > 2) ast_verb(3, "SMS-P2 Destination#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Destination#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
ast_copy_string(h->da, (char *)(&h->imsg[f]), msgsz + 1); ast_copy_string(h->da, (char *)(&h->imsg[f]), msgsz + 1);
break; break;
case 0x1C: /* Notify */ case 0x1C: /* Notify */
if (option_verbose > 2) ast_verb(3, "SMS-P2 Notify#%02X=%s\n", msg, sms_hexdump(&h->imsg[f], 3, debug_buf));
ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Notify#%02X=%s\n", msg, sms_hexdump(&h->imsg[f], 3, debug_buf));
break; break;
default: default:
if (option_verbose > 2) ast_verb(3, "SMS-P2 Par#%02X [%d]: %s\n", msg, msgsz, sms_hexdump(&h->imsg[f], msgsz, debug_buf));
ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Par#%02X [%d]: %s\n", msg, msgsz, sms_hexdump(&h->imsg[f], msgsz, debug_buf));
break; break;
} }
f+=msgsz; /* Skip to next */ f+=msgsz; /* Skip to next */
@ -1391,8 +1385,7 @@ static void sms_debug (int dir, sms_t *h)
} }
if (q < n) if (q < n)
sprintf(p, "..."); sprintf(p, "...");
if (option_verbose > 2) ast_verb(3, "SMS %s%s\n", dir == DIR_RX ? "RX" : "TX", txt);
ast_verbose(VERBOSE_PREFIX_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) */ /* Protocol 2: empty connnection ready (I am master) */
if (h->framenumber < 0 && h->ibytec >= 160 && !memcmp(h->imsg, "UUUUUUUUUUUUUUUUUUUU", 20)) { if (h->framenumber < 0 && h->ibytec >= 160 && !memcmp(h->imsg, "UUUUUUUUUUUUUUUUUUUU", 20)) {
h->framenumber = 1; h->framenumber = 1;
if (option_verbose > 2) ast_verb(3, "SMS protocol 2 detected\n");
ast_verbose(VERBOSE_PREFIX_3 "SMS protocol 2 detected\n");
h->protocol = 2; h->protocol = 2;
h->imsg[0] = 0xff; /* special message (fake) */ h->imsg[0] = 0xff; /* special message (fake) */
h->imsg[1] = h->imsg[2] = 0x00; 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) if (sms_args.argc > 1)
ast_app_parse_options(sms_options, &sms_flags, sms_opts, sms_args.options); 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, ""), sms_args.argc, S_OR(sms_args.queue, ""),
S_OR(sms_args.options, ""), S_OR(sms_args.options, ""),
S_OR(sms_args.addr, ""), 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]); h.opause_0 = atoi(sms_opts[OPTION_ARG_PAUSE]);
if (h.opause_0 < 25 || h.opause_0 > 2000) if (h.opause_0 < 25 || h.opause_0 > 2000)
h.opause_0 = 300; /* default 300ms */ 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 */ /* the following apply if there is an arg3/4 and apply to the created message file */

View File

@ -4554,14 +4554,12 @@ static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms,
if (!ast_strlen_zero(prefile)) { if (!ast_strlen_zero(prefile)) {
/* See if we can find a recorded name for this person instead of their extension number */ /* See if we can find a recorded name for this person instead of their extension number */
if (ast_fileexists(prefile, NULL, NULL) > 0) { if (ast_fileexists(prefile, NULL, NULL) > 0) {
if (option_verbose > 2) ast_verb(3, "Playing envelope info: CID number '%s' matches mailbox number, playing recorded name\n", callerid);
ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: CID number '%s' matches mailbox number, playing recorded name\n", callerid);
if (!callback) if (!callback)
res = wait_file2(chan, vms, "vm-from"); res = wait_file2(chan, vms, "vm-from");
res = ast_stream_and_wait(chan, prefile, ""); res = ast_stream_and_wait(chan, prefile, "");
} else { } else {
if (option_verbose > 2) ast_verb(3, "Playing envelope info: message from '%s'\n", callerid);
ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: message from '%s'\n", callerid);
/* BB: Say "from extension" as one saying to sound smoother */ /* BB: Say "from extension" as one saying to sound smoother */
if (!callback) if (!callback)
res = wait_file2(chan, vms, "vm-from-extension"); 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)) if (vmu && !strcmp(passptr, password))
valid++; valid++;
else { else {
if (option_verbose > 2) ast_verb(3, "Incorrect password '%s' for user '%s' (context = %s)\n", password, mailbox, context ? context : "default");
ast_verbose( VERBOSE_PREFIX_3 "Incorrect password '%s' for user '%s' (context = %s)\n", password, mailbox, context ? context : "default");
if (!ast_strlen_zero(prefix)) if (!ast_strlen_zero(prefix))
mailbox[0] = '\0'; mailbox[0] = '\0';
} }
@ -6993,8 +6990,8 @@ static int vm_execmain(struct ast_channel *chan, void *data)
cmd = 't'; cmd = 't';
break; break;
case '2': /* Callback */ case '2': /* Callback */
if (option_verbose > 2 && !vms.starting) if (!vms.starting)
ast_verbose( VERBOSE_PREFIX_3 "Callback Requested\n"); ast_verb(3, "Callback Requested\n");
if (!ast_strlen_zero(vmu->callback) && vms.lastmsg > -1 && !vms.starting) { if (!ast_strlen_zero(vmu->callback) && vms.lastmsg > -1 && !vms.starting) {
cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 2, record_gain); cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 2, record_gain);
if (cmd == 9) { if (cmd == 9) {
@ -8525,8 +8522,7 @@ static int dialout(struct ast_channel *chan, struct ast_vm_user *vmu, char *num,
int retries = 0; int retries = 0;
if (!num) { if (!num) {
if (option_verbose > 2) ast_verb(3, "Destination number will be entered manually\n");
ast_verbose( VERBOSE_PREFIX_3 "Destination number will be entered manually\n");
while (retries < 3 && cmd != 't') { while (retries < 3 && cmd != 't') {
destination[1] = '\0'; destination[1] = '\0';
destination[0] = cmd = ast_play_and_wait(chan,"vm-enter-num-to-call"); 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) if (cmd < 0)
return 0; return 0;
if (cmd == '*') { if (cmd == '*') {
if (option_verbose > 2) ast_verb(3, "User hit '*' to cancel outgoing call\n");
ast_verbose( VERBOSE_PREFIX_3 "User hit '*' to cancel outgoing call\n");
return 0; return 0;
} }
if ((cmd = ast_readstring(chan,destination + strlen(destination),sizeof(destination)-1,6000,10000,"#")) < 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; return 9;
} }
} else { } else {
if (option_verbose > 2) ast_verb(3, "Caller can not specify callback number - no dialout context available\n");
ast_verbose( VERBOSE_PREFIX_3 "Caller can not specify callback number - no dialout context available\n");
res = ast_play_and_wait(chan, "vm-sorry"); res = ast_play_and_wait(chan, "vm-sorry");
} }
ast_config_destroy(msg_cfg); ast_config_destroy(msg_cfg);
@ -8723,8 +8717,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
break; break;
default: default:
if (num) { if (num) {
if (option_verbose > 2) ast_verb(3, "Confirm CID number '%s' is number to use for callback\n", num);
ast_verbose( VERBOSE_PREFIX_3 "Confirm CID number '%s' is number to use for callback\n", num);
res = ast_play_and_wait(chan, "vm-num-i-have"); res = ast_play_and_wait(chan, "vm-num-i-have");
if (!res) if (!res)
res = play_message_callerid(chan, vms, num, vmu->context, 1); 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); ast_callerid_parse(cid, &name, &num);
if (!num) { if (!num) {
if (option_verbose > 2) ast_verb(3, "No CID number available, no reply sent\n");
ast_verbose(VERBOSE_PREFIX_3 "No CID number available, no reply sent\n");
if (!res) if (!res)
res = ast_play_and_wait(chan, "vm-nonumber"); res = ast_play_and_wait(chan, "vm-nonumber");
ast_config_destroy(msg_cfg); 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; return res;
} else { } else {
/* Sender has no mailbox, can't reply */ /* Sender has no mailbox, can't reply */
if (option_verbose > 2) ast_verb(3, "No mailbox number '%s' in context '%s', no reply sent\n", num, vmu->context);
ast_verbose( VERBOSE_PREFIX_3 "No mailbox number '%s' in context '%s', no reply sent\n", num, vmu->context);
ast_play_and_wait(chan, "vm-nobox"); ast_play_and_wait(chan, "vm-nobox");
res = 't'; res = 't';
ast_config_destroy(msg_cfg); ast_config_destroy(msg_cfg);
@ -8915,16 +8906,14 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
#if 0 #if 0
else if (vmu->review && (*duration < 5)) { else if (vmu->review && (*duration < 5)) {
/* Message is too short */ /* Message is too short */
if (option_verbose > 2) ast_verb(3, "Message too short\n");
ast_verbose(VERBOSE_PREFIX_3 "Message too short\n");
cmd = ast_play_and_wait(chan, "vm-tooshort"); cmd = ast_play_and_wait(chan, "vm-tooshort");
cmd = ast_filedelete(tempfile, NULL); cmd = ast_filedelete(tempfile, NULL);
break; break;
} }
else if (vmu->review && (cmd == 2 && *duration < (maxsilence + 3))) { else if (vmu->review && (cmd == 2 && *duration < (maxsilence + 3))) {
/* Message is all silence */ /* Message is all silence */
if (option_verbose > 2) ast_verb(3, "Nothing recorded\n");
ast_verbose(VERBOSE_PREFIX_3 "Nothing recorded\n");
cmd = ast_filedelete(tempfile, NULL); cmd = ast_filedelete(tempfile, NULL);
cmd = ast_play_and_wait(chan, "vm-nothingrecorded"); cmd = ast_play_and_wait(chan, "vm-nothingrecorded");
if (!cmd) if (!cmd)

View File

@ -79,8 +79,7 @@ static int waitforring_exec(struct ast_channel *chan, void *data)
break; break;
} }
if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_RING)) { if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_RING)) {
if (option_verbose > 2) ast_verb(3, "Got a ring but still waiting for timeout\n");
ast_verbose(VERBOSE_PREFIX_3 "Got a ring but still waiting for timeout\n");
} }
ast_frfree(f); ast_frfree(f);
} }
@ -101,8 +100,7 @@ static int waitforring_exec(struct ast_channel *chan, void *data)
break; break;
} }
if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_RING)) { if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_RING)) {
if (option_verbose > 2) ast_verb(3, "Got a ring after the timeout\n");
ast_verbose(VERBOSE_PREFIX_3 "Got a ring after the timeout\n");
ast_frfree(f); ast_frfree(f);
break; break;
} }

View File

@ -126,12 +126,10 @@ static int do_waiting(struct ast_channel *chan, int silencereqd, time_t waitstar
} }
} }
if (option_verbose > 6) ast_verb(3, "Got %dms silence< %dms required\n", dspsilence, silencereqd);
ast_verbose(VERBOSE_PREFIX_3 "Got %dms silence< %dms required\n", dspsilence, silencereqd);
if (dspsilence >= silencereqd) { if (dspsilence >= silencereqd) {
if (option_verbose > 2) ast_verb(3, "Exiting with %dms silence >= %dms required\n", dspsilence, silencereqd);
ast_verbose(VERBOSE_PREFIX_3 "Exiting with %dms silence >= %dms required\n", dspsilence, silencereqd);
/* Ended happily with silence */ /* Ended happily with silence */
res = 1; res = 1;
pbx_builtin_setvar_helper(chan, "WAITSTATUS", "SILENCE"); 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"); ast_log(LOG_WARNING, "Using default value of 1000ms, 1 iteration, no timeout\n");
} }
if (option_verbose > 2) ast_verb(3, "Waiting %d time(s) for %d ms silence with %d timeout\n", iterations, silencereqd, timeout);
ast_verbose(VERBOSE_PREFIX_3 "Waiting %d time(s) for %d ms silence with %d timeout\n", iterations, silencereqd, timeout);
time(&waitstart); time(&waitstart);
res = 1; res = 1;

View File

@ -229,8 +229,7 @@ static int _while_exec(struct ast_channel *chan, void *data, int end)
} else { } else {
int pri = find_matching_endwhile(chan); int pri = find_matching_endwhile(chan);
if (pri > 0) { if (pri > 0) {
if (option_verbose > 2) ast_verb(3, "Jumping to priority %d\n", pri);
ast_verbose(VERBOSE_PREFIX_3 "Jumping to priority %d\n", pri);
chan->priority = pri; chan->priority = pri;
} else { } else {
ast_log(LOG_WARNING, "Couldn't find matching EndWhile? (While at %s@%s priority %d)\n", chan->context, chan->exten, chan->priority); ast_log(LOG_WARNING, "Couldn't find matching EndWhile? (While at %s@%s priority %d)\n", chan->context, chan->exten, chan->priority);

View File

@ -214,20 +214,17 @@ static int zapras_exec(struct ast_channel *chan, void *data)
if (strcasecmp(chan->tech->type, "Zap")) { if (strcasecmp(chan->tech->type, "Zap")) {
/* If it's not a zap channel, we're done. Wait a couple of /* If it's not a zap channel, we're done. Wait a couple of
seconds and then hangup... */ seconds and then hangup... */
if (option_verbose > 1) ast_verb(2, "Channel %s is not a Zap channel\n", chan->name);
ast_verbose(VERBOSE_PREFIX_2 "Channel %s is not a Zap channel\n", chan->name);
sleep(2); sleep(2);
} else { } else {
memset(&ztp, 0, sizeof(ztp)); memset(&ztp, 0, sizeof(ztp));
if (ioctl(chan->fds[0], ZT_GET_PARAMS, &ztp)) { if (ioctl(chan->fds[0], ZT_GET_PARAMS, &ztp)) {
ast_log(LOG_WARNING, "Unable to get zaptel parameters\n"); ast_log(LOG_WARNING, "Unable to get zaptel parameters\n");
} else if (ztp.sigtype != ZT_SIG_CLEAR) { } else if (ztp.sigtype != ZT_SIG_CLEAR) {
if (option_verbose > 1) ast_verb(2, "Channel %s is not a clear channel\n", chan->name);
ast_verbose(VERBOSE_PREFIX_2 "Channel %s is not a clear channel\n", chan->name);
} else { } else {
/* Everything should be okay. Run PPP. */ /* Everything should be okay. Run PPP. */
if (option_verbose > 2) ast_verb(3, "Starting RAS on %s\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Starting RAS on %s\n", chan->name);
/* Execute RAS */ /* Execute RAS */
run_ras(chan, args); run_ras(chan, args);
} }

View File

@ -231,7 +231,7 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
input[ic++] = '\0'; input[ic++] = '\0';
ic=0; ic=0;
ret = atoi(input); 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; break;
} }
} }
@ -300,7 +300,7 @@ static int conf_exec(struct ast_channel *chan, void *data)
desired_group = ast_strdupa(data); desired_group = ast_strdupa(data);
if(!ast_strlen_zero(desired_group)) { 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; search_group = 1;
} }
@ -330,7 +330,7 @@ static int conf_exec(struct ast_channel *chan, void *data)
if (tempchan && search_group) { if (tempchan && search_group) {
const char *mygroup; const char *mygroup;
if((mygroup = pbx_builtin_getvar_helper(tempchan, "GROUP")) && (!strcmp(mygroup, desired_group))) { 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 { } else {
ast_mutex_unlock(&tempchan->lock); ast_mutex_unlock(&tempchan->lock);
lastchan = tempchan; 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) ) { 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_copy_string(confstr, tempchan->name, sizeof(confstr));
ast_mutex_unlock(&tempchan->lock); ast_mutex_unlock(&tempchan->lock);
if ((tmp = strchr(confstr,'-'))) { if ((tmp = strchr(confstr,'-'))) {

View File

@ -155,8 +155,7 @@ static int load_config(void)
ast_copy_string(tableptr->connection, connection, lenconnection + 1); ast_copy_string(tableptr->connection, connection, lenconnection + 1);
ast_copy_string(tableptr->table, table, lentable + 1); ast_copy_string(tableptr->table, table, lentable + 1);
if (option_verbose > 2) ast_verb(3, "Found adaptive CDR table %s@%s.\n", tableptr->table, tableptr->connection);
ast_verbose(VERBOSE_PREFIX_3 "Found adaptive CDR table %s@%s.\n", tableptr->table, tableptr->connection);
while ((res = SQLFetch(stmt)) != SQL_NO_DATA && res != SQL_ERROR) { while ((res = SQLFetch(stmt)) != SQL_NO_DATA && res != SQL_ERROR) {
char *cdrvar = ""; char *cdrvar = "";
@ -173,8 +172,7 @@ static int load_config(void)
if (strcasecmp(var->value, columnname) == 0) { if (strcasecmp(var->value, columnname) == 0) {
char *tmp = ast_strdupa(var->name + 5); char *tmp = ast_strdupa(var->name + 5);
cdrvar = ast_strip(tmp); cdrvar = ast_strip(tmp);
if (option_verbose > 2) ast_verb(3, "Found alias %s for column %s in %s@%s\n", cdrvar, columnname, tableptr->table, tableptr->connection);
ast_verbose(VERBOSE_PREFIX_3 "Found alias %s for column %s in %s@%s\n", cdrvar, columnname, tableptr->table, tableptr->connection);
break; break;
} }
} }
@ -541,8 +539,7 @@ static int odbc_log(struct ast_cdr *cdr)
sql2[lensql2 - 1] = ')'; sql2[lensql2 - 1] = ')';
strcat(sql + lensql, sql2); strcat(sql + lensql, sql2);
if (option_verbose > 10) ast_verb(11, "[%s]\n", sql);
ast_verbose(VERBOSE_PREFIX_4 "[%s]\n", sql);
/* No need to check the connection now; we'll handle any failure in prepare_and_execute */ /* No need to check the connection now; we'll handle any failure in prepare_and_execute */
obj = ast_odbc_request_obj(tableptr->connection, 0); obj = ast_odbc_request_obj(tableptr->connection, 0);
if (obj) { if (obj) {

View File

@ -126,8 +126,7 @@ static int odbc_log(struct ast_cdr *cdr)
ODBC_res = SQLAllocHandle(SQL_HANDLE_STMT, ODBC_con, &ODBC_stmt); ODBC_res = SQLAllocHandle(SQL_HANDLE_STMT, ODBC_con, &ODBC_stmt);
if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) { if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: Failure in AllocStatement %d\n", ODBC_res);
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Failure in AllocStatement %d\n", ODBC_res);
SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt); SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt);
odbc_disconnect(); odbc_disconnect();
ast_mutex_unlock(&odbc_lock); 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); ODBC_res = SQLPrepare(ODBC_stmt, (unsigned char *)sqlcmd, SQL_NTS);
if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) { if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: Error in PREPARE %d\n", ODBC_res);
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error in PREPARE %d\n", ODBC_res);
SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt); SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt);
odbc_disconnect(); odbc_disconnect();
ast_mutex_unlock(&odbc_lock); ast_mutex_unlock(&odbc_lock);
@ -175,29 +173,23 @@ static int odbc_log(struct ast_cdr *cdr)
if (connected) { if (connected) {
res = odbc_do_query(); res = odbc_do_query();
if (res < 0) { if (res < 0) {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: Query FAILED Call not logged!\n");
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Query FAILED Call not logged!\n"); ast_verb(11, "cdr_odbc: Reconnecting to dsn %s\n", dsn);
if (option_verbose > 10)
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Reconnecting to dsn %s\n", dsn);
SQLDisconnect(ODBC_con); SQLDisconnect(ODBC_con);
res = odbc_init(); res = odbc_init();
if (res < 0) { if (res < 0) {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: %s has gone away!\n", dsn);
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: %s has gone away!\n", dsn);
odbc_disconnect(); odbc_disconnect();
} else { } else {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: Trying Query again!\n");
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Trying Query again!\n");
res = odbc_do_query(); res = odbc_do_query();
if (res < 0) { if (res < 0) {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: Query FAILED Call not logged!\n");
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Query FAILED Call not logged!\n");
} }
} }
} }
} else { } else {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: Query FAILED Call not logged!\n");
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Query FAILED Call not logged!\n");
} }
SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt); SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt);
ast_mutex_unlock(&odbc_lock); ast_mutex_unlock(&odbc_lock);
@ -208,29 +200,24 @@ static int odbc_unload_module(void)
{ {
ast_mutex_lock(&odbc_lock); ast_mutex_lock(&odbc_lock);
if (connected) { if (connected) {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: Disconnecting from %s\n", dsn);
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Disconnecting from %s\n", dsn);
SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt); SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt);
odbc_disconnect(); odbc_disconnect();
} }
if (dsn) { if (dsn) {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: free dsn\n");
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: free dsn\n");
ast_free(dsn); ast_free(dsn);
} }
if (username) { if (username) {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: free username\n");
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: free username\n");
ast_free(username); ast_free(username);
} }
if (password) { if (password) {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: free password\n");
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: free password\n");
ast_free(password); ast_free(password);
} }
if (table) { if (table) {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: free table\n");
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: free table\n");
ast_free(table); ast_free(table);
} }
@ -338,24 +325,18 @@ static int odbc_load_module(void)
goto out; goto out;
} }
if (option_verbose > 2) { ast_verb(3, "cdr_odbc: dsn is %s\n",dsn);
ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: dsn is %s\n",dsn); if (username) {
if (username) ast_verb(3, "cdr_odbc: username is %s\n",username);
{ ast_verb(3, "cdr_odbc: password is [secret]\n");
ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: username is %s\n",username); } else
ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: password is [secret]\n"); ast_verb(3, "cdr_odbc: retreiving username and password from odbc config\n");
} ast_verb(3, "cdr_odbc: table is %s\n",table);
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);
}
res = odbc_init(); res = odbc_init();
if (res < 0) { if (res < 0) {
ast_log(LOG_ERROR, "cdr_odbc: Unable to connect to datasource: %s\n", dsn); ast_log(LOG_ERROR, "cdr_odbc: Unable to connect to datasource: %s\n", dsn);
if (option_verbose > 2) { ast_verb(3, "cdr_odbc: Unable to connect to datasource: %s\n", dsn);
ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: Unable to connect to datasource: %s\n", dsn);
}
} }
res = ast_cdr_register(name, ast_module_info->description, odbc_log); res = ast_cdr_register(name, ast_module_info->description, odbc_log);
if (res) { if (res) {
@ -375,14 +356,12 @@ static int odbc_do_query(void)
ODBC_res = SQLExecute(ODBC_stmt); ODBC_res = SQLExecute(ODBC_stmt);
if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) { if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: Error in Query %d\n", ODBC_res);
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error in Query %d\n", ODBC_res);
SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt); SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt);
odbc_disconnect(); odbc_disconnect();
return -1; return -1;
} else { } else {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: Query Successful!\n");
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Query Successful!\n");
connected = 1; connected = 1;
} }
return 0; return 0;
@ -395,8 +374,7 @@ static int odbc_init(void)
if (ODBC_env == SQL_NULL_HANDLE || connected == 0) { if (ODBC_env == SQL_NULL_HANDLE || connected == 0) {
ODBC_res = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &ODBC_env); ODBC_res = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &ODBC_env);
if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) { if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: Error AllocHandle\n");
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error AllocHandle\n");
connected = 0; connected = 0;
return -1; 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); 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 ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: Error SetEnv\n");
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error SetEnv\n");
SQLFreeHandle(SQL_HANDLE_ENV, ODBC_env); SQLFreeHandle(SQL_HANDLE_ENV, ODBC_env);
connected = 0; connected = 0;
return -1; return -1;
@ -414,8 +391,7 @@ static int odbc_init(void)
ODBC_res = SQLAllocHandle(SQL_HANDLE_DBC, ODBC_env, &ODBC_con); ODBC_res = SQLAllocHandle(SQL_HANDLE_DBC, ODBC_env, &ODBC_con);
if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) { if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: Error AllocHDB %d\n", ODBC_res);
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error AllocHDB %d\n", ODBC_res);
SQLFreeHandle(SQL_HANDLE_ENV, ODBC_env); SQLFreeHandle(SQL_HANDLE_ENV, ODBC_env);
connected = 0; connected = 0;
return -1; 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); 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 ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: Error SQLConnect %d\n", ODBC_res);
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error SQLConnect %d\n", ODBC_res);
SQLFreeHandle(SQL_HANDLE_DBC, ODBC_con); SQLFreeHandle(SQL_HANDLE_DBC, ODBC_con);
SQLFreeHandle(SQL_HANDLE_ENV, ODBC_env); SQLFreeHandle(SQL_HANDLE_ENV, ODBC_env);
connected = 0; connected = 0;
return -1; return -1;
} else { } else {
if (option_verbose > 10) ast_verb(11, "cdr_odbc: Connected to %s\n", dsn);
ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Connected to %s\n", dsn);
connected = 1; connected = 1;
} }
return 0; return 0;

View File

@ -458,8 +458,7 @@ static struct ast_frame *agent_read(struct ast_channel *ast)
case AST_FRAME_CONTROL: case AST_FRAME_CONTROL:
if (f->subclass == AST_CONTROL_ANSWER) { if (f->subclass == AST_CONTROL_ANSWER) {
if (p->ackcall) { if (p->ackcall) {
if (option_verbose > 2) ast_verb(3, "%s answered, waiting for '#' to acknowledge\n", p->chan->name);
ast_verbose(VERBOSE_PREFIX_3 "%s answered, waiting for '#' to acknowledge\n", p->chan->name);
/* Don't pass answer along */ /* Don't pass answer along */
ast_frfree(f); ast_frfree(f);
f = &ast_null_frame; 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_BEGIN:
case AST_FRAME_DTMF_END: case AST_FRAME_DTMF_END:
if (!p->acknowledged && (f->subclass == '#')) { if (!p->acknowledged && (f->subclass == '#')) {
if (option_verbose > 2) ast_verb(3, "%s acknowledged\n", p->chan->name);
ast_verbose(VERBOSE_PREFIX_3 "%s acknowledged\n", p->chan->name);
p->acknowledged = 1; p->acknowledged = 1;
ast_frfree(f); ast_frfree(f);
f = &answer_frame; 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)) { } else if (!ast_strlen_zero(p->loginchan)) {
time(&p->start); time(&p->start);
/* Call on this agent */ /* Call on this agent */
if (option_verbose > 2) ast_verb(3, "outgoing agentcall, to agent '%s', on '%s'\n", p->agent, p->chan->name);
ast_verbose(VERBOSE_PREFIX_3 "outgoing agentcall, to agent '%s', on '%s'\n", p->agent, p->chan->name);
ast_set_callerid(p->chan, ast_set_callerid(p->chan,
ast->cid.cid_num, ast->cid.cid_name, NULL); ast->cid.cid_num, ast->cid.cid_name, NULL);
ast_channel_inherit_variables(ast, p->chan); 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); ast_mutex_unlock(&p->lock);
return res; 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); ast_debug(3, "Playing beep, lang '%s'\n", p->chan->language);
res = ast_streamfile(p->chan, beep, p->chan->language); res = ast_streamfile(p->chan, beep, p->chan->language);
ast_debug(3, "Played beep, result '%d'\n", res); 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) if (max_login_tries < 0)
max_login_tries = 0; max_login_tries = 0;
tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTMAXLOGINTRIES"); tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTMAXLOGINTRIES");
if (option_verbose > 2) ast_verb(3, "Saw variable AGENTMAXLOGINTRIES=%s, setting max_login_tries to: %d on Channel '%s'.\n",tmpoptions,max_login_tries,chan->name);
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);
} }
if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR"))) { if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR"))) {
if (ast_true(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 else
update_cdr = 0; update_cdr = 0;
tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR"); tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR");
if (option_verbose > 2) ast_verb(3, "Saw variable AGENTUPDATECDR=%s, setting update_cdr to: %d on Channel '%s'.\n",tmpoptions,update_cdr,chan->name);
ast_verbose(VERBOSE_PREFIX_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"))) { if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTGOODBYE"))) {
strcpy(agent_goodbye, pbx_builtin_getvar_helper(chan, "AGENTGOODBYE")); strcpy(agent_goodbye, pbx_builtin_getvar_helper(chan, "AGENTGOODBYE"));
tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTGOODBYE"); tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTGOODBYE");
if (option_verbose > 2) ast_verb(3, "Saw variable AGENTGOODBYE=%s, setting agent_goodbye to: %s on Channel '%s'.\n",tmpoptions,agent_goodbye,chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTGOODBYE=%s, setting agent_goodbye to: %s on Channel '%s'.\n",tmpoptions,agent_goodbye,chan->name);
} }
/* End Channel Specific Login Overrides */ /* End Channel Specific Login Overrides */
@ -1824,24 +1818,21 @@ static int login_exec(struct ast_channel *chan, void *data)
else else
p->ackcall = 0; p->ackcall = 0;
tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTACKCALL"); tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTACKCALL");
if (option_verbose > 2) ast_verb(3, "Saw variable AGENTACKCALL=%s, setting ackcall to: %d for Agent '%s'.\n",tmpoptions,p->ackcall,p->agent);
ast_verbose(VERBOSE_PREFIX_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"))) { if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTAUTOLOGOFF"))) {
p->autologoff = atoi(pbx_builtin_getvar_helper(chan, "AGENTAUTOLOGOFF")); p->autologoff = atoi(pbx_builtin_getvar_helper(chan, "AGENTAUTOLOGOFF"));
if (p->autologoff < 0) if (p->autologoff < 0)
p->autologoff = 0; p->autologoff = 0;
tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTAUTOLOGOFF"); tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTAUTOLOGOFF");
if (option_verbose > 2) ast_verb(3, "Saw variable AGENTAUTOLOGOFF=%s, setting autologff to: %d for Agent '%s'.\n",tmpoptions,p->autologoff,p->agent);
ast_verbose(VERBOSE_PREFIX_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"))) { if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTWRAPUPTIME"))) {
p->wrapuptime = atoi(pbx_builtin_getvar_helper(chan, "AGENTWRAPUPTIME")); p->wrapuptime = atoi(pbx_builtin_getvar_helper(chan, "AGENTWRAPUPTIME"));
if (p->wrapuptime < 0) if (p->wrapuptime < 0)
p->wrapuptime = 0; p->wrapuptime = 0;
tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTWRAPUPTIME"); tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTWRAPUPTIME");
if (option_verbose > 2) ast_verb(3, "Saw variable AGENTWRAPUPTIME=%s, setting wrapuptime to: %d for Agent '%s'.\n",tmpoptions,p->wrapuptime,p->agent);
ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTWRAPUPTIME=%s, setting wrapuptime to: %d for Agent '%s'.\n",tmpoptions,p->wrapuptime,p->agent);
} }
/* End Channel Specific Agent Overrides */ /* End Channel Specific Agent Overrides */
if (!p->chan) { if (!p->chan) {
@ -1887,8 +1878,7 @@ static int login_exec(struct ast_channel *chan, void *data)
if (update_cdr && chan->cdr) if (update_cdr && chan->cdr)
snprintf(chan->cdr->channel, sizeof(chan->cdr->channel), "Agent/%s", p->agent); snprintf(chan->cdr->channel, sizeof(chan->cdr->channel), "Agent/%s", p->agent);
ast_queue_log("NONE", chan->uniqueid, agent, "AGENTLOGIN", "%s", chan->name); ast_queue_log("NONE", chan->uniqueid, agent, "AGENTLOGIN", "%s", chan->name);
if (option_verbose > 1) ast_verb(2, "Agent '%s' logged in (format %s/%s)\n", p->agent,
ast_verbose(VERBOSE_PREFIX_2 "Agent '%s' logged in (format %s/%s)\n", p->agent,
ast_getformatname(chan->readformat), ast_getformatname(chan->writeformat)); ast_getformatname(chan->readformat), ast_getformatname(chan->writeformat));
/* Login this channel and wait for it to go away */ /* Login this channel and wait for it to go away */
p->chan = chan; p->chan = chan;
@ -1963,8 +1953,7 @@ static int login_exec(struct ast_channel *chan, void *data)
"Uniqueid: %s\r\n", "Uniqueid: %s\r\n",
p->agent, logintime, chan->uniqueid); p->agent, logintime, chan->uniqueid);
ast_queue_log("NONE", chan->uniqueid, agent, "AGENTLOGOFF", "%s|%ld", chan->name, logintime); ast_queue_log("NONE", chan->uniqueid, agent, "AGENTLOGOFF", "%s|%ld", chan->name, logintime);
if (option_verbose > 1) ast_verb(2, "Agent '%s' logged out\n", p->agent);
ast_verbose(VERBOSE_PREFIX_2 "Agent '%s' logged out\n", p->agent);
/* If there is no owner, go ahead and kill it now */ /* If there is no owner, go ahead and kill it now */
ast_device_state_changed("Agent/%s", p->agent); ast_device_state_changed("Agent/%s", p->agent);
if (p->dead && !p->owner) { if (p->dead && !p->owner) {

View File

@ -1124,10 +1124,8 @@ static int load_module(void)
} }
if (soundcard_init() < 0) { if (soundcard_init() < 0) {
if (option_verbose > 1) { ast_verb(2, "No sound card detected -- console channel will be unavailable\n");
ast_verbose(VERBOSE_PREFIX_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");
ast_verbose(VERBOSE_PREFIX_2 "Turn off ALSA support by adding 'noload=chan_alsa.so' in /etc/asterisk/modules.conf\n");
}
return AST_MODULE_LOAD_DECLINE; return AST_MODULE_LOAD_DECLINE;
} }

View File

@ -656,8 +656,7 @@ static int oh323_call(struct ast_channel *c, char *dest, int timeout)
/* indicate that this is an outgoing call */ /* indicate that this is an outgoing call */
pvt->outgoing = 1; pvt->outgoing = 1;
if (option_verbose > 2) ast_verb(3, "Requested transfer capability: 0x%.2x - %s\n", c->transfercapability, ast_transfercapability2str(c->transfercapability));
ast_verbose(VERBOSE_PREFIX_3 "Requested transfer capability: 0x%.2x - %s\n", c->transfercapability, ast_transfercapability2str(c->transfercapability));
if (h323debug) if (h323debug)
ast_debug(1, "Placing outgoing call to %s, %d/%d\n", called_addr, pvt->options.dtmfcodec[0], pvt->options.dtmfcodec[1]); 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); 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; pvt->jointcapability = pvt->options.capability;
if (h323debug) { if (h323debug) {
ast_verbose(VERBOSE_PREFIX_3 "Setting up Call\n"); ast_verb(3, "Setting up Call\n");
ast_verbose(VERBOSE_PREFIX_3 " \tCall token: [%s]\n", pvt->cd.call_token); ast_verb(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_verb(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_verb(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_verb(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, " \tCalled party number: [%s]\n", pvt->cd.call_dest_e164);
if (pvt->cd.redirect_reason >= 0) 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_verb(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, " \tCalling party IP: [%s]\n", pvt->cd.sourceIp);
} }
/* Decide if we are allowing Gatekeeper routed calls*/ /* Decide if we are allowing Gatekeeper routed calls*/
@ -2540,9 +2539,7 @@ static void *do_monitor(void *data)
h323_reloading = 0; h323_reloading = 0;
ast_mutex_unlock(&h323_reload_lock); ast_mutex_unlock(&h323_reload_lock);
if (reloading) { if (reloading) {
if (option_verbose > 0) { ast_verb(1, "Reloading H.323\n");
ast_verbose(VERBOSE_PREFIX_1 "Reloading H.323\n");
}
h323_do_reload(); h323_do_reload();
} }
/* Check for interfaces needing to be killed */ /* 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; return RESULT_SHOWUSAGE;
} }
if (h323_soft_hangup(argv[2])) { 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 { } 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; return RESULT_SUCCESS;
} }
@ -2922,7 +2919,7 @@ static int reload_config(int is_reload)
gkroute = ast_true(v->value); gkroute = ast_true(v->value);
} else if (!strcasecmp(v->name, "context")) { } else if (!strcasecmp(v->name, "context")) {
ast_copy_string(default_context, v->value, sizeof(default_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")) { } else if (!strcasecmp(v->name, "UserByAlias")) {
userbyalias = ast_true(v->value); userbyalias = ast_true(v->value);
} else if (!strcasecmp(v->name, "AcceptAnonymous")) { } else if (!strcasecmp(v->name, "AcceptAnonymous")) {

View File

@ -1736,8 +1736,7 @@ static void reload_firmware(void)
if (de->d_name[0] != '.') { if (de->d_name[0] != '.') {
snprintf(fn, sizeof(fn), "%s/%s", dir, de->d_name); snprintf(fn, sizeof(fn), "%s/%s", dir, de->d_name);
if (!try_firmware(fn)) { if (!try_firmware(fn)) {
if (option_verbose > 1) ast_verb(2, "Loaded firmware '%s'\n", de->d_name);
ast_verbose(VERBOSE_PREFIX_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]); ast_mutex_unlock(&iaxsl[callno]);
if (option_verbose > 2) ast_verb(3, "Hungup '%s'\n", c->name);
ast_verbose(VERBOSE_PREFIX_3 "Hungup '%s'\n", c->name);
return 0; return 0;
} }
@ -3333,8 +3331,7 @@ static enum ast_bridge_result iax2_bridge(struct ast_channel *c0, struct ast_cha
for (/* ever */;;) { for (/* ever */;;) {
/* Check in case we got masqueraded into */ /* Check in case we got masqueraded into */
if ((c0->tech != &iax2_tech) || (c1->tech != &iax2_tech)) { if ((c0->tech != &iax2_tech) || (c1->tech != &iax2_tech)) {
if (option_verbose > 2) ast_verb(3, "Can't masquerade, we're different...\n");
ast_verbose(VERBOSE_PREFIX_3 "Can't masquerade, we're different...\n");
/* Remove from native mode */ /* Remove from native mode */
if (c0->tech == &iax2_tech) { if (c0->tech == &iax2_tech) {
ast_mutex_lock(&iaxsl[callno0]); 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; return AST_BRIDGE_FAILED_NOWARN;
} }
if (c0->nativeformats != c1->nativeformats) { if (c0->nativeformats != c1->nativeformats) {
if (option_verbose > 2) {
char buf0[255]; char buf0[255];
char buf1[255]; char buf1[255];
ast_getformatname_multiple(buf0, sizeof(buf0) -1, c0->nativeformats); ast_getformatname_multiple(buf0, sizeof(buf0) -1, c0->nativeformats);
ast_getformatname_multiple(buf1, sizeof(buf1) -1, c1->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 */ /* Remove from native mode */
lock_both(callno0, callno1); lock_both(callno0, callno1);
if (iaxs[callno0]) 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); ast_sched_del(sched, reg->expire);
reg->expire = ast_sched_add(sched, (5 * reg->refresh / 6) * 1000, iax2_do_register_s, reg); 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 (inaddrcmp(&oldus, &reg->us) || (reg->messages != oldmsgs)) {
if (option_verbose > 2) {
if (reg->messages > 255) if (reg->messages > 255)
snprintf(msgstatus, sizeof(msgstatus), " with %d new and %d old messages waiting", reg->messages & 0xff, reg->messages >> 8); snprintf(msgstatus, sizeof(msgstatus), " with %d new and %d old messages waiting", reg->messages & 0xff, reg->messages >> 8);
else if (reg->messages > 1) 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 else
snprintf(msgstatus, sizeof(msgstatus), " with no messages waiting\n"); 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)); 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)); 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; reg->regstate = REG_STATE_REGISTERED;
@ -5942,8 +5935,7 @@ static void reg_source_db(struct iax2_peer *p)
if (d) { if (d) {
*d = '\0'; *d = '\0';
d++; d++;
if (option_verbose > 2) ast_verb(3, "Seeding '%s' at %s:%d for %d\n", p->name,
ast_verbose(VERBOSE_PREFIX_3 "Seeding '%s' at %s:%d for %d\n", p->name,
ast_inet_ntoa(in), atoi(c), atoi(d)); ast_inet_ntoa(in), atoi(c), atoi(d));
iax2_poke_peer(p, 0); iax2_poke_peer(p, 0);
p->expiry = atoi(d); 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); 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) { if (!ast_test_flag(p, IAX_TEMPONLY) && sin->sin_addr.s_addr) {
ast_db_put("IAX/Registry", p->name, data); ast_db_put("IAX/Registry", p->name, data);
if (option_verbose > 2) ast_verb(3, "Registered IAX2 '%s' (%s) at %s:%d\n", p->name,
ast_verbose(VERBOSE_PREFIX_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)); 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); manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: IAX2/%s\r\nPeerStatus: Registered\r\n", p->name);
register_peer_exten(p, 1); register_peer_exten(p, 1);
ast_device_state_changed("IAX2/%s", p->name); /* Activate notification */ ast_device_state_changed("IAX2/%s", p->name); /* Activate notification */
} else if (!ast_test_flag(p, IAX_TEMPONLY)) { } else if (!ast_test_flag(p, IAX_TEMPONLY)) {
if (option_verbose > 2) ast_verb(3, "Unregistered IAX2 '%s' (%s)\n", p->name,
ast_verbose(VERBOSE_PREFIX_3 "Unregistered IAX2 '%s' (%s)\n", p->name,
ast_test_flag(&iaxs[callno]->state, IAX_STATE_AUTHENTICATED) ? "AUTHENTICATED" : "UNAUTHENTICATED"); 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); manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: IAX2/%s\r\nPeerStatus: Unregistered\r\n", p->name);
register_peer_exten(p, 0); 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); send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACCEPT, 0, ied1.buf, ied1.pos, -1);
if (strcmp(iaxs[fr->callno]->exten, "TBD")) { if (strcmp(iaxs[fr->callno]->exten, "TBD")) {
ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED); ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
if (option_verbose > 2) ast_verb(3, "Accepting UNAUTHENTICATED call from %s:\n"
ast_verbose(VERBOSE_PREFIX_3 "Accepting UNAUTHENTICATED call from %s:\n"
"%srequested format = %s,\n" "%srequested format = %s,\n"
"%srequested prefs = %s,\n" "%srequested prefs = %s,\n"
"%sactual format = %s,\n" "%sactual format = %s,\n"
@ -7602,8 +7591,7 @@ retryowner:
} else { } else {
ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_TBD); ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_TBD);
/* If this is a TBD call, we're ready but now what... */ /* If this is a TBD call, we're ready but now what... */
if (option_verbose > 2) ast_verb(3, "Accepted unauthenticated TBD call from %s\n", ast_inet_ntoa(sin.sin_addr));
ast_verbose(VERBOSE_PREFIX_3 "Accepted unauthenticated TBD call from %s\n", ast_inet_ntoa(sin.sin_addr));
} }
} }
} }
@ -7701,8 +7689,7 @@ retryowner:
else else
iaxs[fr->callno]->peerformat = iaxs[fr->callno]->capability; iaxs[fr->callno]->peerformat = iaxs[fr->callno]->capability;
} }
if (option_verbose > 2) 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));
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));
if (!(iaxs[fr->callno]->peerformat & iaxs[fr->callno]->capability)) { if (!(iaxs[fr->callno]->peerformat & iaxs[fr->callno]->capability)) {
memset(&ied0, 0, sizeof(ied0)); memset(&ied0, 0, sizeof(ied0));
iax_ie_append_str(&ied0, IAX_IE_CAUSE, "Unable to negotiate codec"); iax_ie_append_str(&ied0, IAX_IE_CAUSE, "Unable to negotiate codec");
@ -7715,8 +7702,7 @@ retryowner:
if (iaxs[fr->callno]->owner) { if (iaxs[fr->callno]->owner) {
/* Switch us to use a compatible format */ /* Switch us to use a compatible format */
iaxs[fr->callno]->owner->nativeformats = iaxs[fr->callno]->peerformat; iaxs[fr->callno]->owner->nativeformats = iaxs[fr->callno]->peerformat;
if (option_verbose > 2) ast_verb(3, "Format for call is %s\n", ast_getformatname(iaxs[fr->callno]->owner->nativeformats));
ast_verbose(VERBOSE_PREFIX_3 "Format for call is %s\n", ast_getformatname(iaxs[fr->callno]->owner->nativeformats));
retryowner2: retryowner2:
if (ast_mutex_trylock(&iaxs[fr->callno]->owner->lock)) { if (ast_mutex_trylock(&iaxs[fr->callno]->owner->lock)) {
ast_mutex_unlock(&iaxsl[fr->callno]); 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); send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACCEPT, 0, ied1.buf, ied1.pos, -1);
if (strcmp(iaxs[fr->callno]->exten, "TBD")) { if (strcmp(iaxs[fr->callno]->exten, "TBD")) {
ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED); ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
if (option_verbose > 2) ast_verb(3, "Accepting AUTHENTICATED call from %s:\n"
ast_verbose(VERBOSE_PREFIX_3 "Accepting AUTHENTICATED call from %s:\n"
"%srequested format = %s,\n" "%srequested format = %s,\n"
"%srequested prefs = %s,\n" "%srequested prefs = %s,\n"
"%sactual format = %s,\n" "%sactual format = %s,\n"
@ -8016,8 +8001,7 @@ retryowner2:
} else { } else {
ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_TBD); ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_TBD);
/* If this is a TBD call, we're ready but now what... */ /* If this is a TBD call, we're ready but now what... */
if (option_verbose > 2) ast_verb(3, "Accepted AUTHENTICATED TBD call from %s\n", ast_inet_ntoa(sin.sin_addr));
ast_verbose(VERBOSE_PREFIX_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); send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
} else { } else {
ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED); ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
if (option_verbose > 2) ast_verb(3, "Accepting DIAL from %s, formats = 0x%x\n", ast_inet_ntoa(sin.sin_addr), iaxs[fr->callno]->peerformat);
ast_verbose(VERBOSE_PREFIX_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); 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); 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))) if (!(c = ast_iax2_new(fr->callno, AST_STATE_RING, iaxs[fr->callno]->peerformat)))
@ -8141,8 +8124,7 @@ retryowner2:
break; break;
case IAX_COMMAND_TXREJ: case IAX_COMMAND_TXREJ:
iaxs[fr->callno]->transferring = 0; iaxs[fr->callno]->transferring = 0;
if (option_verbose > 2) ast_verb(3, "Channel '%s' unable to transfer\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
ast_verbose(VERBOSE_PREFIX_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)); memset(&iaxs[fr->callno]->transfer, 0, sizeof(iaxs[fr->callno]->transfer));
if (iaxs[fr->callno]->bridgecallno) { if (iaxs[fr->callno]->bridgecallno) {
if (iaxs[iaxs[fr->callno]->bridgecallno]->transferring) { if (iaxs[iaxs[fr->callno]->bridgecallno]->transferring) {
@ -8158,15 +8140,13 @@ retryowner2:
iaxs[fr->callno]->transferring = TRANSFER_MREADY; iaxs[fr->callno]->transferring = TRANSFER_MREADY;
else else
iaxs[fr->callno]->transferring = TRANSFER_READY; iaxs[fr->callno]->transferring = TRANSFER_READY;
if (option_verbose > 2) ast_verb(3, "Channel '%s' ready to transfer\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
ast_verbose(VERBOSE_PREFIX_3 "Channel '%s' ready to transfer\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
if (iaxs[fr->callno]->bridgecallno) { if (iaxs[fr->callno]->bridgecallno) {
if ((iaxs[iaxs[fr->callno]->bridgecallno]->transferring == TRANSFER_READY) || if ((iaxs[iaxs[fr->callno]->bridgecallno]->transferring == TRANSFER_READY) ||
(iaxs[iaxs[fr->callno]->bridgecallno]->transferring == TRANSFER_MREADY)) { (iaxs[iaxs[fr->callno]->bridgecallno]->transferring == TRANSFER_MREADY)) {
/* They're both ready, now release them. */ /* They're both ready, now release them. */
if (iaxs[fr->callno]->transferring == TRANSFER_MREADY) { if (iaxs[fr->callno]->transferring == TRANSFER_MREADY) {
if (option_verbose > 2) ast_verb(3, "Attempting media bridge of %s and %s\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>",
ast_verbose(VERBOSE_PREFIX_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]->owner ? iaxs[iaxs[fr->callno]->bridgecallno]->owner->name : "<Unknown>");
iaxs[iaxs[fr->callno]->bridgecallno]->transferring = TRANSFER_MEDIA; 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[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); send_command(iaxs[iaxs[fr->callno]->bridgecallno], AST_FRAME_IAX, IAX_COMMAND_TXMEDIA, 0, ied1.buf, ied1.pos, -1);
} else { } else {
if (option_verbose > 2) ast_verb(3, "Releasing %s and %s\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>",
ast_verbose(VERBOSE_PREFIX_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]->owner ? iaxs[iaxs[fr->callno]->bridgecallno]->owner->name : "<Unknown>");
iaxs[iaxs[fr->callno]->bridgecallno]->transferring = TRANSFER_RELEASED; 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; return -1;
} }
res = iax2_provision(&iaxs[callno]->addr, iaxs[callno]->sockfd, NULL, sdata, force); res = iax2_provision(&iaxs[callno]->addr, iaxs[callno]->sockfd, NULL, sdata, force);
if (option_verbose > 2) ast_verb(3, "Provisioned IAXY at '%s' with '%s'= %d\n",
ast_verbose(VERBOSE_PREFIX_3 "Provisioned IAXY at '%s' with '%s'= %d\n",
ast_inet_ntoa(iaxs[callno]->addr.sin_addr), ast_inet_ntoa(iaxs[callno]->addr.sin_addr),
sdata, res); sdata, res);
return 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(&schedthreadid, NULL, sched_thread, NULL);
ast_pthread_create_background(&netthreadid, NULL, network_thread, NULL); ast_pthread_create_background(&netthreadid, NULL, network_thread, NULL);
if (option_verbose > 1) ast_verb(2, "%d helper threaads started\n", threadcount);
ast_verbose(VERBOSE_PREFIX_2 "%d helper threaads started\n", threadcount);
return 0; 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))) { 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); ast_log(LOG_WARNING, "Unable apply binding to '%s' at line %d\n", v->value, v->lineno);
} else { } else {
if (option_verbose > 1) {
if (strchr(v->value, ':')) 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 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) if (defaultsockfd < 0)
defaultsockfd = ast_netsock_sockfd(ns); defaultsockfd = ast_netsock_sockfd(ns);
ast_netsock_unref(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))) { 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)); ast_log(LOG_ERROR, "Unable to create network socket: %s\n", strerror(errno));
} else { } else {
if (option_verbose > 1) ast_verb(2, "Binding IAX2 to default address 0.0.0.0:%d\n", portno);
ast_verbose(VERBOSE_PREFIX_2 "Binding IAX2 to default address 0.0.0.0:%d\n", portno);
defaultsockfd = ast_netsock_sockfd(ns); defaultsockfd = ast_netsock_sockfd(ns);
ast_netsock_unref(ns); ast_netsock_unref(ns);
} }
@ -10367,8 +10341,7 @@ static int iax2_exec(struct ast_channel *chan, const char *context, const char *
} else { } else {
snprintf(req, sizeof(req), "IAX2/%s/%s", odata, exten); snprintf(req, sizeof(req), "IAX2/%s/%s", odata, exten);
} }
if (option_verbose > 2) ast_verb(3, "Executing Dial('%s')\n", req);
ast_verbose(VERBOSE_PREFIX_3 "Executing Dial('%s')\n", req);
} else { } else {
AST_LIST_UNLOCK(&dpcache); AST_LIST_UNLOCK(&dpcache);
ast_log(LOG_WARNING, "Can't execute nonexistent extension '%s[@%s]' in data '%s'\n", exten, context, data); 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"); ast_log(LOG_ERROR, "Unable to start network thread\n");
__unload_module(); __unload_module();
return AST_MODULE_LOAD_FAILURE; return AST_MODULE_LOAD_FAILURE;
} else if (option_verbose > 1) } else
ast_verbose(VERBOSE_PREFIX_2 "IAX Ready and Listening\n"); ast_verb(2, "IAX Ready and Listening\n");
AST_LIST_LOCK(&registrations); AST_LIST_LOCK(&registrations);
AST_LIST_TRAVERSE(&registrations, reg, entry) AST_LIST_TRAVERSE(&registrations, reg, entry)

View File

@ -854,7 +854,7 @@ static int mgcp_call(struct ast_channel *ast, char *dest, int timeout)
struct ast_var_t *current; struct ast_var_t *current;
if (mgcpdebug) { 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; sub = ast->tech_pvt;
p = sub->parent; 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)) { if (!ast_strlen_zero(distinctive_ring)) {
snprintf(tone, sizeof(tone), "L/wt%s", distinctive_ring); snprintf(tone, sizeof(tone), "L/wt%s", distinctive_ring);
if (mgcpdebug) { if (mgcpdebug) {
ast_verbose(VERBOSE_PREFIX_3 "MGCP distinctive callwait %s\n", tone); ast_verb(3, "MGCP distinctive callwait %s\n", tone);
} }
} else { } else {
snprintf(tone, sizeof(tone), "L/wt"); snprintf(tone, sizeof(tone), "L/wt");
if (mgcpdebug) { if (mgcpdebug) {
ast_verbose(VERBOSE_PREFIX_3 "MGCP normal callwait %s\n", tone); ast_verb(3, "MGCP normal callwait %s\n", tone);
} }
} }
break; break;
@ -886,12 +886,12 @@ static int mgcp_call(struct ast_channel *ast, char *dest, int timeout)
if (!ast_strlen_zero(distinctive_ring)) { if (!ast_strlen_zero(distinctive_ring)) {
snprintf(tone, sizeof(tone), "L/r%s", distinctive_ring); snprintf(tone, sizeof(tone), "L/r%s", distinctive_ring);
if (mgcpdebug) { if (mgcpdebug) {
ast_verbose(VERBOSE_PREFIX_3 "MGCP distinctive ring %s\n", tone); ast_verb(3, "MGCP distinctive ring %s\n", tone);
} }
} else { } else {
snprintf(tone, sizeof(tone), "L/rg"); snprintf(tone, sizeof(tone), "L/rg");
if (mgcpdebug) { if (mgcpdebug) {
ast_verbose(VERBOSE_PREFIX_3 "MGCP default ring\n"); ast_verb(3, "MGCP default ring\n");
} }
} }
break; break;
@ -952,7 +952,7 @@ static int mgcp_hangup(struct ast_channel *ast)
} }
ast_mutex_lock(&sub->lock); ast_mutex_lock(&sub->lock);
if (mgcpdebug) { 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) { 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) if (p->dtmfmode & MGCP_DTMF_HYBRID)
p->dtmfmode &= ~MGCP_DTMF_INBAND; p->dtmfmode &= ~MGCP_DTMF_INBAND;
if (mgcpdebug) { 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); ast_dsp_free(p->dsp);
p->dsp = NULL; p->dsp = NULL;
@ -1013,19 +1013,18 @@ static int mgcp_hangup(struct ast_channel *ast)
if ((p->hookstate == MGCP_ONHOOK) && (!sub->next->rtp)) { if ((p->hookstate == MGCP_ONHOOK) && (!sub->next->rtp)) {
p->hidecallerid = 0; p->hidecallerid = 0;
if (p->hascallwaiting && !p->callwaiting) { if (p->hascallwaiting && !p->callwaiting) {
if (option_verbose > 2) ast_verb(3, "Enabling call waiting on %s\n", ast->name);
ast_verbose(VERBOSE_PREFIX_3 "Enabling call waiting on %s\n", ast->name);
p->callwaiting = -1; p->callwaiting = -1;
} }
if (has_voicemail(p)) { if (has_voicemail(p)) {
if (mgcpdebug) { 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); ast->name, p->name, p->parent->name);
} }
transmit_notify_request(sub, "L/vmwi(+)"); transmit_notify_request(sub, "L/vmwi(+)");
} else { } else {
if (mgcpdebug) { 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); ast->name, p->name, p->parent->name);
} }
transmit_notify_request(sub, "L/vmwi(-)"); transmit_notify_request(sub, "L/vmwi(-)");
@ -1192,11 +1191,8 @@ static int mgcp_answer(struct ast_channel *ast)
} else { } else {
transmit_modify_request(sub); transmit_modify_request(sub);
} }
/* verbose level check */ ast_verb(3, "MGCP mgcp_answer(%s) on %s@%s-%d\n",
if (option_verbose > 2) {
ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_answer(%s) on %s@%s-%d\n",
ast->name, p->name, p->parent->name, sub->id); ast->name, p->name, p->parent->name, sub->id);
}
if (ast->_state != AST_STATE_UP) { if (ast->_state != AST_STATE_UP) {
ast_setstate(ast, AST_STATE_UP); ast_setstate(ast, AST_STATE_UP);
ast_debug(1, "mgcp_answer(%s)\n", ast->name); 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; int res = 0;
if (mgcpdebug) { 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); ind, control2str(ind), ast->name);
} }
ast_mutex_lock(&sub->lock); ast_mutex_lock(&sub->lock);
@ -1508,11 +1504,8 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
tmp = NULL; tmp = NULL;
} }
} }
/* verbose level check */ ast_verb(3, "MGCP mgcp_new(%s) created in state: %s\n",
if (option_verbose > 2) {
ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_new(%s) created in state: %s\n",
tmp->name, ast_state2str(state)); tmp->name, ast_state2str(state));
}
} else { } else {
ast_log(LOG_WARNING, "Unable to allocate channel structure\n"); 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)); memcpy(&g->addr, sin, sizeof(g->addr));
if (ast_ouraddrfor(&g->addr.sin_addr, &g->ourip)) if (ast_ouraddrfor(&g->addr.sin_addr, &g->ourip))
memcpy(&g->ourip, &__ourip, sizeof(g->ourip)); memcpy(&g->ourip, &__ourip, sizeof(g->ourip));
if (option_verbose > 2) 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));
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));
} }
} }
/* not dynamic, check if the name matches */ /* 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) { 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); p->name, p->parent->name, sub->id, mgcp_cxmodes[sub->cxmode], sub->callid);
} }
reqprep(&resp, p, "CRCX"); 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; struct mgcp_endpoint *p = sub->parent;
if (mgcpdebug) { 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]); tone, p->name, p->parent->name, sub->id, mgcp_cxmodes[sub->cxmode]);
} }
ast_copy_string(p->curtone, tone, sizeof(p->curtone)); 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); add_header(&resp, "S", tone2);
} }
if (mgcpdebug) { 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]); tone2, p->name, p->parent->name, sub->id, mgcp_cxmodes[sub->cxmode]);
} }
/* fill in new fields */ /* fill in new fields */
@ -2280,7 +2272,7 @@ static int transmit_modify_request(struct mgcp_subchannel *sub)
return 0; return 0;
} }
if (mgcpdebug) { 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); p->name, p->parent->name, sub->id, mgcp_cxmodes[sub->cxmode], sub->callid);
} }
reqprep(&resp, p, "MDCX"); reqprep(&resp, p, "MDCX");
@ -2323,7 +2315,7 @@ static int transmit_connection_del(struct mgcp_subchannel *sub)
struct mgcp_request resp; struct mgcp_request resp;
if (mgcpdebug) { 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); sub->cxident, p->name, p->parent->name, sub->id, mgcp_cxmodes[sub->cxmode], sub->callid);
} }
reqprep(&resp, p, "DLCX"); 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; struct mgcp_request resp;
if (mgcpdebug) { 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 : ""); cxident ? cxident : "", p->name, p->parent->name, callid ? callid : "");
} }
reqprep(&resp, p, "DLCX"); 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); req = find_command(p, sub, &p->cmd_queue, &p->cmd_queue_lock, ident);
if (!req) { if (!req) {
if (option_verbose > 2) { ast_verb(3, "No command found on [%s] for transaction %d. Ignoring...\n",
ast_verbose(VERBOSE_PREFIX_3 "No command found on [%s] for transaction %d. Ignoring...\n",
gw->name, ident); gw->name, ident);
}
return; return;
} }
@ -2534,10 +2524,8 @@ static void handle_response(struct mgcp_endpoint *p, struct mgcp_subchannel *sub
if (len > (sizeof(cxident) - 1)) if (len > (sizeof(cxident) - 1))
len = sizeof(cxident) - 1; len = sizeof(cxident) - 1;
ast_copy_string(cxident, v, len); ast_copy_string(cxident, v, len);
if (option_verbose > 2) { ast_verb(3, "Non existing connection id %s on %s@%s \n",
ast_verbose(VERBOSE_PREFIX_3 "Non existing connection id %s on %s@%s \n",
cxident, p->name, gw->name); cxident, p->name, gw->name);
}
transmit_connection_del_w_params(p, NULL, cxident); transmit_connection_del_w_params(p, NULL, cxident);
} }
} }
@ -2559,10 +2547,7 @@ static void handle_response(struct mgcp_endpoint *p, struct mgcp_subchannel *sub
/* update the requested events according to the new hookstate */ /* update the requested events according to the new hookstate */
transmit_notify_request(p->sub, ""); transmit_notify_request(p->sub, "");
/* verbose level check */ ast_verb(3, "Setting hookstate of %s@%s to ONHOOK\n", p->name, gw->name);
if (option_verbose > 2) {
ast_verbose(VERBOSE_PREFIX_3 "Setting hookstate of %s@%s to ONHOOK\n", p->name, gw->name);
}
} }
} else if (strstr(c, "hd")) { } else if (strstr(c, "hd")) {
if (p->hookstate != MGCP_OFFHOOK) { if (p->hookstate != MGCP_OFFHOOK) {
@ -2571,10 +2556,7 @@ static void handle_response(struct mgcp_endpoint *p, struct mgcp_subchannel *sub
/* update the requested events according to the new hookstate */ /* update the requested events according to the new hookstate */
transmit_notify_request(p->sub, ""); transmit_notify_request(p->sub, "");
/* verbose level check */ ast_verb(3, "Setting hookstate of %s@%s to OFFHOOK\n", p->name, gw->name);
if (option_verbose > 2) {
ast_verbose(VERBOSE_PREFIX_3 "Setting hookstate of %s@%s to OFFHOOK\n", p->name, gw->name);
}
} }
} }
} }
@ -2662,10 +2644,8 @@ static void *mgcp_ss(void *data)
if (getforward) { if (getforward) {
/* Record this as the forwarding extension */ /* Record this as the forwarding extension */
ast_copy_string(p->call_forward, p->dtmf_buf, sizeof(p->call_forward)); ast_copy_string(p->call_forward, p->dtmf_buf, sizeof(p->call_forward));
if (option_verbose > 2) { ast_verb(3, "Setting call forward to '%s' on channel %s\n",
ast_verbose(VERBOSE_PREFIX_3 "Setting call forward to '%s' on channel %s\n",
p->call_forward, chan->name); p->call_forward, chan->name);
}
/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/ /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl"); transmit_notify_request(sub, "L/sl");
if (res) if (res)
@ -2716,9 +2696,7 @@ static void *mgcp_ss(void *data)
ast_hangup(chan); ast_hangup(chan);
return NULL; return NULL;
} else if (p->hascallwaiting && p->callwaiting && !strcmp(p->dtmf_buf, "*70")) { } else if (p->hascallwaiting && p->callwaiting && !strcmp(p->dtmf_buf, "*70")) {
if (option_verbose > 2) { ast_verb(3, "Disabling call waiting on %s\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Disabling call waiting on %s\n", chan->name);
}
/* Disable call waiting if enabled */ /* Disable call waiting if enabled */
p->callwaiting = 0; p->callwaiting = 0;
/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/ /*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); ast_hangup(chan);
return NULL; return NULL;
} else if (!p->hidecallerid && !strcmp(p->dtmf_buf, "*67")) { } else if (!p->hidecallerid && !strcmp(p->dtmf_buf, "*67")) {
if (option_verbose > 2) { ast_verb(3, "Disabling Caller*ID on %s\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Disabling Caller*ID on %s\n", chan->name);
}
/* Disable Caller*ID if enabled */ /* Disable Caller*ID if enabled */
p->hidecallerid = 1; p->hidecallerid = 1;
ast_set_callerid(chan, "", "", NULL); ast_set_callerid(chan, "", "", NULL);
@ -2762,9 +2738,7 @@ static void *mgcp_ss(void *data)
break; break;
} else if (!strcmp(p->dtmf_buf, "*78")) { } else if (!strcmp(p->dtmf_buf, "*78")) {
/* Do not disturb */ /* Do not disturb */
if (option_verbose > 2) { ast_verb(3, "Enabled DND on channel %s\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Enabled DND on channel %s\n", chan->name);
}
/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/ /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl"); transmit_notify_request(sub, "L/sl");
p->dnd = 1; p->dnd = 1;
@ -2773,9 +2747,7 @@ static void *mgcp_ss(void *data)
len = 0; len = 0;
} else if (!strcmp(p->dtmf_buf, "*79")) { } else if (!strcmp(p->dtmf_buf, "*79")) {
/* Do not disturb */ /* Do not disturb */
if (option_verbose > 2) { ast_verb(3, "Disabled DND on channel %s\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Disabled DND on channel %s\n", chan->name);
}
/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/ /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl"); transmit_notify_request(sub, "L/sl");
p->dnd = 0; p->dnd = 0;
@ -2789,9 +2761,7 @@ static void *mgcp_ss(void *data)
memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf)); memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
len = 0; len = 0;
} else if (p->cancallforward && !strcmp(p->dtmf_buf, "*73")) { } else if (p->cancallforward && !strcmp(p->dtmf_buf, "*73")) {
if (option_verbose > 2) { ast_verb(3, "Cancelling call forwarding on channel %s\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Cancelling call forwarding on channel %s\n", chan->name);
}
/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/ /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl"); transmit_notify_request(sub, "L/sl");
memset(p->call_forward, 0, sizeof(p->call_forward)); 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, /* This is a three way call, the main call being a real channel,
and we're parking the first call. */ and we're parking the first call. */
ast_masq_park_call(ast_bridged_channel(sub->next->owner), chan, 0, NULL); ast_masq_park_call(ast_bridged_channel(sub->next->owner), chan, 0, NULL);
if (option_verbose > 2) { ast_verb(3, "Parking call to '%s'\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Parking call to '%s'\n", chan->name);
}
break; break;
} else if (!ast_strlen_zero(p->lastcallerid) && !strcmp(p->dtmf_buf, "*60")) { } else if (!ast_strlen_zero(p->lastcallerid) && !strcmp(p->dtmf_buf, "*60")) {
if (option_verbose > 2) { ast_verb(3, "Blacklisting number %s\n", p->lastcallerid);
ast_verbose(VERBOSE_PREFIX_3 "Blacklisting number %s\n", p->lastcallerid);
}
res = ast_db_put("blacklist", p->lastcallerid, "1"); res = ast_db_put("blacklist", p->lastcallerid, "1");
if (!res) { if (!res) {
/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/ /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
@ -2819,9 +2785,7 @@ static void *mgcp_ss(void *data)
len = 0; len = 0;
} }
} else if (p->hidecallerid && !strcmp(p->dtmf_buf, "*82")) { } else if (p->hidecallerid && !strcmp(p->dtmf_buf, "*82")) {
if (option_verbose > 2) { ast_verb(3, "Enabling Caller*ID on %s\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Enabling Caller*ID on %s\n", chan->name);
}
/* Enable Caller*ID if enabled */ /* Enable Caller*ID if enabled */
p->hidecallerid = 0; p->hidecallerid = 0;
ast_set_callerid(chan, p->cid_num, p->cid_name, NULL); 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; return -1;
} }
/*swap_subs(p, SUB_THREEWAY, SUB_REAL);*/ /*swap_subs(p, SUB_THREEWAY, SUB_REAL);*/
if (option_verbose > 2) { ast_verb(3, "Swapping %d for %d on %s@%s\n", p->sub->id, p->sub->next->id, p->name, p->parent->name);
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);
}
p->sub = p->sub->next; p->sub = p->sub->next;
unalloc_sub(p->sub->next); unalloc_sub(p->sub->next);
/* Tell the caller not to hangup */ /* 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")) { if (!strcasecmp(req->verb, "RSIP")) {
/* Test if this RSIP request is just a keepalive */ /* Test if this RSIP request is just a keepalive */
if(!strcasecmp( get_header(req, "RM"), "X-keepalive")) { if(!strcasecmp( get_header(req, "RM"), "X-keepalive")) {
if (option_verbose > 2) ast_verb(3, "Received keepalive request from %s@%s\n", p->name, p->parent->name);
ast_verbose(VERBOSE_PREFIX_3 "Received keepalive request from %s@%s\n", p->name, p->parent->name);
transmit_response(sub, "200", req, "OK"); transmit_response(sub, "200", req, "OK");
} else { } else {
dump_queue(p->parent, p); dump_queue(p->parent, p);
dump_cmd_queues(p, NULL); dump_cmd_queues(p, NULL);
if (option_verbose > 2 && (strcmp(p->name, p->parent->wcardep) != 0)) { if ((strcmp(p->name, p->parent->wcardep) != 0)) {
ast_verbose(VERBOSE_PREFIX_3 "Resetting interface %s@%s\n", p->name, p->parent->name); ast_verb(3, "Resetting interface %s@%s\n", p->name, p->parent->name);
} }
/* For RSIP on wildcard we reset all endpoints */ /* For RSIP on wildcard we reset all endpoints */
if (!strcmp(p->name, p->parent->wcardep)) { 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, "*") != 0) && (strcmp(tmp_ep->name, "aaln/" "*") != 0)) {*/
if (strcmp(tmp_ep->name, g->wcardep) != 0) { if (strcmp(tmp_ep->name, g->wcardep) != 0) {
struct mgcp_subchannel *tmp_sub, *first_sub; struct mgcp_subchannel *tmp_sub, *first_sub;
if (option_verbose > 2) { ast_verb(3, "Resetting interface %s@%s\n", tmp_ep->name, p->parent->name);
ast_verbose(VERBOSE_PREFIX_3 "Resetting interface %s@%s\n", tmp_ep->name, p->parent->name);
}
first_sub = tmp_ep->sub; first_sub = tmp_ep->sub;
tmp_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; return -1;
if (p->callwaiting || p->transfer || p->threewaycalling) { if (p->callwaiting || p->transfer || p->threewaycalling) {
if (option_verbose > 2) { ast_verb(3, "Swapping %d for %d on %s@%s\n", p->sub->id, p->sub->next->id, p->name, p->parent->name);
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);
}
p->sub = p->sub->next; p->sub = p->sub->next;
/* transfer control to our next subchannel */ /* transfer control to our next subchannel */
if (!sub->next->owner) { if (!sub->next->owner) {
/* plave the first call on hold and start up a new call */ /* plave the first call on hold and start up a new call */
sub->cxmode = MGCP_CX_MUTE; sub->cxmode = MGCP_CX_MUTE;
if (option_verbose > 2) { ast_verb(3, "MGCP Muting %d on %s@%s\n", sub->id, p->name, p->parent->name);
ast_verbose(VERBOSE_PREFIX_3 "MGCP Muting %d on %s@%s\n", sub->id, p->name, p->parent->name);
}
transmit_modify_request(sub); transmit_modify_request(sub);
if (sub->owner && ast_bridged_channel(sub->owner)) if (sub->owner && ast_bridged_channel(sub->owner))
ast_queue_control(sub->owner, AST_CONTROL_HOLD); 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 */ /* We've got two active calls lets decide whether or not to conference or just flip flop */
if ((!sub->outgoing) && (!sub->next->outgoing)) { if ((!sub->outgoing) && (!sub->next->outgoing)) {
/* We made both calls lets conferenct */ /* We made both calls lets conferenct */
if (option_verbose > 2) { ast_verb(3, "MGCP Conferencing %d and %d on %s@%s\n",
ast_verbose(VERBOSE_PREFIX_3 "MGCP Conferencing %d and %d on %s@%s\n",
sub->id, sub->next->id, p->name, p->parent->name); sub->id, sub->next->id, p->name, p->parent->name);
}
sub->cxmode = MGCP_CX_CONF; sub->cxmode = MGCP_CX_CONF;
sub->next->cxmode = MGCP_CX_CONF; sub->next->cxmode = MGCP_CX_CONF;
if (ast_bridged_channel(sub->next->owner)) 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 */ /* Let's flipflop between calls */
/* XXX Need to check for state up ??? */ /* XXX Need to check for state up ??? */
/* XXX Need a way to indicate the current call, or maybe the call that's waiting */ /* XXX Need a way to indicate the current call, or maybe the call that's waiting */
if (option_verbose > 2) { ast_verb(3, "We didn't make one of the calls FLIPFLOP %d and %d on %s@%s\n",
ast_verbose(VERBOSE_PREFIX_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->id, sub->next->id, p->name, p->parent->name);
}
sub->cxmode = MGCP_CX_MUTE; sub->cxmode = MGCP_CX_MUTE;
if (option_verbose > 2) { ast_verb(3, "MGCP Muting %d on %s@%s\n", sub->id, p->name, p->parent->name);
ast_verbose(VERBOSE_PREFIX_3 "MGCP Muting %d on %s@%s\n", sub->id, p->name, p->parent->name);
}
transmit_modify_request(sub); transmit_modify_request(sub);
if (ast_bridged_channel(sub->owner)) if (ast_bridged_channel(sub->owner))
ast_queue_control(sub->owner, AST_CONTROL_HOLD); 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; sub->alreadygone = 1;
mgcp_queue_hangup(sub); mgcp_queue_hangup(sub);
} else { } else {
/* verbose level check */ ast_verb(3, "MGCP handle_request(%s@%s-%d) ast_channel already destroyed, resending DLCX.\n",
if (option_verbose > 2) {
ast_verbose(VERBOSE_PREFIX_3 "MGCP handle_request(%s@%s-%d) ast_channel already destroyed, resending DLCX.\n",
p->name, p->parent->name, sub->id); p->name, p->parent->name, sub->id);
}
/* Instruct the other side to remove the connection since it apparently * /* Instruct the other side to remove the connection since it apparently *
* still thinks the channel is active. * * still thinks the channel is active. *
* For Cisco IAD2421 /BAK/ */ * 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)) { if ((p->hookstate == MGCP_ONHOOK) && (!sub->rtp) && (!sub->next->rtp)) {
p->hidecallerid = 0; p->hidecallerid = 0;
if (p->hascallwaiting && !p->callwaiting) { if (p->hascallwaiting && !p->callwaiting) {
if (option_verbose > 2) ast_verb(3, "Enabling call waiting on MGCP/%s@%s-%d\n", p->name, p->parent->name, sub->id);
ast_verbose(VERBOSE_PREFIX_3 "Enabling call waiting on MGCP/%s@%s-%d\n", p->name, p->parent->name, sub->id);
p->callwaiting = -1; p->callwaiting = -1;
} }
if (has_voicemail(p)) { if (has_voicemail(p)) {
if (option_verbose > 2) { ast_verb(3, "MGCP handle_request(%s@%s) set vmwi(+)\n", p->name, p->parent->name);
ast_verbose(VERBOSE_PREFIX_3 "MGCP handle_request(%s@%s) set vmwi(+)\n", p->name, p->parent->name);
}
transmit_notify_request(sub, "L/vmwi(+)"); transmit_notify_request(sub, "L/vmwi(+)");
} else { } else {
if (option_verbose > 2) { ast_verb(3, "MGCP handle_request(%s@%s) set vmwi(-)\n", p->name, p->parent->name);
ast_verbose(VERBOSE_PREFIX_3 "MGCP handle_request(%s@%s) set vmwi(-)\n", p->name, p->parent->name);
}
transmit_notify_request(sub, "L/vmwi(-)"); transmit_notify_request(sub, "L/vmwi(-)");
} }
} }
@ -3432,8 +3373,7 @@ static void *do_monitor(void *data)
mgcp_reloading = 0; mgcp_reloading = 0;
ast_mutex_unlock(&mgcp_reload_lock); ast_mutex_unlock(&mgcp_reload_lock);
if (reloading) { if (reloading) {
if (option_verbose > 0) ast_verb(1, "Reloading MGCP\n");
ast_verbose(VERBOSE_PREFIX_1 "Reloading MGCP\n");
mgcp_do_reload(); mgcp_do_reload();
/* Add an I/O event to our UDP socket */ /* Add an I/O event to our UDP socket */
if (mgcpsock > -1) if (mgcpsock > -1)
@ -3551,11 +3491,9 @@ static struct ast_channel *mgcp_request(const char *type, int format, void *data
return NULL; return NULL;
} }
if (option_verbose > 2) { ast_verb(3, "MGCP mgcp_request(%s)\n", tmp);
ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_request(%s)\n", tmp); ast_verb(3, "MGCP cw: %d, dnd: %d, so: %d, sno: %d\n",
ast_verbose(VERBOSE_PREFIX_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); sub->parent->callwaiting, sub->parent->dnd, sub->owner ? 1 : 0, sub->next->owner ? 1: 0);
}
/* Must be busy */ /* Must be busy */
if (((sub->parent->callwaiting) && ((sub->owner) && (sub->next->owner))) || if (((sub->parent->callwaiting) && ((sub->owner) && (sub->next->owner))) ||
((!sub->parent->callwaiting) && (sub->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++) { for (i = 0; i < MAX_SUBS; i++) {
sub = ast_calloc(1, sizeof(*sub)); sub = ast_calloc(1, sizeof(*sub));
if (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->lock);
ast_mutex_init(&sub->cx_queue_lock); ast_mutex_init(&sub->cx_queue_lock);
sub->parent = e; 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->musicclass, musicclass, sizeof(e->musicclass));
ast_copy_string(e->mailbox, mailbox, sizeof(e->mailbox)); ast_copy_string(e->mailbox, mailbox, sizeof(e->mailbox));
if (!ast_strlen_zero(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) { if (!ep_reload) {
/* XXX potential issue due to 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 (sub) {
if (!ep_reload) { 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->lock);
ast_mutex_init(&sub->cx_queue_lock); ast_mutex_init(&sub->cx_queue_lock);
ast_copy_string(sub->magic, MGCP_SUBCHANNEL_MAGIC, sizeof(sub->magic)); ast_copy_string(sub->magic, MGCP_SUBCHANNEL_MAGIC, sizeof(sub->magic));
@ -4184,9 +4122,7 @@ static int reload_config(void)
ast_mutex_lock(&gatelock); ast_mutex_lock(&gatelock);
g = build_gateway(cat, ast_variable_browse(cfg, cat)); g = build_gateway(cat, ast_variable_browse(cfg, cat));
if (g) { if (g) {
if (option_verbose > 2) { ast_verb(3, "Added gateway '%s'\n", g->name);
ast_verbose(VERBOSE_PREFIX_3 "Added gateway '%s'\n", g->name);
}
g->next = gateways; g->next = gateways;
gateways = g; gateways = g;
} }
@ -4237,10 +4173,8 @@ static int reload_config(void)
close(mgcpsock); close(mgcpsock);
mgcpsock = -1; mgcpsock = -1;
} else { } else {
if (option_verbose > 1) { ast_verb(2, "MGCP Listening on %s:%d\n",
ast_verbose(VERBOSE_PREFIX_2 "MGCP Listening on %s:%d\n",
ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port)); ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
}
ast_netsock_set_qos(mgcpsock, tos, cos); ast_netsock_set_qos(mgcpsock, tos, cos);
} }
} }
@ -4254,7 +4188,7 @@ static int reload_config(void)
while (e && e->needaudit) { while (e && e->needaudit) {
e->needaudit = 0; e->needaudit = 0;
transmit_audit_endpoint(e); 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; e = e->next;
} }
g = g->next; g = g->next;

View 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)); 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; 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 (ast_exists_extension(ast, context, "fax", 1, ast->cid.cid_num)) {
if (option_verbose > 2) ast_verb(3, "Redirecting %s to fax extension (context:%s)\n", ast->name, context);
ast_verbose(VERBOSE_PREFIX_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 */ /* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
pbx_builtin_setvar_helper(ast,"FAXEXTEN",ast->exten); pbx_builtin_setvar_helper(ast,"FAXEXTEN",ast->exten);
if (ast_async_goto(ast, context, "fax", 1)) 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; break;
case 2: 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; break;
} }
} else { } else {
@ -2745,8 +2744,7 @@ static enum ast_bridge_result misdn_bridge (struct ast_channel *c0,
misdn_lib_bridge(ch1->bc, ch2->bc); misdn_lib_bridge(ch1->bc, ch2->bc);
} }
if (option_verbose > 2) ast_verb(3, "Native bridging %s and %s\n", c0->name, c1->name);
ast_verbose(VERBOSE_PREFIX_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); chan_misdn_log(1, ch1->bc->port, "* Making Native Bridge between %s and %s\n", ch1->bc->oad, ch2->bc->oad);

View File

@ -710,8 +710,7 @@ static int setformat(struct chan_oss_pvt *o, int mode)
/* Check to see if duplex set (FreeBSD Bug) */ /* Check to see if duplex set (FreeBSD Bug) */
res = ioctl(fd, SNDCTL_DSP_GETCAPS, &fmt); res = ioctl(fd, SNDCTL_DSP_GETCAPS, &fmt);
if (res == 0 && (fmt & DSP_CAP_DUPLEX)) { if (res == 0 && (fmt & DSP_CAP_DUPLEX)) {
if (option_verbose > 1) ast_verb(2, "Console is full duplex\n");
ast_verbose(VERBOSE_PREFIX_2 "Console is full duplex\n");
o->duplex = M_FULL; o->duplex = M_FULL;
}; };
break; break;
@ -1551,10 +1550,8 @@ static struct chan_oss_pvt *store_config(struct ast_config *cfg, char *ctg)
openit: openit:
#ifdef TRYOPEN #ifdef TRYOPEN
if (setformat(o, O_RDWR) < 0) { /* open device */ if (setformat(o, O_RDWR) < 0) { /* open device */
if (option_verbose > 0) { ast_verb(1, "Device %s not detected\n", ctg);
ast_verbose(VERBOSE_PREFIX_2 "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");
ast_verbose(VERBOSE_PREFIX_2 "Turn off OSS support by adding " "'noload=chan_oss.so' in /etc/asterisk/modules.conf\n");
}
goto error; goto error;
} }
if (o->duplex != M_FULL) if (o->duplex != M_FULL)

View File

@ -382,8 +382,7 @@ static int phone_hangup(struct ast_channel *ast)
memset(p->ext, 0, sizeof(p->ext)); memset(p->ext, 0, sizeof(p->ext));
((struct phone_pvt *)(ast->tech_pvt))->owner = NULL; ((struct phone_pvt *)(ast->tech_pvt))->owner = NULL;
ast_module_unref(ast_module_info->self); ast_module_unref(ast_module_info->self);
if (option_verbose > 2) ast_verb(3, "Hungup '%s'\n", ast->name);
ast_verbose( VERBOSE_PREFIX_3 "Hungup '%s'\n", ast->name);
ast->tech_pvt = NULL; ast->tech_pvt = NULL;
ast_setstate(ast, AST_STATE_DOWN); ast_setstate(ast, AST_STATE_DOWN);
restart_monitor(); restart_monitor();

View File

@ -8601,8 +8601,7 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
peer->sipoptions = 0; peer->sipoptions = 0;
peer->lastms = 0; peer->lastms = 0;
if (option_verbose > 2) ast_verb(3, "Unregistered SIP '%s'\n", peer->name);
ast_verbose(VERBOSE_PREFIX_3 "Unregistered SIP '%s'\n", peer->name);
manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: SIP/%s\r\nPeerStatus: Unregistered\r\n", peer->name); manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: SIP/%s\r\nPeerStatus: Unregistered\r\n", peer->name);
return PARSE_REGISTER_UPDATE; 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? */ /* Is this a new IP address for us? */
if (inaddrcmp(&peer->addr, &oldsin)) { if (inaddrcmp(&peer->addr, &oldsin)) {
sip_poke_peer(peer); sip_poke_peer(peer);
if (option_verbose > 2) 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);
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);
register_peer_exten(peer, TRUE); 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"); useragent = get_header(req, "User-Agent");
if (strcasecmp(useragent, peer->useragent)) { /* XXX copy if they are different ? */ if (strcasecmp(useragent, peer->useragent)) { /* XXX copy if they are different ? */
ast_copy_string(peer->useragent, useragent, sizeof(peer->useragent)); ast_copy_string(peer->useragent, useragent, sizeof(peer->useragent));
if (option_verbose > 3) ast_verb(4, "Saved useragent \"%s\" for peer %s\n", peer->useragent, peer->name);
ast_verbose(VERBOSE_PREFIX_3 "Saved useragent \"%s\" for peer %s\n", peer->useragent, peer->name);
} }
return PARSE_REGISTER_UPDATE; return PARSE_REGISTER_UPDATE;
} }
@ -9011,7 +9008,7 @@ static int cb_extensionstate(char *context, char* exten, int state, void *data)
if (p->autokillid > -1) if (p->autokillid > -1)
sip_cancel_destroy(p); /* Remove subscription expiry for renewals */ sip_cancel_destroy(p); /* Remove subscription expiry for renewals */
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); /* Delete subscription in 32 secs */ 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->stateid = -1;
p->subscribed = NONE; p->subscribed = NONE;
append_history(p, "Subscribestatus", "%s", state == AST_EXTENSION_REMOVED ? "HintRemoved" : "Deactivated"); 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 */ if (p->subscribed != NONE) /* Only send state NOTIFY if we know the format */
transmit_state_notify(p, state, 1, FALSE); transmit_state_notify(p, state, 1, FALSE);
if (option_verbose > 1) ast_verb(2, "Extension Changed %s new state %s for Notify User %s\n", exten, ast_extension_state2str(state), p->username);
ast_verbose(VERBOSE_PREFIX_1 "Extension Changed %s new state %s for Notify User %s\n", exten, ast_extension_state2str(state), p->username);
sip_pvt_unlock(p); sip_pvt_unlock(p);
@ -13498,8 +13494,8 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
default: default:
if ((resp >= 300) && (resp < 700)) { if ((resp >= 300) && (resp < 700)) {
/* Fatal response */ /* Fatal response */
if ((option_verbose > 2) && (resp != 487)) if ((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)); 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) if (sipmethod == SIP_INVITE)
stop_media_flows(p); /* Immediately stop RTP, VRTP and UDPTL as applicable */ 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 ((resp >= 300) && (resp < 700)) {
if ((option_verbose > 2) && (resp != 487)) if ((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)); 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) { switch(resp) {
case 488: /* Not acceptable here - codec error */ case 488: /* Not acceptable here - codec error */
case 603: /* Decline */ case 603: /* Decline */
@ -16226,8 +16222,7 @@ static void *do_monitor(void *data)
sip_reloading = FALSE; sip_reloading = FALSE;
ast_mutex_unlock(&sip_reload_lock); ast_mutex_unlock(&sip_reload_lock);
if (reloading) { if (reloading) {
if (option_verbose > 0) ast_verb(1, "Reloading SIP\n");
ast_verbose(VERBOSE_PREFIX_1 "Reloading SIP\n");
sip_do_reload(sip_reloadreason); sip_do_reload(sip_reloadreason);
/* Change the I/O fd of our UDP socket */ /* 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 else
authlist = auth; authlist = auth;
if (option_verbose > 2) ast_verb(3, "Added authentication for realm %s\n", realm);
ast_verbose("Added authentication for realm %s\n", realm);
return authlist; return authlist;
@ -17866,8 +17860,7 @@ static int reload_config(enum channelreloadreason reason)
close(sipsock); close(sipsock);
sipsock = -1; sipsock = -1;
} else { } else {
if (option_verbose > 1) ast_verb(2, "SIP Listening on %s:%d\n",
ast_verbose(VERBOSE_PREFIX_2 "SIP Listening on %s:%d\n",
ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port)); ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
ast_netsock_set_qos(sipsock, global_tos_sip, global_cos_sip); ast_netsock_set_qos(sipsock, global_tos_sip, global_cos_sip);
} }

View File

@ -1884,7 +1884,7 @@ static int skinny_extensionstate_cb(char *context, char *exten, int state, void
switch (state) { switch (state) {
case AST_EXTENSION_DEACTIVATED: /* Retry after a while */ case AST_EXTENSION_DEACTIVATED: /* Retry after a while */
case AST_EXTENSION_REMOVED: /* Extension is gone */ 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; sd->stateid = -1;
callstate = SKINNY_ONHOOK; callstate = SKINNY_ONHOOK;
lamp = SKINNY_LAMP_OFF; lamp = SKINNY_LAMP_OFF;
@ -2072,8 +2072,7 @@ static int skinny_reset_device(int fd, int argc, char *argv[])
else else
req->data.reset.resetType = 1; req->data.reset.resetType = 1;
if (option_verbose > 2) ast_verb(3, "%s device %s.\n", (fullrestart) ? "Restarting" : "Resetting", d->id);
ast_verbose(VERBOSE_PREFIX_3 "%s device %s.\n", (fullrestart) ? "Restarting" : "Resetting", d->id);
transmit_response(d->session, req); 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->mohsuggest, mohsuggest, sizeof(l->mohsuggest));
ast_copy_string(l->regexten, regexten, sizeof(l->regexten)); ast_copy_string(l->regexten, regexten, sizeof(l->regexten));
ast_copy_string(l->mailbox, mailbox, sizeof(l->mailbox)); ast_copy_string(l->mailbox, mailbox, sizeof(l->mailbox));
if (!ast_strlen_zero(mailbox)) { if (!ast_strlen_zero(mailbox))
if (option_verbose > 2) ast_verb(3, "Setting mailbox '%s' on %s@%s\n", mailbox, d->name, l->name);
ast_verbose(VERBOSE_PREFIX_3 "Setting mailbox '%s' on %s@%s\n", mailbox, d->name, l->name);
}
if (!ast_strlen_zero(device_vmexten)) if (!ast_strlen_zero(device_vmexten))
ast_copy_string(l->vmexten, device_vmexten, sizeof(vmexten)); ast_copy_string(l->vmexten, device_vmexten, sizeof(vmexten));
l->msgstate = -1; l->msgstate = -1;
@ -2536,8 +2533,7 @@ static void *skinny_ss(void *data)
int getforward=0; int getforward=0;
int loop_pause = 100; int loop_pause = 100;
if (option_verbose > 2) ast_verb(3, "Starting simple switch on '%s@%s'\n", l->name, d->name);
ast_verbose( VERBOSE_PREFIX_3 "Starting simple switch on '%s@%s'\n", l->name, d->name);
len = strlen(d->exten); len = strlen(d->exten);
@ -2564,8 +2560,7 @@ static void *skinny_ss(void *data)
if (getforward) { if (getforward) {
/* Record this as the forwarding extension */ /* Record this as the forwarding extension */
ast_copy_string(l->call_forward, d->exten, sizeof(l->call_forward)); ast_copy_string(l->call_forward, d->exten, sizeof(l->call_forward));
if (option_verbose > 2) ast_verb(3, "Setting call forward to '%s' on channel %s\n",
ast_verbose(VERBOSE_PREFIX_3 "Setting call forward to '%s' on channel %s\n",
l->call_forward, c->name); l->call_forward, c->name);
transmit_tone(s, SKINNY_DIALTONE); transmit_tone(s, SKINNY_DIALTONE);
if (res) { if (res) {
@ -2643,7 +2638,7 @@ static int skinny_call(struct ast_channel *ast, char *dest, int timeout)
} }
if (skinnydebug) 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) { if (l->dnd) {
ast_queue_control(ast, AST_CONTROL_BUSY); 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; struct skinnysession *s = d->session;
if (skinnydebug) 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) { switch(ind) {
case AST_CONTROL_RINGING: case AST_CONTROL_RINGING:
if (ast->_state != AST_STATE_UP) { 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); transmit_response(s, req);
return 0; return 0;
} }
if (option_verbose > 2) ast_verb(3, "Device '%s' successfully registered\n", name);
ast_verbose(VERBOSE_PREFIX_3 "Device '%s' successfully registered\n", name);
if (!(req = req_alloc(sizeof(struct register_ack_message), REGISTER_ACK_MESSAGE))) if (!(req = req_alloc(sizeof(struct register_ack_message), REGISTER_ACK_MESSAGE)))
return -1; return -1;
@ -3469,14 +3463,12 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
/* Do not disturb */ /* Do not disturb */
if (l->dnd != 0){ if (l->dnd != 0){
if (option_verbose > 2) ast_verb(3, "Disabling DND on %s@%s\n", l->name, d->name);
ast_verbose(VERBOSE_PREFIX_3 "Disabling DND on %s@%s\n", l->name, d->name);
l->dnd = 0; l->dnd = 0;
transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_ON); transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_ON);
transmit_displaynotify(s, "DnD disabled", 10); transmit_displaynotify(s, "DnD disabled", 10);
} else { } else {
if (option_verbose > 2) ast_verb(3, "Enabling DND on %s@%s\n", l->name, d->name);
ast_verbose(VERBOSE_PREFIX_3 "Enabling DND on %s@%s\n", l->name, d->name);
l->dnd = 1; l->dnd = 1;
transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_OFF); transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_OFF);
transmit_displaynotify(s, "DnD enabled", 10); 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 */ /* Do not disturb */
if (l->dnd != 0){ if (l->dnd != 0){
if (option_verbose > 2) ast_verb(3, "Disabling DND on %s@%s\n", l->name, d->name);
ast_verbose(VERBOSE_PREFIX_3 "Disabling DND on %s@%s\n", l->name, d->name);
l->dnd = 0; l->dnd = 0;
transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_ON); transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_ON);
transmit_displaynotify(s, "DnD disabled", 10); transmit_displaynotify(s, "DnD disabled", 10);
} else { } else {
if (option_verbose > 2) ast_verb(3, "Enabling DND on %s@%s\n", l->name, d->name);
ast_verbose(VERBOSE_PREFIX_3 "Enabling DND on %s@%s\n", l->name, d->name);
l->dnd = 1; l->dnd = 1;
transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_OFF); transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_OFF);
transmit_displaynotify(s, "DnD enabled", 10); transmit_displaynotify(s, "DnD enabled", 10);
@ -4753,8 +4743,7 @@ static void *skinny_session(void *data)
struct skinny_req *req; struct skinny_req *req;
struct skinnysession *s = data; struct skinnysession *s = data;
if (option_verbose > 2) ast_verb(3, "Starting Skinny session from %s\n", ast_inet_ntoa(s->sin.sin_addr));
ast_verbose(VERBOSE_PREFIX_3 "Starting Skinny session from %s\n", ast_inet_ntoa(s->sin.sin_addr));
for (;;) { for (;;) {
res = get_input(s); 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); ast_log(LOG_NOTICE, "No available lines on: %s\n", dest);
return NULL; return NULL;
} }
if (option_verbose > 2) { ast_verb(3, "skinny_request(%s)\n", tmp);
ast_verbose(VERBOSE_PREFIX_3 "skinny_request(%s)\n", tmp);
}
tmpc = skinny_new(l, AST_STATE_DOWN); tmpc = skinny_new(l, AST_STATE_DOWN);
if (!tmpc) { if (!tmpc) {
ast_log(LOG_WARNING, "Unable to make channel for '%s'\n", tmp); ast_log(LOG_WARNING, "Unable to make channel for '%s'\n", tmp);
@ -5062,8 +5049,7 @@ static int reload_config(void)
} else { } else {
d = build_device(cat, ast_variable_browse(cfg, cat)); d = build_device(cat, ast_variable_browse(cfg, cat));
if (d) { if (d) {
if (option_verbose > 2) ast_verb(3, "Added device '%s'\n", d->name);
ast_verbose(VERBOSE_PREFIX_3 "Added device '%s'\n", d->name);
ast_mutex_lock(&devicelock); ast_mutex_lock(&devicelock);
d->next = devices; d->next = devices;
devices = d; devices = d;
@ -5105,8 +5091,7 @@ static int reload_config(void)
ast_config_destroy(cfg); ast_config_destroy(cfg);
return 0; return 0;
} }
if (option_verbose > 1) ast_verb(2, "Skinny listening on %s:%d\n",
ast_verbose(VERBOSE_PREFIX_2 "Skinny listening on %s:%d\n",
ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port)); ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
ast_pthread_create_background(&accept_t,NULL, accept_thread, NULL); ast_pthread_create_background(&accept_t,NULL, accept_thread, NULL);
} }

File diff suppressed because it is too large Load Diff

View File

@ -1848,8 +1848,7 @@ static int send_cwcidspill(struct zt_pvt *p)
p->cidlen += READ_SIZE * 4; p->cidlen += READ_SIZE * 4;
p->cidpos = 0; p->cidpos = 0;
send_callerid(p); send_callerid(p);
if (option_verbose > 2) ast_verb(3, "CPE supports Call Waiting Caller*ID. Sending '%s/%s'\n", p->callwait_name, p->callwait_num);
ast_verbose(VERBOSE_PREFIX_3 "CPE supports Call Waiting Caller*ID. Sending '%s/%s'\n", p->callwait_name, p->callwait_num);
return 0; return 0;
} }
@ -2385,8 +2384,7 @@ static int zt_call(struct ast_channel *ast, char *rdest, int timeout)
if (p->pri->facilityenable) if (p->pri->facilityenable)
pri_facility_enable(p->pri->pri); pri_facility_enable(p->pri->pri);
if (option_verbose > 2) ast_verb(3, "Requested transfer capability: 0x%.2x - %s\n", ast->transfercapability, ast_transfercapability2str(ast->transfercapability));
ast_verbose(VERBOSE_PREFIX_3 "Requested transfer capability: 0x%.2x - %s\n", ast->transfercapability, ast_transfercapability2str(ast->transfercapability));
dp_strip = 0; dp_strip = 0;
pridialplan = p->pri->dialplan - 1; pridialplan = p->pri->dialplan - 1;
if (pridialplan == -2 || pridialplan == -3) { /* compute dynamically */ if (pridialplan == -2 || pridialplan == -3) { /* compute dynamically */
@ -2995,8 +2993,7 @@ static int zt_hangup(struct ast_channel *ast)
ast->tech_pvt = NULL; ast->tech_pvt = NULL;
ast_mutex_unlock(&p->lock); ast_mutex_unlock(&p->lock);
ast_module_unref(ast_module_info->self); ast_module_unref(ast_module_info->self);
if (option_verbose > 2) ast_verb(3, "Hungup '%s'\n", ast->name);
ast_verbose( VERBOSE_PREFIX_3 "Hungup '%s'\n", ast->name);
ast_mutex_lock(&iflock); ast_mutex_lock(&iflock);
tmp = iflist; tmp = iflist;
@ -3613,8 +3610,7 @@ static enum ast_bridge_result zt_bridge(struct ast_channel *c0, struct ast_chann
return AST_BRIDGE_FAILED; return AST_BRIDGE_FAILED;
} }
if (option_verbose > 2) ast_verb(3, "Native bridging %s and %s\n", c0->name, c1->name);
ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name);
if (!(flags & AST_BRIDGE_DTMF_CHANNEL_0) && (oi0 == SUB_REAL)) if (!(flags & AST_BRIDGE_DTMF_CHANNEL_0) && (oi0 == SUB_REAL))
disable_dtmf_detect(op0); disable_dtmf_detect(op0);
@ -3865,8 +3861,7 @@ static int check_for_conference(struct zt_pvt *p)
if we're in a conference, it's probably a MeetMe room or if we're in a conference, it's probably a MeetMe room or
some such, so don't let us 3-way out! */ some such, so don't let us 3-way out! */
if ((p->subs[SUB_REAL].curconf.confno != ci.confno) || (p->subs[SUB_REAL].curconf.confmode != ci.confmode)) { if ((p->subs[SUB_REAL].curconf.confno != ci.confno) || (p->subs[SUB_REAL].curconf.confmode != ci.confmode)) {
if (option_verbose > 2) ast_verb(3, "Avoiding 3-way call when in an external conference\n");
ast_verbose(VERBOSE_PREFIX_3 "Avoiding 3-way call when in an external conference\n");
return 1; return 1;
} }
return 0; return 0;
@ -3922,8 +3917,7 @@ static void zt_handle_dtmfup(struct ast_channel *ast, int index, struct ast_fram
const char *target_context = S_OR(ast->macrocontext, ast->context); const char *target_context = S_OR(ast->macrocontext, ast->context);
if (ast_exists_extension(ast, target_context, "fax", 1, ast->cid.cid_num)) { if (ast_exists_extension(ast, target_context, "fax", 1, ast->cid.cid_num)) {
if (option_verbose > 2) ast_verb(3, "Redirecting %s to fax extension\n", ast->name);
ast_verbose(VERBOSE_PREFIX_3 "Redirecting %s to fax extension\n", ast->name);
/* Save the DID/DNIS when we transfer the fax call to a "fax" extension */ /* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
pbx_builtin_setvar_helper(ast, "FAXEXTEN", ast->exten); pbx_builtin_setvar_helper(ast, "FAXEXTEN", ast->exten);
if (ast_async_goto(ast, target_context, "fax", 1)) if (ast_async_goto(ast, target_context, "fax", 1))
@ -4017,8 +4011,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
switch (res) { switch (res) {
#ifdef ZT_EVENT_EC_DISABLED #ifdef ZT_EVENT_EC_DISABLED
case ZT_EVENT_EC_DISABLED: case ZT_EVENT_EC_DISABLED:
if (option_verbose > 2) ast_verb(3, "Channel %d echo canceler disabled due to CED detection\n", p->channel);
ast_verbose(VERBOSE_PREFIX_3 "Channel %d echo canceler disabled due to CED detection\n", p->channel);
p->echocanon = 0; p->echocanon = 0;
break; break;
#endif #endif
@ -4140,8 +4133,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
if (p->subs[SUB_CALLWAIT].owner) { if (p->subs[SUB_CALLWAIT].owner) {
/* There's a call waiting call, so ring the phone, but make it unowned in the mean time */ /* There's a call waiting call, so ring the phone, but make it unowned in the mean time */
swap_subs(p, SUB_CALLWAIT, SUB_REAL); swap_subs(p, SUB_CALLWAIT, SUB_REAL);
if (option_verbose > 2) ast_verb(3, "Channel %d still has (callwait) call, ringing phone\n", p->channel);
ast_verbose(VERBOSE_PREFIX_3 "Channel %d still has (callwait) call, ringing phone\n", p->channel);
unalloc_sub(p, SUB_CALLWAIT); unalloc_sub(p, SUB_CALLWAIT);
#if 0 #if 0
p->subs[index].needanswer = 0; p->subs[index].needanswer = 0;
@ -4555,8 +4547,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
zt_enable_ec(p); zt_enable_ec(p);
ast_hangup(chan); ast_hangup(chan);
} else { } else {
if (option_verbose > 2) ast_verb(3, "Started three way call on channel %d\n", p->channel);
ast_verbose(VERBOSE_PREFIX_3 "Started three way call on channel %d\n", p->channel);
/* Start music on hold if appropriate */ /* Start music on hold if appropriate */
if (ast_bridged_channel(p->subs[SUB_THREEWAY].owner)) { if (ast_bridged_channel(p->subs[SUB_THREEWAY].owner)) {
ast_queue_control_data(p->subs[SUB_THREEWAY].owner, AST_CONTROL_HOLD, ast_queue_control_data(p->subs[SUB_THREEWAY].owner, AST_CONTROL_HOLD,
@ -4578,8 +4569,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
p->owner = p->subs[SUB_REAL].owner; p->owner = p->subs[SUB_REAL].owner;
} }
/* Drop the last call and stop the conference */ /* Drop the last call and stop the conference */
if (option_verbose > 2) ast_verb(3, "Dropping three-way call on %s\n", p->subs[SUB_THREEWAY].owner->name);
ast_verbose(VERBOSE_PREFIX_3 "Dropping three-way call on %s\n", p->subs[SUB_THREEWAY].owner->name);
p->subs[SUB_THREEWAY].owner->_softhangup |= AST_SOFTHANGUP_DEV; p->subs[SUB_THREEWAY].owner->_softhangup |= AST_SOFTHANGUP_DEV;
p->subs[SUB_REAL].inthreeway = 0; p->subs[SUB_REAL].inthreeway = 0;
p->subs[SUB_THREEWAY].inthreeway = 0; p->subs[SUB_THREEWAY].inthreeway = 0;
@ -4589,8 +4579,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
(p->transfertobusy || (ast->_state != AST_STATE_BUSY))) { (p->transfertobusy || (ast->_state != AST_STATE_BUSY))) {
int otherindex = SUB_THREEWAY; int otherindex = SUB_THREEWAY;
if (option_verbose > 2) ast_verb(3, "Building conference on call on %s and %s\n", p->subs[SUB_THREEWAY].owner->name, p->subs[SUB_REAL].owner->name);
ast_verbose(VERBOSE_PREFIX_3 "Building conference on call on %s and %s\n", p->subs[SUB_THREEWAY].owner->name, p->subs[SUB_REAL].owner->name);
/* Put them in the threeway, and flip */ /* Put them in the threeway, and flip */
p->subs[SUB_THREEWAY].inthreeway = 1; p->subs[SUB_THREEWAY].inthreeway = 1;
p->subs[SUB_REAL].inthreeway = 1; p->subs[SUB_REAL].inthreeway = 1;
@ -4608,8 +4597,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
res = tone_zone_play_tone(p->subs[SUB_THREEWAY].zfd, ZT_TONE_RINGTONE); res = tone_zone_play_tone(p->subs[SUB_THREEWAY].zfd, ZT_TONE_RINGTONE);
} }
} else { } else {
if (option_verbose > 2) ast_verb(3, "Dumping incomplete call on on %s\n", p->subs[SUB_THREEWAY].owner->name);
ast_verbose(VERBOSE_PREFIX_3 "Dumping incomplete call on on %s\n", p->subs[SUB_THREEWAY].owner->name);
swap_subs(p, SUB_THREEWAY, SUB_REAL); swap_subs(p, SUB_THREEWAY, SUB_REAL);
p->subs[SUB_THREEWAY].owner->_softhangup |= AST_SOFTHANGUP_DEV; p->subs[SUB_THREEWAY].owner->_softhangup |= AST_SOFTHANGUP_DEV;
p->owner = p->subs[SUB_REAL].owner; p->owner = p->subs[SUB_REAL].owner;
@ -4814,8 +4802,7 @@ static struct ast_frame *__zt_exception(struct ast_channel *ast)
case ZT_EVENT_ONHOOK: case ZT_EVENT_ONHOOK:
zt_disable_ec(p); zt_disable_ec(p);
if (p->owner) { if (p->owner) {
if (option_verbose > 2) ast_verb(3, "Channel %s still has call, ringing phone\n", p->owner->name);
ast_verbose(VERBOSE_PREFIX_3 "Channel %s still has call, ringing phone\n", p->owner->name);
zt_ring_phone(p); zt_ring_phone(p);
p->callwaitingrepeat = 0; p->callwaitingrepeat = 0;
p->cidcwexpire = 0; p->cidcwexpire = 0;
@ -4838,8 +4825,7 @@ static struct ast_frame *__zt_exception(struct ast_channel *ast)
case ZT_EVENT_WINKFLASH: case ZT_EVENT_WINKFLASH:
p->flashtime = ast_tvnow(); p->flashtime = ast_tvnow();
if (p->owner) { if (p->owner) {
if (option_verbose > 2) ast_verb(3, "Channel %d flashed to other channel %s\n", p->channel, p->owner->name);
ast_verbose(VERBOSE_PREFIX_3 "Channel %d flashed to other channel %s\n", p->channel, p->owner->name);
if (p->owner->_state != AST_STATE_UP) { if (p->owner->_state != AST_STATE_UP) {
/* Answer if necessary */ /* Answer if necessary */
usedindex = zt_get_index(p->owner, p, 0); usedindex = zt_get_index(p->owner, p, 0);
@ -5099,8 +5085,7 @@ static struct ast_frame *zt_read(struct ast_channel *ast)
} }
/* Expire CID/CW */ /* Expire CID/CW */
if (p->cidcwexpire == 1) { if (p->cidcwexpire == 1) {
if (option_verbose > 2) ast_verb(3, "CPE does not support Call Waiting Caller*ID.\n");
ast_verbose(VERBOSE_PREFIX_3 "CPE does not support Call Waiting Caller*ID.\n");
restore_conference(p); restore_conference(p);
} }
if (p->subs[index].linear) { if (p->subs[index].linear) {
@ -5745,8 +5730,7 @@ static void *ss_thread(void *data)
return NULL; return NULL;
} }
if (option_verbose > 2) ast_verb(3, "Starting simple switch on '%s'\n", chan->name);
ast_verbose( VERBOSE_PREFIX_3 "Starting simple switch on '%s'\n", chan->name);
index = zt_get_index(chan, p, 1); index = zt_get_index(chan, p, 1);
if (index < 0) { if (index < 0) {
ast_log(LOG_WARNING, "Huh?\n"); ast_log(LOG_WARNING, "Huh?\n");
@ -5784,8 +5768,7 @@ static void *ss_thread(void *data)
} }
/* if no extension was received ('unspecified') on overlap call, use the 's' extension */ /* if no extension was received ('unspecified') on overlap call, use the 's' extension */
if (ast_strlen_zero(exten)) { if (ast_strlen_zero(exten)) {
if (option_verbose > 2) ast_verb(3, "Going to extension s|1 because of empty extension received on overlap call\n");
ast_verbose(VERBOSE_PREFIX_3 "Going to extension s|1 because of empty extension received on overlap call\n");
exten[0] = 's'; exten[0] = 's';
exten[1] = '\0'; exten[1] = '\0';
} }
@ -6061,8 +6044,7 @@ static void *ss_thread(void *data)
} }
return NULL; return NULL;
} else { } else {
if (option_verbose > 2) ast_verb(2, "Unknown extension '%s' in context '%s' requested\n", exten, chan->context);
ast_verbose(VERBOSE_PREFIX_2 "Unknown extension '%s' in context '%s' requested\n", exten, chan->context);
sleep(2); sleep(2);
res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_INFO); res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_INFO);
if (res < 0) if (res < 0)
@ -6112,8 +6094,7 @@ static void *ss_thread(void *data)
if (getforward) { if (getforward) {
/* Record this as the forwarding extension */ /* Record this as the forwarding extension */
ast_copy_string(p->call_forward, exten, sizeof(p->call_forward)); ast_copy_string(p->call_forward, exten, sizeof(p->call_forward));
if (option_verbose > 2) ast_verb(3, "Setting call forward to '%s' on channel %d\n", p->call_forward, p->channel);
ast_verbose(VERBOSE_PREFIX_3 "Setting call forward to '%s' on channel %d\n", p->call_forward, p->channel);
res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL); res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
if (res) if (res)
break; break;
@ -6158,8 +6139,7 @@ static void *ss_thread(void *data)
ast_hangup(chan); ast_hangup(chan);
return NULL; return NULL;
} else if (p->callwaiting && !strcmp(exten, "*70")) { } else if (p->callwaiting && !strcmp(exten, "*70")) {
if (option_verbose > 2) ast_verb(3, "Disabling call waiting on %s\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Disabling call waiting on %s\n", chan->name);
/* Disable call waiting if enabled */ /* Disable call waiting if enabled */
p->callwaiting = 0; p->callwaiting = 0;
res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL); res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
@ -6201,8 +6181,7 @@ static void *ss_thread(void *data)
} }
} else if (!p->hidecallerid && !strcmp(exten, "*67")) { } else if (!p->hidecallerid && !strcmp(exten, "*67")) {
if (option_verbose > 2) ast_verb(3, "Disabling Caller*ID on %s\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Disabling Caller*ID on %s\n", chan->name);
/* Disable Caller*ID if enabled */ /* Disable Caller*ID if enabled */
p->hidecallerid = 1; p->hidecallerid = 1;
if (chan->cid.cid_num) if (chan->cid.cid_num)
@ -6229,8 +6208,7 @@ static void *ss_thread(void *data)
break; break;
} else if (!strcmp(exten, "*78")) { } else if (!strcmp(exten, "*78")) {
/* Do not disturb */ /* Do not disturb */
if (option_verbose > 2) ast_verb(3, "Enabled DND on channel %d\n", p->channel);
ast_verbose(VERBOSE_PREFIX_3 "Enabled DND on channel %d\n", p->channel);
manager_event(EVENT_FLAG_SYSTEM, "DNDState", manager_event(EVENT_FLAG_SYSTEM, "DNDState",
"Channel: Zap/%d\r\n" "Channel: Zap/%d\r\n"
"Status: enabled\r\n", p->channel); "Status: enabled\r\n", p->channel);
@ -6241,8 +6219,7 @@ static void *ss_thread(void *data)
len = 0; len = 0;
} else if (!strcmp(exten, "*79")) { } else if (!strcmp(exten, "*79")) {
/* Do not disturb */ /* Do not disturb */
if (option_verbose > 2) ast_verb(3, "Disabled DND on channel %d\n", p->channel);
ast_verbose(VERBOSE_PREFIX_3 "Disabled DND on channel %d\n", p->channel);
manager_event(EVENT_FLAG_SYSTEM, "DNDState", manager_event(EVENT_FLAG_SYSTEM, "DNDState",
"Channel: Zap/%d\r\n" "Channel: Zap/%d\r\n"
"Status: disabled\r\n", p->channel); "Status: disabled\r\n", p->channel);
@ -6257,8 +6234,7 @@ static void *ss_thread(void *data)
memset(exten, 0, sizeof(exten)); memset(exten, 0, sizeof(exten));
len = 0; len = 0;
} else if (p->cancallforward && !strcmp(exten, "*73")) { } else if (p->cancallforward && !strcmp(exten, "*73")) {
if (option_verbose > 2) ast_verb(3, "Cancelling call forwarding on channel %d\n", p->channel);
ast_verbose(VERBOSE_PREFIX_3 "Cancelling call forwarding on channel %d\n", p->channel);
res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL); res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
memset(p->call_forward, 0, sizeof(p->call_forward)); memset(p->call_forward, 0, sizeof(p->call_forward));
getforward = 0; getforward = 0;
@ -6270,12 +6246,10 @@ static void *ss_thread(void *data)
/* This is a three way call, the main call being a real channel, /* This is a three way call, the main call being a real channel,
and we're parking the first call. */ and we're parking the first call. */
ast_masq_park_call(ast_bridged_channel(p->subs[SUB_THREEWAY].owner), chan, 0, NULL); ast_masq_park_call(ast_bridged_channel(p->subs[SUB_THREEWAY].owner), chan, 0, NULL);
if (option_verbose > 2) ast_verb(3, "Parking call to '%s'\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Parking call to '%s'\n", chan->name);
break; break;
} else if (!ast_strlen_zero(p->lastcid_num) && !strcmp(exten, "*60")) { } else if (!ast_strlen_zero(p->lastcid_num) && !strcmp(exten, "*60")) {
if (option_verbose > 2) ast_verb(3, "Blacklisting number %s\n", p->lastcid_num);
ast_verbose(VERBOSE_PREFIX_3 "Blacklisting number %s\n", p->lastcid_num);
res = ast_db_put("blacklist", p->lastcid_num, "1"); res = ast_db_put("blacklist", p->lastcid_num, "1");
if (!res) { if (!res) {
res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL); res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
@ -6283,8 +6257,7 @@ static void *ss_thread(void *data)
len = 0; len = 0;
} }
} else if (p->hidecallerid && !strcmp(exten, "*82")) { } else if (p->hidecallerid && !strcmp(exten, "*82")) {
if (option_verbose > 2) ast_verb(3, "Enabling Caller*ID on %s\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Enabling Caller*ID on %s\n", chan->name);
/* Enable Caller*ID if enabled */ /* Enable Caller*ID if enabled */
p->hidecallerid = 0; p->hidecallerid = 0;
if (chan->cid.cid_num) if (chan->cid.cid_num)
@ -6603,23 +6576,22 @@ static void *ss_thread(void *data)
} }
} }
} }
if (option_verbose > 2)
/* this only shows up if you have n of the dring patterns filled in */ /* this only shows up if you have n of the dring patterns filled in */
ast_verbose( VERBOSE_PREFIX_3 "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]); ast_verb(3, "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
for (counter = 0; counter < 3; counter++) { for (counter = 0; counter < 3; counter++) {
/* Check to see if the rings we received match any of the ones in zapata.conf for this /* Check to see if the rings we received match any of the ones in zapata.conf for this
channel */ channel */
distMatches = 0; distMatches = 0;
for (counter1 = 0; counter1 < 3; counter1++) { for (counter1 = 0; counter1 < 3; counter1++) {
ast_verbose( VERBOSE_PREFIX_3 "Ring pattern check range: %d\n", p->drings.ringnum[counter].range); ast_verb(3, "Ring pattern check range: %d\n", p->drings.ringnum[counter].range);
if (p->drings.ringnum[counter].ring[counter1] == -1) { if (p->drings.ringnum[counter].ring[counter1] == -1) {
ast_verbose( VERBOSE_PREFIX_3 "Pattern ignore (-1) detected, so matching pattern %d regardless.\n", ast_verb(3, "Pattern ignore (-1) detected, so matching pattern %d regardless.\n",
curRingData[counter1]); curRingData[counter1]);
distMatches++; distMatches++;
} }
else if (curRingData[counter1] <= (p->drings.ringnum[counter].ring[counter1] + p->drings.ringnum[counter].range) && else if (curRingData[counter1] <= (p->drings.ringnum[counter].ring[counter1] + p->drings.ringnum[counter].range) &&
curRingData[counter1] >= (p->drings.ringnum[counter].ring[counter1] - p->drings.ringnum[counter].range)) { curRingData[counter1] >= (p->drings.ringnum[counter].ring[counter1] - p->drings.ringnum[counter].range)) {
ast_verbose( VERBOSE_PREFIX_3 "Ring pattern matched in range: %d to %d\n", ast_verb(3, "Ring pattern matched in range: %d to %d\n",
(p->drings.ringnum[counter].ring[counter1] - p->drings.ringnum[counter].range), (p->drings.ringnum[counter].ring[counter1] - p->drings.ringnum[counter].range),
(p->drings.ringnum[counter].ring[counter1] + p->drings.ringnum[counter].range)); (p->drings.ringnum[counter].ring[counter1] + p->drings.ringnum[counter].range));
distMatches++; distMatches++;
@ -6630,8 +6602,7 @@ static void *ss_thread(void *data)
/* The ring matches, set the context to whatever is for distinctive ring.. */ /* The ring matches, set the context to whatever is for distinctive ring.. */
ast_copy_string(p->context, p->drings.ringContext[counter].contextData, sizeof(p->context)); ast_copy_string(p->context, p->drings.ringContext[counter].contextData, sizeof(p->context));
ast_copy_string(chan->context, p->drings.ringContext[counter].contextData, sizeof(chan->context)); ast_copy_string(chan->context, p->drings.ringContext[counter].contextData, sizeof(chan->context));
if (option_verbose > 2) ast_verb(3, "Distinctive Ring matched context %s\n",p->context);
ast_verbose( VERBOSE_PREFIX_3 "Distinctive Ring matched context %s\n",p->context);
break; break;
} }
} }
@ -6775,8 +6746,7 @@ static void *ss_thread(void *data)
curRingData[receivedRingT] = 0; curRingData[receivedRingT] = 0;
} }
receivedRingT = 0; receivedRingT = 0;
if (option_verbose > 2) ast_verb(3, "Detecting post-CID distinctive ring\n");
ast_verbose( VERBOSE_PREFIX_3 "Detecting post-CID distinctive ring\n");
for (;;) { for (;;) {
i = ZT_IOMUX_READ | ZT_IOMUX_SIGEVENT; i = ZT_IOMUX_READ | ZT_IOMUX_SIGEVENT;
if ((res = ioctl(p->subs[index].zfd, ZT_IOMUX, &i))) { if ((res = ioctl(p->subs[index].zfd, ZT_IOMUX, &i))) {
@ -6820,30 +6790,28 @@ static void *ss_thread(void *data)
} }
} }
if (p->usedistinctiveringdetection == 1) { if (p->usedistinctiveringdetection == 1) {
if (option_verbose > 2)
/* this only shows up if you have n of the dring patterns filled in */ /* this only shows up if you have n of the dring patterns filled in */
ast_verbose( VERBOSE_PREFIX_3 "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]); ast_verb(3, "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
for (counter = 0; counter < 3; counter++) { for (counter = 0; counter < 3; counter++) {
/* Check to see if the rings we received match any of the ones in zapata.conf for this /* Check to see if the rings we received match any of the ones in zapata.conf for this
channel */ channel */
if (option_verbose > 2)
/* this only shows up if you have n of the dring patterns filled in */ /* this only shows up if you have n of the dring patterns filled in */
ast_verbose( VERBOSE_PREFIX_3 "Checking %d,%d,%d\n", ast_verb(3, "Checking %d,%d,%d\n",
p->drings.ringnum[counter].ring[0], p->drings.ringnum[counter].ring[0],
p->drings.ringnum[counter].ring[1], p->drings.ringnum[counter].ring[1],
p->drings.ringnum[counter].ring[2]); p->drings.ringnum[counter].ring[2]);
distMatches = 0; distMatches = 0;
for (counter1 = 0; counter1 < 3; counter1++) { for (counter1 = 0; counter1 < 3; counter1++) {
ast_verbose( VERBOSE_PREFIX_3 "Ring pattern check range: %d\n", p->drings.ringnum[counter].range); ast_verb(3, "Ring pattern check range: %d\n", p->drings.ringnum[counter].range);
if (p->drings.ringnum[counter].ring[counter1] == -1) { if (p->drings.ringnum[counter].ring[counter1] == -1) {
ast_verbose( VERBOSE_PREFIX_3 "Pattern ignore (-1) detected, so matching pattern %d regardless.\n", ast_verb(3, "Pattern ignore (-1) detected, so matching pattern %d regardless.\n",
curRingData[counter1]); curRingData[counter1]);
distMatches++; distMatches++;
} }
else if (curRingData[counter1] <= (p->drings.ringnum[counter].ring[counter1] + p->drings.ringnum[counter].range) && else if (curRingData[counter1] <= (p->drings.ringnum[counter].ring[counter1] + p->drings.ringnum[counter].range) &&
curRingData[counter1] >= (p->drings.ringnum[counter].ring[counter1] - p->drings.ringnum[counter].range)) { curRingData[counter1] >= (p->drings.ringnum[counter].ring[counter1] - p->drings.ringnum[counter].range)) {
ast_verbose( VERBOSE_PREFIX_3 "Ring pattern matched in range: %d to %d\n", ast_verb(3, "Ring pattern matched in range: %d to %d\n",
(p->drings.ringnum[counter].ring[counter1] - p->drings.ringnum[counter].range), (p->drings.ringnum[counter].ring[counter1] - p->drings.ringnum[counter].range),
(p->drings.ringnum[counter].ring[counter1] + p->drings.ringnum[counter].range)); (p->drings.ringnum[counter].ring[counter1] + p->drings.ringnum[counter].range));
distMatches++; distMatches++;
@ -6853,8 +6821,7 @@ static void *ss_thread(void *data)
/* The ring matches, set the context to whatever is for distinctive ring.. */ /* The ring matches, set the context to whatever is for distinctive ring.. */
ast_copy_string(p->context, p->drings.ringContext[counter].contextData, sizeof(p->context)); ast_copy_string(p->context, p->drings.ringContext[counter].contextData, sizeof(p->context));
ast_copy_string(chan->context, p->drings.ringContext[counter].contextData, sizeof(chan->context)); ast_copy_string(chan->context, p->drings.ringContext[counter].contextData, sizeof(chan->context));
if (option_verbose > 2) ast_verb(3, "Distinctive Ring matched context %s\n",p->context);
ast_verbose( VERBOSE_PREFIX_3 "Distinctive Ring matched context %s\n",p->context);
break; break;
} }
} }
@ -7102,7 +7069,7 @@ static int handle_init_event(struct zt_pvt *i, int event)
case SIG_FXSGS: case SIG_FXSGS:
if (i->cid_start == CID_START_POLARITY || i->cid_start == CID_START_POLARITY_IN) { if (i->cid_start == CID_START_POLARITY || i->cid_start == CID_START_POLARITY_IN) {
i->polarity = POLARITY_REV; i->polarity = POLARITY_REV;
ast_verbose(VERBOSE_PREFIX_2 "Starting post polarity " ast_verb(2, "Starting post polarity "
"CID detection on channel %d\n", "CID detection on channel %d\n",
i->channel); i->channel);
chan = zt_new(i, AST_STATE_PRERING, 0, SUB_REAL, 0, 0); chan = zt_new(i, AST_STATE_PRERING, 0, SUB_REAL, 0, 0);
@ -8490,7 +8457,7 @@ static void ss7_start_call(struct zt_pvt *p, struct zt_ss7 *linkset)
c = zt_new(p, AST_STATE_RING, 1, SUB_REAL, law, 0); c = zt_new(p, AST_STATE_RING, 1, SUB_REAL, law, 0);
ast_mutex_lock(&linkset->lock); ast_mutex_lock(&linkset->lock);
if (c) if (c)
ast_verbose(VERBOSE_PREFIX_3 "Accepting call to '%s' on CIC %d\n", p->exten, p->cic); ast_verb(3, "Accepting call to '%s' on CIC %d\n", p->exten, p->cic);
else else
ast_log(LOG_WARNING, "Unable to start PBX on CIC %d\n", p->cic); ast_log(LOG_WARNING, "Unable to start PBX on CIC %d\n", p->cic);
} }
@ -9002,8 +8969,7 @@ static int pri_fixup_principle(struct zt_pri *pri, int principle, q931_call *c)
if (pri->pvts[x]->call == c) { if (pri->pvts[x]->call == c) {
/* Found our call */ /* Found our call */
if (principle != x) { if (principle != x) {
if (option_verbose > 2) ast_verb(3, "Moving call from channel %d to channel %d\n",
ast_verbose(VERBOSE_PREFIX_3 "Moving call from channel %d to channel %d\n",
pri->pvts[x]->channel, pri->pvts[principle]->channel); pri->pvts[x]->channel, pri->pvts[principle]->channel);
if (pri->pvts[principle]->owner) { if (pri->pvts[principle]->owner) {
ast_log(LOG_WARNING, "Can't fix up channel from %d to %d because %d is already in use\n", ast_log(LOG_WARNING, "Can't fix up channel from %d to %d because %d is already in use\n",
@ -9066,8 +9032,7 @@ static void *do_idle_thread(void *vchan)
char ex[80]; char ex[80];
/* Wait up to 30 seconds for an answer */ /* Wait up to 30 seconds for an answer */
int newms, ms = 30000; int newms, ms = 30000;
if (option_verbose > 2) ast_verb(3, "Initiating idle call on channel %s\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Initiating idle call on channel %s\n", chan->name);
snprintf(ex, sizeof(ex), "%d/%s", pvt->channel, pvt->pri->idledial); snprintf(ex, sizeof(ex), "%d/%s", pvt->channel, pvt->pri->idledial);
if (ast_call(chan, ex, 0)) { if (ast_call(chan, ex, 0)) {
ast_log(LOG_WARNING, "Idle dial failed on '%s' to '%s'\n", chan->name, ex); ast_log(LOG_WARNING, "Idle dial failed on '%s' to '%s'\n", chan->name, ex);
@ -9087,18 +9052,15 @@ static void *do_idle_thread(void *vchan)
ast_copy_string(chan->exten, pvt->pri->idleext, sizeof(chan->exten)); ast_copy_string(chan->exten, pvt->pri->idleext, sizeof(chan->exten));
ast_copy_string(chan->context, pvt->pri->idlecontext, sizeof(chan->context)); ast_copy_string(chan->context, pvt->pri->idlecontext, sizeof(chan->context));
chan->priority = 1; chan->priority = 1;
if (option_verbose > 3) ast_verb(4, "Idle channel '%s' answered, sending to %s@%s\n", chan->name, chan->exten, chan->context);
ast_verbose(VERBOSE_PREFIX_3 "Idle channel '%s' answered, sending to %s@%s\n", chan->name, chan->exten, chan->context);
ast_pbx_run(chan); ast_pbx_run(chan);
/* It's already hungup, return immediately */ /* It's already hungup, return immediately */
return NULL; return NULL;
case AST_CONTROL_BUSY: case AST_CONTROL_BUSY:
if (option_verbose > 3) ast_verb(4, "Idle channel '%s' busy, waiting...\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Idle channel '%s' busy, waiting...\n", chan->name);
break; break;
case AST_CONTROL_CONGESTION: case AST_CONTROL_CONGESTION:
if (option_verbose > 3) ast_verb(4, "Idle channel '%s' congested, waiting...\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Idle channel '%s' congested, waiting...\n", chan->name);
break; break;
}; };
} }
@ -9497,8 +9459,7 @@ static void *pri_dchannel(void *vpri)
switch (e->e) { switch (e->e) {
case PRI_EVENT_DCHAN_UP: case PRI_EVENT_DCHAN_UP:
if (option_verbose > 1) ast_verb(2, "%s D-Channel on span %d up\n", pri_order(which), pri->span);
ast_verbose(VERBOSE_PREFIX_2 "%s D-Channel on span %d up\n", pri_order(which), pri->span);
pri->dchanavail[which] |= DCHAN_UP; pri->dchanavail[which] |= DCHAN_UP;
if (!pri->pri) pri_find_dchan(pri); if (!pri->pri) pri_find_dchan(pri);
@ -9518,8 +9479,7 @@ static void *pri_dchannel(void *vpri)
} }
break; break;
case PRI_EVENT_DCHAN_DOWN: case PRI_EVENT_DCHAN_DOWN:
if (option_verbose > 1) ast_verb(2, "%s D-Channel on span %d down\n", pri_order(which), pri->span);
ast_verbose(VERBOSE_PREFIX_2 "%s D-Channel on span %d down\n", pri_order(which), pri->span);
pri->dchanavail[which] &= ~DCHAN_UP; pri->dchanavail[which] &= ~DCHAN_UP;
pri_find_dchan(pri); pri_find_dchan(pri);
if (!pri_is_up(pri)) { if (!pri_is_up(pri)) {
@ -9555,8 +9515,7 @@ static void *pri_dchannel(void *vpri)
ast_log(LOG_WARNING, "Restart requested on odd/unavailable channel number %d/%d on span %d\n", ast_log(LOG_WARNING, "Restart requested on odd/unavailable channel number %d/%d on span %d\n",
PRI_SPAN(e->restart.channel), PRI_CHANNEL(e->restart.channel), pri->span); PRI_SPAN(e->restart.channel), PRI_CHANNEL(e->restart.channel), pri->span);
else { else {
if (option_verbose > 2) ast_verb(3, "B-channel %d/%d restarted on span %d\n",
ast_verbose(VERBOSE_PREFIX_3 "B-channel %d/%d restarted on span %d\n",
PRI_SPAN(e->restart.channel), PRI_CHANNEL(e->restart.channel), pri->span); PRI_SPAN(e->restart.channel), PRI_CHANNEL(e->restart.channel), pri->span);
ast_mutex_lock(&pri->pvts[chanpos]->lock); ast_mutex_lock(&pri->pvts[chanpos]->lock);
if (pri->pvts[chanpos]->call) { if (pri->pvts[chanpos]->call) {
@ -9571,8 +9530,7 @@ static void *pri_dchannel(void *vpri)
ast_mutex_unlock(&pri->pvts[chanpos]->lock); ast_mutex_unlock(&pri->pvts[chanpos]->lock);
} }
} else { } else {
if (option_verbose > 2) ast_verb(3, "Restart on requested on entire span %d\n", pri->span);
ast_verbose(VERBOSE_PREFIX_2 "Restart on requested on entire span %d\n", pri->span);
for (x = 0; x < pri->numchans; x++) for (x = 0; x < pri->numchans; x++)
if (pri->pvts[x]) { if (pri->pvts[x]) {
ast_mutex_lock(&pri->pvts[x]->lock); ast_mutex_lock(&pri->pvts[x]->lock);
@ -9721,8 +9679,7 @@ static void *pri_dchannel(void *vpri)
e->ring.redirectingnum, e->ring.callingplanrdnis); e->ring.redirectingnum, e->ring.callingplanrdnis);
/* If immediate=yes go to s|1 */ /* If immediate=yes go to s|1 */
if (pri->pvts[chanpos]->immediate) { if (pri->pvts[chanpos]->immediate) {
if (option_verbose > 2) ast_verb(3, "Going to extension s|1 because of immediate=yes\n");
ast_verbose(VERBOSE_PREFIX_3 "Going to extension s|1 because of immediate=yes\n");
pri->pvts[chanpos]->exten[0] = 's'; pri->pvts[chanpos]->exten[0] = 's';
pri->pvts[chanpos]->exten[1] = '\0'; pri->pvts[chanpos]->exten[1] = '\0';
} }
@ -9737,8 +9694,7 @@ static void *pri_dchannel(void *vpri)
ast_copy_string(pri->pvts[chanpos]->dnid, e->ring.callednum, sizeof(pri->pvts[chanpos]->dnid)); ast_copy_string(pri->pvts[chanpos]->dnid, e->ring.callednum, sizeof(pri->pvts[chanpos]->dnid));
/* No number yet, but received "sending complete"? */ /* No number yet, but received "sending complete"? */
if (e->ring.complete && (ast_strlen_zero(e->ring.callednum))) { if (e->ring.complete && (ast_strlen_zero(e->ring.callednum))) {
if (option_verbose > 2) ast_verb(3, "Going to extension s|1 because of Complete received\n");
ast_verbose(VERBOSE_PREFIX_3 "Going to extension s|1 because of Complete received\n");
pri->pvts[chanpos]->exten[0] = 's'; pri->pvts[chanpos]->exten[0] = 's';
pri->pvts[chanpos]->exten[1] = '\0'; pri->pvts[chanpos]->exten[1] = '\0';
} }
@ -9810,8 +9766,7 @@ static void *pri_dchannel(void *vpri)
ast_mutex_lock(&pri->lock); ast_mutex_lock(&pri->lock);
if (c && !ast_pthread_create_detached(&threadid, NULL, ss_thread, c)) { if (c && !ast_pthread_create_detached(&threadid, NULL, ss_thread, c)) {
if (option_verbose > 2) ast_verb(3, "Accepting overlap call from '%s' to '%s' on channel %d/%d, span %d\n",
ast_verbose(VERBOSE_PREFIX_3 "Accepting overlap call from '%s' to '%s' on channel %d/%d, span %d\n",
plancallingnum, S_OR(pri->pvts[chanpos]->exten, "<unspecified>"), plancallingnum, S_OR(pri->pvts[chanpos]->exten, "<unspecified>"),
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span); pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span);
} else { } else {
@ -9847,8 +9802,7 @@ static void *pri_dchannel(void *vpri)
snprintf(calledtonstr, sizeof(calledtonstr)-1, "%d", e->ring.calledplan); snprintf(calledtonstr, sizeof(calledtonstr)-1, "%d", e->ring.calledplan);
pbx_builtin_setvar_helper(c, "CALLEDTON", calledtonstr); pbx_builtin_setvar_helper(c, "CALLEDTON", calledtonstr);
if (option_verbose > 2) ast_verb(3, "Accepting call from '%s' to '%s' on channel %d/%d, span %d\n",
ast_verbose(VERBOSE_PREFIX_3 "Accepting call from '%s' to '%s' on channel %d/%d, span %d\n",
plancallingnum, pri->pvts[chanpos]->exten, plancallingnum, pri->pvts[chanpos]->exten,
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span); pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span);
zt_enable_ec(pri->pvts[chanpos]); zt_enable_ec(pri->pvts[chanpos]);
@ -9860,8 +9814,7 @@ static void *pri_dchannel(void *vpri)
} }
} }
} else { } else {
if (option_verbose > 2) ast_verb(3, "Extension '%s' in context '%s' from '%s' does not exist. Rejecting call on channel %d/%d, span %d\n",
ast_verbose(VERBOSE_PREFIX_3 "Extension '%s' in context '%s' from '%s' does not exist. Rejecting call on channel %d/%d, span %d\n",
pri->pvts[chanpos]->exten, pri->pvts[chanpos]->context, pri->pvts[chanpos]->cid_num, pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->exten, pri->pvts[chanpos]->context, pri->pvts[chanpos]->cid_num, pri->pvts[chanpos]->logicalspan,
pri->pvts[chanpos]->prioffset, pri->span); pri->pvts[chanpos]->prioffset, pri->span);
pri_hangup(pri->pri, e->ring.call, PRI_CAUSE_UNALLOCATED); pri_hangup(pri->pri, e->ring.call, PRI_CAUSE_UNALLOCATED);
@ -9932,14 +9885,12 @@ static void *pri_dchannel(void *vpri)
struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_PROGRESS, }; struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_PROGRESS, };
if (e->proceeding.cause > -1) { if (e->proceeding.cause > -1) {
if (option_verbose > 2) ast_verb(3, "PROGRESS with cause code %d received\n", e->proceeding.cause);
ast_verbose(VERBOSE_PREFIX_3 "PROGRESS with cause code %d received\n", e->proceeding.cause);
/* Work around broken, out of spec USER_BUSY cause in a progress message */ /* Work around broken, out of spec USER_BUSY cause in a progress message */
if (e->proceeding.cause == AST_CAUSE_USER_BUSY) { if (e->proceeding.cause == AST_CAUSE_USER_BUSY) {
if (pri->pvts[chanpos]->owner) { if (pri->pvts[chanpos]->owner) {
if (option_verbose > 2) ast_verb(3, "PROGRESS with 'user busy' received, signaling AST_CONTROL_BUSY instead of AST_CONTROL_PROGRESS\n");
ast_verbose(VERBOSE_PREFIX_3 "PROGRESS with 'user busy' received, signaling AST_CONTROL_BUSY instead of AST_CONTROL_PROGRESS\n");
pri->pvts[chanpos]->owner->hangupcause = e->proceeding.cause; pri->pvts[chanpos]->owner->hangupcause = e->proceeding.cause;
f.subclass = AST_CONTROL_BUSY; f.subclass = AST_CONTROL_BUSY;
@ -10113,23 +10064,20 @@ static void *pri_dchannel(void *vpri)
} }
} }
} }
if (option_verbose > 2) ast_verb(3, "Channel %d/%d, span %d got hangup, cause %d\n",
ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup, cause %d\n",
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, e->hangup.cause); pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, e->hangup.cause);
} else { } else {
pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause); pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause);
pri->pvts[chanpos]->call = NULL; pri->pvts[chanpos]->call = NULL;
} }
if (e->hangup.cause == PRI_CAUSE_REQUESTED_CHAN_UNAVAIL) { if (e->hangup.cause == PRI_CAUSE_REQUESTED_CHAN_UNAVAIL) {
if (option_verbose > 2) ast_verb(3, "Forcing restart of channel %d/%d on span %d since channel reported in use\n",
ast_verbose(VERBOSE_PREFIX_3 "Forcing restart of channel %d/%d on span %d since channel reported in use\n",
PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span); PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
pri_reset(pri->pri, PVT_TO_CHANNEL(pri->pvts[chanpos])); pri_reset(pri->pri, PVT_TO_CHANNEL(pri->pvts[chanpos]));
pri->pvts[chanpos]->resetting = 1; pri->pvts[chanpos]->resetting = 1;
} }
if (e->hangup.aoc_units > -1) if (e->hangup.aoc_units > -1)
if (option_verbose > 2) ast_verb(3, "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, (int)e->hangup.aoc_units, (e->hangup.aoc_units == 1) ? "" : "s"); pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, (int)e->hangup.aoc_units, (e->hangup.aoc_units == 1) ? "" : "s");
#ifdef SUPPORT_USERUSER #ifdef SUPPORT_USERUSER
@ -10180,19 +10128,16 @@ static void *pri_dchannel(void *vpri)
pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV; pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
} }
} }
if (option_verbose > 2) ast_verb(3, "Channel %d/%d, span %d got hangup request, cause %d\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span, e->hangup.cause);
ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup request, cause %d\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span, e->hangup.cause);
if (e->hangup.aoc_units > -1) if (e->hangup.aoc_units > -1)
if (option_verbose > 2) ast_verb(3, "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, (int)e->hangup.aoc_units, (e->hangup.aoc_units == 1) ? "" : "s"); pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, (int)e->hangup.aoc_units, (e->hangup.aoc_units == 1) ? "" : "s");
} else { } else {
pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause); pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause);
pri->pvts[chanpos]->call = NULL; pri->pvts[chanpos]->call = NULL;
} }
if (e->hangup.cause == PRI_CAUSE_REQUESTED_CHAN_UNAVAIL) { if (e->hangup.cause == PRI_CAUSE_REQUESTED_CHAN_UNAVAIL) {
if (option_verbose > 2) ast_verb(3, "Forcing restart of channel %d/%d span %d since channel reported in use\n",
ast_verbose(VERBOSE_PREFIX_3 "Forcing restart of channel %d/%d span %d since channel reported in use\n",
PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span); PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
pri_reset(pri->pri, PVT_TO_CHANNEL(pri->pvts[chanpos])); pri_reset(pri->pri, PVT_TO_CHANNEL(pri->pvts[chanpos]));
pri->pvts[chanpos]->resetting = 1; pri->pvts[chanpos]->resetting = 1;
@ -10222,8 +10167,7 @@ static void *pri_dchannel(void *vpri)
pri->pvts[chanpos]->call = NULL; pri->pvts[chanpos]->call = NULL;
pri->pvts[chanpos]->resetting = 0; pri->pvts[chanpos]->resetting = 0;
if (pri->pvts[chanpos]->owner) { if (pri->pvts[chanpos]->owner) {
if (option_verbose > 2) ast_verb(3, "Channel %d/%d, span %d got hangup ACK\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup ACK\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
} }
#ifdef SUPPORT_USERUSER #ifdef SUPPORT_USERUSER
@ -10259,8 +10203,7 @@ static void *pri_dchannel(void *vpri)
pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV; pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
} }
pri->pvts[chanpos]->resetting = 0; pri->pvts[chanpos]->resetting = 0;
if (option_verbose > 2) ast_verb(3, "B-channel %d/%d successfully restarted on span %d\n", pri->pvts[chanpos]->logicalspan,
ast_verbose(VERBOSE_PREFIX_3 "B-channel %d/%d successfully restarted on span %d\n", pri->pvts[chanpos]->logicalspan,
pri->pvts[chanpos]->prioffset, pri->span); pri->pvts[chanpos]->prioffset, pri->span);
ast_mutex_unlock(&pri->pvts[chanpos]->lock); ast_mutex_unlock(&pri->pvts[chanpos]->lock);
if (pri->resetting) if (pri->resetting)
@ -10284,8 +10227,7 @@ static void *pri_dchannel(void *vpri)
} }
pri->pvts[chanpos]->resetting = 0; pri->pvts[chanpos]->resetting = 0;
pri->pvts[chanpos]->inservice = 1; pri->pvts[chanpos]->inservice = 1;
if (option_verbose > 2) ast_verb(3, "B-channel %d/%d successfully restarted on span %d\n", pri->pvts[chanpos]->logicalspan,
ast_verbose(VERBOSE_PREFIX_3 "B-channel %d/%d successfully restarted on span %d\n", pri->pvts[chanpos]->logicalspan,
pri->pvts[chanpos]->prioffset, pri->span); pri->pvts[chanpos]->prioffset, pri->span);
ast_mutex_unlock(&pri->pvts[chanpos]->lock); ast_mutex_unlock(&pri->pvts[chanpos]->lock);
if (pri->resetting) if (pri->resetting)
@ -10757,8 +10699,7 @@ static int zap_destroy_channel(int fd, int argc, char **argv)
static int setup_zap(int reload); static int setup_zap(int reload);
static int zap_restart(void) static int zap_restart(void)
{ {
if (option_verbose > 0) ast_verb(1, "Destroying channels and reloading zaptel configuration.\n");
ast_verbose(VERBOSE_PREFIX_1 "Destroying channels and reloading zaptel configuration.\n");
while (iflist) { while (iflist) {
ast_debug(1, "Destroying zaptel channel no. %d\n", iflist->channel); ast_debug(1, "Destroying zaptel channel no. %d\n", iflist->channel);
/* Also updates iflist: */ /* Also updates iflist: */
@ -11453,7 +11394,7 @@ static int __unload_module(void)
/* Free associated memory */ /* Free associated memory */
if (pl) if (pl)
destroy_zt_pvt(&pl); destroy_zt_pvt(&pl);
ast_verbose(VERBOSE_PREFIX_3 "Unregistered channel %d\n", x); ast_verb(3, "Unregistered channel %d\n", x);
} }
iflist = NULL; iflist = NULL;
ifcount = 0; ifcount = 0;
@ -11879,14 +11820,12 @@ static int build_channels(struct zt_chan_conf conf, int iscrv, const char *value
#endif #endif
if (tmp) { if (tmp) {
if (option_verbose > 2) {
#ifdef HAVE_PRI #ifdef HAVE_PRI
if (pri) if (pri)
ast_verbose(VERBOSE_PREFIX_3 "%s CRV %d:%d, %s signalling\n", reload ? "Reconfigured" : "Registered", trunkgroup, x, sig2str(tmp->sig)); ast_verb(3, "%s CRV %d:%d, %s signalling\n", reload ? "Reconfigured" : "Registered", trunkgroup, x, sig2str(tmp->sig));
else else
#endif #endif
ast_verbose(VERBOSE_PREFIX_3 "%s channel %d, %s signalling\n", reload ? "Reconfigured" : "Registered", x, sig2str(tmp->sig)); ast_verb(3, "%s channel %d, %s signalling\n", reload ? "Reconfigured" : "Registered", x, sig2str(tmp->sig));
}
} else { } else {
ast_log(LOG_ERROR, "Unable to %s channel '%s'\n", ast_log(LOG_ERROR, "Unable to %s channel '%s'\n",
(reload == 1) ? "reconfigure" : "register", value); (reload == 1) ? "reconfigure" : "register", value);
@ -12598,8 +12537,7 @@ static int process_zap(struct zt_chan_conf *confp, struct ast_variable *v, int r
else { else {
cadences[num_cadence] = new_cadence; cadences[num_cadence] = new_cadence;
cidrings[num_cadence++] = cid_location; cidrings[num_cadence++] = cid_location;
if (option_verbose > 2) ast_verb(3, "cadence 'r%d' added: %s\n",num_cadence,original_args);
ast_verbose(VERBOSE_PREFIX_3 "cadence 'r%d' added: %s\n",num_cadence,original_args);
} }
} }
} }
@ -12671,8 +12609,7 @@ static int process_zap(struct zt_chan_conf *confp, struct ast_variable *v, int r
tmp = mkintf(CHAN_PSEUDO, *confp, NULL, reload); tmp = mkintf(CHAN_PSEUDO, *confp, NULL, reload);
if (tmp) { if (tmp) {
if (option_verbose > 2) ast_verb(3, "Automatically generated pseudo channel\n");
ast_verbose(VERBOSE_PREFIX_3 "Automatically generated pseudo channel\n");
} else { } else {
ast_log(LOG_WARNING, "Unable to register pseudo channel!\n"); ast_log(LOG_WARNING, "Unable to register pseudo channel!\n");
} }
@ -12729,8 +12666,8 @@ static int setup_zap(int reload)
if (i) { if (i) {
if (pri_create_trunkgroup(trunkgroup, dchannels)) { if (pri_create_trunkgroup(trunkgroup, dchannels)) {
ast_log(LOG_WARNING, "Unable to create trunk group %d with Primary D-channel %d at line %d of zapata.conf\n", trunkgroup, dchannels[0], v->lineno); ast_log(LOG_WARNING, "Unable to create trunk group %d with Primary D-channel %d at line %d of zapata.conf\n", trunkgroup, dchannels[0], v->lineno);
} else if (option_verbose > 1) } else
ast_verbose(VERBOSE_PREFIX_2 "Created trunk group %d with Primary D-channel %d and %d backup%s\n", trunkgroup, dchannels[0], i - 1, (i == 1) ? "" : "s"); ast_verb(2, "Created trunk group %d with Primary D-channel %d and %d backup%s\n", trunkgroup, dchannels[0], i - 1, (i == 1) ? "" : "s");
} else } else
ast_log(LOG_WARNING, "Trunk group %d lacks any valid D-channels at line %d of zapata.conf\n", trunkgroup, v->lineno); ast_log(LOG_WARNING, "Trunk group %d lacks any valid D-channels at line %d of zapata.conf\n", trunkgroup, v->lineno);
} else } else
@ -12750,8 +12687,8 @@ static int setup_zap(int reload)
if (logicalspan >= 0) { if (logicalspan >= 0) {
if (pri_create_spanmap(spanno - 1, trunkgroup, logicalspan)) { if (pri_create_spanmap(spanno - 1, trunkgroup, logicalspan)) {
ast_log(LOG_WARNING, "Failed to map span %d to trunk group %d (logical span %d)\n", spanno, trunkgroup, logicalspan); ast_log(LOG_WARNING, "Failed to map span %d to trunk group %d (logical span %d)\n", spanno, trunkgroup, logicalspan);
} else if (option_verbose > 1) } else
ast_verbose(VERBOSE_PREFIX_2 "Mapped span %d to trunk group %d (logical span %d)\n", spanno, trunkgroup, logicalspan); ast_verb(2, "Mapped span %d to trunk group %d (logical span %d)\n", spanno, trunkgroup, logicalspan);
} else } else
ast_log(LOG_WARNING, "Logical span must be a postive number, or '0' (for unspecified) at line %d of zapata.conf\n", v->lineno); ast_log(LOG_WARNING, "Logical span must be a postive number, or '0' (for unspecified) at line %d of zapata.conf\n", v->lineno);
} else } else
@ -12804,8 +12741,8 @@ static int setup_zap(int reload)
if (start_pri(pris + x)) { if (start_pri(pris + x)) {
ast_log(LOG_ERROR, "Unable to start D-channel on span %d\n", x + 1); ast_log(LOG_ERROR, "Unable to start D-channel on span %d\n", x + 1);
return -1; return -1;
} else if (option_verbose > 1) } else
ast_verbose(VERBOSE_PREFIX_2 "Starting D-Channel on span %d\n", x + 1); ast_verb(2, "Starting D-Channel on span %d\n", x + 1);
} }
} }
} }
@ -12817,8 +12754,8 @@ static int setup_zap(int reload)
if (ast_pthread_create(&linksets[x].master, NULL, ss7_linkset, &linksets[x])) { if (ast_pthread_create(&linksets[x].master, NULL, ss7_linkset, &linksets[x])) {
ast_log(LOG_ERROR, "Unable to start SS7 linkset on span %d\n", x + 1); ast_log(LOG_ERROR, "Unable to start SS7 linkset on span %d\n", x + 1);
return -1; return -1;
} else if (option_verbose > 1) } else
ast_verbose(VERBOSE_PREFIX_2 "Starting SS7 linkset on span %d\n", x + 1); ast_verb(2, "Starting SS7 linkset on span %d\n", x + 1);
} }
} }
} }

View File

@ -507,8 +507,7 @@ int iax_provision_reload(void)
if (strcasecmp(cat, "general")) { if (strcasecmp(cat, "general")) {
iax_process_template(cfg, cat, found ? "default" : NULL); iax_process_template(cfg, cat, found ? "default" : NULL);
found++; found++;
if (option_verbose > 2) ast_verb(3, "Loaded provisioning template '%s'\n", cat);
ast_verbose(VERBOSE_PREFIX_3 "Loaded provisioning template '%s'\n", cat);
} }
cat = ast_category_browse(cfg, cat); cat = ast_category_browse(cfg, cat);
} }

View File

@ -359,8 +359,7 @@ static void parse_config(void)
for (var = ast_variable_browse(cfg, "plc"); var ; var = var->next) { for (var = ast_variable_browse(cfg, "plc"); var ; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) { if (!strcasecmp(var->name, "genericplc")) {
adpcmtolin.useplc = ast_true(var->value) ? 1 : 0; adpcmtolin.useplc = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "codec_adpcm: %susing generic PLC\n", adpcmtolin.useplc ? "" : "not ");
ast_verbose(VERBOSE_PREFIX_3 "codec_adpcm: %susing generic PLC\n", adpcmtolin.useplc ? "" : "not ");
} }
} }
ast_config_destroy(cfg); ast_config_destroy(cfg);

View File

@ -143,8 +143,7 @@ static void parse_config(void)
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) { for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) { if (!strcasecmp(var->name, "genericplc")) {
alawtolin.useplc = ast_true(var->value) ? 1 : 0; alawtolin.useplc = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "codec_alaw: %susing generic PLC\n", alawtolin.useplc ? "" : "not ");
ast_verbose(VERBOSE_PREFIX_3 "codec_alaw: %susing generic PLC\n", alawtolin.useplc ? "" : "not ");
} }
} }
ast_config_destroy(cfg); ast_config_destroy(cfg);

View File

@ -174,8 +174,7 @@ static void parse_config(void)
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) { for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) { if (!strcasecmp(var->name, "genericplc")) {
g722tolin.useplc = ast_true(var->value) ? 1 : 0; g722tolin.useplc = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "codec_g722: %susing generic PLC\n",
ast_verbose(VERBOSE_PREFIX_3 "codec_g722: %susing generic PLC\n",
g722tolin.useplc ? "" : "not "); g722tolin.useplc ? "" : "not ");
} }
} }

View File

@ -904,8 +904,7 @@ static void parse_config(void)
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) { for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) { if (!strcasecmp(var->name, "genericplc")) {
g726tolin.useplc = ast_true(var->value) ? 1 : 0; g726tolin.useplc = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "codec_g726: %susing generic PLC\n",
ast_verbose(VERBOSE_PREFIX_3 "codec_g726: %susing generic PLC\n",
g726tolin.useplc ? "" : "not "); g726tolin.useplc ? "" : "not ");
} }
} }

View File

@ -244,8 +244,7 @@ static void parse_config(void)
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) { for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) { if (!strcasecmp(var->name, "genericplc")) {
gsmtolin.useplc = ast_true(var->value) ? 1 : 0; gsmtolin.useplc = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "codec_gsm: %susing generic PLC\n", gsmtolin.useplc ? "" : "not ");
ast_verbose(VERBOSE_PREFIX_3 "codec_gsm: %susing generic PLC\n", gsmtolin.useplc ? "" : "not ");
} }
} }
ast_config_destroy(cfg); ast_config_destroy(cfg);

View File

@ -270,8 +270,7 @@ static void parse_config(void)
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) { for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) { if (!strcasecmp(var->name, "genericplc")) {
lpc10tolin.useplc = ast_true(var->value) ? 1 : 0; lpc10tolin.useplc = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "codec_lpc10: %susing generic PLC\n",
ast_verbose(VERBOSE_PREFIX_3 "codec_lpc10: %susing generic PLC\n",
lpc10tolin.useplc ? "" : "not "); lpc10tolin.useplc ? "" : "not ");
} }
} }

View File

@ -389,23 +389,20 @@ static void parse_config(void)
if (!strcasecmp(var->name, "quality")) { if (!strcasecmp(var->name, "quality")) {
res = abs(atoi(var->value)); res = abs(atoi(var->value));
if (res > -1 && res < 11) { if (res > -1 && res < 11) {
if (option_verbose > 2) ast_verb(3, "CODEC SPEEX: Setting Quality to %d\n",res);
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting Quality to %d\n",res);
quality = res; quality = res;
} else } else
ast_log(LOG_ERROR,"Error Quality must be 0-10\n"); ast_log(LOG_ERROR,"Error Quality must be 0-10\n");
} else if (!strcasecmp(var->name, "complexity")) { } else if (!strcasecmp(var->name, "complexity")) {
res = abs(atoi(var->value)); res = abs(atoi(var->value));
if (res > -1 && res < 11) { if (res > -1 && res < 11) {
if (option_verbose > 2) ast_verb(3, "CODEC SPEEX: Setting Complexity to %d\n",res);
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting Complexity to %d\n",res);
complexity = res; complexity = res;
} else } else
ast_log(LOG_ERROR,"Error! Complexity must be 0-10\n"); ast_log(LOG_ERROR,"Error! Complexity must be 0-10\n");
} else if (!strcasecmp(var->name, "vbr_quality")) { } else if (!strcasecmp(var->name, "vbr_quality")) {
if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0 && res_f <= 10) { if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0 && res_f <= 10) {
if (option_verbose > 2) ast_verb(3, "CODEC SPEEX: Setting VBR Quality to %f\n",res_f);
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting VBR Quality to %f\n",res_f);
vbr_quality = res_f; vbr_quality = res_f;
} else } else
ast_log(LOG_ERROR,"Error! VBR Quality must be 0-10\n"); ast_log(LOG_ERROR,"Error! VBR Quality must be 0-10\n");
@ -413,70 +410,56 @@ static void parse_config(void)
ast_log(LOG_ERROR,"Error! ABR Quality setting obsolete, set ABR to desired bitrate\n"); ast_log(LOG_ERROR,"Error! ABR Quality setting obsolete, set ABR to desired bitrate\n");
} else if (!strcasecmp(var->name, "enhancement")) { } else if (!strcasecmp(var->name, "enhancement")) {
enhancement = ast_true(var->value) ? 1 : 0; enhancement = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "CODEC SPEEX: Perceptual Enhancement Mode. [%s]\n",enhancement ? "on" : "off");
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Perceptual Enhancement Mode. [%s]\n",enhancement ? "on" : "off");
} else if (!strcasecmp(var->name, "vbr")) { } else if (!strcasecmp(var->name, "vbr")) {
vbr = ast_true(var->value) ? 1 : 0; vbr = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "CODEC SPEEX: VBR Mode. [%s]\n",vbr ? "on" : "off");
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: VBR Mode. [%s]\n",vbr ? "on" : "off");
} else if (!strcasecmp(var->name, "abr")) { } else if (!strcasecmp(var->name, "abr")) {
res = abs(atoi(var->value)); res = abs(atoi(var->value));
if (res >= 0) { if (res >= 0) {
if (option_verbose > 2) {
if (res > 0) if (res > 0)
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting ABR target bitrate to %d\n",res); ast_verb(3, "CODEC SPEEX: Setting ABR target bitrate to %d\n",res);
else else
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Disabling ABR\n"); ast_verb(3, "CODEC SPEEX: Disabling ABR\n");
}
abr = res; abr = res;
} else } else
ast_log(LOG_ERROR,"Error! ABR target bitrate must be >= 0\n"); ast_log(LOG_ERROR,"Error! ABR target bitrate must be >= 0\n");
} else if (!strcasecmp(var->name, "vad")) { } else if (!strcasecmp(var->name, "vad")) {
vad = ast_true(var->value) ? 1 : 0; vad = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "CODEC SPEEX: VAD Mode. [%s]\n",vad ? "on" : "off");
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: VAD Mode. [%s]\n",vad ? "on" : "off");
} else if (!strcasecmp(var->name, "dtx")) { } else if (!strcasecmp(var->name, "dtx")) {
dtx = ast_true(var->value) ? 1 : 0; dtx = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "CODEC SPEEX: DTX Mode. [%s]\n",dtx ? "on" : "off");
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: DTX Mode. [%s]\n",dtx ? "on" : "off");
} else if (!strcasecmp(var->name, "preprocess")) { } else if (!strcasecmp(var->name, "preprocess")) {
preproc = ast_true(var->value) ? 1 : 0; preproc = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "CODEC SPEEX: Preprocessing. [%s]\n",preproc ? "on" : "off");
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessing. [%s]\n",preproc ? "on" : "off");
} else if (!strcasecmp(var->name, "pp_vad")) { } else if (!strcasecmp(var->name, "pp_vad")) {
pp_vad = ast_true(var->value) ? 1 : 0; pp_vad = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "CODEC SPEEX: Preprocessor VAD. [%s]\n",pp_vad ? "on" : "off");
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessor VAD. [%s]\n",pp_vad ? "on" : "off");
} else if (!strcasecmp(var->name, "pp_agc")) { } else if (!strcasecmp(var->name, "pp_agc")) {
pp_agc = ast_true(var->value) ? 1 : 0; pp_agc = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "CODEC SPEEX: Preprocessor AGC. [%s]\n",pp_agc ? "on" : "off");
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessor AGC. [%s]\n",pp_agc ? "on" : "off");
} else if (!strcasecmp(var->name, "pp_agc_level")) { } else if (!strcasecmp(var->name, "pp_agc_level")) {
if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) { if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) {
if (option_verbose > 2) ast_verb(3, "CODEC SPEEX: Setting preprocessor AGC Level to %f\n",res_f);
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting preprocessor AGC Level to %f\n",res_f);
pp_agc_level = res_f; pp_agc_level = res_f;
} else } else
ast_log(LOG_ERROR,"Error! Preprocessor AGC Level must be >= 0\n"); ast_log(LOG_ERROR,"Error! Preprocessor AGC Level must be >= 0\n");
} else if (!strcasecmp(var->name, "pp_denoise")) { } else if (!strcasecmp(var->name, "pp_denoise")) {
pp_denoise = ast_true(var->value) ? 1 : 0; pp_denoise = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "CODEC SPEEX: Preprocessor Denoise. [%s]\n",pp_denoise ? "on" : "off");
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessor Denoise. [%s]\n",pp_denoise ? "on" : "off");
} else if (!strcasecmp(var->name, "pp_dereverb")) { } else if (!strcasecmp(var->name, "pp_dereverb")) {
pp_dereverb = ast_true(var->value) ? 1 : 0; pp_dereverb = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "CODEC SPEEX: Preprocessor Dereverb. [%s]\n",pp_dereverb ? "on" : "off");
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessor Dereverb. [%s]\n",pp_dereverb ? "on" : "off");
} else if (!strcasecmp(var->name, "pp_dereverb_decay")) { } else if (!strcasecmp(var->name, "pp_dereverb_decay")) {
if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) { if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) {
if (option_verbose > 2) ast_verb(3, "CODEC SPEEX: Setting preprocessor Dereverb Decay to %f\n",res_f);
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting preprocessor Dereverb Decay to %f\n",res_f);
pp_dereverb_decay = res_f; pp_dereverb_decay = res_f;
} else } else
ast_log(LOG_ERROR,"Error! Preprocessor Dereverb Decay must be >= 0\n"); ast_log(LOG_ERROR,"Error! Preprocessor Dereverb Decay must be >= 0\n");
} else if (!strcasecmp(var->name, "pp_dereverb_level")) { } else if (!strcasecmp(var->name, "pp_dereverb_level")) {
if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) { if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) {
if (option_verbose > 2) ast_verb(3, "CODEC SPEEX: Setting preprocessor Dereverb Level to %f\n",res_f);
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting preprocessor Dereverb Level to %f\n",res_f);
pp_dereverb_level = res_f; pp_dereverb_level = res_f;
} else } else
ast_log(LOG_ERROR,"Error! Preprocessor Dereverb Level must be >= 0\n"); ast_log(LOG_ERROR,"Error! Preprocessor Dereverb Level must be >= 0\n");

View File

@ -156,8 +156,7 @@ static void parse_config(void)
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) { for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) { if (!strcasecmp(var->name, "genericplc")) {
ulawtolin.useplc = ast_true(var->value) ? 1 : 0; ulawtolin.useplc = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2) ast_verb(3, "codec_ulaw: %susing generic PLC\n", ulawtolin.useplc ? "" : "not ");
ast_verbose(VERBOSE_PREFIX_3 "codec_ulaw: %susing generic PLC\n", ulawtolin.useplc ? "" : "not ");
} }
} }
ast_config_destroy(cfg); ast_config_destroy(cfg);

View File

@ -323,8 +323,7 @@ static void parse_config(void)
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) { for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) { if (!strcasecmp(var->name, "genericplc")) {
global_useplc = ast_true(var->value); global_useplc = ast_true(var->value);
if (option_verbose > 2) ast_verb(3, "codec_zap: %susing generic PLC\n",
ast_verbose(VERBOSE_PREFIX_3 "codec_zap: %susing generic PLC\n",
global_useplc ? "" : "not "); global_useplc ? "" : "not ");
} }
} }
@ -366,14 +365,13 @@ static int find_transcoders(void)
return 0; return 0;
} }
for (info.tcnum = 0; !(res = ioctl(fd, ZT_TRANSCODE_OP, &info)); info.tcnum++) { for (info.tcnum = 0; !(res = ioctl(fd, ZT_TRANSCODE_OP, &info)); info.tcnum++) {
if (option_verbose > 1) ast_verb(2, "Found transcoder '%s'.\n", info.name);
ast_verbose(VERBOSE_PREFIX_2 "Found transcoder '%s'.\n", info.name);
build_translators(&map, info.dstfmts, info.srcfmts); build_translators(&map, info.dstfmts, info.srcfmts);
} }
close(fd); close(fd);
if (!info.tcnum && (option_verbose > 1)) if (!info.tcnum)
ast_verbose(VERBOSE_PREFIX_2 "No hardware transcoders found.\n"); ast_verb(2, "No hardware transcoders found.\n");
for (x = 0; x < 32; x++) { for (x = 0; x < 32; x++) {
for (y = 0; y < 32; y++) { for (y = 0; y < 32; y++) {

View File

@ -324,8 +324,7 @@ static int acf_odbc_read(struct ast_channel *chan, const char *cmd, char *s, cha
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) { if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
int res1 = -1; int res1 = -1;
if (res == SQL_NO_DATA) { if (res == SQL_NO_DATA) {
if (option_verbose > 3) ast_verb(4, "Found no rows [%s]\n", sql);
ast_verbose(VERBOSE_PREFIX_4 "Found no rows [%s]\n", sql);
res1 = 0; res1 = 0;
ast_copy_string(rowcount, "0", sizeof(rowcount)); ast_copy_string(rowcount, "0", sizeof(rowcount));
} else { } else {

View File

@ -111,16 +111,13 @@ static int timeout_write(struct ast_channel *chan, const char *cmd, char *data,
case 'a': case 'a':
case 'A': case 'A':
ast_channel_setwhentohangup(chan, x); ast_channel_setwhentohangup(chan, x);
if (option_verbose > 2) {
if (chan->whentohangup) { if (chan->whentohangup) {
struct timeval tv = { chan->whentohangup, 0 }; struct timeval tv = { chan->whentohangup, 0 };
ast_strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S.%3q %Z", ast_strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S.%3q %Z",
ast_localtime(&tv, &myt, NULL)); ast_localtime(&tv, &myt, NULL));
ast_verbose(VERBOSE_PREFIX_3 "Channel will hangup at %s.\n", ast_verb(3, "Channel will hangup at %s.\n", timestr);
timestr);
} else { } else {
ast_verbose(VERBOSE_PREFIX_3 "Channel hangup cancelled.\n"); ast_verb(3, "Channel hangup cancelled.\n");
}
} }
break; break;
@ -128,9 +125,7 @@ static int timeout_write(struct ast_channel *chan, const char *cmd, char *data,
case 'R': case 'R':
if (chan->pbx) { if (chan->pbx) {
chan->pbx->rtimeout = x; chan->pbx->rtimeout = x;
if (option_verbose > 2) ast_verb(3, "Response timeout set to %d\n", chan->pbx->rtimeout);
ast_verbose(VERBOSE_PREFIX_3 "Response timeout set to %d\n",
chan->pbx->rtimeout);
} }
break; break;
@ -138,9 +133,7 @@ static int timeout_write(struct ast_channel *chan, const char *cmd, char *data,
case 'D': case 'D':
if (chan->pbx) { if (chan->pbx) {
chan->pbx->dtimeout = x; chan->pbx->dtimeout = x;
if (option_verbose > 2) ast_verb(3, "Digit timeout set to %d\n", chan->pbx->dtimeout);
ast_verbose(VERBOSE_PREFIX_3 "Digit timeout set to %d\n",
chan->pbx->dtimeout);
} }
break; break;

View File

@ -511,8 +511,7 @@ static int create_jb(struct ast_channel *chan, struct ast_frame *frr)
now, frr->ts, frr->len); now, frr->ts, frr->len);
} }
if (option_verbose > 2) ast_verb(3, "%s jitterbuffer created on channel %s\n", jbimpl->name, chan->name);
ast_verbose(VERBOSE_PREFIX_3 "%s jitterbuffer created on channel %s\n", jbimpl->name, chan->name);
/* Free the frame if it has not been queued in the jb */ /* Free the frame if it has not been queued in the jb */
if (res != JB_IMPL_OK) if (res != JB_IMPL_OK)
@ -545,8 +544,7 @@ void ast_jb_destroy(struct ast_channel *chan)
ast_clear_flag(jb, JB_CREATED); ast_clear_flag(jb, JB_CREATED);
if (option_verbose > 2) ast_verb(3, "%s jitterbuffer destroyed on channel %s\n", jbimpl->name, chan->name);
ast_verbose(VERBOSE_PREFIX_3 "%s jitterbuffer destroyed on channel %s\n", jbimpl->name, chan->name);
} }
} }

View File

@ -205,8 +205,8 @@ int ast_app_has_voicemail(const char *mailbox, const char *folder)
if (ast_has_voicemail_func) if (ast_has_voicemail_func)
return ast_has_voicemail_func(mailbox, folder); return ast_has_voicemail_func(mailbox, folder);
if ((option_verbose > 2) && !warned) { if (!warned) {
ast_verbose(VERBOSE_PREFIX_3 "Message check requested for mailbox %s/folder %s but voicemail not loaded.\n", mailbox, folder ? folder : "INBOX"); ast_verb(3, "Message check requested for mailbox %s/folder %s but voicemail not loaded.\n", mailbox, folder ? folder : "INBOX");
warned++; warned++;
} }
return 0; return 0;
@ -223,9 +223,9 @@ int ast_app_inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
if (ast_inboxcount_func) if (ast_inboxcount_func)
return ast_inboxcount_func(mailbox, newmsgs, oldmsgs); return ast_inboxcount_func(mailbox, newmsgs, oldmsgs);
if (!warned && (option_verbose > 2)) { if (!warned) {
warned++; warned++;
ast_verbose(VERBOSE_PREFIX_3 "Message count requested for mailbox %s but voicemail not loaded.\n", mailbox); ast_verb(3, "Message count requested for mailbox %s but voicemail not loaded.\n", mailbox);
} }
return 0; return 0;
@ -237,9 +237,9 @@ int ast_app_messagecount(const char *context, const char *mailbox, const char *f
if (ast_messagecount_func) if (ast_messagecount_func)
return ast_messagecount_func(context, mailbox, folder); return ast_messagecount_func(context, mailbox, folder);
if (!warned && (option_verbose > 2)) { if (!warned) {
warned++; warned++;
ast_verbose(VERBOSE_PREFIX_3 "Message count requested for mailbox %s@%s/%s but voicemail not loaded.\n", mailbox, context, folder); ast_verb(3, "Message count requested for mailbox %s@%s/%s but voicemail not loaded.\n", mailbox, context, folder);
} }
return 0; return 0;
@ -454,13 +454,13 @@ int ast_control_streamfile(struct ast_channel *chan, const char *file,
else if (end || offset < 0) { else if (end || offset < 0) {
if (offset == -8) if (offset == -8)
offset = 0; offset = 0;
ast_verbose(VERBOSE_PREFIX_3 "ControlPlayback seek to offset %ld from end\n", offset); ast_verb(3, "ControlPlayback seek to offset %ld from end\n", offset);
ast_seekstream(chan->stream, offset, SEEK_END); ast_seekstream(chan->stream, offset, SEEK_END);
end = NULL; end = NULL;
offset = 0; offset = 0;
} else if (offset) { } else if (offset) {
ast_verbose(VERBOSE_PREFIX_3 "ControlPlayback seek to offset %ld\n", offset); ast_verb(3, "ControlPlayback seek to offset %ld\n", offset);
ast_seekstream(chan->stream, offset, SEEK_SET); ast_seekstream(chan->stream, offset, SEEK_SET);
offset = 0; offset = 0;
}; };
@ -615,8 +615,7 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile,
end = start = time(NULL); /* pre-initialize end to be same as start in case we never get into loop */ end = start = time(NULL); /* pre-initialize end to be same as start in case we never get into loop */
for (x = 0; x < fmtcnt; x++) { for (x = 0; x < fmtcnt; x++) {
others[x] = ast_writefile(prepend ? prependfile : recordfile, sfmt[x], comment, O_TRUNC, 0, AST_FILE_MODE); others[x] = ast_writefile(prepend ? prependfile : recordfile, sfmt[x], comment, O_TRUNC, 0, AST_FILE_MODE);
if (option_verbose > 2) ast_verb(3, "x=%d, open writing: %s format: %s, %p\n", x, prepend ? prependfile : recordfile, sfmt[x], others[x]);
ast_verbose(VERBOSE_PREFIX_3 "x=%d, open writing: %s format: %s, %p\n", x, prepend ? prependfile : recordfile, sfmt[x], others[x]);
if (!others[x]) if (!others[x])
break; break;
@ -691,8 +690,7 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile,
if (totalsilence > maxsilence) { if (totalsilence > maxsilence) {
/* Ended happily with silence */ /* Ended happily with silence */
if (option_verbose > 2) ast_verb(3, "Recording automatically stopped after a silence of %d seconds\n", totalsilence/1000);
ast_verbose( VERBOSE_PREFIX_3 "Recording automatically stopped after a silence of %d seconds\n", totalsilence/1000);
res = 'S'; res = 'S';
outmsg = 2; outmsg = 2;
break; break;
@ -709,22 +707,19 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile,
} else if (f->frametype == AST_FRAME_DTMF) { } else if (f->frametype == AST_FRAME_DTMF) {
if (prepend) { if (prepend) {
/* stop recording with any digit */ /* stop recording with any digit */
if (option_verbose > 2) ast_verb(3, "User ended message by pressing %c\n", f->subclass);
ast_verbose(VERBOSE_PREFIX_3 "User ended message by pressing %c\n", f->subclass);
res = 't'; res = 't';
outmsg = 2; outmsg = 2;
break; break;
} }
if (strchr(acceptdtmf, f->subclass)) { if (strchr(acceptdtmf, f->subclass)) {
if (option_verbose > 2) ast_verb(3, "User ended message by pressing %c\n", f->subclass);
ast_verbose(VERBOSE_PREFIX_3 "User ended message by pressing %c\n", f->subclass);
res = f->subclass; res = f->subclass;
outmsg = 2; outmsg = 2;
break; break;
} }
if (strchr(canceldtmf, f->subclass)) { if (strchr(canceldtmf, f->subclass)) {
if (option_verbose > 2) ast_verb(3, "User cancelled message by pressing %c\n", f->subclass);
ast_verbose(VERBOSE_PREFIX_3 "User cancelled message by pressing %c\n", f->subclass);
res = f->subclass; res = f->subclass;
outmsg = 0; outmsg = 0;
break; break;
@ -733,8 +728,7 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile,
if (maxtime) { if (maxtime) {
end = time(NULL); end = time(NULL);
if (maxtime < (end - start)) { if (maxtime < (end - start)) {
if (option_verbose > 2) ast_verb(3, "Took too long, cutting it short...\n");
ast_verbose(VERBOSE_PREFIX_3 "Took too long, cutting it short...\n");
res = 't'; res = 't';
outmsg = 2; outmsg = 2;
break; break;
@ -743,8 +737,7 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile,
ast_frfree(f); ast_frfree(f);
} }
if (!f) { if (!f) {
if (option_verbose > 2) ast_verb(3, "User hung up\n");
ast_verbose(VERBOSE_PREFIX_3 "User hung up\n");
res = -1; res = -1;
outmsg = 1; outmsg = 1;
} else { } else {
@ -792,8 +785,7 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile,
ast_closestream(others[x]); ast_closestream(others[x]);
ast_closestream(realfiles[x]); ast_closestream(realfiles[x]);
ast_filerename(prependfile, recordfile, sfmt[x]); ast_filerename(prependfile, recordfile, sfmt[x]);
if (option_verbose > 3) ast_verb(4, "Recording Format: sfmts=%s, prependfile %s, recordfile %s\n", sfmt[x], prependfile, recordfile);
ast_verbose(VERBOSE_PREFIX_4 "Recording Format: sfmts=%s, prependfile %s, recordfile %s\n", sfmt[x], prependfile, recordfile);
ast_filedelete(prependfile, sfmt[x]); ast_filedelete(prependfile, sfmt[x]);
} }
} }
@ -1127,16 +1119,16 @@ int ast_record_review(struct ast_channel *chan, const char *playfile, const char
} }
case '2': case '2':
/* Review */ /* Review */
ast_verbose(VERBOSE_PREFIX_3 "Reviewing the recording\n"); ast_verb(3, "Reviewing the recording\n");
cmd = ast_stream_and_wait(chan, recordfile, AST_DIGIT_ANY); cmd = ast_stream_and_wait(chan, recordfile, AST_DIGIT_ANY);
break; break;
case '3': case '3':
message_exists = 0; message_exists = 0;
/* Record */ /* Record */
if (recorded == 1) if (recorded == 1)
ast_verbose(VERBOSE_PREFIX_3 "Re-recording\n"); ast_verb(3, "Re-recording\n");
else else
ast_verbose(VERBOSE_PREFIX_3 "Recording\n"); ast_verb(3, "Recording\n");
recorded = 1; recorded = 1;
cmd = ast_play_and_record(chan, playfile, recordfile, maxtime, fmt, duration, silencethreshold, maxsilence, path); cmd = ast_play_and_record(chan, playfile, recordfile, maxtime, fmt, duration, silencethreshold, maxsilence, path);
if (cmd == -1) { if (cmd == -1) {

View File

@ -152,8 +152,7 @@ void ast_cdr_unregister(const char *name)
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&be_list, i, list) { AST_RWLIST_TRAVERSE_SAFE_BEGIN(&be_list, i, list) {
if (!strcasecmp(name, i->name)) { if (!strcasecmp(name, i->name)) {
AST_RWLIST_REMOVE_CURRENT(&be_list, list); AST_RWLIST_REMOVE_CURRENT(&be_list, list);
if (option_verbose > 1) ast_verb(2, "Unregistered '%s' CDR backend\n", name);
ast_verbose(VERBOSE_PREFIX_2 "Unregistered '%s' CDR backend\n", name);
ast_free(i); ast_free(i);
break; break;
} }

View File

@ -435,9 +435,7 @@ int ast_channel_register(const struct ast_channel_tech *tech)
ast_debug(1, "Registered handler for '%s' (%s)\n", chan->tech->type, chan->tech->description); ast_debug(1, "Registered handler for '%s' (%s)\n", chan->tech->type, chan->tech->description);
if (option_verbose > 1) ast_verb(2, "Registered channel type '%s' (%s)\n", chan->tech->type, chan->tech->description);
ast_verbose(VERBOSE_PREFIX_2 "Registered channel type '%s' (%s)\n", chan->tech->type,
chan->tech->description);
AST_RWLIST_UNLOCK(&channels); AST_RWLIST_UNLOCK(&channels);
return 0; return 0;
@ -456,8 +454,7 @@ void ast_channel_unregister(const struct ast_channel_tech *tech)
if (chan->tech == tech) { if (chan->tech == tech) {
AST_LIST_REMOVE_CURRENT(&backends, list); AST_LIST_REMOVE_CURRENT(&backends, list);
ast_free(chan); ast_free(chan);
if (option_verbose > 1) ast_verb(2, "Unregistered channel type '%s'\n", tech->type);
ast_verbose(VERBOSE_PREFIX_2 "Unregistered channel type '%s'\n", tech->type);
break; break;
} }
} }
@ -4169,9 +4166,7 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
case AST_BRIDGE_RETRY: case AST_BRIDGE_RETRY:
continue; continue;
default: default:
if (option_verbose > 2) ast_verb(3, "Native bridging %s and %s ended\n", c0->name, c1->name);
ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s ended\n",
c0->name, c1->name);
/* fallthrough */ /* fallthrough */
case AST_BRIDGE_FAILED_NOWARN: case AST_BRIDGE_FAILED_NOWARN:
nativefailed++; nativefailed++;
@ -4452,10 +4447,7 @@ int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *inte
if (ast_moh_start_ptr) if (ast_moh_start_ptr)
return ast_moh_start_ptr(chan, mclass, interpclass); return ast_moh_start_ptr(chan, mclass, interpclass);
if (option_verbose > 2) { ast_verb(3, "Music class %s requested but no musiconhold loaded.\n", mclass ? mclass : (interpclass ? interpclass : "default"));
ast_verbose(VERBOSE_PREFIX_3 "Music class %s requested but no musiconhold loaded.\n",
mclass ? mclass : (interpclass ? interpclass : "default"));
}
return 0; return 0;
} }

View File

@ -825,20 +825,16 @@ static struct ast_config *config_text_file_load(const char *database, const char
ast_log(LOG_WARNING, "'%s' is not a regular file, ignoring\n", fn); ast_log(LOG_WARNING, "'%s' is not a regular file, ignoring\n", fn);
continue; continue;
} }
if (option_verbose > 1) { ast_verb(2, "Parsing '%s': ", fn);
ast_verbose(VERBOSE_PREFIX_2 "Parsing '%s': ", fn);
fflush(stdout); fflush(stdout);
}
if (!(f = fopen(fn, "r"))) { if (!(f = fopen(fn, "r"))) {
ast_debug(1, "No file to parse: %s\n", fn); ast_debug(1, "No file to parse: %s\n", fn);
if (option_verbose > 1) ast_verb(2, "Not found (%s)\n", strerror(errno));
ast_verbose( "Not found (%s)\n", strerror(errno));
continue; continue;
} }
count++; count++;
ast_debug(1, "Parsing %s\n", fn); ast_debug(1, "Parsing %s\n", fn);
if (option_verbose > 1) ast_verb(2, "Found\n");
ast_verbose("Found\n");
while (!feof(f)) { while (!feof(f)) {
lineno++; lineno++;
if (fgets(buf, sizeof(buf), f)) { if (fgets(buf, sizeof(buf), f)) {
@ -971,8 +967,7 @@ int config_text_file_save(const char *configfile, const struct ast_config *cfg,
#else #else
if ((f = fopen(fn, "w"))) { if ((f = fopen(fn, "w"))) {
#endif #endif
if (option_verbose > 1) ast_verb(2, "Saving '%s': ", fn);
ast_verbose(VERBOSE_PREFIX_2 "Saving '%s': ", fn);
fprintf(f, ";!\n"); fprintf(f, ";!\n");
fprintf(f, ";! Automatically generated configuration file\n"); fprintf(f, ";! Automatically generated configuration file\n");
if (strcmp(configfile, fn)) if (strcmp(configfile, fn))
@ -1024,12 +1019,11 @@ int config_text_file_save(const char *configfile, const struct ast_config *cfg,
#endif #endif
cat = cat->next; cat = cat->next;
} }
if ((option_verbose > 1) && !option_debug) if (!option_debug)
ast_verbose("Saved\n"); ast_verb(2, "Saved\n");
} else { } else {
ast_debug(1, "Unable to open for writing: %s\n", fn); ast_debug(1, "Unable to open for writing: %s\n", fn);
if (option_verbose > 1) ast_verb(2, "Unable to write (%s)", strerror(errno));
ast_verbose(VERBOSE_PREFIX_2 "Unable to write (%s)", strerror(errno));
return -1; return -1;
} }
fclose(f); fclose(f);
@ -1078,9 +1072,7 @@ static int append_mapping(char *name, char *driver, char *database, char *table)
} }
map->next = config_maps; map->next = config_maps;
if (option_verbose > 1) ast_verb(2, "Binding %s to %s/%s/%s\n", map->name, map->driver, map->database, map->table ? map->table : map->name);
ast_verbose(VERBOSE_PREFIX_2 "Binding %s to %s/%s/%s\n",
map->name, map->driver, map->database, map->table ? map->table : map->name);
config_maps = map; config_maps = map;
return 0; return 0;

View File

@ -284,8 +284,7 @@ static int begin_dial(struct ast_dial *dial, struct ast_channel *chan)
channel->owner = NULL; channel->owner = NULL;
} else { } else {
success++; success++;
if (option_verbose > 2) ast_verb(3, "Called %s\n", numsubst);
ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", numsubst);
} }
} }
@ -320,56 +319,47 @@ static void handle_frame(struct ast_dial *dial, struct ast_dial_channel *channel
if (fr->frametype == AST_FRAME_CONTROL) { if (fr->frametype == AST_FRAME_CONTROL) {
switch (fr->subclass) { switch (fr->subclass) {
case AST_CONTROL_ANSWER: case AST_CONTROL_ANSWER:
if (option_verbose > 2) ast_verb(3, "%s answered %s\n", channel->owner->name, chan->name);
ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", channel->owner->name, chan->name);
AST_LIST_REMOVE(&dial->channels, channel, list); AST_LIST_REMOVE(&dial->channels, channel, list);
AST_LIST_INSERT_HEAD(&dial->channels, channel, list); AST_LIST_INSERT_HEAD(&dial->channels, channel, list);
set_state(dial, AST_DIAL_RESULT_ANSWERED); set_state(dial, AST_DIAL_RESULT_ANSWERED);
break; break;
case AST_CONTROL_BUSY: case AST_CONTROL_BUSY:
if (option_verbose > 2) ast_verb(3, "%s is busy\n", channel->owner->name);
ast_verbose(VERBOSE_PREFIX_3 "%s is busy\n", channel->owner->name);
ast_hangup(channel->owner); ast_hangup(channel->owner);
channel->owner = NULL; channel->owner = NULL;
break; break;
case AST_CONTROL_CONGESTION: case AST_CONTROL_CONGESTION:
if (option_verbose > 2) ast_verb(3, "%s is circuit-busy\n", channel->owner->name);
ast_verbose(VERBOSE_PREFIX_3 "%s is circuit-busy\n", channel->owner->name);
ast_hangup(channel->owner); ast_hangup(channel->owner);
channel->owner = NULL; channel->owner = NULL;
break; break;
case AST_CONTROL_RINGING: case AST_CONTROL_RINGING:
if (option_verbose > 2) ast_verb(3, "%s is ringing\n", channel->owner->name);
ast_verbose(VERBOSE_PREFIX_3 "%s is ringing\n", channel->owner->name);
if (!dial->options[AST_DIAL_OPTION_MUSIC]) if (!dial->options[AST_DIAL_OPTION_MUSIC])
ast_indicate(chan, AST_CONTROL_RINGING); ast_indicate(chan, AST_CONTROL_RINGING);
set_state(dial, AST_DIAL_RESULT_RINGING); set_state(dial, AST_DIAL_RESULT_RINGING);
break; break;
case AST_CONTROL_PROGRESS: case AST_CONTROL_PROGRESS:
if (option_verbose > 2) ast_verb(3, "%s is making progress, passing it to %s\n", channel->owner->name, chan->name);
ast_verbose (VERBOSE_PREFIX_3 "%s is making progress, passing it to %s\n", channel->owner->name, chan->name);
ast_indicate(chan, AST_CONTROL_PROGRESS); ast_indicate(chan, AST_CONTROL_PROGRESS);
set_state(dial, AST_DIAL_RESULT_PROGRESS); set_state(dial, AST_DIAL_RESULT_PROGRESS);
break; break;
case AST_CONTROL_VIDUPDATE: case AST_CONTROL_VIDUPDATE:
if (option_verbose > 2) ast_verb(3, "%s requested a video update, passing it to %s\n", channel->owner->name, chan->name);
ast_verbose (VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", channel->owner->name, chan->name);
ast_indicate(chan, AST_CONTROL_VIDUPDATE); ast_indicate(chan, AST_CONTROL_VIDUPDATE);
break; break;
case AST_CONTROL_PROCEEDING: case AST_CONTROL_PROCEEDING:
if (option_verbose > 2) ast_verb(3, "%s is proceeding, passing it to %s\n", channel->owner->name, chan->name);
ast_verbose (VERBOSE_PREFIX_3 "%s is proceeding, passing it to %s\n", channel->owner->name, chan->name);
ast_indicate(chan, AST_CONTROL_PROCEEDING); ast_indicate(chan, AST_CONTROL_PROCEEDING);
set_state(dial, AST_DIAL_RESULT_PROCEEDING); set_state(dial, AST_DIAL_RESULT_PROCEEDING);
break; break;
case AST_CONTROL_HOLD: case AST_CONTROL_HOLD:
if (option_verbose > 2) ast_verb(3, "Call on %s placed on hold\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Call on %s placed on hold\n", chan->name);
ast_indicate(chan, AST_CONTROL_HOLD); ast_indicate(chan, AST_CONTROL_HOLD);
break; break;
case AST_CONTROL_UNHOLD: case AST_CONTROL_UNHOLD:
if (option_verbose > 2) ast_verb(3, "Call on %s left from hold\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Call on %s left from hold\n", chan->name);
ast_indicate(chan, AST_CONTROL_UNHOLD); ast_indicate(chan, AST_CONTROL_UNHOLD);
break; break;
case AST_CONTROL_OFFHOOK: case AST_CONTROL_OFFHOOK:
@ -396,37 +386,31 @@ static void handle_frame_ownerless(struct ast_dial *dial, struct ast_dial_channe
switch (fr->subclass) { switch (fr->subclass) {
case AST_CONTROL_ANSWER: case AST_CONTROL_ANSWER:
if (option_verbose > 2) ast_verb(3, "%s answered\n", channel->owner->name);
ast_verbose( VERBOSE_PREFIX_3 "%s answered\n", channel->owner->name);
AST_LIST_REMOVE(&dial->channels, channel, list); AST_LIST_REMOVE(&dial->channels, channel, list);
AST_LIST_INSERT_HEAD(&dial->channels, channel, list); AST_LIST_INSERT_HEAD(&dial->channels, channel, list);
set_state(dial, AST_DIAL_RESULT_ANSWERED); set_state(dial, AST_DIAL_RESULT_ANSWERED);
break; break;
case AST_CONTROL_BUSY: case AST_CONTROL_BUSY:
if (option_verbose > 2) ast_verb(3, "%s is busy\n", channel->owner->name);
ast_verbose(VERBOSE_PREFIX_3 "%s is busy\n", channel->owner->name);
ast_hangup(channel->owner); ast_hangup(channel->owner);
channel->owner = NULL; channel->owner = NULL;
break; break;
case AST_CONTROL_CONGESTION: case AST_CONTROL_CONGESTION:
if (option_verbose > 2) ast_verb(3, "%s is circuit-busy\n", channel->owner->name);
ast_verbose(VERBOSE_PREFIX_3 "%s is circuit-busy\n", channel->owner->name);
ast_hangup(channel->owner); ast_hangup(channel->owner);
channel->owner = NULL; channel->owner = NULL;
break; break;
case AST_CONTROL_RINGING: case AST_CONTROL_RINGING:
if (option_verbose > 2) ast_verb(3, "%s is ringing\n", channel->owner->name);
ast_verbose(VERBOSE_PREFIX_3 "%s is ringing\n", channel->owner->name);
set_state(dial, AST_DIAL_RESULT_RINGING); set_state(dial, AST_DIAL_RESULT_RINGING);
break; break;
case AST_CONTROL_PROGRESS: case AST_CONTROL_PROGRESS:
if (option_verbose > 2) ast_verb(3, "%s is making progress\n", channel->owner->name);
ast_verbose (VERBOSE_PREFIX_3 "%s is making progress\n", channel->owner->name);
set_state(dial, AST_DIAL_RESULT_PROGRESS); set_state(dial, AST_DIAL_RESULT_PROGRESS);
break; break;
case AST_CONTROL_PROCEEDING: case AST_CONTROL_PROCEEDING:
if (option_verbose > 2) ast_verb(3, "%s is proceeding\n", channel->owner->name);
ast_verbose (VERBOSE_PREFIX_3 "%s is proceeding\n", channel->owner->name);
set_state(dial, AST_DIAL_RESULT_PROCEEDING); set_state(dial, AST_DIAL_RESULT_PROCEEDING);
break; break;
default: default:

View File

@ -113,8 +113,7 @@ void ast_dnsmgr_release(struct ast_dnsmgr_entry *entry)
AST_RWLIST_WRLOCK(&entry_list); AST_RWLIST_WRLOCK(&entry_list);
AST_RWLIST_REMOVE(&entry_list, entry, list); AST_RWLIST_REMOVE(&entry_list, entry, list);
AST_RWLIST_UNLOCK(&entry_list); AST_RWLIST_UNLOCK(&entry_list);
if (option_verbose > 3) ast_verb(4, "removing dns manager for '%s'\n", entry->name);
ast_verbose(VERBOSE_PREFIX_4 "removing dns manager for '%s'\n", entry->name);
ast_mutex_destroy(&entry->lock); ast_mutex_destroy(&entry->lock);
ast_free(entry); ast_free(entry);
@ -131,8 +130,7 @@ int ast_dnsmgr_lookup(const char *name, struct in_addr *result, struct ast_dnsmg
if (*dnsmgr && !strcasecmp((*dnsmgr)->name, name)) if (*dnsmgr && !strcasecmp((*dnsmgr)->name, name))
return 0; return 0;
if (option_verbose > 3) ast_verb(4, "doing dnsmgr_lookup for '%s'\n", name);
ast_verbose(VERBOSE_PREFIX_4 "doing dnsmgr_lookup for '%s'\n", name);
/* if it's actually an IP address and not a name, /* if it's actually an IP address and not a name,
there's no need for a managed lookup */ there's no need for a managed lookup */
@ -147,8 +145,7 @@ int ast_dnsmgr_lookup(const char *name, struct in_addr *result, struct ast_dnsmg
if (!enabled) if (!enabled)
return 0; return 0;
if (option_verbose > 2) ast_verb(3, "adding dns manager for '%s'\n", name);
ast_verbose(VERBOSE_PREFIX_2 "adding dns manager for '%s'\n", name);
*dnsmgr = ast_dnsmgr_get(name, result); *dnsmgr = ast_dnsmgr_get(name, result);
return !*dnsmgr; return !*dnsmgr;
} }
@ -166,8 +163,8 @@ static int dnsmgr_refresh(struct ast_dnsmgr_entry *entry, int verbose)
int changed = 0; int changed = 0;
ast_mutex_lock(&entry->lock); ast_mutex_lock(&entry->lock);
if (verbose && (option_verbose > 2)) if (verbose)
ast_verbose(VERBOSE_PREFIX_2 "refreshing '%s'\n", entry->name); ast_verb(3, "refreshing '%s'\n", entry->name);
if ((hp = ast_gethostbyname(entry->name, &ahp))) { if ((hp = ast_gethostbyname(entry->name, &ahp))) {
/* check to see if it has changed, do callback if requested (where de callback is defined ????) */ /* check to see if it has changed, do callback if requested (where de callback is defined ????) */
@ -232,8 +229,7 @@ static int refresh_list(void *data)
return -1; return -1;
} }
if (option_verbose > 2) ast_verb(3, "Refreshing DNS lookups.\n");
ast_verbose(VERBOSE_PREFIX_2 "Refreshing DNS lookups.\n");
AST_RWLIST_RDLOCK(info->entries); AST_RWLIST_RDLOCK(info->entries);
AST_RWLIST_TRAVERSE(info->entries, entry, list) { AST_RWLIST_TRAVERSE(info->entries, entry, list) {
if (info->regex_present && regexec(&info->filter, entry->name, 0, NULL, 0)) if (info->regex_present && regexec(&info->filter, entry->name, 0, NULL, 0))

View File

@ -97,8 +97,7 @@ int __ast_format_register(const struct ast_format *f, struct ast_module *mod)
AST_RWLIST_INSERT_HEAD(&formats, tmp, list); AST_RWLIST_INSERT_HEAD(&formats, tmp, list);
AST_RWLIST_UNLOCK(&formats); AST_RWLIST_UNLOCK(&formats);
if (option_verbose > 1) ast_verb(2, "Registered file format %s, extension(s) %s\n", f->name, f->exts);
ast_verbose( VERBOSE_PREFIX_2 "Registered file format %s, extension(s) %s\n", f->name, f->exts);
return 0; return 0;
} }
@ -119,10 +118,9 @@ int ast_format_unregister(const char *name)
AST_RWLIST_TRAVERSE_SAFE_END AST_RWLIST_TRAVERSE_SAFE_END
AST_RWLIST_UNLOCK(&formats); AST_RWLIST_UNLOCK(&formats);
if (!res) { if (!res)
if (option_verbose > 1) ast_verb(2, "Unregistered format %s\n", name);
ast_verbose( VERBOSE_PREFIX_2 "Unregistered format %s\n", name); else
} else
ast_log(LOG_WARNING, "Tried to unregister format %s, already unregistered\n", name); ast_log(LOG_WARNING, "Tried to unregister format %s, already unregistered\n", name);
return res; return res;
@ -797,8 +795,7 @@ int ast_streamfile(struct ast_channel *chan, const char *filename, const char *p
ast_playstream(fs); ast_playstream(fs);
if (vfs) if (vfs)
ast_playstream(vfs); ast_playstream(vfs);
if (option_verbose > 2) ast_verb(3, "<%s> Playing '%s.%s' (language '%s')\n", chan->name, filename, ast_getformatname(chan->writeformat), preflang ? preflang : "default");
ast_verbose(VERBOSE_PREFIX_3 "<%s> Playing '%s.%s' (language '%s')\n", chan->name, filename, ast_getformatname(chan->writeformat), preflang ? preflang : "default");
return 0; return 0;
} }

View File

@ -51,8 +51,7 @@ static AST_RWLIST_HEAD_STATIC(imagers, ast_imager);
int ast_image_register(struct ast_imager *img) int ast_image_register(struct ast_imager *img)
{ {
if (option_verbose > 1) ast_verb(2, "Registered format '%s' (%s)\n", img->name, img->desc);
ast_verbose(VERBOSE_PREFIX_2 "Registered format '%s' (%s)\n", img->name, img->desc);
AST_RWLIST_WRLOCK(&imagers); AST_RWLIST_WRLOCK(&imagers);
AST_RWLIST_INSERT_HEAD(&imagers, img, list); AST_RWLIST_INSERT_HEAD(&imagers, img, list);
AST_RWLIST_UNLOCK(&imagers); AST_RWLIST_UNLOCK(&imagers);
@ -72,8 +71,8 @@ void ast_image_unregister(struct ast_imager *img)
} }
AST_RWLIST_TRAVERSE_SAFE_END AST_RWLIST_TRAVERSE_SAFE_END
AST_RWLIST_UNLOCK(&imagers); AST_RWLIST_UNLOCK(&imagers);
if (i && (option_verbose > 1)) if (i)
ast_verbose(VERBOSE_PREFIX_2 "Unregistered format '%s' (%s)\n", img->name, img->desc); ast_verb(2, "Unregistered format '%s' (%s)\n", img->name, img->desc);
} }
int ast_supports_images(struct ast_channel *chan) int ast_supports_images(struct ast_channel *chan)

View File

@ -369,8 +369,7 @@ int ast_set_indication_country(const char *country)
if (!country || !(zone = ast_get_indication_zone(country))) if (!country || !(zone = ast_get_indication_zone(country)))
return 1; return 1;
if (option_verbose > 2) ast_verb(3, "Setting default indication country to '%s'\n", country);
ast_verbose(VERBOSE_PREFIX_3 "Setting default indication country to '%s'\n", country);
/* Protect the current tonezone using the tone_zones lock as well */ /* Protect the current tonezone using the tone_zones lock as well */
AST_RWLIST_WRLOCK(&tone_zones); AST_RWLIST_WRLOCK(&tone_zones);
@ -494,8 +493,7 @@ int ast_register_indication_country(struct ind_tone_zone *zone)
/* It's all over. */ /* It's all over. */
AST_RWLIST_UNLOCK(&tone_zones); AST_RWLIST_UNLOCK(&tone_zones);
if (option_verbose > 2) ast_verb(3, "Registered indication country '%s'\n", zone->country);
ast_verbose(VERBOSE_PREFIX_3 "Registered indication country '%s'\n", zone->country);
return 0; return 0;
} }
@ -518,8 +516,7 @@ int ast_unregister_indication_country(const char *country)
} }
/* Remove from the list */ /* Remove from the list */
AST_RWLIST_REMOVE_CURRENT(&tone_zones, list); AST_RWLIST_REMOVE_CURRENT(&tone_zones, list);
if (option_verbose > 2) ast_verb(3, "Unregistered indication country '%s'\n", tz->country);
ast_verbose(VERBOSE_PREFIX_3 "Unregistered indication country '%s'\n", tz->country);
free_zone(tz); free_zone(tz);
res = 0; res = 0;
} }

View File

@ -583,8 +583,7 @@ int ast_module_reload(const char *name)
} }
res = 2; res = 2;
if (option_verbose > 2) ast_verb(3, "Reloading module '%s' (%s)\n", cur->resource, info->description);
ast_verbose(VERBOSE_PREFIX_3 "Reloading module '%s' (%s)\n", cur->resource, info->description);
info->reload(); info->reload();
} }
AST_LIST_UNLOCK(&module_list); AST_LIST_UNLOCK(&module_list);
@ -665,13 +664,11 @@ static enum ast_module_load_result load_resource(const char *resource_name, unsi
switch (res) { switch (res) {
case AST_MODULE_LOAD_SUCCESS: case AST_MODULE_LOAD_SUCCESS:
if (!ast_fully_booted) { if (!ast_fully_booted) {
if (option_verbose) ast_verb(1, "%s => (%s)\n", resource_name, term_color(tmp, mod->info->description, COLOR_BROWN, COLOR_BLACK, sizeof(tmp)));
ast_verbose("%s => (%s)\n", resource_name, term_color(tmp, mod->info->description, COLOR_BROWN, COLOR_BLACK, sizeof(tmp)));
if (ast_opt_console && !option_verbose) if (ast_opt_console && !option_verbose)
ast_verbose( "."); ast_verbose( ".");
} else { } else {
if (option_verbose) ast_verb(1, "Loaded %s => (%s)\n", resource_name, mod->info->description);
ast_verbose(VERBOSE_PREFIX_1 "Loaded %s => (%s)\n", resource_name, mod->info->description);
} }
mod->flags.running = 1; mod->flags.running = 1;
@ -742,8 +739,7 @@ int load_modules(unsigned int preload_only)
/* all embedded modules have registered themselves by now */ /* all embedded modules have registered themselves by now */
embedding = 0; embedding = 0;
if (option_verbose) ast_verb(1, "Asterisk Dynamic Loader Starting:\n");
ast_verbose("Asterisk Dynamic Loader Starting:\n");
AST_LIST_HEAD_INIT_NOLOCK(&load_order); AST_LIST_HEAD_INIT_NOLOCK(&load_order);

View File

@ -1482,11 +1482,8 @@ static int action_login(struct mansession *s, const struct message *m)
return -1; return -1;
} }
s->authenticated = 1; s->authenticated = 1;
if (option_verbose > 1) { if (manager_displayconnects(s))
if (manager_displayconnects(s)) { ast_verb(2, "%sManager '%s' logged on from %s\n", (s->managerid ? "HTTP " : ""), s->username, ast_inet_ntoa(s->sin.sin_addr));
ast_verbose(VERBOSE_PREFIX_2 "%sManager '%s' logged on from %s\n", (s->managerid ? "HTTP " : ""), s->username, ast_inet_ntoa(s->sin.sin_addr));
}
}
ast_log(LOG_EVENT, "%sManager '%s' logged on from %s\n", (s->managerid ? "HTTP " : ""), s->username, ast_inet_ntoa(s->sin.sin_addr)); ast_log(LOG_EVENT, "%sManager '%s' logged on from %s\n", (s->managerid ? "HTTP " : ""), s->username, ast_inet_ntoa(s->sin.sin_addr));
astman_send_ack(s, m, "Authentication accepted"); astman_send_ack(s, m, "Authentication accepted");
return 0; return 0;
@ -2526,16 +2523,12 @@ static void *session_do(void *data)
} }
/* session is over, explain why and terminate */ /* session is over, explain why and terminate */
if (s->authenticated) { if (s->authenticated) {
if (option_verbose > 1) {
if (manager_displayconnects(s)) if (manager_displayconnects(s))
ast_verbose(VERBOSE_PREFIX_2 "Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr)); ast_verb(2, "Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr));
}
ast_log(LOG_EVENT, "Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr)); ast_log(LOG_EVENT, "Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr));
} else { } else {
if (option_verbose > 1) {
if (displayconnects) if (displayconnects)
ast_verbose(VERBOSE_PREFIX_2 "Connect attempt from '%s' unable to authenticate\n", ast_inet_ntoa(s->sin.sin_addr)); ast_verb(2, "Connect attempt from '%s' unable to authenticate\n", ast_inet_ntoa(s->sin.sin_addr));
}
ast_log(LOG_EVENT, "Failed attempt from %s\n", ast_inet_ntoa(s->sin.sin_addr)); ast_log(LOG_EVENT, "Failed attempt from %s\n", ast_inet_ntoa(s->sin.sin_addr));
} }
destroy_session(s); destroy_session(s);
@ -2557,7 +2550,7 @@ static void purge_sessions(int n_max)
AST_LIST_REMOVE_CURRENT(&sessions, list); AST_LIST_REMOVE_CURRENT(&sessions, list);
ast_atomic_fetchadd_int(&num_sessions, -1); ast_atomic_fetchadd_int(&num_sessions, -1);
if (s->authenticated && (option_verbose > 1) && manager_displayconnects(s)) { if (s->authenticated && (option_verbose > 1) && manager_displayconnects(s)) {
ast_verbose(VERBOSE_PREFIX_2 "HTTP Manager '%s' timed out from %s\n", ast_verb(2, "HTTP Manager '%s' timed out from %s\n",
s->username, ast_inet_ntoa(s->sin.sin_addr)); s->username, ast_inet_ntoa(s->sin.sin_addr));
} }
free_session(s); /* XXX outside ? */ free_session(s); /* XXX outside ? */
@ -2680,8 +2673,7 @@ int ast_manager_unregister(char *action)
else else
first_action = cur->next; first_action = cur->next;
ast_free(cur); ast_free(cur);
if (option_verbose > 1) ast_verb(2, "Manager unregistered action %s\n", action);
ast_verbose(VERBOSE_PREFIX_2 "Manager unregistered action %s\n", action);
break; break;
} }
} }
@ -2721,8 +2713,7 @@ static int ast_manager_register_struct(struct manager_action *act)
first_action = act; first_action = act;
act->next = cur; act->next = cur;
if (option_verbose > 1) ast_verb(2, "Manager registered action %s\n", act->action);
ast_verbose(VERBOSE_PREFIX_2 "Manager registered action %s\n", act->action);
ast_rwlock_unlock(&actionlock); ast_rwlock_unlock(&actionlock);
return 0; return 0;
} }
@ -3091,16 +3082,12 @@ static struct ast_str *generic_http_callback(enum output_format format,
if (process_message(s, &m)) { if (process_message(s, &m)) {
if (s->authenticated) { if (s->authenticated) {
if (option_verbose > 1) {
if (manager_displayconnects(s)) if (manager_displayconnects(s))
ast_verbose(VERBOSE_PREFIX_2 "HTTP Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr)); ast_verb(2, "HTTP Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr));
}
ast_log(LOG_EVENT, "HTTP Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr)); ast_log(LOG_EVENT, "HTTP Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr));
} else { } else {
if (option_verbose > 1) {
if (displayconnects) if (displayconnects)
ast_verbose(VERBOSE_PREFIX_2 "HTTP Connect attempt from '%s' unable to authenticate\n", ast_inet_ntoa(s->sin.sin_addr)); ast_verb(2, "HTTP Connect attempt from '%s' unable to authenticate\n", ast_inet_ntoa(s->sin.sin_addr));
}
ast_log(LOG_EVENT, "HTTP Failed attempt from %s\n", ast_inet_ntoa(s->sin.sin_addr)); ast_log(LOG_EVENT, "HTTP Failed attempt from %s\n", ast_inet_ntoa(s->sin.sin_addr));
} }
s->needdestroy = 1; s->needdestroy = 1;

View File

@ -3761,12 +3761,10 @@ enum ast_bridge_result ast_rtp_bridge(struct ast_channel *c0, struct ast_channel
return AST_BRIDGE_FAILED_NOWARN; return AST_BRIDGE_FAILED_NOWARN;
} }
if (option_verbose > 2) ast_verb(3, "Packet2Packet bridging %s and %s\n", c0->name, c1->name);
ast_verbose(VERBOSE_PREFIX_3 "Packet2Packet bridging %s and %s\n", c0->name, c1->name);
res = bridge_p2p_loop(c0, c1, p0, p1, timeoutms, flags, fo, rc, pvt0, pvt1); res = bridge_p2p_loop(c0, c1, p0, p1, timeoutms, flags, fo, rc, pvt0, pvt1);
} else { } else {
if (option_verbose > 2) ast_verb(3, "Native bridging %s and %s\n", c0->name, c1->name);
ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name);
res = bridge_native_loop(c0, c1, p0, p1, vp0, vp1, tp0, tp1, pr0, pr1, codec0, codec1, timeoutms, flags, fo, rc, pvt0, pvt1); res = bridge_native_loop(c0, c1, p0, p1, vp0, vp1, tp0, tp1, pr0, pr1, codec0, codec1, timeoutms, flags, fo, rc, pvt0, pvt1);
} }
@ -4046,8 +4044,7 @@ int ast_rtp_reload(void)
rtpstart = 5000; rtpstart = 5000;
rtpend = 31000; rtpend = 31000;
} }
if (option_verbose > 1) ast_verb(2, "RTP Allocating from port range %d -> %d\n", rtpstart, rtpend);
ast_verbose(VERBOSE_PREFIX_2 "RTP Allocating from port range %d -> %d\n", rtpstart, rtpend);
return 0; return 0;
} }

View File

@ -1234,7 +1234,7 @@ static int ast_say_number_full_he(struct ast_channel *chan, int num,
int state = 0; /* no need to save anything */ int state = 0; /* no need to save anything */
int mf = 1; /* +1 = Masculin; -1 = Feminin */ int mf = 1; /* +1 = Masculin; -1 = Feminin */
char fn[SAY_NUM_BUF_SIZE] = ""; char fn[SAY_NUM_BUF_SIZE] = "";
ast_verbose(VERBOSE_PREFIX_3 "ast_say_digits_full: started. " ast_verb(3, "ast_say_digits_full: started. "
"num: %d, options=\"%s\"\n", "num: %d, options=\"%s\"\n",
num, options num, options
); );
@ -1253,7 +1253,7 @@ static int ast_say_number_full_he(struct ast_channel *chan, int num,
* state==0 is the normal mode and it means that we continue * state==0 is the normal mode and it means that we continue
* to check if the number num has yet anything left. * to check if the number num has yet anything left.
*/ */
ast_verbose(VERBOSE_PREFIX_3 "ast_say_digits_full: num: %d, " ast_verb(3, "ast_say_digits_full: num: %d, "
"state=%d, options=\"%s\", mf=%d\n", "state=%d, options=\"%s\", mf=%d\n",
num, state, options, mf num, state, options, mf
); );

View File

@ -82,8 +82,7 @@ static int parse_srv(char *host, int hostlen, int *portno, unsigned char *answer
return -1; return -1;
} }
if (res && strcmp(repl, ".")) { if (res && strcmp(repl, ".")) {
if (option_verbose > 3) ast_verb(3, "parse_srv: SRV mapped to host %s, port %d\n", repl, ntohs(srv->portnum));
ast_verbose( VERBOSE_PREFIX_3 "parse_srv: SRV mapped to host %s, port %d\n", repl, ntohs(srv->portnum));
if (host) { if (host) {
ast_copy_string(host, repl, hostlen); ast_copy_string(host, repl, hostlen);
host[hostlen-1] = '\0'; host[hostlen-1] = '\0';

View File

@ -573,6 +573,7 @@ int __ast_register_translator(struct ast_translator *t, struct ast_module *mod)
{ {
static int added_cli = 0; static int added_cli = 0;
struct ast_translator *u; struct ast_translator *u;
char tmp[80];
if (!mod) { if (!mod) {
ast_log(LOG_WARNING, "Missing module pointer, you need to supply one\n"); ast_log(LOG_WARNING, "Missing module pointer, you need to supply one\n");
@ -626,13 +627,9 @@ int __ast_register_translator(struct ast_translator *t, struct ast_module *mod)
calc_cost(t, 1); calc_cost(t, 1);
if (option_verbose > 1) { ast_verb(2, "Registered translator '%s' from format %s to %s, cost %d\n",
char tmp[80];
ast_verbose(VERBOSE_PREFIX_2 "Registered translator '%s' from format %s to %s, cost %d\n",
term_color(tmp, t->name, COLOR_MAGENTA, COLOR_BLACK, sizeof(tmp)), term_color(tmp, t->name, COLOR_MAGENTA, COLOR_BLACK, sizeof(tmp)),
ast_getformatname(1 << t->srcfmt), ast_getformatname(1 << t->dstfmt), t->cost); ast_getformatname(1 << t->srcfmt), ast_getformatname(1 << t->dstfmt), t->cost);
}
if (!added_cli) { if (!added_cli) {
ast_cli_register_multiple(cli_translate, sizeof(cli_translate) / sizeof(struct ast_cli_entry)); ast_cli_register_multiple(cli_translate, sizeof(cli_translate) / sizeof(struct ast_cli_entry));
@ -676,8 +673,7 @@ int ast_unregister_translator(struct ast_translator *t)
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&translators, u, list) { AST_RWLIST_TRAVERSE_SAFE_BEGIN(&translators, u, list) {
if (u == t) { if (u == t) {
AST_RWLIST_REMOVE_CURRENT(&translators, list); AST_RWLIST_REMOVE_CURRENT(&translators, list);
if (option_verbose > 1) ast_verb(2, "Unregistered translator '%s' from format %s to %s\n", term_color(tmp, t->name, COLOR_MAGENTA, COLOR_BLACK, sizeof(tmp)), ast_getformatname(1 << t->srcfmt), ast_getformatname(1 << t->dstfmt));
ast_verbose(VERBOSE_PREFIX_2 "Unregistered translator '%s' from format %s to %s\n", term_color(tmp, t->name, COLOR_MAGENTA, COLOR_BLACK, sizeof(tmp)), ast_getformatname(1 << t->srcfmt), ast_getformatname(1 << t->dstfmt));
found = 1; found = 1;
break; break;
} }

View File

@ -702,8 +702,7 @@ struct ast_frame *ast_udptl_read(struct ast_udptl *udptl)
} }
if (udptl_debug_test_addr(&sin)) { if (udptl_debug_test_addr(&sin)) {
if (option_verbose) ast_verb(1, "Got UDPTL packet from %s:%d (type %d, seq %d, len %d)\n",
ast_verbose("Got UDPTL packet from %s:%d (type %d, seq %d, len %d)\n",
ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port), 0, seqno, res); ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port), 0, seqno, res);
} }
#if 0 #if 0
@ -1256,8 +1255,7 @@ void ast_udptl_reload(void)
udptlstart = 4500; udptlstart = 4500;
udptlend = 4999; udptlend = 4999;
} }
if (option_verbose > 1) ast_verb(2, "UDPTL allocating from port range %d -> %d\n", udptlstart, udptlend);
ast_verbose(VERBOSE_PREFIX_2 "UDPTL allocating from port range %d -> %d\n", udptlstart, udptlend);
} }
void ast_udptl_init(void) void ast_udptl_init(void)

View File

@ -1634,11 +1634,9 @@ static int handle_command_response(struct dundi_transaction *trans, struct dundi
ntohs(trans->addr.sin_port), expire); ntohs(trans->addr.sin_port), expire);
ast_db_put("dundi/dpeers", dundi_eid_to_str_short(eid_str, sizeof(eid_str), &peer->eid), data); ast_db_put("dundi/dpeers", dundi_eid_to_str_short(eid_str, sizeof(eid_str), &peer->eid), data);
if (inaddrcmp(&peer->addr, &trans->addr)) { if (inaddrcmp(&peer->addr, &trans->addr)) {
if (option_verbose > 2) { ast_verb(3, "Registered DUNDi peer '%s' at '%s:%d'\n",
ast_verbose(VERBOSE_PREFIX_3 "Registered DUNDi peer '%s' at '%s:%d'\n",
dundi_eid_to_str(eid_str, sizeof(eid_str), &peer->eid), dundi_eid_to_str(eid_str, sizeof(eid_str), &peer->eid),
ast_inet_ntoa(trans->addr.sin_addr), ntohs(trans->addr.sin_port)); ast_inet_ntoa(trans->addr.sin_addr), ntohs(trans->addr.sin_port));
}
needqual = 1; needqual = 1;
} }
@ -4796,10 +4794,7 @@ static int load_module(void)
ast_custom_function_register(&dundi_query_function); ast_custom_function_register(&dundi_query_function);
ast_custom_function_register(&dundi_result_function); ast_custom_function_register(&dundi_result_function);
if (option_verbose > 1) { ast_verb(2, "DUNDi Ready and Listening on %s port %d\n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
ast_verbose(VERBOSE_PREFIX_2 "DUNDi Ready and Listening on %s port %d\n",
ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
}
return AST_MODULE_LOAD_SUCCESS; return AST_MODULE_LOAD_SUCCESS;
} }

View File

@ -313,8 +313,7 @@ static void exit_now(GtkWidget *widget, gpointer data)
ast_update_use_count(); ast_update_use_count();
ast_unregister_verbose(verboser); ast_unregister_verbose(verboser);
ast_unload_resource("pbx_gtkconsole", 0); ast_unload_resource("pbx_gtkconsole", 0);
if (option_verbose > 1) ast_verb(2, "GTK Console Monitor Exiting\n");
ast_verbose(VERBOSE_PREFIX_2 "GTK Console Monitor Exiting\n");
/* XXX Trying to quit after calling this makes asterisk segfault XXX */ /* XXX Trying to quit after calling this makes asterisk segfault XXX */
} }
@ -488,15 +487,14 @@ static int load_module(void *mod)
if (!show_console()) { if (!show_console()) {
inuse++; inuse++;
ast_update_use_count(); ast_update_use_count();
if (option_verbose > 1) ast_verb(2, "Launched GTK Console monitor\n");
ast_verbose( VERBOSE_PREFIX_2 "Launched GTK Console monitor\n");
} else } else
ast_log(LOG_WARNING, "Unable to start GTK console\n"); ast_log(LOG_WARNING, "Unable to start GTK console\n");
} else { } else {
if (option_debug) if (option_debug)
ast_log(LOG_DEBUG, "Unable to start GTK console monitor -- ignoring\n"); ast_log(LOG_DEBUG, "Unable to start GTK console monitor -- ignoring\n");
else if (option_verbose > 1) else
ast_verbose( VERBOSE_PREFIX_2 "GTK is not available -- skipping monitor\n"); ast_verb(2, "GTK is not available -- skipping monitor\n");
} }
return 0; return 0;
} }

View File

@ -198,8 +198,7 @@ static int realtime_exec(struct ast_channel *chan, const char *context, const ch
if(!ast_strlen_zero(tmp)) if(!ast_strlen_zero(tmp))
pbx_substitute_variables_helper(chan, tmp, appdata, sizeof(appdata) - 1); pbx_substitute_variables_helper(chan, tmp, appdata, sizeof(appdata) - 1);
if (option_verbose > 2) ast_verb(3, "Executing %s(\"%s\", \"%s\")\n",
ast_verbose( VERBOSE_PREFIX_3 "Executing %s(\"%s\", \"%s\")\n",
term_color(tmp1, app, COLOR_BRCYAN, 0, sizeof(tmp1)), term_color(tmp1, app, COLOR_BRCYAN, 0, sizeof(tmp1)),
term_color(tmp2, chan->name, COLOR_BRMAGENTA, 0, sizeof(tmp2)), term_color(tmp2, chan->name, COLOR_BRMAGENTA, 0, sizeof(tmp2)),
term_color(tmp3, S_OR(appdata, ""), COLOR_BRMAGENTA, 0, sizeof(tmp3))); term_color(tmp3, S_OR(appdata, ""), COLOR_BRMAGENTA, 0, sizeof(tmp3)));

View File

@ -329,12 +329,10 @@ static void *attempt_thread(void *data)
struct outgoing *o = data; struct outgoing *o = data;
int res, reason; int res, reason;
if (!ast_strlen_zero(o->app)) { if (!ast_strlen_zero(o->app)) {
if (option_verbose > 2) ast_verb(3, "Attempting call on %s/%s for application %s(%s) (Retry %d)\n", o->tech, o->dest, o->app, o->data, o->retries);
ast_verbose(VERBOSE_PREFIX_3 "Attempting call on %s/%s for application %s(%s) (Retry %d)\n", o->tech, o->dest, o->app, o->data, o->retries);
res = ast_pbx_outgoing_app(o->tech, AST_FORMAT_SLINEAR, o->dest, o->waittime * 1000, o->app, o->data, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL); res = ast_pbx_outgoing_app(o->tech, AST_FORMAT_SLINEAR, o->dest, o->waittime * 1000, o->app, o->data, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
} else { } else {
if (option_verbose > 2) ast_verb(3, "Attempting call on %s/%s for %s@%s:%d (Retry %d)\n", o->tech, o->dest, o->exten, o->context,o->priority, o->retries);
ast_verbose(VERBOSE_PREFIX_3 "Attempting call on %s/%s for %s@%s:%d (Retry %d)\n", o->tech, o->dest, o->exten, o->context,o->priority, o->retries);
res = ast_pbx_outgoing_exten(o->tech, AST_FORMAT_SLINEAR, o->dest, o->waittime * 1000, o->context, o->exten, o->priority, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL); res = ast_pbx_outgoing_exten(o->tech, AST_FORMAT_SLINEAR, o->dest, o->waittime * 1000, o->context, o->exten, o->priority, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
} }
if (res) { if (res) {

View File

@ -346,8 +346,7 @@ static enum agi_result launch_script(char *script, char *argv[], int *fds, int *
_exit(1); _exit(1);
} }
pthread_sigmask(SIG_SETMASK, &old_set, NULL); pthread_sigmask(SIG_SETMASK, &old_set, NULL);
if (option_verbose > 2) ast_verb(3, "Launched AGI Script %s\n", script);
ast_verbose(VERBOSE_PREFIX_3 "Launched AGI Script %s\n", script);
fds[0] = toast[0]; fds[0] = toast[0];
fds[1] = fromast[1]; fds[1] = fromast[1];
if (efd) if (efd)
@ -584,8 +583,7 @@ static int handle_streamfile(struct ast_channel *chan, AGI *agi, int argc, char
vfs = ast_openvstream(chan, argv[2], chan->language); vfs = ast_openvstream(chan, argv[2], chan->language);
ast_debug(vfs && 1, "Ooh, found a video stream, too\n"); ast_debug(vfs && 1, "Ooh, found a video stream, too\n");
if (option_verbose > 2) ast_verb(3, "Playing '%s' (escape_digits=%s) (sample_offset %ld)\n", argv[2], edigits, sample_offset);
ast_verbose(VERBOSE_PREFIX_3 "Playing '%s' (escape_digits=%s) (sample_offset %ld)\n", argv[2], edigits, sample_offset);
ast_seekstream(fs, 0, SEEK_END); ast_seekstream(fs, 0, SEEK_END);
max_length = ast_tellstream(fs); max_length = ast_tellstream(fs);
@ -640,8 +638,7 @@ static int handle_getoption(struct ast_channel *chan, AGI *agi, int argc, char *
vfs = ast_openvstream(chan, argv[2], chan->language); vfs = ast_openvstream(chan, argv[2], chan->language);
ast_debug(vfs && 1, "Ooh, found a video stream, too\n"); ast_debug(vfs && 1, "Ooh, found a video stream, too\n");
if (option_verbose > 2) ast_verb(3, "Playing '%s' (escape_digits=%s) (timeout %d)\n", argv[2], edigits, timeout);
ast_verbose(VERBOSE_PREFIX_3 "Playing '%s' (escape_digits=%s) (timeout %d)\n", argv[2], edigits, timeout);
ast_seekstream(fs, 0, SEEK_END); ast_seekstream(fs, 0, SEEK_END);
max_length = ast_tellstream(fs); max_length = ast_tellstream(fs);
@ -1096,8 +1093,7 @@ static int handle_exec(struct ast_channel *chan, AGI *agi, int argc, char **argv
if (argc < 2) if (argc < 2)
return RESULT_SHOWUSAGE; return RESULT_SHOWUSAGE;
if (option_verbose > 2) ast_verb(3, "AGI Script Executing Application: (%s) Options: (%s)\n", argv[1], argv[2]);
ast_verbose(VERBOSE_PREFIX_3 "AGI Script Executing Application: (%s) Options: (%s)\n", argv[1], argv[2]);
if ((app = pbx_findapp(argv[1]))) { if ((app = pbx_findapp(argv[1]))) {
res = pbx_exec(chan, app, argv[2]); res = pbx_exec(chan, app, argv[2]);
@ -1870,8 +1866,7 @@ static enum agi_result run_agi(struct ast_channel *chan, char *request, AGI *agi
/* Program terminated */ /* Program terminated */
if (returnstatus && returnstatus != AST_PBX_KEEPALIVE) if (returnstatus && returnstatus != AST_PBX_KEEPALIVE)
returnstatus = -1; returnstatus = -1;
if (option_verbose > 2) ast_verb(3, "AGI Script %s completed, returning %d\n", request, returnstatus);
ast_verbose(VERBOSE_PREFIX_3 "AGI Script %s completed, returning %d\n", request, returnstatus);
if (pid > 0) if (pid > 0)
waitpid(pid, status, 0); waitpid(pid, status, 0);
/* No need to kill the pid anymore, since they closed us */ /* No need to kill the pid anymore, since they closed us */

View File

@ -500,15 +500,13 @@ static SQLHSTMT config_odbc_prepare(struct odbc_obj *obj, void *data)
res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &sth); res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &sth);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) { if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
if (option_verbose > 3) ast_verb(4, "Failure in AllocStatement %d\n", res);
ast_verbose( VERBOSE_PREFIX_4 "Failure in AllocStatement %d\n", res);
return NULL; return NULL;
} }
res = SQLPrepare(sth, (unsigned char *)q->sql, SQL_NTS); res = SQLPrepare(sth, (unsigned char *)q->sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) { if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
if (option_verbose > 3) ast_verb(4, "Error in PREPARE %d\n", res);
ast_verbose( VERBOSE_PREFIX_4 "Error in PREPARE %d\n", res);
SQLFreeHandle(SQL_HANDLE_STMT, sth); SQLFreeHandle(SQL_HANDLE_STMT, sth);
return NULL; return NULL;
} }
@ -615,16 +613,14 @@ static struct ast_config_engine odbc_engine = {
static int unload_module (void) static int unload_module (void)
{ {
ast_config_engine_deregister(&odbc_engine); ast_config_engine_deregister(&odbc_engine);
if (option_verbose) ast_verb(1, "res_config_odbc unloaded.\n");
ast_verbose("res_config_odbc unloaded.\n");
return 0; return 0;
} }
static int load_module (void) static int load_module (void)
{ {
ast_config_engine_register(&odbc_engine); ast_config_engine_register(&odbc_engine);
if (option_verbose) ast_verb(1, "res_config_odbc loaded.\n");
ast_verbose("res_config_odbc loaded.\n");
return 0; return 0;
} }

View File

@ -548,9 +548,7 @@ static int load_module(void)
} }
ast_config_engine_register(&pgsql_engine); ast_config_engine_register(&pgsql_engine);
if (option_verbose) { ast_verb(1, "Postgresql RealTime driver loaded.\n");
ast_verbose("Postgresql RealTime driver loaded.\n");
}
ast_cli_register_multiple(cli_realtime, sizeof(cli_realtime) / sizeof(struct ast_cli_entry)); ast_cli_register_multiple(cli_realtime, sizeof(cli_realtime) / sizeof(struct ast_cli_entry));
ast_mutex_unlock(&pgsql_lock); ast_mutex_unlock(&pgsql_lock);
@ -569,9 +567,7 @@ static int unload_module(void)
}; };
ast_cli_unregister_multiple(cli_realtime, sizeof(cli_realtime) / sizeof(struct ast_cli_entry)); ast_cli_unregister_multiple(cli_realtime, sizeof(cli_realtime) / sizeof(struct ast_cli_entry));
ast_config_engine_deregister(&pgsql_engine); ast_config_engine_deregister(&pgsql_engine);
if (option_verbose) { ast_verb(1, "Postgresql RealTime unloaded.\n");
ast_verbose("Postgresql RealTime unloaded.\n");
}
/* Unlock so something else can destroy the lock. */ /* Unlock so something else can destroy the lock. */
ast_mutex_unlock(&pgsql_lock); ast_mutex_unlock(&pgsql_lock);
@ -596,7 +592,7 @@ static int reload(void)
ast_debug(1, "Postgresql RealTime: Cannot Connect: %s\n", PQerrorMessage(pgsqlConn)); ast_debug(1, "Postgresql RealTime: Cannot Connect: %s\n", PQerrorMessage(pgsqlConn));
} }
ast_verbose(VERBOSE_PREFIX_2 "Postgresql RealTime reloaded.\n"); ast_verb(2, "Postgresql RealTime reloaded.\n");
/* Done reloading. Release lock so others can now use driver. */ /* Done reloading. Release lock so others can now use driver. */
ast_mutex_unlock(&pgsql_lock); ast_mutex_unlock(&pgsql_lock);

View File

@ -247,8 +247,7 @@ static struct ast_key *try_load_key(char *dir, char *fname, int ifd, int ofd, in
if (RSA_size(key->rsa) == 128) { if (RSA_size(key->rsa) == 128) {
/* Key loaded okay */ /* Key loaded okay */
key->ktype &= ~KEY_NEEDS_PASSCODE; key->ktype &= ~KEY_NEEDS_PASSCODE;
if (option_verbose > 2) ast_verb(3, "Loaded %s key '%s'\n", key->ktype == AST_KEY_PUBLIC ? "PUBLIC" : "PRIVATE", key->name);
ast_verbose(VERBOSE_PREFIX_3 "Loaded %s key '%s'\n", key->ktype == AST_KEY_PUBLIC ? "PUBLIC" : "PRIVATE", key->name);
ast_debug(1, "Key '%s' loaded OK\n", key->name); ast_debug(1, "Key '%s' loaded OK\n", key->name);
key->delme = 0; key->delme = 0;
} else } else

View File

@ -434,8 +434,7 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou
AST_LIST_UNLOCK(&parkinglot); AST_LIST_UNLOCK(&parkinglot);
/* Wake up the (presumably select()ing) thread */ /* Wake up the (presumably select()ing) thread */
pthread_kill(parking_thread, SIGURG); pthread_kill(parking_thread, SIGURG);
if (option_verbose > 1) ast_verb(2, "Parked %s on %d@%s. Will timeout back to extension [%s] %s, %d in %d seconds\n", pu->chan->name, pu->parkingnum, parking_con, pu->context, pu->exten, pu->priority, (pu->parkingtime/1000));
ast_verbose(VERBOSE_PREFIX_2 "Parked %s on %d@%s. Will timeout back to extension [%s] %s, %d in %d seconds\n", pu->chan->name, pu->parkingnum, parking_con, pu->context, pu->exten, pu->priority, (pu->parkingtime/1000));
if (pu->parkingnum != -1) if (pu->parkingnum != -1)
snprintf(pu->parkingexten, sizeof(pu->parkingexten), "%d", x); snprintf(pu->parkingexten, sizeof(pu->parkingexten), "%d", x);
@ -602,8 +601,7 @@ static int builtin_automonitor(struct ast_channel *chan, struct ast_channel *pee
} }
if (callee_chan->monitor) { if (callee_chan->monitor) {
if (option_verbose > 3) ast_verb(4, "User hit '%s' to stop recording call.\n", code);
ast_verbose(VERBOSE_PREFIX_3 "User hit '%s' to stop recording call.\n", code);
ast_monitor_stop(callee_chan, 1); ast_monitor_stop(callee_chan, 1);
return FEATURE_RETURN_SUCCESS; return FEATURE_RETURN_SUCCESS;
} }
@ -639,8 +637,7 @@ static int builtin_automonitor(struct ast_channel *chan, struct ast_channel *pee
args[x] = '-'; args[x] = '-';
} }
if (option_verbose > 3) ast_verb(4, "User hit '%s' to record call. filename: %s\n", code, args);
ast_verbose(VERBOSE_PREFIX_3 "User hit '%s' to record call. filename: %s\n", code, args);
pbx_exec(callee_chan, monitor_app, args); pbx_exec(callee_chan, monitor_app, args);
pbx_builtin_setvar_helper(callee_chan, "TOUCH_MONITOR_OUTPUT", touch_filename); pbx_builtin_setvar_helper(callee_chan, "TOUCH_MONITOR_OUTPUT", touch_filename);
@ -655,8 +652,7 @@ static int builtin_automonitor(struct ast_channel *chan, struct ast_channel *pee
static int builtin_disconnect(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense) static int builtin_disconnect(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense)
{ {
if (option_verbose > 3) ast_verb(4, "User hit '%s' to disconnect call.\n", code);
ast_verbose(VERBOSE_PREFIX_3 "User hit '%s' to disconnect call.\n", code);
return FEATURE_RETURN_HANGUP; return FEATURE_RETURN_HANGUP;
} }
@ -742,8 +738,7 @@ static int builtin_blindtransfer(struct ast_channel *chan, struct ast_channel *p
} }
if (!transferee->pbx) { if (!transferee->pbx) {
/* Doh! Use our handy async_goto functions */ /* Doh! Use our handy async_goto functions */
if (option_verbose > 2) ast_verb(3, "Transferring %s to '%s' (context %s) priority 1\n"
ast_verbose(VERBOSE_PREFIX_3 "Transferring %s to '%s' (context %s) priority 1\n"
,transferee->name, xferto, transferer_real_context); ,transferee->name, xferto, transferer_real_context);
if (ast_async_goto(transferee, transferer_real_context, xferto, 1)) if (ast_async_goto(transferee, transferer_real_context, xferto, 1))
ast_log(LOG_WARNING, "Async goto failed :-(\n"); ast_log(LOG_WARNING, "Async goto failed :-(\n");
@ -755,8 +750,7 @@ static int builtin_blindtransfer(struct ast_channel *chan, struct ast_channel *p
check_goto_on_transfer(transferer); check_goto_on_transfer(transferer);
return res; return res;
} else { } else {
if (option_verbose > 2) ast_verb(3, "Unable to find extension '%s' in context '%s'\n", xferto, transferer_real_context);
ast_verbose(VERBOSE_PREFIX_3 "Unable to find extension '%s' in context '%s'\n", xferto, transferer_real_context);
} }
if (ast_stream_and_wait(transferer, xferfailsound, AST_DIGIT_ANY) < 0) { if (ast_stream_and_wait(transferer, xferfailsound, AST_DIGIT_ANY) < 0) {
finishup(transferee); finishup(transferee);
@ -765,8 +759,7 @@ static int builtin_blindtransfer(struct ast_channel *chan, struct ast_channel *p
ast_stopstream(transferer); ast_stopstream(transferer);
res = finishup(transferee); res = finishup(transferee);
if (res) { if (res) {
if (option_verbose > 1) ast_verb(2, "Hungup during autoservice stop on '%s'\n", transferee->name);
ast_verbose(VERBOSE_PREFIX_2 "Hungup during autoservice stop on '%s'\n", transferee->name);
return res; return res;
} }
return FEATURE_RETURN_SUCCESS; return FEATURE_RETURN_SUCCESS;
@ -1040,8 +1033,7 @@ void ast_register_feature(struct ast_call_feature *feature)
AST_LIST_INSERT_HEAD(&feature_list,feature,feature_entry); AST_LIST_INSERT_HEAD(&feature_list,feature,feature_entry);
AST_LIST_UNLOCK(&feature_list); AST_LIST_UNLOCK(&feature_list);
if (option_verbose >= 2) ast_verb(2, "Registered Feature '%s'\n",feature->sname);
ast_verbose(VERBOSE_PREFIX_2 "Registered Feature '%s'\n",feature->sname);
} }
/*! \brief This function must be called while feature_groups is locked... */ /*! \brief This function must be called while feature_groups is locked... */
@ -1066,8 +1058,7 @@ static struct feature_group* register_group(const char *fgname)
AST_LIST_INSERT_HEAD(&feature_groups, fg, entry); AST_LIST_INSERT_HEAD(&feature_groups, fg, entry);
if (option_verbose >= 2) ast_verb(2, "Registered group '%s'\n", fg->gname);
ast_verbose(VERBOSE_PREFIX_2 "Registered group '%s'\n", fg->gname);
return fg; return fg;
} }
@ -1102,8 +1093,7 @@ static void register_group_feature(struct feature_group *fg, const char *exten,
AST_LIST_INSERT_HEAD(&fg->features, fge, entry); AST_LIST_INSERT_HEAD(&fg->features, fge, entry);
if (option_verbose >= 2) ast_verb(2, "Registered feature '%s' for group '%s' at exten '%s'\n",
ast_verbose(VERBOSE_PREFIX_2 "Registered feature '%s' for group '%s' at exten '%s'\n",
feature->sname, fg->gname, exten); feature->sname, fg->gname, exten);
} }
@ -1362,8 +1352,7 @@ static int ast_feature_interpret(struct ast_channel *chan, struct ast_channel *p
/* Feature is up for consideration */ /* Feature is up for consideration */
if (!strcmp(feature->exten, code)) { if (!strcmp(feature->exten, code)) {
if (option_verbose > 2) ast_verb(3, " Feature Found: %s exten: %s\n",feature->sname, tok);
ast_verbose(VERBOSE_PREFIX_3 " Feature Found: %s exten: %s\n",feature->sname, tok);
res = feature->operation(chan, peer, config, code, sense); res = feature->operation(chan, peer, config, code, sense);
AST_LIST_UNLOCK(&feature_list); AST_LIST_UNLOCK(&feature_list);
break; break;
@ -1491,13 +1480,11 @@ static struct ast_channel *ast_feature_request_and_dial(struct ast_channel *call
if (f->frametype == AST_FRAME_CONTROL || f->frametype == AST_FRAME_DTMF || f->frametype == AST_FRAME_TEXT) { if (f->frametype == AST_FRAME_CONTROL || f->frametype == AST_FRAME_DTMF || f->frametype == AST_FRAME_TEXT) {
if (f->subclass == AST_CONTROL_RINGING) { if (f->subclass == AST_CONTROL_RINGING) {
state = f->subclass; state = f->subclass;
if (option_verbose > 2) ast_verb(3, "%s is ringing\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "%s is ringing\n", chan->name);
ast_indicate(caller, AST_CONTROL_RINGING); ast_indicate(caller, AST_CONTROL_RINGING);
} else if ((f->subclass == AST_CONTROL_BUSY) || (f->subclass == AST_CONTROL_CONGESTION)) { } else if ((f->subclass == AST_CONTROL_BUSY) || (f->subclass == AST_CONTROL_CONGESTION)) {
state = f->subclass; state = f->subclass;
if (option_verbose > 2) ast_verb(3, "%s is busy\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "%s is busy\n", chan->name);
ast_indicate(caller, AST_CONTROL_BUSY); ast_indicate(caller, AST_CONTROL_BUSY);
ast_frfree(f); ast_frfree(f);
f = NULL; f = NULL;
@ -1955,8 +1942,7 @@ static void *do_parking_thread(void *ignore)
post_manager_event("ParkedCallTimeOut", pu); post_manager_event("ParkedCallTimeOut", pu);
if (option_verbose > 1) ast_verb(2, "Timeout for %s parked on %d. Returning to %s,%s,%d\n", chan->name, pu->parkingnum, chan->context, chan->exten, chan->priority);
ast_verbose(VERBOSE_PREFIX_2 "Timeout for %s parked on %d. Returning to %s,%s,%d\n", chan->name, pu->parkingnum, chan->context, chan->exten, chan->priority);
/* Start up the PBX, or hang them up */ /* Start up the PBX, or hang them up */
if (ast_pbx_start(chan)) { if (ast_pbx_start(chan)) {
ast_log(LOG_WARNING, "Unable to restart the PBX for user on '%s', hanging them up...\n", chan->name); ast_log(LOG_WARNING, "Unable to restart the PBX for user on '%s', hanging them up...\n", chan->name);
@ -1994,8 +1980,7 @@ static void *do_parking_thread(void *ignore)
post_manager_event("ParkedCallGiveUp", pu); post_manager_event("ParkedCallGiveUp", pu);
/* There's a problem, hang them up*/ /* There's a problem, hang them up*/
if (option_verbose > 1) ast_verb(2, "%s got tired of being parked\n", chan->name);
ast_verbose(VERBOSE_PREFIX_2 "%s got tired of being parked\n", chan->name);
ast_hangup(chan); ast_hangup(chan);
/* And take them out of the parking lot */ /* And take them out of the parking lot */
AST_LIST_REMOVE_CURRENT(&parkinglot, list); AST_LIST_REMOVE_CURRENT(&parkinglot, list);
@ -2177,8 +2162,7 @@ static int park_exec(struct ast_channel *chan, void *data)
} }
/* This runs sorta backwards, since we give the incoming channel control, as if it /* This runs sorta backwards, since we give the incoming channel control, as if it
were the person called. */ were the person called. */
if (option_verbose > 2) ast_verb(3, "Channel %s connected to parked call %d\n", chan->name, park);
ast_verbose(VERBOSE_PREFIX_3 "Channel %s connected to parked call %d\n", chan->name, park);
pbx_builtin_setvar_helper(chan, "PARKEDCHANNEL", peer->name); pbx_builtin_setvar_helper(chan, "PARKEDCHANNEL", peer->name);
ast_cdr_setdestchan(chan->cdr, peer->name); ast_cdr_setdestchan(chan->cdr, peer->name);
@ -2204,8 +2188,7 @@ static int park_exec(struct ast_channel *chan, void *data)
/*! \todo XXX Play a message XXX */ /*! \todo XXX Play a message XXX */
if (ast_stream_and_wait(chan, "pbx-invalidpark", "")) if (ast_stream_and_wait(chan, "pbx-invalidpark", ""))
ast_log(LOG_WARNING, "ast_streamfile of %s failed on %s\n", "pbx-invalidpark", chan->name); ast_log(LOG_WARNING, "ast_streamfile of %s failed on %s\n", "pbx-invalidpark", chan->name);
if (option_verbose > 2) ast_verb(3, "Channel %s tried to talk to nonexistent parked call %d\n", chan->name, park);
ast_verbose(VERBOSE_PREFIX_3 "Channel %s tried to talk to nonexistent parked call %d\n", chan->name, park);
res = -1; res = -1;
} }
@ -2810,8 +2793,7 @@ static int load_config(void)
ast_register_feature(feature); ast_register_feature(feature);
if (option_verbose >= 1) ast_verb(2, "Mapping Feature '%s' to app '%s(%s)' with code '%s'\n", var->name, app, app_args, exten);
ast_verbose(VERBOSE_PREFIX_2 "Mapping Feature '%s' to app '%s(%s)' with code '%s'\n", var->name, app, app_args, exten);
} }
ast_unregister_groups(); ast_unregister_groups();

View File

@ -1389,39 +1389,37 @@ static void aji_handle_presence(struct aji_client *client, ikspak *pak)
iks_delete(iq); iks_delete(iq);
} }
} }
if (option_verbose > 4) {
switch (pak->subtype) { switch (pak->subtype) {
case IKS_TYPE_AVAILABLE: case IKS_TYPE_AVAILABLE:
ast_verbose(VERBOSE_PREFIX_3 "JABBER: I am available ^_* %i\n", pak->subtype); ast_verb(5, "JABBER: I am available ^_* %i\n", pak->subtype);
break; break;
case IKS_TYPE_UNAVAILABLE: case IKS_TYPE_UNAVAILABLE:
ast_verbose(VERBOSE_PREFIX_3 "JABBER: I am unavailable ^_* %i\n", pak->subtype); ast_verb(5, "JABBER: I am unavailable ^_* %i\n", pak->subtype);
break; break;
default: default:
ast_verbose(VERBOSE_PREFIX_3 "JABBER: Ohh sexy and the wrong type: %i\n", pak->subtype); ast_verb(5, "JABBER: Ohh sexy and the wrong type: %i\n", pak->subtype);
} }
switch (pak->show) { switch (pak->show) {
case IKS_SHOW_UNAVAILABLE: case IKS_SHOW_UNAVAILABLE:
ast_verbose(VERBOSE_PREFIX_3 "JABBER: type: %i subtype %i\n", pak->subtype, pak->show); ast_verb(5, "JABBER: type: %i subtype %i\n", pak->subtype, pak->show);
break; break;
case IKS_SHOW_AVAILABLE: case IKS_SHOW_AVAILABLE:
ast_verbose(VERBOSE_PREFIX_3 "JABBER: type is available\n"); ast_verb(5, "JABBER: type is available\n");
break; break;
case IKS_SHOW_CHAT: case IKS_SHOW_CHAT:
ast_verbose(VERBOSE_PREFIX_3 "JABBER: type: %i subtype %i\n", pak->subtype, pak->show); ast_verb(5, "JABBER: type: %i subtype %i\n", pak->subtype, pak->show);
break; break;
case IKS_SHOW_AWAY: case IKS_SHOW_AWAY:
ast_verbose(VERBOSE_PREFIX_3 "JABBER: type is away\n"); ast_verb(5, "JABBER: type is away\n");
break; break;
case IKS_SHOW_XA: case IKS_SHOW_XA:
ast_verbose(VERBOSE_PREFIX_3 "JABBER: type: %i subtype %i\n", pak->subtype, pak->show); ast_verb(5, "JABBER: type: %i subtype %i\n", pak->subtype, pak->show);
break; break;
case IKS_SHOW_DND: case IKS_SHOW_DND:
ast_verbose(VERBOSE_PREFIX_3 "JABBER: type: %i subtype %i\n", pak->subtype, pak->show); ast_verb(5, "JABBER: type: %i subtype %i\n", pak->subtype, pak->show);
break; break;
default: default:
ast_verbose(VERBOSE_PREFIX_3 "JABBER: Kinky! how did that happen %i\n", pak->show); ast_verb(5, "JABBER: Kinky! how did that happen %i\n", pak->show);
}
} }
} }
@ -1455,26 +1453,24 @@ static void aji_handle_subscribe(struct aji_client *client, ikspak *pak)
if(client->component) if(client->component)
aji_set_presence(client, pak->from->full, iks_find_attrib(pak->x, "to"), 1, client->statusmessage); aji_set_presence(client, pak->from->full, iks_find_attrib(pak->x, "to"), 1, client->statusmessage);
} }
if (option_verbose > 4) {
switch (pak->subtype) { switch (pak->subtype) {
case IKS_TYPE_SUBSCRIBE: case IKS_TYPE_SUBSCRIBE:
ast_verbose(VERBOSE_PREFIX_3 "JABBER: This is a subcription of type %i\n", pak->subtype); ast_verb(5, "JABBER: This is a subcription of type %i\n", pak->subtype);
break; break;
case IKS_TYPE_SUBSCRIBED: case IKS_TYPE_SUBSCRIBED:
ast_verbose(VERBOSE_PREFIX_3 "JABBER: This is a subcription of type %i\n", pak->subtype); ast_verb(5, "JABBER: This is a subcription of type %i\n", pak->subtype);
break; break;
case IKS_TYPE_UNSUBSCRIBE: case IKS_TYPE_UNSUBSCRIBE:
ast_verbose(VERBOSE_PREFIX_3 "JABBER: This is a subcription of type %i\n", pak->subtype); ast_verb(5, "JABBER: This is a subcription of type %i\n", pak->subtype);
break; break;
case IKS_TYPE_UNSUBSCRIBED: case IKS_TYPE_UNSUBSCRIBED:
ast_verbose(VERBOSE_PREFIX_3 "JABBER: This is a subcription of type %i\n", pak->subtype); ast_verb(5, "JABBER: This is a subcription of type %i\n", pak->subtype);
break; break;
default: /*IKS_TYPE_ERROR: */ default: /*IKS_TYPE_ERROR: */
ast_verbose(VERBOSE_PREFIX_3 "JABBER: This is a subcription of type %i\n", pak->subtype); ast_verb(5, "JABBER: This is a subcription of type %i\n", pak->subtype);
break; break;
} }
} }
}
/*! /*!
* \brief sends messages. * \brief sends messages.
@ -1605,8 +1601,7 @@ static void *aji_recv_loop(void *data)
do { do {
if (res != IKS_OK) { if (res != IKS_OK) {
while(res != IKS_OK) { while(res != IKS_OK) {
if(option_verbose > 3) ast_verb(4, "JABBER: reconnecting.\n");
ast_verbose("JABBER: reconnecting.\n");
res = aji_reconnect(client); res = aji_reconnect(client);
sleep(4); sleep(4);
} }
@ -1968,8 +1963,7 @@ static int aji_initialize(struct aji_client *client)
int ast_aji_disconnect(struct aji_client *client) int ast_aji_disconnect(struct aji_client *client)
{ {
if (client) { if (client) {
if (option_verbose > 3) ast_verb(4, "JABBER: Disconnecting\n");
ast_verbose(VERBOSE_PREFIX_3 "JABBER: Disconnecting\n");
iks_disconnect(client->p); iks_disconnect(client->p);
iks_parser_delete(client->p); iks_parser_delete(client->p);
ASTOBJ_UNREF(client, aji_client_destroy); ASTOBJ_UNREF(client, aji_client_destroy);

View File

@ -202,8 +202,7 @@ static void moh_files_release(struct ast_channel *chan, void *data)
ast_closestream(chan->stream); ast_closestream(chan->stream);
chan->stream = NULL; chan->stream = NULL;
} }
if (option_verbose > 2) ast_verb(3, "Stopped music on hold on %s\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Stopped music on hold on %s\n", chan->name);
if (state->origwfmt && ast_set_write_format(chan, state->origwfmt)) { if (state->origwfmt && ast_set_write_format(chan, state->origwfmt)) {
ast_log(LOG_WARNING, "Unable to restore channel '%s' to format '%d'\n", chan->name, state->origwfmt); ast_log(LOG_WARNING, "Unable to restore channel '%s' to format '%d'\n", chan->name, state->origwfmt);
@ -318,8 +317,7 @@ static void *moh_files_alloc(struct ast_channel *chan, void *params)
state->origwfmt = chan->writeformat; state->origwfmt = chan->writeformat;
if (option_verbose > 2) ast_verb(3, "Started music on hold, class '%s', on %s\n", class->name, chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Started music on hold, class '%s', on %s\n", class->name, chan->name);
} }
return chan->music_state; return chan->music_state;
@ -719,8 +717,7 @@ static void moh_release(struct ast_channel *chan, void *data)
if (chan) { if (chan) {
if (oldwfmt && ast_set_write_format(chan, oldwfmt)) if (oldwfmt && ast_set_write_format(chan, oldwfmt))
ast_log(LOG_WARNING, "Unable to restore channel '%s' to format %s\n", chan->name, ast_getformatname(oldwfmt)); ast_log(LOG_WARNING, "Unable to restore channel '%s' to format %s\n", chan->name, ast_getformatname(oldwfmt));
if (option_verbose > 2) ast_verb(3, "Stopped music on hold on %s\n", chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Stopped music on hold on %s\n", chan->name);
} }
} }
@ -736,8 +733,7 @@ static void *moh_alloc(struct ast_channel *chan, void *params)
moh_release(NULL, res); moh_release(NULL, res);
res = NULL; res = NULL;
} }
if (option_verbose > 2) ast_verb(3, "Started music on hold, class '%s', on channel '%s'\n", class->name, chan->name);
ast_verbose(VERBOSE_PREFIX_3 "Started music on hold, class '%s', on channel '%s'\n", class->name, chan->name);
} }
return res; return res;
} }
@ -1091,8 +1087,7 @@ static void ast_moh_destroy(void)
char buff[8192]; char buff[8192];
int bytes, tbytes = 0, stime = 0, pid = 0; int bytes, tbytes = 0, stime = 0, pid = 0;
if (option_verbose > 1) ast_verb(2, "Destroying musiconhold processes\n");
ast_verbose(VERBOSE_PREFIX_2 "Destroying musiconhold processes\n");
AST_RWLIST_WRLOCK(&mohclasses); AST_RWLIST_WRLOCK(&mohclasses);
while ((moh = AST_RWLIST_REMOVE_HEAD(&mohclasses, list))) { while ((moh = AST_RWLIST_REMOVE_HEAD(&mohclasses, list))) {

View File

@ -668,8 +668,7 @@ static int smdi_load(int reload)
iface->msg_expiry = msg_expiry; iface->msg_expiry = msg_expiry;
/* start the listner thread */ /* start the listner thread */
if (option_verbose > 2) ast_verb(3, "Starting SMDI monitor thread for %s\n", iface->name);
ast_verbose(VERBOSE_PREFIX_3 "Starting SMDI monitor thread for %s\n", iface->name);
if (ast_pthread_create_background(&iface->thread, NULL, smdi_read, iface)) { if (ast_pthread_create_background(&iface->thread, NULL, smdi_read, iface)) {
ast_log(LOG_ERROR, "Error starting SMDI monitor thread for %s\n", iface->name); ast_log(LOG_ERROR, "Error starting SMDI monitor thread for %s\n", iface->name);
ASTOBJ_UNREF(iface, ast_smdi_interface_destroy); ASTOBJ_UNREF(iface, ast_smdi_interface_destroy);

View File

@ -99,7 +99,7 @@ static int load_module(void)
if(!load_config()) if(!load_config())
return AST_MODULE_LOAD_DECLINE; return AST_MODULE_LOAD_DECLINE;
ast_verbose(VERBOSE_PREFIX_1 "Loading [Sub]Agent Module\n"); ast_verb(1, "Loading [Sub]Agent Module\n");
res_snmp_dont_stop = 1; res_snmp_dont_stop = 1;
if (res_snmp_enabled) if (res_snmp_enabled)
@ -110,7 +110,7 @@ static int load_module(void)
static int unload_module(void) static int unload_module(void)
{ {
ast_verbose(VERBOSE_PREFIX_1 "Unloading [Sub]Agent Module\n"); ast_verb(1, "Unloading [Sub]Agent Module\n");
res_snmp_dont_stop = 0; res_snmp_dont_stop = 0;
return ((thread != AST_PTHREADT_NULL) ? pthread_join(thread, NULL) : 0); return ((thread != AST_PTHREADT_NULL) ? pthread_join(thread, NULL) : 0);

View File

@ -274,16 +274,14 @@ int ast_speech_register(struct ast_speech_engine *engine)
return -1; return -1;
} }
if (option_verbose > 1) ast_verb(2, "Registered speech recognition engine '%s'\n", engine->name);
ast_verbose(VERBOSE_PREFIX_2 "Registered speech recognition engine '%s'\n", engine->name);
/* Add to the engine linked list and make default if needed */ /* Add to the engine linked list and make default if needed */
AST_RWLIST_WRLOCK(&engines); AST_RWLIST_WRLOCK(&engines);
AST_RWLIST_INSERT_HEAD(&engines, engine, list); AST_RWLIST_INSERT_HEAD(&engines, engine, list);
if (!default_engine) { if (!default_engine) {
default_engine = engine; default_engine = engine;
if (option_verbose > 1) ast_verb(2, "Made '%s' the default speech recognition engine\n", engine->name);
ast_verbose(VERBOSE_PREFIX_2 "Made '%s' the default speech recognition engine\n", engine->name);
} }
AST_RWLIST_UNLOCK(&engines); AST_RWLIST_UNLOCK(&engines);
@ -307,8 +305,7 @@ int ast_speech_unregister(char *engine_name)
/* If this was the default engine, we need to pick a new one */ /* If this was the default engine, we need to pick a new one */
if (!default_engine) if (!default_engine)
default_engine = AST_RWLIST_FIRST(&engines); default_engine = AST_RWLIST_FIRST(&engines);
if (option_verbose > 1) ast_verb(2, "Unregistered speech recognition engine '%s'\n", engine_name);
ast_verbose(VERBOSE_PREFIX_2 "Unregistered speech recognition engine '%s'\n", engine_name);
/* All went well */ /* All went well */
res = 0; res = 0;
break; break;