res_monitor: Remove deprecated module.

ASTERISK-30303

Change-Id: I0462caefb4f9544e2e2baa23c498858310b52d50
This commit is contained in:
Mike Bradeen
2022-11-18 18:24:38 -07:00
committed by George Joseph
parent cbaba132a7
commit 6b03d60c7d
36 changed files with 50 additions and 1720 deletions

View File

@@ -3,7 +3,6 @@
*ast_agi_*;
*ast_beep_*;
*ast_smdi_*;
*ast_monitor_*;
*ast_key_get;
*ast_check_signature;
*ast_check_signature_bin;

View File

@@ -414,7 +414,6 @@ static int setup_bridge_features_builtin(struct ast_bridge_features *features, s
res |= builtin_features_helper(features, chan, flags, AST_FEATURE_REDIRECT, "atxfer", AST_BRIDGE_BUILTIN_ATTENDEDTRANSFER);
res |= builtin_features_helper(features, chan, flags, AST_FEATURE_DISCONNECT, "disconnect", AST_BRIDGE_BUILTIN_HANGUP);
res |= builtin_features_helper(features, chan, flags, AST_FEATURE_PARKCALL, "parkcall", AST_BRIDGE_BUILTIN_PARKCALL);
res |= builtin_features_helper(features, chan, flags, AST_FEATURE_AUTOMON, "automon", AST_BRIDGE_BUILTIN_AUTOMON);
res |= builtin_features_helper(features, chan, flags, AST_FEATURE_AUTOMIXMON, "automixmon", AST_BRIDGE_BUILTIN_AUTOMIXMON);
return res ? -1 : 0;

View File

@@ -1626,8 +1626,6 @@ static void testsuite_notify_feature_success(struct ast_channel *chan, const cha
feature = "atxfer";
} else if (!strcmp(dtmf, featuremap->disconnect)) {
feature = "disconnect";
} else if (!strcmp(dtmf, featuremap->automon)) {
feature = "automon";
} else if (!strcmp(dtmf, featuremap->automixmon)) {
feature = "automixmon";
} else if (!strcmp(dtmf, featuremap->parkcall)) {

View File

@@ -2195,11 +2195,6 @@ static void ast_channel_destructor(void *obj)
ast_debug(1, "Channel %p '%s' destroying\n", chan, ast_channel_name(chan));
/* Stop monitoring */
if (ast_channel_monitor(chan)) {
ast_channel_monitor(chan)->stop(chan, 0);
}
/* If there is native format music-on-hold state, free it */
if (ast_channel_music_state(chan)) {
ast_moh_cleanup(chan);
@@ -2516,15 +2511,13 @@ void ast_set_hangupsource(struct ast_channel *chan, const char *source, int forc
int ast_channel_has_audio_frame_or_monitor(struct ast_channel *chan)
{
return ast_channel_monitor(chan)
|| !ast_audiohook_write_list_empty(ast_channel_audiohooks(chan))
return !ast_audiohook_write_list_empty(ast_channel_audiohooks(chan))
|| !ast_framehook_list_contains_no_active(ast_channel_framehooks(chan));
}
int ast_channel_has_hook_requiring_audio(struct ast_channel *chan)
{
return ast_channel_monitor(chan)
|| !ast_audiohook_write_list_empty(ast_channel_audiohooks(chan))
return !ast_audiohook_write_list_empty(ast_channel_audiohooks(chan))
|| !ast_framehook_list_contains_no_active_of_type(ast_channel_framehooks(chan), AST_FRAME_VOICE);
}
@@ -4164,40 +4157,6 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio, int
}
}
if (ast_channel_monitor(chan) && ast_channel_monitor(chan)->read_stream) {
/* XXX what does this do ? */
#ifndef MONITOR_CONSTANT_DELAY
int jump = ast_channel_outsmpl(chan) - ast_channel_insmpl(chan) - 4 * f->samples;
if (jump >= 0) {
jump = calc_monitor_jump((ast_channel_outsmpl(chan) - ast_channel_insmpl(chan)),
ast_format_get_sample_rate(f->subclass.format),
ast_format_get_sample_rate(ast_channel_monitor(chan)->read_stream->fmt->format));
if (ast_seekstream(ast_channel_monitor(chan)->read_stream, jump, SEEK_FORCECUR) == -1) {
ast_log(LOG_WARNING, "Failed to perform seek in monitoring read stream, synchronization between the files may be broken\n");
}
ast_channel_insmpl_set(chan, ast_channel_insmpl(chan) + (ast_channel_outsmpl(chan) - ast_channel_insmpl(chan)) + f->samples);
} else {
ast_channel_insmpl_set(chan, ast_channel_insmpl(chan) + f->samples);
}
#else
int jump = calc_monitor_jump((ast_channel_outsmpl(chan) - ast_channel_insmpl(chan)),
ast_format_get_sample_rate(f->subclass.format),
ast_format_get_sample_rate(ast_channel_monitor(chan)->read_stream->fmt->format));
if (jump - MONITOR_DELAY >= 0) {
if (ast_seekstream(ast_channel_monitor(chan)->read_stream, jump - f->samples, SEEK_FORCECUR) == -1) {
ast_log(LOG_WARNING, "Failed to perform seek in monitoring read stream, synchronization between the files may be broken\n");
}
ast_channel_insmpl(chan) += ast_channel_outsmpl(chan) - ast_channel_insmpl(chan);
} else {
ast_channel_insmpl(chan) += f->samples;
}
#endif
if (ast_channel_monitor(chan)->state == AST_MONITOR_RUNNING) {
if (ast_writestream(ast_channel_monitor(chan)->read_stream, f) < 0)
ast_log(LOG_WARNING, "Failed to write data to channel monitor read stream\n");
}
}
if (ast_channel_readtrans(chan)
&& ast_format_cmp(f->subclass.format, ast_channel_rawreadformat(chan)) == AST_FORMAT_CMP_EQUAL) {
f = ast_translate(ast_channel_readtrans(chan), f, 1);
@@ -5440,48 +5399,6 @@ int ast_write_stream(struct ast_channel *chan, int stream_num, struct ast_frame
}
}
/* If Monitor is running on this channel, then we have to write frames out there too */
/* the translator on chan->writetrans may have returned multiple frames
from the single frame we passed in; if so, feed each one of them to the
monitor */
if ((stream == default_stream) && ast_channel_monitor(chan) && ast_channel_monitor(chan)->write_stream) {
struct ast_frame *cur;
for (cur = f; cur; cur = AST_LIST_NEXT(cur, frame_list)) {
/* XXX must explain this code */
#ifndef MONITOR_CONSTANT_DELAY
int jump = ast_channel_insmpl(chan) - ast_channel_outsmpl(chan) - 4 * cur->samples;
if (jump >= 0) {
jump = calc_monitor_jump((ast_channel_insmpl(chan) - ast_channel_outsmpl(chan)),
ast_format_get_sample_rate(f->subclass.format),
ast_format_get_sample_rate(ast_channel_monitor(chan)->write_stream->fmt->format));
if (ast_seekstream(ast_channel_monitor(chan)->write_stream, jump, SEEK_FORCECUR) == -1) {
ast_log(LOG_WARNING, "Failed to perform seek in monitoring write stream, synchronization between the files may be broken\n");
}
ast_channel_outsmpl_set(chan, ast_channel_outsmpl(chan) + (ast_channel_insmpl(chan) - ast_channel_outsmpl(chan)) + cur->samples);
} else {
ast_channel_outsmpl_set(chan, ast_channel_outsmpl(chan) + cur->samples);
}
#else
int jump = calc_monitor_jump((ast_channel_insmpl(chan) - ast_channel_outsmpl(chan)),
ast_format_get_sample_rate(f->subclass.format),
ast_format_get_sample_rate(ast_channel_monitor(chan)->write_stream->fmt->format));
if (jump - MONITOR_DELAY >= 0) {
if (ast_seekstream(ast_channel_monitor(chan)->write_stream, jump - cur->samples, SEEK_FORCECUR) == -1) {
ast_log(LOG_WARNING, "Failed to perform seek in monitoring write stream, synchronization between the files may be broken\n");
}
ast_channel_outsmpl_set(chan, ast_channel_outsmpl(chan) + ast_channel_insmpl(chan) - ast_channel_outsmpl(chan));
} else {
ast_channel_outsmpl_set(chan, ast_channel_outsmpl(chan) + cur->samples);
}
#endif
if (ast_channel_monitor(chan)->state == AST_MONITOR_RUNNING) {
if (ast_writestream(ast_channel_monitor(chan)->write_stream, cur) < 0)
ast_log(LOG_WARNING, "Failed to write data to channel monitor write stream\n");
}
}
}
/* the translator on chan->writetrans may have returned multiple frames
from the single frame we passed in; if so, feed each one of them to the
channel, freeing each one after it has been written */
@@ -7130,11 +7047,6 @@ static void channel_do_masquerade(struct ast_channel *original, struct ast_chann
}
}
/* Update the type. */
t_pvt = ast_channel_monitor(original);
ast_channel_monitor_set(original, ast_channel_monitor(clonechan));
ast_channel_monitor_set(clonechan, t_pvt);
/* Keep the same language. */
ast_channel_language_set(original, ast_channel_language(clonechan));

View File

@@ -94,7 +94,6 @@ struct ast_channel {
struct ast_cdr *cdr; /*!< Call Detail Record */
struct ast_tone_zone *zone; /*!< Tone zone as set in indications.conf or
* in the CHANNEL dialplan function */
struct ast_channel_monitor *monitor; /*!< Channel monitoring */
ast_callid callid; /*!< Bound call identifier pointer */
struct ao2_container *dialed_causes; /*!< Contains tech-specific and Asterisk cause data from dialed channels */
@@ -604,14 +603,6 @@ void ast_channel_masqr_set(struct ast_channel *chan, struct ast_channel *value)
{
chan->masqr = value;
}
struct ast_channel_monitor *ast_channel_monitor(const struct ast_channel *chan)
{
return chan->monitor;
}
void ast_channel_monitor_set(struct ast_channel *chan, struct ast_channel_monitor *value)
{
chan->monitor = value;
}
struct ast_filestream *ast_channel_stream(const struct ast_channel *chan)
{
return chan->stream;

View File

@@ -478,41 +478,6 @@ static void bridge_config_set_limits(struct ast_bridge_config *config, struct as
callee_limits->duration = config->timelimit;
}
/*!
* \internal
* \brief Check if Monitor needs to be started on a channel.
* \since 12.0.0
*
* \param chan The bridge considers this channel the caller.
* \param peer The bridge considers this channel the callee.
*/
static void bridge_check_monitor(struct ast_channel *chan, struct ast_channel *peer)
{
const char *value;
const char *monitor_args = NULL;
struct ast_channel *monitor_chan = NULL;
ast_channel_lock(chan);
value = pbx_builtin_getvar_helper(chan, "AUTO_MONITOR");
if (!ast_strlen_zero(value)) {
monitor_args = ast_strdupa(value);
monitor_chan = chan;
}
ast_channel_unlock(chan);
if (!monitor_chan) {
ast_channel_lock(peer);
value = pbx_builtin_getvar_helper(peer, "AUTO_MONITOR");
if (!ast_strlen_zero(value)) {
monitor_args = ast_strdupa(value);
monitor_chan = peer;
}
ast_channel_unlock(peer);
}
if (monitor_chan) {
ast_pbx_exec_application(monitor_chan, "Monitor", monitor_args);
}
}
/*!
* \internal
* \brief Send the peer channel on its way on bridge start failure.
@@ -550,8 +515,6 @@ static int pre_bridge_setup(struct ast_channel *chan, struct ast_channel *peer,
ast_indicate(peer, AST_CONTROL_RINGING);
}
bridge_check_monitor(chan, peer);
set_config_flags(chan, config);
/* Answer if need be */

View File

@@ -39,10 +39,10 @@
<synopsis>Milliseconds allowed between digit presses when entering a feature code.</synopsis>
</configOption>
<configOption name="courtesytone">
<synopsis>Sound to play when automon or automixmon is activated</synopsis>
<synopsis>Sound to play when automixmon is activated</synopsis>
</configOption>
<configOption name="recordingfailsound">
<synopsis>Sound to play when automon or automixmon is attempted but fails to start</synopsis>
<synopsis>Sound to play when automixmon is attempted but fails to start</synopsis>
</configOption>
<configOption name="transferdigittimeout" default="3">
<synopsis>Seconds allowed between digit presses when dialing a transfer destination</synopsis>
@@ -186,22 +186,6 @@
is used. The call is parked in the next available space in the parking lot.</para>
</description>
</configOption>
<configOption name="automon">
<synopsis>DTMF sequence to start or stop Monitor on a call</synopsis>
<description>
<para>This will cause the channel that pressed the DTMF sequence
to be monitored by the <literal>Monitor</literal> application. The
format for the recording is determined by the <replaceable>TOUCH_MONITOR_FORMAT</replaceable>
channel variable. If this variable is not specified, then <literal>wav</literal> is the
default. The filename is constructed in the following manner:</para>
<para> prefix-timestamp-suffix.fmt</para>
<para>where prefix is either the value of the <replaceable>TOUCH_MONITOR_PREFIX</replaceable>
channel variable or <literal>auto</literal> if the variable is not set. The timestamp
is a UNIX timestamp. The suffix is either the value of the <replaceable>TOUCH_MONITOR</replaceable>
channel variable or the callerID of the channels if the variable is not set.</para>
</description>
<see-also><ref type="configOption">automixmon</ref></see-also>
</configOption>
<configOption name="automixmon">
<synopsis>DTMF sequence to start or stop MixMonitor on a call</synopsis>
<description>
@@ -216,7 +200,6 @@
is a UNIX timestamp. The suffix is either the value of the <replaceable>TOUCH_MIXMONITOR</replaceable>
channel variable or the callerID of the channels if the variable is not set.</para>
</description>
<see-also><ref type="configOption">automon</ref></see-also>
</configOption>
</configObject>
<configObject name="applicationmap">
@@ -352,7 +335,6 @@
<enumlist>
<enum name="atxfer"><para>Attended Transfer</para></enum>
<enum name="blindxfer"><para>Blind Transfer</para></enum>
<enum name="automon"><para>Auto Monitor</para></enum>
<enum name="disconnect"><para>Call Disconnect</para></enum>
<enum name="parkcall"><para>Park Call</para></enum>
<enum name="automixmon"><para>Auto MixMonitor</para></enum>
@@ -1013,8 +995,6 @@ static int featuremap_set(struct ast_featuremap_config *featuremap, const char *
ast_string_field_set(featuremap, blindxfer, value);
} else if (!strcasecmp(name, "disconnect")) {
ast_string_field_set(featuremap, disconnect, value);
} else if (!strcasecmp(name, "automon")) {
ast_string_field_set(featuremap, automon, value);
} else if (!strcasecmp(name, "atxfer")) {
ast_string_field_set(featuremap, atxfer, value);
} else if (!strcasecmp(name, "automixmon")) {
@@ -1038,8 +1018,6 @@ static int featuremap_get(struct ast_featuremap_config *featuremap, const char *
ast_copy_string(buf, featuremap->blindxfer, len);
} else if (!strcasecmp(field, "disconnect")) {
ast_copy_string(buf, featuremap->disconnect, len);
} else if (!strcasecmp(field, "automon")) {
ast_copy_string(buf, featuremap->automon, len);
} else if (!strcasecmp(field, "atxfer")) {
ast_copy_string(buf, featuremap->atxfer, len);
} else if (!strcasecmp(field, "automixmon")) {
@@ -1857,8 +1835,6 @@ static int load_config(void)
DEFAULT_FEATUREMAP_BLINDXFER, featuremap_handler, 0);
aco_option_register_custom(&cfg_info, "disconnect", ACO_EXACT, featuremap_options,
DEFAULT_FEATUREMAP_DISCONNECT, featuremap_handler, 0);
aco_option_register_custom(&cfg_info, "automon", ACO_EXACT, featuremap_options,
DEFAULT_FEATUREMAP_AUTOMON, featuremap_handler, 0);
aco_option_register_custom(&cfg_info, "atxfer", ACO_EXACT, featuremap_options,
DEFAULT_FEATUREMAP_ATXFER, featuremap_handler, 0);
aco_option_register_custom(&cfg_info, "parkcall", ACO_EXACT, featuremap_options,
@@ -1957,7 +1933,6 @@ static char *handle_feature_show(struct ast_cli_entry *e, int cmd, struct ast_cl
ast_cli(a->fd, HFS_FORMAT, "Pickup", DEFAULT_PICKUPEXTEN, cfg->global->pickup->pickupexten);
ast_cli(a->fd, HFS_FORMAT, "Blind Transfer", DEFAULT_FEATUREMAP_BLINDXFER, cfg->featuremap->blindxfer);
ast_cli(a->fd, HFS_FORMAT, "Attended Transfer", DEFAULT_FEATUREMAP_ATXFER, cfg->featuremap->atxfer);
ast_cli(a->fd, HFS_FORMAT, "One Touch Monitor", DEFAULT_FEATUREMAP_AUTOMON, cfg->featuremap->automon);
ast_cli(a->fd, HFS_FORMAT, "Disconnect Call", DEFAULT_FEATUREMAP_DISCONNECT, cfg->featuremap->disconnect);
ast_cli(a->fd, HFS_FORMAT, "Park Call", DEFAULT_FEATUREMAP_PARKCALL, cfg->featuremap->parkcall);
ast_cli(a->fd, HFS_FORMAT, "One Touch MixMonitor", DEFAULT_FEATUREMAP_AUTOMIXMON, cfg->featuremap->automixmon);

View File

@@ -451,32 +451,6 @@
</see-also>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="MonitorStart">
<managerEventInstance class="EVENT_FLAG_CALL">
<synopsis>Raised when monitoring has started on a channel.</synopsis>
<syntax>
<channel_snapshot/>
</syntax>
<see-also>
<ref type="managerEvent">MonitorStop</ref>
<ref type="application">Monitor</ref>
<ref type="manager">Monitor</ref>
</see-also>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="MonitorStop">
<managerEventInstance class="EVENT_FLAG_CALL">
<synopsis>Raised when monitoring has stopped on a channel.</synopsis>
<syntax>
<channel_snapshot/>
</syntax>
<see-also>
<ref type="managerEvent">MonitorStart</ref>
<ref type="application">StopMonitor</ref>
<ref type="manager">StopMonitor</ref>
</see-also>
</managerEventInstance>
</managerEvent>
***/
/*! \brief The \ref stasis subscription returned by the forwarding of the channel topic
@@ -1160,22 +1134,6 @@ static void channel_moh_stop_cb(void *data, struct stasis_subscription *sub,
publish_basic_channel_event("MusicOnHoldStop", EVENT_FLAG_CALL, payload->snapshot);
}
static void channel_monitor_start_cb(void *data, struct stasis_subscription *sub,
struct stasis_message *message)
{
struct ast_channel_blob *payload = stasis_message_data(message);
publish_basic_channel_event("MonitorStart", EVENT_FLAG_CALL, payload->snapshot);
}
static void channel_monitor_stop_cb(void *data, struct stasis_subscription *sub,
struct stasis_message *message)
{
struct ast_channel_blob *payload = stasis_message_data(message);
publish_basic_channel_event("MonitorStop", EVENT_FLAG_CALL, payload->snapshot);
}
static void channel_mixmonitor_start_cb(void *data, struct stasis_subscription *sub,
struct stasis_message *message)
{
@@ -1426,13 +1384,6 @@ int manager_channels_init(void)
ret |= stasis_message_router_add(message_router,
ast_channel_moh_stop_type(), channel_moh_stop_cb, NULL);
ret |= stasis_message_router_add(message_router,
ast_channel_monitor_start_type(), channel_monitor_start_cb,
NULL);
ret |= stasis_message_router_add(message_router,
ast_channel_monitor_stop_type(), channel_monitor_stop_cb, NULL);
ret |= stasis_message_router_add(message_router,
ast_channel_mixmonitor_start_type(), channel_mixmonitor_start_cb, NULL);

View File

@@ -130,8 +130,6 @@
<enum name="ast_channel_hangup_handler_type" />
<enum name="ast_channel_moh_start_type" />
<enum name="ast_channel_moh_stop_type" />
<enum name="ast_channel_monitor_start_type" />
<enum name="ast_channel_monitor_stop_type" />
<enum name="ast_channel_mixmonitor_start_type" />
<enum name="ast_channel_mixmonitor_stop_type" />
<enum name="ast_channel_mixmonitor_mute_type" />

View File

@@ -1611,8 +1611,6 @@ STASIS_MESSAGE_TYPE_DEFN(ast_channel_fax_type);
STASIS_MESSAGE_TYPE_DEFN(ast_channel_hangup_handler_type);
STASIS_MESSAGE_TYPE_DEFN(ast_channel_moh_start_type);
STASIS_MESSAGE_TYPE_DEFN(ast_channel_moh_stop_type);
STASIS_MESSAGE_TYPE_DEFN(ast_channel_monitor_start_type);
STASIS_MESSAGE_TYPE_DEFN(ast_channel_monitor_stop_type);
STASIS_MESSAGE_TYPE_DEFN(ast_channel_mixmonitor_start_type);
STASIS_MESSAGE_TYPE_DEFN(ast_channel_mixmonitor_stop_type);
STASIS_MESSAGE_TYPE_DEFN(ast_channel_mixmonitor_mute_type);
@@ -1659,8 +1657,6 @@ static void stasis_channels_cleanup(void)
STASIS_MESSAGE_TYPE_CLEANUP(ast_channel_hangup_handler_type);
STASIS_MESSAGE_TYPE_CLEANUP(ast_channel_moh_start_type);
STASIS_MESSAGE_TYPE_CLEANUP(ast_channel_moh_stop_type);
STASIS_MESSAGE_TYPE_CLEANUP(ast_channel_monitor_start_type);
STASIS_MESSAGE_TYPE_CLEANUP(ast_channel_monitor_stop_type);
STASIS_MESSAGE_TYPE_CLEANUP(ast_channel_mixmonitor_start_type);
STASIS_MESSAGE_TYPE_CLEANUP(ast_channel_mixmonitor_stop_type);
STASIS_MESSAGE_TYPE_CLEANUP(ast_channel_mixmonitor_mute_type);
@@ -1714,8 +1710,6 @@ int ast_stasis_channels_init(void)
res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_hangup_handler_type);
res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_moh_start_type);
res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_moh_stop_type);
res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_monitor_start_type);
res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_monitor_stop_type);
res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_mixmonitor_start_type);
res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_mixmonitor_stop_type);
res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_mixmonitor_mute_type);