aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_adsi.c
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-01 01:37:50 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-01 01:37:50 +0000
commit02481047df7b3cf29bfa4a56e2b730e4eb47e464 (patch)
tree27dc85e87dffe26384d95a08caa718255738c795 /res/res_adsi.c
parenta7c0447e636acec7aae62d8e86c490ccee1d678f (diff)
Only reload if the config file has changed.
Closes issue #11281, patch by eliel. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@90410 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_adsi.c')
-rw-r--r--res/res_adsi.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/res/res_adsi.c b/res/res_adsi.c
index 149381a0c..2df5324aa 100644
--- a/res/res_adsi.c
+++ b/res/res_adsi.c
@@ -1012,18 +1012,19 @@ static void init_state(void)
alignment = ADSI_JUST_CENT;
}
-static void adsi_load(void)
+static void adsi_load(int reload)
{
int x = 0;
struct ast_config *conf = NULL;
struct ast_variable *v;
- struct ast_flags config_flags = { 0 };
+ struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
char *name, *sname;
init_state();
if (!(conf = ast_config_load("adsi.conf", config_flags)))
return;
-
+ else if (conf == CONFIG_STATUS_FILEUNCHANGED)
+ return;
for (v = ast_variable_browse(conf, "intro"); v; v = v->next) {
if (!strcasecmp(v->name, "alignment"))
alignment = str2align(v->value);
@@ -1066,13 +1067,13 @@ static void adsi_load(void)
static int reload(void)
{
- adsi_load();
+ adsi_load(1);
return 0;
}
static int load_module(void)
{
- adsi_load();
+ adsi_load(0);
ast_adsi_begin_download = _ast_adsi_begin_download;
ast_adsi_end_download = _ast_adsi_end_download;