diff options
author | Jason Parker <jparker@digium.com> | 2010-09-08 20:32:49 +0000 |
---|---|---|
committer | Jason Parker <jparker@digium.com> | 2010-09-08 20:32:49 +0000 |
commit | d077b0f081817909a8ec16292cfa83a6e4ada258 (patch) | |
tree | be05bcb9fecb1079688163fa5a98887fe691049d /res | |
parent | 1c12ca0407e7e94de05de3faf3ff6ff5a7977ba5 (diff) |
Merged revisions 285527 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
................
r285527 | qwell | 2010-09-08 15:32:13 -0500 (Wed, 08 Sep 2010) | 15 lines
Merged revisions 285526 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2
........
r285526 | qwell | 2010-09-08 15:31:43 -0500 (Wed, 08 Sep 2010) | 8 lines
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
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@285528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r-- | res/res_musiconhold.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index c52477ca2..a54becc4b 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -1114,6 +1114,19 @@ static int init_files_class(struct mohclass *class) 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) { @@ -1607,6 +1620,9 @@ static int load_moh_classes(int 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; } |