]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7523: [mod_json_cdr] don't bind events before we configure the module
authorMichael Jerris <mike@jerris.com>
Mon, 4 May 2015 15:46:30 +0000 (11:46 -0400)
committerMichael Jerris <mike@jerris.com>
Mon, 4 May 2015 15:46:30 +0000 (11:46 -0400)
src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c

index 098bd52a0e7b512921bcf4fd0f2859a06dc9fbb4..5eacd6eacbe3cae7e4006530bd993018b2e8a700 100644 (file)
@@ -579,11 +579,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_json_cdr_load)
 
        memset(&globals, 0, sizeof(globals));
 
-       if (switch_event_bind_removable(modname, SWITCH_EVENT_TRAP, SWITCH_EVENT_SUBCLASS_ANY, event_handler, NULL, &globals.node) != SWITCH_STATUS_SUCCESS) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
-               return SWITCH_STATUS_GENERR;
-       }
-
        globals.log_http_and_disk = 0;
        globals.log_errors_to_disk = SWITCH_TRUE;
        globals.log_b = 1;
@@ -726,6 +721,11 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_json_cdr_load)
 
        set_json_cdr_log_dirs();
 
+       if (switch_event_bind_removable(modname, SWITCH_EVENT_TRAP, SWITCH_EVENT_SUBCLASS_ANY, event_handler, NULL, &globals.node) != SWITCH_STATUS_SUCCESS) {
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
+               return SWITCH_STATUS_GENERR;
+       }
+
        switch_xml_free(xml);
        return status;
 }