diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-16 21:09:46 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-16 21:09:46 +0000 |
commit | dbec3d56c146801fad339a1d46a388865b18ffb4 (patch) | |
tree | 8fda811f62cb6ffb99847befb7b74b1519ea95ba /channels/chan_h323.c | |
parent | 0fb9c73a989207650aa3ba603824e4593809611b (diff) |
Don't reload a configuration file if nothing has changed.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79747 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_h323.c')
-rw-r--r-- | channels/chan_h323.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/channels/chan_h323.c b/channels/chan_h323.c index 36f42e878..6da113ddb 100644 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -2812,13 +2812,23 @@ static int reload_config(int is_reload) int is_user, is_peer, is_alias; char _gatekeeper[100]; int gk_discover, gk_disable, gk_changed; + struct ast_flags config_flags = { is_reload ? CONFIG_FLAG_FILEUNCHANGED : 0 }; - cfg = ast_config_load(config); + cfg = ast_config_load(config, config_flags); /* We *must* have a config file otherwise stop immediately */ if (!cfg) { ast_log(LOG_NOTICE, "Unable to load config %s, H.323 disabled\n", config); return 1; + } else if (cfg == CONFIG_STATUS_FILEUNCHANGED) { + ucfg = ast_config_load("users.conf", config_flags); + if (ucfg == CONFIG_STATUS_FILEUNCHANGED) + return 0; + ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED); + cfg = ast_config_load(config, config_flags); + } else { + ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED); + ucfg = ast_config_load("users.conf", config_flags); } /* fire up the H.323 Endpoint */ @@ -2851,8 +2861,6 @@ static int reload_config(int is_reload) /* Copy the default jb config over global_jbconf */ memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf)); - /* Load configuration from users.conf */ - ucfg = ast_config_load("users.conf"); if (ucfg) { struct ast_variable *gen; int genhas_h323; |