|
|
@ -879,6 +879,11 @@ static int action_redirect(struct mansession *s, struct message *m)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
chan = ast_get_channel_by_name_locked(name);
|
|
|
|
chan = ast_get_channel_by_name_locked(name);
|
|
|
|
|
|
|
|
if (chan->_state != AST_STATE_UP) {
|
|
|
|
|
|
|
|
astman_send_error(s, m, "Redirect failed, channel not up.\n");
|
|
|
|
|
|
|
|
ast_mutex_unlock(&chan->lock);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
if (!chan) {
|
|
|
|
if (!chan) {
|
|
|
|
char buf[BUFSIZ];
|
|
|
|
char buf[BUFSIZ];
|
|
|
|
snprintf(buf, sizeof(buf), "Channel does not exist: %s", name);
|
|
|
|
snprintf(buf, sizeof(buf), "Channel does not exist: %s", name);
|
|
|
@ -887,6 +892,12 @@ static int action_redirect(struct mansession *s, struct message *m)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!ast_strlen_zero(name2))
|
|
|
|
if (!ast_strlen_zero(name2))
|
|
|
|
chan2 = ast_get_channel_by_name_locked(name2);
|
|
|
|
chan2 = ast_get_channel_by_name_locked(name2);
|
|
|
|
|
|
|
|
if (chan2 && chan2->_state != AST_STATE_UP) {
|
|
|
|
|
|
|
|
astman_send_error(s, m, "Redirect failed, extra channel not up.\n");
|
|
|
|
|
|
|
|
ast_mutex_unlock(&chan->lock);
|
|
|
|
|
|
|
|
ast_mutex_unlock(&chan2->lock);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
res = ast_async_goto(chan, context, exten, pi);
|
|
|
|
res = ast_async_goto(chan, context, exten, pi);
|
|
|
|
if (!res) {
|
|
|
|
if (!res) {
|
|
|
|
if (!ast_strlen_zero(name2)) {
|
|
|
|
if (!ast_strlen_zero(name2)) {
|
|
|
|