mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
cdr_custom: Allow absolute filenames.
A follow up to #893 that brings the same functionality to cdr_custom. Also update the sample configuration files to note support for absolute paths.
This commit is contained in:
@@ -58,8 +58,7 @@
|
||||
#include "asterisk/threadstorage.h"
|
||||
#include "asterisk/strings.h"
|
||||
|
||||
#define CUSTOM_LOG_DIR "/cdr_custom"
|
||||
#define CONFIG "cdr_custom.conf"
|
||||
#define CONFIG "cdr_custom.conf"
|
||||
|
||||
AST_THREADSTORAGE(custom_buf);
|
||||
|
||||
@@ -112,7 +111,11 @@ static int load_config(void)
|
||||
}
|
||||
|
||||
ast_string_field_build(sink, format, "%s\n", var->value);
|
||||
ast_string_field_build(sink, filename, "%s/%s/%s", ast_config_AST_LOG_DIR, name, var->name);
|
||||
if (var->name[0] == '/') {
|
||||
ast_string_field_build(sink, filename, "%s", var->name);
|
||||
} else {
|
||||
ast_string_field_build(sink, filename, "%s/%s/%s", ast_config_AST_LOG_DIR, name, var->name);
|
||||
}
|
||||
ast_mutex_init(&sink->lock);
|
||||
|
||||
AST_RWLIST_INSERT_TAIL(&sinks, sink, list);
|
||||
|
Reference in New Issue
Block a user