summaryrefslogtreecommitdiff
path: root/channels/chan_h323.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2007-08-16 21:09:46 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2007-08-16 21:09:46 +0000
commit56b9568164b694a42e88f1f8a31012078b833203 (patch)
tree8fda811f62cb6ffb99847befb7b74b1519ea95ba /channels/chan_h323.c
parentc0060cd99a0a318b504da4c13eee85f3b9043fdc (diff)
Don't reload a configuration file if nothing has changed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_h323.c')
-rw-r--r--channels/chan_h323.c14
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;