res_mixmonitor: MixMonitorMute by MixMonitor ID

While it is possible to create multiple mixmonitor instances
on a channel, it was not previously possible to mute individual
instances.

This change includes the ability to specify the MixMonitorID
when calling the manager action: MixMonitorMute.  This will
allow an individual MixMonitor instance to be muted via id.
This id can be stored as a channel variable using the 'i'
MixMonitor option.

As part of this change, if no MixMonitorID is specified in
the manager action MixMonitorMute, Asterisk will set the mute
flag on all MixMonitor spy-type audiohooks on the channel.
This is done via the new audiohook function:
ast_audiohook_set_mute_all.

ASTERISK-30464

Change-Id: Ibba8c7e750577aa1595a24b23316ef445245be98
This commit is contained in:
Mike Bradeen
2023-03-13 13:27:06 -06:00
committed by Friendly Automation
parent 8d2ffc8aa5
commit fa635a872e
4 changed files with 123 additions and 8 deletions

View File

@@ -358,6 +358,16 @@ int ast_audiohook_volume_adjust(struct ast_channel *chan, enum ast_audiohook_dir
*/
int ast_audiohook_set_mute(struct ast_channel *chan, const char *source, enum ast_audiohook_flags flag, int clear);
/*! \brief Mute frames read from or written for all audiohooks on a channel
* \param chan Channel to muck with
* \param source Type of audiohooks
* \param flag which direction to set / clear
* \param clear set or clear muted frames on direction based on flag parameter
* \retval >=0 number of muted audiohooks
* \retval -1 failure
*/
int ast_audiohook_set_mute_all(struct ast_channel *chan, const char *source, enum ast_audiohook_flags flag, int clear);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif