mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 03:50:31 +00:00
Permit custom locations for astdb and the keys directory (though default to the current locations) (Closes issue #10267)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
7
Makefile
7
Makefile
@@ -108,6 +108,8 @@ ifeq ($(OSARCH),SunOS)
|
||||
ASTETCDIR=/var/etc/asterisk
|
||||
ASTLIBDIR=/opt/asterisk/lib
|
||||
ASTVARLIBDIR=/var/opt/asterisk
|
||||
ASTDBDIR=$(ASTVARLIBDIR)
|
||||
ASTKEYDIR=$(ASTVARLIBDIR)
|
||||
ASTSPOOLDIR=/var/spool/asterisk
|
||||
ASTLOGDIR=/var/log/asterisk
|
||||
ASTHEADERDIR=/opt/asterisk/include
|
||||
@@ -128,9 +130,12 @@ else
|
||||
ifneq ($(findstring BSD,$(OSARCH)),)
|
||||
ASTVARLIBDIR=$(prefix)/share/asterisk
|
||||
ASTVARRUNDIR=$(localstatedir)/run/asterisk
|
||||
ASTDBDIR=$(localstatedir)/db/asterisk
|
||||
else
|
||||
ASTVARLIBDIR=$(localstatedir)/lib/asterisk
|
||||
ASTDBDIR=$(ASTVARLIBDIR)
|
||||
endif
|
||||
ASTKEYDIR=$(ASTVARLIBDIR)
|
||||
endif
|
||||
ifeq ($(ASTDATADIR),)
|
||||
ASTDATADIR:=$(ASTVARLIBDIR)
|
||||
@@ -556,6 +561,8 @@ samples: adsi
|
||||
echo "astetcdir => $(ASTETCDIR)" ; \
|
||||
echo "astmoddir => $(MODULES_DIR)" ; \
|
||||
echo "astvarlibdir => $(ASTVARLIBDIR)" ; \
|
||||
echo "astdbdir => $(ASTDBDIR)" ; \
|
||||
echo "astkeydir => $(ASTKEYDIR)" ; \
|
||||
echo "astdatadir => $(ASTDATADIR)" ; \
|
||||
echo "astagidir => $(AGI_DIR)" ; \
|
||||
echo "astspooldir => $(ASTSPOOLDIR)" ; \
|
||||
|
@@ -2301,6 +2301,10 @@ static void ast_readconfig(void)
|
||||
char *config = AST_CONFIG_FILE;
|
||||
char hostname[MAXHOSTNAMELEN] = "";
|
||||
struct ast_flags config_flags = { 0 };
|
||||
struct {
|
||||
unsigned int dbdir:1;
|
||||
unsigned int keydir:1;
|
||||
} found = { 0, 0 };
|
||||
|
||||
if (ast_opt_override_config) {
|
||||
cfg = ast_config_load(ast_config_AST_CONFIG_FILE, config_flags);
|
||||
@@ -2348,10 +2352,18 @@ static void ast_readconfig(void)
|
||||
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 (!found.dbdir)
|
||||
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);
|
||||
found.dbdir = 1;
|
||||
} else if (!strcasecmp(v->name, "astdatadir")) {
|
||||
ast_copy_string(ast_config_AST_DATA_DIR, v->value, sizeof(ast_config_AST_DATA_DIR));
|
||||
if (!found.keydir)
|
||||
snprintf(ast_config_AST_KEY_DIR, sizeof(ast_config_AST_KEY_DIR), "%s/keys", v->value);
|
||||
} else if (!strcasecmp(v->name, "astkeydir")) {
|
||||
snprintf(ast_config_AST_KEY_DIR, sizeof(ast_config_AST_KEY_DIR), "%s/keys", v->value);
|
||||
found.keydir = 1;
|
||||
} else if (!strcasecmp(v->name, "astlogdir")) {
|
||||
ast_copy_string(ast_config_AST_LOG_DIR, v->value, sizeof(ast_config_AST_LOG_DIR));
|
||||
} else if (!strcasecmp(v->name, "astagidir")) {
|
||||
|
Reference in New Issue
Block a user