dect
/
asterisk
Archived
13
0
Fork 0

Replace ast_log(LOG_DEBUG, ...) with ast_debug()

(closes issue #18556)
Reported by: kkm

Review: https://reviewboard.asterisk.org/r/1071/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@306258 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
pabelanger 2011-02-04 16:55:39 +00:00
parent 71d8066a81
commit 6705f03406
39 changed files with 739 additions and 777 deletions

View File

@ -1083,7 +1083,6 @@ static int ooh323_answer(struct ast_channel *ast)
if (ast->_state != AST_STATE_UP) {
ast_channel_lock(ast);
ast_setstate(ast, AST_STATE_UP);
if (option_debug)
ast_debug(1, "ooh323_answer(%s)\n", ast->name);
ast_channel_unlock(ast);
ooAnswerCall(p->callToken);
@ -1133,7 +1132,6 @@ static int ooh323_write(struct ast_channel *ast, struct ast_frame *f)
return res;
}
if (f->frametype == AST_FRAME_VOICE) {
/* sending progress for first */
if (!ast_test_flag(p, H323_OUTGOING) && !p->progsent &&
@ -1226,24 +1224,26 @@ static int ooh323_indicate(struct ast_channel *ast, int condition, const void *d
case AST_CONTROL_PROGRESS:
if (ast->_state != AST_STATE_UP) {
if (!p->progsent) {
if (gH323Debug)
ast_log(LOG_DEBUG,"Sending manual progress for %s, res = %d\n", callToken,
if (gH323Debug) {
ast_debug(1, "Sending manual progress for %s, res = %d\n", callToken,
ooManualProgress(callToken));
else
} else {
ooManualProgress(callToken);
}
p->progsent = 1;
}
}
break;
case AST_CONTROL_RINGING:
if (ast->_state == AST_STATE_RING || ast->_state == AST_STATE_RINGING) {
if (gH323Debug)
ast_log(LOG_DEBUG,"Sending manual ringback for %s, res = %d\n",
if (gH323Debug) {
ast_debug(1, "Sending manual ringback for %s, res = %d\n",
callToken,
ooManualRingback(callToken));
else
} else {
ooManualRingback(callToken);
}
}
break;
case AST_CONTROL_SRCUPDATE:
ast_rtp_instance_update_source(p->rtp);
@ -1256,9 +1256,10 @@ static int ooh323_indicate(struct ast_channel *ast, int condition, const void *d
|| ast_strlen_zero(ast->connected.id.name.str)) {
break;
}
if (gH323Debug)
ast_log(LOG_DEBUG, "Sending connected line info for %s (%s)\n",
if (gH323Debug) {
ast_debug(1, "Sending connected line info for %s (%s)\n",
callToken, ast->connected.id.name.str);
}
ooSetANI(callToken, ast->connected.id.name.str);
break;
@ -2056,7 +2057,7 @@ int onCallCleared(ooCallData *call)
while (p->owner) {
if (ast_channel_trylock(p->owner)) {
ooTrace(OOTRCLVLINFO, "Failed to grab lock, trying again\n");
ast_log(LOG_DEBUG,"Failed to grab lock, trying again\n");
ast_debug(1, "Failed to grab lock, trying again\n");
DEADLOCK_AVOIDANCE(&p->lock);
} else {
ownerLock = 1; break;
@ -4251,8 +4252,10 @@ struct ast_frame *ooh323_rtp_read(struct ast_channel *ast, struct ooh323_pvt *p)
break;
case 5:
f = ast_udptl_read(p->udptl); /* UDPTL t.38 data */
if (gH323Debug) ast_debug(1, "Got UDPTL %d/%d len %d for %s\n",
if (gH323Debug) {
ast_debug(1, "Got UDPTL %d/%d len %d for %s\n",
f->frametype, f->subclass.integer, f->datalen, ast->name);
}
break;
default:
@ -4273,11 +4276,12 @@ struct ast_frame *ooh323_rtp_read(struct ast_channel *ast, struct ooh323_pvt *p)
(f->subclass.format.id == AST_FORMAT_SLINEAR || f->subclass.format.id == AST_FORMAT_ALAW ||
f->subclass.format.id == AST_FORMAT_ULAW)) {
f = ast_dsp_process(p->owner, p->vad, f);
if (f && (f->frametype == AST_FRAME_DTMF))
if (f && (f->frametype == AST_FRAME_DTMF)) {
ast_debug(1, "* Detected inband DTMF '%c'\n", f->subclass.integer);
}
}
}
}
return f;
}
@ -4292,13 +4296,15 @@ void onModeChanged(ooCallData *call, int t38mode) {
ast_mutex_lock(&p->lock);
if (gH323Debug)
if (gH323Debug) {
ast_debug(1, "change mode to %d for %s\n", t38mode, call->callToken);
}
if (t38mode == p->faxmode) {
if (gH323Debug)
if (gH323Debug) {
ast_debug(1, "mode for %s is already %d\n", call->callToken,
t38mode);
}
ast_mutex_unlock(&p->lock);
return;
}

View File

@ -172,7 +172,7 @@ static void span_message(int level, const char *msg)
} else if (level == SPAN_LOG_WARNING) {
ast_log(LOG_WARNING, "%s", msg);
} else {
ast_log(LOG_DEBUG, "%s", msg);
ast_debug(1, "%s", msg);
}
}

View File

@ -2106,7 +2106,7 @@ static void *announce_thread(void *data)
}
for (res = 1; !conf->announcethread_stop && (current = AST_LIST_REMOVE_HEAD(&local_list, entry)); ao2_ref(current, -1)) {
ast_log(LOG_DEBUG, "About to play %s\n", current->namerecloc);
ast_debug(1, "About to play %s\n", current->namerecloc);
if (!ast_fileexists(current->namerecloc, NULL, NULL))
continue;
if ((current->confchan) && (current->confusers > 1) && !ast_check_hangup(current->confchan)) {

View File

@ -1646,7 +1646,7 @@ static const char* dtmf_tones[] = {
ast_playtones_start(myrpt->txchannel, 0, dtmf_tones[15], 0);
else {
/* not handled */
ast_log(LOG_DEBUG, "Unable to generate DTMF tone '%c' for '%s'\n", digit, myrpt->txchannel->name);
ast_debug(1, "Unable to generate DTMF tone '%c' for '%s'\n", digit, myrpt->txchannel->name);
}
rpt_mutex_lock(&myrpt->lock);
}
@ -12525,7 +12525,7 @@ struct ast_format_cap *cap = NULL;
f->data.ptr,f->datalen / 2);
if (n1 != l->wasvox)
{
if (debug)ast_log(LOG_DEBUG,"Link Node %s, vox %d\n",l->name,n1);
ast_debug(1,"Link Node %s, vox %d\n",l->name,n1);
l->wasvox = n1;
l->voxtostate = 0;
if (n1) l->voxtotimer = myrpt->p.voxtimeout_ms;
@ -12874,7 +12874,7 @@ struct ast_format_cap *cap = NULL;
n = dovox(&myrpt->vox,f->data.ptr,f->datalen / 2);
if (n != myrpt->wasvox)
{
if (debug) ast_log(LOG_DEBUG,"Node %s, vox %d\n",myrpt->name,n);
ast_debug(1,"Node %s, vox %d\n",myrpt->name,n);
myrpt->wasvox = n;
myrpt->voxtostate = 0;
if (n) myrpt->voxtotimer = myrpt->p.voxtimeout_ms;

View File

@ -1212,7 +1212,7 @@ static int check_password(struct ast_vm_user *vmu, char *password)
if (!ast_strlen_zero(ext_pass_check_cmd)) {
char cmd[255], buf[255];
ast_log(AST_LOG_DEBUG, "Verify password policies for %s\n", password);
ast_debug(1, "Verify password policies for %s\n", password);
snprintf(cmd, sizeof(cmd), "%s %s %s %s %s", ext_pass_check_cmd, vmu->mailbox, vmu->context, vmu->password, password);
if (vm_check_password_shell(cmd, buf, sizeof(buf))) {
@ -1754,8 +1754,7 @@ static void vm_imap_delete(char *file, int msgnum, struct ast_vm_user *vmu)
ast_log(LOG_WARNING, "msgnum %d, mailbox message %lu is zero.\n", msgnum, messageNum);
return;
}
if (option_debug > 2)
ast_log(LOG_DEBUG, "deleting msgnum %d, which is mailbox message %lu\n", msgnum, messageNum);
ast_debug(3, "deleting msgnum %d, which is mailbox message %lu\n", msgnum, messageNum);
/* delete message */
snprintf (arg, sizeof(arg), "%lu", messageNum);
ast_mutex_lock(&vms->lock);
@ -1888,8 +1887,7 @@ static int imap_retrieve_file(const char *dir, const int msgnum, const char *mai
goto exit;
}
if (option_debug > 2)
ast_log(LOG_DEBUG, "Before mail_fetchheaders, curmsg is: %d, imap messages is %lu\n", msgnum, vms->msgArray[msgnum]);
ast_debug(3, "Before mail_fetchheaders, curmsg is: %d, imap messages is %lu\n", msgnum, vms->msgArray[msgnum]);
if (vms->msgArray[msgnum] == 0) {
ast_log(LOG_WARNING, "Trying to access unknown message\n");
res = -1;
@ -2504,11 +2502,9 @@ static int init_mailstream(struct vm_state *vms, int box)
ast_log(LOG_ERROR, "vm_state is NULL!\n");
return -1;
}
if (option_debug > 2)
ast_log(LOG_DEBUG, "vm_state user is:%s\n", vms->imapuser);
ast_debug(3, "vm_state user is:%s\n", vms->imapuser);
if (vms->mailstream == NIL || !vms->mailstream) {
if (option_debug)
ast_log(LOG_DEBUG, "mailstream not set.\n");
ast_debug(1, "mailstream not set.\n");
} else {
stream = vms->mailstream;
}
@ -2541,8 +2537,7 @@ static int init_mailstream(struct vm_state *vms, int box)
}
/* Now connect to the target folder */
imap_mailbox_name(tmp, sizeof(tmp), vms, box, 1);
if (option_debug > 2)
ast_log(LOG_DEBUG, "Before mail_open, server: %s, box:%d\n", tmp, box);
ast_debug(3, "Before mail_open, server: %s, box:%d\n", tmp, box);
ast_mutex_lock(&vms->lock);
vms->mailstream = mail_open (stream, tmp, debug ? OP_DEBUG : NIL);
ast_mutex_unlock(&vms->lock);
@ -2927,8 +2922,7 @@ static struct vm_state *create_vm_state_from_user(struct ast_vm_user *vmu)
if ((vms_p = pthread_getspecific(ts_vmstate.key)) && !strcmp(vms_p->imapuser, vmu->imapuser) && !strcmp(vms_p->username, vmu->mailbox)) {
return vms_p;
}
if (option_debug > 4)
ast_log(AST_LOG_DEBUG, "Adding new vmstate for %s\n", vmu->imapuser);
ast_debug(5, "Adding new vmstate for %s\n", vmu->imapuser);
if (!(vms_p = ast_calloc(1, sizeof(*vms_p))))
return NULL;
ast_copy_string(vms_p->imapuser, vmu->imapuser, sizeof(vms_p->imapuser));
@ -2937,8 +2931,7 @@ static struct vm_state *create_vm_state_from_user(struct ast_vm_user *vmu)
ast_copy_string(vms_p->context, vmu->context, sizeof(vms_p->context));
vms_p->mailstream = NIL; /* save for access from interactive entry point */
vms_p->imapversion = vmu->imapversion;
if (option_debug > 4)
ast_log(AST_LOG_DEBUG, "Copied %s to %s\n", vmu->imapuser, vms_p->imapuser);
ast_debug(5, "Copied %s to %s\n", vmu->imapuser, vms_p->imapuser);
vms_p->updated = 1;
/* set mailbox to INBOX! */
ast_copy_string(vms_p->curbox, mbox(vmu, 0), sizeof(vms_p->curbox));
@ -4256,9 +4249,7 @@ static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu
strcat(fromfile, ".txt");
}
if (!(msg_cfg = ast_config_load(fromfile, config_flags))) {
if (option_debug > 0) {
ast_log(LOG_DEBUG, "Config load for message text file '%s' failed\n", fromfile);
}
ast_debug(1, "Config load for message text file '%s' failed\n", fromfile);
return;
}
@ -5669,8 +5660,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
}
/* If maxmsg is zero, act as a "greetings only" voicemail: Exit successfully without recording */
if (vmu->maxmsg == 0) {
if (option_debug > 2)
ast_log(LOG_DEBUG, "Greetings only VM (maxmsg=0), Skipping voicemail recording\n");
ast_debug(3, "Greetings only VM (maxmsg=0), Skipping voicemail recording\n");
pbx_builtin_setvar_helper(chan, "VMSTATUS", "SUCCESS");
goto leave_vm_out;
}
@ -7408,7 +7398,6 @@ static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms,
char *callerid, *name;
char prefile[PATH_MAX] = "";
/* If voicemail cid is not enabled, or we didn't get cid or context from
* the attribute file, leave now.
*
@ -11686,7 +11675,7 @@ static int load_config(int reload)
/* External password validation command */
if ((val = ast_variable_retrieve(cfg, "general", "externpasscheck"))) {
ast_copy_string(ext_pass_check_cmd, val, sizeof(ext_pass_check_cmd));
ast_log(AST_LOG_DEBUG, "found externpasscheck: %s\n", ext_pass_check_cmd);
ast_debug(1, "found externpasscheck: %s\n", ext_pass_check_cmd);
}
#ifdef IMAP_STORAGE

View File

@ -186,9 +186,7 @@ static void radius_log(const struct ast_event *event, void *userdata)
}
if (build_radius_record(&send, &record)) {
if (option_debug) {
ast_log(LOG_DEBUG, "Unable to create RADIUS record. CEL not recorded!\n");
}
ast_debug(1, "Unable to create RADIUS record. CEL not recorded!\n");
goto return_cleanup;
}

View File

@ -1734,7 +1734,7 @@ static int my_get_callerid(void *pvt, char *namebuf, char *numbuf, enum analog_e
if (num)
ast_copy_string(numbuf, num, ANALOG_MAX_CID);
ast_log(LOG_DEBUG, "CallerID number: %s, name: %s, flags=%d\n", num, name, flags);
ast_debug(1, "CallerID number: %s, name: %s, flags=%d\n", num, name, flags);
return 0;
}
}
@ -2236,7 +2236,7 @@ static void my_set_waitingfordt(void *pvt, struct ast_channel *ast)
struct dahdi_pvt *p = pvt;
if (p->waitfordialtone && CANPROGRESSDETECT(p) && p->dsp) {
ast_log(LOG_DEBUG, "Defer dialing for %dms or dialtone\n", p->waitfordialtone);
ast_debug(1, "Defer dialing for %dms or dialtone\n", p->waitfordialtone);
gettimeofday(&p->waitingfordt, NULL);
ast_setstate(ast, AST_STATE_OFFHOOK);
}
@ -2899,7 +2899,7 @@ static int my_dial_digits(void *pvt, enum analog_sub sub, struct analog_dialoper
res = ioctl(p->subs[index].dfd, DAHDI_DIAL, &ddop);
if (res == -1)
ast_log(LOG_DEBUG, "DAHDI_DIAL ioctl failed on %s: %s\n", p->owner->name, strerror(errno));
ast_debug(1, "DAHDI_DIAL ioctl failed on %s: %s\n", p->owner->name, strerror(errno));
return res;
}
@ -2924,7 +2924,7 @@ static int my_is_dialing(void *pvt, enum analog_sub sub)
index = analogsub_to_dahdisub(sub);
if (ioctl(p->subs[index].dfd, DAHDI_DIALING, &x)) {
ast_log(LOG_DEBUG, "DAHDI_DIALING ioctl failed!\n");
ast_debug(1, "DAHDI_DIALING ioctl failed!\n");
return -1;
}
@ -3829,13 +3829,13 @@ static void dahdi_r2_on_call_offered(openr2_chan_t *r2chan, const char *ani, con
p->mfcr2_recvd_category = category;
/* if we're not supposed to use CID, clear whatever we have */
if (!p->use_callerid) {
ast_log(LOG_DEBUG, "No CID allowed in configuration, CID is being cleared!\n");
ast_debug(1, "No CID allowed in configuration, CID is being cleared!\n");
p->cid_num[0] = 0;
p->cid_name[0] = 0;
}
/* if we're supposed to answer immediately, clear DNIS and set 's' exten */
if (p->immediate || !openr2_context_get_max_dnis(openr2_chan_get_context(r2chan))) {
ast_log(LOG_DEBUG, "Setting exten => s because of immediate or 0 DNIS configured\n");
ast_debug(1, "Setting exten => s because of immediate or 0 DNIS configured\n");
p->exten[0] = 's';
p->exten[1] = 0;
}
@ -3858,10 +3858,10 @@ static void dahdi_r2_on_call_offered(openr2_chan_t *r2chan, const char *ani, con
ast_log(LOG_WARNING, "Unable to create PBX channel in DAHDI channel %d\n", p->channel);
dahdi_r2_disconnect_call(p, OR2_CAUSE_OUT_OF_ORDER);
} else if (p->mfcr2_charge_calls) {
ast_log(LOG_DEBUG, "Accepting MFC/R2 call with charge on chan %d\n", p->channel);
ast_debug(1, "Accepting MFC/R2 call with charge on chan %d\n", p->channel);
openr2_chan_accept_call(r2chan, OR2_CALL_WITH_CHARGE);
} else {
ast_log(LOG_DEBUG, "Accepting MFC/R2 call with no charge on chan %d\n", p->channel);
ast_debug(1, "Accepting MFC/R2 call with no charge on chan %d\n", p->channel);
openr2_chan_accept_call(r2chan, OR2_CALL_NO_CHARGE);
}
}
@ -3893,7 +3893,7 @@ static void dahdi_r2_on_call_accepted(openr2_chan_t *r2chan, openr2_call_mode_t
if (!p->mfcr2_accept_on_offer) {
openr2_chan_disable_read(r2chan);
if (p->mfcr2_answer_pending) {
ast_log(LOG_DEBUG, "Answering MFC/R2 call after accepting it on chan %d\n", openr2_chan_get_number(r2chan));
ast_debug(1, "Answering MFC/R2 call after accepting it on chan %d\n", openr2_chan_get_number(r2chan));
dahdi_r2_answer(p);
}
return;
@ -3927,7 +3927,7 @@ static void dahdi_r2_on_call_answered(openr2_chan_t *r2chan)
static void dahdi_r2_on_call_read(openr2_chan_t *r2chan, const unsigned char *buf, int buflen)
{
/*ast_log(LOG_DEBUG, "Read data from dahdi channel %d\n", openr2_chan_get_number(r2chan));*/
/*ast_debug(1, "Read data from dahdi channel %d\n", openr2_chan_get_number(r2chan));*/
}
static int dahdi_r2_cause_to_ast_cause(openr2_call_disconnect_cause_t cause)
@ -4010,11 +4010,11 @@ static void dahdi_r2_write_log(openr2_log_level_t level, char *logmessage)
case OR2_LOG_CAS_TRACE:
case OR2_LOG_DEBUG:
case OR2_LOG_EX_DEBUG:
ast_log(LOG_DEBUG, "%s", logmessage);
ast_debug(1, "%s", logmessage);
break;
default:
ast_log(LOG_WARNING, "We should handle logging level %d here.\n", level);
ast_log(LOG_DEBUG, "%s", logmessage);
ast_debug(1, "%s", logmessage);
break;
}
}
@ -5819,23 +5819,23 @@ static int dahdi_send_callrerouting_facility_exec(struct ast_channel *chan, cons
);
if (ast_strlen_zero(data)) {
ast_log(LOG_DEBUG, "No data sent to application!\n");
ast_debug(1, "No data sent to application!\n");
return -1;
}
if (chan->tech != &dahdi_tech) {
ast_log(LOG_DEBUG, "Only DAHDI technology accepted!\n");
ast_debug(1, "Only DAHDI technology accepted!\n");
return -1;
}
pvt = (struct dahdi_pvt *) chan->tech_pvt;
if (!pvt) {
ast_log(LOG_DEBUG, "Unable to find technology private\n");
ast_debug(1, "Unable to find technology private\n");
return -1;
}
switch (pvt->sig) {
case SIG_PRI_LIB_HANDLE_CASES:
break;
default:
ast_log(LOG_DEBUG, "callrerouting attempted on non-ISDN channel %s\n",
ast_debug(1, "callrerouting attempted on non-ISDN channel %s\n",
chan->name);
return -1;
}
@ -5882,18 +5882,18 @@ static int dahdi_accept_r2_call_exec(struct ast_channel *chan, const char *data)
);
if (ast_strlen_zero(data)) {
ast_log(LOG_DEBUG, "No data sent to application!\n");
ast_debug(1, "No data sent to application!\n");
return -1;
}
if (chan->tech != &dahdi_tech) {
ast_log(LOG_DEBUG, "Only DAHDI technology accepted!\n");
ast_debug(1, "Only DAHDI technology accepted!\n");
return -1;
}
p = (struct dahdi_pvt *)chan->tech_pvt;
if (!p) {
ast_log(LOG_DEBUG, "Unable to find technology private!\n");
ast_debug(1, "Unable to find technology private!\n");
return -1;
}
@ -5908,13 +5908,13 @@ static int dahdi_accept_r2_call_exec(struct ast_channel *chan, const char *data)
ast_mutex_lock(&p->lock);
if (!p->mfcr2 || !p->mfcr2call) {
ast_mutex_unlock(&p->lock);
ast_log(LOG_DEBUG, "Channel %s does not seems to be an R2 active channel!\n", chan->name);
ast_debug(1, "Channel %s does not seems to be an R2 active channel!\n", chan->name);
return -1;
}
if (p->mfcr2_call_accepted) {
ast_mutex_unlock(&p->lock);
ast_log(LOG_DEBUG, "MFC/R2 call already accepted on channel %s!\n", chan->name);
ast_debug(1, "MFC/R2 call already accepted on channel %s!\n", chan->name);
return 0;
}
accept_mode = ast_true(args.charge) ? OR2_CALL_WITH_CHARGE : OR2_CALL_NO_CHARGE;
@ -5936,7 +5936,7 @@ static int dahdi_accept_r2_call_exec(struct ast_channel *chan, const char *data)
}
res = ast_waitfor(chan, timeout);
if (res < 0) {
ast_log(LOG_DEBUG, "ast_waitfor failed on channel %s, going out ...\n", chan->name);
ast_debug(1, "ast_waitfor failed on channel %s, going out ...\n", chan->name);
res = -1;
break;
}
@ -5945,12 +5945,12 @@ static int dahdi_accept_r2_call_exec(struct ast_channel *chan, const char *data)
}
f = ast_read(chan);
if (!f) {
ast_log(LOG_DEBUG, "No frame read on channel %s, going out ...\n", chan->name);
ast_debug(1, "No frame read on channel %s, going out ...\n", chan->name);
res = -1;
break;
}
if (f->frametype == AST_FRAME_CONTROL && f->subclass.integer == AST_CONTROL_HANGUP) {
ast_log(LOG_DEBUG, "Got HANGUP frame on channel %s, going out ...\n", chan->name);
ast_debug(1, "Got HANGUP frame on channel %s, going out ...\n", chan->name);
ast_frfree(f);
res = -1;
break;
@ -5959,7 +5959,7 @@ static int dahdi_accept_r2_call_exec(struct ast_channel *chan, const char *data)
ast_mutex_lock(&p->lock);
if (p->mfcr2_call_accepted) {
ast_mutex_unlock(&p->lock);
ast_log(LOG_DEBUG, "Accepted MFC/R2 call!\n");
ast_debug(1, "Accepted MFC/R2 call!\n");
break;
}
ast_mutex_unlock(&p->lock);
@ -6003,7 +6003,7 @@ static openr2_call_disconnect_cause_t dahdi_ast_cause_to_r2_cause(int cause)
r2cause = OR2_CAUSE_NORMAL_CLEARING;
break;
}
ast_log(LOG_DEBUG, "ast cause %d resulted in openr2 cause %d/%s\n",
ast_debug(1, "ast cause %d resulted in openr2 cause %d/%s\n",
cause, r2cause, openr2_proto_get_disconnect_string(r2cause));
return r2cause;
}
@ -6305,7 +6305,7 @@ static int dahdi_hangup(struct ast_channel *ast)
/* Perform low level hangup if no owner left */
#ifdef HAVE_OPENR2
if (p->mfcr2 && p->mfcr2call && openr2_chan_get_direction(p->r2chan) != OR2_DIR_STOPPED) {
ast_log(LOG_DEBUG, "disconnecting MFC/R2 call on chan %d\n", p->channel);
ast_debug(1, "disconnecting MFC/R2 call on chan %d\n", p->channel);
/* If it's an incoming call, check the mfcr2_forced_release setting */
if (openr2_chan_get_direction(p->r2chan) == OR2_DIR_BACKWARD && p->mfcr2_forced_release) {
dahdi_r2_disconnect_call(p, OR2_CAUSE_FORCED_RELEASE);
@ -6317,7 +6317,7 @@ static int dahdi_hangup(struct ast_channel *ast)
dahdi_r2_disconnect_call(p, r2cause);
}
} else if (p->mfcr2call) {
ast_log(LOG_DEBUG, "Clearing call request on channel %d\n", p->channel);
ast_debug(1, "Clearing call request on channel %d\n", p->channel);
/* since ast_request() was called but not ast_call() we have not yet dialed
and the openr2 stack will not call on_call_end callback, we need to unset
the mfcr2call flag and bump the monitor count so the monitor thread can take
@ -6464,14 +6464,14 @@ static int dahdi_answer(struct ast_channel *ast)
openr2_chan_answer_call will be called when the callback on_call_accepted is executed */
p->mfcr2_answer_pending = 1;
if (p->mfcr2_charge_calls) {
ast_log(LOG_DEBUG, "Accepting MFC/R2 call with charge before answering on chan %d\n", p->channel);
ast_debug(1, "Accepting MFC/R2 call with charge before answering on chan %d\n", p->channel);
openr2_chan_accept_call(p->r2chan, OR2_CALL_WITH_CHARGE);
} else {
ast_log(LOG_DEBUG, "Accepting MFC/R2 call with no charge before answering on chan %d\n", p->channel);
ast_debug(1, "Accepting MFC/R2 call with no charge before answering on chan %d\n", p->channel);
openr2_chan_accept_call(p->r2chan, OR2_CALL_NO_CHARGE);
}
} else {
ast_log(LOG_DEBUG, "Answering MFC/R2 call on chan %d\n", p->channel);
ast_debug(1, "Answering MFC/R2 call on chan %d\n", p->channel);
dahdi_r2_answer(p);
}
break;
@ -7771,7 +7771,7 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast)
if (p->sig != SIG_MFCR2) {
ast_log(LOG_WARNING, "Received bits changed on %s signalling?\n", sig2str(p->sig));
} else {
ast_log(LOG_DEBUG, "bits changed in chan %d\n", p->channel);
ast_debug(1, "bits changed in chan %d\n", p->channel);
openr2_chan_handle_cas(p->r2chan);
}
#else
@ -7793,7 +7793,7 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast)
if (p->inalarm) break;
if ((p->radio || (p->oprmode < 0))) break;
if (ioctl(p->subs[idx].dfd,DAHDI_DIALING,&x) == -1) {
ast_log(LOG_DEBUG, "DAHDI_DIALING ioctl failed on %s: %s\n",ast->name, strerror(errno));
ast_debug(1, "DAHDI_DIALING ioctl failed on %s: %s\n",ast->name, strerror(errno));
return NULL;
}
if (!x) { /* if not still dialing in driver */
@ -8744,7 +8744,7 @@ static struct ast_frame *dahdi_read(struct ast_channel *ast)
if (p->mfcr2_call_accepted &&
!p->mfcr2_progress_sent &&
ast->_state == AST_STATE_RINGING) {
ast_log(LOG_DEBUG, "Enqueuing progress frame after R2 accept in chan %d\n", p->channel);
ast_debug(1, "Enqueuing progress frame after R2 accept in chan %d\n", p->channel);
ast_queue_frame(p->owner, &fr);
p->mfcr2_progress_sent = 1;
}
@ -9009,7 +9009,7 @@ static struct ast_frame *dahdi_read(struct ast_channel *ast)
p->waitingfordt.tv_sec = 0;
p->dsp_features &= ~DSP_FEATURE_WAITDIALTONE;
ast_dsp_set_features(p->dsp, p->dsp_features);
ast_log(LOG_DEBUG, "Got 10 samples of dialtone!\n");
ast_debug(1, "Got 10 samples of dialtone!\n");
if (!ast_strlen_zero(p->dop.dialstr)) { /* Dial deferred digits */
res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_DIAL, &p->dop);
if (res < 0) {
@ -9018,7 +9018,7 @@ static struct ast_frame *dahdi_read(struct ast_channel *ast)
ast_mutex_unlock(&p->lock);
return NULL;
} else {
ast_log(LOG_DEBUG, "Sent deferred digit string: %s\n", p->dop.dialstr);
ast_debug(1, "Sent deferred digit string: %s\n", p->dop.dialstr);
p->dialing = 1;
p->dop.dialstr[0] = '\0';
p->dop.op = DAHDI_DIAL_OP_REPLACE;
@ -10462,7 +10462,7 @@ static void *analog_ss_thread(void *data)
f = ast_read(chan);
if (f->frametype == AST_FRAME_DTMF) {
dtmfbuf[k++] = f->subclass.integer;
ast_log(LOG_DEBUG, "CID got digit '%c'\n", f->subclass.integer);
ast_debug(1, "CID got digit '%c'\n", f->subclass.integer);
res = 2000;
}
ast_frfree(f);
@ -10474,7 +10474,7 @@ static void *analog_ss_thread(void *data)
dahdi_setlinear(p->subs[idx].dfd, p->subs[idx].linear);
/* Got cid and ring. */
callerid_get_dtmf(dtmfbuf, dtmfcid, &flags);
ast_log(LOG_DEBUG, "CID is '%s', flags %d\n",
ast_debug(1, "CID is '%s', flags %d\n",
dtmfcid, flags);
/* If first byte is NULL, we have no cid */
if (!ast_strlen_zero(dtmfcid))
@ -10522,7 +10522,7 @@ static void *analog_ss_thread(void *data)
}
/* If we get a PR event, they hung up while processing calerid */
if ( res == DAHDI_EVENT_POLARITY && p->hanguponpolarityswitch && p->polarity == POLARITY_REV) {
ast_log(LOG_DEBUG, "Hanging up due to polarity reversal on channel %d while detecting callerid\n", p->channel);
ast_debug(1, "Hanging up due to polarity reversal on channel %d while detecting callerid\n", p->channel);
p->polarity = POLARITY_IDLE;
callerid_free(cs);
ast_hangup(chan);
@ -11537,7 +11537,7 @@ static void *do_monitor(void *data)
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
ast_log(LOG_DEBUG, "Maybe some MWI on port %d!\n", i->channel);
ast_debug(1, "Maybe some MWI on port %d!\n", i->channel);
if ((mtd = ast_calloc(1, sizeof(*mtd)))) {
mtd->pvt = i;
memcpy(mtd->buf, buf, res);
@ -11844,7 +11844,7 @@ static struct dahdi_mfcr2 *dahdi_r2_get_link(void)
new_r2link->r2master = AST_PTHREADT_NULL;
r2links[r2links_count] = new_r2link;
r2links_count++;
ast_log(LOG_DEBUG, "Created new R2 link!\n");
ast_debug(1, "Created new R2 link!\n");
}
return r2links[r2links_count - 1];
}
@ -11942,7 +11942,7 @@ static int device2chan(const char *subdir, int channel, char *path, int pathlen)
return -EINVAL;
}
num = minor(stbuf.st_rdev);
ast_log(LOG_DEBUG, "%s -> %d\n", path, num);
ast_debug(1, "%s -> %d\n", path, num);
return num;
}
@ -13339,7 +13339,7 @@ static struct ast_channel *dahdi_request(const char *type, struct ast_format_cap
ast_mutex_lock(&p->lock);
if (p->mfcr2call) {
ast_mutex_unlock(&p->lock);
ast_log(LOG_DEBUG, "Yay!, someone just beat us in the race for channel %d.\n", p->channel);
ast_debug(1, "Yay!, someone just beat us in the race for channel %d.\n", p->channel);
goto next;
}
p->mfcr2call = 1;
@ -13676,7 +13676,7 @@ static void *mfcr2_monitor(void *data)
continue;
}
if (!mfcr2->pvts[i]->r2chan) {
ast_log(LOG_DEBUG, "Wow, no r2chan on channel %d\n", mfcr2->pvts[i]->channel);
ast_debug(1, "Wow, no r2chan on channel %d\n", mfcr2->pvts[i]->channel);
quit_loop = 1;
break;
}
@ -13690,7 +13690,7 @@ static void *mfcr2_monitor(void *data)
}
if (pollsize == 0) {
if (!was_idle) {
ast_log(LOG_DEBUG, "Monitor thread going idle since everybody has an owner\n");
ast_debug(1, "Monitor thread going idle since everybody has an owner\n");
was_idle = 1;
}
poll(NULL, 0, maxsleep);
@ -16497,7 +16497,7 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct
return -1;
}
}
ast_log(LOG_DEBUG, "Channel '%s' configured.\n", v->value);
ast_debug(1, "Channel '%s' configured.\n", v->value);
} else if (!strcasecmp(v->name, "ignore_failed_channels")) {
confp->ignore_failed_channels = ast_true(v->value);
} else if (!strcasecmp(v->name, "buffers")) {

View File

@ -498,7 +498,7 @@ static int gtalk_ringing_ack(void *data, ikspak *pak)
(redirect = iks_find_cdata(traversenodes, "redirect")) &&
(redirect = strstr(redirect, "xmpp:"))) {
redirect += 5;
ast_log(LOG_DEBUG, "redirect %s\n", redirect);
ast_debug(1, "redirect %s\n", redirect);
ast_copy_string(p->them, redirect, sizeof(p->them));
gtalk_invite(p, p->them, p->us, p->sid, 1);
@ -626,7 +626,7 @@ static int gtalk_is_answered(struct gtalk *client, ikspak *pak)
char s1[BUFSIZ], s2[BUFSIZ], s3[BUFSIZ];
int peernoncodeccapability;
ast_log(LOG_DEBUG, "The client is %s\n", client->name);
ast_debug(1, "The client is %s\n", client->name);
/* Make sure our new call does exist */
for (tmp = client->p; tmp; tmp = tmp->next) {
@ -701,7 +701,7 @@ static int gtalk_is_accepted(struct gtalk *client, ikspak *pak)
struct gtalk_pvt *tmp;
char *from;
ast_log(LOG_DEBUG, "The client is %s\n", client->name);
ast_debug(1, "The client is %s\n", client->name);
/* find corresponding call */
for (tmp = client->p; tmp; tmp = tmp->next) {
if (iks_find_with_attrib(pak->x, "session", "id", tmp->sid)) {

View File

@ -1890,9 +1890,7 @@ static int scheduled_destroy(const void *vid)
unsigned short callno = PTR_TO_CALLNO(vid);
ast_mutex_lock(&iaxsl[callno]);
if (iaxs[callno]) {
if (option_debug) {
ast_log(LOG_DEBUG, "Really destroying %d now...\n", callno);
}
ast_debug(1, "Really destroying %d now...\n", callno);
iax2_destroy(callno);
}
ast_mutex_unlock(&iaxsl[callno]);
@ -7838,9 +7836,6 @@ static int raw_hangup(struct sockaddr_in *sin, unsigned short src, unsigned shor
fh.type = AST_FRAME_IAX;
fh.csub = compress_subclass(IAX_COMMAND_INVAL);
iax_outputframe(NULL, &fh, 0, sin, 0);
#if 0
if (option_debug)
#endif
ast_debug(1, "Raw Hangup %s:%d, src=%d, dst=%d\n",
ast_inet_ntoa(sin->sin_addr), ntohs(sin->sin_port), src, dst);
return sendto(sockfd, &fh, sizeof(fh), 0, (struct sockaddr *)sin, sizeof(*sin));
@ -9261,7 +9256,6 @@ static int timing_read(int *id, int fd, short events, void *cbdata)
ast_mutex_unlock(&drop->lock);
ast_mutex_destroy(&drop->lock);
ast_free(drop);
}
if (iaxtrunkdebug)

View File

@ -11988,7 +11988,7 @@ static int misdn_command_exec(struct ast_channel *chan, const char *data)
return -1;
}
ast_log(LOG_DEBUG, "%s(%s)\n", misdn_command_name, (char *) data);
ast_debug(1, "%s(%s)\n", misdn_command_name, (char *) data);
parse = ast_strdupa(data);
AST_STANDARD_APP_ARGS(subcommand, parse);

View File

@ -4349,7 +4349,6 @@ static void sip_destroy_peer(struct sip_peer *peer)
peer->call = dialog_unref(peer->call, "peer->call is being unset");
}
if (peer->mwipvt) { /* We have an active subscription, delete it */
dialog_unlink_all(peer->mwipvt, TRUE, TRUE);
peer->mwipvt = dialog_unref(peer->mwipvt, "unreffing peer->mwipvt");
@ -20476,7 +20475,6 @@ static void *sip_park_thread(void *stuff)
res = ast_park_call(transferee, transferer, 0, d->parkexten, &ext);
#ifdef WHEN_WE_KNOW_THAT_THE_CLIENT_SUPPORTS_MESSAGE
if (!res) {
transmit_message_with_text(transferer->tech_pvt, "Unable to park call.\n");
@ -23695,7 +23693,7 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
while (!found_supported && !ast_strlen_zero(acceptheader)) {
found_supported = strcmp(acceptheader, "application/simple-message-summary") ? 0 : 1;
if (!found_supported && (option_debug > 2)) {
ast_log(LOG_DEBUG, "Received SIP mailbox subscription for unknown format: %s\n", acceptheader);
ast_debug(1, "Received SIP mailbox subscription for unknown format: %s\n", acceptheader);
}
acceptheader = __get_header(req, "Accept", &start);
}
@ -24007,7 +24005,6 @@ static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct as
/* New SIP request coming in
(could be new request in existing SIP dialog as well...)
*/
p->method = req->method; /* Find out which SIP method they are using */
ast_debug(4, "**** Received %s (%d) - Command in SIP %s\n", sip_methods[p->method].text, sip_methods[p->method].id, cmd);

View File

@ -4508,8 +4508,7 @@ static int skinny_transfer(struct skinny_subchannel *sub)
}
return 0;
} else {
if (option_debug)
ast_log(LOG_DEBUG, "Neither %s nor %s are in a bridge, nothing to transfer\n",
ast_debug(1, "Neither %s nor %s are in a bridge, nothing to transfer\n",
xferor->owner->name, xferee->owner->name);
}
}

View File

@ -913,7 +913,7 @@ struct ast_channel *sig_pri_request(struct sig_pri_chan *p, enum sig_pri_law law
{
struct ast_channel *ast;
ast_log(LOG_DEBUG, "%s %d\n", __FUNCTION__, p->channel);
ast_debug(1, "%s %d\n", __FUNCTION__, p->channel);
p->outgoing = 1;
ast = sig_pri_new_ast_channel(p, AST_STATE_RESERVED, law, transfercapability, p->exten, requestor);
@ -1594,7 +1594,7 @@ static void *pri_ss_thread(void *data)
timeout = pri_gendigittimeout;
res = ast_waitfordigit(chan, timeout);
if (res < 0) {
ast_log(LOG_DEBUG, "waitfordigit returned < 0...\n");
ast_debug(1, "waitfordigit returned < 0...\n");
ast_hangup(chan);
return NULL;
} else if (res) {
@ -1666,7 +1666,7 @@ static void *pri_ss_thread(void *data)
ast_log(LOG_WARNING, "PBX exited non-zero!\n");
}
} else {
ast_log(LOG_DEBUG, "No such possible extension '%s' in context '%s'\n", exten, chan->context);
ast_debug(1, "No such possible extension '%s' in context '%s'\n", exten, chan->context);
chan->hangupcause = AST_CAUSE_UNALLOCATED;
ast_hangup(chan);
p->exten[0] = '\0';
@ -3471,7 +3471,7 @@ static void sig_pri_send_aoce_termination_request(struct sig_pri_span *pri, int
pvt->waiting_for_aoce = 1;
ast_channel_setwhentohangup_tv(pvt->owner, whentohangup);
ast_log(LOG_DEBUG, "Delaying hangup on %s for aoc-e msg\n", pvt->owner->name);
ast_debug(1, "Delaying hangup on %s for aoc-e msg\n", pvt->owner->name);
cleanup_termination_request:
ast_channel_unlock(pvt->owner);
@ -6776,7 +6776,7 @@ int sig_pri_hangup(struct sig_pri_chan *p, struct ast_channel *ast)
const char *useruser = pbx_builtin_getvar_helper(ast, "USERUSERINFO");
#endif
ast_log(LOG_DEBUG, "%s %d\n", __FUNCTION__, p->channel);
ast_debug(1, "%s %d\n", __FUNCTION__, p->channel);
if (!ast->tech_pvt) {
ast_log(LOG_WARNING, "Asked to hangup channel not connected\n");
return 0;
@ -6805,7 +6805,7 @@ int sig_pri_hangup(struct sig_pri_chan *p, struct ast_channel *ast)
sig_pri_moh_fsm_event(ast, p, SIG_PRI_MOH_EVENT_RESET);
if (p->call) {
if (p->alreadyhungup) {
ast_log(LOG_DEBUG, "Already hungup... Calling hangup once, and clearing call\n");
ast_debug(1, "Already hungup... Calling hangup once, and clearing call\n");
#ifdef SUPPORT_USERUSER
pri_call_set_useruser(p->call, useruser);
@ -6821,7 +6821,7 @@ int sig_pri_hangup(struct sig_pri_chan *p, struct ast_channel *ast)
} else {
const char *cause = pbx_builtin_getvar_helper(ast,"PRI_CAUSE");
int icause = ast->hangupcause ? ast->hangupcause : -1;
ast_log(LOG_DEBUG, "Not yet hungup... Calling hangup once with icause, and clearing call\n");
ast_debug(1, "Not yet hungup... Calling hangup once with icause, and clearing call\n");
#ifdef SUPPORT_USERUSER
pri_call_set_useruser(p->call, useruser);
@ -6976,7 +6976,7 @@ int sig_pri_call(struct sig_pri_chan *p, struct ast_channel *ast, char *rdest, i
struct ast_flags opts;
char *opt_args[OPT_ARG_ARRAY_SIZE];
ast_log(LOG_DEBUG, "CALLER NAME: %s NUM: %s\n",
ast_debug(1, "CALLER NAME: %s NUM: %s\n",
S_COR(ast->connected.id.name.valid, ast->connected.id.name.str, ""),
S_COR(ast->connected.id.number.valid, ast->connected.id.number.str, ""));
@ -7640,7 +7640,7 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi
* and initiate the softhangup since the delay is no longer necessary */
if (p->waiting_for_aoce) {
p->waiting_for_aoce = 0;
ast_log(LOG_DEBUG,
ast_debug(1,
"Received final AOC-E msg, continue with hangup on %s\n",
chan->name);
ast_softhangup_nolock(chan, AST_SOFTHANGUP_DEV);
@ -8349,7 +8349,7 @@ int pri_send_callrerouting_facility_exec(struct sig_pri_chan *p, enum ast_channe
sig_pri_lock_private(p);
if (!p->pri || !p->call) {
ast_log(LOG_DEBUG, "Unable to find pri or call on channel!\n");
ast_debug(1, "Unable to find pri or call on channel!\n");
sig_pri_unlock_private(p);
return -1;
}
@ -8358,7 +8358,7 @@ int pri_send_callrerouting_facility_exec(struct sig_pri_chan *p, enum ast_channe
res = pri_callrerouting_facility(p->pri->pri, p->call, destination, original, reason);
pri_rel(p->pri);
} else {
ast_log(LOG_DEBUG, "Unable to grab pri to send callrerouting facility on span %d!\n", p->pri->span);
ast_debug(1, "Unable to grab pri to send callrerouting facility on span %d!\n", p->pri->span);
}
sig_pri_unlock_private(p);

View File

@ -89,7 +89,7 @@ static int ilbctolin_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
float tmpf[ILBC_SAMPLES];
if (!f->data.ptr && f->datalen) {
ast_log(LOG_DEBUG, "issue 16070, ILIB ERROR. data = NULL datalen = %d src = %s\n", f->datalen, f->src ? f->src : "no src set");
ast_debug(1, "issue 16070, ILIB ERROR. data = NULL datalen = %d src = %s\n", f->datalen, f->src ? f->src : "no src set");
f->datalen = 0;
}

View File

@ -2389,8 +2389,7 @@ static inline enum ast_t38_state ast_channel_get_t38_state(struct ast_channel *c
#define CHECK_BLOCKING(c) do { \
if (ast_test_flag(c, AST_FLAG_BLOCKING)) {\
if (option_debug) \
ast_log(LOG_DEBUG, "Thread %ld Blocking '%s', already blocked by thread %ld in procedure %s\n", (long) pthread_self(), (c)->name, (long) (c)->blocker, (c)->blockproc); \
ast_debug(1, "Thread %ld Blocking '%s', already blocked by thread %ld in procedure %s\n", (long) pthread_self(), (c)->name, (long) (c)->blocker, (c)->blockproc); \
} else { \
(c)->blocker = pthread_self(); \
(c)->blockproc = __PRETTY_FUNCTION__; \

View File

@ -49,8 +49,8 @@ extern "C" {
int _sched_res = -1; \
while (id > -1 && (_sched_res = ast_sched_del(sched, id)) && ++_count < 10) \
usleep(1); \
if (_count == 10 && option_debug > 2) { \
ast_log(LOG_DEBUG, "Unable to cancel schedule ID %d.\n", id); \
if (_count == 10) { \
ast_debug(3, "Unable to cancel schedule ID %d.\n", id); \
} \
id = -1; \
(_sched_res); \
@ -87,8 +87,8 @@ extern "C" {
usleep(1); \
ast_mutex_lock(lock); \
} \
if (_count == 10 && option_debug > 2) { \
ast_log(LOG_DEBUG, "Unable to cancel schedule ID %d.\n", id); \
if (_count == 10) { \
ast_debug(3, "Unable to cancel schedule ID %d.\n", id); \
} \
id = -1; \
(_sched_res); \

View File

@ -1481,9 +1481,9 @@ static int ast_unlock_path_flock(const char *path)
snprintf(s, strlen(path) + 19, "%s/lock", path);
unlink(s);
path_lock_destroy(p);
ast_log(LOG_DEBUG, "Unlocked path '%s'\n", path);
ast_debug(1, "Unlocked path '%s'\n", path);
} else {
ast_log(LOG_DEBUG, "Failed to unlock path '%s': "
ast_debug(1, "Failed to unlock path '%s': "
"lock not found\n", path);
}

View File

@ -138,16 +138,13 @@ int ast_audiohook_write_frame(struct ast_audiohook *audiohook, enum ast_audiohoo
other_factory_ms = other_factory_samples / 8;
if (ast_test_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC) && other_factory_samples && (our_factory_ms - other_factory_ms > AST_AUDIOHOOK_SYNC_TOLERANCE)) {
if (option_debug)
ast_log(LOG_DEBUG, "Flushing audiohook %p so it remains in sync\n", audiohook);
ast_debug(1, "Flushing audiohook %p so it remains in sync\n", audiohook);
ast_slinfactory_flush(factory);
ast_slinfactory_flush(other_factory);
}
if (ast_test_flag(audiohook, AST_AUDIOHOOK_SMALL_QUEUE) && (our_factory_samples > 640 || other_factory_samples > 640)) {
if (option_debug) {
ast_log(LOG_DEBUG, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook);
}
ast_debug(1, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook);
ast_slinfactory_flush(factory);
ast_slinfactory_flush(other_factory);
}
@ -256,8 +253,8 @@ static struct ast_frame *audiohook_read_frame_both(struct ast_audiohook *audioho
}
}
}
} else if (option_debug)
ast_log(LOG_DEBUG, "Failed to get %d samples from read factory %p\n", (int)samples, &audiohook->read_factory);
}
ast_debug(1, "Failed to get %d samples from read factory %p\n", (int)samples, &audiohook->read_factory);
/* Move on to the write factory... if there are enough samples, read them in */
if (usable_write) {
@ -275,8 +272,8 @@ static struct ast_frame *audiohook_read_frame_both(struct ast_audiohook *audioho
}
}
}
} else if (option_debug)
ast_log(LOG_DEBUG, "Failed to get %d samples from write factory %p\n", (int)samples, &audiohook->write_factory);
}
ast_debug(1, "Failed to get %d samples from write factory %p\n", (int)samples, &audiohook->write_factory);
/* Basically we figure out which buffer to use... and if mixing can be done here */
if (!read_buf && !write_buf)
@ -818,7 +815,7 @@ int ast_channel_audiohook_count_by_source(struct ast_channel *chan, const char *
AST_LIST_TRAVERSE_SAFE_END;
break;
default:
ast_log(LOG_DEBUG, "Invalid audiohook type supplied, (%d)\n", type);
ast_debug(1, "Invalid audiohook type supplied, (%d)\n", type);
return -1;
}
@ -856,7 +853,7 @@ int ast_channel_audiohook_count_by_source_running(struct ast_channel *chan, cons
AST_LIST_TRAVERSE_SAFE_END;
break;
default:
ast_log(LOG_DEBUG, "Invalid audiohook type supplied, (%d)\n", type);
ast_debug(1, "Invalid audiohook type supplied, (%d)\n", type);
return -1;
}
return count;

View File

@ -679,9 +679,9 @@ static int ast_channel_trace_data_update(struct ast_channel *chan, struct ast_ch
(AST_LIST_EMPTY(&traced->trace))) {
/* Just do some debug logging */
if (AST_LIST_EMPTY(&traced->trace))
ast_log(LOG_DEBUG, "Setting initial trace context to %s\n", chan->context);
ast_debug(1, "Setting initial trace context to %s\n", chan->context);
else
ast_log(LOG_DEBUG, "Changing trace context from %s to %s\n", AST_LIST_FIRST(&traced->trace)->context, chan->context);
ast_debug(1, "Changing trace context from %s to %s\n", AST_LIST_FIRST(&traced->trace)->context, chan->context);
/* alloc or bail out */
trace = ast_malloc(sizeof(*trace));
if (!trace)
@ -6222,32 +6222,32 @@ static void ast_set_owners_and_peers(struct ast_channel *chan1,
struct ast_channel *chan2)
{
if (!ast_strlen_zero(chan1->accountcode) && ast_strlen_zero(chan2->peeraccount)) {
ast_log(LOG_DEBUG, "setting peeraccount to %s for %s from data on channel %s\n",
ast_debug(1, "setting peeraccount to %s for %s from data on channel %s\n",
chan1->accountcode, chan2->name, chan1->name);
ast_string_field_set(chan2, peeraccount, chan1->accountcode);
}
if (!ast_strlen_zero(chan2->accountcode) && ast_strlen_zero(chan1->peeraccount)) {
ast_log(LOG_DEBUG, "setting peeraccount to %s for %s from data on channel %s\n",
ast_debug(1, "setting peeraccount to %s for %s from data on channel %s\n",
chan2->accountcode, chan1->name, chan2->name);
ast_string_field_set(chan1, peeraccount, chan2->accountcode);
}
if (!ast_strlen_zero(chan1->peeraccount) && ast_strlen_zero(chan2->accountcode)) {
ast_log(LOG_DEBUG, "setting accountcode to %s for %s from data on channel %s\n",
ast_debug(1, "setting accountcode to %s for %s from data on channel %s\n",
chan1->peeraccount, chan2->name, chan1->name);
ast_string_field_set(chan2, accountcode, chan1->peeraccount);
}
if (!ast_strlen_zero(chan2->peeraccount) && ast_strlen_zero(chan1->accountcode)) {
ast_log(LOG_DEBUG, "setting accountcode to %s for %s from data on channel %s\n",
ast_debug(1, "setting accountcode to %s for %s from data on channel %s\n",
chan2->peeraccount, chan1->name, chan2->name);
ast_string_field_set(chan1, accountcode, chan2->peeraccount);
}
if (0 != strcmp(chan1->accountcode, chan2->peeraccount)) {
ast_log(LOG_DEBUG, "changing peeraccount from %s to %s on %s to match channel %s\n",
ast_debug(1, "changing peeraccount from %s to %s on %s to match channel %s\n",
chan2->peeraccount, chan1->peeraccount, chan2->name, chan1->name);
ast_string_field_set(chan2, peeraccount, chan1->accountcode);
}
if (0 != strcmp(chan2->accountcode, chan1->peeraccount)) {
ast_log(LOG_DEBUG, "changing peeraccount from %s to %s on %s to match channel %s\n",
ast_debug(1, "changing peeraccount from %s to %s on %s to match channel %s\n",
chan1->peeraccount, chan2->peeraccount, chan1->name, chan2->name);
ast_string_field_set(chan1, peeraccount, chan2->accountcode);
}
@ -8686,7 +8686,7 @@ int ast_connected_line_parse_data(const unsigned char *data, size_t datalen, str
break;
/* Connected line party unknown element */
default:
ast_log(LOG_DEBUG, "Unknown connected line element: %u (%u)\n",
ast_debug(1, "Unknown connected line element: %u (%u)\n",
(unsigned) ie_id, (unsigned) ie_len);
break;
}
@ -8714,7 +8714,7 @@ int ast_connected_line_parse_data(const unsigned char *data, size_t datalen, str
* The other end is newer than we are.
* We need to assume that they are compatible with us.
*/
ast_log(LOG_DEBUG, "Connected line frame has newer version: %u\n",
ast_debug(1, "Connected line frame has newer version: %u\n",
(unsigned) frame_version);
break;
}
@ -9185,7 +9185,7 @@ int ast_redirecting_parse_data(const unsigned char *data, size_t datalen, struct
break;
/* Redirecting unknown element */
default:
ast_log(LOG_DEBUG, "Unknown redirecting element: %u (%u)\n",
ast_debug(1, "Unknown redirecting element: %u (%u)\n",
(unsigned) ie_id, (unsigned) ie_len);
break;
}
@ -9221,7 +9221,7 @@ int ast_redirecting_parse_data(const unsigned char *data, size_t datalen, struct
* The other end is newer than we are.
* We need to assume that they are compatible with us.
*/
ast_log(LOG_DEBUG, "Redirecting frame has newer version: %u\n",
ast_debug(1, "Redirecting frame has newer version: %u\n",
(unsigned) frame_version);
break;
}

View File

@ -1923,12 +1923,12 @@ static int builtin_blindtransfer(struct ast_channel *chan, struct ast_channel *p
}
if (transferer->cdr) {
struct ast_cdr *swap = transferer->cdr;
ast_log(LOG_DEBUG,"transferer=%s; transferee=%s; lastapp=%s; lastdata=%s; chan=%s; dstchan=%s\n",
ast_debug(1, "transferer=%s; transferee=%s; lastapp=%s; lastdata=%s; chan=%s; dstchan=%s\n",
transferer->name, transferee->name, transferer->cdr->lastapp, transferer->cdr->lastdata,
transferer->cdr->channel, transferer->cdr->dstchannel);
ast_log(LOG_DEBUG,"TRANSFEREE; lastapp=%s; lastdata=%s, chan=%s; dstchan=%s\n",
ast_debug(1, "TRANSFEREE; lastapp=%s; lastdata=%s, chan=%s; dstchan=%s\n",
transferee->cdr->lastapp, transferee->cdr->lastdata, transferee->cdr->channel, transferee->cdr->dstchannel);
ast_log(LOG_DEBUG,"transferer_real_context=%s; xferto=%s\n", transferer_real_context, xferto);
ast_debug(1, "transferer_real_context=%s; xferto=%s\n", transferer_real_context, xferto);
/* swap cdrs-- it will save us some time & work */
transferer->cdr = transferee->cdr;
transferee->cdr = swap;
@ -1942,7 +1942,7 @@ static int builtin_blindtransfer(struct ast_channel *chan, struct ast_channel *p
} else {
/* Set the channel's new extension, since it exists, using transferer context */
ast_set_flag(transferee, AST_FLAG_BRIDGE_HANGUP_DONT); /* don't let the after-bridge code run the h-exten */
ast_log(LOG_DEBUG,"ABOUT TO AST_ASYNC_GOTO, have a pbx... set HANGUP_DONT on chan=%s\n", transferee->name);
ast_debug(1, "ABOUT TO AST_ASYNC_GOTO, have a pbx... set HANGUP_DONT on chan=%s\n", transferee->name);
if (ast_channel_connected_line_macro(transferee, transferer, &transferer->connected, 1, 0)) {
ast_channel_update_connected_line(transferer, &transferer->connected, NULL);
}
@ -4665,7 +4665,7 @@ static struct ast_parkinglot *build_parkinglot(char *name, struct ast_variable *
} else if (!strcasecmp(confvar->name, "findslot")) {
parkinglot->parkfindnext = (!strcasecmp(confvar->value, "next"));
} else if (!strcasecmp(confvar->name, "parkedcalltransfers")) {
ast_log(LOG_DEBUG, "Setting parking lot %s %s to %s\n", name, confvar->name, confvar->value);
ast_debug(1, "Setting parking lot %s %s to %s\n", name, confvar->name, confvar->value);
if (!strcasecmp(confvar->value, "both")) {
parkinglot->parkedcalltransfers = AST_FEATURE_FLAG_BYBOTH;
} else if (!strcasecmp(confvar->value, "caller")) {
@ -4674,7 +4674,7 @@ static struct ast_parkinglot *build_parkinglot(char *name, struct ast_variable *
parkinglot->parkedcalltransfers = AST_FEATURE_FLAG_BYCALLEE;
}
} else if (!strcasecmp(confvar->name, "parkedcallreparking")) {
ast_log(LOG_DEBUG, "Setting parking lot %s %s to %s\n", name, confvar->name, confvar->value);
ast_debug(1, "Setting parking lot %s %s to %s\n", name, confvar->name, confvar->value);
if (!strcasecmp(confvar->value, "both")) {
parkinglot->parkedcallreparking = AST_FEATURE_FLAG_BYBOTH;
} else if (!strcasecmp(confvar->value, "caller")) {
@ -4683,7 +4683,7 @@ static struct ast_parkinglot *build_parkinglot(char *name, struct ast_variable *
parkinglot->parkedcallreparking = AST_FEATURE_FLAG_BYCALLEE;
}
} else if (!strcasecmp(confvar->name, "parkedcallhangup")) {
ast_log(LOG_DEBUG, "Setting parking lot %s %s to %s\n", name, confvar->name, confvar->value);
ast_debug(1, "Setting parking lot %s %s to %s\n", name, confvar->name, confvar->value);
if (!strcasecmp(confvar->value, "both")) {
parkinglot->parkedcallhangup = AST_FEATURE_FLAG_BYBOTH;
} else if (!strcasecmp(confvar->value, "caller")) {
@ -4692,7 +4692,7 @@ static struct ast_parkinglot *build_parkinglot(char *name, struct ast_variable *
parkinglot->parkedcallhangup = AST_FEATURE_FLAG_BYCALLEE;
}
} else if (!strcasecmp(confvar->name, "parkedcallrecording")) {
ast_log(LOG_DEBUG, "Setting parking lot %s %s to %s\n", name, confvar->name, confvar->value);
ast_debug(1, "Setting parking lot %s %s to %s\n", name, confvar->name, confvar->value);
if (!strcasecmp(confvar->value, "both")) {
parkinglot->parkedcallrecording = AST_FEATURE_FLAG_BYBOTH;
} else if (!strcasecmp(confvar->value, "caller")) {

View File

@ -787,7 +787,7 @@ static struct ast_variable *parse_cookies(char *cookies)
}
if (option_debug) {
ast_log(LOG_DEBUG, "mmm ... cookie! Name: '%s' Value: '%s'\n", name, val);
ast_debug(1, "mmm ... cookie! Name: '%s' Value: '%s'\n", name, val);
}
var = ast_variable_new(name, val, __FILE__);

View File

@ -1258,7 +1258,7 @@ char **ast_bt_get_symbols(void **addresses, size_t num_frames)
char asteriskpath[256];
if (!(dli.dli_fname = ast_utils_which("asterisk", asteriskpath, sizeof(asteriskpath)))) {
/* This will fail to find symbols */
ast_log(LOG_DEBUG, "Failed to find asterisk binary for debug symbols.\n");
ast_debug(1, "Failed to find asterisk binary for debug symbols.\n");
dli.dli_fname = "asterisk";
}
}
@ -1378,7 +1378,7 @@ void ast_backtrace(void)
if ((strings = ast_bt_get_symbols(bt->addresses, bt->num_frames))) {
ast_debug(1, "Got %d backtrace record%c\n", bt->num_frames, bt->num_frames != 1 ? 's' : ' ');
for (i = 3; i < bt->num_frames - 2; i++) {
ast_log(LOG_DEBUG, "#%d: [%p] %s\n", i - 3, bt->addresses[i], strings[i]);
ast_debug(1, "#%d: [%p] %s\n", i - 3, bt->addresses[i], strings[i]);
}
/* MALLOC_DEBUG will erroneously report an error here, unless we undef the macro. */

View File

@ -1214,7 +1214,7 @@ static struct mansession_session *unref_mansession(struct mansession_session *s)
{
int refcount = ao2_ref(s, -1);
if (manager_debug) {
ast_log(LOG_DEBUG, "Mansession: %p refcount now %d\n", s, refcount - 1);
ast_debug(1, "Mansession: %p refcount now %d\n", s, refcount - 1);
}
return s;
}
@ -4344,14 +4344,14 @@ static int manager_modulecheck(struct mansession *s, const struct message *m)
cut = filename + strlen(filename);
}
snprintf(cut, (sizeof(filename) - strlen(filename)) - 1, ".so");
ast_log(LOG_DEBUG, "**** ModuleCheck .so file %s\n", filename);
ast_debug(1, "**** ModuleCheck .so file %s\n", filename);
res = ast_module_check(filename);
if (!res) {
astman_send_error(s, m, "Module not loaded");
return 0;
}
snprintf(cut, (sizeof(filename) - strlen(filename)) - 1, ".c");
ast_log(LOG_DEBUG, "**** ModuleCheck .c file %s\n", filename);
ast_debug(1, "**** ModuleCheck .c file %s\n", filename);
#if !defined(LOW_MEMORY)
version = ast_file_version_find(filename);
#endif

View File

@ -2054,7 +2054,7 @@ static struct match_char *add_exten_to_pattern_tree(struct ast_context *con, str
return 0;
}
#ifdef NEED_DEBUG
ast_log(LOG_DEBUG, "Adding exten %s%c%s to tree\n", s1, e1->matchcid ? '/' : ' ', e1->matchcid ? e1->cidmatch : "");
ast_debug(1, "Adding exten %s%c%s to tree\n", s1, e1->matchcid ? '/' : ' ', e1->matchcid ? e1->cidmatch : "");
#endif
m1 = con->pattern_tree; /* each pattern starts over at the root of the pattern tree */
m0 = &con->pattern_tree;
@ -2180,9 +2180,9 @@ static void create_match_char_tree(struct ast_context *con)
#ifdef NEED_DEBUG
int biggest_bucket, resizes, numobjs, numbucks;
ast_log(LOG_DEBUG,"Creating Extension Trie for context %s(%p)\n", con->name, con);
ast_debug(1, "Creating Extension Trie for context %s(%p)\n", con->name, con);
ast_hashtab_get_stats(con->root_table, &biggest_bucket, &resizes, &numobjs, &numbucks);
ast_log(LOG_DEBUG,"This tree has %d objects in %d bucket lists, longest list=%d objects, and has resized %d times\n",
ast_debug(1, "This tree has %d objects in %d bucket lists, longest list=%d objects, and has resized %d times\n",
numobjs, numbucks, biggest_bucket, resizes);
#endif
t1 = ast_hashtab_start_traversal(con->root_table);
@ -2701,7 +2701,7 @@ struct ast_exten *pbx_find_extension(struct ast_channel *chan,
if (!tmp->pattern_tree && tmp->root_table) {
create_match_char_tree(tmp);
#ifdef NEED_DEBUG
ast_log(LOG_DEBUG, "Tree Created in context %s:\n", context);
ast_debug(1, "Tree Created in context %s:\n", context);
log_match_char_tree(tmp->pattern_tree," ");
#endif
}

View File

@ -2269,7 +2269,7 @@ static int ast_say_number_full_se(struct ast_channel *chan, int num, const char
num %= 1000000;
ast_copy_string(fn, "digits/million", sizeof(fn));
} else { /* Miljarder - Billions */
ast_log(LOG_DEBUG, "Number '%d' is too big for me\n", num);
ast_debug(1, "Number '%d' is too big for me\n", num);
return -1;
}
@ -2350,7 +2350,7 @@ static int ast_say_number_full_zh(struct ast_channel *chan, int num, const char
snprintf(fn, sizeof(fn), "digits/%d", (num / 100));
playh++;
snprintf(buf, 10, "%d", num);
ast_log(LOG_DEBUG, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length);
ast_debug(1, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length);
last_length = strlen(buf);
num -= ((num / 100) * 100);
} else if (num < 10000){
@ -2358,7 +2358,7 @@ static int ast_say_number_full_zh(struct ast_channel *chan, int num, const char
snprintf(fn, sizeof(fn), "digits/%d", (num / 1000));
playt++;
snprintf(buf, 10, "%d", num);
ast_log(LOG_DEBUG, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length);
ast_debug(1, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length);
last_length = strlen(buf);
num -= ((num / 1000) * 1000);
} else if (num < 100000000) { /* 100,000,000 */
@ -2366,7 +2366,7 @@ static int ast_say_number_full_zh(struct ast_channel *chan, int num, const char
if (res)
return res;
snprintf(buf, 10, "%d", num);
ast_log(LOG_DEBUG, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length);
ast_debug(1, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length);
num -= ((num / 10000) * 10000);
last_length = strlen(buf);
snprintf(fn, sizeof(fn), "digits/wan");
@ -2376,7 +2376,7 @@ static int ast_say_number_full_zh(struct ast_channel *chan, int num, const char
if (res)
return res;
snprintf(buf, 10, "%d", num);
ast_log(LOG_DEBUG, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length);
ast_debug(1, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length);
last_length = strlen(buf);
num -= ((num / 100000000) * 100000000);
snprintf(fn, sizeof(fn), "digits/yi");
@ -2443,7 +2443,7 @@ static int ast_say_number_full_ur(struct ast_channel *chan, int num, const char
num = num % 10000000;
snprintf(fn, sizeof(fn), "digits/crore");
} else {
ast_log(LOG_DEBUG, "Number '%d' is too big for me\n", num);
ast_debug(1, "Number '%d' is too big for me\n", num);
res = -1;
}
@ -3267,7 +3267,7 @@ static int ast_say_enumeration_full_he(struct ast_channel *chan, int num, const
snprintf(fn, sizeof(fn), "digits/1m");
num = num % 1000000;
} else {
ast_log(LOG_DEBUG, "Number '%d' is too big for me\n", num);
ast_debug(1, "Number '%d' is too big for me\n", num);
res = -1;
}
if (!res) {
@ -4349,7 +4349,7 @@ int ast_say_date_with_format_th(struct ast_channel *chan, time_t t, const char *
ast_localtime(&when, &tm, tzone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
ast_log(LOG_DEBUG, "Parsing %c (offset %d) in %s\n", format[offset], offset, format);
ast_debug(1, "Parsing %c (offset %d) in %s\n", format[offset], offset, format);
switch (format[offset]) {
/* NOTE: if you add more options here, please try to be consistent with strftime(3) */
case '\'':

View File

@ -351,7 +351,7 @@ static void tps_taskprocessor_destroy(void *tps)
ast_log(LOG_ERROR, "missing taskprocessor\n");
return;
}
ast_log(LOG_DEBUG, "destroying taskprocessor '%s'\n", t->name);
ast_debug(1, "destroying taskprocessor '%s'\n", t->name);
/* kill it */
ast_mutex_lock(&t->taskprocessor_lock);
t->poll_thread_run = 0;

View File

@ -1793,7 +1793,7 @@ static char *xmldoc_build_field(const char *type, const char *name, const char *
node = ast_xml_find_element(ast_xml_node_get_children(node), var, NULL, NULL);
if (!node || !ast_xml_node_get_children(node)) {
ast_log(LOG_DEBUG, "Cannot find variable '%s' in tree '%s'\n", var, name);
ast_debug(1, "Cannot find variable '%s' in tree '%s'\n", var, name);
return ret;
}

View File

@ -76,7 +76,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
char *newpattern=NULL; \
loopback_subst(buf, sizeof(buf), exten, context, priority, data); \
loopback_parse(&newexten, &newcontext, &newpriority, &newpattern, buf); \
ast_log(LOG_DEBUG, "Parsed into %s @ %s priority %d\n", newexten, newcontext, newpriority); \
ast_debug(1, "Parsed into %s @ %s priority %d\n", newexten, newcontext, newpriority); \
if (!strcasecmp(newcontext, context)) return -1
static char *loopback_subst(char *buf, int buflen, const char *exten, const char *context, int priority, const char *data)

View File

@ -432,7 +432,7 @@ static int scan_service(const char *fn, time_t now)
now += o->retrytime;
if (o->callingpid && (o->callingpid == ast_mainpid)) {
safe_append(o, time(NULL), "DelayedRetry");
ast_log(LOG_DEBUG, "Delaying retry since we're currently running '%s'\n", o->fn);
ast_debug(1, "Delaying retry since we're currently running '%s'\n", o->fn);
free_outgoing(o);
} else {
/* Increment retries */

View File

@ -182,18 +182,18 @@ static void ast_event_cb(const struct ast_event *ast_event, void *data)
const char *filter_str;
SaEvtEventIdT event_id;
ast_log(LOG_DEBUG, "Got an event to forward\n");
ast_debug(1, "Got an event to forward\n");
if (ast_eid_cmp(&ast_eid_default, ast_event_get_ie_raw(ast_event, AST_EVENT_IE_EID))) {
/* If the event didn't originate from this server, don't send it back out. */
ast_log(LOG_DEBUG, "Returning here\n");
ast_debug(1, "Returning here\n");
return;
}
ais_res = saEvtEventAllocate(event_channel->handle, &event_handle);
if (ais_res != SA_AIS_OK) {
ast_log(LOG_ERROR, "Error allocating event: %s\n", ais_err2str(ais_res));
ast_log(LOG_DEBUG, "Returning here\n");
ast_debug(1, "Returning here\n");
return;
}
@ -237,7 +237,7 @@ return_event_free:
if (ais_res != SA_AIS_OK) {
ast_log(LOG_ERROR, "Error freeing allocated event: %s\n", ais_err2str(ais_res));
}
ast_log(LOG_DEBUG, "Returning here (event_free)\n");
ast_debug(1, "Returning here (event_free)\n");
}
static char *ais_evt_show_event_channels(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
@ -325,7 +325,7 @@ static void add_publish_event(struct event_channel *event_channel, const char *e
}
publish_event->type = type;
ast_log(LOG_DEBUG, "Subscribing to event type %d\n", type);
ast_debug(1, "Subscribing to event type %d\n", type);
publish_event->sub = ast_event_subscribe(type, ast_event_cb, "AIS", event_channel,
AST_EVENT_IE_END);
ast_event_dump_cache(publish_event->sub);

View File

@ -1122,7 +1122,7 @@ static char *handle_cli_agi_add_cmd(struct ast_cli_entry *e, int cmd, struct ast
return CLI_FAILURE;
}
ast_log(LOG_DEBUG, "Added AGI command to channel %s queue\n", chan->name);
ast_debug(1, "Added AGI command to channel %s queue\n", chan->name);
ast_channel_unlock(chan);
chan = ast_channel_unref(chan);
@ -1259,7 +1259,7 @@ static enum agi_result launch_asyncagi(struct ast_channel *chan, char *argv[], i
while (1) {
/* bail out if we need to hangup */
if (ast_check_hangup(chan)) {
ast_log(LOG_DEBUG, "ast_check_hangup returned true on chan %s\n", chan->name);
ast_debug(1, "ast_check_hangup returned true on chan %s\n", chan->name);
break;
}
/* retrieve a command
@ -1296,21 +1296,21 @@ static enum agi_result launch_asyncagi(struct ast_channel *chan, char *argv[], i
/* no command so far, wait a bit for a frame to read */
res = ast_waitfor(chan, timeout);
if (res < 0) {
ast_log(LOG_DEBUG, "ast_waitfor returned <= 0 on chan %s\n", chan->name);
ast_debug(1, "ast_waitfor returned <= 0 on chan %s\n", chan->name);
break;
}
if (res == 0)
continue;
f = ast_read(chan);
if (!f) {
ast_log(LOG_DEBUG, "No frame read on channel %s, going out ...\n", chan->name);
ast_debug(1, "No frame read on channel %s, going out ...\n", chan->name);
returnstatus = AGI_RESULT_HANGUP;
break;
}
/* is there any other frame we should care about
besides AST_CONTROL_HANGUP? */
if (f->frametype == AST_FRAME_CONTROL && f->subclass.integer == AST_CONTROL_HANGUP) {
ast_log(LOG_DEBUG, "Got HANGUP frame on channel %s, going out ...\n", chan->name);
ast_debug(1, "Got HANGUP frame on channel %s, going out ...\n", chan->name);
ast_frfree(f);
break;
}

View File

@ -411,7 +411,6 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf
char *ldap_attribute_name = ldap_first_attribute(ldapConn, ldap_entry, &ber);
struct berval *value;
while (ldap_attribute_name) {
const char *attribute_name = convert_attribute_name_from_ldap(table_config, ldap_attribute_name);
int is_realmed_password_attribute = strcasecmp(attribute_name, "md5secret") == 0;
struct berval **values = NULL;
@ -805,7 +804,7 @@ static struct ast_variable **realtime_ldap_base_ap(unsigned int *entries_count_p
LDAP_SCOPE_SUBTREE, ast_str_buffer(filter), NULL, 0, NULL, NULL, NULL, LDAP_NO_LIMIT,
&ldap_result_msg);
if (result != LDAP_SUCCESS && is_ldap_connect_error(result)) {
ast_log(LOG_DEBUG, "Failed to query directory. Try %d/10\n", tries + 1);
ast_debug(1, "Failed to query directory. Try %d/10\n", tries + 1);
if (++tries < 10) {
usleep(1);
if (ldapConn) {

View File

@ -365,9 +365,7 @@ static int http_post_callback(struct ast_tcptls_session_instance *ser, const str
fprintf(f, "\r\n");
if (0 > readmimefile(ser->f, f, boundary_marker, content_len)) {
if (option_debug) {
ast_log(LOG_DEBUG, "Cannot find boundary marker in POST request.\n");
}
ast_debug(1, "Cannot find boundary marker in POST request.\n");
fclose(f);
return -1;

View File

@ -3158,7 +3158,7 @@ static void aji_mwi_cb(const struct ast_event *ast_event, void *data)
if (ast_eid_cmp(&ast_eid_default, ast_event_get_ie_raw(ast_event, AST_EVENT_IE_EID)))
{
/* If the event didn't originate from this server, don't send it back out. */
ast_log(LOG_DEBUG, "Returning here\n");
ast_debug(1, "Returning here\n");
return;
}
@ -3186,7 +3186,7 @@ static void aji_devstate_cb(const struct ast_event *ast_event, void *data)
if (ast_eid_cmp(&ast_eid_default, ast_event_get_ie_raw(ast_event, AST_EVENT_IE_EID)))
{
/* If the event didn't originate from this server, don't send it back out. */
ast_log(LOG_DEBUG, "Returning here\n");
ast_debug(1, "Returning here\n");
return;
}
@ -3246,7 +3246,7 @@ static int aji_handle_pubsub_event(void *data, ikspak *pak)
item_content = iks_child(item);
ast_str_to_eid(&pubsub_eid, iks_find_attrib(item_content, "eid"));
if (!ast_eid_cmp(&ast_eid_default, &pubsub_eid)) {
ast_log(LOG_DEBUG, "Returning here, eid of incoming event matches ours!\n");
ast_debug(1, "Returning here, eid of incoming event matches ours!\n");
return IKS_FILTER_EAT;
}
if (!strcasecmp(iks_name(item_content), "state")) {
@ -3271,7 +3271,7 @@ static int aji_handle_pubsub_event(void *data, ikspak *pak)
return IKS_FILTER_EAT;
}
} else {
ast_log(LOG_DEBUG, "Don't know how to handle PubSub event of type %s\n",
ast_debug(1, "Don't know how to handle PubSub event of type %s\n",
iks_name(item_content));
return IKS_FILTER_EAT;
}

View File

@ -842,7 +842,7 @@ static struct mohclass *_get_mohbyname(const char *name, int warn, int flags, co
#endif
if (!moh && warn) {
ast_log(LOG_DEBUG, "Music on Hold class '%s' not found in memory\n", name);
ast_debug(1, "Music on Hold class '%s' not found in memory\n", name);
}
return moh;
@ -1537,7 +1537,7 @@ static void moh_class_destructor(void *obj)
char buff[8192];
int bytes, tbytes = 0, stime = 0, pid = 0;
ast_log(LOG_DEBUG, "killing %d!\n", class->pid);
ast_debug(1, "killing %d!\n", class->pid);
stime = time(NULL) + 2;
pid = class->pid;
@ -1571,7 +1571,7 @@ static void moh_class_destructor(void *obj)
tbytes = tbytes + bytes;
}
ast_log(LOG_DEBUG, "mpg123 pid %d and child died after %d bytes read\n", pid, tbytes);
ast_debug(1, "mpg123 pid %d and child died after %d bytes read\n", pid, tbytes);
close(class->srcfd);
}

View File

@ -1435,15 +1435,15 @@ static odbc_status odbc_obj_disconnect(struct odbc_obj *obj)
if (obj->parent) {
if (res == SQL_SUCCESS || res == SQL_SUCCESS_WITH_INFO) {
ast_log(LOG_DEBUG, "Disconnected %d from %s [%s]\n", res, obj->parent->name, obj->parent->dsn);
ast_debug(1, "Disconnected %d from %s [%s]\n", res, obj->parent->name, obj->parent->dsn);
} else {
ast_log(LOG_DEBUG, "res_odbc: %s [%s] already disconnected\n", obj->parent->name, obj->parent->dsn);
ast_debug(1, "res_odbc: %s [%s] already disconnected\n", obj->parent->name, obj->parent->dsn);
}
}
if ((res = SQLFreeHandle(SQL_HANDLE_DBC, obj->con) == SQL_SUCCESS)) {
obj->con = NULL;
ast_log(LOG_DEBUG, "Database handle deallocated\n");
ast_debug(1, "Database handle deallocated\n");
} else {
SQLGetDiagRec(SQL_HANDLE_DBC, obj->con, 1, state, &err, msg, 100, &mlen);
ast_log(LOG_WARNING, "Unable to deallocate database handle? %d errno=%d %s\n", res, (int)err, msg);

View File

@ -1127,7 +1127,7 @@ static int ast_rtp_raw_write(struct ast_rtp_instance *instance, struct ast_frame
strerror(errno));
} else if (((ast_test_flag(rtp, FLAG_NAT_ACTIVE) == FLAG_NAT_INACTIVE) || rtpdebug) && !ast_test_flag(rtp, FLAG_NAT_INACTIVE_NOWARN)) {
/* Only give this error message once if we are not RTP debugging */
if (option_debug || rtpdebug)
if (rtpdebug)
ast_debug(0, "RTP NAT: Can't write RTP to private address %s, waiting for other end to send audio...\n",
ast_sockaddr_stringify(&remote_address));
ast_set_flag(rtp, FLAG_NAT_INACTIVE_NOWARN);
@ -1417,7 +1417,7 @@ static void process_dtmf_rfc2833(struct ast_rtp_instance *instance, unsigned cha
}
/* Print out debug if turned on */
if (rtpdebug || option_debug > 2)
if (rtpdebug)
ast_debug(0, "- RTP 2833 Event: %08x (len = %d)\n", event, len);
/* Figure out what digit was pressed */
@ -1433,7 +1433,7 @@ static void process_dtmf_rfc2833(struct ast_rtp_instance *instance, unsigned cha
resp = 'X';
} else {
/* Not a supported event */
ast_log(LOG_DEBUG, "Ignoring RTP 2833 Event: %08x. Not a DTMF Digit.\n", event);
ast_debug(1, "Ignoring RTP 2833 Event: %08x. Not a DTMF Digit.\n", event);
return;
}
@ -1563,7 +1563,7 @@ static struct ast_frame *process_dtmf_cisco(struct ast_rtp_instance *instance, u
power = data[2];
event = data[3] & 0x1f;
if (option_debug > 2 || rtpdebug)
if (rtpdebug)
ast_debug(0, "Cisco DTMF Digit: %02x (len=%d, seq=%d, flags=%02x, power=%d, history count=%d)\n", event, len, seq, flags, power, (len - 4) / 2);
if (event < 10) {
resp = '0' + event;
@ -1663,7 +1663,7 @@ static struct ast_frame *ast_rtcp_read(struct ast_rtp_instance *instance)
/* Send to whoever sent to us */
if (ast_sockaddr_cmp(&rtp->rtcp->them, &addr)) {
ast_sockaddr_copy(&rtp->rtcp->them, &addr);
if (option_debug || rtpdebug)
if (rtpdebug)
ast_debug(0, "RTCP NAT: Got RTCP from other end. Now sending to address %s\n",
ast_sockaddr_stringify(&rtp->rtcp->them));
}
@ -1685,8 +1685,8 @@ static struct ast_frame *ast_rtcp_read(struct ast_rtp_instance *instance)
length &= 0xffff;
if ((i + length) > packetwords) {
if (option_debug || rtpdebug)
ast_log(LOG_DEBUG, "RTCP Read too short\n");
if (rtpdebug)
ast_debug(1, "RTCP Read too short\n");
return &ast_null_frame;
}
@ -2068,7 +2068,7 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc
}
rtp->rxseqno = 0;
ast_set_flag(rtp, FLAG_NAT_ACTIVE);
if (option_debug || rtpdebug)
if (rtpdebug)
ast_debug(0, "RTP NAT: Got audio from other end. Now sending to address %s\n",
ast_sockaddr_stringify(&remote_address));
}
@ -2103,7 +2103,7 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc
};
if (!mark) {
if (option_debug || rtpdebug) {
if (rtpdebug) {
ast_debug(1, "Forcing Marker bit, because SSRC has changed\n");
}
mark = 1;

View File

@ -650,7 +650,7 @@ static void *smdi_read(void *iface_p)
/* check if this is the start of a message */
if (!start) {
if (c == 'M') {
ast_log(LOG_DEBUG, "Read an 'M' to start an SMDI message\n");
ast_debug(1, "Read an 'M' to start an SMDI message\n");
start = 1;
}
continue;
@ -659,7 +659,7 @@ static void *smdi_read(void *iface_p)
if (c == 'D') { /* MD message */
start = 0;
ast_log(LOG_DEBUG, "Read a 'D' ... it's an MD message.\n");
ast_debug(1, "Read a 'D' ... it's an MD message.\n");
if (!(md_msg = ast_calloc(1, sizeof(*md_msg)))) {
ASTOBJ_UNREF(iface, ast_smdi_interface_destroy);
@ -671,43 +671,43 @@ static void *smdi_read(void *iface_p)
/* read the message desk number */
for (i = 0; i < sizeof(md_msg->mesg_desk_num) - 1; i++) {
md_msg->mesg_desk_num[i] = fgetc(iface->file);
ast_log(LOG_DEBUG, "Read a '%c'\n", md_msg->mesg_desk_num[i]);
ast_debug(1, "Read a '%c'\n", md_msg->mesg_desk_num[i]);
}
md_msg->mesg_desk_num[sizeof(md_msg->mesg_desk_num) - 1] = '\0';
ast_log(LOG_DEBUG, "The message desk number is '%s'\n", md_msg->mesg_desk_num);
ast_debug(1, "The message desk number is '%s'\n", md_msg->mesg_desk_num);
/* read the message desk terminal number */
for (i = 0; i < sizeof(md_msg->mesg_desk_term) - 1; i++) {
md_msg->mesg_desk_term[i] = fgetc(iface->file);
ast_log(LOG_DEBUG, "Read a '%c'\n", md_msg->mesg_desk_term[i]);
ast_debug(1, "Read a '%c'\n", md_msg->mesg_desk_term[i]);
}
md_msg->mesg_desk_term[sizeof(md_msg->mesg_desk_term) - 1] = '\0';
ast_log(LOG_DEBUG, "The message desk terminal is '%s'\n", md_msg->mesg_desk_term);
ast_debug(1, "The message desk terminal is '%s'\n", md_msg->mesg_desk_term);
/* read the message type */
md_msg->type = fgetc(iface->file);
ast_log(LOG_DEBUG, "Message type is '%c'\n", md_msg->type);
ast_debug(1, "Message type is '%c'\n", md_msg->type);
/* read the forwarding station number (may be blank) */
cp = &md_msg->fwd_st[0];
for (i = 0; i < sizeof(md_msg->fwd_st) - 1; i++) {
if ((c = fgetc(iface->file)) == ' ') {
*cp = '\0';
ast_log(LOG_DEBUG, "Read a space, done looking for the forwarding station\n");
ast_debug(1, "Read a space, done looking for the forwarding station\n");
break;
}
/* store c in md_msg->fwd_st */
if (i >= iface->msdstrip) {
ast_log(LOG_DEBUG, "Read a '%c' and stored it in the forwarding station buffer\n", c);
ast_debug(1, "Read a '%c' and stored it in the forwarding station buffer\n", c);
*cp++ = c;
} else {
ast_log(LOG_DEBUG, "Read a '%c', but didn't store it in the fwd station buffer, because of the msdstrip setting (%d < %d)\n", c, i, iface->msdstrip);
ast_debug(1, "Read a '%c', but didn't store it in the fwd station buffer, because of the msdstrip setting (%d < %d)\n", c, i, iface->msdstrip);
}
}
@ -715,7 +715,7 @@ static void *smdi_read(void *iface_p)
md_msg->fwd_st[sizeof(md_msg->fwd_st) - 1] = '\0';
cp = NULL;
ast_log(LOG_DEBUG, "The forwarding station is '%s'\n", md_msg->fwd_st);
ast_debug(1, "The forwarding station is '%s'\n", md_msg->fwd_st);
/* Put the fwd_st in the name field so that we can use ASTOBJ_FIND to look
* up a message on this field */
@ -726,7 +726,7 @@ static void *smdi_read(void *iface_p)
for (i = 0; i < sizeof(md_msg->calling_st) - 1; i++) {
if (!isdigit((c = fgetc(iface->file)))) {
*cp = '\0';
ast_log(LOG_DEBUG, "Read a '%c', but didn't store it in the calling station buffer because it's not a digit\n", c);
ast_debug(1, "Read a '%c', but didn't store it in the calling station buffer because it's not a digit\n", c);
if (c == ' ') {
/* Don't break on a space. We may read the space before the calling station
* here if the forwarding station buffer filled up. */
@ -738,10 +738,10 @@ static void *smdi_read(void *iface_p)
/* store c in md_msg->calling_st */
if (i >= iface->msdstrip) {
ast_log(LOG_DEBUG, "Read a '%c' and stored it in the calling station buffer\n", c);
ast_debug(1, "Read a '%c' and stored it in the calling station buffer\n", c);
*cp++ = c;
} else {
ast_log(LOG_DEBUG, "Read a '%c', but didn't store it in the calling station buffer, because of the msdstrip setting (%d < %d)\n", c, i, iface->msdstrip);
ast_debug(1, "Read a '%c', but didn't store it in the calling station buffer, because of the msdstrip setting (%d < %d)\n", c, i, iface->msdstrip);
}
}
@ -749,19 +749,19 @@ static void *smdi_read(void *iface_p)
md_msg->calling_st[sizeof(md_msg->calling_st) - 1] = '\0';
cp = NULL;
ast_log(LOG_DEBUG, "The calling station is '%s'\n", md_msg->calling_st);
ast_debug(1, "The calling station is '%s'\n", md_msg->calling_st);
/* add the message to the message queue */
md_msg->timestamp = ast_tvnow();
ast_smdi_md_message_push(iface, md_msg);
ast_log(LOG_DEBUG, "Received SMDI MD message on %s\n", iface->name);
ast_debug(1, "Received SMDI MD message on %s\n", iface->name);
ASTOBJ_UNREF(md_msg, ast_smdi_md_message_destroy);
} else if (c == 'W') { /* MWI message */
start = 0;
ast_log(LOG_DEBUG, "Read a 'W', it's an MWI message. (No more debug coming for MWI messages)\n");
ast_debug(1, "Read a 'W', it's an MWI message. (No more debug coming for MWI messages)\n");
if (!(mwi_msg = ast_calloc(1, sizeof(*mwi_msg)))) {
ASTOBJ_UNREF(iface,ast_smdi_interface_destroy);
@ -803,7 +803,7 @@ static void *smdi_read(void *iface_p)
/* add the message to the message queue */
mwi_msg->timestamp = ast_tvnow();
ast_smdi_mwi_message_push(iface, mwi_msg);
ast_log(LOG_DEBUG, "Received SMDI MWI message on %s\n", iface->name);
ast_debug(1, "Received SMDI MWI message on %s\n", iface->name);
ASTOBJ_UNREF(mwi_msg, ast_smdi_mwi_message_destroy);
} else {

View File

@ -3761,15 +3761,13 @@ static struct ast_config *config_text_file_load(const char *database, const char
fflush(stdout);
}
if (!(f = fopen(fn, "r"))) {
if (option_debug)
ast_log(LOG_DEBUG, "No file to parse: %s\n", fn);
ast_debug(1, "No file to parse: %s\n", fn);
if (option_verbose > 1)
ast_verbose( "Not found (%s)\n", strerror(errno));
continue;
}
count++;
if (option_debug)
ast_log(LOG_DEBUG, "Parsing %s\n", fn);
ast_debug(1, "Parsing %s\n", fn);
if (option_verbose > 1)
ast_verbose("Found\n");
while(!feof(f)) {
@ -4157,8 +4155,6 @@ int localized_config_text_file_save(const char *configfile, const struct ast_con
}
fclose(f);
var = var->next;
}
cat = cat->next;
@ -4166,8 +4162,7 @@ int localized_config_text_file_save(const char *configfile, const struct ast_con
if ((option_verbose > 1) && !option_debug)
ast_verbose("Saved\n");
} else {
if (option_debug)
ast_log(LOG_DEBUG, "Unable to open for writing: %s\n", fn);
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));
return -1;
@ -4277,14 +4272,12 @@ static int ast_add_hint(struct ast_exten *e)
/* Search if hint exists, do nothing */
AST_RWLIST_TRAVERSE(&hints, hint, list) {
if (hint->exten == e) {
if (option_debug > 1)
ast_log(LOG_DEBUG, "HINTS: Not re-adding existing hint %s: %s\n", ast_get_extension_name(e), ast_get_extension_app(e));
ast_debug(2, "HINTS: Not re-adding existing hint %s: %s\n", ast_get_extension_name(e), ast_get_extension_app(e));
return -1;
}
}
if (option_debug > 1)
ast_log(LOG_DEBUG, "HINTS: Adding hint %s: %s\n", ast_get_extension_name(e), ast_get_extension_app(e));
ast_debug(2, "HINTS: Adding hint %s: %s\n", ast_get_extension_name(e), ast_get_extension_app(e));
if (!(hint = ast_calloc(1, sizeof(*hint)))) {
return -1;
@ -5323,8 +5316,7 @@ static struct ast_context *__ast_context_create(struct ast_context **extcontexts
tmp->includes = NULL;
tmp->ignorepats = NULL;
*loc_contexts = tmp;
if (option_debug)
ast_log(LOG_DEBUG, "Registered context '%s'\n", tmp->name);
ast_debug(1, "Registered context '%s'\n", tmp->name);
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Registered extension context '%s'\n", tmp->name);
}
@ -5457,10 +5449,10 @@ static int ast_add_extension2(struct ast_context *con,
}
if (option_debug) {
if (tmp->matchcid) {
ast_log(LOG_DEBUG, "Added extension '%s' priority %d (CID match '%s') to %s\n",
ast_debug(1, "Added extension '%s' priority %d (CID match '%s') to %s\n",
tmp->exten, tmp->priority, tmp->cidmatch, con->name);
} else {
ast_log(LOG_DEBUG, "Added extension '%s' priority %d to %s\n",
ast_debug(1, "Added extension '%s' priority %d to %s\n",
tmp->exten, tmp->priority, con->name);
}
}
@ -5551,8 +5543,7 @@ static int pbx_extension_helper(struct ast_channel *c, struct ast_context *con,
ast_log(LOG_NOTICE, "No such label '%s' in extension '%s' in context '%s'\n", label, exten, context);
break;
default:
if (option_debug)
ast_log(LOG_DEBUG, "Shouldn't happen!\n");
ast_debug(1, "Shouldn't happen!\n");
}
return (matching_action) ? 0 : -1;
@ -5834,8 +5825,7 @@ static void pbx_substitute_variables_helper_full(struct ast_channel *c, struct v
if (isfunction) {
/* Evaluate function */
cp4 = ast_func_read(c, vars, workspace, VAR_BUF_SIZE) ? NULL : workspace;
if (option_debug)
ast_log(LOG_DEBUG, "Function result is '%s'\n", cp4 ? cp4 : "(null)");
ast_debug(1, "Function result is '%s'\n", cp4 ? cp4 : "(null)");
} else {
/* Retrieve variable value */
pbx_retrieve_variable(c, vars, &cp4, workspace, VAR_BUF_SIZE, headp);
@ -5903,8 +5893,7 @@ static void pbx_substitute_variables_helper_full(struct ast_channel *c, struct v
length = ast_expr(vars, cp2, count, NULL);
if (length) {
if (option_debug)
ast_log(LOG_DEBUG, "Expression result is '%s'\n", cp2);
ast_debug(1, "Expression result is '%s'\n", cp2);
count -= length;
cp2 += length;
*cp2 = 0;
@ -6098,8 +6087,7 @@ static void __ast_context_destroy(struct ast_context *con, const char *registrar
for (tmp = contexts; tmp; ) {
struct ast_context *next; /* next starting point */
for (; tmp; tmpl = tmp, tmp = tmp->next) {
if (option_debug)
ast_log(LOG_DEBUG, "check ctx %s %s\n", tmp->name, tmp->registrar);
ast_debug(1, "check ctx %s %s\n", tmp->name, tmp->registrar);
if ( (!registrar || !strcasecmp(registrar, tmp->registrar)) &&
(!con || !strcasecmp(tmp->name, con->name)) )
break; /* found it */
@ -6107,8 +6095,7 @@ static void __ast_context_destroy(struct ast_context *con, const char *registrar
if (!tmp) /* not found, we are done */
break;
ast_wrlock_context(tmp);
if (option_debug)
ast_log(LOG_DEBUG, "delete ctx %s %s\n", tmp->name, tmp->registrar);
ast_debug(1, "delete ctx %s %s\n", tmp->name, tmp->registrar);
next = tmp->next;
if (tmpl)
tmpl->next = next;
@ -6173,8 +6160,7 @@ static void ast_merge_contexts_and_delete(struct ast_context **extcontexts, cons
tmp = *extcontexts;
if (registrar) {
/* XXX remove previous contexts from same registrar */
if (option_debug)
ast_log(LOG_DEBUG, "must remove any reg %s\n", registrar);
ast_debug(1, "must remove any reg %s\n", registrar);
__ast_context_destroy(NULL,registrar);
while (tmp) {
lasttmp = tmp;