asterisk
asterisk copied to clipboard
CLI background color
I'm using the Alpine version under UNRAID and I have problems with the color of the text in the CLI. Some of the text (usually debug messages) is displayed black on dark grey background (see attached screenshot) and therefore barely readable. After such a line is displayed also the color of the commands typed afterwards becomes black on dark grey. Initially I thought that there is a problem with my specific asterisk configuration, or the TERMINAL settings or the Docker configurations.... After some hair pulling I realized that the culprit is the -W from the asterisk command line from docker-entrypoint.sh
if [ "$1" = "" ]; then
COMMAND="/usr/sbin/asterisk -T -W -U ${ASTERISK_USER} -p -vvvdddf"
else
-W Display colored terminal text as if the background were white or otherwise light in color. Normally, terminal text is displayed as if the background were black or otherwise dark in color.
Given that normally the linux console has a black background I think that this setting is inconvenient for most of the people. Could you please change this to -B instead or eventually make it configurable? Of course, you already provided a nice mechanism to override the entire COMMAND, however maybe some people, just like me, will have difficulties to figure out from where the problem comes in the first place.
Thanks and keep up the good work!

Thanks!
There is no option for -B, I will refactor image builder and will make colours options configurable
/ # asterisk -h
Asterisk 16.7.0, Copyright (C) 1999 - 2018, Digium, Inc. and others.
Usage: asterisk [OPTIONS]
Valid Options:
-V Display version number and exit
-C <configfile> Use an alternate configuration file
-G <group> Run as a group other than the caller
-U <user> Run as a user other than the caller
-c Provide console CLI
-d Increase debugging (multiple d's = more debugging)
-f Do not fork
-F Always fork
-g Dump core in case of a crash
-h This help screen
-i Initialize crypto keys at startup
-L <load> Limit the maximum load average before rejecting new calls
-M <value> Limit the maximum number of calls to the specified value
-m Mute debugging and console output on the console
-n Disable console colorization
-p Run as pseudo-realtime thread
-q Quiet mode (suppress output)
-r Connect to Asterisk on this machine
-R Same as -r, except attempt to reconnect if disconnected
-s <socket> Connect to Asterisk via socket <socket> (only valid with -r)
-t Record soundfiles in /var/tmp and move them where they
belong after they are done
-T Display the time in [Mmm dd hh:mm:ss] format for each line
of output to the CLI
-v Increase verbosity (multiple v's = more verbose)
-x <cmd> Execute command <cmd> (implies -r)
-X Enable use of #exec in asterisk.conf
-W Adjust terminal colors to compensate for a light background
Thank you very much for considering this small improvement! Indeed - the -B is not between the switches displayed by the help command - apparently they forgot it - but for sure it is handled in the code: https://github.com/asterisk/asterisk/blob/7d96b3e43746c2f3a16314acead2be53ee83f3d3/main/asterisk.c#L3570 and it seems to work fine on my side (notice the text background change from dark grey to black)

I see this is still a issue in asterisk 18. When a black notice/warning come in the terminal stays black. Should this not reset to default instead of switching it to black?
