]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 272332 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 23 Jun 2010 21:54:59 +0000 (21:54 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 23 Jun 2010 21:54:59 +0000 (21:54 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

........
  r272332 | tilghman | 2010-06-23 16:53:49 -0500 (Wed, 23 Jun 2010) | 8 lines

  If there is realtime configuration, it does not get re-read on reload unless the config file also changes.

  (closes issue #16982)
   Reported by: dmitri
   Patches:
         res_musiconhold.patch uploaded by dmitri (license 1001)
   Tested by: atis
........

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

res/res_musiconhold.c

index 1599b26f6f5171a52682e44bcbc64b5d77e769a0..ed2cdc1b0538c9d8bdbabf4707c992fc5f78bb52 100644 (file)
@@ -1577,6 +1577,10 @@ 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 (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");
+               }
                return 0;
        }
 
@@ -1799,7 +1803,7 @@ static int load_module(void)
                return AST_MODULE_LOAD_DECLINE;
        }
 
-       if (!load_moh_classes(0)) {     /* No music classes configured, so skip it */
+       if (!load_moh_classes(0) && ast_check_realtime("musiconhold") == 0) {   /* No music classes configured, so skip it */
                ast_log(LOG_WARNING, "No music on hold classes configured, "
                                "disabling music on hold.\n");
        } else {