[asterisk-commits] tilghman: trunk r272332 - /trunk/res/res_musiconhold.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 23 16:53:53 CDT 2010


Author: tilghman
Date: Wed Jun 23 16:53:49 2010
New Revision: 272332

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=272332
Log:
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

Modified:
    trunk/res/res_musiconhold.c

Modified: trunk/res/res_musiconhold.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_musiconhold.c?view=diff&rev=272332&r1=272331&r2=272332
==============================================================================
--- trunk/res/res_musiconhold.c (original)
+++ trunk/res/res_musiconhold.c Wed Jun 23 16:53:49 2010
@@ -1605,6 +1605,10 @@
 	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;
 	}
 
@@ -1827,7 +1831,7 @@
 		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 {




More information about the asterisk-commits mailing list