]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Prevent SLA settings from getting wiped out on reload
authorKinsey Moore <kmoore@digium.com>
Mon, 9 Jan 2012 15:37:12 +0000 (15:37 +0000)
committerKinsey Moore <kmoore@digium.com>
Mon, 9 Jan 2012 15:37:12 +0000 (15:37 +0000)
If SLA was reloaded without the config file being changed, current settings got
wiped out before the SLA reload code decided it wasn't going to reload the file
since nothing was changed.  Moving the settings reset later in the reload
process fixes this.

(closes issue AST-744)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350023 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_meetme.c

index edbc87f6e34cd3ce4b98c982ad0750e39d12864e..f1f259713ecea9310518c77d8508323eed589808 100644 (file)
@@ -5910,19 +5910,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;
@@ -6821,6 +6808,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);