From 4b14597b4c77e7f327754cb8fa6b9a134d45dfd3 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 25 Jun 2009 23:21:33 +0000 Subject: [PATCH] MODEVENT-44 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13968 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c b/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c index 24bb2b28ca..c56b44f8f7 100644 --- a/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c +++ b/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c @@ -52,6 +52,7 @@ static struct { switch_hash_t *template_hash; char *log_dir; char *default_template; + int masterfileonly; int shutdown; int rotate; int debug; @@ -226,7 +227,7 @@ static switch_status_t my_on_reporting(switch_core_session_t *session) log_line = switch_channel_expand_variables(channel, a_template_str); - if (accountcode) { + if ((accountcode) && (!globals.masterfileonly)) { path = switch_mprintf("%s%s%s.csv", log_dir, SWITCH_PATH_SEPARATOR, accountcode); assert(path); write_cdr(path, log_line); @@ -338,6 +339,8 @@ static switch_status_t load_config(switch_memory_pool_t *pool) globals.rotate = switch_true(val); } else if (!strcasecmp(var, "default-template")) { globals.default_template = switch_core_strdup(pool, val); + } else if (!strcasecmp(var, "master-file-only")) { + globals.masterfileonly = switch_true(val); } } }