diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/asterisk.c | 2 | ||||
-rw-r--r-- | main/cli.c | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/main/asterisk.c b/main/asterisk.c index 53e4d042b..9f0f049de 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -936,7 +936,7 @@ static void *netconsole(void *vconsole) break; } tmp[res] = 0; - ast_cli_command(con->fd, tmp); + ast_cli_command_multiple(con->fd, res, tmp); } if (fds[1].revents) { res = read(con->p[0], tmp, sizeof(tmp)); diff --git a/main/cli.c b/main/cli.c index 1d3a7b94b..826ed6f2a 100644 --- a/main/cli.c +++ b/main/cli.c @@ -2005,3 +2005,20 @@ int ast_cli_command(int fd, const char *s) return 0; } + +int ast_cli_command_multiple(int fd, size_t size, const char *s) +{ + char cmd[512]; + int x, y = 0, count = 0; + + for (x = 0; x < size; x++) { + cmd[y] = s[x]; + y++; + if (s[x] == '\0') { + ast_cli_command(fd, cmd); + y = 0; + count++; + } + } + return count; +} |