unicode characters suddenly appearing in asterisk CLI SSH console

2

I have a mysterious issue. I connect to an Arch Linux virtual machine running asterisk. All of a sudden, anytime I enter the asterisk CLI, the SSH console spits out unicode character codes. What I am showing below is the result of moving the arrows. How can I get my normal display back?

aag ~ $ sudo asterisk -r
Connected to Asterisk 13.9.1 currently running on asterisk (pid = 1399)
asterisk*CLI> \U+4B01B\U+4B05B\U+4B041

aag

Posted 2016-07-16T18:04:46.010

Reputation: 127

Answers

5

The issue is discussed on the Asterisk forums here https://community.asterisk.org/t/cli-gibberish-prompt-and-input-appear-to-be-some-sort-of-unicode-characters/67382/15

It's caused when Asterisk uses external libedit (which is the default option in Asterisk if it's provided by the system, and Arch Linux provides it by default) with incompatible version.

One workaround is to compile Asterisk with --with-libedit=internal. Other workaround is to downgrade libedit to a compatible version (e.g. libedit 20150325_3.1-2)

miopa

Posted 2016-07-16T18:04:46.010

Reputation: 66

1Just a hint for a non-invasive approach, get the proper versions of libedit (and libtinfo that it requires by itself) and use LD_PRELOAD instead of doing a system-wide library downgrade: alias asterisk="LD_PRELOAD=/usr/local/lib/libtinfo.so.5:/usr/local/lib/libedit.so.0.0.53 asterisk". Of course this assumes you put these libraries in /usr/local/lib – Marcelo – 2017-02-15T20:18:00.813

1

You can edit the PKGBUILD file and add --with-libedit=internal in the ./configure line.

Lilong

Posted 2016-07-16T18:04:46.010

Reputation: 21

Thanks. I am not sure why it was downvoted - might the downvoter provide clarity? Also, what exactly does this PKGBUILD option do? – aag – 2016-08-27T07:14:32.050

PKGBUILD is the file to build packages. Since asterisk is in AUR, you can download the PKGBUILD file, edit the file and then rebuild and reinstall the asterisk package. Alternatively you can downgrade the libedit package. – Lilong – 2016-08-27T20:21:22.057

0

Those are color/positions chars.

You have 2 options

1)Ensure you ssh client support same terminal type you have in TERM variable. To get it use

env|grep TERM

2) run asterisk console without color

-n Disable ANSI colors even on terminals capable of displaying them.

So use

   asterisk -rn

arheops

Posted 2016-07-16T18:04:46.010

Reputation: 977

thank you for taking time to help me. Regrettably, neither suggestions helped. Starting the asterisk CLI with the -rn switch did not change anything. I then removed the colors by editing ~/.bashrc and rebooting. Still getting the code gibberish though. I should add that locale indicates that asterisk (on arch linux) is using UTF-8, and the terminal software (putty) is also using xterm and UTF-8 – aag – 2016-07-17T19:38:03.817

Maybe your asterisk compiled in other environment without UTF-8. Try other encoding(in both terminal and putty). – arheops – 2016-07-17T21:30:22.917

I installed a completely fresh version of arch linux, and compiled asterisk anew from yaourt. Again, no joy. The linux environment works just fine, but as soon as I switch to asterisk things go awry. This only happens since a few weeks, which leads me to wonder whether it's a bug. – aag – 2016-07-18T18:10:56.870

Arch linux is not so common. Sorry, can say nothing except i say above. – arheops – 2016-07-18T21:57:10.583