diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-21 18:40:14 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-21 18:40:14 +0000 |
commit | 741ba21e7eb7330dda284110d9dd069c1fff7b6e (patch) | |
tree | 4cee42c854ebc6fbcc2327890338654680a60599 /main | |
parent | c6349aca4b981b49720cb66ddf968482daacf43d (diff) |
Strip the preamble from the output also when -rx is not being used
(Related to issue #12702)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@117519 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/asterisk.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c index ef6c64de6..e11ee2658 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -2347,6 +2347,14 @@ static void ast_remotecontrol(char * data) if (ebuf[strlen(ebuf)-1] == '\n') ebuf[strlen(ebuf)-1] = '\0'; if (!remoteconsolehandler(ebuf)) { + /* Strip preamble from output */ + char *tmp; + for (tmp = ebuf; *tmp; tmp++) { + if (*tmp == 127) { + memmove(tmp, tmp + 1, strlen(tmp)); + tmp--; + } + } res = write(ast_consock, ebuf, strlen(ebuf) + 1); if (res < 1) { ast_log(LOG_WARNING, "Unable to write: %s\n", strerror(errno)); |