aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/asterisk.c8
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));