diff --git a/include/asterisk/musiconhold.h b/include/asterisk/musiconhold.h index 46cdc1f04a..03cf30555b 100644 --- a/include/asterisk/musiconhold.h +++ b/include/asterisk/musiconhold.h @@ -51,7 +51,15 @@ void ast_install_music_functions(int (*start_ptr)(struct ast_channel *, const ch void ast_uninstall_music_functions(void); -void ast_moh_cleanup(struct ast_channel *chan); +/*! + * \brief Clean up music on hold state on a given channel + * + * \param chan The channel where music on hold was configured. + * + * \deprecated This function no longer does anything but is kept for + * backwards compatibility. + */ +void ast_moh_cleanup(struct ast_channel *chan) attribute_deprecated; #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/main/channel.c b/main/channel.c index c70cc0d4a5..645164146c 100644 --- a/main/channel.c +++ b/main/channel.c @@ -2207,6 +2207,8 @@ void ast_party_redirecting_free(struct ast_party_redirecting *doomed) ast_party_redirecting_reason_free(&doomed->orig_reason); } +static void moh_cleanup(struct ast_channel *chan); + /*! \brief Free a channel structure */ static void ast_channel_destructor(void *obj) { @@ -2222,7 +2224,7 @@ static void ast_channel_destructor(void *obj) /* If there is native format music-on-hold state, free it */ if (ast_channel_music_state(chan)) { - ast_moh_cleanup(chan); + moh_cleanup(chan); } ast_pbx_hangup_handler_destroy(chan); @@ -7791,6 +7793,11 @@ void ast_moh_stop(struct ast_channel *chan) } void ast_moh_cleanup(struct ast_channel *chan) +{ + /* A nop but needed for API compat */ +} + +static void moh_cleanup(struct ast_channel *chan) { if (ast_moh_cleanup_ptr) ast_moh_cleanup_ptr(chan);