|
|
@ -157,7 +157,9 @@ static struct logchannel *make_logchannel(char *channel, char *components, int l
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
chan = malloc(sizeof(struct logchannel));
|
|
|
|
chan = malloc(sizeof(struct logchannel));
|
|
|
|
|
|
|
|
|
|
|
|
if (chan) {
|
|
|
|
if (!chan) /* Can't allocate memory */
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
|
|
memset(chan, 0, sizeof(struct logchannel));
|
|
|
|
memset(chan, 0, sizeof(struct logchannel));
|
|
|
|
if (!strcasecmp(channel, "console")) {
|
|
|
|
if (!strcasecmp(channel, "console")) {
|
|
|
|
chan->type = LOGTYPE_CONSOLE;
|
|
|
|
chan->type = LOGTYPE_CONSOLE;
|
|
|
@ -232,6 +234,7 @@ static struct logchannel *make_logchannel(char *channel, char *components, int l
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
chan->type = LOGTYPE_SYSLOG;
|
|
|
|
chan->type = LOGTYPE_SYSLOG;
|
|
|
|
|
|
|
|
snprintf(chan->filename, sizeof(chan->filename), "%s", channel);
|
|
|
|
openlog("asterisk", LOG_PID, chan->facility);
|
|
|
|
openlog("asterisk", LOG_PID, chan->facility);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (channel[0] == '/') {
|
|
|
|
if (channel[0] == '/') {
|
|
|
@ -255,7 +258,6 @@ static struct logchannel *make_logchannel(char *channel, char *components, int l
|
|
|
|
chan->type = LOGTYPE_FILE;
|
|
|
|
chan->type = LOGTYPE_FILE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
chan->logmask = make_components(components, lineno);
|
|
|
|
chan->logmask = make_components(components, lineno);
|
|
|
|
}
|
|
|
|
|
|
|
|
return chan;
|
|
|
|
return chan;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|