diff --git a/daemon/media_player.c b/daemon/media_player.c index ac3a3c38e..a66367151 100644 --- a/daemon/media_player.c +++ b/daemon/media_player.c @@ -1497,7 +1497,7 @@ bool call_ml_stops_moh(struct call_monologue *from_ml, struct call_monologue *to enum ng_opmode opmode) { #ifdef WITH_TRANSCODING - if (opmode == OP_OFFER && !call_ml_sendonly_inactive(from_ml) && (to_ml->player && to_ml->player->moh)) + if (opmode == OP_OFFER && !call_ml_sendonly_inactive(from_ml) && (to_ml->player && to_ml->player->opts.moh)) { return true; } @@ -1577,7 +1577,7 @@ const char * call_check_moh(struct call_monologue *from_ml, struct call_monologu if (errstr) return errstr; /* mark player as used for MoH */ - to_ml->player->moh = true; + to_ml->player->opts.moh = true; /* handle MoH related flags */ call_ml_moh_handle_flags(from_ml, to_ml); @@ -1588,7 +1588,7 @@ const char * call_check_moh(struct call_monologue *from_ml, struct call_monologu /* whom to stop the moh audio */ call_stop_media_for_ml(to_ml); /* mark MoH as already not used (it can be unset now) */ - to_ml->player->moh = false; + to_ml->player->opts.moh = false; ilog(LOG_DEBUG, "Music on hold stopped with coming SDP offer."); } diff --git a/daemon/sdp.c b/daemon/sdp.c index 08160b965..d7b23f38f 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -2837,7 +2837,7 @@ static void sdp_out_add_other(GString *out, struct call_monologue *monologue, if (flags->loop_protect) append_attr_to_gstring(out, "rtpengine", &rtpe_instance_id, flags, media->type_id); #ifdef WITH_TRANSCODING - if (monologue->player && monologue->player->moh && rtpe_config.moh_attr_name) { + if (monologue->player && monologue->player->opts.moh && rtpe_config.moh_attr_name) { append_attr_to_gstring(out, rtpe_config.moh_attr_name, NULL, flags, media->type_id); } #endif diff --git a/include/media_player.h b/include/media_player.h index 1269fbd1c..9a9e76136 100644 --- a/include/media_player.h +++ b/include/media_player.h @@ -26,6 +26,7 @@ typedef struct { unsigned int block_egress:1; str file, blob; long long db_id; + bool moh; } media_player_opts_t; @@ -86,7 +87,6 @@ struct media_player { unsigned long sync_ts; struct timeval sync_ts_tv; long long last_frame_ts; - bool moh; }; INLINE void media_player_put(struct media_player **mp) {