#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);
}
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);
#include "asterisk/threadstorage.h"
#include "asterisk/strings.h"
-#define CUSTOM_LOG_DIR "/cel_custom"
-#define CONFIG "cel_custom.conf"
+#define CONFIG "cel_custom.conf"
AST_THREADSTORAGE(custom_buf);
; in /var/log/asterisk). Depending on which mapping you uncomment, you may see
; Master.csv, Simple.csv, or both.
;
+; Alternatively, you can also specify the location of your CSV file using an
+; absolute path, e.g.:
+;
+; /srv/pbx/cdr/Master.csv => ${CSV_QUOTE(${CDR(clid)})},...
+;
;[mappings]
;Master.csv => ${CSV_QUOTE(${CDR(clid)})},${CSV_QUOTE(${CDR(src)})},${CSV_QUOTE(${CDR(dst)})},${CSV_QUOTE(${CDR(dcontext)})},${CSV_QUOTE(${CDR(channel)})},${CSV_QUOTE(${CDR(dstchannel)})},${CSV_QUOTE(${CDR(lastapp)})},${CSV_QUOTE(${CDR(lastdata)})},${CSV_QUOTE(${CDR(start)})},${CSV_QUOTE(${CDR(answer)})},${CSV_QUOTE(${CDR(end)})},${CSV_QUOTE(${CDR(duration)})},${CSV_QUOTE(${CDR(billsec)})},${CSV_QUOTE(${CDR(disposition)})},${CSV_QUOTE(${CDR(amaflags)})},${CSV_QUOTE(${CDR(accountcode)})},${CSV_QUOTE(${CDR(uniqueid)})},${CSV_QUOTE(${CDR(userfield)})},${CDR(sequence)}
;
; You can also create more than one template if desired. All logs will appear
; in the cel-custom directory under your Asterisk logs directory.
;
+; Alternatively, you can also specify the location of your CSV file using an
+; absolute path, e.g.:
+;
+; /srv/pbx/cel/Master.csv => ${CSV_QUOTE(${eventtype})},...
+;
;
; Within a mapping, use the CALLERID() and CHANNEL() functions to retrieve