]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_console: Use correct parameter for 'set active'
authorOron Peled <oron.peled@xorcom.com>
Tue, 19 Dec 2017 08:50:04 +0000 (10:50 +0200)
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>
Tue, 19 Dec 2017 16:58:37 +0000 (10:58 -0600)
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

channels/chan_console.c

index 02d68870b9c616be4dc02b976e353a4044e4ba15..d7a72138df97a858fcb06348714fbab6d7dab5e9 100644 (file)
@@ -1235,7 +1235,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;
        }