Index: res/res_musiconhold.c =================================================================== --- res/res_musiconhold.c (revision 344438) +++ res/res_musiconhold.c (working copy) @@ -1502,6 +1502,13 @@ return -1; } + if (ast_test_flag(global_flags, MOH_CACHERTCLASSES) && mohclass->realtime && !strcasecmp(mohclass->mode, "files")) { + if (!moh_scan_files(mohclass)) { + mohclass = mohclass_unref(mohclass, "unreffing potential mohclass (moh_scan_files failed)"); + return -1; + } + } + ast_manager_event(chan, EVENT_FLAG_CALL, "MusicOnHold", "State: Start\r\n" "Channel: %s\r\n"