|
|
@ -59,8 +59,9 @@ static int load_config(int reload)
|
|
|
|
int newenablecdr = 0;
|
|
|
|
int newenablecdr = 0;
|
|
|
|
|
|
|
|
|
|
|
|
cfg = ast_config_load(CONF_FILE, config_flags);
|
|
|
|
cfg = ast_config_load(CONF_FILE, config_flags);
|
|
|
|
if (cfg == CONFIG_STATUS_FILEUNCHANGED)
|
|
|
|
if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (reload && customfields) {
|
|
|
|
if (reload && customfields) {
|
|
|
|
ast_free(customfields);
|
|
|
|
ast_free(customfields);
|
|
|
@ -73,7 +74,7 @@ static int load_config(int reload)
|
|
|
|
if (enablecdr)
|
|
|
|
if (enablecdr)
|
|
|
|
ast_cdr_unregister(name);
|
|
|
|
ast_cdr_unregister(name);
|
|
|
|
enablecdr = 0;
|
|
|
|
enablecdr = 0;
|
|
|
|
return 0;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
while ( (cat = ast_category_browse(cfg, cat)) ) {
|
|
|
|
while ( (cat = ast_category_browse(cfg, cat)) ) {
|
|
|
@ -112,7 +113,7 @@ static int load_config(int reload)
|
|
|
|
ast_cdr_register(name, "Asterisk Manager Interface CDR Backend", manager_log);
|
|
|
|
ast_cdr_register(name, "Asterisk Manager Interface CDR Backend", manager_log);
|
|
|
|
enablecdr = newenablecdr;
|
|
|
|
enablecdr = newenablecdr;
|
|
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int manager_log(struct ast_cdr *cdr)
|
|
|
|
static int manager_log(struct ast_cdr *cdr)
|
|
|
@ -185,9 +186,9 @@ static int unload_module(void)
|
|
|
|
|
|
|
|
|
|
|
|
static int load_module(void)
|
|
|
|
static int load_module(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/* Configuration file */
|
|
|
|
if (load_config(0)) {
|
|
|
|
if (!load_config(0))
|
|
|
|
|
|
|
|
return AST_MODULE_LOAD_DECLINE;
|
|
|
|
return AST_MODULE_LOAD_DECLINE;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return AST_MODULE_LOAD_SUCCESS;
|
|
|
|
return AST_MODULE_LOAD_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|