Summary:ASTERISK-08789: [patch] Provide colors for daeminized asterisk
Reporter:Tzafrir Cohen (tzafrir)Labels:
Date Opened:2007-02-12 16:37:04.000-0600Date Closed:2009-11-07 15:45:24.000-0600
Versions:Frequency of
Environment:Attachments:( 0) 20071017__bug9048.diff.txt
( 1) daemon_color.diff
( 2) daemon_color.dpatch
Description:The attached patch tells Asterisk to assume that if it was daemonised, it should use the terminal type "xterm".

As a result, rastrisk connections will have color.
Comments:By: Tzafrir Cohen (tzafrir) 2007-03-02 09:11:05.000-0600

Uploaded the current patch used in the upcoming Debian package.

One small issue: The background of my terminal is a non-black one. When I run 'asterisk', the color of the terminal is suddenly changed to black, even though Asterisk prints no text to the console.

By: Tilghman Lesher (tilghman) 2007-03-03 01:15:39.000-0600

Uh, we should never be auto setting the terminal type to "xterm".  If anything, it should be "linux" or "cons25" for *BSD.

By: Tzafrir Cohen (tzafrir) 2007-03-07 11:47:07.000-0600

It should be "vt100", of course :-)

By: Tilghman Lesher (tilghman) 2007-03-07 12:27:01.000-0600

No, it should be whatever the native console is on the machine on which it is running.  That's "linux" for Linux and "cons25" for FreeBSD, at least.  As far as I'm aware, "vt100" is not a native terminal on any machine which supports running Asterisk.

By: Tzafrir Cohen (tzafrir) 2007-03-07 12:50:57.000-0600

It doesn't really matter. It does not need a terminal device. It should be able to work on a Linux system compiled without the virtual terminals or whatever. Otherwise what's the point of it being a daemon?

(as opposed to "safe_asterisk" that attempts to run from a specific terminal)

By: Tzafrir Cohen (tzafrir) 2007-08-27 03:58:13

One minor known issue: before daemonizing, asterisk still manages to set the terminal's color to black.

By: Tilghman Lesher (tilghman) 2007-10-17 10:44:19

This patch is what I would prefer for this purpose.  Set the terminal type according to what the native terminal type is for a particular platform, or if we don't know it, refuse to set the console type at all.

By: Tzafrir Cohen (tzafrir) 2007-10-17 10:54:34

Not that I really mind. But how can I know in advance aat compile time if the terminal from which I'll be connecting will be the console of Linux, FreeBSD, Solaris, or something completely different?

(I tend to connect from xterm or mlterm. Others are known to prefer putty or konsole)

By: Tilghman Lesher (tilghman) 2007-10-17 11:28:01

Well, it should the native type for the console on which the process is actually running.

If you wanted something different, you can always set the TERM in the startup script to something else.  But the native type should be the same as the machine itself.

By: Digium Subversion (svnbot) 2007-10-17 11:46:01

Repository: asterisk
Revision: 86119

U   trunk/main/term.c

r86119 | tilghman | 2007-10-17 11:46:00 -0500 (Wed, 17 Oct 2007) | 3 lines

Support color on certain platforms, even when started at boot (before TERM is set)
Closes issue ASTERISK-8789