<!-- delay between retries in seconds, default is 5 seconds -->\r
<!-- <param name="delay" value="1"/> -->\r
\r
- <!-- optional: full path to the error log dir for failed web posts if not specified its <freeswitch>/logs/xml_cdr_curl -->\r
- <!-- <param name="errLogDir" value="/tmp"/> -->\r
-\r
<!-- optional: if not present we do not log every record to disk -->\r
- <!-- per original code base /xml_cdr is appended to the directory name -->\r
- <!-- defined but blank value will default to freeswitchdir/log -->\r
- <param name="logDir" value=""/>\r
+ <!-- either an absolute path, a relative path assuming ${prefix}/logs or a blank value will default to ${prefix}/logs/xml_cdr -->\r
+ <param name="log-dir" value=""/>\r
+\r
+ <!-- optional: full path to the error log dir for failed web posts if not specified its the same as log-dir -->\r
+ <!-- either an absolute path, a relative path assuming ${prefix}/logs or a blank or omitted value will default to ${prefix}/logs/xml_cdr -->\r
+ <!-- <param name="err-log-dir" value="/tmp"/> -->\r
\r
</settings>\r
</configuration>\r
return SWITCH_STATUS_TERM;
}
- globals.log_dir = switch_mprintf("%s/xml_cdr", SWITCH_GLOBAL_dirs.log_dir);
- globals.err_log_dir = strdup(globals.log_dir);
-
if ((settings = switch_xml_child(cfg, "settings"))) {
for (param = switch_xml_child(settings, "param"); param; param = param->next) {
char *var = (char *) switch_xml_attr_soft(param, "name");
} else if (!strcasecmp(var, "retries")) {
globals.retries = (uint32_t) atoi(val);
} else if (!strcasecmp(var, "log-dir")) {
- switch_safe_free(globals.log_dir);
- if (switch_is_file_path(val)) {
- globals.log_dir = strdup(val);
+ if (switch_strlen_zero(val)) {
+ globals.log_dir = switch_mprintf("%s/xml_cdr", SWITCH_GLOBAL_dirs.log_dir);
} else {
- globals.log_dir = switch_mprintf("%s/%s", SWITCH_GLOBAL_dirs.log_dir, val);
+ if (switch_is_file_path(val)) {
+ globals.log_dir = strdup(val);
+ } else {
+ globals.log_dir = switch_mprintf("%s/%s", SWITCH_GLOBAL_dirs.log_dir, val);
+ }
}
} else if (!strcasecmp(var, "err-log-dir")) {
- switch_safe_free(globals.err_log_dir);
- if (switch_is_file_path(val)) {
- globals.err_log_dir = strdup(val);
+ if (switch_strlen_zero(val)) {
+ globals.err_log_dir = switch_mprintf("%s/xml_cdr", SWITCH_GLOBAL_dirs.log_dir);
} else {
- globals.err_log_dir = switch_mprintf("%s/%s", SWITCH_GLOBAL_dirs.log_dir, val);
+ if (switch_is_file_path(val)) {
+ globals.err_log_dir = strdup(val);
+ } else {
+ globals.err_log_dir = switch_mprintf("%s/%s", SWITCH_GLOBAL_dirs.log_dir, val);
+ }
}
}
+ if (switch_strlen_zero(globals.err_log_dir)) {
+ if (!switch_strlen_zero(globals.log_dir)) {
+ globals.err_log_dir = strdup(globals.log_dir);
+ } else {
+ globals.err_log_dir = switch_mprintf("%s/xml_cdr", SWITCH_GLOBAL_dirs.log_dir);
+ }
+ }
}
}
if(globals.retries < 0) {