Merged revisions 325821 via svnmerge from
authorJonathan Rose <jrose@digium.com>
Thu, 30 Jun 2011 19:31:51 +0000 (19:31 +0000)
committerJonathan Rose <jrose@digium.com>
Thu, 30 Jun 2011 19:31:51 +0000 (19:31 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r325821 | jrose | 2011-06-30 14:17:32 -0500 (Thu, 30 Jun 2011) | 10 lines

  Fixes an issue with Music on Hold classes losing files in playlist when realtime is used.

  The bug occurs rather intermittently and I relied on the reporters to test the patch.
  After a sanity check and some testing, I'm giving it an OK.

  (closes issue ASTERISK-17875)
  Reported by: David Cunningham
  Patches:
        res_musiconhold.c.mohrt17875_v1 uploaded by Igor Goncharovsky (license #5009)
........

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

res/res_musiconhold.c

index 7ed5955..cc98543 100644 (file)
@@ -1652,14 +1652,15 @@ static int load_moh_classes(int reload)
 
        cfg = ast_config_load("musiconhold.conf", config_flags);
 
-       if (cfg == CONFIG_STATUS_FILEMISSING || cfg == CONFIG_STATUS_FILEUNCHANGED || cfg == CONFIG_STATUS_FILEINVALID) {
+       if (cfg == CONFIG_STATUS_FILEMISSING || cfg == CONFIG_STATUS_FILEINVALID) {
                if (ast_check_realtime("musiconhold") && reload) {
                        ao2_t_callback(mohclasses, OBJ_NODATA, moh_class_mark, NULL, "Mark deleted classes");
                        ao2_t_callback(mohclasses, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, moh_classes_delete_marked, NULL, "Purge marked classes");
                }
-               if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
-                       moh_rescan_files();
-               }
+               return 0;
+       }
+       if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
+               moh_rescan_files();
                return 0;
        }