From 741ba21e7eb7330dda284110d9dd069c1fff7b6e Mon Sep 17 00:00:00 2001 From: tilghman Date: Wed, 21 May 2008 18:40:14 +0000 Subject: 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 --- main/asterisk.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'main') 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)); -- cgit v1.2.3