aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/res_musiconhold.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index c0076209a..1eb8d10df 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -362,14 +362,10 @@ static void moh_handle_digit(struct ast_channel *chan, char digit)
if ((class = get_mohbydigit(digit))) {
classname = ast_strdupa(class->name);
class = mohclass_unref(class);
+ ast_string_field_set(chan,musicclass,classname);
+ ast_moh_stop(chan);
+ ast_moh_start(chan, classname, NULL);
}
-
- if (!class) {
- return;
- }
-
- ast_moh_stop(chan);
- ast_moh_start(chan, classname, NULL);
}
static struct ast_generator moh_file_stream =