mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 03:50:31 +00:00
Fix StopMixMonitor Hanging Up When Unable To Stop MixMonitor On A Channel
A regression was accidentally introduced when allowing an optional ID to be used when calling StopMixMonitor. When we are unable to stop MixMonitor on a channel, -1 is being returned which triggers the hangup of the channel. This patch restores the prior behavior by returning 0 whether we were successful or not. It also allows the call from the manager to use the return code when the action fails. (closes issue ASTERISK-21294) Reported by: daroz Tested by: daroz Patches: asterisk-21294-stop_mixmonitor_hangingup.diff Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2404/ ........ Merged revisions 383631 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383632 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1042,7 +1042,7 @@ static int mixmonitor_exec(struct ast_channel *chan, const char *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int stop_mixmonitor_exec(struct ast_channel *chan, const char *data)
|
||||
static int stop_mixmonitor_full(struct ast_channel *chan, const char *data)
|
||||
{
|
||||
struct ast_datastore *datastore = NULL;
|
||||
char *parse = "";
|
||||
@@ -1096,6 +1096,12 @@ static int stop_mixmonitor_exec(struct ast_channel *chan, const char *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int stop_mixmonitor_exec(struct ast_channel *chan, const char *data)
|
||||
{
|
||||
stop_mixmonitor_full(chan, data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char *handle_cli_mixmonitor(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
|
||||
{
|
||||
struct ast_channel *chan;
|
||||
@@ -1315,7 +1321,7 @@ static int manager_stop_mixmonitor(struct mansession *s, const struct message *m
|
||||
return AMI_SUCCESS;
|
||||
}
|
||||
|
||||
res = stop_mixmonitor_exec(c, mixmonitor_id);
|
||||
res = stop_mixmonitor_full(c, mixmonitor_id);
|
||||
|
||||
if (res) {
|
||||
astman_send_error(s, m, "Could not stop monitoring channel");
|
||||
|
Reference in New Issue
Block a user