summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/channel.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index a9f0fbb34..da4f794df 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -6406,6 +6406,7 @@ static void channel_do_masquerade(struct ast_channel *original, struct ast_chann
unsigned int clone_disablestatecache;
int visible_indication;
int clone_hold_state;
+ int moh_is_playing;
struct ast_frame *current;
const struct ast_channel_tech *t;
void *t_pvt;
@@ -6452,6 +6453,8 @@ static void channel_do_masquerade(struct ast_channel *original, struct ast_chann
ao2_unlink(channels, original);
ao2_unlink(channels, clonechan);
+ moh_is_playing = ast_test_flag(ast_channel_flags(original), AST_FLAG_MOH);
+
/*
* Stop any visible indication on the original channel so we can
* transfer it to the clonechan taking the original's place.
@@ -6753,6 +6756,12 @@ static void channel_do_masquerade(struct ast_channel *original, struct ast_chann
}
}
+ /* if moh is playing on the original channel then it needs to be
+ maintained on the channel that is replacing it. */
+ if (moh_is_playing) {
+ ast_moh_start(original, NULL, NULL);
+ }
+
ast_channel_lock(original);
/* Signal any blocker */