diff --git a/apps/app_meetme.c b/apps/app_meetme.c index 6421f3b9899f3d677c2734411a02840656fe74ff..956f95c52b518cc68357fcea2eb0be1ba713eb83 100644 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -6093,19 +6093,6 @@ static void sla_check_reload(void) return; } - /* We need to actually delete the previous versions of trunks and stations now */ - AST_RWLIST_TRAVERSE_SAFE_BEGIN(&sla_stations, station, entry) { - AST_RWLIST_REMOVE_CURRENT(entry); - ast_free(station); - } - AST_RWLIST_TRAVERSE_SAFE_END; - - AST_RWLIST_TRAVERSE_SAFE_BEGIN(&sla_trunks, trunk, entry) { - AST_RWLIST_REMOVE_CURRENT(entry); - ast_free(trunk); - } - AST_RWLIST_TRAVERSE_SAFE_END; - /* yay */ sla_load_config(1); sla.reload = 0; @@ -7004,6 +6991,24 @@ static int sla_load_config(int reload) return 0; } + if (reload) { + struct sla_station *station; + struct sla_trunk *trunk; + + /* We need to actually delete the previous versions of trunks and stations now */ + AST_RWLIST_TRAVERSE_SAFE_BEGIN(&sla_stations, station, entry) { + AST_RWLIST_REMOVE_CURRENT(entry); + ast_free(station); + } + AST_RWLIST_TRAVERSE_SAFE_END; + + AST_RWLIST_TRAVERSE_SAFE_BEGIN(&sla_trunks, trunk, entry) { + AST_RWLIST_REMOVE_CURRENT(entry); + ast_free(trunk); + } + AST_RWLIST_TRAVERSE_SAFE_END; + } + if ((val = ast_variable_retrieve(cfg, "general", "attemptcallerid"))) sla.attempt_callerid = ast_true(val);