Index: res/res_musiconhold.c =================================================================== --- res/res_musiconhold.c (revision 79575) +++ res/res_musiconhold.c (working copy) @@ -1129,14 +1129,23 @@ } } -static int moh_cli(int fd, int argc, char *argv[]) +static int moh_reload(void) { int x; moh_on_off(0); ast_moh_destroy(); - x = load_moh_classes(1); + if ((x = load_moh_classes(1))) + ast_install_music_functions(local_ast_moh_start, local_ast_moh_stop, local_ast_moh_cleanup); moh_on_off(1); + + return x; +} + +static int moh_cli(int fd, int argc, char *argv[]) +{ + int x = moh_reload(); + ast_cli(fd, "\n%d class%s reloaded.\n", x, x == 1 ? "" : "es"); return 0; } @@ -1239,8 +1248,7 @@ static int reload(void) { - if (init_classes(1)) - ast_install_music_functions(local_ast_moh_start, local_ast_moh_stop, local_ast_moh_cleanup); + moh_reload(); return 0; }