Page 1 of 1

unusual console..

PostPosted: Tue Mar 16, 2010 7:29 pm
by ruben23
Hi, i tried couple of time installing an setting up with vicidial single server with this config:

asterisk-1.4.27-vici.tar.gz
asterisk-1.4.28-vici.tar.gz
dahdi-linux-complete-2.2.0.2+2.2.0.tar.gz
libpri-1.4.10.1.tar.gz
agc_2.2.0 or agc_2.0.5

All works well after install but the asterisk console is unusual there is no color hinting for asterisk CLI, which we usually see AGI script colors in pink and yellow on NOTICE, red on ERRORS - all seems in one color plain white text for all.

-I have done with asterisk-1.4.27-vici.tar.gz and asterisk-1.4.28-vici.tar.gz
but with lower version its fine.

any issue regarding on this..?

PostPosted: Wed Mar 17, 2010 5:50 pm
by ruben23
to give you a sample:

Image

PostPosted: Thu Mar 18, 2010 11:11 am
by gardo
How do you start Asterisk?

PostPosted: Thu Mar 18, 2010 5:23 pm
by ruben23
it is started automatically on boot through init script...and i run asterisk -rvvvvvv for the console. Are there other ways..?

PostPosted: Thu Mar 18, 2010 6:42 pm
by williamconley
http://www.mail-archive.com/asterisk-us ... 12860.html

from 11/2008:

The startup scripts changed slightly, such that they no longer
output to a terminal. Because there is no console, Asterisk cannot detect
which control codes to send (hence, no color). Note that if you startup
Asterisk with safe_asterisk, this isn't a problem, as safe_asterisk attaches
the process to a terminal (typically, pty8).


http://www.voipplanet.com/backgrounders ... hp/3650931

And more on point, but convoluted, you'll have to pull it out and/or interpret it as you see fit:

Customizing the Asterisk CLI prompt
Old critters like me don't care to read colored text on black backgrounds, which is the default Asterisk console color scheme. The easy way to get around this is to have these lines in /etc/init.d/asterisk:

# Full path to asterisk binary
DAEMON=$AST_SBIN/asterisk TERM=linux asterisk

The DAEMON line is already there—just add TERM=linux asterisk. Restart Asterisk from the Linux command line this way:
# /etc/init.d/asterisk restart

Then when you attach to a running Asterisk session (asterisk -r) from an X terminal (like Konsole, xterm, or Gnome terminal) you'll keep your local terminal color scheme. But this doesn't affect the Asterisk root console, because those colors are hard-coded into Asterisk. You can see for yourself in the source directory, in /usr/src/asterisk-1.4.0-[version]/main/term.c.

You can customize the prompt a bit, if the default prompt is too dull for you. First add these lines to /etc/asterisk/extensions.conf in the [globals] section:

${ENV(UNIX)}
${ENV(ASTERISK_PROMPT)}

Then in /etc/profile on the Asterisk server, set the ASTERISK_PROMPT values:
ASTERISK_PROMPT='%t, %l2, %h*> '
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC ASTERISK_PROMPT

Your export variables will probably be different; just tack ASTERISK_PROMPT on at the end. Reboot, run asterisk -r from your X terminal, and voilá! The prompt is customized and your colors do not change:
17:51:30, 0.54, asterisk1.alrac.net*>

This example displays the time, the load average for the past five minutes, and the fully-qualified server name. Look in /usr/src/asterisk-1.4.0-[version]/doc/cliprompt.txt to see a list of values to use.


_______________


What i get from this is that the terminal it believes it is pointing to is determined when it is started and after that it will issue color controls for that terminal or NO colors, based on how you start the remote terminal.

i'd do more but the pizza is here and i'm out of time :)

PostPosted: Sat Mar 20, 2010 4:34 pm
by ruben23
@williamconley

-This just happens when i install asterisk-1.4.27-vici.tar.gz and asterisk-1.4.28-vici.tar.gz but when i run install asterisk 1.4.21 the color hinting on the asterisk CLI is working.

Have you setup with this asterisk verison and the CLI color hinting is working..?

-Is this a problem with the startscript..? of asterisk- It just really hard to see CLI without color to identofy error and problems.

PostPosted: Sat Mar 20, 2010 4:44 pm
by williamconley
if you read the above and check out the included links, they are basically saying that at the time of startup the color codes are decided. there is a system variable that determines the "console type" or "target terminal type" depending on how you want to look at it and whether or not to generate colors is done on the command line when starting, apparently. so .. yes, you must find or set that variable and then ensure that color is turned on when asterisk is first started. then your consoles may have color available to them.

you will likely have to experiment with it a bit. interesting, i've had a couple installations that were missing color, but never even thought of it. now i know. cool.

PostPosted: Sat Mar 20, 2010 6:07 pm
by ruben23
@williamconley

-Im thinking the main cause of this problem is running make config upon building my asterisk source.
-i think new versions of asterisk 1.4.27 don't inlcude safe_asterisk on its init script.

-but the problem if i don't run make config on asterisk- how do i run it automatically on startup..? is asterisk inlcuded on the vicidial init script..?

PostPosted: Sat Mar 20, 2010 7:21 pm
by williamconley
you need to read the links and try to understand them. it's not likely about how the program is compiled, but about the environment (system variables) and "switches" at execution time.

you should find out what the environment variables are in a DEMO vicidial (which will provide colors and give you a free easy to use comparison environment)

then check that against the one you are running, find the "different" in the variables that deal with console and execution and work it out. :)

PostPosted: Mon Mar 22, 2010 8:04 am
by Op3r
Honestly I dont know what's the issue between a not having a color and a colored cli anymore.

There are just the same.

PostPosted: Mon Mar 22, 2010 10:25 am
by williamconley
there should be a system variable that is different at startup.

i do not see your OS in your specs, so use either vicibox, vicibox redux or vicidialNOW to make a fresh install (spare P4, vicibox demo which does not require installation, or even a VMWare if you aren't going to make any calls).

then you can compare the system variables at the time of startup for asterisk and see what is different.

of course, you can also shut asterisk down and start it up after using the links i supplied to help you SET system variables until you find a way to get color and then see if that will "stick" during reboot.