After some discussions, we decided that the return values here were a bit messy.
This also fixes a bug on reload, where peers may not have reregistered properly. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
22436131f7
commit
6a90ea5cf4
|
@ -10007,7 +10007,7 @@ static int set_config(char *config_file, int reload)
|
||||||
} else if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
|
} else if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
|
||||||
ucfg = ast_config_load("users.conf", config_flags);
|
ucfg = ast_config_load("users.conf", config_flags);
|
||||||
if (ucfg == CONFIG_STATUS_FILEUNCHANGED)
|
if (ucfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||||
return 1;
|
return 0;
|
||||||
/* Otherwise we need to reread both files */
|
/* Otherwise we need to reread both files */
|
||||||
ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED);
|
ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED);
|
||||||
cfg = ast_config_load(config_file, config_flags);
|
cfg = ast_config_load(config_file, config_flags);
|
||||||
|
@ -10365,7 +10365,7 @@ static int set_config(char *config_file, int reload)
|
||||||
}
|
}
|
||||||
ast_config_destroy(cfg);
|
ast_config_destroy(cfg);
|
||||||
set_timing();
|
set_timing();
|
||||||
return capability;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int reload_config(void)
|
static int reload_config(void)
|
||||||
|
@ -10373,7 +10373,7 @@ static int reload_config(void)
|
||||||
char *config = "iax.conf";
|
char *config = "iax.conf";
|
||||||
struct iax2_registry *reg;
|
struct iax2_registry *reg;
|
||||||
|
|
||||||
if (set_config(config, 1) == 1) {
|
if (set_config(config, 1) > 0) {
|
||||||
prune_peers();
|
prune_peers();
|
||||||
prune_users();
|
prune_users();
|
||||||
trunk_timed = trunk_untimed = 0;
|
trunk_timed = trunk_untimed = 0;
|
||||||
|
|
Loading…
Reference in New Issue