{
char *chan;
char *num, *name;
- char tmp[AST_MAX_EXTENSION];
+ char tmp[AST_MAX_EXTENSION] = "";
if (cdr) {
chan = strlen(cdr->channel) ? cdr->channel : "<unknown>";
if (strlen(cdr->channel))
strncpy(cdr->src, num, sizeof(cdr->src) - 1);
}
- if (c->state == AST_STATE_UP)
+ if (c->_state == AST_STATE_UP)
cdr->disposition = AST_CDR_ANSWERED;
else
cdr->disposition = AST_CDR_NOANSWER;
return "Unknown";
}
+int ast_cdr_setaccount(struct ast_channel *chan, char *account)
+{
+ struct ast_cdr *cdr = chan->cdr;
+
+ strncpy(chan->accountcode, account, sizeof(chan->accountcode) - 1);
+ if (cdr)
+ strncpy(cdr->accountcode, chan->accountcode, sizeof(cdr->accountcode) - 1);
+ return 0;
+}
+
int ast_cdr_amaflags2int(char *flag)
{
if (!strcasecmp(flag, "default"))
/* Gotta have at least one. We'll make a NULL one */
logfiles = make_logfile("ignore", "", -1);
}
+ ast_destroy(cfg);
ast_pthread_mutex_unlock(&loglock);
struct logfile *f;
va_list ap;
- va_start(ap, fmt);
if (!option_verbose && !option_debug && (!level)) {
- va_end(ap);
return;
}
ast_pthread_mutex_lock(&loglock);
/* Log events into the event log file, with a different format */
strftime(date, sizeof(date), "%b %e %T", tm);
fprintf(eventlog, "%s asterisk[%d]: ", date, getpid());
+ va_start(ap, fmt);
vfprintf(eventlog, fmt, ap);
+ va_end(ap);
fflush(eventlog);
} else
/** Cannot use ast_log() from locked section of ast_log()!
ast_log(LOG_WARNING, "Unable to retrieve local time?\n"); **/
- fprintf(stderr, "ast_log: Unable to retrieve local time for %d?\n", t);
+ fprintf(stderr, "ast_log: Unable to retrieve local time for %ld?\n", t);
} else {
if (logfiles) {
f = logfiles;
term_color(tmp3, linestr, COLOR_BRWHITE, 0, sizeof(tmp3)),
term_color(tmp4, function, COLOR_BRWHITE, 0, sizeof(tmp4)));
}
- vfprintf(f->f, fmt, ap);
va_start(ap, fmt);
- fflush(f->f);
+ vfprintf(f->f, fmt, ap);
va_end(ap);
+ fflush(f->f);
}
f = f->next;
}
}
}
ast_pthread_mutex_unlock(&loglock);
- va_end(ap);
}
extern void ast_verbose(char *fmt, ...)