chan_console: Use correct parameter for 'set active'

chan_console supports multiple devices but the CLI only works on a
single device. 'console set active' selects this device.

Sadly that CLI picks the wrong command-line parameter and will only
work for a device called 'active'.

ASTERISK-27490 #close

Change-Id: I2f0e5fe63db19845bee862575b739360797dc73d
pull/9/head
Oron Peled 7 years ago committed by Tzafrir Cohen
parent 11a1e07ad2
commit c02e256407

@ -1233,7 +1233,7 @@ static char *cli_console_active(struct ast_cli_entry *e, int cmd, struct ast_cli
return CLI_SUCCESS;
}
if (!(pvt = find_pvt(a->argv[e->args - 1]))) {
if (!(pvt = find_pvt(a->argv[e->args]))) {
ast_cli(a->fd, "Could not find a device called '%s'.\n", a->argv[e->args]);
return CLI_FAILURE;
}

Loading…
Cancel
Save