[asterisk-commits] wdoekes: trunk r398197 - in /trunk: ./ cel/cel_custom.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Sep 3 09:29:57 CDT 2013
Author: wdoekes
Date: Tue Sep 3 09:29:52 2013
New Revision: 398197
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=398197
Log:
Be a little more verbose when loading cel_custom.conf.
Review: https://reviewboard.asterisk.org/r/2805/
........
Merged revisions 398167 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 398168 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 398196 from http://svn.asterisk.org/svn/asterisk/branches/12
Modified:
trunk/ (props changed)
trunk/cel/cel_custom.c
Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Tue Sep 3 09:29:52 2013
@@ -1,1 +1,1 @@
-/branches/12:1-398149
+/branches/12:1-398149,398196
Modified: trunk/cel/cel_custom.c
URL: http://svnview.digium.com/svn/asterisk/trunk/cel/cel_custom.c?view=diff&rev=398197&r1=398196&r2=398197
==============================================================================
--- trunk/cel/cel_custom.c (original)
+++ trunk/cel/cel_custom.c Tue Sep 3 09:29:52 2013
@@ -82,6 +82,7 @@
struct ast_config *cfg;
struct ast_variable *var;
struct ast_flags config_flags = { 0 };
+ int mappings = 0;
int res = 0;
cfg = ast_config_load(CONFIG, config_flags);
@@ -90,7 +91,10 @@
return -1;
}
- var = ast_variable_browse(cfg, "mappings");
+ if (!(var = ast_variable_browse(cfg, "mappings"))) {
+ ast_log(LOG_NOTICE, "No mappings found in " CONFIG ". Not logging CEL to custom CSVs.\n");
+ }
+
while (var) {
if (!ast_strlen_zero(var->name) && !ast_strlen_zero(var->value)) {
struct cel_config *sink = ast_calloc_with_stringfields(1, struct cel_config, 1024);
@@ -105,6 +109,8 @@
ast_string_field_build(sink, filename, "%s/%s/%s", ast_config_AST_LOG_DIR, name, var->name);
ast_mutex_init(&sink->lock);
+ ast_verb(3, "Added CEL CSV mapping for '%s'.\n", sink->filename);
+ mappings += 1;
AST_RWLIST_INSERT_TAIL(&sinks, sink, list);
} else {
ast_log(LOG_NOTICE, "Mapping must have both a filename and a format at line %d\n", var->lineno);
@@ -112,6 +118,8 @@
var = var->next;
}
ast_config_destroy(cfg);
+
+ ast_verb(1, "Added CEL CSV mapping for %d files.\n", mappings);
return res;
}
More information about the asterisk-commits
mailing list