--- asterisk-1.4.22/main/asterisk.c 2008-07-26 17:31:21.000000000 +0200 +++ asterisk-1.4.22-patched/main/asterisk.c 2009-01-16 11:42:15.000000000 +0100 @@ -2437,6 +2437,7 @@ struct ast_config *cfg; struct ast_variable *v; char *config = AST_CONFIG_FILE; + unsigned int founddbdir = 0; if (ast_opt_override_config) { cfg = ast_config_load(ast_config_AST_CONFIG_FILE); @@ -2486,7 +2487,11 @@ snprintf(ast_config_AST_MONITOR_DIR, sizeof(ast_config_AST_MONITOR_DIR) - 1, "%s/monitor", v->value); } else if (!strcasecmp(v->name, "astvarlibdir")) { ast_copy_string(ast_config_AST_VAR_DIR, v->value, sizeof(ast_config_AST_VAR_DIR)); + if (!founddbdir) + snprintf(ast_config_AST_DB, sizeof(ast_config_AST_DB), "%s/astdb", v->value); + } else if (!strcasecmp(v->name, "astdbdir")) { snprintf(ast_config_AST_DB, sizeof(ast_config_AST_DB), "%s/astdb", v->value); + founddbdir = 1; } else if (!strcasecmp(v->name, "astdatadir")) { ast_copy_string(ast_config_AST_DATA_DIR, v->value, sizeof(ast_config_AST_DATA_DIR)); snprintf(ast_config_AST_KEY_DIR, sizeof(ast_config_AST_KEY_DIR), "%s/keys", v->value); --- asterisk-1.4.22/doc/asterisk-conf.txt 2008-08-13 22:33:47.000000000 +0200 +++ asterisk-1.4.22-patched/doc/asterisk-conf.txt 2009-01-16 11:36:31.000000000 +0100 @@ -20,6 +20,9 @@ ; Where additional 'library' elements (scripts, etc.) are located astvarlibdir => /var/lib/asterisk +; Where the astdb file should be located, defaults to astvarlibdir +astdbdir => /var/lib/asterisk + ; Where AGI scripts/programs are located astagidir => /var/lib/asterisk/agi-bin