From: Michael Jerris Date: Mon, 4 May 2015 15:46:30 +0000 (-0400) Subject: FS-7523: [mod_json_cdr] don't bind events before we configure the module X-Git-Tag: v1.4.19~6^2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7382cecf8c30d6bb05f3fc7a41d86ecf95855262;p=thirdparty%2Ffreeswitch.git FS-7523: [mod_json_cdr] don't bind events before we configure the module --- diff --git a/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c b/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c index 098bd52a0e..5eacd6eacb 100644 --- a/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c +++ b/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c @@ -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; }