/* Now begin the download attempt */
if (ast_adsi_begin_download(chan, scr->desc, scr->fdn, scr->sec, scr->ver)) {
/* User rejected us for some reason */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "User rejected download attempt\n");
+ ast_verb(3, "User rejected download attempt\n");
ast_log(LOG_NOTICE, "User rejected download on channel %s\n", chan->name);
ast_free(scr);
return -1;
return -1;
if (ast_adsi_end_download(chan)) {
/* Download failed for some reason */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Download attempt failed\n");
+ ast_verb(3, "Download attempt failed\n");
ast_log(LOG_NOTICE, "Download failed on %s\n", chan->name);
ast_free(scr);
return -1;
data = "asterisk.adsi";
if (!ast_adsi_available(chan)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "ADSI Unavailable on CPE. Not bothering to try.\n");
+ ast_verb(3, "ADSI Unavailable on CPE. Not bothering to try.\n");
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "ADSI Available on CPE. Attempting Upload.\n");
+ ast_verb(3, "ADSI Available on CPE. Attempting Upload.\n");
res = adsi_prog(chan, data);
}
res = ast_db_get(db_family, key, value, sizeof(value) - 1);
if(res){
- if(option_verbose >= 4)
- ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Creating database entry %s and setting to 1\n", key);
+ ast_verb(4, "AlarmReceiver: Creating database entry %s and setting to 1\n", key);
/* Guess we have to create it */
res = ast_db_put(db_family, key, "1");
return;
break;
}
if (ast_write(chan, &wf)){
- if(option_verbose >= 4)
- ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Failed to write frame on %s\n", chan->name);
+ ast_verb(4, "AlarmReceiver: Failed to write frame on %s\n", chan->name);
ast_log(LOG_WARNING, "AlarmReceiver Failed to write frame on %s\n",chan->name);
res = -1;
ast_frfree(f);
got_some_digits = 1;
- if (option_verbose >= 2)
- ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Received Event %s\n", event);
+ ast_verb(2, "AlarmReceiver: Received Event %s\n", event);
ast_debug(1, "AlarmReceiver: Received event: %s\n", event);
/* Calculate checksum */
}
if(i == 16){
- if(option_verbose >= 2)
- ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Bad DTMF character %c, trying again\n", event[j]);
+ ast_verb(2, "AlarmReceiver: Bad DTMF character %c, trying again\n", event[j]);
continue; /* Bad character */
}
if (checksum) {
database_increment("checksum-errors");
- if (option_verbose >= 2)
- ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Nonzero checksum\n");
+ ast_verb(2, "AlarmReceiver: Nonzero checksum\n");
ast_debug(1, "AlarmReceiver: Nonzero checksum\n");
continue;
}
if(strncmp(event + 4, "18", 2)){
if(strncmp(event + 4, "98", 2)){
database_increment("format-errors");
- if(option_verbose >= 2)
- ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Wrong message type\n");
+ ast_verb(2, "AlarmReceiver: Wrong message type\n");
ast_debug(1, "AlarmReceiver: Wrong message type\n");
continue;
}
/* Set write and read formats to ULAW */
- if(option_verbose >= 4)
- ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Setting read and write formats to ULAW\n");
+ ast_verb(4, "AlarmReceiver: Setting read and write formats to ULAW\n");
if (ast_set_write_format(chan,AST_FORMAT_ULAW)){
ast_log(LOG_WARNING, "AlarmReceiver: Unable to set write format to Mu-law on %s\n",chan->name);
/* Answer the channel if it is not already */
- if(option_verbose >= 4)
- ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Answering channel\n");
+ ast_verb(4, "AlarmReceiver: Answering channel\n");
if (chan->_state != AST_STATE_UP) {
if ((res = ast_answer(chan)))
/* Wait for the connection to settle post-answer */
- if(option_verbose >= 4)
- ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Waiting for connection to stabilize\n");
+ ast_verb(4, "AlarmReceiver: Waiting for connection to stabilize\n");
res = ast_safe_sleep(chan, 1250);
AST_APP_ARG(argSilenceThreshold);
);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "AMD: %s %s %s (Fmt: %d)\n", chan->name ,chan->cid.cid_ani, chan->cid.cid_rdnis, chan->readformat);
+ ast_verb(3, "AMD: %s %s %s (Fmt: %d)\n", chan->name ,chan->cid.cid_ani, chan->cid.cid_rdnis, chan->readformat);
/* Lets parse the arguments. */
if (!ast_strlen_zero(parse)) {
}
/* Now we're ready to roll! */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "AMD: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
+ ast_verb(3, "AMD: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
"totalAnalysisTime [%d] minimumWordLength [%d] betweenWordsSilence [%d] maximumNumberOfWords [%d] silenceThreshold [%d] \n",
initialSilence, greeting, afterGreetingSilence, totalAnalysisTime,
minimumWordLength, betweenWordsSilence, maximumNumberOfWords, silenceThreshold );
while ((res = ast_waitfor(chan, totalAnalysisTime)) > -1) {
/* If we fail to read in a frame, that means they hung up */
if (!(f = ast_read(chan))) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "AMD: HANGUP\n");
+ ast_verb(3, "AMD: HANGUP\n");
ast_debug(1, "Got hangup\n");
strcpy(amdStatus, "HANGUP");
break;
}
if (silenceDuration >= afterGreetingSilence && inGreeting == 1) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "AMD: HUMAN: silenceDuration:%d afterGreetingSilence:%d\n",
+ ast_verb(3, "AMD: HUMAN: silenceDuration:%d afterGreetingSilence:%d\n",
silenceDuration, afterGreetingSilence);
ast_frfree(f);
strcpy(amdStatus , "HUMAN");
}
if (inGreeting == 1 && voiceDuration >= greeting) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "AMD: ANSWERING MACHINE: voiceDuration:%d greeting:%d\n", voiceDuration, greeting);
+ ast_verb(3, "AMD: ANSWERING MACHINE: voiceDuration:%d greeting:%d\n", voiceDuration, greeting);
ast_frfree(f);
strcpy(amdStatus , "MACHINE");
sprintf(amdCause , "LONGGREETING-%d-%d", voiceDuration, greeting);
if (!res) {
/* It took too long to get a frame back. Giving up. */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "AMD: Channel [%s]. Too long...\n", chan->name);
+ ast_verb(3, "AMD: Channel [%s]. Too long...\n", chan->name);
strcpy(amdStatus , "NOTSURE");
sprintf(amdCause , "TOOLONG-%d", iTotalTime);
}
ast_config_destroy(cfg);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "AMD defaults: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
+ ast_verb(3, "AMD defaults: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
"totalAnalysisTime [%d] minimumWordLength [%d] betweenWordsSilence [%d] maximumNumberOfWords [%d] silenceThreshold [%d] \n",
dfltInitialSilence, dfltGreeting, dfltAfterGreetingSilence, dfltTotalAnalysisTime,
dfltMinimumWordLength, dfltBetweenWordsSilence, dfltMaximumNumberOfWords, dfltSilenceThreshold );
return 0;
name = ast_strdupa(spyee->name);
- if (option_verbose >= 2)
- ast_verbose(VERBOSE_PREFIX_2 "Spying on channel %s\n", name);
+ ast_verb(2, "Spying on channel %s\n", name);
memset(&csth, 0, sizeof(csth));
ast_set_flag(&csth.spy, CHANSPY_FORMAT_AUDIO);
(*volfactor)++;
if (*volfactor > 4)
*volfactor = -4;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Setting spy volume on %s to %d\n", chan->name, *volfactor);
+ ast_verb(3, "Setting spy volume on %s to %d\n", chan->name, *volfactor);
csth.volfactor = *volfactor;
set_volume(chan, &csth);
if (csth.volfactor) {
keytree = 0;
}
- if (option_verbose > 2) {
if (keytree)
- ast_verbose(VERBOSE_PREFIX_3 "DBdeltree: family=%s, keytree=%s\n", family, keytree);
+ ast_verb(3, "DBdeltree: family=%s, keytree=%s\n", family, keytree);
else
- ast_verbose(VERBOSE_PREFIX_3 "DBdeltree: family=%s\n", family);
- }
+ ast_verb(3, "DBdeltree: family=%s\n", family);
- if (ast_db_deltree(family, keytree)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "DBdeltree: Error deleting key from database.\n");
- }
+ if (ast_db_deltree(family, keytree))
+ ast_verb(3, "DBdeltree: Error deleting key from database.\n");
return 0;
}
ast_debug(1, "Ignoring; Syntax error in argument\n");
return 0;
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "DBdel: family=%s, key=%s\n", family, key);
- if (ast_db_del(family, key)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "DBdel: Error deleting key from database.\n");
- }
+ ast_verb(3, "DBdel: family=%s, key=%s\n", family, key);
+ if (ast_db_del(family, key))
+ ast_verb(3, "DBdel: Error deleting key from database.\n");
} else {
ast_debug(1, "Ignoring, no parameters\n");
}
/* Before processing channel, go ahead and check for forwarding */
o->forwards++;
if (o->forwards < AST_MAX_FORWARDS) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, c->name);
+ ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, c->name);
/* If we have been told to ignore forwards, just set this channel to null and continue processing extensions normally */
if (ast_test_flag64(peerflags, OPT_IGNORE_FORWARDING)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s/%s' prevented.\n", in->name, tech, stuff);
+ ast_verb(3, "Forwarding %s to '%s/%s' prevented.\n", in->name, tech, stuff);
c = o->chan = NULL;
cause = AST_CAUSE_BUSY;
} else {
ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
}
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", c->name);
+ ast_verb(3, "Too many forwards from %s\n", c->name);
cause = AST_CAUSE_CONGESTION;
c = o->chan = NULL;
}
}
if (pos == 1) { /* only the input channel is available */
if (numlines == (num.busy + num.congestion + num.nochan)) {
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_2 "Everyone is busy/congested at this time (%d:%d/%d/%d)\n", numlines, num.busy, num.congestion, num.nochan);
+ ast_verb(2, "Everyone is busy/congested at this time (%d:%d/%d/%d)\n", numlines, num.busy, num.congestion, num.nochan);
if (num.busy)
strcpy(pa->status, "BUSY");
else if (num.congestion)
else if (num.nochan)
strcpy(pa->status, "CHANUNAVAIL");
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "No one is available to answer at this time (%d:%d/%d/%d)\n", numlines, num.busy, num.congestion, num.nochan);
+ ast_verb(3, "No one is available to answer at this time (%d:%d/%d/%d)\n", numlines, num.busy, num.congestion, num.nochan);
}
*to = 0;
return NULL;
continue;
if (ast_test_flag64(o, DIAL_STILLGOING) && c->_state == AST_STATE_UP) {
if (!peer) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s answered %s\n", c->name, in->name);
+ ast_verb(3, "%s answered %s\n", c->name, in->name);
peer = c;
ast_copy_flags64(peerflags, o,
OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
case AST_CONTROL_ANSWER:
/* This is our guy if someone answered. */
if (!peer) {
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", c->name, in->name);
+ ast_verb(3, "%s answered %s\n", c->name, in->name);
peer = c;
ast_copy_flags64(peerflags, o,
OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
c->hangupcause = AST_CAUSE_NORMAL_CLEARING;
break;
case AST_CONTROL_BUSY:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s is busy\n", c->name);
+ ast_verb(3, "%s is busy\n", c->name);
in->hangupcause = c->hangupcause;
ast_hangup(c);
c = o->chan = NULL;
handle_cause(AST_CAUSE_BUSY, &num);
break;
case AST_CONTROL_CONGESTION:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s is circuit-busy\n", c->name);
+ ast_verb(3, "%s is circuit-busy\n", c->name);
in->hangupcause = c->hangupcause;
ast_hangup(c);
c = o->chan = NULL;
handle_cause(AST_CAUSE_CONGESTION, &num);
break;
case AST_CONTROL_RINGING:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s is ringing\n", c->name);
+ ast_verb(3, "%s is ringing\n", c->name);
/* Setup early media if appropriate */
if (single)
ast_channel_early_bridge(in, c);
}
break;
case AST_CONTROL_PROGRESS:
- if (option_verbose > 2)
- ast_verbose (VERBOSE_PREFIX_3 "%s is making progress passing it to %s\n", c->name, in->name);
+ ast_verb(3, "%s is making progress passing it to %s\n", c->name, in->name);
/* Setup early media if appropriate */
if (single)
ast_channel_early_bridge(in, c);
ast_indicate(in, AST_CONTROL_PROGRESS);
break;
case AST_CONTROL_VIDUPDATE:
- if (option_verbose > 2)
- ast_verbose (VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", c->name, in->name);
+ ast_verb(3, "%s requested a video update, passing it to %s\n", c->name, in->name);
ast_indicate(in, AST_CONTROL_VIDUPDATE);
break;
case AST_CONTROL_PROCEEDING:
- if (option_verbose > 2)
- ast_verbose (VERBOSE_PREFIX_3 "%s is proceeding passing it to %s\n", c->name, in->name);
+ ast_verb(3, "%s is proceeding passing it to %s\n", c->name, in->name);
if (single)
ast_channel_early_bridge(in, c);
if (!ast_test_flag64(outgoing, OPT_RINGBACK))
ast_indicate(in, AST_CONTROL_PROCEEDING);
break;
case AST_CONTROL_HOLD:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Call on %s placed on hold\n", c->name);
+ ast_verb(3, "Call on %s placed on hold\n", c->name);
ast_indicate(in, AST_CONTROL_HOLD);
break;
case AST_CONTROL_UNHOLD:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Call on %s left from hold\n", c->name);
+ ast_verb(3, "Call on %s left from hold\n", c->name);
ast_indicate(in, AST_CONTROL_UNHOLD);
break;
case AST_CONTROL_OFFHOOK:
break;
case -1:
if (!ast_test_flag64(outgoing, OPT_RINGBACK | OPT_MUSICBACK)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s stopped sounds\n", c->name);
+ ast_verb(3, "%s stopped sounds\n", c->name);
ast_indicate(in, -1);
pa->sentringing = 0;
}
if (ast_test_flag64(peerflags, OPT_DTMF_EXIT)) {
const char *context = pbx_builtin_getvar_helper(in, "EXITCONTEXT");
if (onedigit_goto(in, context, (char) f->subclass, 1)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
+ ast_verb(3, "User hit %c to disconnect call.\n", f->subclass);
*to=0;
ast_cdr_noanswer(in->cdr);
*result = f->subclass;
if (ast_test_flag64(peerflags, OPT_CALLER_HANGUP) &&
(f->subclass == '*')) { /* hmm it it not guaranteed to be '*' anymore. */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
+ ast_verb(3, "User hit %c to disconnect call.\n", f->subclass);
*to=0;
strcpy(pa->status, "CANCEL");
ast_cdr_noanswer(in->cdr);
((f->subclass == AST_CONTROL_HOLD) ||
(f->subclass == AST_CONTROL_UNHOLD) ||
(f->subclass == AST_CONTROL_VIDUPDATE))) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s requested special control %d, passing it to %s\n", in->name, f->subclass, outgoing->chan->name);
+ ast_verb(3, "%s requested special control %d, passing it to %s\n", in->name, f->subclass, outgoing->chan->name);
ast_indicate_data(outgoing->chan, f->subclass, f->data, f->datalen);
}
ast_frfree(f);
}
- if (!*to && (option_verbose > 2))
- ast_verbose(VERBOSE_PREFIX_3 "Nobody picked up in %d ms\n", orig);
+ if (!*to)
+ ast_verb(3, "Nobody picked up in %d ms\n", orig);
if (!*to || ast_check_hangup(in)) {
ast_cdr_noanswer(in->cdr);
}
/* more efficient to do it like S(x) does since no advanced opts */
if (!config->play_warning && !config->start_sound && !config->end_sound && config->timelimit) {
*calldurationlimit = config->timelimit / 1000;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Setting call duration limit to %d seconds.\n",
+ ast_verb(3, "Setting call duration limit to %d seconds.\n",
*calldurationlimit);
config->timelimit = play_to_caller = play_to_callee =
config->play_warning = config->warning_freq = 0;
- } else if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Limit Data for this call:\n");
- ast_verbose(VERBOSE_PREFIX_4 "timelimit = %ld\n", config->timelimit);
- ast_verbose(VERBOSE_PREFIX_4 "play_warning = %ld\n", config->play_warning);
- ast_verbose(VERBOSE_PREFIX_4 "play_to_caller = %s\n", play_to_caller ? "yes" : "no");
- ast_verbose(VERBOSE_PREFIX_4 "play_to_callee = %s\n", play_to_callee ? "yes" : "no");
- ast_verbose(VERBOSE_PREFIX_4 "warning_freq = %ld\n", config->warning_freq);
- ast_verbose(VERBOSE_PREFIX_4 "start_sound = %s\n", S_OR(config->start_sound, ""));
- ast_verbose(VERBOSE_PREFIX_4 "warning_sound = %s\n", config->warning_sound);
- ast_verbose(VERBOSE_PREFIX_4 "end_sound = %s\n", S_OR(config->end_sound, ""));
+ } else {
+ ast_verb(3, "Limit Data for this call:\n");
+ ast_verb(4, "timelimit = %ld\n", config->timelimit);
+ ast_verb(4, "play_warning = %ld\n", config->play_warning);
+ ast_verb(4, "play_to_caller = %s\n", play_to_caller ? "yes" : "no");
+ ast_verb(4, "play_to_callee = %s\n", play_to_callee ? "yes" : "no");
+ ast_verb(4, "warning_freq = %ld\n", config->warning_freq);
+ ast_verb(4, "start_sound = %s\n", S_OR(config->start_sound, ""));
+ ast_verb(4, "warning_sound = %s\n", config->warning_sound);
+ ast_verb(4, "end_sound = %s\n", S_OR(config->end_sound, ""));
}
if (play_to_caller)
ast_set_flag(&(config->features_caller), AST_FEATURE_PLAY_WARNING);
static const char *_val[] = { "ALLOW", "DENY", "TORTURE", "KILL", "ALLOW" };
static const int _flag[] = { AST_PRIVACY_ALLOW, AST_PRIVACY_DENY, AST_PRIVACY_TORTURE, AST_PRIVACY_KILL, AST_PRIVACY_ALLOW};
int i = res2 - '1';
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to %s\n",
+ ast_verb(3, "--Set privacy database entry %s/%s to %s\n",
opt_args[OPT_ARG_PRIVACY], pa->privcid, _val[i]);
ast_privacy_set(opt_args[OPT_ARG_PRIVACY], pa->privcid, _flag[i]);
}
ast_filedelete(pa->privintro, NULL);
if( ast_fileexists(pa->privintro, NULL, NULL ) > 0 )
ast_log(LOG_NOTICE, "privacy: ast_filedelete didn't do its job on %s\n", pa->privintro);
- else if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Successfully deleted %s intro file\n", pa->privintro);
+ else
+ ast_verb(3, "Successfully deleted %s intro file\n", pa->privintro);
}
return 0; /* the good exit path */
} else {
l = ast_strdupa(chan->cid.cid_num);
ast_shrink_phone_number(l);
if (ast_test_flag64(opts, OPT_PRIVACY) ) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Privacy DB is '%s', clid is '%s'\n",
+ ast_verb(3, "Privacy DB is '%s', clid is '%s'\n",
opt_args[OPT_ARG_PRIVACY], l);
pa->privdb_val = ast_privacy_check(opt_args[OPT_ARG_PRIVACY], l);
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Privacy Screening, clid is '%s'\n", l);
+ ast_verb(3, "Privacy Screening, clid is '%s'\n", l);
pa->privdb_val = AST_PRIVACY_UNKNOWN;
}
} else {
if (*tn2=='/') /* any other chars to be afraid of? */
*tn2 = '=';
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Privacy-- callerid is empty\n");
+ ast_verb(3, "Privacy-- callerid is empty\n");
snprintf(callerid, sizeof(callerid), "NOCALLERID_%s%s", chan->exten, tnam);
l = callerid;
ast_filedelete(pa->privintro, NULL);
if (ast_fileexists(pa->privintro,NULL,NULL ) > 0 )
ast_log(LOG_NOTICE,"privacy: ast_filedelete didn't do its job on %s\n", pa->privintro);
- else if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Successfully deleted %s intro file\n", pa->privintro);
+ else
+ ast_verb(3, "Successfully deleted %s intro file\n", pa->privintro);
return -1;
}
if (!ast_streamfile(chan, "vm-dialout", chan->language) )
if (ast_test_flag64(&opts, OPT_OPERMODE)) {
opermode = ast_strlen_zero(opt_args[OPT_ARG_OPERMODE]) ? 1 : atoi(opt_args[OPT_ARG_OPERMODE]);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Setting operator services mode to %d.\n", opermode);
+ ast_verb(3, "Setting operator services mode to %d.\n", opermode);
}
if (ast_test_flag64(&opts, OPT_DURATION_STOP) && !ast_strlen_zero(opt_args[OPT_ARG_DURATION_STOP])) {
pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
goto done;
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Setting call duration limit to %d seconds.\n", calldurationlimit);
+ ast_verb(3, "Setting call duration limit to %d seconds.\n", calldurationlimit);
}
if (ast_test_flag64(&opts, OPT_SENDDTMF) && !ast_strlen_zero(opt_args[OPT_ARG_SENDDTMF])) {
}
tmp->forwards++;
if (tmp->forwards < AST_MAX_FORWARDS) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n",
+ ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n",
chan->name, tech, stuff, tc->name);
ast_hangup(tc);
/* If we have been told to ignore forwards, just set this channel to null
if (ast_test_flag64(&opts, OPT_IGNORE_FORWARDING)) {
tc = NULL;
cause = AST_CAUSE_BUSY;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s/%s' prevented.\n",
+ ast_verb(3, "Forwarding %s to '%s/%s' prevented.\n",
chan->name, tech, stuff);
} else {
tc = ast_request(tech, chan->nativeformats, stuff, &cause);
else
ast_channel_inherit_variables(chan, tc);
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", tc->name);
+ ast_verb(3, "Too many forwards from %s\n", tc->name);
ast_hangup(tc);
tc = NULL;
cause = AST_CAUSE_CONGESTION;
if (res) {
/* Again, keep going even if there's an error */
ast_debug(1, "ast call on peer returned %d\n", res);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", numsubst);
+ ast_verb(3, "Couldn't call %s\n", numsubst);
ast_hangup(tc);
tc = NULL;
ast_free(tmp);
continue;
} else {
senddialevent(chan, tc);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", numsubst);
+ ast_verb(3, "Called %s\n", numsubst);
if (!ast_test_flag64(peerflags, OPT_ORIGINAL_CLID))
ast_set_callerid(tc, S_OR(chan->macroexten, chan->exten), get_cid_name(cidname, sizeof(cidname), chan), NULL);
}
if ((res = ast_spawn_extension(peer, peer->context, peer->exten, peer->priority, peer->cid.cid_num))) {
/* Something bad happened, or a hangup has been requested. */
ast_debug(1, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, peer->name);
- if (option_verbose > 1)
- ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, peer->name);
+ ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, peer->name);
break;
}
peer->priority++;
zt_wait_event(chan->fds[0]);
}
res = ast_safe_sleep(chan, 1000);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Flashed channel %s\n", chan->name);
+ ast_verb(3, "Flashed channel %s\n", chan->name);
} else
ast_log(LOG_WARNING, "Unable to flash channel %s: %s\n", chan->name, strerror(errno));
} else
if (!AST_LIST_EMPTY(findme_user_list)) {
if (!caller) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Original caller hungup. Cleanup.\n");
+ ast_verb(3, "Original caller hungup. Cleanup.\n");
clear_calling_tree(findme_user_list);
return NULL;
}
if (tmpuser->state == 3)
tmpuser->digts += (towas - wtd);
if (tmpuser->digts && (tmpuser->digts > featuredigittimeout)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "We've been waiting for digits longer than we should have.\n");
+ ast_verb(3, "We've been waiting for digits longer than we should have.\n");
if (!ast_strlen_zero(namerecloc)) {
tmpuser->state = 1;
tmpuser->digts = 0;
else if (tmpto < 0 && !tmpuser->ochan->timingfunc) {
ast_stopstream(tmpuser->ochan);
if (tmpuser->state == 1) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Playback of the call-from file appears to be done.\n");
+ ast_verb(3, "Playback of the call-from file appears to be done.\n");
if (!ast_streamfile(tmpuser->ochan, namerecloc, tmpuser->ochan->language)) {
tmpuser->state = 2;
} else {
}
}
} else if (tmpuser->state == 2) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Playback of name file appears to be done.\n");
+ ast_verb(3, "Playback of name file appears to be done.\n");
memset(tmpuser->yn, 0, sizeof(tmpuser->yn));
tmpuser->ynidx = 0;
if (!ast_streamfile(tmpuser->ochan, pressbuttonname, tmpuser->ochan->language)) {
return NULL;
}
} else if (tmpuser->state == 3) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Playback of the next step file appears to be done.\n");
+ ast_verb(3, "Playback of the next step file appears to be done.\n");
tmpuser->digts = 0;
}
}
totalwait -= tmpto;
wtd = to;
if (totalwait <= 0) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "We've hit our timeout for this step. Drop everyone and move on to the next one. %ld\n", totalwait);
+ ast_verb(3, "We've hit our timeout for this step. Drop everyone and move on to the next one. %ld\n", totalwait);
clear_calling_tree(findme_user_list);
return NULL;
}
switch(f->subclass) {
case AST_CONTROL_HANGUP:
if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "%s received a hangup frame.\n", winner->name);
+ ast_verb(3, "%s received a hangup frame.\n", winner->name);
if (dg == 0) {
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "The calling channel hungup. Need to drop everyone else.\n");
+ ast_verb(3, "The calling channel hungup. Need to drop everyone else.\n");
clear_calling_tree(findme_user_list);
ctstatus = -1;
}
break;
case AST_CONTROL_ANSWER:
if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", winner->name, caller->name);
+ ast_verb(3, "%s answered %s\n", winner->name, caller->name);
/* If call has been answered, then the eventual hangup is likely to be normal hangup */
winner->hangupcause = AST_CAUSE_NORMAL_CLEARING;
caller->hangupcause = AST_CAUSE_NORMAL_CLEARING;
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Starting playback of %s\n", callfromname);
+ ast_verb(3, "Starting playback of %s\n", callfromname);
if (dg > 0) {
if (!ast_strlen_zero(namerecloc)) {
if (!ast_streamfile(winner, callfromname, winner->language)) {
}
break;
case AST_CONTROL_BUSY:
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "%s is busy\n", winner->name);
+ ast_verb(3, "%s is busy\n", winner->name);
break;
case AST_CONTROL_CONGESTION:
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "%s is circuit-busy\n", winner->name);
+ ast_verb(3, "%s is circuit-busy\n", winner->name);
break;
case AST_CONTROL_RINGING:
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "%s is ringing\n", winner->name);
+ ast_verb(3, "%s is ringing\n", winner->name);
break;
case AST_CONTROL_PROGRESS:
- if (option_verbose > 2)
- ast_verbose ( VERBOSE_PREFIX_3 "%s is making progress passing it to %s\n", winner->name, caller->name);
+ ast_verb(3, "%s is making progress passing it to %s\n", winner->name, caller->name);
break;
case AST_CONTROL_VIDUPDATE:
- if (option_verbose > 2)
- ast_verbose ( VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", winner->name, caller->name);
+ ast_verb(3, "%s requested a video update, passing it to %s\n", winner->name, caller->name);
break;
case AST_CONTROL_PROCEEDING:
- if (option_verbose > 2)
- ast_verbose ( VERBOSE_PREFIX_3 "%s is proceeding passing it to %s\n", winner->name,caller->name);
+ ast_verb(3, "%s is proceeding passing it to %s\n", winner->name,caller->name);
break;
case AST_CONTROL_HOLD:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Call on %s placed on hold\n", winner->name);
+ ast_verb(3, "Call on %s placed on hold\n", winner->name);
break;
case AST_CONTROL_UNHOLD:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Call on %s left from hold\n", winner->name);
+ ast_verb(3, "Call on %s left from hold\n", winner->name);
break;
case AST_CONTROL_OFFHOOK:
case AST_CONTROL_FLASH:
/* Ignore going off hook and flash */
break;
case -1:
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "%s stopped sounds\n", winner->name);
+ ast_verb(3, "%s stopped sounds\n", winner->name);
break;
default:
ast_debug(1, "Dunno what to do with control type %d\n", f->subclass);
livechannels--;
ast_debug(1, "live channels left %d\n", livechannels);
if (!livechannels) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "no live channels left. exiting.\n");
+ ast_verb(3, "no live channels left. exiting.\n");
return NULL;
}
}
}
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "couldn't reach at this number.\n");
+ ast_verb(3, "couldn't reach at this number.\n");
}
/* --- WAIT FOR WINNER NUMBER END! -----------*/
if (outbound) {
ast_set_callerid(outbound, caller->cid.cid_num, caller->cid.cid_name, caller->cid.cid_num);
ast_channel_inherit_variables(tpargs->chan, outbound);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "calling %s\n", dialarg);
+ ast_verb(3, "calling %s\n", dialarg);
if (!ast_call(outbound,dialarg,0)) {
tmpuser->ochan = outbound;
tmpuser->state = 0;
ast_copy_string(tmpuser->dialarg, dialarg, sizeof(dialarg));
AST_LIST_INSERT_TAIL(findme_user_list, tmpuser, entry);
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "couldn't reach at this number.\n");
+ ast_verb(3, "couldn't reach at this number.\n");
if (outbound) {
if (!outbound->cdr)
outbound->cdr = ast_cdr_alloc();
res = ast_adsi_get_cpeid(chan, cpeid, 0);
if (res > 0) {
gotcpeid = 1;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Got CPEID of '%02x:%02x:%02x:%02x' on '%s'\n", cpeid[0], cpeid[1], cpeid[2], cpeid[3], chan->name);
+ ast_verb(3, "Got CPEID of '%02x:%02x:%02x:%02x' on '%s'\n", cpeid[0], cpeid[1], cpeid[2], cpeid[3], chan->name);
}
if (res > -1) {
strcpy(data[1], "Measuring CPE...");
cpeid_setstatus(chan, data, 0);
res = ast_adsi_get_cpeinfo(chan, &width, &height, &buttons, 0);
if (res > -1) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CPE has %d lines, %d columns, and %d buttons on '%s'\n", height, width, buttons, chan->name);
+ ast_verb(3, "CPE has %d lines, %d columns, and %d buttons on '%s'\n", height, width, buttons, chan->name);
gotgeometry = 1;
}
}
goto out;
case AST_PBX_KEEPALIVE:
ast_debug(2, "Spawn extension (%s,%s,%d) exited KEEPALIVE in macro %s on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
- if (option_verbose > 1)
- ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited KEEPALIVE in macro '%s' on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
+ ast_verb(2, "Spawn extension (%s, %s, %d) exited KEEPALIVE in macro '%s' on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
goto out;
break;
default:
ast_debug(2, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
- if (option_verbose > 1)
- ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
+ ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
dead = 1;
goto out;
}
}
if (gosub_level == 0 && strcasecmp(chan->context, fullmacro)) {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Channel '%s' jumping out of macro '%s'\n", chan->name, macro);
+ ast_verb(2, "Channel '%s' jumping out of macro '%s'\n", chan->name, macro);
break;
}
/* Fill the conference struct */
cnf->start = time(NULL);
cnf->isdynamic = dynamic ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Created MeetMe conference %d for conference '%s'\n", cnf->zapconf, cnf->confno);
+ ast_verb(3, "Created MeetMe conference %d for conference '%s'\n", cnf->zapconf, cnf->confno);
AST_LIST_INSERT_HEAD(&confs, cnf, list);
/* Reserve conference number in map */
snprintf(recordingtmp, sizeof(recordingtmp), "wav");
conf->recordingformat = ast_strdupa(recordingtmp);
}
- ast_verbose(VERBOSE_PREFIX_4 "Starting recording of MeetMe Conference %s into file %s.%s.\n",
+ ast_verb(4, "Starting recording of MeetMe Conference %s into file %s.%s.\n",
conf->confno, conf->recordingfilename, conf->recordingformat);
}
}
}
dialtech = strsep(&args.dial, "/");
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Dial Tech,String: (%s,%s)\n", dialtech, args.dial);
+ ast_verb(3, "Dial Tech,String: (%s,%s)\n", dialtech, args.dial);
if (!ast_strlen_zero(args.return_context))
ast_parseable_goto(chan, args.return_context);
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Return Context: (%s,%s,%d) ID: %s\n", chan->context, chan->exten, chan->priority, chan->cid.cid_num);
+ ast_verb(3, "Return Context: (%s,%s,%d) ID: %s\n", chan->context, chan->exten, chan->priority, chan->cid.cid_num);
if (!ast_exists_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num)) {
- ast_verbose(VERBOSE_PREFIX_3 "Warning: Return Context Invalid, call will return to default|s\n");
+ ast_verb(3, "Warning: Return Context Invalid, call will return to default|s\n");
}
- }
/* we are using masq_park here to protect * from touching the channel once we park it. If the channel comes out of timeout
before we are done announcing and the channel is messed with, Kablooeee. So we use Masq to prevent this. */
ast_masq_park_call(chan, NULL, timeout, &lot);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, args.return_context);
+ ast_verb(3, "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, args.return_context);
/* Now place the call to the extension */
if (dchan) {
if (dchan->_state == AST_STATE_UP) {
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "Channel %s was answered.\n", dchan->name);
+ ast_verb(4, "Channel %s was answered.\n", dchan->name);
} else {
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "Channel %s was never answered.\n", dchan->name);
+ ast_verb(4, "Channel %s was never answered.\n", dchan->name);
ast_log(LOG_WARNING, "PARK: Channel %s was never answered for the announce.\n", dchan->name);
ast_hangup(dchan);
return -1;
/* now we have the call placed and are ready to play stuff to it */
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "Announce Template:%s\n", args.template);
+ ast_verb(4, "Announce Template:%s\n", args.template);
for (looptemp = 0, tmp[looptemp++] = strsep(&args.template, ":");
looptemp < sizeof(tmp) / sizeof(tmp[0]);
tmp[looptemp++] = strsep(&args.template, ":"));
for (i = 0; i < looptemp; i++) {
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "Announce:%s\n", tmp[i]);
+ ast_verb(4, "Announce:%s\n", tmp[i]);
if (!strcmp(tmp[i], "PARKED")) {
ast_say_digits(dchan, lot, "", dchan->language);
} else {
avgholdsecs = 0;
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Hold time for %s is %d minutes %d seconds\n", qe->parent->name, avgholdmins, avgholdsecs);
+ ast_verb(3, "Hold time for %s is %d minutes %d seconds\n", qe->parent->name, avgholdmins, avgholdsecs);
/* If the hold time is >1 min, if it's enabled, and if it's not
supposed to be only once and we have already said it, say it */
}
posout:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Told %s in %s their queue position (which was %d)\n",
+ ast_verb(3, "Told %s in %s their queue position (which was %d)\n",
qe->chan->name, qe->parent->name, qe->pos);
res = play_file(qe->chan, qe->parent->sound_thanks);
if ((res = ast_call(tmp->chan, location, 0))) {
/* Again, keep going even if there's an error */
ast_debug(1, "ast call on peer returned %d\n", res);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", tmp->interface);
+ ast_verb(3, "Couldn't call %s\n", tmp->interface);
do_hang(tmp);
(*busies)++;
return 0;
tmp->chan->cid.cid_name ? tmp->chan->cid.cid_name : "unknown",
qe->chan->context, qe->chan->exten, qe->chan->priority,
qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", tmp->interface);
+ ast_verb(3, "Called %s\n", tmp->interface);
}
return 1;
else
ast_moh_stop(qe->chan);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Playing periodic announcement\n");
+ ast_verb(3, "Playing periodic announcement\n");
/* Check to make sure we have a sound file. If not, reset to the first sound file */
if (qe->last_periodic_announce_sound >= MAX_PERIODIC_ANNOUNCEMENTS || !strlen(qe->parent->sound_periodicannounce[qe->last_periodic_announce_sound])) {
/*! \brief RNA == Ring No Answer. Common code that is executed when we try a queue member and they don't answer. */
static void rna(int rnatime, struct queue_ent *qe, char *interface, char *membername)
{
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Nobody picked up in %d ms\n", rnatime);
+ ast_verb(3, "Nobody picked up in %d ms\n", rnatime);
ast_queue_log(qe->parent->name, qe->chan->uniqueid, membername, "RINGNOANSWER", "%d", rnatime);
if (qe->parent->autopause) {
if (!set_member_paused(qe->parent->name, interface, 1)) {
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Auto-Pausing Queue Member %s in queue %s since they failed to answer.\n", interface, qe->parent->name);
+ ast_verb(3, "Auto-Pausing Queue Member %s in queue %s since they failed to answer.\n", interface, qe->parent->name);
} else {
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Failed to pause Queue Member %s in queue %s!\n", interface, qe->parent->name);
+ ast_verb(3, "Failed to pause Queue Member %s in queue %s!\n", interface, qe->parent->name);
}
}
return;
for (o = outgoing; o; o = o->q_next) {
if (o->stillgoing && (o->chan) && (o->chan->_state == AST_STATE_UP)) {
if (!peer) {
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", o->chan->name, in->name);
+ ast_verb(3, "%s answered %s\n", o->chan->name, in->name);
peer = o;
}
} else if (o->chan && (o->chan == winner)) {
ast_copy_string(membername, o->member->membername, sizeof(membername));
if (!ast_strlen_zero(o->chan->call_forward) && !forwardsallowed) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s' prevented.\n", in->name, o->chan->call_forward);
+ ast_verb(3, "Forwarding %s to '%s' prevented.\n", in->name, o->chan->call_forward);
numnochan++;
do_hang(o);
winner = NULL;
tech = "Local";
}
/* Before processing channel, go ahead and check for forwarding */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, o->chan->name);
+ ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, o->chan->name);
/* Setup parameters */
o->chan = ast_request(tech, in->nativeformats, stuff, &status);
if (status != o->oldstatus)
case AST_CONTROL_ANSWER:
/* This is our guy if someone answered. */
if (!peer) {
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", o->chan->name, in->name);
+ ast_verb(3, "%s answered %s\n", o->chan->name, in->name);
peer = o;
}
break;
case AST_CONTROL_BUSY:
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "%s is busy\n", o->chan->name);
+ ast_verb(3, "%s is busy\n", o->chan->name);
if (in->cdr)
ast_cdr_busy(in->cdr);
do_hang(o);
numbusies++;
break;
case AST_CONTROL_CONGESTION:
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "%s is circuit-busy\n", o->chan->name);
+ ast_verb(3, "%s is circuit-busy\n", o->chan->name);
if (in->cdr)
ast_cdr_busy(in->cdr);
endtime = (long) time(NULL);
numbusies++;
break;
case AST_CONTROL_RINGING:
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "%s is ringing\n", o->chan->name);
+ ast_verb(3, "%s is ringing\n", o->chan->name);
if (!sentringing) {
#if 0
ast_indicate(in, AST_CONTROL_RINGING);
return NULL;
}
if ((f->frametype == AST_FRAME_DTMF) && caller_disconnect && (f->subclass == '*')) {
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
+ ast_verb(3, "User hit %c to disconnect call.\n", f->subclass);
*to = 0;
ast_frfree(f);
return NULL;
}
if ((f->frametype == AST_FRAME_DTMF) && valid_exit(qe, f->subclass)) {
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_3 "User pressed digit: %c\n", f->subclass);
+ ast_verb(3, "User pressed digit: %c\n", f->subclass);
*to = 0;
*digit = f->subclass;
ast_frfree(f);
/* exit after 'timeout' cycle if 'n' option enabled */
if (go_on >= qe.parent->membercount) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Exiting on time-out cycle\n");
+ ast_verb(3, "Exiting on time-out cycle\n");
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
record_abandoned(&qe);
reason = QUEUE_TIMEOUT;
maxdigits = atoi(arglist.maxdigits);
if ((maxdigits<1) || (maxdigits>255)) {
maxdigits = 255;
- } else if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Accepting a maximum of %d digits.\n", maxdigits);
+ } else
+ ast_verb(3, "Accepting a maximum of %d digits.\n", maxdigits);
}
if (ast_strlen_zero(arglist.variable)) {
ast_log(LOG_WARNING, "Invalid! Usage: Read(variable[|filename][|maxdigits][|option][|attempts][|timeout])\n\n");
if (res > -1) {
pbx_builtin_setvar_helper(chan, arglist.variable, tmp);
if (!ast_strlen_zero(tmp)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "User entered '%s'\n", tmp);
+ ast_verb(3, "User entered '%s'\n", tmp);
tries = 0;
} else {
tries--;
- if (option_verbose > 2) {
if (tries)
- ast_verbose(VERBOSE_PREFIX_3 "User entered nothing, %d chance%s left\n", tries, (tries != 1) ? "s" : "");
+ ast_verb(3, "User entered nothing, %d chance%s left\n", tries, (tries != 1) ? "s" : "");
else
- ast_verbose(VERBOSE_PREFIX_3 "User entered nothing.\n");
+ ast_verb(3, "User entered nothing.\n");
}
- }
res = 0;
} else {
pbx_builtin_setvar_helper(chan, arglist.variable, tmp);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "User disconnected\n");
+ ast_verb(3, "User disconnected\n");
}
}
}
);
#endif
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s config for repeater %s\n",
+ ast_verb(3, "%s config for repeater %s\n",
(init) ? "Loading initial" : "Re-Loading", rpt_vars[n].name);
ast_mutex_lock(&rpt_vars[n].lock);
if (rpt_vars[n].cfg)
l->chan->whentohangup = 0;
l->chan->appl = "Apprpt";
l->chan->data = "(Remote Rx)";
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "rpt (remote) initiating call to %s/%s on %s\n",
+ ast_verb(3, "rpt (remote) initiating call to %s/%s on %s\n",
deststr, tele, l->chan->name);
if (l->chan->cid.cid_num)
ast_free(l->chan->cid.cid_num);
} else {
rpt_telemetry(myrpt, CONNFAIL, l);
ast_free(l);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Unable to place call to %s/%s on %s\n",
+ ast_verb(3, "Unable to place call to %s/%s on %s\n",
deststr, tele, l->chan->name);
return DC_ERROR;
}
l->chan->whentohangup = 0;
l->chan->appl = "Apprpt";
l->chan->data = "(Remote Rx)";
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "rpt (remote) initiating call to %s/%s on %s\n",
+ ast_verb(3, "rpt (remote) initiating call to %s/%s on %s\n",
deststr, tele, l->chan->name);
if (l->chan->cid.cid_num)
ast_free(l->chan->cid.cid_num);
} else {
rpt_telemetry(myrpt, CONNFAIL, l);
ast_free(l);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Unable to place call to %s/%s on %s\n",
+ ast_verb(3, "Unable to place call to %s/%s on %s\n",
deststr, tele, l->chan->name);
return DC_ERROR;
}
l->chan->whentohangup = 0;
l->chan->appl = "Apprpt";
l->chan->data = "(Remote Rx)";
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "rpt (attempt_reconnect) initiating call to %s/%s on %s\n",
+ ast_verb(3, "rpt (attempt_reconnect) initiating call to %s/%s on %s\n",
deststr, tele, l->chan->name);
if (l->chan->cid.cid_num)
ast_free(l->chan->cid.cid_num);
ast_call(l->chan, tele, 999);
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Unable to place call to %s/%s on %s\n",
+ ast_verb(3, "Unable to place call to %s/%s on %s\n",
deststr, tele, l->chan->name);
return -1;
}
myrpt->rxchannel->whentohangup = 0;
myrpt->rxchannel->appl = "Apprpt";
myrpt->rxchannel->data = "(Repeater Rx)";
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "rpt (Rx) initiating call to %s/%s on %s\n",
+ ast_verb(3, "rpt (Rx) initiating call to %s/%s on %s\n",
tmpstr, tele, myrpt->rxchannel->name);
ast_call(myrpt->rxchannel, tele, 999);
if (myrpt->rxchannel->_state != AST_STATE_UP) {
myrpt->txchannel->whentohangup = 0;
myrpt->txchannel->appl = "Apprpt";
myrpt->txchannel->data = "(Repeater Tx)";
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "rpt (Tx) initiating call to %s/%s on %s\n",
+ ast_verb(3, "rpt (Tx) initiating call to %s/%s on %s\n",
tmpstr, tele, myrpt->txchannel->name);
ast_call(myrpt->txchannel, tele, 999);
if (myrpt->rxchannel->_state != AST_STATE_UP) {
if (!ast_strlen_zero(optionarg.return_context)) {
if (ast_parseable_goto(chan, optionarg.return_context)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Warning: Return Context Invalid, call will return to default|s\n");
+ ast_verb(3, "Warning: Return Context Invalid, call will return to default|s\n");
}
}
before we are done announcing and the channel is messed with, Kablooeee. So we use Masq to prevent this. */
ast_masq_park_call(chan, NULL, timeout, &lot);
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, optionarg.return_context);
+ ast_verb(3, "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, optionarg.return_context);
snprintf(tmp, sizeof(tmp), "%d,%s", lot, optionarg.template + 1);
rpt_telemetry(myrpt, REV_PATCH, tmp);
myrpt->rxchannel->whentohangup = 0;
myrpt->rxchannel->appl = "Apprpt";
myrpt->rxchannel->data = "(Link Rx)";
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "rpt (Rx) initiating call to %s/%s on %s\n",
+ ast_verb(3, "rpt (Rx) initiating call to %s/%s on %s\n",
myrpt->rxchanname, tele, myrpt->rxchannel->name);
rpt_mutex_unlock(&myrpt->lock);
ast_call(myrpt->rxchannel, tele, 999);
myrpt->txchannel->whentohangup = 0;
myrpt->txchannel->appl = "Apprpt";
myrpt->txchannel->data = "(Link Tx)";
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "rpt (Tx) initiating call to %s/%s on %s\n",
+ ast_verb(3, "rpt (Tx) initiating call to %s/%s on %s\n",
myrpt->txchanname, tele, myrpt->txchannel->name);
rpt_mutex_unlock(&myrpt->lock);
ast_call(myrpt->txchannel, tele, 999);
char debug_buf[MAX_DEBUG_LEN * 3 + 1];
sz = h->imsg[1] + 2;
- /* ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Frame: %s\n", sms_hexdump(h->imsg, sz, debug_buf)); */
+ /* ast_verb(3, "SMS-P2 Frame: %s\n", sms_hexdump(h->imsg, sz, debug_buf)); */
/* Parse message body (called payload) */
tv.tv_sec = h->scts = time(NULL);
msgsz += (h->imsg[f++] * 256);
switch (msg) {
case 0x13: /* Body */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Body#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
+ ast_verb(3, "SMS-P2 Body#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
if (msgsz >= sizeof(h->imsg))
msgsz = sizeof(h->imsg) - 1;
for (i = 0; i < msgsz; i++)
tm.tm_min = ( (h->imsg[f + 6] * 10) + h->imsg[f + 7] );
tm.tm_sec = 0;
h->scts = ast_mktime(&tm, NULL);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Date#%02X=%02d/%02d %02d:%02d\n", msg, tm.tm_mday, tm.tm_mon + 1, tm.tm_hour, tm.tm_min);
+ ast_verb(3, "SMS-P2 Date#%02X=%02d/%02d %02d:%02d\n", msg, tm.tm_mday, tm.tm_mon + 1, tm.tm_hour, tm.tm_min);
break;
case 0x15: /* Calling line (from SMSC) */
if (msgsz >= 20)
msgsz = 20 - 1;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Origin#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
+ ast_verb(3, "SMS-P2 Origin#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
ast_copy_string(h->oa, (char *)(&h->imsg[f]), msgsz + 1);
break;
case 0x18: /* Destination(from TE/phone) */
if (msgsz >= 20)
msgsz = 20 - 1;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Destination#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
+ ast_verb(3, "SMS-P2 Destination#%02X=[%.*s]\n", msg, msgsz, &h->imsg[f]);
ast_copy_string(h->da, (char *)(&h->imsg[f]), msgsz + 1);
break;
case 0x1C: /* Notify */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Notify#%02X=%s\n", msg, sms_hexdump(&h->imsg[f], 3, debug_buf));
+ ast_verb(3, "SMS-P2 Notify#%02X=%s\n", msg, sms_hexdump(&h->imsg[f], 3, debug_buf));
break;
default:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "SMS-P2 Par#%02X [%d]: %s\n", msg, msgsz, sms_hexdump(&h->imsg[f], msgsz, debug_buf));
+ ast_verb(3, "SMS-P2 Par#%02X [%d]: %s\n", msg, msgsz, sms_hexdump(&h->imsg[f], msgsz, debug_buf));
break;
}
f+=msgsz; /* Skip to next */
}
if (q < n)
sprintf(p, "...");
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "SMS %s%s\n", dir == DIR_RX ? "RX" : "TX", txt);
+ ast_verb(3, "SMS %s%s\n", dir == DIR_RX ? "RX" : "TX", txt);
}
/* Protocol 2: empty connnection ready (I am master) */
if (h->framenumber < 0 && h->ibytec >= 160 && !memcmp(h->imsg, "UUUUUUUUUUUUUUUUUUUU", 20)) {
h->framenumber = 1;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "SMS protocol 2 detected\n");
+ ast_verb(3, "SMS protocol 2 detected\n");
h->protocol = 2;
h->imsg[0] = 0xff; /* special message (fake) */
h->imsg[1] = h->imsg[2] = 0x00;
if (sms_args.argc > 1)
ast_app_parse_options(sms_options, &sms_flags, sms_opts, sms_args.options);
- ast_verbose("sms argc %d queue <%s> opts <%s> addr <%s> body <%s>\n",
+ ast_verb(1, "sms argc %d queue <%s> opts <%s> addr <%s> body <%s>\n",
sms_args.argc, S_OR(sms_args.queue, ""),
S_OR(sms_args.options, ""),
S_OR(sms_args.addr, ""),
h.opause_0 = atoi(sms_opts[OPTION_ARG_PAUSE]);
if (h.opause_0 < 25 || h.opause_0 > 2000)
h.opause_0 = 300; /* default 300ms */
- ast_verbose("initial delay %dms\n", h.opause_0);
+ ast_verb(1, "initial delay %dms\n", h.opause_0);
/* the following apply if there is an arg3/4 and apply to the created message file */
if (!ast_strlen_zero(prefile)) {
/* See if we can find a recorded name for this person instead of their extension number */
if (ast_fileexists(prefile, NULL, NULL) > 0) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: CID number '%s' matches mailbox number, playing recorded name\n", callerid);
+ ast_verb(3, "Playing envelope info: CID number '%s' matches mailbox number, playing recorded name\n", callerid);
if (!callback)
res = wait_file2(chan, vms, "vm-from");
res = ast_stream_and_wait(chan, prefile, "");
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: message from '%s'\n", callerid);
+ ast_verb(3, "Playing envelope info: message from '%s'\n", callerid);
/* BB: Say "from extension" as one saying to sound smoother */
if (!callback)
res = wait_file2(chan, vms, "vm-from-extension");
if (vmu && !strcmp(passptr, password))
valid++;
else {
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Incorrect password '%s' for user '%s' (context = %s)\n", password, mailbox, context ? context : "default");
+ ast_verb(3, "Incorrect password '%s' for user '%s' (context = %s)\n", password, mailbox, context ? context : "default");
if (!ast_strlen_zero(prefix))
mailbox[0] = '\0';
}
cmd = 't';
break;
case '2': /* Callback */
- if (option_verbose > 2 && !vms.starting)
- ast_verbose( VERBOSE_PREFIX_3 "Callback Requested\n");
+ if (!vms.starting)
+ ast_verb(3, "Callback Requested\n");
if (!ast_strlen_zero(vmu->callback) && vms.lastmsg > -1 && !vms.starting) {
cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 2, record_gain);
if (cmd == 9) {
int retries = 0;
if (!num) {
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Destination number will be entered manually\n");
+ ast_verb(3, "Destination number will be entered manually\n");
while (retries < 3 && cmd != 't') {
destination[1] = '\0';
destination[0] = cmd = ast_play_and_wait(chan,"vm-enter-num-to-call");
if (cmd < 0)
return 0;
if (cmd == '*') {
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "User hit '*' to cancel outgoing call\n");
+ ast_verb(3, "User hit '*' to cancel outgoing call\n");
return 0;
}
if ((cmd = ast_readstring(chan,destination + strlen(destination),sizeof(destination)-1,6000,10000,"#")) < 0)
return 9;
}
} else {
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Caller can not specify callback number - no dialout context available\n");
+ ast_verb(3, "Caller can not specify callback number - no dialout context available\n");
res = ast_play_and_wait(chan, "vm-sorry");
}
ast_config_destroy(msg_cfg);
break;
default:
if (num) {
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Confirm CID number '%s' is number to use for callback\n", num);
+ ast_verb(3, "Confirm CID number '%s' is number to use for callback\n", num);
res = ast_play_and_wait(chan, "vm-num-i-have");
if (!res)
res = play_message_callerid(chan, vms, num, vmu->context, 1);
ast_callerid_parse(cid, &name, &num);
if (!num) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "No CID number available, no reply sent\n");
+ ast_verb(3, "No CID number available, no reply sent\n");
if (!res)
res = ast_play_and_wait(chan, "vm-nonumber");
ast_config_destroy(msg_cfg);
return res;
} else {
/* Sender has no mailbox, can't reply */
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "No mailbox number '%s' in context '%s', no reply sent\n", num, vmu->context);
+ ast_verb(3, "No mailbox number '%s' in context '%s', no reply sent\n", num, vmu->context);
ast_play_and_wait(chan, "vm-nobox");
res = 't';
ast_config_destroy(msg_cfg);
#if 0
else if (vmu->review && (*duration < 5)) {
/* Message is too short */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Message too short\n");
+ ast_verb(3, "Message too short\n");
cmd = ast_play_and_wait(chan, "vm-tooshort");
cmd = ast_filedelete(tempfile, NULL);
break;
}
else if (vmu->review && (cmd == 2 && *duration < (maxsilence + 3))) {
/* Message is all silence */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Nothing recorded\n");
+ ast_verb(3, "Nothing recorded\n");
cmd = ast_filedelete(tempfile, NULL);
cmd = ast_play_and_wait(chan, "vm-nothingrecorded");
if (!cmd)
break;
}
if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_RING)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Got a ring but still waiting for timeout\n");
+ ast_verb(3, "Got a ring but still waiting for timeout\n");
}
ast_frfree(f);
}
break;
}
if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_RING)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Got a ring after the timeout\n");
+ ast_verb(3, "Got a ring after the timeout\n");
ast_frfree(f);
break;
}
}
}
- if (option_verbose > 6)
- ast_verbose(VERBOSE_PREFIX_3 "Got %dms silence< %dms required\n", dspsilence, silencereqd);
+ ast_verb(3, "Got %dms silence< %dms required\n", dspsilence, silencereqd);
if (dspsilence >= silencereqd) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Exiting with %dms silence >= %dms required\n", dspsilence, silencereqd);
+ ast_verb(3, "Exiting with %dms silence >= %dms required\n", dspsilence, silencereqd);
/* Ended happily with silence */
res = 1;
pbx_builtin_setvar_helper(chan, "WAITSTATUS", "SILENCE");
ast_log(LOG_WARNING, "Using default value of 1000ms, 1 iteration, no timeout\n");
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Waiting %d time(s) for %d ms silence with %d timeout\n", iterations, silencereqd, timeout);
+ ast_verb(3, "Waiting %d time(s) for %d ms silence with %d timeout\n", iterations, silencereqd, timeout);
time(&waitstart);
res = 1;
} else {
int pri = find_matching_endwhile(chan);
if (pri > 0) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Jumping to priority %d\n", pri);
+ ast_verb(3, "Jumping to priority %d\n", pri);
chan->priority = pri;
} else {
ast_log(LOG_WARNING, "Couldn't find matching EndWhile? (While at %s@%s priority %d)\n", chan->context, chan->exten, chan->priority);
if (strcasecmp(chan->tech->type, "Zap")) {
/* If it's not a zap channel, we're done. Wait a couple of
seconds and then hangup... */
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Channel %s is not a Zap channel\n", chan->name);
+ ast_verb(2, "Channel %s is not a Zap channel\n", chan->name);
sleep(2);
} else {
memset(&ztp, 0, sizeof(ztp));
if (ioctl(chan->fds[0], ZT_GET_PARAMS, &ztp)) {
ast_log(LOG_WARNING, "Unable to get zaptel parameters\n");
} else if (ztp.sigtype != ZT_SIG_CLEAR) {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Channel %s is not a clear channel\n", chan->name);
+ ast_verb(2, "Channel %s is not a clear channel\n", chan->name);
} else {
/* Everything should be okay. Run PPP. */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Starting RAS on %s\n", chan->name);
+ ast_verb(3, "Starting RAS on %s\n", chan->name);
/* Execute RAS */
run_ras(chan, args);
}
input[ic++] = '\0';
ic=0;
ret = atoi(input);
- ast_verbose(VERBOSE_PREFIX_3 "Zapscan: change channel to %d\n",ret);
+ ast_verb(3, "Zapscan: change channel to %d\n",ret);
break;
}
}
desired_group = ast_strdupa(data);
if(!ast_strlen_zero(desired_group)) {
- ast_verbose(VERBOSE_PREFIX_3 "Scanning for group %s\n", desired_group);
+ ast_verb(3, "Scanning for group %s\n", desired_group);
search_group = 1;
}
if (tempchan && search_group) {
const char *mygroup;
if((mygroup = pbx_builtin_getvar_helper(tempchan, "GROUP")) && (!strcmp(mygroup, desired_group))) {
- ast_verbose(VERBOSE_PREFIX_3 "Found Matching Channel %s in group %s\n", tempchan->name, desired_group);
+ ast_verb(3, "Found Matching Channel %s in group %s\n", tempchan->name, desired_group);
} else {
ast_mutex_unlock(&tempchan->lock);
lastchan = tempchan;
}
}
if (tempchan && (!strcmp(tempchan->tech->type, "Zap")) && (tempchan != chan) ) {
- ast_verbose(VERBOSE_PREFIX_3 "Zap channel %s is in-use, monitoring...\n", tempchan->name);
+ ast_verb(3, "Zap channel %s is in-use, monitoring...\n", tempchan->name);
ast_copy_string(confstr, tempchan->name, sizeof(confstr));
ast_mutex_unlock(&tempchan->lock);
if ((tmp = strchr(confstr,'-'))) {
ast_copy_string(tableptr->connection, connection, lenconnection + 1);
ast_copy_string(tableptr->table, table, lentable + 1);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Found adaptive CDR table %s@%s.\n", tableptr->table, tableptr->connection);
+ ast_verb(3, "Found adaptive CDR table %s@%s.\n", tableptr->table, tableptr->connection);
while ((res = SQLFetch(stmt)) != SQL_NO_DATA && res != SQL_ERROR) {
char *cdrvar = "";
if (strcasecmp(var->value, columnname) == 0) {
char *tmp = ast_strdupa(var->name + 5);
cdrvar = ast_strip(tmp);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Found alias %s for column %s in %s@%s\n", cdrvar, columnname, tableptr->table, tableptr->connection);
+ ast_verb(3, "Found alias %s for column %s in %s@%s\n", cdrvar, columnname, tableptr->table, tableptr->connection);
break;
}
}
sql2[lensql2 - 1] = ')';
strcat(sql + lensql, sql2);
- if (option_verbose > 10)
- ast_verbose(VERBOSE_PREFIX_4 "[%s]\n", sql);
+ ast_verb(11, "[%s]\n", sql);
/* No need to check the connection now; we'll handle any failure in prepare_and_execute */
obj = ast_odbc_request_obj(tableptr->connection, 0);
if (obj) {
ODBC_res = SQLAllocHandle(SQL_HANDLE_STMT, ODBC_con, &ODBC_stmt);
if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Failure in AllocStatement %d\n", ODBC_res);
+ ast_verb(11, "cdr_odbc: Failure in AllocStatement %d\n", ODBC_res);
SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt);
odbc_disconnect();
ast_mutex_unlock(&odbc_lock);
ODBC_res = SQLPrepare(ODBC_stmt, (unsigned char *)sqlcmd, SQL_NTS);
if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error in PREPARE %d\n", ODBC_res);
+ ast_verb(11, "cdr_odbc: Error in PREPARE %d\n", ODBC_res);
SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt);
odbc_disconnect();
ast_mutex_unlock(&odbc_lock);
if (connected) {
res = odbc_do_query();
if (res < 0) {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Query FAILED Call not logged!\n");
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Reconnecting to dsn %s\n", dsn);
+ ast_verb(11, "cdr_odbc: Query FAILED Call not logged!\n");
+ ast_verb(11, "cdr_odbc: Reconnecting to dsn %s\n", dsn);
SQLDisconnect(ODBC_con);
res = odbc_init();
if (res < 0) {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: %s has gone away!\n", dsn);
+ ast_verb(11, "cdr_odbc: %s has gone away!\n", dsn);
odbc_disconnect();
} else {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Trying Query again!\n");
+ ast_verb(11, "cdr_odbc: Trying Query again!\n");
res = odbc_do_query();
if (res < 0) {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Query FAILED Call not logged!\n");
+ ast_verb(11, "cdr_odbc: Query FAILED Call not logged!\n");
}
}
}
} else {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Query FAILED Call not logged!\n");
+ ast_verb(11, "cdr_odbc: Query FAILED Call not logged!\n");
}
SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt);
ast_mutex_unlock(&odbc_lock);
{
ast_mutex_lock(&odbc_lock);
if (connected) {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Disconnecting from %s\n", dsn);
+ ast_verb(11, "cdr_odbc: Disconnecting from %s\n", dsn);
SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt);
odbc_disconnect();
}
if (dsn) {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: free dsn\n");
+ ast_verb(11, "cdr_odbc: free dsn\n");
ast_free(dsn);
}
if (username) {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: free username\n");
+ ast_verb(11, "cdr_odbc: free username\n");
ast_free(username);
}
if (password) {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: free password\n");
+ ast_verb(11, "cdr_odbc: free password\n");
ast_free(password);
}
if (table) {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: free table\n");
+ ast_verb(11, "cdr_odbc: free table\n");
ast_free(table);
}
goto out;
}
- if (option_verbose > 2) {
- ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: dsn is %s\n",dsn);
- if (username)
- {
- ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: username is %s\n",username);
- ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: password is [secret]\n");
- }
- else
- ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: retreiving username and password from odbc config\n");
- ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: table is %s\n",table);
- }
+ ast_verb(3, "cdr_odbc: dsn is %s\n",dsn);
+ if (username) {
+ ast_verb(3, "cdr_odbc: username is %s\n",username);
+ ast_verb(3, "cdr_odbc: password is [secret]\n");
+ } else
+ ast_verb(3, "cdr_odbc: retreiving username and password from odbc config\n");
+ ast_verb(3, "cdr_odbc: table is %s\n",table);
res = odbc_init();
if (res < 0) {
ast_log(LOG_ERROR, "cdr_odbc: Unable to connect to datasource: %s\n", dsn);
- if (option_verbose > 2) {
- ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: Unable to connect to datasource: %s\n", dsn);
+ ast_verb(3, "cdr_odbc: Unable to connect to datasource: %s\n", dsn);
}
- }
res = ast_cdr_register(name, ast_module_info->description, odbc_log);
if (res) {
ast_log(LOG_ERROR, "cdr_odbc: Unable to register ODBC CDR handling\n");
ODBC_res = SQLExecute(ODBC_stmt);
if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error in Query %d\n", ODBC_res);
+ ast_verb(11, "cdr_odbc: Error in Query %d\n", ODBC_res);
SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt);
odbc_disconnect();
return -1;
} else {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Query Successful!\n");
+ ast_verb(11, "cdr_odbc: Query Successful!\n");
connected = 1;
}
return 0;
if (ODBC_env == SQL_NULL_HANDLE || connected == 0) {
ODBC_res = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &ODBC_env);
if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error AllocHandle\n");
+ ast_verb(11, "cdr_odbc: Error AllocHandle\n");
connected = 0;
return -1;
}
ODBC_res = SQLSetEnvAttr(ODBC_env, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0);
if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error SetEnv\n");
+ ast_verb(11, "cdr_odbc: Error SetEnv\n");
SQLFreeHandle(SQL_HANDLE_ENV, ODBC_env);
connected = 0;
return -1;
ODBC_res = SQLAllocHandle(SQL_HANDLE_DBC, ODBC_env, &ODBC_con);
if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error AllocHDB %d\n", ODBC_res);
+ ast_verb(11, "cdr_odbc: Error AllocHDB %d\n", ODBC_res);
SQLFreeHandle(SQL_HANDLE_ENV, ODBC_env);
connected = 0;
return -1;
ODBC_res = SQLConnect(ODBC_con, (SQLCHAR*)dsn, SQL_NTS, (SQLCHAR*)username, SQL_NTS, (SQLCHAR*)password, SQL_NTS);
if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO)) {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error SQLConnect %d\n", ODBC_res);
+ ast_verb(11, "cdr_odbc: Error SQLConnect %d\n", ODBC_res);
SQLFreeHandle(SQL_HANDLE_DBC, ODBC_con);
SQLFreeHandle(SQL_HANDLE_ENV, ODBC_env);
connected = 0;
return -1;
} else {
- if (option_verbose > 10)
- ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Connected to %s\n", dsn);
+ ast_verb(11, "cdr_odbc: Connected to %s\n", dsn);
connected = 1;
}
return 0;
case AST_FRAME_CONTROL:
if (f->subclass == AST_CONTROL_ANSWER) {
if (p->ackcall) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s answered, waiting for '#' to acknowledge\n", p->chan->name);
+ ast_verb(3, "%s answered, waiting for '#' to acknowledge\n", p->chan->name);
/* Don't pass answer along */
ast_frfree(f);
f = &ast_null_frame;
case AST_FRAME_DTMF_BEGIN:
case AST_FRAME_DTMF_END:
if (!p->acknowledged && (f->subclass == '#')) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s acknowledged\n", p->chan->name);
+ ast_verb(3, "%s acknowledged\n", p->chan->name);
p->acknowledged = 1;
ast_frfree(f);
f = &answer_frame;
} else if (!ast_strlen_zero(p->loginchan)) {
time(&p->start);
/* Call on this agent */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "outgoing agentcall, to agent '%s', on '%s'\n", p->agent, p->chan->name);
+ ast_verb(3, "outgoing agentcall, to agent '%s', on '%s'\n", p->agent, p->chan->name);
ast_set_callerid(p->chan,
ast->cid.cid_num, ast->cid.cid_name, NULL);
ast_channel_inherit_variables(ast, p->chan);
ast_mutex_unlock(&p->lock);
return res;
}
- ast_verbose( VERBOSE_PREFIX_3 "agent_call, call to agent '%s' call on '%s'\n", p->agent, p->chan->name);
+ ast_verb(3, "agent_call, call to agent '%s' call on '%s'\n", p->agent, p->chan->name);
ast_debug(3, "Playing beep, lang '%s'\n", p->chan->language);
res = ast_streamfile(p->chan, beep, p->chan->language);
ast_debug(3, "Played beep, result '%d'\n", res);
if (max_login_tries < 0)
max_login_tries = 0;
tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTMAXLOGINTRIES");
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTMAXLOGINTRIES=%s, setting max_login_tries to: %d on Channel '%s'.\n",tmpoptions,max_login_tries,chan->name);
+ ast_verb(3, "Saw variable AGENTMAXLOGINTRIES=%s, setting max_login_tries to: %d on Channel '%s'.\n",tmpoptions,max_login_tries,chan->name);
}
if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR"))) {
if (ast_true(pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR")))
else
update_cdr = 0;
tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR");
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTUPDATECDR=%s, setting update_cdr to: %d on Channel '%s'.\n",tmpoptions,update_cdr,chan->name);
+ ast_verb(3, "Saw variable AGENTUPDATECDR=%s, setting update_cdr to: %d on Channel '%s'.\n",tmpoptions,update_cdr,chan->name);
}
if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTGOODBYE"))) {
strcpy(agent_goodbye, pbx_builtin_getvar_helper(chan, "AGENTGOODBYE"));
tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTGOODBYE");
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTGOODBYE=%s, setting agent_goodbye to: %s on Channel '%s'.\n",tmpoptions,agent_goodbye,chan->name);
+ ast_verb(3, "Saw variable AGENTGOODBYE=%s, setting agent_goodbye to: %s on Channel '%s'.\n",tmpoptions,agent_goodbye,chan->name);
}
/* End Channel Specific Login Overrides */
else
p->ackcall = 0;
tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTACKCALL");
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTACKCALL=%s, setting ackcall to: %d for Agent '%s'.\n",tmpoptions,p->ackcall,p->agent);
+ ast_verb(3, "Saw variable AGENTACKCALL=%s, setting ackcall to: %d for Agent '%s'.\n",tmpoptions,p->ackcall,p->agent);
}
if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTAUTOLOGOFF"))) {
p->autologoff = atoi(pbx_builtin_getvar_helper(chan, "AGENTAUTOLOGOFF"));
if (p->autologoff < 0)
p->autologoff = 0;
tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTAUTOLOGOFF");
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTAUTOLOGOFF=%s, setting autologff to: %d for Agent '%s'.\n",tmpoptions,p->autologoff,p->agent);
+ ast_verb(3, "Saw variable AGENTAUTOLOGOFF=%s, setting autologff to: %d for Agent '%s'.\n",tmpoptions,p->autologoff,p->agent);
}
if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTWRAPUPTIME"))) {
p->wrapuptime = atoi(pbx_builtin_getvar_helper(chan, "AGENTWRAPUPTIME"));
if (p->wrapuptime < 0)
p->wrapuptime = 0;
tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTWRAPUPTIME");
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTWRAPUPTIME=%s, setting wrapuptime to: %d for Agent '%s'.\n",tmpoptions,p->wrapuptime,p->agent);
+ ast_verb(3, "Saw variable AGENTWRAPUPTIME=%s, setting wrapuptime to: %d for Agent '%s'.\n",tmpoptions,p->wrapuptime,p->agent);
}
/* End Channel Specific Agent Overrides */
if (!p->chan) {
if (update_cdr && chan->cdr)
snprintf(chan->cdr->channel, sizeof(chan->cdr->channel), "Agent/%s", p->agent);
ast_queue_log("NONE", chan->uniqueid, agent, "AGENTLOGIN", "%s", chan->name);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Agent '%s' logged in (format %s/%s)\n", p->agent,
+ ast_verb(2, "Agent '%s' logged in (format %s/%s)\n", p->agent,
ast_getformatname(chan->readformat), ast_getformatname(chan->writeformat));
/* Login this channel and wait for it to go away */
p->chan = chan;
"Uniqueid: %s\r\n",
p->agent, logintime, chan->uniqueid);
ast_queue_log("NONE", chan->uniqueid, agent, "AGENTLOGOFF", "%s|%ld", chan->name, logintime);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Agent '%s' logged out\n", p->agent);
+ ast_verb(2, "Agent '%s' logged out\n", p->agent);
/* If there is no owner, go ahead and kill it now */
ast_device_state_changed("Agent/%s", p->agent);
if (p->dead && !p->owner) {
}
if (soundcard_init() < 0) {
- if (option_verbose > 1) {
- ast_verbose(VERBOSE_PREFIX_2 "No sound card detected -- console channel will be unavailable\n");
- ast_verbose(VERBOSE_PREFIX_2 "Turn off ALSA support by adding 'noload=chan_alsa.so' in /etc/asterisk/modules.conf\n");
- }
+ ast_verb(2, "No sound card detected -- console channel will be unavailable\n");
+ ast_verb(2, "Turn off ALSA support by adding 'noload=chan_alsa.so' in /etc/asterisk/modules.conf\n");
return AST_MODULE_LOAD_DECLINE;
}
/* indicate that this is an outgoing call */
pvt->outgoing = 1;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Requested transfer capability: 0x%.2x - %s\n", c->transfercapability, ast_transfercapability2str(c->transfercapability));
+ ast_verb(3, "Requested transfer capability: 0x%.2x - %s\n", c->transfercapability, ast_transfercapability2str(c->transfercapability));
if (h323debug)
ast_debug(1, "Placing outgoing call to %s, %d/%d\n", called_addr, pvt->options.dtmfcodec[0], pvt->options.dtmfcodec[1]);
ast_mutex_unlock(&pvt->lock);
pvt->jointcapability = pvt->options.capability;
if (h323debug) {
- ast_verbose(VERBOSE_PREFIX_3 "Setting up Call\n");
- ast_verbose(VERBOSE_PREFIX_3 " \tCall token: [%s]\n", pvt->cd.call_token);
- ast_verbose(VERBOSE_PREFIX_3 " \tCalling party name: [%s]\n", pvt->cd.call_source_name);
- ast_verbose(VERBOSE_PREFIX_3 " \tCalling party number: [%s]\n", pvt->cd.call_source_e164);
- ast_verbose(VERBOSE_PREFIX_3 " \tCalled party name: [%s]\n", pvt->cd.call_dest_alias);
- ast_verbose(VERBOSE_PREFIX_3 " \tCalled party number: [%s]\n", pvt->cd.call_dest_e164);
+ ast_verb(3, "Setting up Call\n");
+ ast_verb(3, " \tCall token: [%s]\n", pvt->cd.call_token);
+ ast_verb(3, " \tCalling party name: [%s]\n", pvt->cd.call_source_name);
+ ast_verb(3, " \tCalling party number: [%s]\n", pvt->cd.call_source_e164);
+ ast_verb(3, " \tCalled party name: [%s]\n", pvt->cd.call_dest_alias);
+ ast_verb(3, " \tCalled party number: [%s]\n", pvt->cd.call_dest_e164);
if (pvt->cd.redirect_reason >= 0)
- ast_verbose(VERBOSE_PREFIX_3 " \tRedirecting party number: [%s] (reason %d)\n", pvt->cd.redirect_number, pvt->cd.redirect_reason);
- ast_verbose(VERBOSE_PREFIX_3 " \tCalling party IP: [%s]\n", pvt->cd.sourceIp);
+ ast_verb(3, " \tRedirecting party number: [%s] (reason %d)\n", pvt->cd.redirect_number, pvt->cd.redirect_reason);
+ ast_verb(3, " \tCalling party IP: [%s]\n", pvt->cd.sourceIp);
}
/* Decide if we are allowing Gatekeeper routed calls*/
h323_reloading = 0;
ast_mutex_unlock(&h323_reload_lock);
if (reloading) {
- if (option_verbose > 0) {
- ast_verbose(VERBOSE_PREFIX_1 "Reloading H.323\n");
- }
+ ast_verb(1, "Reloading H.323\n");
h323_do_reload();
}
/* Check for interfaces needing to be killed */
return RESULT_SHOWUSAGE;
}
if (h323_soft_hangup(argv[2])) {
- ast_verbose(VERBOSE_PREFIX_3 "Hangup succeeded on %s\n", argv[2]);
+ ast_verb(3, "Hangup succeeded on %s\n", argv[2]);
} else {
- ast_verbose(VERBOSE_PREFIX_3 "Hangup failed for %s\n", argv[2]);
+ ast_verb(3, "Hangup failed for %s\n", argv[2]);
}
return RESULT_SUCCESS;
}
gkroute = ast_true(v->value);
} else if (!strcasecmp(v->name, "context")) {
ast_copy_string(default_context, v->value, sizeof(default_context));
- ast_verbose(VERBOSE_PREFIX_2 "Setting default context to %s\n", default_context);
+ ast_verb(2, "Setting default context to %s\n", default_context);
} else if (!strcasecmp(v->name, "UserByAlias")) {
userbyalias = ast_true(v->value);
} else if (!strcasecmp(v->name, "AcceptAnonymous")) {
if (de->d_name[0] != '.') {
snprintf(fn, sizeof(fn), "%s/%s", dir, de->d_name);
if (!try_firmware(fn)) {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Loaded firmware '%s'\n", de->d_name);
+ ast_verb(2, "Loaded firmware '%s'\n", de->d_name);
}
}
}
}
}
ast_mutex_unlock(&iaxsl[callno]);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Hungup '%s'\n", c->name);
+ ast_verb(3, "Hungup '%s'\n", c->name);
return 0;
}
for (/* ever */;;) {
/* Check in case we got masqueraded into */
if ((c0->tech != &iax2_tech) || (c1->tech != &iax2_tech)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Can't masquerade, we're different...\n");
+ ast_verb(3, "Can't masquerade, we're different...\n");
/* Remove from native mode */
if (c0->tech == &iax2_tech) {
ast_mutex_lock(&iaxsl[callno0]);
return AST_BRIDGE_FAILED_NOWARN;
}
if (c0->nativeformats != c1->nativeformats) {
- if (option_verbose > 2) {
char buf0[255];
char buf1[255];
ast_getformatname_multiple(buf0, sizeof(buf0) -1, c0->nativeformats);
ast_getformatname_multiple(buf1, sizeof(buf1) -1, c1->nativeformats);
- ast_verbose(VERBOSE_PREFIX_3 "Operating with different codecs %d[%s] %d[%s] , can't native bridge...\n", c0->nativeformats, buf0, c1->nativeformats, buf1);
- }
+ ast_verb(3, "Operating with different codecs %d[%s] %d[%s] , can't native bridge...\n", c0->nativeformats, buf0, c1->nativeformats, buf1);
/* Remove from native mode */
lock_both(callno0, callno1);
if (iaxs[callno0])
ast_sched_del(sched, reg->expire);
reg->expire = ast_sched_add(sched, (5 * reg->refresh / 6) * 1000, iax2_do_register_s, reg);
if (inaddrcmp(&oldus, ®->us) || (reg->messages != oldmsgs)) {
- if (option_verbose > 2) {
if (reg->messages > 255)
snprintf(msgstatus, sizeof(msgstatus), " with %d new and %d old messages waiting", reg->messages & 0xff, reg->messages >> 8);
else if (reg->messages > 1)
else
snprintf(msgstatus, sizeof(msgstatus), " with no messages waiting\n");
snprintf(ourip, sizeof(ourip), "%s:%d", ast_inet_ntoa(reg->us.sin_addr), ntohs(reg->us.sin_port));
- ast_verbose(VERBOSE_PREFIX_3 "Registered IAX2 to '%s', who sees us as %s%s\n", ast_inet_ntoa(sin->sin_addr), ourip, msgstatus);
- }
+ ast_verb(3, "Registered IAX2 to '%s', who sees us as %s%s\n", ast_inet_ntoa(sin->sin_addr), ourip, msgstatus);
manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelType: IAX2\r\nDomain: %s\r\nStatus: Registered\r\n", ast_inet_ntoa(sin->sin_addr));
}
reg->regstate = REG_STATE_REGISTERED;
if (d) {
*d = '\0';
d++;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Seeding '%s' at %s:%d for %d\n", p->name,
+ ast_verb(3, "Seeding '%s' at %s:%d for %d\n", p->name,
ast_inet_ntoa(in), atoi(c), atoi(d));
iax2_poke_peer(p, 0);
p->expiry = atoi(d);
snprintf(data, sizeof(data), "%s:%d:%d", ast_inet_ntoa(sin->sin_addr), ntohs(sin->sin_port), p->expiry);
if (!ast_test_flag(p, IAX_TEMPONLY) && sin->sin_addr.s_addr) {
ast_db_put("IAX/Registry", p->name, data);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Registered IAX2 '%s' (%s) at %s:%d\n", p->name,
+ ast_verb(3, "Registered IAX2 '%s' (%s) at %s:%d\n", p->name,
ast_test_flag(&iaxs[callno]->state, IAX_STATE_AUTHENTICATED) ? "AUTHENTICATED" : "UNAUTHENTICATED", ast_inet_ntoa(sin->sin_addr), ntohs(sin->sin_port));
manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: IAX2/%s\r\nPeerStatus: Registered\r\n", p->name);
register_peer_exten(p, 1);
ast_device_state_changed("IAX2/%s", p->name); /* Activate notification */
} else if (!ast_test_flag(p, IAX_TEMPONLY)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Unregistered IAX2 '%s' (%s)\n", p->name,
+ ast_verb(3, "Unregistered IAX2 '%s' (%s)\n", p->name,
ast_test_flag(&iaxs[callno]->state, IAX_STATE_AUTHENTICATED) ? "AUTHENTICATED" : "UNAUTHENTICATED");
manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: IAX2/%s\r\nPeerStatus: Unregistered\r\n", p->name);
register_peer_exten(p, 0);
send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACCEPT, 0, ied1.buf, ied1.pos, -1);
if (strcmp(iaxs[fr->callno]->exten, "TBD")) {
ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Accepting UNAUTHENTICATED call from %s:\n"
+ ast_verb(3, "Accepting UNAUTHENTICATED call from %s:\n"
"%srequested format = %s,\n"
"%srequested prefs = %s,\n"
"%sactual format = %s,\n"
} else {
ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_TBD);
/* If this is a TBD call, we're ready but now what... */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Accepted unauthenticated TBD call from %s\n", ast_inet_ntoa(sin.sin_addr));
+ ast_verb(3, "Accepted unauthenticated TBD call from %s\n", ast_inet_ntoa(sin.sin_addr));
}
}
}
else
iaxs[fr->callno]->peerformat = iaxs[fr->callno]->capability;
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Call accepted by %s (format %s)\n", ast_inet_ntoa(iaxs[fr->callno]->addr.sin_addr), ast_getformatname(iaxs[fr->callno]->peerformat));
+ ast_verb(3, "Call accepted by %s (format %s)\n", ast_inet_ntoa(iaxs[fr->callno]->addr.sin_addr), ast_getformatname(iaxs[fr->callno]->peerformat));
if (!(iaxs[fr->callno]->peerformat & iaxs[fr->callno]->capability)) {
memset(&ied0, 0, sizeof(ied0));
iax_ie_append_str(&ied0, IAX_IE_CAUSE, "Unable to negotiate codec");
if (iaxs[fr->callno]->owner) {
/* Switch us to use a compatible format */
iaxs[fr->callno]->owner->nativeformats = iaxs[fr->callno]->peerformat;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Format for call is %s\n", ast_getformatname(iaxs[fr->callno]->owner->nativeformats));
+ ast_verb(3, "Format for call is %s\n", ast_getformatname(iaxs[fr->callno]->owner->nativeformats));
retryowner2:
if (ast_mutex_trylock(&iaxs[fr->callno]->owner->lock)) {
ast_mutex_unlock(&iaxsl[fr->callno]);
send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACCEPT, 0, ied1.buf, ied1.pos, -1);
if (strcmp(iaxs[fr->callno]->exten, "TBD")) {
ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Accepting AUTHENTICATED call from %s:\n"
+ ast_verb(3, "Accepting AUTHENTICATED call from %s:\n"
"%srequested format = %s,\n"
"%srequested prefs = %s,\n"
"%sactual format = %s,\n"
} else {
ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_TBD);
/* If this is a TBD call, we're ready but now what... */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Accepted AUTHENTICATED TBD call from %s\n", ast_inet_ntoa(sin.sin_addr));
+ ast_verb(3, "Accepted AUTHENTICATED TBD call from %s\n", ast_inet_ntoa(sin.sin_addr));
}
}
}
send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
} else {
ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Accepting DIAL from %s, formats = 0x%x\n", ast_inet_ntoa(sin.sin_addr), iaxs[fr->callno]->peerformat);
+ ast_verb(3, "Accepting DIAL from %s, formats = 0x%x\n", ast_inet_ntoa(sin.sin_addr), iaxs[fr->callno]->peerformat);
ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
send_command(iaxs[fr->callno], AST_FRAME_CONTROL, AST_CONTROL_PROGRESS, 0, NULL, 0, -1);
if (!(c = ast_iax2_new(fr->callno, AST_STATE_RING, iaxs[fr->callno]->peerformat)))
break;
case IAX_COMMAND_TXREJ:
iaxs[fr->callno]->transferring = 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel '%s' unable to transfer\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
+ ast_verb(3, "Channel '%s' unable to transfer\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
memset(&iaxs[fr->callno]->transfer, 0, sizeof(iaxs[fr->callno]->transfer));
if (iaxs[fr->callno]->bridgecallno) {
if (iaxs[iaxs[fr->callno]->bridgecallno]->transferring) {
iaxs[fr->callno]->transferring = TRANSFER_MREADY;
else
iaxs[fr->callno]->transferring = TRANSFER_READY;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel '%s' ready to transfer\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
+ ast_verb(3, "Channel '%s' ready to transfer\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
if (iaxs[fr->callno]->bridgecallno) {
if ((iaxs[iaxs[fr->callno]->bridgecallno]->transferring == TRANSFER_READY) ||
(iaxs[iaxs[fr->callno]->bridgecallno]->transferring == TRANSFER_MREADY)) {
/* They're both ready, now release them. */
if (iaxs[fr->callno]->transferring == TRANSFER_MREADY) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Attempting media bridge of %s and %s\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>",
+ ast_verb(3, "Attempting media bridge of %s and %s\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>",
iaxs[iaxs[fr->callno]->bridgecallno]->owner ? iaxs[iaxs[fr->callno]->bridgecallno]->owner->name : "<Unknown>");
iaxs[iaxs[fr->callno]->bridgecallno]->transferring = TRANSFER_MEDIA;
send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_TXMEDIA, 0, ied0.buf, ied0.pos, -1);
send_command(iaxs[iaxs[fr->callno]->bridgecallno], AST_FRAME_IAX, IAX_COMMAND_TXMEDIA, 0, ied1.buf, ied1.pos, -1);
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Releasing %s and %s\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>",
+ ast_verb(3, "Releasing %s and %s\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>",
iaxs[iaxs[fr->callno]->bridgecallno]->owner ? iaxs[iaxs[fr->callno]->bridgecallno]->owner->name : "<Unknown>");
iaxs[iaxs[fr->callno]->bridgecallno]->transferring = TRANSFER_RELEASED;
return -1;
}
res = iax2_provision(&iaxs[callno]->addr, iaxs[callno]->sockfd, NULL, sdata, force);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Provisioned IAXY at '%s' with '%s'= %d\n",
+ ast_verb(3, "Provisioned IAXY at '%s' with '%s'= %d\n",
ast_inet_ntoa(iaxs[callno]->addr.sin_addr),
sdata, res);
return res;
}
ast_pthread_create_background(&schedthreadid, NULL, sched_thread, NULL);
ast_pthread_create_background(&netthreadid, NULL, network_thread, NULL);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "%d helper threaads started\n", threadcount);
+ ast_verb(2, "%d helper threaads started\n", threadcount);
return 0;
}
if (!(ns = ast_netsock_bind(netsock, io, v->value, portno, tos, cos, socket_read, NULL))) {
ast_log(LOG_WARNING, "Unable apply binding to '%s' at line %d\n", v->value, v->lineno);
} else {
- if (option_verbose > 1) {
if (strchr(v->value, ':'))
- ast_verbose(VERBOSE_PREFIX_2 "Binding IAX2 to '%s'\n", v->value);
+ ast_verb(2, "Binding IAX2 to '%s'\n", v->value);
else
- ast_verbose(VERBOSE_PREFIX_2 "Binding IAX2 to '%s:%d'\n", v->value, portno);
- }
+ ast_verb(2, "Binding IAX2 to '%s:%d'\n", v->value, portno);
if (defaultsockfd < 0)
defaultsockfd = ast_netsock_sockfd(ns);
ast_netsock_unref(ns);
if (!(ns = ast_netsock_bind(netsock, io, "0.0.0.0", portno, tos, cos, socket_read, NULL))) {
ast_log(LOG_ERROR, "Unable to create network socket: %s\n", strerror(errno));
} else {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Binding IAX2 to default address 0.0.0.0:%d\n", portno);
+ ast_verb(2, "Binding IAX2 to default address 0.0.0.0:%d\n", portno);
defaultsockfd = ast_netsock_sockfd(ns);
ast_netsock_unref(ns);
}
} else {
snprintf(req, sizeof(req), "IAX2/%s/%s", odata, exten);
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Executing Dial('%s')\n", req);
+ ast_verb(3, "Executing Dial('%s')\n", req);
} else {
AST_LIST_UNLOCK(&dpcache);
ast_log(LOG_WARNING, "Can't execute nonexistent extension '%s[@%s]' in data '%s'\n", exten, context, data);
ast_log(LOG_ERROR, "Unable to start network thread\n");
__unload_module();
return AST_MODULE_LOAD_FAILURE;
- } else if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "IAX Ready and Listening\n");
+ } else
+ ast_verb(2, "IAX Ready and Listening\n");
AST_LIST_LOCK(®istrations);
AST_LIST_TRAVERSE(®istrations, reg, entry)
struct ast_var_t *current;
if (mgcpdebug) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_call(%s)\n", ast->name);
+ ast_verb(3, "MGCP mgcp_call(%s)\n", ast->name);
}
sub = ast->tech_pvt;
p = sub->parent;
if (!ast_strlen_zero(distinctive_ring)) {
snprintf(tone, sizeof(tone), "L/wt%s", distinctive_ring);
if (mgcpdebug) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP distinctive callwait %s\n", tone);
+ ast_verb(3, "MGCP distinctive callwait %s\n", tone);
}
} else {
snprintf(tone, sizeof(tone), "L/wt");
if (mgcpdebug) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP normal callwait %s\n", tone);
+ ast_verb(3, "MGCP normal callwait %s\n", tone);
}
}
break;
if (!ast_strlen_zero(distinctive_ring)) {
snprintf(tone, sizeof(tone), "L/r%s", distinctive_ring);
if (mgcpdebug) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP distinctive ring %s\n", tone);
+ ast_verb(3, "MGCP distinctive ring %s\n", tone);
}
} else {
snprintf(tone, sizeof(tone), "L/rg");
if (mgcpdebug) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP default ring\n");
+ ast_verb(3, "MGCP default ring\n");
}
}
break;
}
ast_mutex_lock(&sub->lock);
if (mgcpdebug) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_hangup(%s) on %s@%s\n", ast->name, p->name, p->parent->name);
+ ast_verb(3, "MGCP mgcp_hangup(%s) on %s@%s\n", ast->name, p->name, p->parent->name);
}
if ((p->dtmfmode & MGCP_DTMF_INBAND) && p->dsp) {
if (p->dtmfmode & MGCP_DTMF_HYBRID)
p->dtmfmode &= ~MGCP_DTMF_INBAND;
if (mgcpdebug) {
- ast_verbose(VERBOSE_PREFIX_2 "MGCP free dsp on %s@%s\n", p->name, p->parent->name);
+ ast_verb(2, "MGCP free dsp on %s@%s\n", p->name, p->parent->name);
}
ast_dsp_free(p->dsp);
p->dsp = NULL;
if ((p->hookstate == MGCP_ONHOOK) && (!sub->next->rtp)) {
p->hidecallerid = 0;
if (p->hascallwaiting && !p->callwaiting) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Enabling call waiting on %s\n", ast->name);
+ ast_verb(3, "Enabling call waiting on %s\n", ast->name);
p->callwaiting = -1;
}
if (has_voicemail(p)) {
if (mgcpdebug) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_hangup(%s) on %s@%s set vmwi(+)\n",
+ ast_verb(3, "MGCP mgcp_hangup(%s) on %s@%s set vmwi(+)\n",
ast->name, p->name, p->parent->name);
}
transmit_notify_request(sub, "L/vmwi(+)");
} else {
if (mgcpdebug) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_hangup(%s) on %s@%s set vmwi(-)\n",
+ ast_verb(3, "MGCP mgcp_hangup(%s) on %s@%s set vmwi(-)\n",
ast->name, p->name, p->parent->name);
}
transmit_notify_request(sub, "L/vmwi(-)");
} else {
transmit_modify_request(sub);
}
- /* verbose level check */
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_answer(%s) on %s@%s-%d\n",
+ ast_verb(3, "MGCP mgcp_answer(%s) on %s@%s-%d\n",
ast->name, p->name, p->parent->name, sub->id);
- }
if (ast->_state != AST_STATE_UP) {
ast_setstate(ast, AST_STATE_UP);
ast_debug(1, "mgcp_answer(%s)\n", ast->name);
int res = 0;
if (mgcpdebug) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP asked to indicate %d '%s' condition on channel %s\n",
+ ast_verb(3, "MGCP asked to indicate %d '%s' condition on channel %s\n",
ind, control2str(ind), ast->name);
}
ast_mutex_lock(&sub->lock);
tmp = NULL;
}
}
- /* verbose level check */
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_new(%s) created in state: %s\n",
+ ast_verb(3, "MGCP mgcp_new(%s) created in state: %s\n",
tmp->name, ast_state2str(state));
- }
} else {
ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
}
memcpy(&g->addr, sin, sizeof(g->addr));
if (ast_ouraddrfor(&g->addr.sin_addr, &g->ourip))
memcpy(&g->ourip, &__ourip, sizeof(g->ourip));
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Registered MGCP gateway '%s' at %s port %d\n", g->name, ast_inet_ntoa(g->addr.sin_addr), ntohs(g->addr.sin_port));
+ ast_verb(3, "Registered MGCP gateway '%s' at %s port %d\n", g->name, ast_inet_ntoa(g->addr.sin_addr), ntohs(g->addr.sin_port));
}
}
/* not dynamic, check if the name matches */
}
}
if (mgcpdebug) {
- ast_verbose(VERBOSE_PREFIX_3 "Creating connection for %s@%s-%d in cxmode: %s callid: %s\n",
+ ast_verb(3, "Creating connection for %s@%s-%d in cxmode: %s callid: %s\n",
p->name, p->parent->name, sub->id, mgcp_cxmodes[sub->cxmode], sub->callid);
}
reqprep(&resp, p, "CRCX");
struct mgcp_endpoint *p = sub->parent;
if (mgcpdebug) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP Asked to indicate tone: %s on %s@%s-%d in cxmode: %s\n",
+ ast_verb(3, "MGCP Asked to indicate tone: %s on %s@%s-%d in cxmode: %s\n",
tone, p->name, p->parent->name, sub->id, mgcp_cxmodes[sub->cxmode]);
}
ast_copy_string(p->curtone, tone, sizeof(p->curtone));
add_header(&resp, "S", tone2);
}
if (mgcpdebug) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP Asked to indicate tone: %s on %s@%s-%d in cxmode: %s\n",
+ ast_verb(3, "MGCP Asked to indicate tone: %s on %s@%s-%d in cxmode: %s\n",
tone2, p->name, p->parent->name, sub->id, mgcp_cxmodes[sub->cxmode]);
}
/* fill in new fields */
return 0;
}
if (mgcpdebug) {
- ast_verbose(VERBOSE_PREFIX_3 "Modified %s@%s-%d with new mode: %s on callid: %s\n",
+ ast_verb(3, "Modified %s@%s-%d with new mode: %s on callid: %s\n",
p->name, p->parent->name, sub->id, mgcp_cxmodes[sub->cxmode], sub->callid);
}
reqprep(&resp, p, "MDCX");
struct mgcp_request resp;
if (mgcpdebug) {
- ast_verbose(VERBOSE_PREFIX_3 "Delete connection %s %s@%s-%d with new mode: %s on callid: %s\n",
+ ast_verb(3, "Delete connection %s %s@%s-%d with new mode: %s on callid: %s\n",
sub->cxident, p->name, p->parent->name, sub->id, mgcp_cxmodes[sub->cxmode], sub->callid);
}
reqprep(&resp, p, "DLCX");
struct mgcp_request resp;
if (mgcpdebug) {
- ast_verbose(VERBOSE_PREFIX_3 "Delete connection %s %s@%s on callid: %s\n",
+ ast_verb(3, "Delete connection %s %s@%s on callid: %s\n",
cxident ? cxident : "", p->name, p->parent->name, callid ? callid : "");
}
reqprep(&resp, p, "DLCX");
req = find_command(p, sub, &p->cmd_queue, &p->cmd_queue_lock, ident);
if (!req) {
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "No command found on [%s] for transaction %d. Ignoring...\n",
+ ast_verb(3, "No command found on [%s] for transaction %d. Ignoring...\n",
gw->name, ident);
- }
return;
}
if (len > (sizeof(cxident) - 1))
len = sizeof(cxident) - 1;
ast_copy_string(cxident, v, len);
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Non existing connection id %s on %s@%s \n",
+ ast_verb(3, "Non existing connection id %s on %s@%s \n",
cxident, p->name, gw->name);
- }
transmit_connection_del_w_params(p, NULL, cxident);
}
}
/* update the requested events according to the new hookstate */
transmit_notify_request(p->sub, "");
- /* verbose level check */
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Setting hookstate of %s@%s to ONHOOK\n", p->name, gw->name);
+ ast_verb(3, "Setting hookstate of %s@%s to ONHOOK\n", p->name, gw->name);
}
- }
} else if (strstr(c, "hd")) {
if (p->hookstate != MGCP_OFFHOOK) {
p->hookstate = MGCP_OFFHOOK;
/* update the requested events according to the new hookstate */
transmit_notify_request(p->sub, "");
- /* verbose level check */
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Setting hookstate of %s@%s to OFFHOOK\n", p->name, gw->name);
+ ast_verb(3, "Setting hookstate of %s@%s to OFFHOOK\n", p->name, gw->name);
}
}
}
}
}
- }
if (resp && resp->lines) {
/* do not process sdp if we are hanging up. this may be a late response */
if (getforward) {
/* Record this as the forwarding extension */
ast_copy_string(p->call_forward, p->dtmf_buf, sizeof(p->call_forward));
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Setting call forward to '%s' on channel %s\n",
+ ast_verb(3, "Setting call forward to '%s' on channel %s\n",
p->call_forward, chan->name);
- }
/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
if (res)
ast_hangup(chan);
return NULL;
} else if (p->hascallwaiting && p->callwaiting && !strcmp(p->dtmf_buf, "*70")) {
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Disabling call waiting on %s\n", chan->name);
- }
+ ast_verb(3, "Disabling call waiting on %s\n", chan->name);
/* Disable call waiting if enabled */
p->callwaiting = 0;
/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
ast_hangup(chan);
return NULL;
} else if (!p->hidecallerid && !strcmp(p->dtmf_buf, "*67")) {
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Disabling Caller*ID on %s\n", chan->name);
- }
+ ast_verb(3, "Disabling Caller*ID on %s\n", chan->name);
/* Disable Caller*ID if enabled */
p->hidecallerid = 1;
ast_set_callerid(chan, "", "", NULL);
break;
} else if (!strcmp(p->dtmf_buf, "*78")) {
/* Do not disturb */
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Enabled DND on channel %s\n", chan->name);
- }
+ ast_verb(3, "Enabled DND on channel %s\n", chan->name);
/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
p->dnd = 1;
len = 0;
} else if (!strcmp(p->dtmf_buf, "*79")) {
/* Do not disturb */
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Disabled DND on channel %s\n", chan->name);
- }
+ ast_verb(3, "Disabled DND on channel %s\n", chan->name);
/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
p->dnd = 0;
memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
len = 0;
} else if (p->cancallforward && !strcmp(p->dtmf_buf, "*73")) {
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Cancelling call forwarding on channel %s\n", chan->name);
- }
+ ast_verb(3, "Cancelling call forwarding on channel %s\n", chan->name);
/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
memset(p->call_forward, 0, sizeof(p->call_forward));
/* This is a three way call, the main call being a real channel,
and we're parking the first call. */
ast_masq_park_call(ast_bridged_channel(sub->next->owner), chan, 0, NULL);
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Parking call to '%s'\n", chan->name);
- }
+ ast_verb(3, "Parking call to '%s'\n", chan->name);
break;
} else if (!ast_strlen_zero(p->lastcallerid) && !strcmp(p->dtmf_buf, "*60")) {
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Blacklisting number %s\n", p->lastcallerid);
- }
+ ast_verb(3, "Blacklisting number %s\n", p->lastcallerid);
res = ast_db_put("blacklist", p->lastcallerid, "1");
if (!res) {
/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
len = 0;
}
} else if (p->hidecallerid && !strcmp(p->dtmf_buf, "*82")) {
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Enabling Caller*ID on %s\n", chan->name);
- }
+ ast_verb(3, "Enabling Caller*ID on %s\n", chan->name);
/* Enable Caller*ID if enabled */
p->hidecallerid = 0;
ast_set_callerid(chan, p->cid_num, p->cid_name, NULL);
return -1;
}
/*swap_subs(p, SUB_THREEWAY, SUB_REAL);*/
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Swapping %d for %d on %s@%s\n", p->sub->id, p->sub->next->id, p->name, p->parent->name);
- }
+ ast_verb(3, "Swapping %d for %d on %s@%s\n", p->sub->id, p->sub->next->id, p->name, p->parent->name);
p->sub = p->sub->next;
unalloc_sub(p->sub->next);
/* Tell the caller not to hangup */
if (!strcasecmp(req->verb, "RSIP")) {
/* Test if this RSIP request is just a keepalive */
if(!strcasecmp( get_header(req, "RM"), "X-keepalive")) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Received keepalive request from %s@%s\n", p->name, p->parent->name);
+ ast_verb(3, "Received keepalive request from %s@%s\n", p->name, p->parent->name);
transmit_response(sub, "200", req, "OK");
} else {
dump_queue(p->parent, p);
dump_cmd_queues(p, NULL);
- if (option_verbose > 2 && (strcmp(p->name, p->parent->wcardep) != 0)) {
- ast_verbose(VERBOSE_PREFIX_3 "Resetting interface %s@%s\n", p->name, p->parent->name);
+ if ((strcmp(p->name, p->parent->wcardep) != 0)) {
+ ast_verb(3, "Resetting interface %s@%s\n", p->name, p->parent->name);
}
/* For RSIP on wildcard we reset all endpoints */
if (!strcmp(p->name, p->parent->wcardep)) {
/*if ((strcmp(tmp_ep->name, "*") != 0) && (strcmp(tmp_ep->name, "aaln/" "*") != 0)) {*/
if (strcmp(tmp_ep->name, g->wcardep) != 0) {
struct mgcp_subchannel *tmp_sub, *first_sub;
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Resetting interface %s@%s\n", tmp_ep->name, p->parent->name);
- }
+ ast_verb(3, "Resetting interface %s@%s\n", tmp_ep->name, p->parent->name);
first_sub = tmp_ep->sub;
tmp_sub = tmp_ep->sub;
return -1;
if (p->callwaiting || p->transfer || p->threewaycalling) {
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Swapping %d for %d on %s@%s\n", p->sub->id, p->sub->next->id, p->name, p->parent->name);
- }
+ ast_verb(3, "Swapping %d for %d on %s@%s\n", p->sub->id, p->sub->next->id, p->name, p->parent->name);
p->sub = p->sub->next;
/* transfer control to our next subchannel */
if (!sub->next->owner) {
/* plave the first call on hold and start up a new call */
sub->cxmode = MGCP_CX_MUTE;
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP Muting %d on %s@%s\n", sub->id, p->name, p->parent->name);
- }
+ ast_verb(3, "MGCP Muting %d on %s@%s\n", sub->id, p->name, p->parent->name);
transmit_modify_request(sub);
if (sub->owner && ast_bridged_channel(sub->owner))
ast_queue_control(sub->owner, AST_CONTROL_HOLD);
/* We've got two active calls lets decide whether or not to conference or just flip flop */
if ((!sub->outgoing) && (!sub->next->outgoing)) {
/* We made both calls lets conferenct */
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP Conferencing %d and %d on %s@%s\n",
+ ast_verb(3, "MGCP Conferencing %d and %d on %s@%s\n",
sub->id, sub->next->id, p->name, p->parent->name);
- }
sub->cxmode = MGCP_CX_CONF;
sub->next->cxmode = MGCP_CX_CONF;
if (ast_bridged_channel(sub->next->owner))
/* Let's flipflop between calls */
/* XXX Need to check for state up ??? */
/* XXX Need a way to indicate the current call, or maybe the call that's waiting */
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "We didn't make one of the calls FLIPFLOP %d and %d on %s@%s\n",
+ ast_verb(3, "We didn't make one of the calls FLIPFLOP %d and %d on %s@%s\n",
sub->id, sub->next->id, p->name, p->parent->name);
- }
sub->cxmode = MGCP_CX_MUTE;
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP Muting %d on %s@%s\n", sub->id, p->name, p->parent->name);
- }
+ ast_verb(3, "MGCP Muting %d on %s@%s\n", sub->id, p->name, p->parent->name);
transmit_modify_request(sub);
if (ast_bridged_channel(sub->owner))
ast_queue_control(sub->owner, AST_CONTROL_HOLD);
sub->alreadygone = 1;
mgcp_queue_hangup(sub);
} else {
- /* verbose level check */
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP handle_request(%s@%s-%d) ast_channel already destroyed, resending DLCX.\n",
+ ast_verb(3, "MGCP handle_request(%s@%s-%d) ast_channel already destroyed, resending DLCX.\n",
p->name, p->parent->name, sub->id);
- }
/* Instruct the other side to remove the connection since it apparently *
* still thinks the channel is active. *
* For Cisco IAD2421 /BAK/ */
if ((p->hookstate == MGCP_ONHOOK) && (!sub->rtp) && (!sub->next->rtp)) {
p->hidecallerid = 0;
if (p->hascallwaiting && !p->callwaiting) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Enabling call waiting on MGCP/%s@%s-%d\n", p->name, p->parent->name, sub->id);
+ ast_verb(3, "Enabling call waiting on MGCP/%s@%s-%d\n", p->name, p->parent->name, sub->id);
p->callwaiting = -1;
}
if (has_voicemail(p)) {
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP handle_request(%s@%s) set vmwi(+)\n", p->name, p->parent->name);
- }
+ ast_verb(3, "MGCP handle_request(%s@%s) set vmwi(+)\n", p->name, p->parent->name);
transmit_notify_request(sub, "L/vmwi(+)");
} else {
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP handle_request(%s@%s) set vmwi(-)\n", p->name, p->parent->name);
- }
+ ast_verb(3, "MGCP handle_request(%s@%s) set vmwi(-)\n", p->name, p->parent->name);
transmit_notify_request(sub, "L/vmwi(-)");
}
}
mgcp_reloading = 0;
ast_mutex_unlock(&mgcp_reload_lock);
if (reloading) {
- if (option_verbose > 0)
- ast_verbose(VERBOSE_PREFIX_1 "Reloading MGCP\n");
+ ast_verb(1, "Reloading MGCP\n");
mgcp_do_reload();
/* Add an I/O event to our UDP socket */
if (mgcpsock > -1)
return NULL;
}
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_request(%s)\n", tmp);
- ast_verbose(VERBOSE_PREFIX_3 "MGCP cw: %d, dnd: %d, so: %d, sno: %d\n",
+ ast_verb(3, "MGCP mgcp_request(%s)\n", tmp);
+ ast_verb(3, "MGCP cw: %d, dnd: %d, so: %d, sno: %d\n",
sub->parent->callwaiting, sub->parent->dnd, sub->owner ? 1 : 0, sub->next->owner ? 1: 0);
- }
/* Must be busy */
if (((sub->parent->callwaiting) && ((sub->owner) && (sub->next->owner))) ||
((!sub->parent->callwaiting) && (sub->owner)) ||
for (i = 0; i < MAX_SUBS; i++) {
sub = ast_calloc(1, sizeof(*sub));
if (sub) {
- ast_verbose(VERBOSE_PREFIX_3 "Allocating subchannel '%d' on %s@%s\n", i, e->name, gw->name);
+ ast_verb(3, "Allocating subchannel '%d' on %s@%s\n", i, e->name, gw->name);
ast_mutex_init(&sub->lock);
ast_mutex_init(&sub->cx_queue_lock);
sub->parent = e;
ast_copy_string(e->musicclass, musicclass, sizeof(e->musicclass));
ast_copy_string(e->mailbox, mailbox, sizeof(e->mailbox));
if (!ast_strlen_zero(mailbox)) {
- ast_verbose(VERBOSE_PREFIX_3 "Setting mailbox '%s' on %s@%s\n", mailbox, gw->name, e->name);
+ ast_verb(3, "Setting mailbox '%s' on %s@%s\n", mailbox, gw->name, e->name);
}
if (!ep_reload) {
/* XXX potential issue due to reload */
if (sub) {
if (!ep_reload) {
- ast_verbose(VERBOSE_PREFIX_3 "Allocating subchannel '%d' on %s@%s\n", i, e->name, gw->name);
+ ast_verb(3, "Allocating subchannel '%d' on %s@%s\n", i, e->name, gw->name);
ast_mutex_init(&sub->lock);
ast_mutex_init(&sub->cx_queue_lock);
ast_copy_string(sub->magic, MGCP_SUBCHANNEL_MAGIC, sizeof(sub->magic));
ast_mutex_lock(&gatelock);
g = build_gateway(cat, ast_variable_browse(cfg, cat));
if (g) {
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Added gateway '%s'\n", g->name);
- }
+ ast_verb(3, "Added gateway '%s'\n", g->name);
g->next = gateways;
gateways = g;
}
close(mgcpsock);
mgcpsock = -1;
} else {
- if (option_verbose > 1) {
- ast_verbose(VERBOSE_PREFIX_2 "MGCP Listening on %s:%d\n",
+ ast_verb(2, "MGCP Listening on %s:%d\n",
ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
- }
ast_netsock_set_qos(mgcpsock, tos, cos);
}
}
while (e && e->needaudit) {
e->needaudit = 0;
transmit_audit_endpoint(e);
- ast_verbose(VERBOSE_PREFIX_3 "MGCP Auditing endpoint %s@%s for hookstate\n", e->name, g->name);
+ ast_verb(3, "MGCP Auditing endpoint %s@%s for hookstate\n", e->name, g->name);
e = e->next;
}
g = g->next;
misdn_cfg_get(tmp->bc->port, MISDN_CFG_FAXDETECT_CONTEXT, &context_tmp, sizeof(context_tmp));
context = ast_strlen_zero(context_tmp) ? (ast_strlen_zero(ast->macrocontext) ? ast->context : ast->macrocontext) : context_tmp;
if (ast_exists_extension(ast, context, "fax", 1, ast->cid.cid_num)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Redirecting %s to fax extension (context:%s)\n", ast->name, context);
+ ast_verb(3, "Redirecting %s to fax extension (context:%s)\n", ast->name, context);
/* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
pbx_builtin_setvar_helper(ast,"FAXEXTEN",ast->exten);
if (ast_async_goto(ast, context, "fax", 1))
}
break;
case 2:
- ast_verbose(VERBOSE_PREFIX_3 "Not redirecting %s to fax extension, nojump is set.\n", ast->name);
+ ast_verb(3, "Not redirecting %s to fax extension, nojump is set.\n", ast->name);
break;
}
} else {
misdn_lib_bridge(ch1->bc, ch2->bc);
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name);
+ ast_verb(3, "Native bridging %s and %s\n", c0->name, c1->name);
chan_misdn_log(1, ch1->bc->port, "* Making Native Bridge between %s and %s\n", ch1->bc->oad, ch2->bc->oad);
/* Check to see if duplex set (FreeBSD Bug) */
res = ioctl(fd, SNDCTL_DSP_GETCAPS, &fmt);
if (res == 0 && (fmt & DSP_CAP_DUPLEX)) {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Console is full duplex\n");
+ ast_verb(2, "Console is full duplex\n");
o->duplex = M_FULL;
};
break;
openit:
#ifdef TRYOPEN
if (setformat(o, O_RDWR) < 0) { /* open device */
- if (option_verbose > 0) {
- ast_verbose(VERBOSE_PREFIX_2 "Device %s not detected\n", ctg);
- ast_verbose(VERBOSE_PREFIX_2 "Turn off OSS support by adding " "'noload=chan_oss.so' in /etc/asterisk/modules.conf\n");
- }
+ ast_verb(1, "Device %s not detected\n", ctg);
+ ast_verb(1, "Turn off OSS support by adding " "'noload=chan_oss.so' in /etc/asterisk/modules.conf\n");
goto error;
}
if (o->duplex != M_FULL)
memset(p->ext, 0, sizeof(p->ext));
((struct phone_pvt *)(ast->tech_pvt))->owner = NULL;
ast_module_unref(ast_module_info->self);
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Hungup '%s'\n", ast->name);
+ ast_verb(3, "Hungup '%s'\n", ast->name);
ast->tech_pvt = NULL;
ast_setstate(ast, AST_STATE_DOWN);
restart_monitor();
peer->sipoptions = 0;
peer->lastms = 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Unregistered SIP '%s'\n", peer->name);
+ ast_verb(3, "Unregistered SIP '%s'\n", peer->name);
manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: SIP/%s\r\nPeerStatus: Unregistered\r\n", peer->name);
return PARSE_REGISTER_UPDATE;
}
/* Is this a new IP address for us? */
if (inaddrcmp(&peer->addr, &oldsin)) {
sip_poke_peer(peer);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Registered SIP '%s' at %s port %d expires %d\n", peer->name, ast_inet_ntoa(peer->addr.sin_addr), ntohs(peer->addr.sin_port), expiry);
+ ast_verb(3, "Registered SIP '%s' at %s port %d expires %d\n", peer->name, ast_inet_ntoa(peer->addr.sin_addr), ntohs(peer->addr.sin_port), expiry);
register_peer_exten(peer, TRUE);
}
useragent = get_header(req, "User-Agent");
if (strcasecmp(useragent, peer->useragent)) { /* XXX copy if they are different ? */
ast_copy_string(peer->useragent, useragent, sizeof(peer->useragent));
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_3 "Saved useragent \"%s\" for peer %s\n", peer->useragent, peer->name);
+ ast_verb(4, "Saved useragent \"%s\" for peer %s\n", peer->useragent, peer->name);
}
return PARSE_REGISTER_UPDATE;
}
if (p->autokillid > -1)
sip_cancel_destroy(p); /* Remove subscription expiry for renewals */
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); /* Delete subscription in 32 secs */
- ast_verbose(VERBOSE_PREFIX_2 "Extension state: Watcher for hint %s %s. Notify User %s\n", exten, state == AST_EXTENSION_DEACTIVATED ? "deactivated" : "removed", p->username);
+ ast_verb(2, "Extension state: Watcher for hint %s %s. Notify User %s\n", exten, state == AST_EXTENSION_DEACTIVATED ? "deactivated" : "removed", p->username);
p->stateid = -1;
p->subscribed = NONE;
append_history(p, "Subscribestatus", "%s", state == AST_EXTENSION_REMOVED ? "HintRemoved" : "Deactivated");
if (p->subscribed != NONE) /* Only send state NOTIFY if we know the format */
transmit_state_notify(p, state, 1, FALSE);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_1 "Extension Changed %s new state %s for Notify User %s\n", exten, ast_extension_state2str(state), p->username);
+ ast_verb(2, "Extension Changed %s new state %s for Notify User %s\n", exten, ast_extension_state2str(state), p->username);
sip_pvt_unlock(p);
default:
if ((resp >= 300) && (resp < 700)) {
/* Fatal response */
- if ((option_verbose > 2) && (resp != 487))
- ast_verbose(VERBOSE_PREFIX_3 "Got SIP response %d \"%s\" back from %s\n", resp, rest, ast_inet_ntoa(p->sa.sin_addr));
+ if ((resp != 487))
+ ast_verb(3, "Got SIP response %d \"%s\" back from %s\n", resp, rest, ast_inet_ntoa(p->sa.sin_addr));
if (sipmethod == SIP_INVITE)
stop_media_flows(p); /* Immediately stop RTP, VRTP and UDPTL as applicable */
}
}
if ((resp >= 300) && (resp < 700)) {
- if ((option_verbose > 2) && (resp != 487))
- ast_verbose(VERBOSE_PREFIX_3 "Incoming call: Got SIP response %d \"%s\" back from %s\n", resp, rest, ast_inet_ntoa(p->sa.sin_addr));
+ if ((resp != 487))
+ ast_verb(3, "Incoming call: Got SIP response %d \"%s\" back from %s\n", resp, rest, ast_inet_ntoa(p->sa.sin_addr));
switch(resp) {
case 488: /* Not acceptable here - codec error */
case 603: /* Decline */
sip_reloading = FALSE;
ast_mutex_unlock(&sip_reload_lock);
if (reloading) {
- if (option_verbose > 0)
- ast_verbose(VERBOSE_PREFIX_1 "Reloading SIP\n");
+ ast_verb(1, "Reloading SIP\n");
sip_do_reload(sip_reloadreason);
/* Change the I/O fd of our UDP socket */
else
authlist = auth;
- if (option_verbose > 2)
- ast_verbose("Added authentication for realm %s\n", realm);
+ ast_verb(3, "Added authentication for realm %s\n", realm);
return authlist;
close(sipsock);
sipsock = -1;
} else {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "SIP Listening on %s:%d\n",
+ ast_verb(2, "SIP Listening on %s:%d\n",
ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
ast_netsock_set_qos(sipsock, global_tos_sip, global_cos_sip);
}
switch (state) {
case AST_EXTENSION_DEACTIVATED: /* Retry after a while */
case AST_EXTENSION_REMOVED: /* Extension is gone */
- ast_verbose(VERBOSE_PREFIX_2 "Extension state: Watcher for hint %s %s. Notify Device %s\n", exten, state == AST_EXTENSION_DEACTIVATED ? "deactivated" : "removed", d->name);
+ ast_verb(2, "Extension state: Watcher for hint %s %s. Notify Device %s\n", exten, state == AST_EXTENSION_DEACTIVATED ? "deactivated" : "removed", d->name);
sd->stateid = -1;
callstate = SKINNY_ONHOOK;
lamp = SKINNY_LAMP_OFF;
else
req->data.reset.resetType = 1;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s device %s.\n", (fullrestart) ? "Restarting" : "Resetting", d->id);
+ ast_verb(3, "%s device %s.\n", (fullrestart) ? "Restarting" : "Resetting", d->id);
transmit_response(d->session, req);
}
}
ast_copy_string(l->mohsuggest, mohsuggest, sizeof(l->mohsuggest));
ast_copy_string(l->regexten, regexten, sizeof(l->regexten));
ast_copy_string(l->mailbox, mailbox, sizeof(l->mailbox));
- if (!ast_strlen_zero(mailbox)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Setting mailbox '%s' on %s@%s\n", mailbox, d->name, l->name);
- }
+ if (!ast_strlen_zero(mailbox))
+ ast_verb(3, "Setting mailbox '%s' on %s@%s\n", mailbox, d->name, l->name);
if (!ast_strlen_zero(device_vmexten))
ast_copy_string(l->vmexten, device_vmexten, sizeof(vmexten));
l->msgstate = -1;
int getforward=0;
int loop_pause = 100;
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Starting simple switch on '%s@%s'\n", l->name, d->name);
+ ast_verb(3, "Starting simple switch on '%s@%s'\n", l->name, d->name);
len = strlen(d->exten);
if (getforward) {
/* Record this as the forwarding extension */
ast_copy_string(l->call_forward, d->exten, sizeof(l->call_forward));
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Setting call forward to '%s' on channel %s\n",
+ ast_verb(3, "Setting call forward to '%s' on channel %s\n",
l->call_forward, c->name);
transmit_tone(s, SKINNY_DIALTONE);
if (res) {
}
if (skinnydebug)
- ast_verbose(VERBOSE_PREFIX_3 "skinny_call(%s)\n", ast->name);
+ ast_verb(3, "skinny_call(%s)\n", ast->name);
if (l->dnd) {
ast_queue_control(ast, AST_CONTROL_BUSY);
struct skinnysession *s = d->session;
if (skinnydebug)
- ast_verbose(VERBOSE_PREFIX_3 "Asked to indicate '%s' condition on channel %s\n", control2str(ind), ast->name);
+ ast_verb(3, "Asked to indicate '%s' condition on channel %s\n", control2str(ind), ast->name);
switch(ind) {
case AST_CONTROL_RINGING:
if (ast->_state != AST_STATE_UP) {
transmit_response(s, req);
return 0;
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Device '%s' successfully registered\n", name);
+ ast_verb(3, "Device '%s' successfully registered\n", name);
if (!(req = req_alloc(sizeof(struct register_ack_message), REGISTER_ACK_MESSAGE)))
return -1;
/* Do not disturb */
if (l->dnd != 0){
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Disabling DND on %s@%s\n", l->name, d->name);
+ ast_verb(3, "Disabling DND on %s@%s\n", l->name, d->name);
l->dnd = 0;
transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_ON);
transmit_displaynotify(s, "DnD disabled", 10);
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Enabling DND on %s@%s\n", l->name, d->name);
+ ast_verb(3, "Enabling DND on %s@%s\n", l->name, d->name);
l->dnd = 1;
transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_OFF);
transmit_displaynotify(s, "DnD enabled", 10);
/* Do not disturb */
if (l->dnd != 0){
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Disabling DND on %s@%s\n", l->name, d->name);
+ ast_verb(3, "Disabling DND on %s@%s\n", l->name, d->name);
l->dnd = 0;
transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_ON);
transmit_displaynotify(s, "DnD disabled", 10);
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Enabling DND on %s@%s\n", l->name, d->name);
+ ast_verb(3, "Enabling DND on %s@%s\n", l->name, d->name);
l->dnd = 1;
transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_OFF);
transmit_displaynotify(s, "DnD enabled", 10);
struct skinny_req *req;
struct skinnysession *s = data;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Starting Skinny session from %s\n", ast_inet_ntoa(s->sin.sin_addr));
+ ast_verb(3, "Starting Skinny session from %s\n", ast_inet_ntoa(s->sin.sin_addr));
for (;;) {
res = get_input(s);
ast_log(LOG_NOTICE, "No available lines on: %s\n", dest);
return NULL;
}
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "skinny_request(%s)\n", tmp);
- }
+ ast_verb(3, "skinny_request(%s)\n", tmp);
tmpc = skinny_new(l, AST_STATE_DOWN);
if (!tmpc) {
ast_log(LOG_WARNING, "Unable to make channel for '%s'\n", tmp);
} else {
d = build_device(cat, ast_variable_browse(cfg, cat));
if (d) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Added device '%s'\n", d->name);
+ ast_verb(3, "Added device '%s'\n", d->name);
ast_mutex_lock(&devicelock);
d->next = devices;
devices = d;
ast_config_destroy(cfg);
return 0;
}
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Skinny listening on %s:%d\n",
+ ast_verb(2, "Skinny listening on %s:%d\n",
ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
ast_pthread_create_background(&accept_t,NULL, accept_thread, NULL);
}
p1->bridge = &bridges[i];
} ast_mutex_unlock(&p1->lock);
- if (option_verbose>1)
- ast_verbose(VERBOSE_PREFIX_2 "%s: vpb_bridge: Bridging call entered with [%s, %s]\n",p0->dev, c0->name, c1->name);
+ ast_verb(2, "%s: vpb_bridge: Bridging call entered with [%s, %s]\n",p0->dev, c0->name, c1->name);
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name);
+ ast_verb(3, "Native bridging %s and %s\n", c0->name, c1->name);
#ifdef HALF_DUPLEX_BRIDGE
- if (option_verbose>1)
- ast_verbose(VERBOSE_PREFIX_2 "%s: vpb_bridge: Starting half-duplex bridge [%s, %s]\n",p0->dev, c0->name, c1->name);
+ ast_verb(2, "%s: vpb_bridge: Starting half-duplex bridge [%s, %s]\n",p0->dev, c0->name, c1->name);
int dir = 0;
vpb_play_buf_finish(p0->handle);
vpb_play_buf_finish(p1->handle);
- if (option_verbose>1)
- ast_verbose(VERBOSE_PREFIX_2 "%s: vpb_bridge: Finished half-duplex bridge [%s, %s]\n",p0->dev, c0->name, c1->name);
+ ast_verb(2, "%s: vpb_bridge: Finished half-duplex bridge [%s, %s]\n",p0->dev, c0->name, c1->name);
res = VPB_OK;
p1->bridge = NULL;
- if (option_verbose>1)
- ast_verbose(VERBOSE_PREFIX_2 "Bridging call done with [%s, %s] => %d\n", c0->name, c1->name, res);
+ ast_verb(2, "Bridging call done with [%s, %s] => %d\n", c0->name, c1->name, res);
/*
ast_mutex_unlock(&p0->lock);
if( ast_mutex_trylock(&p->record_lock) == 0 ) {
cid_record_time = ast_tvnow();
- if (option_verbose>3)
- ast_verbose(VERBOSE_PREFIX_4 "CID record - start\n");
+ ast_verb(4, "CID record - start\n");
/* Skip any trailing ringtone */
if (UsePolarityCID != 1){
vpb_sleep(RING_SKIP);
}
- if (option_verbose>3)
- ast_verbose(VERBOSE_PREFIX_4 "CID record - skipped %dms trailing ring\n",
+ ast_verb(4, "CID record - skipped %dms trailing ring\n",
ast_tvdiff_ms(ast_tvnow(), cid_record_time));
cid_record_time = ast_tvnow();
vpb_wave_close_write(ws);
#endif
- if (option_verbose>3)
- ast_verbose(VERBOSE_PREFIX_4 "CID record - recorded %dms between rings\n",
+ ast_verb(4, "CID record - recorded %dms between rings\n",
ast_tvdiff_ms(ast_tvnow(), cid_record_time));
ast_mutex_unlock(&p->record_lock);
strcpy(p->cid_name, cli_struct->cn);
}
- if (option_verbose>3)
- ast_verbose(VERBOSE_PREFIX_4 "CID record - got [%s] [%s]\n",owner->cid.cid_num,owner->cid.cid_name );
+ ast_verb(4, "CID record - got [%s] [%s]\n",owner->cid.cid_num,owner->cid.cid_name );
snprintf(p->callerid,sizeof(p->callerid)-1,"%s %s",cli_struct->cldn,cli_struct->cn);
}
else {
#endif
if(p->callerid_type == 1) {
- if (option_verbose>3) ast_verbose(VERBOSE_PREFIX_4 "Collected caller ID already\n");
+ ast_verb(4, "Collected caller ID already\n");
return;
}
else if(p->callerid_type == 2 ) {
which_cid=CID_SIG_V23;
- if (option_verbose>3) ast_verbose(VERBOSE_PREFIX_4 "Collecting Caller ID v23...\n");
+ ast_verb(4, "Collecting Caller ID v23...\n");
}
else if(p->callerid_type == 3) {
which_cid=CID_SIG_BELL;
- if (option_verbose>3) ast_verbose(VERBOSE_PREFIX_4 "Collecting Caller ID bell...\n");
+ ast_verb(4, "Collecting Caller ID bell...\n");
}
else {
- if (option_verbose>3)
- ast_verbose(VERBOSE_PREFIX_4 "Caller ID disabled\n");
+ ast_verb(4, "Caller ID disabled\n");
return;
}
/* vpb_sleep(RING_SKIP); */
vpb_wave_write(ws,(char*)buf,sizeof(buf));
#endif
sam_count+=sizeof(buf);
- if (option_verbose>3) ast_verbose(VERBOSE_PREFIX_4 "Collecting Caller ID samples [%d][%d]...\n",sam_count,rc);
+ ast_verb(4, "Collecting Caller ID samples [%d][%d]...\n",sam_count,rc);
}
vpb_record_buf_finish(p->handle);
#ifdef ANALYSE_CID
#endif
if (rc == 1){
callerid_get(cs, &name, &number, &flags);
- if (option_verbose>0)
- ast_verbose(VERBOSE_PREFIX_1 "%s: Caller ID name [%s] number [%s] flags [%d]\n",p->dev,name, number,flags);
+ ast_verb(1, "%s: Caller ID name [%s] number [%s] flags [%d]\n",p->dev,name, number,flags);
}
else {
ast_log(LOG_ERROR, "%s: Failed to decode Caller ID \n", p->dev );
vpb_tone_terminate(handle);
ret = vpb_get_event_ch_async(handle,&je);
if ((ret == VPB_OK)&&(je.type != VPB_DIALEND)){
- if (option_verbose > 3){
- ast_verbose(VERBOSE_PREFIX_4 "Stop tone collected a wrong event!![%d]\n",je.type);
- }
+ ast_verb(4, "Stop tone collected a wrong event!![%d]\n",je.type);
/* vpb_put_event(&je); */
}
vpb_sleep(10);
{
int ret=VPB_OK;
stoptone(handle);
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "[%02d]: Playing tone\n", handle);
+ ast_verb(4, "[%02d]: Playing tone\n", handle);
ret = vpb_playtone_async(handle, tone);
return ret;
}
int endbridge = 0;
int res=0;
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: handle_owned: got event: [%d=>%d]\n", p->dev, e->type, e->data);
+ ast_verb(4, "%s: handle_owned: got event: [%d=>%d]\n", p->dev, e->type, e->data);
f.src = "vpb";
switch (e->type) {
case VPB_TONEDETECT:
if (e->data == VPB_BUSY || e->data == VPB_BUSY_308 || e->data == VPB_BUSY_AUST ) {
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: handle_owned: got event: BUSY\n", p->dev);
+ ast_verb(4, "%s: handle_owned: got event: BUSY\n", p->dev);
if (p->owner->_state == AST_STATE_UP) {
f.subclass = AST_CONTROL_HANGUP;
}
const char *target_context = S_OR(p->owner->macrocontext, p->owner->context);
if (ast_exists_extension(p->owner, target_context, "fax", 1, p->owner->cid.cid_num)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Redirecting %s to fax extension\n", p->owner->name);
+ ast_verb(3, "Redirecting %s to fax extension\n", p->owner->name);
/* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
pbx_builtin_setvar_helper(p->owner, "FAXEXTEN", p->owner->exten);
if (ast_async_goto(p->owner, target_context, "fax", 1))
if ( ast_tvdiff_ms(ast_tvnow(), p->lastgrunt) > gruntdetect_timeout ) {
/* Nothing heard on line for a very long time
* Timeout connection */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "grunt timeout\n");
+ ast_verb(3, "grunt timeout\n");
ast_log(LOG_NOTICE,"%s: Line hangup due of lack of conversation\n",p->dev);
f.subclass = AST_CONTROL_HANGUP;
} else {
case VPB_DIALEND:
if (p->state < 5){
f.subclass = AST_CONTROL_ANSWER;
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "%s: Dialend\n", p->dev);
+ ast_verb(2, "%s: Dialend\n", p->dev);
} else {
f.frametype = AST_FRAME_NULL;
}
}
/*
- if (option_verbose > 3) ast_verbose("%s: LOCKING in handle_owned [%d]\n", p->dev,res);
+ ast_verb(4, "%s: LOCKING in handle_owned [%d]\n", p->dev,res);
res = ast_mutex_lock(&p->lock);
- if (option_verbose > 3) ast_verbose("%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+ ast_verb(4, "%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
*/
{
if (p->bridge) { /* Check what happened, see if we need to report it. */
if (endbridge){
res = ast_mutex_unlock(&p->lock);
/*
- if (option_verbose > 3) ast_verbose("%s: unLOCKING in handle_owned [%d]\n", p->dev,res);
+ ast_verb(4, "%s: unLOCKING in handle_owned [%d]\n", p->dev,res);
*/
return 0;
}
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: handle_owned: Prepared frame type[%d]subclass[%d], bridge=%p owner=[%s]\n",
+ ast_verb(4, "%s: handle_owned: Prepared frame type[%d]subclass[%d], bridge=%p owner=[%s]\n",
p->dev, f.frametype, f.subclass, (void *)p->bridge, p->owner->name);
/* Trylock used here to avoid deadlock that can occur if we
if (ast_mutex_trylock(&p->owner->lock)==0) {
ast_queue_frame(p->owner, &f);
ast_mutex_unlock(&p->owner->lock);
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: handled_owned: Queued Frame to [%s]\n", p->dev,p->owner->name);
+ ast_verb(4, "%s: handled_owned: Queued Frame to [%s]\n", p->dev,p->owner->name);
} else {
ast_verbose("%s: handled_owned: Missed event %d/%d \n",
p->dev,f.frametype, f.subclass);
}
res = ast_mutex_unlock(&p->lock);
/*
- if (option_verbose > 3) ast_verbose("%s: unLOCKING in handle_owned [%d]\n", p->dev,res);
+ ast_verb(4, "%s: unLOCKING in handle_owned [%d]\n", p->dev,res);
*/
return 0;
struct ast_channel *c;
*/
- if (option_verbose > 3) {
char str[VPB_MAX_STR];
vpb_translate_event(e, str);
- ast_verbose(VERBOSE_PREFIX_4 "%s: handle_notowned: mode=%d, event[%d][%s]=[%d]\n",
- p->dev, p->mode, e->type,str, e->data);
- }
+ ast_verb(4, "%s: handle_notowned: mode=%d, event[%d][%s]=[%d]\n", p->dev, p->mode, e->type,str, e->data);
switch(e->type) {
case VPB_LOOP_ONHOOK:
case VPB_LOOP_POLARITY:
if (UsePolarityCID == 1){
- if (option_verbose>3)
- ast_verbose(VERBOSE_PREFIX_4 "Polarity reversal\n");
+ ast_verb(4, "Polarity reversal\n");
if(p->callerid_type == 1) {
- if (option_verbose>3)
- ast_verbose(VERBOSE_PREFIX_4 "Using VPB Caller ID\n");
+ ast_verb(4, "Using VPB Caller ID\n");
get_callerid(p); /* UK CID before 1st ring*/
}
/* get_callerid_ast(p); */ /* Caller ID using the ast functions */
vpb_new(p, AST_STATE_RING, p->context);
if (UsePolarityCID != 1){
if(p->callerid_type == 1) {
- if (option_verbose>3)
- ast_verbose(VERBOSE_PREFIX_4 "Using VPB Caller ID\n");
+ ast_verb(4, "Using VPB Caller ID\n");
get_callerid(p); /* Australian CID only between 1st and 2nd ring */
}
get_callerid_ast(p); /* Caller ID using the ast functions */
if (p->mode == MODE_IMMEDIATE)
vpb_new(p,AST_STATE_RING, p->context);
else {
- ast_verbose(VERBOSE_PREFIX_4 "%s: handle_notowned: playing dialtone\n",p->dev);
+ ast_verb(4, "%s: handle_notowned: playing dialtone\n",p->dev);
playtone(p->handle, &Dialtone);
p->state=VPB_STATE_PLAYDIAL;
p->wantdtmf = 1;
}
*/
} else {
- ast_verbose(VERBOSE_PREFIX_4 "%s: handle_notowned: Got a DIALEND when not really expected\n",p->dev);
+ ast_verb(4, "%s: handle_notowned: Got a DIALEND when not really expected\n",p->dev);
}
break;
case VPB_TIMEREXP:
if (e->data == p->dtmfidd_timer_id) {
if (ast_exists_extension(NULL, p->context, p->ext, 1, p->callerid)){
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: handle_notowned: DTMF IDD timer out, matching on [%s] in [%s]\n", p->dev,p->ext , p->context);
+ ast_verb(4, "%s: handle_notowned: DTMF IDD timer out, matching on [%s] in [%s]\n", p->dev,p->ext , p->context);
vpb_new(p,AST_STATE_RING, p->context);
}
}
else if ( e->data == DTMF_CID_STOP ) { /* CallerID End signal */
p->callerid[p->dtmf_caller_pos] = '\0';
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 " %s: DTMF CallerID %s\n",p->dev,p->callerid);
+ ast_verb(3, " %s: DTMF CallerID %s\n",p->dev,p->callerid);
if (owner){
/*
if (owner->cid.cid_num)
ast_callerid_split(p->callerid, cid_name, sizeof(cid_name), cid_num, sizeof(cid_num));
ast_set_callerid(owner, cid_num, cid_name, cid_num);
- }
- else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 " %s: DTMF CallerID: no owner to assign CID \n",p->dev);
- }
+ } else
+ ast_verb(3, " %s: DTMF CallerID: no owner to assign CID \n",p->dev);
} else if ( p->dtmf_caller_pos < AST_MAX_EXTENSION ) {
if ( p->dtmf_caller_pos >= 0 )
p->callerid[p->dtmf_caller_pos] = e->data;
#endif
if (ast_exists_extension(NULL, p->context, p->ext, 1, p->callerid)){
if ( ast_canmatch_extension(NULL, p->context, p->ext, 1, p->callerid)){
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: handle_notowned: Multiple matches on [%s] in [%s]\n", p->dev,p->ext , p->context);
+ ast_verb(4, "%s: handle_notowned: Multiple matches on [%s] in [%s]\n", p->dev,p->ext , p->context);
/* Start DTMF IDD timer */
vpb_timer_stop(p->dtmfidd_timer);
vpb_timer_start(p->dtmfidd_timer);
}
else {
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: handle_notowned: Matched on [%s] in [%s]\n", p->dev,p->ext , p->context);
+ ast_verb(4, "%s: handle_notowned: Matched on [%s] in [%s]\n", p->dev,p->ext , p->context);
vpb_new(p,AST_STATE_UP, p->context);
}
} else if (!ast_canmatch_extension(NULL, p->context, p->ext, 1, p->callerid)){
if (ast_exists_extension(NULL, "default", p->ext, 1, p->callerid)) {
vpb_new(p,AST_STATE_UP, "default");
} else if (!ast_canmatch_extension(NULL, "default", p->ext, 1, p->callerid)) {
- if (option_verbose > 3) {
- ast_verbose(VERBOSE_PREFIX_4 "%s: handle_notowned: can't match anything in %s or default\n", p->dev, p->context);
- }
+ ast_verb(4, "%s: handle_notowned: can't match anything in %s or default\n", p->dev, p->context);
playtone(p->handle, &Busytone);
vpb_timer_stop(p->busy_timer);
vpb_timer_start(p->busy_timer);
break;
}
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: handle_notowned: mode=%d, [%d=>%d]\n",
- p->dev, p->mode, e->type, e->data);
+ ast_verb(4, "%s: handle_notowned: mode=%d, [%d=>%d]\n", p->dev, p->mode, e->type, e->data);
return 0;
}
/* Monitor thread, doesn't die until explicitly killed. */
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Starting vpb monitor thread[%ld]\n",
+ ast_verb(2, "Starting vpb monitor thread[%ld]\n",
pthread_self());
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
struct vpb_pvt *p;
/*
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "Monitor waiting for event\n");
+ ast_verb(4, "Monitor waiting for event\n");
*/
int res = vpb_get_event_sync(&e, VPB_WAIT_TIMEOUT);
if( (res==VPB_NO_EVENTS) || (res==VPB_TIME_OUT) ){
/*
- if (option_verbose > 3){
if (res == VPB_NO_EVENTS){
- ast_verbose(VERBOSE_PREFIX_4 "No events....\n");
+ ast_verb(4, "No events....\n");
} else {
- ast_verbose(VERBOSE_PREFIX_4 "No events, timed out....\n");
+ ast_verb(4, "No events, timed out....\n");
}
- }
*/
continue;
}
p = NULL;
ast_mutex_lock(&monlock); {
-
- if (e.type == VPB_NULL_EVENT) {
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "Monitor got null event\n");
- }
+ //XXX useless braces, remove them and fix indenting
+ if (e.type == VPB_NULL_EVENT)
+ ast_verb(4, "Monitor got null event\n");
else {
vpb_translate_event(&e, str);
if (strlen(str)>1){
p = p->next;
} ast_mutex_unlock(&iflock);
- if (p && (option_verbose > 3))
- ast_verbose(VERBOSE_PREFIX_4 "%s: Event [%d=>%s] \n",
+ if (p)
+ ast_verb(4, "%s: Event [%d=>%s] \n",
p ? p->dev : "null", e.type, str );
}
if (!p) {
if (e.type != VPB_NULL_EVENT){
ast_log(LOG_WARNING, "Got event [%s][%d], no matching iface!\n", str,e.type);
- if (option_verbose > 3){
- ast_verbose(VERBOSE_PREFIX_4 "vpb/ERR: No interface for Event [%d=>%s] \n",e.type,str );
+ ast_verb(4, "vpb/ERR: No interface for Event [%d=>%s] \n",e.type,str );
}
- }
continue;
}
/* flush the event from the channel event Q */
vpb_get_event_ch_async(e.handle,&je);
- if (option_verbose > 4){
vpb_translate_event(&je, str);
- ast_verbose("%s: Flushing event [%d]=>%s\n",p->dev,je.type,str);
- }
+ ast_verb(5, "%s: Flushing event [%d]=>%s\n",p->dev,je.type,str);
/* Check for ownership and locks */
if ((p->owner)&&(!p->golock)){
if (mthreadactive == -2)
return 0;
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "Restarting monitor\n");
+ ast_verb(4, "Restarting monitor\n");
ast_mutex_lock(&monlock); {
if (monitor_thread == pthread_self()) {
ast_log(LOG_WARNING, "Cannot kill myself\n");
error = -1;
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "Monitor trying to kill monitor\n");
+ ast_verb(4, "Monitor trying to kill monitor\n");
}
else {
if (mthreadactive != -1) {
e.type = VPB_NULL_EVENT;
e.data = 0;
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "Trying to reawake monitor\n");
+ ast_verb(4, "Trying to reawake monitor\n");
vpb_put_event(&e);
} else {
/* Start a new monitor */
int pid = ast_pthread_create(&monitor_thread, NULL, do_monitor, NULL);
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "Created new monitor thread %d\n",pid);
+ ast_verb(4, "Created new monitor thread %d\n",pid);
if (pid < 0) {
ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
error = -1;
}
} ast_mutex_unlock(&monlock);
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "Monitor restarted\n");
+ ast_verb(4, "Monitor restarted\n");
return error;
}
int tmp = 0;
if (use_ast_ind == 1) {
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: vpb_indicate called when using Ast Indications !?!\n", p->dev);
+ ast_verb(4, "%s: vpb_indicate called when using Ast Indications !?!\n", p->dev);
return 0;
}
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: vpb_indicate [%d] state[%d]\n", p->dev, condition,ast->_state);
+ ast_verb(4, "%s: vpb_indicate [%d] state[%d]\n", p->dev, condition,ast->_state);
/*
if (ast->_state != AST_STATE_UP) {
- ast_verbose(VERBOSE_PREFIX_4 "%s: vpb_indicate Not in AST_STATE_UP\n", p->dev, condition,ast->_state);
+ ast_verb(4, "%s: vpb_indicate Not in AST_STATE_UP\n", p->dev, condition,ast->_state);
return res;
}
*/
/*
- if (option_verbose > 3) ast_verbose("%s: LOCKING in indicate \n", p->dev);
- if (option_verbose > 3) ast_verbose("%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+ ast_verb(4, "%s: LOCKING in indicate \n", p->dev);
+ ast_verb(4, "%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
*/
ast_mutex_lock(&p->lock);
switch(condition) {
if (ast->_state == AST_STATE_UP) {
playtone(p->handle, &Ringbacktone);
p->state = VPB_STATE_PLAYRING;
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: vpb indicate: setting ringback timer [%d]\n", p->dev,p->ringback_timer_id);
+ ast_verb(4, "%s: vpb indicate: setting ringback timer [%d]\n", p->dev,p->ringback_timer_id);
vpb_timer_stop(p->ringback_timer);
vpb_timer_start(p->ringback_timer);
}
tmp = ast_mutex_unlock(&p->lock);
/*
- if (option_verbose > 3) ast_verbose("%s: unLOCKING in indicate [%d]\n", p->dev,tmp);
+ ast_verb(4, "%s: unLOCKING in indicate [%d]\n", p->dev,tmp);
*/
return res;
}
int res = 0;
/*
- if (option_verbose > 3) ast_verbose("%s: LOCKING in fixup \n", p->dev);
- if (option_verbose > 3) ast_verbose("%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+ ast_verb(4, "%s: LOCKING in fixup \n", p->dev);
+ ast_verb(4, "%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
*/
ast_mutex_lock(&p->lock);
ast_debug(1, "New owner for channel %s is %s\n", p->dev, newchan->name);
if (newchan->_state == AST_STATE_RINGING){
if (use_ast_ind == 1) {
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: vpb_fixup Calling ast_indicate\n", p->dev);
+ ast_verb(4, "%s: vpb_fixup Calling ast_indicate\n", p->dev);
ast_indicate(newchan, AST_CONTROL_RINGING);
}
else {
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: vpb_fixup Calling vpb_indicate\n", p->dev);
+ ast_verb(4, "%s: vpb_fixup Calling vpb_indicate\n", p->dev);
vpb_indicate(newchan, AST_CONTROL_RINGING, NULL, 0);
}
}
res= ast_mutex_unlock(&p->lock);
/*
- if (option_verbose > 3) ast_verbose("%s: unLOCKING in fixup [%d]\n", p->dev,res);
+ ast_verb(4, "%s: unLOCKING in fixup [%d]\n", p->dev,res);
*/
return 0;
}
int res = 0;
if (use_ast_dtmf){
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: vpb_digit: asked to play digit[%c] but we are using asterisk dtmf play back?!\n", p->dev, digit);
+ ast_verb(4, "%s: vpb_digit: asked to play digit[%c] but we are using asterisk dtmf play back?!\n", p->dev, digit);
return 0;
}
/*
- if (option_verbose > 3) ast_verbose("%s: LOCKING in digit \n", p->dev);
- if (option_verbose > 3) ast_verbose("%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+ ast_verb(4, "%s: LOCKING in digit \n", p->dev);
+ ast_verb(4, "%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
*/
ast_mutex_lock(&p->lock);
s[0] = digit;
s[1] = '\0';
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: vpb_digit: asked to play digit[%s]\n", p->dev, s);
+ ast_verb(4, "%s: vpb_digit: asked to play digit[%s]\n", p->dev, s);
ast_mutex_lock(&p->play_dtmf_lock);
strncat(p->play_dtmf,s,sizeof(*p->play_dtmf));
res = ast_mutex_unlock(&p->lock);
/*
- if (option_verbose > 3) ast_verbose("%s: unLOCKING in digit [%d]\n", p->dev,res);
+ ast_verb(4, "%s: unLOCKING in digit [%d]\n", p->dev,res);
*/
return 0;
}
int tmp = 0;
/*
- if (option_verbose > 3) ast_verbose("%s: LOCKING in call \n", p->dev);
- if (option_verbose > 3) ast_verbose("%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+ ast_verb(4, "%s: LOCKING in call \n", p->dev);
+ ast_verb(4, "%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
*/
ast_mutex_lock(&p->lock);
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: starting call to [%s]\n", p->dev,dest);
+ ast_verb(4, "%s: starting call to [%s]\n", p->dev,dest);
if (s)
s = s + 1;
ast_log(LOG_WARNING, "vpb_call on %s neither down nor reserved!\n", ast->name);
tmp = ast_mutex_unlock(&p->lock);
/*
- if (option_verbose > 3) ast_verbose("%s: unLOCKING in call [%d]\n", p->dev,tmp);
+ ast_verb(4, "%s: unLOCKING in call [%d]\n", p->dev,tmp);
*/
return -1;
}
memcpy( &call.tone_map, DialToneMap, sizeof(DialToneMap) );
vpb_set_call(p->handle, &call);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "%s: Calling %s on %s \n",p->dev, dialstring, ast->name);
+ ast_verb(2, "%s: Calling %s on %s \n",p->dev, dialstring, ast->name);
- if (option_verbose > 2) {
int j;
- ast_verbose(VERBOSE_PREFIX_2 "%s: Dial parms for %s %d/%dms/%dms/%dms/%dms\n", p->dev
+ ast_verb(2, "%s: Dial parms for %s %d/%dms/%dms/%dms/%dms\n", p->dev
, ast->name, call.dialtones, call.dialtone_timeout
, call.ringback_timeout, call.inter_ringback_timeout
, call.answer_timeout );
for( j=0; !call.tone_map[j].terminate; j++ )
- ast_verbose(VERBOSE_PREFIX_2 "%s: Dial parms for %s tone %d->%d\n", p->dev,
+ ast_verb(2, "%s: Dial parms for %s tone %d->%d\n", p->dev,
ast->name, call.tone_map[j].tone_id, call.tone_map[j].call_id);
- }
- if (option_verbose > 3)
- ast_verbose("%s: Disabling Loop Drop detection\n",p->dev);
+ ast_verb(4, "%s: Disabling Loop Drop detection\n",p->dev);
vpb_disable_event(p->handle, VPB_MDROP);
vpb_sethook_sync(p->handle,VPB_OFFHOOK);
p->state=VPB_STATE_OFFHOOK;
#ifndef DIAL_WITH_CALL_PROGRESS
vpb_sleep(300);
- if (option_verbose > 3)
- ast_verbose("%s: Enabling Loop Drop detection\n",p->dev);
+ ast_verb(4, "%s: Enabling Loop Drop detection\n",p->dev);
vpb_enable_event(p->handle, VPB_MDROP);
res = vpb_dial_async(p->handle, dialstring);
#else
- if (option_verbose > 3)
- ast_verbose("%s: Enabling Loop Drop detection\n",p->dev);
+ ast_verb(4, "%s: Enabling Loop Drop detection\n",p->dev);
vpb_enable_event(p->handle, VPB_MDROP);
res = vpb_call_async(p->handle, dialstring);
#endif
res = 0;
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s: VPB Calling %s [t=%d] on %s returned %d\n",p->dev , s, timeout, ast->name, res);
+ ast_verb(3, "%s: VPB Calling %s [t=%d] on %s returned %d\n",p->dev , s, timeout, ast->name, res);
if (res == 0) {
ast_setstate(ast, AST_STATE_RINGING);
ast_queue_control(ast,AST_CONTROL_RINGING);
tmp = ast_mutex_unlock(&p->lock);
/*
- if (option_verbose > 3) ast_verbose("%s: unLOCKING in call [%d]\n", p->dev,tmp);
+ ast_verb(4, "%s: unLOCKING in call [%d]\n", p->dev,tmp);
*/
return res;
}
int res =0 ;
/*
- if (option_verbose > 3) ast_verbose("%s: LOCKING in hangup \n", p->dev);
- if (option_verbose > 3) ast_verbose("%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
- if (option_verbose > 3) ast_verbose("%s: LOCKING pthread_self(%d)\n", p->dev,pthread_self());
+ ast_verb(4, "%s: LOCKING in hangup \n", p->dev);
+ ast_verb(4, "%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+ ast_verb(4, "%s: LOCKING pthread_self(%d)\n", p->dev,pthread_self());
ast_mutex_lock(&p->lock);
*/
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "%s: Hangup requested\n", ast->name);
+ ast_verb(2, "%s: Hangup requested\n", ast->name);
if (!ast->tech || !ast->tech_pvt) {
ast_log(LOG_WARNING, "%s: channel not connected?\n", ast->name);
res = ast_mutex_unlock(&p->lock);
/*
- if (option_verbose > 3) ast_verbose("%s: unLOCKING in hangup [%d]\n", p->dev,res);
+ ast_verb(4, "%s: unLOCKING in hangup [%d]\n", p->dev,res);
*/
/* Free up ast dsp if we have one */
if ((use_ast_dtmfdet)&&(p->vad)) {
p->stopreads = 1;
if( p->readthread ){
pthread_join(p->readthread, NULL);
- if(option_verbose>3)
- ast_verbose( VERBOSE_PREFIX_4 "%s: stopped record thread \n",ast->name);
+ ast_verb(4, "%s: stopped record thread \n",ast->name);
}
/* Stop play */
if (p->lastoutput != -1) {
- if(option_verbose>1)
- ast_verbose( VERBOSE_PREFIX_2 "%s: Ending play mode \n",ast->name);
+ ast_verb(2, "%s: Ending play mode \n",ast->name);
vpb_play_terminate(p->handle);
ast_mutex_lock(&p->play_lock); {
vpb_play_buf_finish(p->handle);
} ast_mutex_unlock(&p->play_lock);
}
- if(option_verbose>3)
- ast_verbose( VERBOSE_PREFIX_4 "%s: Setting state down\n",ast->name);
+ ast_verb(4, "%s: Setting state down\n",ast->name);
ast_setstate(ast,AST_STATE_DOWN);
/*
- if (option_verbose > 3) ast_verbose("%s: LOCKING in hangup \n", p->dev);
- if (option_verbose > 3) ast_verbose("%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
- if (option_verbose > 3) ast_verbose("%s: LOCKING pthread_self(%d)\n", p->dev,pthread_self());
+ ast_verb(4, "%s: LOCKING in hangup \n", p->dev);
+ ast_verb(4, "%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+ ast_verb(4, "%s: LOCKING pthread_self(%d)\n", p->dev,pthread_self());
*/
ast_mutex_lock(&p->lock);
/* This is causing a "dial end" "play tone" loop
playtone(p->handle, &Busytone);
p->state = VPB_STATE_PLAYBUSY;
- if(option_verbose>4)
- ast_verbose( VERBOSE_PREFIX_4 "%s: Station offhook[%d], playing busy tone\n",
+ ast_verb(5, "%s: Station offhook[%d], playing busy tone\n",
ast->name,p->state);
*/
}
p->state=VPB_STATE_ONHOOK;
}
while (VPB_OK==vpb_get_event_ch_async(p->handle,&je)){
- if(option_verbose>3) {
vpb_translate_event(&je, str);
- ast_verbose( VERBOSE_PREFIX_4 "%s: Flushing event [%d]=>%s\n",ast->name,je.type,str);
+ ast_verb(4, "%s: Flushing event [%d]=>%s\n",ast->name,je.type,str);
}
- }
p->readthread = 0;
p->lastoutput = -1;
p->vad = NULL;
}
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "%s: Hangup complete\n", ast->name);
+ ast_verb(2, "%s: Hangup complete\n", ast->name);
restart_monitor();
/*
- if (option_verbose > 3) ast_verbose("%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+ ast_verb(4, "%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
*/
res = ast_mutex_unlock(&p->lock);
/*
- if (option_verbose > 3) ast_verbose("%s: unLOCKING in hangup [%d]\n", p->dev,res);
- if (option_verbose > 3) ast_verbose("%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+ ast_verb(4, "%s: unLOCKING in hangup [%d]\n", p->dev,res);
+ ast_verb(4, "%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
*/
return 0;
}
/*
VPB_EVENT je;
int ret;
- if (option_verbose > 3) ast_verbose("%s: LOCKING in answer \n", p->dev);
- if (option_verbose > 3) ast_verbose("%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
+ ast_verb(4, "%s: LOCKING in answer \n", p->dev);
+ ast_verb(4, "%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
*/
ast_mutex_lock(&p->lock);
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: Answering channel\n",p->dev);
+ ast_verb(4, "%s: Answering channel\n",p->dev);
if (p->mode == MODE_FXO){
- if (option_verbose > 3)
- ast_verbose("%s: Disabling Loop Drop detection\n",p->dev);
+ ast_verb(4, "%s: Disabling Loop Drop detection\n",p->dev);
vpb_disable_event(p->handle, VPB_MDROP);
}
/* vpb_sleep(500);
ret = vpb_get_event_ch_async(p->handle,&je);
if ((ret == VPB_OK)&&((je.type != VPB_DROP)&&(je.type != VPB_RING))){
- if (option_verbose > 3){
- ast_verbose(VERBOSE_PREFIX_4 "%s: Answer collected a wrong event!!\n",p->dev);
- }
+ ast_verb(4, "%s: Answer collected a wrong event!!\n",p->dev);
vpb_put_event(&je);
}
*/
}
ast_setstate(ast, AST_STATE_UP);
- if(option_verbose>1)
-/*
- ast_verbose( VERBOSE_PREFIX_2 "%s: Answered call from %s on %s [%s]\n", p->dev,
- p->owner->callerid, ast->name,(p->mode == MODE_FXO)?"FXO":"FXS");
-*/
- ast_verbose( VERBOSE_PREFIX_2 "%s: Answered call on %s [%s]\n", p->dev,
+ ast_verb(2, "%s: Answered call on %s [%s]\n", p->dev,
ast->name,(p->mode == MODE_FXO)?"FXO":"FXS");
ast->rings = 0;
/* ast_verbose("%s: unLOCKING in answer [%d]\n", p->dev,res); */
ast_pthread_create(&p->readthread, NULL, do_chanreads, (void *)p);
} else {
- if(option_verbose>3)
- ast_verbose(VERBOSE_PREFIX_4 "%s: Record thread already running!!\n",p->dev);
+ ast_verb(4, "%s: Record thread already running!!\n",p->dev);
}
} else {
- if(option_verbose>3) {
- ast_verbose(VERBOSE_PREFIX_4 "%s: Answered state is up\n",p->dev);
- }
+ ast_verb(4, "%s: Answered state is up\n",p->dev);
/* res = ast_mutex_unlock(&p->lock); */
/* ast_verbose("%s: unLOCKING in answer [%d]\n", p->dev,res); */
}
vpb_sleep(500);
if (p->mode == MODE_FXO){
- if (option_verbose > 3)
- ast_verbose("%s: Re-enabling Loop Drop detection\n",p->dev);
+ ast_verb(4, "%s: Re-enabling Loop Drop detection\n",p->dev);
vpb_enable_event(p->handle,VPB_MDROP);
}
res = ast_mutex_unlock(&p->lock);
/*
- if(option_verbose>3) ast_verbose("%s: unLOCKING in answer [%d]\n", p->dev,res);
+ ast_verb(4, "%s: unLOCKING in answer [%d]\n", p->dev,res);
*/
return 0;
}
int tdiff;
/* ast_mutex_lock(&p->lock); */
- if(option_verbose>5)
- ast_verbose("%s: vpb_write: Writing to channel\n", p->dev);
+ ast_verb(6, "%s: vpb_write: Writing to channel\n", p->dev);
if (frame->frametype != AST_FRAME_VOICE) {
- if(option_verbose>3)
- ast_verbose("%s: vpb_write: Don't know how to handle from type %d\n", ast->name, frame->frametype);
+ ast_verb(4, "%s: vpb_write: Don't know how to handle from type %d\n", ast->name, frame->frametype);
/* ast_mutex_unlock(&p->lock); */
return 0;
} else if (ast->_state != AST_STATE_UP) {
- if(option_verbose>3)
- ast_verbose("%s: vpb_write: Attempt to Write frame type[%d]subclass[%d] on not up chan(state[%d])\n",ast->name, frame->frametype, frame->subclass,ast->_state);
+ ast_verb(4, "%s: vpb_write: Attempt to Write frame type[%d]subclass[%d] on not up chan(state[%d])\n",ast->name, frame->frametype, frame->subclass,ast->_state);
p->lastoutput = -1;
/* ast_mutex_unlock(&p->lock); */
return 0;
/* Check if we have set up the play_buf */
if (p->lastoutput == -1) {
vpb_play_buf_start(p->handle, fmt);
- if(option_verbose>1) {
- ast_verbose("%s: vpb_write: Starting play mode (codec=%d)[%s]\n",p->dev,fmt,ast2vpbformatname(frame->subclass));
- }
+ ast_verb(2, "%s: vpb_write: Starting play mode (codec=%d)[%s]\n",p->dev,fmt,ast2vpbformatname(frame->subclass));
p->lastoutput = fmt;
ast_mutex_unlock(&p->play_lock);
return 0;
} else if (p->lastoutput != fmt) {
vpb_play_buf_finish(p->handle);
vpb_play_buf_start(p->handle, fmt);
- if(option_verbose>1)
- ast_verbose("%s: vpb_write: Changed play format (%d=>%d)\n",p->dev,p->lastoutput,fmt);
+ ast_verb(2, "%s: vpb_write: Changed play format (%d=>%d)\n",p->dev,p->lastoutput,fmt);
ast_mutex_unlock(&p->play_lock);
return 0;
}
play_buf_time_start = ast_tvnow();
/* res = vpb_play_buf_sync(p->handle, (char*)frame->data, tdiff*8*2); */
res = vpb_play_buf_sync(p->handle, (char*)frame->data, frame->datalen);
- if( res == VPB_OK && option_verbose > 5 ) {
+ if(res == VPB_OK) {
short * data = (short*)frame->data;
- ast_verbose("%s: vpb_write: Wrote chan (codec=%d) %d %d\n", p->dev, fmt, data[0],data[1]);
+ ast_verb(6, "%s: vpb_write: Wrote chan (codec=%d) %d %d\n", p->dev, fmt, data[0],data[1]);
}
p->play_buf_time = ast_tvdiff_ms(ast_tvnow(), play_buf_time_start);
}
ast_mutex_unlock(&p->play_lock);
/* ast_mutex_unlock(&p->lock); */
- if(option_verbose>5)
- ast_verbose("%s: vpb_write: Done Writing to channel\n", p->dev);
+ ast_verb(6, "%s: vpb_write: Done Writing to channel\n", p->dev);
return 0;
}
fr->offset = AST_FRIENDLY_OFFSET;
memset(p->buf, 0, sizeof p->buf);
- if (option_verbose > 2) {
- ast_verbose("%s: chanreads: starting thread\n", p->dev);
- }
+ ast_verb(3, "%s: chanreads: starting thread\n", p->dev);
ast_mutex_lock(&p->record_lock);
p->stopreads = 0;
p->read_state = 1;
while (!p->stopreads && p->owner) {
- if (option_verbose > 4)
- ast_verbose("%s: chanreads: Starting cycle ...\n", p->dev);
- if (option_verbose > 4)
- ast_verbose("%s: chanreads: Checking bridge \n", p->dev);
+ ast_verb(5, "%s: chanreads: Starting cycle ...\n", p->dev);
+ ast_verb(5, "%s: chanreads: Checking bridge \n", p->dev);
if (p->bridge) {
if (p->bridge->c0 == p->owner && (p->bridge->flags & AST_BRIDGE_REC_CHANNEL_0))
bridgerec = 1;
else
bridgerec = 0;
} else {
- if (option_verbose > 4)
- ast_verbose("%s: chanreads: No native bridge.\n", p->dev);
+ ast_verb(5, "%s: chanreads: No native bridge.\n", p->dev);
if (p->owner->_bridge){
- if (option_verbose > 4){
- ast_verbose("%s: chanreads: Got Asterisk bridge with [%s].\n", p->dev,p->owner->_bridge->name);
- }
+ ast_verb(5, "%s: chanreads: Got Asterisk bridge with [%s].\n", p->dev,p->owner->_bridge->name);
bridgerec = 1;
}
else {
/* if ( (p->owner->_state != AST_STATE_UP) || !bridgerec) */
if ( (p->owner->_state != AST_STATE_UP) )
{
- if (option_verbose > 4) {
if (p->owner->_state != AST_STATE_UP)
- ast_verbose("%s: chanreads: Im not up[%d]\n", p->dev,p->owner->_state);
+ ast_verb(5, "%s: chanreads: Im not up[%d]\n", p->dev,p->owner->_state);
else
- ast_verbose("%s: chanreads: No bridgerec[%d]\n", p->dev,bridgerec);
- }
+ ast_verb(5, "%s: chanreads: No bridgerec[%d]\n", p->dev,bridgerec);
vpb_sleep(10);
continue;
}
ignore_dtmf = 0;
if(( ignore_dtmf != p->last_ignore_dtmf ) &&(!use_ast_dtmfdet)){
- if(option_verbose>1)
- ast_verbose( VERBOSE_PREFIX_2 "%s:Now %s DTMF \n",
+ ast_verb(2, "%s:Now %s DTMF \n",
p->dev, ignore_dtmf ? "ignoring" : "listening for");
vpb_set_event_mask(p->handle, ignore_dtmf ? VPB_EVENTS_NODTMF : VPB_EVENTS_ALL );
}
/* Play DTMF digits here to avoid problem you get if playing a digit during
* a record operation
*/
- if (option_verbose > 5) {
- ast_verbose("%s: chanreads: Checking dtmf's \n", p->dev);
- }
+ ast_verb(6, "%s: chanreads: Checking dtmf's \n", p->dev);
ast_mutex_lock(&p->play_dtmf_lock);
if( p->play_dtmf[0] ) {
/* Try to ignore DTMF event we get after playing digit */
vpb_set_event_mask(p->handle, VPB_EVENTS_NODTMF );
if (p->bridge == NULL){
vpb_dial_sync(p->handle,p->play_dtmf);
- if(option_verbose>1)
- ast_verbose( VERBOSE_PREFIX_2 "%s: chanreads: Played DTMF %s\n",p->dev,p->play_dtmf);
+ ast_verb(2, "%s: chanreads: Played DTMF %s\n",p->dev,p->play_dtmf);
}
else {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "%s: chanreads: Not playing DTMF frame on native bridge\n", p->dev);
+ ast_verb(2, "%s: chanreads: Not playing DTMF frame on native bridge\n", p->dev);
}
p->play_dtmf[0] = '\0';
ast_mutex_unlock(&p->play_dtmf_lock);
vpb_record_buf_start(p->handle, fmt);
vpb_reset_record_fifo_alarm(p->handle);
p->lastinput = fmt;
- if(option_verbose>1)
- ast_verbose( VERBOSE_PREFIX_2 "%s: Starting record mode (codec=%d)[%s]\n",p->dev,fmt,ast2vpbformatname(afmt));
+ ast_verb(2, "%s: Starting record mode (codec=%d)[%s]\n",p->dev,fmt,ast2vpbformatname(afmt));
continue;
} else if (p->lastinput != fmt) {
vpb_record_buf_finish(p->handle);
vpb_record_buf_start(p->handle, fmt);
p->lastinput = fmt;
- if(option_verbose>1)
- ast_verbose( VERBOSE_PREFIX_2 "%s: Changed record format (%d=>%d)\n",p->dev,p->lastinput,fmt);
+ ast_verb(2, "%s: Changed record format (%d=>%d)\n",p->dev,p->lastinput,fmt);
continue;
}
/* Read only if up and not bridged, or a bridge for which we can read. */
- if (option_verbose > 5) {
- ast_verbose("%s: chanreads: getting buffer!\n", p->dev);
- }
+ ast_verb(6, "%s: chanreads: getting buffer!\n", p->dev);
if( (res = vpb_record_buf_sync(p->handle, readbuf, readlen) ) == VPB_OK ) {
- if (option_verbose > 5) {
- ast_verbose("%s: chanreads: got buffer!\n", p->dev);
- }
+ ast_verb(6, "%s: chanreads: got buffer!\n", p->dev);
/* Apply extra gain ! */
if( p->rxswgain > MAX_VPB_GAIN )
a_gain_vector(p->rxswgain - MAX_VPB_GAIN , (short*)readbuf, readlen/sizeof(short));
- if (option_verbose > 5) {
- ast_verbose("%s: chanreads: applied gain\n", p->dev);
- }
+ ast_verb(6, "%s: chanreads: applied gain\n", p->dev);
fr->subclass = afmt;
fr->data = readbuf;
* (ast_hangup() immediately gets lock)
*/
if (p->owner && !p->stopreads ) {
- if (option_verbose > 5) {
- ast_verbose("%s: chanreads: queueing buffer on read frame q (state[%d])\n", p->dev,p->owner->_state);
- }
+ ast_verb(6, "%s: chanreads: queueing buffer on read frame q (state[%d])\n", p->dev,p->owner->_state);
do {
res = ast_mutex_trylock(&p->owner->lock);
trycnt++;
ast_queue_frame(p->owner, fr);
ast_mutex_unlock(&p->owner->lock);
} else {
- if (option_verbose > 4)
- ast_verbose("%s: chanreads: Couldnt get lock after %d tries!\n", p->dev,trycnt);
+ ast_verb(5, "%s: chanreads: Couldnt get lock after %d tries!\n", p->dev,trycnt);
}
trycnt=0;
ast_mutex_unlock(&p->owner->lock);
} else {
if (res == EINVAL )
- if (option_verbose > 4) ast_verbose("%s: chanreads: try owner->lock gave me EINVAL[%d]\n", p->dev,res);
+ ast_verb(5, "%s: chanreads: try owner->lock gave me EINVAL[%d]\n", p->dev,res);
else if (res == EBUSY )
- if (option_verbose > 4) ast_verbose("%s: chanreads: try owner->lock gave me EBUSY[%d]\n", p->dev,res);
+ ast_verb(5, "%s: chanreads: try owner->lock gave me EBUSY[%d]\n", p->dev,res);
while(res !=0){
res = ast_mutex_trylock(&p->owner->lock);
}
}
else {
if (res == EINVAL )
- if (option_verbose > 4) ast_verbose("%s: chanreads: try owner->lock gave me EINVAL[%d]\n", p->dev,res);
+ ast_verb(5, "%s: chanreads: try owner->lock gave me EINVAL[%d]\n", p->dev,res);
else if (res == EBUSY )
- if (option_verbose > 4) ast_verbose("%s: chanreads: try owner->lock gave me EBUSY[%d]\n", p->dev,res);
- if (option_verbose > 4) ast_verbose("%s: chanreads: Couldnt get lock on owner[%s][%d][%d] channel to send frame!\n", p->dev,p->owner->name,(int)p->owner->lock.__m_owner,(int)p->owner->lock.__m_count);
+ ast_verb(5, "%s: chanreads: try owner->lock gave me EBUSY[%d]\n", p->dev,res);
+ ast_verb(5, "%s: chanreads: Couldnt get lock on owner[%s][%d][%d] channel to send frame!\n", p->dev,p->owner->name,(int)p->owner->lock.__m_owner,(int)p->owner->lock.__m_count);
}
}
*/
- if (option_verbose > 6) {
short * data = (short*)readbuf;
- ast_verbose("%s: Read channel (codec=%d) %d %d\n", p->dev, fmt, data[0], data[1] );
+ ast_verb(7, "%s: Read channel (codec=%d) %d %d\n", p->dev, fmt, data[0], data[1] );
}
- }
else {
- if (option_verbose > 4) {
- ast_verbose("%s: p->stopreads[%d] p->owner[%p]\n", p->dev, p->stopreads,(void *)p->owner);
+ ast_verb(5, "%s: p->stopreads[%d] p->owner[%p]\n", p->dev, p->stopreads,(void *)p->owner);
}
}
+ ast_verb(5, "%s: chanreads: Finished cycle...\n", p->dev);
}
- if (option_verbose > 4)
- ast_verbose("%s: chanreads: Finished cycle...\n", p->dev);
- }
p->read_state=0;
/* When stopreads seen, go away! */
p->read_state=0;
ast_mutex_unlock(&p->record_lock);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "%s: Ending record mode (%d/%s)\n",
+ ast_verb(2, "%s: Ending record mode (%d/%s)\n",
p->dev, p->stopreads, p->owner? "yes" : "no");
return NULL;
}
ast_log(LOG_WARNING, "Called vpb_new on owned channel (%s) ?!\n", me->dev);
return NULL;
}
- if (option_verbose > 3)
- ast_verbose("%s: New call for context [%s]\n",me->dev,context);
+ ast_verb(4, "%s: New call for context [%s]\n",me->dev,context);
tmp = ast_channel_alloc(1, state, 0, 0, "", me->ext, me->context, 0, me->dev);
if (tmp) {
} ast_mutex_unlock(&iflock);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 " %s requested, got: [%s]\n",
- name, tmp ? tmp->name : "None");
+ ast_verb(2, " %s requested, got: [%s]\n", name, tmp ? tmp->name : "None");
ast_free(name);
p->cidlen += READ_SIZE * 4;
p->cidpos = 0;
send_callerid(p);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CPE supports Call Waiting Caller*ID. Sending '%s/%s'\n", p->callwait_name, p->callwait_num);
+ ast_verb(3, "CPE supports Call Waiting Caller*ID. Sending '%s/%s'\n", p->callwait_name, p->callwait_num);
return 0;
}
if (p->pri->facilityenable)
pri_facility_enable(p->pri->pri);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Requested transfer capability: 0x%.2x - %s\n", ast->transfercapability, ast_transfercapability2str(ast->transfercapability));
+ ast_verb(3, "Requested transfer capability: 0x%.2x - %s\n", ast->transfercapability, ast_transfercapability2str(ast->transfercapability));
dp_strip = 0;
pridialplan = p->pri->dialplan - 1;
if (pridialplan == -2 || pridialplan == -3) { /* compute dynamically */
ast->tech_pvt = NULL;
ast_mutex_unlock(&p->lock);
ast_module_unref(ast_module_info->self);
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Hungup '%s'\n", ast->name);
+ ast_verb(3, "Hungup '%s'\n", ast->name);
ast_mutex_lock(&iflock);
tmp = iflist;
return AST_BRIDGE_FAILED;
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name);
+ ast_verb(3, "Native bridging %s and %s\n", c0->name, c1->name);
if (!(flags & AST_BRIDGE_DTMF_CHANNEL_0) && (oi0 == SUB_REAL))
disable_dtmf_detect(op0);
if we're in a conference, it's probably a MeetMe room or
some such, so don't let us 3-way out! */
if ((p->subs[SUB_REAL].curconf.confno != ci.confno) || (p->subs[SUB_REAL].curconf.confmode != ci.confmode)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Avoiding 3-way call when in an external conference\n");
+ ast_verb(3, "Avoiding 3-way call when in an external conference\n");
return 1;
}
return 0;
const char *target_context = S_OR(ast->macrocontext, ast->context);
if (ast_exists_extension(ast, target_context, "fax", 1, ast->cid.cid_num)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Redirecting %s to fax extension\n", ast->name);
+ ast_verb(3, "Redirecting %s to fax extension\n", ast->name);
/* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
pbx_builtin_setvar_helper(ast, "FAXEXTEN", ast->exten);
if (ast_async_goto(ast, target_context, "fax", 1))
switch (res) {
#ifdef ZT_EVENT_EC_DISABLED
case ZT_EVENT_EC_DISABLED:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel %d echo canceler disabled due to CED detection\n", p->channel);
+ ast_verb(3, "Channel %d echo canceler disabled due to CED detection\n", p->channel);
p->echocanon = 0;
break;
#endif
if (p->subs[SUB_CALLWAIT].owner) {
/* There's a call waiting call, so ring the phone, but make it unowned in the mean time */
swap_subs(p, SUB_CALLWAIT, SUB_REAL);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel %d still has (callwait) call, ringing phone\n", p->channel);
+ ast_verb(3, "Channel %d still has (callwait) call, ringing phone\n", p->channel);
unalloc_sub(p, SUB_CALLWAIT);
#if 0
p->subs[index].needanswer = 0;
zt_enable_ec(p);
ast_hangup(chan);
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Started three way call on channel %d\n", p->channel);
+ ast_verb(3, "Started three way call on channel %d\n", p->channel);
/* Start music on hold if appropriate */
if (ast_bridged_channel(p->subs[SUB_THREEWAY].owner)) {
ast_queue_control_data(p->subs[SUB_THREEWAY].owner, AST_CONTROL_HOLD,
p->owner = p->subs[SUB_REAL].owner;
}
/* Drop the last call and stop the conference */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Dropping three-way call on %s\n", p->subs[SUB_THREEWAY].owner->name);
+ ast_verb(3, "Dropping three-way call on %s\n", p->subs[SUB_THREEWAY].owner->name);
p->subs[SUB_THREEWAY].owner->_softhangup |= AST_SOFTHANGUP_DEV;
p->subs[SUB_REAL].inthreeway = 0;
p->subs[SUB_THREEWAY].inthreeway = 0;
(p->transfertobusy || (ast->_state != AST_STATE_BUSY))) {
int otherindex = SUB_THREEWAY;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Building conference on call on %s and %s\n", p->subs[SUB_THREEWAY].owner->name, p->subs[SUB_REAL].owner->name);
+ ast_verb(3, "Building conference on call on %s and %s\n", p->subs[SUB_THREEWAY].owner->name, p->subs[SUB_REAL].owner->name);
/* Put them in the threeway, and flip */
p->subs[SUB_THREEWAY].inthreeway = 1;
p->subs[SUB_REAL].inthreeway = 1;
res = tone_zone_play_tone(p->subs[SUB_THREEWAY].zfd, ZT_TONE_RINGTONE);
}
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Dumping incomplete call on on %s\n", p->subs[SUB_THREEWAY].owner->name);
+ ast_verb(3, "Dumping incomplete call on on %s\n", p->subs[SUB_THREEWAY].owner->name);
swap_subs(p, SUB_THREEWAY, SUB_REAL);
p->subs[SUB_THREEWAY].owner->_softhangup |= AST_SOFTHANGUP_DEV;
p->owner = p->subs[SUB_REAL].owner;
case ZT_EVENT_ONHOOK:
zt_disable_ec(p);
if (p->owner) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel %s still has call, ringing phone\n", p->owner->name);
+ ast_verb(3, "Channel %s still has call, ringing phone\n", p->owner->name);
zt_ring_phone(p);
p->callwaitingrepeat = 0;
p->cidcwexpire = 0;
case ZT_EVENT_WINKFLASH:
p->flashtime = ast_tvnow();
if (p->owner) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel %d flashed to other channel %s\n", p->channel, p->owner->name);
+ ast_verb(3, "Channel %d flashed to other channel %s\n", p->channel, p->owner->name);
if (p->owner->_state != AST_STATE_UP) {
/* Answer if necessary */
usedindex = zt_get_index(p->owner, p, 0);
}
/* Expire CID/CW */
if (p->cidcwexpire == 1) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CPE does not support Call Waiting Caller*ID.\n");
+ ast_verb(3, "CPE does not support Call Waiting Caller*ID.\n");
restore_conference(p);
}
if (p->subs[index].linear) {
return NULL;
}
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Starting simple switch on '%s'\n", chan->name);
+ ast_verb(3, "Starting simple switch on '%s'\n", chan->name);
index = zt_get_index(chan, p, 1);
if (index < 0) {
ast_log(LOG_WARNING, "Huh?\n");
}
/* if no extension was received ('unspecified') on overlap call, use the 's' extension */
if (ast_strlen_zero(exten)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Going to extension s|1 because of empty extension received on overlap call\n");
+ ast_verb(3, "Going to extension s|1 because of empty extension received on overlap call\n");
exten[0] = 's';
exten[1] = '\0';
}
}
return NULL;
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_2 "Unknown extension '%s' in context '%s' requested\n", exten, chan->context);
+ ast_verb(2, "Unknown extension '%s' in context '%s' requested\n", exten, chan->context);
sleep(2);
res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_INFO);
if (res < 0)
if (getforward) {
/* Record this as the forwarding extension */
ast_copy_string(p->call_forward, exten, sizeof(p->call_forward));
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Setting call forward to '%s' on channel %d\n", p->call_forward, p->channel);
+ ast_verb(3, "Setting call forward to '%s' on channel %d\n", p->call_forward, p->channel);
res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
if (res)
break;
ast_hangup(chan);
return NULL;
} else if (p->callwaiting && !strcmp(exten, "*70")) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Disabling call waiting on %s\n", chan->name);
+ ast_verb(3, "Disabling call waiting on %s\n", chan->name);
/* Disable call waiting if enabled */
p->callwaiting = 0;
res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
}
} else if (!p->hidecallerid && !strcmp(exten, "*67")) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Disabling Caller*ID on %s\n", chan->name);
+ ast_verb(3, "Disabling Caller*ID on %s\n", chan->name);
/* Disable Caller*ID if enabled */
p->hidecallerid = 1;
if (chan->cid.cid_num)
break;
} else if (!strcmp(exten, "*78")) {
/* Do not disturb */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Enabled DND on channel %d\n", p->channel);
+ ast_verb(3, "Enabled DND on channel %d\n", p->channel);
manager_event(EVENT_FLAG_SYSTEM, "DNDState",
"Channel: Zap/%d\r\n"
"Status: enabled\r\n", p->channel);
len = 0;
} else if (!strcmp(exten, "*79")) {
/* Do not disturb */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Disabled DND on channel %d\n", p->channel);
+ ast_verb(3, "Disabled DND on channel %d\n", p->channel);
manager_event(EVENT_FLAG_SYSTEM, "DNDState",
"Channel: Zap/%d\r\n"
"Status: disabled\r\n", p->channel);
memset(exten, 0, sizeof(exten));
len = 0;
} else if (p->cancallforward && !strcmp(exten, "*73")) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Cancelling call forwarding on channel %d\n", p->channel);
+ ast_verb(3, "Cancelling call forwarding on channel %d\n", p->channel);
res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
memset(p->call_forward, 0, sizeof(p->call_forward));
getforward = 0;
/* This is a three way call, the main call being a real channel,
and we're parking the first call. */
ast_masq_park_call(ast_bridged_channel(p->subs[SUB_THREEWAY].owner), chan, 0, NULL);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Parking call to '%s'\n", chan->name);
+ ast_verb(3, "Parking call to '%s'\n", chan->name);
break;
} else if (!ast_strlen_zero(p->lastcid_num) && !strcmp(exten, "*60")) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Blacklisting number %s\n", p->lastcid_num);
+ ast_verb(3, "Blacklisting number %s\n", p->lastcid_num);
res = ast_db_put("blacklist", p->lastcid_num, "1");
if (!res) {
res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
len = 0;
}
} else if (p->hidecallerid && !strcmp(exten, "*82")) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Enabling Caller*ID on %s\n", chan->name);
+ ast_verb(3, "Enabling Caller*ID on %s\n", chan->name);
/* Enable Caller*ID if enabled */
p->hidecallerid = 0;
if (chan->cid.cid_num)
}
}
}
- if (option_verbose > 2)
/* this only shows up if you have n of the dring patterns filled in */
- ast_verbose( VERBOSE_PREFIX_3 "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
+ ast_verb(3, "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
for (counter = 0; counter < 3; counter++) {
/* Check to see if the rings we received match any of the ones in zapata.conf for this
channel */
distMatches = 0;
for (counter1 = 0; counter1 < 3; counter1++) {
- ast_verbose( VERBOSE_PREFIX_3 "Ring pattern check range: %d\n", p->drings.ringnum[counter].range);
+ ast_verb(3, "Ring pattern check range: %d\n", p->drings.ringnum[counter].range);
if (p->drings.ringnum[counter].ring[counter1] == -1) {
- ast_verbose( VERBOSE_PREFIX_3 "Pattern ignore (-1) detected, so matching pattern %d regardless.\n",
+ ast_verb(3, "Pattern ignore (-1) detected, so matching pattern %d regardless.\n",
curRingData[counter1]);
distMatches++;
}
else if (curRingData[counter1] <= (p->drings.ringnum[counter].ring[counter1] + p->drings.ringnum[counter].range) &&
curRingData[counter1] >= (p->drings.ringnum[counter].ring[counter1] - p->drings.ringnum[counter].range)) {
- ast_verbose( VERBOSE_PREFIX_3 "Ring pattern matched in range: %d to %d\n",
+ ast_verb(3, "Ring pattern matched in range: %d to %d\n",
(p->drings.ringnum[counter].ring[counter1] - p->drings.ringnum[counter].range),
(p->drings.ringnum[counter].ring[counter1] + p->drings.ringnum[counter].range));
distMatches++;
/* The ring matches, set the context to whatever is for distinctive ring.. */
ast_copy_string(p->context, p->drings.ringContext[counter].contextData, sizeof(p->context));
ast_copy_string(chan->context, p->drings.ringContext[counter].contextData, sizeof(chan->context));
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Distinctive Ring matched context %s\n",p->context);
+ ast_verb(3, "Distinctive Ring matched context %s\n",p->context);
break;
}
}
curRingData[receivedRingT] = 0;
}
receivedRingT = 0;
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Detecting post-CID distinctive ring\n");
+ ast_verb(3, "Detecting post-CID distinctive ring\n");
for (;;) {
i = ZT_IOMUX_READ | ZT_IOMUX_SIGEVENT;
if ((res = ioctl(p->subs[index].zfd, ZT_IOMUX, &i))) {
}
}
if (p->usedistinctiveringdetection == 1) {
- if (option_verbose > 2)
/* this only shows up if you have n of the dring patterns filled in */
- ast_verbose( VERBOSE_PREFIX_3 "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
+ ast_verb(3, "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
for (counter = 0; counter < 3; counter++) {
/* Check to see if the rings we received match any of the ones in zapata.conf for this
channel */
- if (option_verbose > 2)
/* this only shows up if you have n of the dring patterns filled in */
- ast_verbose( VERBOSE_PREFIX_3 "Checking %d,%d,%d\n",
+ ast_verb(3, "Checking %d,%d,%d\n",
p->drings.ringnum[counter].ring[0],
p->drings.ringnum[counter].ring[1],
p->drings.ringnum[counter].ring[2]);
distMatches = 0;
for (counter1 = 0; counter1 < 3; counter1++) {
- ast_verbose( VERBOSE_PREFIX_3 "Ring pattern check range: %d\n", p->drings.ringnum[counter].range);
+ ast_verb(3, "Ring pattern check range: %d\n", p->drings.ringnum[counter].range);
if (p->drings.ringnum[counter].ring[counter1] == -1) {
- ast_verbose( VERBOSE_PREFIX_3 "Pattern ignore (-1) detected, so matching pattern %d regardless.\n",
+ ast_verb(3, "Pattern ignore (-1) detected, so matching pattern %d regardless.\n",
curRingData[counter1]);
distMatches++;
}
else if (curRingData[counter1] <= (p->drings.ringnum[counter].ring[counter1] + p->drings.ringnum[counter].range) &&
curRingData[counter1] >= (p->drings.ringnum[counter].ring[counter1] - p->drings.ringnum[counter].range)) {
- ast_verbose( VERBOSE_PREFIX_3 "Ring pattern matched in range: %d to %d\n",
+ ast_verb(3, "Ring pattern matched in range: %d to %d\n",
(p->drings.ringnum[counter].ring[counter1] - p->drings.ringnum[counter].range),
(p->drings.ringnum[counter].ring[counter1] + p->drings.ringnum[counter].range));
distMatches++;
/* The ring matches, set the context to whatever is for distinctive ring.. */
ast_copy_string(p->context, p->drings.ringContext[counter].contextData, sizeof(p->context));
ast_copy_string(chan->context, p->drings.ringContext[counter].contextData, sizeof(chan->context));
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Distinctive Ring matched context %s\n",p->context);
+ ast_verb(3, "Distinctive Ring matched context %s\n",p->context);
break;
}
}
case SIG_FXSGS:
if (i->cid_start == CID_START_POLARITY || i->cid_start == CID_START_POLARITY_IN) {
i->polarity = POLARITY_REV;
- ast_verbose(VERBOSE_PREFIX_2 "Starting post polarity "
+ ast_verb(2, "Starting post polarity "
"CID detection on channel %d\n",
i->channel);
chan = zt_new(i, AST_STATE_PRERING, 0, SUB_REAL, 0, 0);
c = zt_new(p, AST_STATE_RING, 1, SUB_REAL, law, 0);
ast_mutex_lock(&linkset->lock);
if (c)
- ast_verbose(VERBOSE_PREFIX_3 "Accepting call to '%s' on CIC %d\n", p->exten, p->cic);
+ ast_verb(3, "Accepting call to '%s' on CIC %d\n", p->exten, p->cic);
else
ast_log(LOG_WARNING, "Unable to start PBX on CIC %d\n", p->cic);
}
if (pri->pvts[x]->call == c) {
/* Found our call */
if (principle != x) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Moving call from channel %d to channel %d\n",
+ ast_verb(3, "Moving call from channel %d to channel %d\n",
pri->pvts[x]->channel, pri->pvts[principle]->channel);
if (pri->pvts[principle]->owner) {
ast_log(LOG_WARNING, "Can't fix up channel from %d to %d because %d is already in use\n",
char ex[80];
/* Wait up to 30 seconds for an answer */
int newms, ms = 30000;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Initiating idle call on channel %s\n", chan->name);
+ ast_verb(3, "Initiating idle call on channel %s\n", chan->name);
snprintf(ex, sizeof(ex), "%d/%s", pvt->channel, pvt->pri->idledial);
if (ast_call(chan, ex, 0)) {
ast_log(LOG_WARNING, "Idle dial failed on '%s' to '%s'\n", chan->name, ex);
ast_copy_string(chan->exten, pvt->pri->idleext, sizeof(chan->exten));
ast_copy_string(chan->context, pvt->pri->idlecontext, sizeof(chan->context));
chan->priority = 1;
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_3 "Idle channel '%s' answered, sending to %s@%s\n", chan->name, chan->exten, chan->context);
+ ast_verb(4, "Idle channel '%s' answered, sending to %s@%s\n", chan->name, chan->exten, chan->context);
ast_pbx_run(chan);
/* It's already hungup, return immediately */
return NULL;
case AST_CONTROL_BUSY:
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_3 "Idle channel '%s' busy, waiting...\n", chan->name);
+ ast_verb(4, "Idle channel '%s' busy, waiting...\n", chan->name);
break;
case AST_CONTROL_CONGESTION:
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_3 "Idle channel '%s' congested, waiting...\n", chan->name);
+ ast_verb(4, "Idle channel '%s' congested, waiting...\n", chan->name);
break;
};
}
switch (e->e) {
case PRI_EVENT_DCHAN_UP:
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "%s D-Channel on span %d up\n", pri_order(which), pri->span);
+ ast_verb(2, "%s D-Channel on span %d up\n", pri_order(which), pri->span);
pri->dchanavail[which] |= DCHAN_UP;
if (!pri->pri) pri_find_dchan(pri);
}
break;
case PRI_EVENT_DCHAN_DOWN:
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "%s D-Channel on span %d down\n", pri_order(which), pri->span);
+ ast_verb(2, "%s D-Channel on span %d down\n", pri_order(which), pri->span);
pri->dchanavail[which] &= ~DCHAN_UP;
pri_find_dchan(pri);
if (!pri_is_up(pri)) {
ast_log(LOG_WARNING, "Restart requested on odd/unavailable channel number %d/%d on span %d\n",
PRI_SPAN(e->restart.channel), PRI_CHANNEL(e->restart.channel), pri->span);
else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "B-channel %d/%d restarted on span %d\n",
+ ast_verb(3, "B-channel %d/%d restarted on span %d\n",
PRI_SPAN(e->restart.channel), PRI_CHANNEL(e->restart.channel), pri->span);
ast_mutex_lock(&pri->pvts[chanpos]->lock);
if (pri->pvts[chanpos]->call) {
ast_mutex_unlock(&pri->pvts[chanpos]->lock);
}
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_2 "Restart on requested on entire span %d\n", pri->span);
+ ast_verb(3, "Restart on requested on entire span %d\n", pri->span);
for (x = 0; x < pri->numchans; x++)
if (pri->pvts[x]) {
ast_mutex_lock(&pri->pvts[x]->lock);
e->ring.redirectingnum, e->ring.callingplanrdnis);
/* If immediate=yes go to s|1 */
if (pri->pvts[chanpos]->immediate) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Going to extension s|1 because of immediate=yes\n");
+ ast_verb(3, "Going to extension s|1 because of immediate=yes\n");
pri->pvts[chanpos]->exten[0] = 's';
pri->pvts[chanpos]->exten[1] = '\0';
}
ast_copy_string(pri->pvts[chanpos]->dnid, e->ring.callednum, sizeof(pri->pvts[chanpos]->dnid));
/* No number yet, but received "sending complete"? */
if (e->ring.complete && (ast_strlen_zero(e->ring.callednum))) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Going to extension s|1 because of Complete received\n");
+ ast_verb(3, "Going to extension s|1 because of Complete received\n");
pri->pvts[chanpos]->exten[0] = 's';
pri->pvts[chanpos]->exten[1] = '\0';
}
ast_mutex_lock(&pri->lock);
if (c && !ast_pthread_create_detached(&threadid, NULL, ss_thread, c)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Accepting overlap call from '%s' to '%s' on channel %d/%d, span %d\n",
+ ast_verb(3, "Accepting overlap call from '%s' to '%s' on channel %d/%d, span %d\n",
plancallingnum, S_OR(pri->pvts[chanpos]->exten, "<unspecified>"),
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span);
} else {
snprintf(calledtonstr, sizeof(calledtonstr)-1, "%d", e->ring.calledplan);
pbx_builtin_setvar_helper(c, "CALLEDTON", calledtonstr);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Accepting call from '%s' to '%s' on channel %d/%d, span %d\n",
+ ast_verb(3, "Accepting call from '%s' to '%s' on channel %d/%d, span %d\n",
plancallingnum, pri->pvts[chanpos]->exten,
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span);
zt_enable_ec(pri->pvts[chanpos]);
}
}
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Extension '%s' in context '%s' from '%s' does not exist. Rejecting call on channel %d/%d, span %d\n",
+ ast_verb(3, "Extension '%s' in context '%s' from '%s' does not exist. Rejecting call on channel %d/%d, span %d\n",
pri->pvts[chanpos]->exten, pri->pvts[chanpos]->context, pri->pvts[chanpos]->cid_num, pri->pvts[chanpos]->logicalspan,
pri->pvts[chanpos]->prioffset, pri->span);
pri_hangup(pri->pri, e->ring.call, PRI_CAUSE_UNALLOCATED);
struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_PROGRESS, };
if (e->proceeding.cause > -1) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "PROGRESS with cause code %d received\n", e->proceeding.cause);
+ ast_verb(3, "PROGRESS with cause code %d received\n", e->proceeding.cause);
/* Work around broken, out of spec USER_BUSY cause in a progress message */
if (e->proceeding.cause == AST_CAUSE_USER_BUSY) {
if (pri->pvts[chanpos]->owner) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "PROGRESS with 'user busy' received, signaling AST_CONTROL_BUSY instead of AST_CONTROL_PROGRESS\n");
+ ast_verb(3, "PROGRESS with 'user busy' received, signaling AST_CONTROL_BUSY instead of AST_CONTROL_PROGRESS\n");
pri->pvts[chanpos]->owner->hangupcause = e->proceeding.cause;
f.subclass = AST_CONTROL_BUSY;
}
}
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup, cause %d\n",
+ ast_verb(3, "Channel %d/%d, span %d got hangup, cause %d\n",
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, e->hangup.cause);
} else {
pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause);
pri->pvts[chanpos]->call = NULL;
}
if (e->hangup.cause == PRI_CAUSE_REQUESTED_CHAN_UNAVAIL) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Forcing restart of channel %d/%d on span %d since channel reported in use\n",
+ ast_verb(3, "Forcing restart of channel %d/%d on span %d since channel reported in use\n",
PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
pri_reset(pri->pri, PVT_TO_CHANNEL(pri->pvts[chanpos]));
pri->pvts[chanpos]->resetting = 1;
}
if (e->hangup.aoc_units > -1)
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
+ ast_verb(3, "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, (int)e->hangup.aoc_units, (e->hangup.aoc_units == 1) ? "" : "s");
#ifdef SUPPORT_USERUSER
pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
}
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup request, cause %d\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span, e->hangup.cause);
+ ast_verb(3, "Channel %d/%d, span %d got hangup request, cause %d\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span, e->hangup.cause);
if (e->hangup.aoc_units > -1)
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
+ ast_verb(3, "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, (int)e->hangup.aoc_units, (e->hangup.aoc_units == 1) ? "" : "s");
} else {
pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause);
pri->pvts[chanpos]->call = NULL;
}
if (e->hangup.cause == PRI_CAUSE_REQUESTED_CHAN_UNAVAIL) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Forcing restart of channel %d/%d span %d since channel reported in use\n",
+ ast_verb(3, "Forcing restart of channel %d/%d span %d since channel reported in use\n",
PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
pri_reset(pri->pri, PVT_TO_CHANNEL(pri->pvts[chanpos]));
pri->pvts[chanpos]->resetting = 1;
pri->pvts[chanpos]->call = NULL;
pri->pvts[chanpos]->resetting = 0;
if (pri->pvts[chanpos]->owner) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup ACK\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
+ ast_verb(3, "Channel %d/%d, span %d got hangup ACK\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
}
#ifdef SUPPORT_USERUSER
pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
}
pri->pvts[chanpos]->resetting = 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "B-channel %d/%d successfully restarted on span %d\n", pri->pvts[chanpos]->logicalspan,
+ ast_verb(3, "B-channel %d/%d successfully restarted on span %d\n", pri->pvts[chanpos]->logicalspan,
pri->pvts[chanpos]->prioffset, pri->span);
ast_mutex_unlock(&pri->pvts[chanpos]->lock);
if (pri->resetting)
}
pri->pvts[chanpos]->resetting = 0;
pri->pvts[chanpos]->inservice = 1;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "B-channel %d/%d successfully restarted on span %d\n", pri->pvts[chanpos]->logicalspan,
+ ast_verb(3, "B-channel %d/%d successfully restarted on span %d\n", pri->pvts[chanpos]->logicalspan,
pri->pvts[chanpos]->prioffset, pri->span);
ast_mutex_unlock(&pri->pvts[chanpos]->lock);
if (pri->resetting)
static int setup_zap(int reload);
static int zap_restart(void)
{
- if (option_verbose > 0)
- ast_verbose(VERBOSE_PREFIX_1 "Destroying channels and reloading zaptel configuration.\n");
+ ast_verb(1, "Destroying channels and reloading zaptel configuration.\n");
while (iflist) {
ast_debug(1, "Destroying zaptel channel no. %d\n", iflist->channel);
/* Also updates iflist: */
/* Free associated memory */
if (pl)
destroy_zt_pvt(&pl);
- ast_verbose(VERBOSE_PREFIX_3 "Unregistered channel %d\n", x);
+ ast_verb(3, "Unregistered channel %d\n", x);
}
iflist = NULL;
ifcount = 0;
#endif
if (tmp) {
- if (option_verbose > 2) {
#ifdef HAVE_PRI
if (pri)
- ast_verbose(VERBOSE_PREFIX_3 "%s CRV %d:%d, %s signalling\n", reload ? "Reconfigured" : "Registered", trunkgroup, x, sig2str(tmp->sig));
+ ast_verb(3, "%s CRV %d:%d, %s signalling\n", reload ? "Reconfigured" : "Registered", trunkgroup, x, sig2str(tmp->sig));
else
#endif
- ast_verbose(VERBOSE_PREFIX_3 "%s channel %d, %s signalling\n", reload ? "Reconfigured" : "Registered", x, sig2str(tmp->sig));
- }
+ ast_verb(3, "%s channel %d, %s signalling\n", reload ? "Reconfigured" : "Registered", x, sig2str(tmp->sig));
} else {
ast_log(LOG_ERROR, "Unable to %s channel '%s'\n",
(reload == 1) ? "reconfigure" : "register", value);
else {
cadences[num_cadence] = new_cadence;
cidrings[num_cadence++] = cid_location;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "cadence 'r%d' added: %s\n",num_cadence,original_args);
+ ast_verb(3, "cadence 'r%d' added: %s\n",num_cadence,original_args);
}
}
}
tmp = mkintf(CHAN_PSEUDO, *confp, NULL, reload);
if (tmp) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Automatically generated pseudo channel\n");
+ ast_verb(3, "Automatically generated pseudo channel\n");
} else {
ast_log(LOG_WARNING, "Unable to register pseudo channel!\n");
}
if (i) {
if (pri_create_trunkgroup(trunkgroup, dchannels)) {
ast_log(LOG_WARNING, "Unable to create trunk group %d with Primary D-channel %d at line %d of zapata.conf\n", trunkgroup, dchannels[0], v->lineno);
- } else if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Created trunk group %d with Primary D-channel %d and %d backup%s\n", trunkgroup, dchannels[0], i - 1, (i == 1) ? "" : "s");
+ } else
+ ast_verb(2, "Created trunk group %d with Primary D-channel %d and %d backup%s\n", trunkgroup, dchannels[0], i - 1, (i == 1) ? "" : "s");
} else
ast_log(LOG_WARNING, "Trunk group %d lacks any valid D-channels at line %d of zapata.conf\n", trunkgroup, v->lineno);
} else
if (logicalspan >= 0) {
if (pri_create_spanmap(spanno - 1, trunkgroup, logicalspan)) {
ast_log(LOG_WARNING, "Failed to map span %d to trunk group %d (logical span %d)\n", spanno, trunkgroup, logicalspan);
- } else if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Mapped span %d to trunk group %d (logical span %d)\n", spanno, trunkgroup, logicalspan);
+ } else
+ ast_verb(2, "Mapped span %d to trunk group %d (logical span %d)\n", spanno, trunkgroup, logicalspan);
} else
ast_log(LOG_WARNING, "Logical span must be a postive number, or '0' (for unspecified) at line %d of zapata.conf\n", v->lineno);
} else
if (start_pri(pris + x)) {
ast_log(LOG_ERROR, "Unable to start D-channel on span %d\n", x + 1);
return -1;
- } else if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Starting D-Channel on span %d\n", x + 1);
+ } else
+ ast_verb(2, "Starting D-Channel on span %d\n", x + 1);
}
}
}
if (ast_pthread_create(&linksets[x].master, NULL, ss7_linkset, &linksets[x])) {
ast_log(LOG_ERROR, "Unable to start SS7 linkset on span %d\n", x + 1);
return -1;
- } else if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Starting SS7 linkset on span %d\n", x + 1);
+ } else
+ ast_verb(2, "Starting SS7 linkset on span %d\n", x + 1);
}
}
}
if (strcasecmp(cat, "general")) {
iax_process_template(cfg, cat, found ? "default" : NULL);
found++;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Loaded provisioning template '%s'\n", cat);
+ ast_verb(3, "Loaded provisioning template '%s'\n", cat);
}
cat = ast_category_browse(cfg, cat);
}
for (var = ast_variable_browse(cfg, "plc"); var ; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
adpcmtolin.useplc = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "codec_adpcm: %susing generic PLC\n", adpcmtolin.useplc ? "" : "not ");
+ ast_verb(3, "codec_adpcm: %susing generic PLC\n", adpcmtolin.useplc ? "" : "not ");
}
}
ast_config_destroy(cfg);
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
alawtolin.useplc = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "codec_alaw: %susing generic PLC\n", alawtolin.useplc ? "" : "not ");
+ ast_verb(3, "codec_alaw: %susing generic PLC\n", alawtolin.useplc ? "" : "not ");
}
}
ast_config_destroy(cfg);
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
g722tolin.useplc = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "codec_g722: %susing generic PLC\n",
+ ast_verb(3, "codec_g722: %susing generic PLC\n",
g722tolin.useplc ? "" : "not ");
}
}
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
g726tolin.useplc = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "codec_g726: %susing generic PLC\n",
+ ast_verb(3, "codec_g726: %susing generic PLC\n",
g726tolin.useplc ? "" : "not ");
}
}
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
gsmtolin.useplc = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "codec_gsm: %susing generic PLC\n", gsmtolin.useplc ? "" : "not ");
+ ast_verb(3, "codec_gsm: %susing generic PLC\n", gsmtolin.useplc ? "" : "not ");
}
}
ast_config_destroy(cfg);
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
lpc10tolin.useplc = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "codec_lpc10: %susing generic PLC\n",
+ ast_verb(3, "codec_lpc10: %susing generic PLC\n",
lpc10tolin.useplc ? "" : "not ");
}
}
if (!strcasecmp(var->name, "quality")) {
res = abs(atoi(var->value));
if (res > -1 && res < 11) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting Quality to %d\n",res);
+ ast_verb(3, "CODEC SPEEX: Setting Quality to %d\n",res);
quality = res;
} else
ast_log(LOG_ERROR,"Error Quality must be 0-10\n");
} else if (!strcasecmp(var->name, "complexity")) {
res = abs(atoi(var->value));
if (res > -1 && res < 11) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting Complexity to %d\n",res);
+ ast_verb(3, "CODEC SPEEX: Setting Complexity to %d\n",res);
complexity = res;
} else
ast_log(LOG_ERROR,"Error! Complexity must be 0-10\n");
} else if (!strcasecmp(var->name, "vbr_quality")) {
if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0 && res_f <= 10) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting VBR Quality to %f\n",res_f);
+ ast_verb(3, "CODEC SPEEX: Setting VBR Quality to %f\n",res_f);
vbr_quality = res_f;
} else
ast_log(LOG_ERROR,"Error! VBR Quality must be 0-10\n");
ast_log(LOG_ERROR,"Error! ABR Quality setting obsolete, set ABR to desired bitrate\n");
} else if (!strcasecmp(var->name, "enhancement")) {
enhancement = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Perceptual Enhancement Mode. [%s]\n",enhancement ? "on" : "off");
+ ast_verb(3, "CODEC SPEEX: Perceptual Enhancement Mode. [%s]\n",enhancement ? "on" : "off");
} else if (!strcasecmp(var->name, "vbr")) {
vbr = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: VBR Mode. [%s]\n",vbr ? "on" : "off");
+ ast_verb(3, "CODEC SPEEX: VBR Mode. [%s]\n",vbr ? "on" : "off");
} else if (!strcasecmp(var->name, "abr")) {
res = abs(atoi(var->value));
if (res >= 0) {
- if (option_verbose > 2) {
if (res > 0)
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting ABR target bitrate to %d\n",res);
+ ast_verb(3, "CODEC SPEEX: Setting ABR target bitrate to %d\n",res);
else
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Disabling ABR\n");
- }
+ ast_verb(3, "CODEC SPEEX: Disabling ABR\n");
abr = res;
} else
ast_log(LOG_ERROR,"Error! ABR target bitrate must be >= 0\n");
} else if (!strcasecmp(var->name, "vad")) {
vad = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: VAD Mode. [%s]\n",vad ? "on" : "off");
+ ast_verb(3, "CODEC SPEEX: VAD Mode. [%s]\n",vad ? "on" : "off");
} else if (!strcasecmp(var->name, "dtx")) {
dtx = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: DTX Mode. [%s]\n",dtx ? "on" : "off");
+ ast_verb(3, "CODEC SPEEX: DTX Mode. [%s]\n",dtx ? "on" : "off");
} else if (!strcasecmp(var->name, "preprocess")) {
preproc = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessing. [%s]\n",preproc ? "on" : "off");
+ ast_verb(3, "CODEC SPEEX: Preprocessing. [%s]\n",preproc ? "on" : "off");
} else if (!strcasecmp(var->name, "pp_vad")) {
pp_vad = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessor VAD. [%s]\n",pp_vad ? "on" : "off");
+ ast_verb(3, "CODEC SPEEX: Preprocessor VAD. [%s]\n",pp_vad ? "on" : "off");
} else if (!strcasecmp(var->name, "pp_agc")) {
pp_agc = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessor AGC. [%s]\n",pp_agc ? "on" : "off");
+ ast_verb(3, "CODEC SPEEX: Preprocessor AGC. [%s]\n",pp_agc ? "on" : "off");
} else if (!strcasecmp(var->name, "pp_agc_level")) {
if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting preprocessor AGC Level to %f\n",res_f);
+ ast_verb(3, "CODEC SPEEX: Setting preprocessor AGC Level to %f\n",res_f);
pp_agc_level = res_f;
} else
ast_log(LOG_ERROR,"Error! Preprocessor AGC Level must be >= 0\n");
} else if (!strcasecmp(var->name, "pp_denoise")) {
pp_denoise = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessor Denoise. [%s]\n",pp_denoise ? "on" : "off");
+ ast_verb(3, "CODEC SPEEX: Preprocessor Denoise. [%s]\n",pp_denoise ? "on" : "off");
} else if (!strcasecmp(var->name, "pp_dereverb")) {
pp_dereverb = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessor Dereverb. [%s]\n",pp_dereverb ? "on" : "off");
+ ast_verb(3, "CODEC SPEEX: Preprocessor Dereverb. [%s]\n",pp_dereverb ? "on" : "off");
} else if (!strcasecmp(var->name, "pp_dereverb_decay")) {
if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting preprocessor Dereverb Decay to %f\n",res_f);
+ ast_verb(3, "CODEC SPEEX: Setting preprocessor Dereverb Decay to %f\n",res_f);
pp_dereverb_decay = res_f;
} else
ast_log(LOG_ERROR,"Error! Preprocessor Dereverb Decay must be >= 0\n");
} else if (!strcasecmp(var->name, "pp_dereverb_level")) {
if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting preprocessor Dereverb Level to %f\n",res_f);
+ ast_verb(3, "CODEC SPEEX: Setting preprocessor Dereverb Level to %f\n",res_f);
pp_dereverb_level = res_f;
} else
ast_log(LOG_ERROR,"Error! Preprocessor Dereverb Level must be >= 0\n");
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
ulawtolin.useplc = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "codec_ulaw: %susing generic PLC\n", ulawtolin.useplc ? "" : "not ");
+ ast_verb(3, "codec_ulaw: %susing generic PLC\n", ulawtolin.useplc ? "" : "not ");
}
}
ast_config_destroy(cfg);
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
global_useplc = ast_true(var->value);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "codec_zap: %susing generic PLC\n",
+ ast_verb(3, "codec_zap: %susing generic PLC\n",
global_useplc ? "" : "not ");
}
}
return 0;
}
for (info.tcnum = 0; !(res = ioctl(fd, ZT_TRANSCODE_OP, &info)); info.tcnum++) {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Found transcoder '%s'.\n", info.name);
+ ast_verb(2, "Found transcoder '%s'.\n", info.name);
build_translators(&map, info.dstfmts, info.srcfmts);
}
close(fd);
- if (!info.tcnum && (option_verbose > 1))
- ast_verbose(VERBOSE_PREFIX_2 "No hardware transcoders found.\n");
+ if (!info.tcnum)
+ ast_verb(2, "No hardware transcoders found.\n");
for (x = 0; x < 32; x++) {
for (y = 0; y < 32; y++) {
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
int res1 = -1;
if (res == SQL_NO_DATA) {
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "Found no rows [%s]\n", sql);
+ ast_verb(4, "Found no rows [%s]\n", sql);
res1 = 0;
ast_copy_string(rowcount, "0", sizeof(rowcount));
} else {
case 'a':
case 'A':
ast_channel_setwhentohangup(chan, x);
- if (option_verbose > 2) {
if (chan->whentohangup) {
struct timeval tv = { chan->whentohangup, 0 };
ast_strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S.%3q %Z",
ast_localtime(&tv, &myt, NULL));
- ast_verbose(VERBOSE_PREFIX_3 "Channel will hangup at %s.\n",
- timestr);
+ ast_verb(3, "Channel will hangup at %s.\n", timestr);
} else {
- ast_verbose(VERBOSE_PREFIX_3 "Channel hangup cancelled.\n");
+ ast_verb(3, "Channel hangup cancelled.\n");
}
- }
break;
case 'r':
case 'R':
if (chan->pbx) {
chan->pbx->rtimeout = x;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Response timeout set to %d\n",
- chan->pbx->rtimeout);
+ ast_verb(3, "Response timeout set to %d\n", chan->pbx->rtimeout);
}
break;
case 'D':
if (chan->pbx) {
chan->pbx->dtimeout = x;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Digit timeout set to %d\n",
- chan->pbx->dtimeout);
+ ast_verb(3, "Digit timeout set to %d\n", chan->pbx->dtimeout);
}
break;
now, frr->ts, frr->len);
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s jitterbuffer created on channel %s\n", jbimpl->name, chan->name);
+ ast_verb(3, "%s jitterbuffer created on channel %s\n", jbimpl->name, chan->name);
/* Free the frame if it has not been queued in the jb */
if (res != JB_IMPL_OK)
ast_clear_flag(jb, JB_CREATED);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s jitterbuffer destroyed on channel %s\n", jbimpl->name, chan->name);
+ ast_verb(3, "%s jitterbuffer destroyed on channel %s\n", jbimpl->name, chan->name);
}
}
if (ast_has_voicemail_func)
return ast_has_voicemail_func(mailbox, folder);
- if ((option_verbose > 2) && !warned) {
- ast_verbose(VERBOSE_PREFIX_3 "Message check requested for mailbox %s/folder %s but voicemail not loaded.\n", mailbox, folder ? folder : "INBOX");
+ if (!warned) {
+ ast_verb(3, "Message check requested for mailbox %s/folder %s but voicemail not loaded.\n", mailbox, folder ? folder : "INBOX");
warned++;
}
return 0;
if (ast_inboxcount_func)
return ast_inboxcount_func(mailbox, newmsgs, oldmsgs);
- if (!warned && (option_verbose > 2)) {
+ if (!warned) {
warned++;
- ast_verbose(VERBOSE_PREFIX_3 "Message count requested for mailbox %s but voicemail not loaded.\n", mailbox);
+ ast_verb(3, "Message count requested for mailbox %s but voicemail not loaded.\n", mailbox);
}
return 0;
if (ast_messagecount_func)
return ast_messagecount_func(context, mailbox, folder);
- if (!warned && (option_verbose > 2)) {
+ if (!warned) {
warned++;
- ast_verbose(VERBOSE_PREFIX_3 "Message count requested for mailbox %s@%s/%s but voicemail not loaded.\n", mailbox, context, folder);
+ ast_verb(3, "Message count requested for mailbox %s@%s/%s but voicemail not loaded.\n", mailbox, context, folder);
}
return 0;
else if (end || offset < 0) {
if (offset == -8)
offset = 0;
- ast_verbose(VERBOSE_PREFIX_3 "ControlPlayback seek to offset %ld from end\n", offset);
+ ast_verb(3, "ControlPlayback seek to offset %ld from end\n", offset);
ast_seekstream(chan->stream, offset, SEEK_END);
end = NULL;
offset = 0;
} else if (offset) {
- ast_verbose(VERBOSE_PREFIX_3 "ControlPlayback seek to offset %ld\n", offset);
+ ast_verb(3, "ControlPlayback seek to offset %ld\n", offset);
ast_seekstream(chan->stream, offset, SEEK_SET);
offset = 0;
};
end = start = time(NULL); /* pre-initialize end to be same as start in case we never get into loop */
for (x = 0; x < fmtcnt; x++) {
others[x] = ast_writefile(prepend ? prependfile : recordfile, sfmt[x], comment, O_TRUNC, 0, AST_FILE_MODE);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "x=%d, open writing: %s format: %s, %p\n", x, prepend ? prependfile : recordfile, sfmt[x], others[x]);
+ ast_verb(3, "x=%d, open writing: %s format: %s, %p\n", x, prepend ? prependfile : recordfile, sfmt[x], others[x]);
if (!others[x])
break;
if (totalsilence > maxsilence) {
/* Ended happily with silence */
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Recording automatically stopped after a silence of %d seconds\n", totalsilence/1000);
+ ast_verb(3, "Recording automatically stopped after a silence of %d seconds\n", totalsilence/1000);
res = 'S';
outmsg = 2;
break;
} else if (f->frametype == AST_FRAME_DTMF) {
if (prepend) {
/* stop recording with any digit */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "User ended message by pressing %c\n", f->subclass);
+ ast_verb(3, "User ended message by pressing %c\n", f->subclass);
res = 't';
outmsg = 2;
break;
}
if (strchr(acceptdtmf, f->subclass)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "User ended message by pressing %c\n", f->subclass);
+ ast_verb(3, "User ended message by pressing %c\n", f->subclass);
res = f->subclass;
outmsg = 2;
break;
}
if (strchr(canceldtmf, f->subclass)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "User cancelled message by pressing %c\n", f->subclass);
+ ast_verb(3, "User cancelled message by pressing %c\n", f->subclass);
res = f->subclass;
outmsg = 0;
break;
if (maxtime) {
end = time(NULL);
if (maxtime < (end - start)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Took too long, cutting it short...\n");
+ ast_verb(3, "Took too long, cutting it short...\n");
res = 't';
outmsg = 2;
break;
ast_frfree(f);
}
if (!f) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "User hung up\n");
+ ast_verb(3, "User hung up\n");
res = -1;
outmsg = 1;
} else {
ast_closestream(others[x]);
ast_closestream(realfiles[x]);
ast_filerename(prependfile, recordfile, sfmt[x]);
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "Recording Format: sfmts=%s, prependfile %s, recordfile %s\n", sfmt[x], prependfile, recordfile);
+ ast_verb(4, "Recording Format: sfmts=%s, prependfile %s, recordfile %s\n", sfmt[x], prependfile, recordfile);
ast_filedelete(prependfile, sfmt[x]);
}
}
}
case '2':
/* Review */
- ast_verbose(VERBOSE_PREFIX_3 "Reviewing the recording\n");
+ ast_verb(3, "Reviewing the recording\n");
cmd = ast_stream_and_wait(chan, recordfile, AST_DIGIT_ANY);
break;
case '3':
message_exists = 0;
/* Record */
if (recorded == 1)
- ast_verbose(VERBOSE_PREFIX_3 "Re-recording\n");
+ ast_verb(3, "Re-recording\n");
else
- ast_verbose(VERBOSE_PREFIX_3 "Recording\n");
+ ast_verb(3, "Recording\n");
recorded = 1;
cmd = ast_play_and_record(chan, playfile, recordfile, maxtime, fmt, duration, silencethreshold, maxsilence, path);
if (cmd == -1) {
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&be_list, i, list) {
if (!strcasecmp(name, i->name)) {
AST_RWLIST_REMOVE_CURRENT(&be_list, list);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Unregistered '%s' CDR backend\n", name);
+ ast_verb(2, "Unregistered '%s' CDR backend\n", name);
ast_free(i);
break;
}
ast_debug(1, "Registered handler for '%s' (%s)\n", chan->tech->type, chan->tech->description);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Registered channel type '%s' (%s)\n", chan->tech->type,
- chan->tech->description);
+ ast_verb(2, "Registered channel type '%s' (%s)\n", chan->tech->type, chan->tech->description);
AST_RWLIST_UNLOCK(&channels);
return 0;
if (chan->tech == tech) {
AST_LIST_REMOVE_CURRENT(&backends, list);
ast_free(chan);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Unregistered channel type '%s'\n", tech->type);
+ ast_verb(2, "Unregistered channel type '%s'\n", tech->type);
break;
}
}
case AST_BRIDGE_RETRY:
continue;
default:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s ended\n",
- c0->name, c1->name);
+ ast_verb(3, "Native bridging %s and %s ended\n", c0->name, c1->name);
/* fallthrough */
case AST_BRIDGE_FAILED_NOWARN:
nativefailed++;
if (ast_moh_start_ptr)
return ast_moh_start_ptr(chan, mclass, interpclass);
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Music class %s requested but no musiconhold loaded.\n",
- mclass ? mclass : (interpclass ? interpclass : "default"));
- }
+ ast_verb(3, "Music class %s requested but no musiconhold loaded.\n", mclass ? mclass : (interpclass ? interpclass : "default"));
return 0;
}
ast_log(LOG_WARNING, "'%s' is not a regular file, ignoring\n", fn);
continue;
}
- if (option_verbose > 1) {
- ast_verbose(VERBOSE_PREFIX_2 "Parsing '%s': ", fn);
+ ast_verb(2, "Parsing '%s': ", fn);
fflush(stdout);
- }
if (!(f = fopen(fn, "r"))) {
ast_debug(1, "No file to parse: %s\n", fn);
- if (option_verbose > 1)
- ast_verbose( "Not found (%s)\n", strerror(errno));
+ ast_verb(2, "Not found (%s)\n", strerror(errno));
continue;
}
count++;
ast_debug(1, "Parsing %s\n", fn);
- if (option_verbose > 1)
- ast_verbose("Found\n");
+ ast_verb(2, "Found\n");
while (!feof(f)) {
lineno++;
if (fgets(buf, sizeof(buf), f)) {
#else
if ((f = fopen(fn, "w"))) {
#endif
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Saving '%s': ", fn);
+ ast_verb(2, "Saving '%s': ", fn);
fprintf(f, ";!\n");
fprintf(f, ";! Automatically generated configuration file\n");
if (strcmp(configfile, fn))
#endif
cat = cat->next;
}
- if ((option_verbose > 1) && !option_debug)
- ast_verbose("Saved\n");
+ if (!option_debug)
+ ast_verb(2, "Saved\n");
} else {
ast_debug(1, "Unable to open for writing: %s\n", fn);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Unable to write (%s)", strerror(errno));
+ ast_verb(2, "Unable to write (%s)", strerror(errno));
return -1;
}
fclose(f);
}
map->next = config_maps;
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Binding %s to %s/%s/%s\n",
- map->name, map->driver, map->database, map->table ? map->table : map->name);
+ ast_verb(2, "Binding %s to %s/%s/%s\n", map->name, map->driver, map->database, map->table ? map->table : map->name);
config_maps = map;
return 0;
channel->owner = NULL;
} else {
success++;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", numsubst);
+ ast_verb(3, "Called %s\n", numsubst);
}
}
if (fr->frametype == AST_FRAME_CONTROL) {
switch (fr->subclass) {
case AST_CONTROL_ANSWER:
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", channel->owner->name, chan->name);
+ ast_verb(3, "%s answered %s\n", channel->owner->name, chan->name);
AST_LIST_REMOVE(&dial->channels, channel, list);
AST_LIST_INSERT_HEAD(&dial->channels, channel, list);
set_state(dial, AST_DIAL_RESULT_ANSWERED);
break;
case AST_CONTROL_BUSY:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s is busy\n", channel->owner->name);
+ ast_verb(3, "%s is busy\n", channel->owner->name);
ast_hangup(channel->owner);
channel->owner = NULL;
break;
case AST_CONTROL_CONGESTION:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s is circuit-busy\n", channel->owner->name);
+ ast_verb(3, "%s is circuit-busy\n", channel->owner->name);
ast_hangup(channel->owner);
channel->owner = NULL;
break;
case AST_CONTROL_RINGING:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s is ringing\n", channel->owner->name);
+ ast_verb(3, "%s is ringing\n", channel->owner->name);
if (!dial->options[AST_DIAL_OPTION_MUSIC])
ast_indicate(chan, AST_CONTROL_RINGING);
set_state(dial, AST_DIAL_RESULT_RINGING);
break;
case AST_CONTROL_PROGRESS:
- if (option_verbose > 2)
- ast_verbose (VERBOSE_PREFIX_3 "%s is making progress, passing it to %s\n", channel->owner->name, chan->name);
+ ast_verb(3, "%s is making progress, passing it to %s\n", channel->owner->name, chan->name);
ast_indicate(chan, AST_CONTROL_PROGRESS);
set_state(dial, AST_DIAL_RESULT_PROGRESS);
break;
case AST_CONTROL_VIDUPDATE:
- if (option_verbose > 2)
- ast_verbose (VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", channel->owner->name, chan->name);
+ ast_verb(3, "%s requested a video update, passing it to %s\n", channel->owner->name, chan->name);
ast_indicate(chan, AST_CONTROL_VIDUPDATE);
break;
case AST_CONTROL_PROCEEDING:
- if (option_verbose > 2)
- ast_verbose (VERBOSE_PREFIX_3 "%s is proceeding, passing it to %s\n", channel->owner->name, chan->name);
+ ast_verb(3, "%s is proceeding, passing it to %s\n", channel->owner->name, chan->name);
ast_indicate(chan, AST_CONTROL_PROCEEDING);
set_state(dial, AST_DIAL_RESULT_PROCEEDING);
break;
case AST_CONTROL_HOLD:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Call on %s placed on hold\n", chan->name);
+ ast_verb(3, "Call on %s placed on hold\n", chan->name);
ast_indicate(chan, AST_CONTROL_HOLD);
break;
case AST_CONTROL_UNHOLD:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Call on %s left from hold\n", chan->name);
+ ast_verb(3, "Call on %s left from hold\n", chan->name);
ast_indicate(chan, AST_CONTROL_UNHOLD);
break;
case AST_CONTROL_OFFHOOK:
switch (fr->subclass) {
case AST_CONTROL_ANSWER:
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "%s answered\n", channel->owner->name);
+ ast_verb(3, "%s answered\n", channel->owner->name);
AST_LIST_REMOVE(&dial->channels, channel, list);
AST_LIST_INSERT_HEAD(&dial->channels, channel, list);
set_state(dial, AST_DIAL_RESULT_ANSWERED);
break;
case AST_CONTROL_BUSY:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s is busy\n", channel->owner->name);
+ ast_verb(3, "%s is busy\n", channel->owner->name);
ast_hangup(channel->owner);
channel->owner = NULL;
break;
case AST_CONTROL_CONGESTION:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s is circuit-busy\n", channel->owner->name);
+ ast_verb(3, "%s is circuit-busy\n", channel->owner->name);
ast_hangup(channel->owner);
channel->owner = NULL;
break;
case AST_CONTROL_RINGING:
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s is ringing\n", channel->owner->name);
+ ast_verb(3, "%s is ringing\n", channel->owner->name);
set_state(dial, AST_DIAL_RESULT_RINGING);
break;
case AST_CONTROL_PROGRESS:
- if (option_verbose > 2)
- ast_verbose (VERBOSE_PREFIX_3 "%s is making progress\n", channel->owner->name);
+ ast_verb(3, "%s is making progress\n", channel->owner->name);
set_state(dial, AST_DIAL_RESULT_PROGRESS);
break;
case AST_CONTROL_PROCEEDING:
- if (option_verbose > 2)
- ast_verbose (VERBOSE_PREFIX_3 "%s is proceeding\n", channel->owner->name);
+ ast_verb(3, "%s is proceeding\n", channel->owner->name);
set_state(dial, AST_DIAL_RESULT_PROCEEDING);
break;
default:
AST_RWLIST_WRLOCK(&entry_list);
AST_RWLIST_REMOVE(&entry_list, entry, list);
AST_RWLIST_UNLOCK(&entry_list);
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "removing dns manager for '%s'\n", entry->name);
+ ast_verb(4, "removing dns manager for '%s'\n", entry->name);
ast_mutex_destroy(&entry->lock);
ast_free(entry);
if (*dnsmgr && !strcasecmp((*dnsmgr)->name, name))
return 0;
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_4 "doing dnsmgr_lookup for '%s'\n", name);
+ ast_verb(4, "doing dnsmgr_lookup for '%s'\n", name);
/* if it's actually an IP address and not a name,
there's no need for a managed lookup */
if (!enabled)
return 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_2 "adding dns manager for '%s'\n", name);
+ ast_verb(3, "adding dns manager for '%s'\n", name);
*dnsmgr = ast_dnsmgr_get(name, result);
return !*dnsmgr;
}
int changed = 0;
ast_mutex_lock(&entry->lock);
- if (verbose && (option_verbose > 2))
- ast_verbose(VERBOSE_PREFIX_2 "refreshing '%s'\n", entry->name);
+ if (verbose)
+ ast_verb(3, "refreshing '%s'\n", entry->name);
if ((hp = ast_gethostbyname(entry->name, &ahp))) {
/* check to see if it has changed, do callback if requested (where de callback is defined ????) */
return -1;
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_2 "Refreshing DNS lookups.\n");
+ ast_verb(3, "Refreshing DNS lookups.\n");
AST_RWLIST_RDLOCK(info->entries);
AST_RWLIST_TRAVERSE(info->entries, entry, list) {
if (info->regex_present && regexec(&info->filter, entry->name, 0, NULL, 0))
AST_RWLIST_INSERT_HEAD(&formats, tmp, list);
AST_RWLIST_UNLOCK(&formats);
- if (option_verbose > 1)
- ast_verbose( VERBOSE_PREFIX_2 "Registered file format %s, extension(s) %s\n", f->name, f->exts);
+ ast_verb(2, "Registered file format %s, extension(s) %s\n", f->name, f->exts);
return 0;
}
AST_RWLIST_TRAVERSE_SAFE_END
AST_RWLIST_UNLOCK(&formats);
- if (!res) {
- if (option_verbose > 1)
- ast_verbose( VERBOSE_PREFIX_2 "Unregistered format %s\n", name);
- } else
+ if (!res)
+ ast_verb(2, "Unregistered format %s\n", name);
+ else
ast_log(LOG_WARNING, "Tried to unregister format %s, already unregistered\n", name);
return res;
ast_playstream(fs);
if (vfs)
ast_playstream(vfs);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "<%s> Playing '%s.%s' (language '%s')\n", chan->name, filename, ast_getformatname(chan->writeformat), preflang ? preflang : "default");
+ ast_verb(3, "<%s> Playing '%s.%s' (language '%s')\n", chan->name, filename, ast_getformatname(chan->writeformat), preflang ? preflang : "default");
return 0;
}
int ast_image_register(struct ast_imager *img)
{
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Registered format '%s' (%s)\n", img->name, img->desc);
+ ast_verb(2, "Registered format '%s' (%s)\n", img->name, img->desc);
AST_RWLIST_WRLOCK(&imagers);
AST_RWLIST_INSERT_HEAD(&imagers, img, list);
AST_RWLIST_UNLOCK(&imagers);
}
AST_RWLIST_TRAVERSE_SAFE_END
AST_RWLIST_UNLOCK(&imagers);
- if (i && (option_verbose > 1))
- ast_verbose(VERBOSE_PREFIX_2 "Unregistered format '%s' (%s)\n", img->name, img->desc);
+ if (i)
+ ast_verb(2, "Unregistered format '%s' (%s)\n", img->name, img->desc);
}
int ast_supports_images(struct ast_channel *chan)
if (!country || !(zone = ast_get_indication_zone(country)))
return 1;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Setting default indication country to '%s'\n", country);
+ ast_verb(3, "Setting default indication country to '%s'\n", country);
/* Protect the current tonezone using the tone_zones lock as well */
AST_RWLIST_WRLOCK(&tone_zones);
/* It's all over. */
AST_RWLIST_UNLOCK(&tone_zones);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Registered indication country '%s'\n", zone->country);
+ ast_verb(3, "Registered indication country '%s'\n", zone->country);
return 0;
}
}
/* Remove from the list */
AST_RWLIST_REMOVE_CURRENT(&tone_zones, list);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Unregistered indication country '%s'\n", tz->country);
+ ast_verb(3, "Unregistered indication country '%s'\n", tz->country);
free_zone(tz);
res = 0;
}
}
res = 2;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Reloading module '%s' (%s)\n", cur->resource, info->description);
+ ast_verb(3, "Reloading module '%s' (%s)\n", cur->resource, info->description);
info->reload();
}
AST_LIST_UNLOCK(&module_list);
switch (res) {
case AST_MODULE_LOAD_SUCCESS:
if (!ast_fully_booted) {
- if (option_verbose)
- ast_verbose("%s => (%s)\n", resource_name, term_color(tmp, mod->info->description, COLOR_BROWN, COLOR_BLACK, sizeof(tmp)));
+ ast_verb(1, "%s => (%s)\n", resource_name, term_color(tmp, mod->info->description, COLOR_BROWN, COLOR_BLACK, sizeof(tmp)));
if (ast_opt_console && !option_verbose)
ast_verbose( ".");
} else {
- if (option_verbose)
- ast_verbose(VERBOSE_PREFIX_1 "Loaded %s => (%s)\n", resource_name, mod->info->description);
+ ast_verb(1, "Loaded %s => (%s)\n", resource_name, mod->info->description);
}
mod->flags.running = 1;
/* all embedded modules have registered themselves by now */
embedding = 0;
- if (option_verbose)
- ast_verbose("Asterisk Dynamic Loader Starting:\n");
+ ast_verb(1, "Asterisk Dynamic Loader Starting:\n");
AST_LIST_HEAD_INIT_NOLOCK(&load_order);
return -1;
}
s->authenticated = 1;
- if (option_verbose > 1) {
- if (manager_displayconnects(s)) {
- ast_verbose(VERBOSE_PREFIX_2 "%sManager '%s' logged on from %s\n", (s->managerid ? "HTTP " : ""), s->username, ast_inet_ntoa(s->sin.sin_addr));
- }
- }
+ if (manager_displayconnects(s))
+ ast_verb(2, "%sManager '%s' logged on from %s\n", (s->managerid ? "HTTP " : ""), s->username, ast_inet_ntoa(s->sin.sin_addr));
ast_log(LOG_EVENT, "%sManager '%s' logged on from %s\n", (s->managerid ? "HTTP " : ""), s->username, ast_inet_ntoa(s->sin.sin_addr));
astman_send_ack(s, m, "Authentication accepted");
return 0;
}
/* session is over, explain why and terminate */
if (s->authenticated) {
- if (option_verbose > 1) {
if (manager_displayconnects(s))
- ast_verbose(VERBOSE_PREFIX_2 "Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr));
- }
+ ast_verb(2, "Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr));
ast_log(LOG_EVENT, "Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr));
} else {
- if (option_verbose > 1) {
if (displayconnects)
- ast_verbose(VERBOSE_PREFIX_2 "Connect attempt from '%s' unable to authenticate\n", ast_inet_ntoa(s->sin.sin_addr));
- }
+ ast_verb(2, "Connect attempt from '%s' unable to authenticate\n", ast_inet_ntoa(s->sin.sin_addr));
ast_log(LOG_EVENT, "Failed attempt from %s\n", ast_inet_ntoa(s->sin.sin_addr));
}
destroy_session(s);
AST_LIST_REMOVE_CURRENT(&sessions, list);
ast_atomic_fetchadd_int(&num_sessions, -1);
if (s->authenticated && (option_verbose > 1) && manager_displayconnects(s)) {
- ast_verbose(VERBOSE_PREFIX_2 "HTTP Manager '%s' timed out from %s\n",
+ ast_verb(2, "HTTP Manager '%s' timed out from %s\n",
s->username, ast_inet_ntoa(s->sin.sin_addr));
}
free_session(s); /* XXX outside ? */
else
first_action = cur->next;
ast_free(cur);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Manager unregistered action %s\n", action);
+ ast_verb(2, "Manager unregistered action %s\n", action);
break;
}
}
first_action = act;
act->next = cur;
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Manager registered action %s\n", act->action);
+ ast_verb(2, "Manager registered action %s\n", act->action);
ast_rwlock_unlock(&actionlock);
return 0;
}
if (process_message(s, &m)) {
if (s->authenticated) {
- if (option_verbose > 1) {
if (manager_displayconnects(s))
- ast_verbose(VERBOSE_PREFIX_2 "HTTP Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr));
- }
+ ast_verb(2, "HTTP Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr));
ast_log(LOG_EVENT, "HTTP Manager '%s' logged off from %s\n", s->username, ast_inet_ntoa(s->sin.sin_addr));
} else {
- if (option_verbose > 1) {
if (displayconnects)
- ast_verbose(VERBOSE_PREFIX_2 "HTTP Connect attempt from '%s' unable to authenticate\n", ast_inet_ntoa(s->sin.sin_addr));
- }
+ ast_verb(2, "HTTP Connect attempt from '%s' unable to authenticate\n", ast_inet_ntoa(s->sin.sin_addr));
ast_log(LOG_EVENT, "HTTP Failed attempt from %s\n", ast_inet_ntoa(s->sin.sin_addr));
}
s->needdestroy = 1;
return AST_BRIDGE_FAILED_NOWARN;
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Packet2Packet bridging %s and %s\n", c0->name, c1->name);
+ ast_verb(3, "Packet2Packet bridging %s and %s\n", c0->name, c1->name);
res = bridge_p2p_loop(c0, c1, p0, p1, timeoutms, flags, fo, rc, pvt0, pvt1);
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name);
+ ast_verb(3, "Native bridging %s and %s\n", c0->name, c1->name);
res = bridge_native_loop(c0, c1, p0, p1, vp0, vp1, tp0, tp1, pr0, pr1, codec0, codec1, timeoutms, flags, fo, rc, pvt0, pvt1);
}
rtpstart = 5000;
rtpend = 31000;
}
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "RTP Allocating from port range %d -> %d\n", rtpstart, rtpend);
+ ast_verb(2, "RTP Allocating from port range %d -> %d\n", rtpstart, rtpend);
return 0;
}
int state = 0; /* no need to save anything */
int mf = 1; /* +1 = Masculin; -1 = Feminin */
char fn[SAY_NUM_BUF_SIZE] = "";
- ast_verbose(VERBOSE_PREFIX_3 "ast_say_digits_full: started. "
+ ast_verb(3, "ast_say_digits_full: started. "
"num: %d, options=\"%s\"\n",
num, options
);
* state==0 is the normal mode and it means that we continue
* to check if the number num has yet anything left.
*/
- ast_verbose(VERBOSE_PREFIX_3 "ast_say_digits_full: num: %d, "
+ ast_verb(3, "ast_say_digits_full: num: %d, "
"state=%d, options=\"%s\", mf=%d\n",
num, state, options, mf
);
return -1;
}
if (res && strcmp(repl, ".")) {
- if (option_verbose > 3)
- ast_verbose( VERBOSE_PREFIX_3 "parse_srv: SRV mapped to host %s, port %d\n", repl, ntohs(srv->portnum));
+ ast_verb(3, "parse_srv: SRV mapped to host %s, port %d\n", repl, ntohs(srv->portnum));
if (host) {
ast_copy_string(host, repl, hostlen);
host[hostlen-1] = '\0';
{
static int added_cli = 0;
struct ast_translator *u;
+ char tmp[80];
if (!mod) {
ast_log(LOG_WARNING, "Missing module pointer, you need to supply one\n");
calc_cost(t, 1);
- if (option_verbose > 1) {
- char tmp[80];
-
- ast_verbose(VERBOSE_PREFIX_2 "Registered translator '%s' from format %s to %s, cost %d\n",
+ ast_verb(2, "Registered translator '%s' from format %s to %s, cost %d\n",
term_color(tmp, t->name, COLOR_MAGENTA, COLOR_BLACK, sizeof(tmp)),
ast_getformatname(1 << t->srcfmt), ast_getformatname(1 << t->dstfmt), t->cost);
- }
if (!added_cli) {
ast_cli_register_multiple(cli_translate, sizeof(cli_translate) / sizeof(struct ast_cli_entry));
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&translators, u, list) {
if (u == t) {
AST_RWLIST_REMOVE_CURRENT(&translators, list);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Unregistered translator '%s' from format %s to %s\n", term_color(tmp, t->name, COLOR_MAGENTA, COLOR_BLACK, sizeof(tmp)), ast_getformatname(1 << t->srcfmt), ast_getformatname(1 << t->dstfmt));
+ ast_verb(2, "Unregistered translator '%s' from format %s to %s\n", term_color(tmp, t->name, COLOR_MAGENTA, COLOR_BLACK, sizeof(tmp)), ast_getformatname(1 << t->srcfmt), ast_getformatname(1 << t->dstfmt));
found = 1;
break;
}
}
if (udptl_debug_test_addr(&sin)) {
- if (option_verbose)
- ast_verbose("Got UDPTL packet from %s:%d (type %d, seq %d, len %d)\n",
+ ast_verb(1, "Got UDPTL packet from %s:%d (type %d, seq %d, len %d)\n",
ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port), 0, seqno, res);
}
#if 0
udptlstart = 4500;
udptlend = 4999;
}
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "UDPTL allocating from port range %d -> %d\n", udptlstart, udptlend);
+ ast_verb(2, "UDPTL allocating from port range %d -> %d\n", udptlstart, udptlend);
}
void ast_udptl_init(void)
ntohs(trans->addr.sin_port), expire);
ast_db_put("dundi/dpeers", dundi_eid_to_str_short(eid_str, sizeof(eid_str), &peer->eid), data);
if (inaddrcmp(&peer->addr, &trans->addr)) {
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Registered DUNDi peer '%s' at '%s:%d'\n",
+ ast_verb(3, "Registered DUNDi peer '%s' at '%s:%d'\n",
dundi_eid_to_str(eid_str, sizeof(eid_str), &peer->eid),
ast_inet_ntoa(trans->addr.sin_addr), ntohs(trans->addr.sin_port));
- }
needqual = 1;
}
ast_custom_function_register(&dundi_query_function);
ast_custom_function_register(&dundi_result_function);
- if (option_verbose > 1) {
- ast_verbose(VERBOSE_PREFIX_2 "DUNDi Ready and Listening on %s port %d\n",
- ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
- }
+ ast_verb(2, "DUNDi Ready and Listening on %s port %d\n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
return AST_MODULE_LOAD_SUCCESS;
}
ast_update_use_count();
ast_unregister_verbose(verboser);
ast_unload_resource("pbx_gtkconsole", 0);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "GTK Console Monitor Exiting\n");
+ ast_verb(2, "GTK Console Monitor Exiting\n");
/* XXX Trying to quit after calling this makes asterisk segfault XXX */
}
if (!show_console()) {
inuse++;
ast_update_use_count();
- if (option_verbose > 1)
- ast_verbose( VERBOSE_PREFIX_2 "Launched GTK Console monitor\n");
+ ast_verb(2, "Launched GTK Console monitor\n");
} else
ast_log(LOG_WARNING, "Unable to start GTK console\n");
} else {
if (option_debug)
ast_log(LOG_DEBUG, "Unable to start GTK console monitor -- ignoring\n");
- else if (option_verbose > 1)
- ast_verbose( VERBOSE_PREFIX_2 "GTK is not available -- skipping monitor\n");
+ else
+ ast_verb(2, "GTK is not available -- skipping monitor\n");
}
return 0;
}
if(!ast_strlen_zero(tmp))
pbx_substitute_variables_helper(chan, tmp, appdata, sizeof(appdata) - 1);
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Executing %s(\"%s\", \"%s\")\n",
+ ast_verb(3, "Executing %s(\"%s\", \"%s\")\n",
term_color(tmp1, app, COLOR_BRCYAN, 0, sizeof(tmp1)),
term_color(tmp2, chan->name, COLOR_BRMAGENTA, 0, sizeof(tmp2)),
term_color(tmp3, S_OR(appdata, ""), COLOR_BRMAGENTA, 0, sizeof(tmp3)));
struct outgoing *o = data;
int res, reason;
if (!ast_strlen_zero(o->app)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Attempting call on %s/%s for application %s(%s) (Retry %d)\n", o->tech, o->dest, o->app, o->data, o->retries);
+ ast_verb(3, "Attempting call on %s/%s for application %s(%s) (Retry %d)\n", o->tech, o->dest, o->app, o->data, o->retries);
res = ast_pbx_outgoing_app(o->tech, AST_FORMAT_SLINEAR, o->dest, o->waittime * 1000, o->app, o->data, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Attempting call on %s/%s for %s@%s:%d (Retry %d)\n", o->tech, o->dest, o->exten, o->context,o->priority, o->retries);
+ ast_verb(3, "Attempting call on %s/%s for %s@%s:%d (Retry %d)\n", o->tech, o->dest, o->exten, o->context,o->priority, o->retries);
res = ast_pbx_outgoing_exten(o->tech, AST_FORMAT_SLINEAR, o->dest, o->waittime * 1000, o->context, o->exten, o->priority, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
}
if (res) {
_exit(1);
}
pthread_sigmask(SIG_SETMASK, &old_set, NULL);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Launched AGI Script %s\n", script);
+ ast_verb(3, "Launched AGI Script %s\n", script);
fds[0] = toast[0];
fds[1] = fromast[1];
if (efd)
vfs = ast_openvstream(chan, argv[2], chan->language);
ast_debug(vfs && 1, "Ooh, found a video stream, too\n");
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Playing '%s' (escape_digits=%s) (sample_offset %ld)\n", argv[2], edigits, sample_offset);
+ ast_verb(3, "Playing '%s' (escape_digits=%s) (sample_offset %ld)\n", argv[2], edigits, sample_offset);
ast_seekstream(fs, 0, SEEK_END);
max_length = ast_tellstream(fs);
vfs = ast_openvstream(chan, argv[2], chan->language);
ast_debug(vfs && 1, "Ooh, found a video stream, too\n");
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Playing '%s' (escape_digits=%s) (timeout %d)\n", argv[2], edigits, timeout);
+ ast_verb(3, "Playing '%s' (escape_digits=%s) (timeout %d)\n", argv[2], edigits, timeout);
ast_seekstream(fs, 0, SEEK_END);
max_length = ast_tellstream(fs);
if (argc < 2)
return RESULT_SHOWUSAGE;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "AGI Script Executing Application: (%s) Options: (%s)\n", argv[1], argv[2]);
+ ast_verb(3, "AGI Script Executing Application: (%s) Options: (%s)\n", argv[1], argv[2]);
if ((app = pbx_findapp(argv[1]))) {
res = pbx_exec(chan, app, argv[2]);
/* Program terminated */
if (returnstatus && returnstatus != AST_PBX_KEEPALIVE)
returnstatus = -1;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "AGI Script %s completed, returning %d\n", request, returnstatus);
+ ast_verb(3, "AGI Script %s completed, returning %d\n", request, returnstatus);
if (pid > 0)
waitpid(pid, status, 0);
/* No need to kill the pid anymore, since they closed us */
res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &sth);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
- if (option_verbose > 3)
- ast_verbose( VERBOSE_PREFIX_4 "Failure in AllocStatement %d\n", res);
+ ast_verb(4, "Failure in AllocStatement %d\n", res);
return NULL;
}
res = SQLPrepare(sth, (unsigned char *)q->sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
- if (option_verbose > 3)
- ast_verbose( VERBOSE_PREFIX_4 "Error in PREPARE %d\n", res);
+ ast_verb(4, "Error in PREPARE %d\n", res);
SQLFreeHandle(SQL_HANDLE_STMT, sth);
return NULL;
}
static int unload_module (void)
{
ast_config_engine_deregister(&odbc_engine);
- if (option_verbose)
- ast_verbose("res_config_odbc unloaded.\n");
+ ast_verb(1, "res_config_odbc unloaded.\n");
return 0;
}
static int load_module (void)
{
ast_config_engine_register(&odbc_engine);
- if (option_verbose)
- ast_verbose("res_config_odbc loaded.\n");
+ ast_verb(1, "res_config_odbc loaded.\n");
return 0;
}
}
ast_config_engine_register(&pgsql_engine);
- if (option_verbose) {
- ast_verbose("Postgresql RealTime driver loaded.\n");
- }
+ ast_verb(1, "Postgresql RealTime driver loaded.\n");
ast_cli_register_multiple(cli_realtime, sizeof(cli_realtime) / sizeof(struct ast_cli_entry));
ast_mutex_unlock(&pgsql_lock);
};
ast_cli_unregister_multiple(cli_realtime, sizeof(cli_realtime) / sizeof(struct ast_cli_entry));
ast_config_engine_deregister(&pgsql_engine);
- if (option_verbose) {
- ast_verbose("Postgresql RealTime unloaded.\n");
- }
+ ast_verb(1, "Postgresql RealTime unloaded.\n");
/* Unlock so something else can destroy the lock. */
ast_mutex_unlock(&pgsql_lock);
ast_debug(1, "Postgresql RealTime: Cannot Connect: %s\n", PQerrorMessage(pgsqlConn));
}
- ast_verbose(VERBOSE_PREFIX_2 "Postgresql RealTime reloaded.\n");
+ ast_verb(2, "Postgresql RealTime reloaded.\n");
/* Done reloading. Release lock so others can now use driver. */
ast_mutex_unlock(&pgsql_lock);
if (RSA_size(key->rsa) == 128) {
/* Key loaded okay */
key->ktype &= ~KEY_NEEDS_PASSCODE;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Loaded %s key '%s'\n", key->ktype == AST_KEY_PUBLIC ? "PUBLIC" : "PRIVATE", key->name);
+ ast_verb(3, "Loaded %s key '%s'\n", key->ktype == AST_KEY_PUBLIC ? "PUBLIC" : "PRIVATE", key->name);
ast_debug(1, "Key '%s' loaded OK\n", key->name);
key->delme = 0;
} else
AST_LIST_UNLOCK(&parkinglot);
/* Wake up the (presumably select()ing) thread */
pthread_kill(parking_thread, SIGURG);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Parked %s on %d@%s. Will timeout back to extension [%s] %s, %d in %d seconds\n", pu->chan->name, pu->parkingnum, parking_con, pu->context, pu->exten, pu->priority, (pu->parkingtime/1000));
+ ast_verb(2, "Parked %s on %d@%s. Will timeout back to extension [%s] %s, %d in %d seconds\n", pu->chan->name, pu->parkingnum, parking_con, pu->context, pu->exten, pu->priority, (pu->parkingtime/1000));
if (pu->parkingnum != -1)
snprintf(pu->parkingexten, sizeof(pu->parkingexten), "%d", x);
}
if (callee_chan->monitor) {
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_3 "User hit '%s' to stop recording call.\n", code);
+ ast_verb(4, "User hit '%s' to stop recording call.\n", code);
ast_monitor_stop(callee_chan, 1);
return FEATURE_RETURN_SUCCESS;
}
args[x] = '-';
}
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_3 "User hit '%s' to record call. filename: %s\n", code, args);
+ ast_verb(4, "User hit '%s' to record call. filename: %s\n", code, args);
pbx_exec(callee_chan, monitor_app, args);
pbx_builtin_setvar_helper(callee_chan, "TOUCH_MONITOR_OUTPUT", touch_filename);
static int builtin_disconnect(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense)
{
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_3 "User hit '%s' to disconnect call.\n", code);
+ ast_verb(4, "User hit '%s' to disconnect call.\n", code);
return FEATURE_RETURN_HANGUP;
}
}
if (!transferee->pbx) {
/* Doh! Use our handy async_goto functions */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Transferring %s to '%s' (context %s) priority 1\n"
+ ast_verb(3, "Transferring %s to '%s' (context %s) priority 1\n"
,transferee->name, xferto, transferer_real_context);
if (ast_async_goto(transferee, transferer_real_context, xferto, 1))
ast_log(LOG_WARNING, "Async goto failed :-(\n");
check_goto_on_transfer(transferer);
return res;
} else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Unable to find extension '%s' in context '%s'\n", xferto, transferer_real_context);
+ ast_verb(3, "Unable to find extension '%s' in context '%s'\n", xferto, transferer_real_context);
}
if (ast_stream_and_wait(transferer, xferfailsound, AST_DIGIT_ANY) < 0) {
finishup(transferee);
ast_stopstream(transferer);
res = finishup(transferee);
if (res) {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Hungup during autoservice stop on '%s'\n", transferee->name);
+ ast_verb(2, "Hungup during autoservice stop on '%s'\n", transferee->name);
return res;
}
return FEATURE_RETURN_SUCCESS;
AST_LIST_INSERT_HEAD(&feature_list,feature,feature_entry);
AST_LIST_UNLOCK(&feature_list);
- if (option_verbose >= 2)
- ast_verbose(VERBOSE_PREFIX_2 "Registered Feature '%s'\n",feature->sname);
+ ast_verb(2, "Registered Feature '%s'\n",feature->sname);
}
/*! \brief This function must be called while feature_groups is locked... */
AST_LIST_INSERT_HEAD(&feature_groups, fg, entry);
- if (option_verbose >= 2)
- ast_verbose(VERBOSE_PREFIX_2 "Registered group '%s'\n", fg->gname);
+ ast_verb(2, "Registered group '%s'\n", fg->gname);
return fg;
}
AST_LIST_INSERT_HEAD(&fg->features, fge, entry);
- if (option_verbose >= 2)
- ast_verbose(VERBOSE_PREFIX_2 "Registered feature '%s' for group '%s' at exten '%s'\n",
+ ast_verb(2, "Registered feature '%s' for group '%s' at exten '%s'\n",
feature->sname, fg->gname, exten);
}
/* Feature is up for consideration */
if (!strcmp(feature->exten, code)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 " Feature Found: %s exten: %s\n",feature->sname, tok);
+ ast_verb(3, " Feature Found: %s exten: %s\n",feature->sname, tok);
res = feature->operation(chan, peer, config, code, sense);
AST_LIST_UNLOCK(&feature_list);
break;
if (f->frametype == AST_FRAME_CONTROL || f->frametype == AST_FRAME_DTMF || f->frametype == AST_FRAME_TEXT) {
if (f->subclass == AST_CONTROL_RINGING) {
state = f->subclass;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s is ringing\n", chan->name);
+ ast_verb(3, "%s is ringing\n", chan->name);
ast_indicate(caller, AST_CONTROL_RINGING);
} else if ((f->subclass == AST_CONTROL_BUSY) || (f->subclass == AST_CONTROL_CONGESTION)) {
state = f->subclass;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "%s is busy\n", chan->name);
+ ast_verb(3, "%s is busy\n", chan->name);
ast_indicate(caller, AST_CONTROL_BUSY);
ast_frfree(f);
f = NULL;
post_manager_event("ParkedCallTimeOut", pu);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Timeout for %s parked on %d. Returning to %s,%s,%d\n", chan->name, pu->parkingnum, chan->context, chan->exten, chan->priority);
+ ast_verb(2, "Timeout for %s parked on %d. Returning to %s,%s,%d\n", chan->name, pu->parkingnum, chan->context, chan->exten, chan->priority);
/* Start up the PBX, or hang them up */
if (ast_pbx_start(chan)) {
ast_log(LOG_WARNING, "Unable to restart the PBX for user on '%s', hanging them up...\n", chan->name);
post_manager_event("ParkedCallGiveUp", pu);
/* There's a problem, hang them up*/
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "%s got tired of being parked\n", chan->name);
+ ast_verb(2, "%s got tired of being parked\n", chan->name);
ast_hangup(chan);
/* And take them out of the parking lot */
AST_LIST_REMOVE_CURRENT(&parkinglot, list);
}
/* This runs sorta backwards, since we give the incoming channel control, as if it
were the person called. */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel %s connected to parked call %d\n", chan->name, park);
+ ast_verb(3, "Channel %s connected to parked call %d\n", chan->name, park);
pbx_builtin_setvar_helper(chan, "PARKEDCHANNEL", peer->name);
ast_cdr_setdestchan(chan->cdr, peer->name);
/*! \todo XXX Play a message XXX */
if (ast_stream_and_wait(chan, "pbx-invalidpark", ""))
ast_log(LOG_WARNING, "ast_streamfile of %s failed on %s\n", "pbx-invalidpark", chan->name);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel %s tried to talk to nonexistent parked call %d\n", chan->name, park);
+ ast_verb(3, "Channel %s tried to talk to nonexistent parked call %d\n", chan->name, park);
res = -1;
}
ast_register_feature(feature);
- if (option_verbose >= 1)
- ast_verbose(VERBOSE_PREFIX_2 "Mapping Feature '%s' to app '%s(%s)' with code '%s'\n", var->name, app, app_args, exten);
+ ast_verb(2, "Mapping Feature '%s' to app '%s(%s)' with code '%s'\n", var->name, app, app_args, exten);
}
ast_unregister_groups();
iks_delete(iq);
}
}
- if (option_verbose > 4) {
switch (pak->subtype) {
case IKS_TYPE_AVAILABLE:
- ast_verbose(VERBOSE_PREFIX_3 "JABBER: I am available ^_* %i\n", pak->subtype);
+ ast_verb(5, "JABBER: I am available ^_* %i\n", pak->subtype);
break;
case IKS_TYPE_UNAVAILABLE:
- ast_verbose(VERBOSE_PREFIX_3 "JABBER: I am unavailable ^_* %i\n", pak->subtype);
+ ast_verb(5, "JABBER: I am unavailable ^_* %i\n", pak->subtype);
break;
default:
- ast_verbose(VERBOSE_PREFIX_3 "JABBER: Ohh sexy and the wrong type: %i\n", pak->subtype);
+ ast_verb(5, "JABBER: Ohh sexy and the wrong type: %i\n", pak->subtype);
}
switch (pak->show) {
case IKS_SHOW_UNAVAILABLE:
- ast_verbose(VERBOSE_PREFIX_3 "JABBER: type: %i subtype %i\n", pak->subtype, pak->show);
+ ast_verb(5, "JABBER: type: %i subtype %i\n", pak->subtype, pak->show);
break;
case IKS_SHOW_AVAILABLE:
- ast_verbose(VERBOSE_PREFIX_3 "JABBER: type is available\n");
+ ast_verb(5, "JABBER: type is available\n");
break;
case IKS_SHOW_CHAT:
- ast_verbose(VERBOSE_PREFIX_3 "JABBER: type: %i subtype %i\n", pak->subtype, pak->show);
+ ast_verb(5, "JABBER: type: %i subtype %i\n", pak->subtype, pak->show);
break;
case IKS_SHOW_AWAY:
- ast_verbose(VERBOSE_PREFIX_3 "JABBER: type is away\n");
+ ast_verb(5, "JABBER: type is away\n");
break;
case IKS_SHOW_XA:
- ast_verbose(VERBOSE_PREFIX_3 "JABBER: type: %i subtype %i\n", pak->subtype, pak->show);
+ ast_verb(5, "JABBER: type: %i subtype %i\n", pak->subtype, pak->show);
break;
case IKS_SHOW_DND:
- ast_verbose(VERBOSE_PREFIX_3 "JABBER: type: %i subtype %i\n", pak->subtype, pak->show);
+ ast_verb(5, "JABBER: type: %i subtype %i\n", pak->subtype, pak->show);
break;
default:
- ast_verbose(VERBOSE_PREFIX_3 "JABBER: Kinky! how did that happen %i\n", pak->show);
+ ast_verb(5, "JABBER: Kinky! how did that happen %i\n", pak->show);
}
}
-}
/*!
* \brief handles subscription requests.
if(client->component)
aji_set_presence(client, pak->from->full, iks_find_attrib(pak->x, "to"), 1, client->statusmessage);
}
- if (option_verbose > 4) {
switch (pak->subtype) {
case IKS_TYPE_SUBSCRIBE:
- ast_verbose(VERBOSE_PREFIX_3 "JABBER: This is a subcription of type %i\n", pak->subtype);
+ ast_verb(5, "JABBER: This is a subcription of type %i\n", pak->subtype);
break;
case IKS_TYPE_SUBSCRIBED:
- ast_verbose(VERBOSE_PREFIX_3 "JABBER: This is a subcription of type %i\n", pak->subtype);
+ ast_verb(5, "JABBER: This is a subcription of type %i\n", pak->subtype);
break;
case IKS_TYPE_UNSUBSCRIBE:
- ast_verbose(VERBOSE_PREFIX_3 "JABBER: This is a subcription of type %i\n", pak->subtype);
+ ast_verb(5, "JABBER: This is a subcription of type %i\n", pak->subtype);
break;
case IKS_TYPE_UNSUBSCRIBED:
- ast_verbose(VERBOSE_PREFIX_3 "JABBER: This is a subcription of type %i\n", pak->subtype);
+ ast_verb(5, "JABBER: This is a subcription of type %i\n", pak->subtype);
break;
default: /*IKS_TYPE_ERROR: */
- ast_verbose(VERBOSE_PREFIX_3 "JABBER: This is a subcription of type %i\n", pak->subtype);
+ ast_verb(5, "JABBER: This is a subcription of type %i\n", pak->subtype);
break;
}
}
-}
/*!
* \brief sends messages.
do {
if (res != IKS_OK) {
while(res != IKS_OK) {
- if(option_verbose > 3)
- ast_verbose("JABBER: reconnecting.\n");
+ ast_verb(4, "JABBER: reconnecting.\n");
res = aji_reconnect(client);
sleep(4);
}
int ast_aji_disconnect(struct aji_client *client)
{
if (client) {
- if (option_verbose > 3)
- ast_verbose(VERBOSE_PREFIX_3 "JABBER: Disconnecting\n");
+ ast_verb(4, "JABBER: Disconnecting\n");
iks_disconnect(client->p);
iks_parser_delete(client->p);
ASTOBJ_UNREF(client, aji_client_destroy);
ast_closestream(chan->stream);
chan->stream = NULL;
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Stopped music on hold on %s\n", chan->name);
+ ast_verb(3, "Stopped music on hold on %s\n", chan->name);
if (state->origwfmt && ast_set_write_format(chan, state->origwfmt)) {
ast_log(LOG_WARNING, "Unable to restore channel '%s' to format '%d'\n", chan->name, state->origwfmt);
state->origwfmt = chan->writeformat;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Started music on hold, class '%s', on %s\n", class->name, chan->name);
+ ast_verb(3, "Started music on hold, class '%s', on %s\n", class->name, chan->name);
}
return chan->music_state;
if (chan) {
if (oldwfmt && ast_set_write_format(chan, oldwfmt))
ast_log(LOG_WARNING, "Unable to restore channel '%s' to format %s\n", chan->name, ast_getformatname(oldwfmt));
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Stopped music on hold on %s\n", chan->name);
+ ast_verb(3, "Stopped music on hold on %s\n", chan->name);
}
}
moh_release(NULL, res);
res = NULL;
}
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Started music on hold, class '%s', on channel '%s'\n", class->name, chan->name);
+ ast_verb(3, "Started music on hold, class '%s', on channel '%s'\n", class->name, chan->name);
}
return res;
}
char buff[8192];
int bytes, tbytes = 0, stime = 0, pid = 0;
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Destroying musiconhold processes\n");
+ ast_verb(2, "Destroying musiconhold processes\n");
AST_RWLIST_WRLOCK(&mohclasses);
while ((moh = AST_RWLIST_REMOVE_HEAD(&mohclasses, list))) {
iface->msg_expiry = msg_expiry;
/* start the listner thread */
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Starting SMDI monitor thread for %s\n", iface->name);
+ ast_verb(3, "Starting SMDI monitor thread for %s\n", iface->name);
if (ast_pthread_create_background(&iface->thread, NULL, smdi_read, iface)) {
ast_log(LOG_ERROR, "Error starting SMDI monitor thread for %s\n", iface->name);
ASTOBJ_UNREF(iface, ast_smdi_interface_destroy);
if(!load_config())
return AST_MODULE_LOAD_DECLINE;
- ast_verbose(VERBOSE_PREFIX_1 "Loading [Sub]Agent Module\n");
+ ast_verb(1, "Loading [Sub]Agent Module\n");
res_snmp_dont_stop = 1;
if (res_snmp_enabled)
static int unload_module(void)
{
- ast_verbose(VERBOSE_PREFIX_1 "Unloading [Sub]Agent Module\n");
+ ast_verb(1, "Unloading [Sub]Agent Module\n");
res_snmp_dont_stop = 0;
return ((thread != AST_PTHREADT_NULL) ? pthread_join(thread, NULL) : 0);
return -1;
}
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Registered speech recognition engine '%s'\n", engine->name);
+ ast_verb(2, "Registered speech recognition engine '%s'\n", engine->name);
/* Add to the engine linked list and make default if needed */
AST_RWLIST_WRLOCK(&engines);
AST_RWLIST_INSERT_HEAD(&engines, engine, list);
if (!default_engine) {
default_engine = engine;
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Made '%s' the default speech recognition engine\n", engine->name);
+ ast_verb(2, "Made '%s' the default speech recognition engine\n", engine->name);
}
AST_RWLIST_UNLOCK(&engines);
/* If this was the default engine, we need to pick a new one */
if (!default_engine)
default_engine = AST_RWLIST_FIRST(&engines);
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Unregistered speech recognition engine '%s'\n", engine_name);
+ ast_verb(2, "Unregistered speech recognition engine '%s'\n", engine_name);
/* All went well */
res = 0;
break;