[asterisk-commits] qwell: branch 1.6.2 r285526 - /branches/1.6.2/res/res_musiconhold.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 8 15:31:48 CDT 2010


Author: qwell
Date: Wed Sep  8 15:31:43 2010
New Revision: 285526

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=285526
Log:
Fixes issue where moh files were no longer rescanned during a reload.

(closes issue #16744)
Reported by: pj
Patches: 
      16744-reload.diff uploaded by qwell (license 4)
Tested by: qwell

Modified:
    branches/1.6.2/res/res_musiconhold.c

Modified: branches/1.6.2/res/res_musiconhold.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/res/res_musiconhold.c?view=diff&rev=285526&r1=285525&r2=285526
==============================================================================
--- branches/1.6.2/res/res_musiconhold.c (original)
+++ branches/1.6.2/res/res_musiconhold.c Wed Sep  8 15:31:43 2010
@@ -1081,6 +1081,19 @@
 	return 0;
 }
 
+static void moh_rescan_files(void) {
+	struct ao2_iterator i;
+	struct mohclass *c;
+
+	i = ao2_iterator_init(mohclasses, 0);
+
+	while ( (c = ao2_iterator_next(&i)) ) {
+		moh_scan_files(c);
+		ao2_ref(c, -1);
+	}
+
+	ao2_iterator_destroy(&i);
+}
 
 static int moh_diff(struct mohclass *old, struct mohclass *new)
 {
@@ -1584,6 +1597,9 @@
 			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;
 	}
 




More information about the asterisk-commits mailing list