]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODEVENT-44
authorMichael Jerris <mike@jerris.com>
Thu, 25 Jun 2009 23:21:33 +0000 (23:21 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 25 Jun 2009 23:21:33 +0000 (23:21 +0000)
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

index 24bb2b28cabaef49857714a4a040f569d9736dd1..c56b44f8f797cf1f1e886d847a275414304f1a53 100644 (file)
@@ -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")) {\r
+                                       globals.masterfileonly = switch_true(val);\r
                                }
                        }
                }