[Home]

Summary:ASTERISK-03028: [patch] Feature request for turning off display/logging of manager logins
Reporter:a (cyberdjheffer)Labels:
Date Opened:2004-12-18 10:57:18.000-0600Date Closed:2008-01-15 15:19:56.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) displayconnects_manager.patch
( 1) manager.conf.sample
Description:Whenever someone or a computer telnets into the manager interface of Asterisk, two lines of text show up on the CLI console.  The only way I have found to turn off the logging and display of this information is to comment out the associated source code and then recompile Asterisk.  I would like a feature that would allow the Asterisk administrator to turn on or off either the logging or display of manager telnet messages.  This would allow the CLI console to be used for just displaying the results of calls that are being placed/received.
Comments:By: Clod Patry (junky) 2004-12-18 11:14:51.000-0600

Please choose the right project/category when you report a bug.
Thanks

By: Clod Patry (junky) 2004-12-18 11:31:02.000-0600

I think it's a good option to have a parameter to enable/disable this yeah.
An option like clioutput=yes/no should be good.
If you wanna submit a patch, go ahead (a diff -u format).

By: brian22942 (brian22942) 2004-12-19 17:46:11.000-0600

I'll go ahead and tackle this one. Should be trivial. Give me a day to do it and test it.

By: Mark Spencer (markster) 2004-12-19 18:29:27.000-0600

how about instead of "clioutput" we call it something more intuitive like "displayconnects" or something?

By: brian22942 (brian22942) 2004-12-19 20:39:18.000-0600

Here's the patch. Adds new option displayconnects=on or displayconnects=off. If turned off, users won't see when a manager connects on the CLI - logging to file is still enabled. Pretty self-explanatory. Compiles successfully. Haven't had a chance to test it yet, so feel free to apply it and let me know how it turns out. Disclaimer sent over the weekend.

edited on: 12-19-04 21:01

By: Clod Patry (junky) 2004-12-21 00:46:07.000-0600

I'm not sure to get that patch.
I think you just switch your manager.c and manager.bak when ya generated the patch, is that possible?
Cause you seems to - everything which is not in current CVS, and you + everything which is in the current CVS.

If you could attach a new manager.conf.sample too, that would be great.

By: brian22942 (brian22942) 2004-12-21 06:53:02.000-0600

My bad on the earlier patch. The new patch is in manager.c.diff.txt and I have attached the diff for the manager.conf (it's just one line) and the new manager.conf.sample. Compiles sucessfully with 1.0.3 Stable.

edited on: 12-21-04 06:54

By: Clod Patry (junky) 2004-12-21 12:13:14.000-0600

that makes better sense to me.
I'll test it tomorrow.
If someone else wants to tests, go ahead.

By: a (cyberdjheffer) 2004-12-21 20:41:37.000-0600

I compiled Asterisk 1.0.3 (stable) with the manager.c.diff.txt diff file patched to manager.c.  displayconnects=off works in that it turns off the display of manager logins, but displays of the manager.conf file being parsed are still displayed in the CLI screen.  Can parsing text displays be turned off too?

By: Clod Patry (junky) 2004-12-21 23:03:28.000-0600

Im not sure of what you're asking now.
Are you asking about that line:
== Parsing '/etc/asterisk/manager.conf': Asterisk Management interface listening on port 5038
is it that line you wanna takes off the CLI?

if isn't that line, indicates which lines you're talking about exactly.

By: a (cyberdjheffer) 2004-12-22 00:32:25.000-0600

The "Parsing '/etc/asterisk/manager.conf'" line is what I had seen on the CLI that keeps repeating.

By: brian22942 (brian22942) 2004-12-22 05:44:42.000-0600

Are you saying you want everything that pertains to the manager to be removed from being reported on the cli? I do not think that is what displayconnects behavior is designed to do. Why would you want that?

edited on: 12-22-04 05:45

By: Clod Patry (junky) 2004-12-22 07:54:56.000-0600

Im with brian, why do you need it exactly?
isn't just when you start asterisk and reload it that you see that line?
"Keep repeating" means what exactly?
That line is from config.c.
I don't see why you don't want that line in CLI, exactly? can you provide more details about this please?

edited on: 12-22-04 09:38

By: a (cyberdjheffer) 2004-12-22 14:45:07.000-0600

I am running a custom application that logs into the Asterisk manager once every second.  As a result, the unaltered stable 1.0.3 version of Asterisk shows notifications of manager logins and parsing of the manager.conf file.  I am trying to have my CLI screen only show the status of calls.  When the manager notifications are displayed, the call information scrolls away.

By: () 2004-12-22 15:12:17.000-0600

Oh, the message "Parsing /etc/asterisk/manager.conf" is displayed everytime a manager logs in. Right now, if you have Asterisk set to verbose output, it will display a lot of information. I suggest you try an alternative method of using the manager proxy that is posted on the wiki. That way, it will only post "Parsing /etc/asterisk/manager.conf" once and continue to stay logged in from a machine remotely or locally. You can pass commands to Asterisk through the proxy. I'm not going to tackle selective verbose output. But, I think a combination of the proxy and the displayconnects patch is what you should go for thinking ahead.

By: Clod Patry (junky) 2004-12-22 18:10:48.000-0600

Even with displayconnects=off , im still getting:
 == Parsing '/etc/asterisk/manager.conf': Found
 == Manager 'junky' logged on from 127.0.0.1
and when im login out:
 == Manager 'junky' logged off from 127.0.0.1

the logged on/off isn't supposed to be ignored?

That patch should allow displayconnects=on/off in the general class to disabled all managers into the manager.conf, no?

And we should use ast_true instead of just checking for "on".


Plus the indentation isnt correct, try to respect the standards.
Thanks.

edited on: 12-22-04 18:22

edited on: 12-22-04 18:33

By: brian22942 (brian22942) 2004-12-22 19:36:19.000-0600

I set it by each individual manager. I can change it to be for all managers. What is the correct indentation ?

By: Clod Patry (junky) 2004-12-22 21:23:39.000-0600

This is a patch which allows displayconnects in general too (affect all users).
If a displayconnects is set for a user, it 1 in priority vs the general section.

By indentation, i mean, do a <tab>, not some spaces.

was created with CVS-HEAD-12/20/04-17:58:25 .

Disclaimer on patch.

edited on: 12-22-04 21:27

edited on: 12-23-04 07:54

By: brian22942 (brian22942) 2004-12-23 06:28:09.000-0600

Ah, ya posted it before I did ;)

Looks good and I tested successfully over here. Works great.

edited on: 12-23-04 06:28

By: () 2004-12-24 12:28:46.000-0600

Does it work for you cyberdjheffer?

By: Clod Patry (junky) 2004-12-24 12:55:07.000-0600

If you don't want to see the Parsing line, you can just do:
set verbose 1 , cause config.c print Parsing line if verbose > 1.

By: Clod Patry (junky) 2004-12-27 13:05:54.000-0600

cyberdjheffer: any updates? does that work fine for you?
any other comments/suggestions before we close this bug?

By: a (cyberdjheffer) 2004-12-27 14:43:07.000-0600

Is your suggestion below implemented in the CLI or in source code?

If you don't want to see the Parsing line, you can just do:
set verbose 1 , cause config.c print Parsing line if verbose > 1.

By: Clod Patry (junky) 2004-12-27 18:29:59.000-0600

yes, combine a verbose 1 with the latest patch above and it should fix your problem. Just confirm us it works fine for you too.

By: a (cyberdjheffer) 2004-12-28 10:17:01.000-0600

The source code patch does work in terms of not displaying the manager logins.  When I issue the CLI command "set verbose 1" the parsing manager lines don't show up on the display, but the status of calls doesn't show up at all.  When I issue the CLI command "set verbose 3" the parsing manager lines do show up on the display, and the status of calls does show up.  Isn't there a way to show the call status and not show the notice of the manager file being parsed?

By: () 2004-12-28 12:46:47.000-0600

(this brian23/brian22942, lost my passwd)
Junky may have to assist me on this one.

Patched files: manager.c, option.h, asterisk.c, cli.c, config.c

Ok, this patch _should_ allow you:
 1. Specify option -M on the command line when starting Asterisk to turn on display of manager connects and parsing message
 2. Use the option show managermsg on/off in the CLI
 3. The new displayconnects option in the general or users tab will be ignored if show managermsg is on/off.

This is not _tested_. Let me know if it works for you.

edited on: 12-28-04 12:48

By: Clod Patry (junky) 2004-12-28 20:02:41.000-0600

hi, instead of creating 2 new accounts, why not asking to get your password?
and all your patches could be merged into 1, which make manipulation faster.

I'll take some time tomorrow to analyze your patches, but if you want, message me on IRC (JunK-Y) and we'll talk about all this, together.

Plus, try to respect all conventions, with right tabulations and do your if/else like this:

if ( blah ) {
    foo;
} else {
    bar;
}

edited on: 12-28-04 20:04

By: Clod Patry (junky) 2004-12-30 17:41:08.000-0600

the idea here is pretty interesting
but when i've tried the compile the 1st patch i've tested (cli.c.diff.txt)
it doesnt work.
here's what's wrong:
       if ((argc != 3)
               return RESULT_SHOWUSAGE;
ya've 2 ((.
and that line:         oldval = option_managermsg;
option_managermsg was not initialized, can i ask the goal of that line too?
and the var option_man_msg isnt initialized.

and vars in config.c won't work neither.

I appreciated if you can test these patches, merge them together, its faster for us to test it. And respect all asterisk standards. (see doc/CODING-GUIDELINES)

Thanks.

edited on: 12-30-04 17:41

By: () 2004-12-31 08:36:25.000-0600

junky:
  I'll work on getting the patch merged into one file and make the necessary corrections. But, since it is the holidays, I won't be able to get anything finalized until next Tuesday or Wednesday. Sorry for the delay.

By: Clod Patry (junky) 2004-12-31 12:34:03.000-0600

i think that would be cool having just a "show managermsg on/off in the CLI".
Turning that off should take off connections+parsing of manager.conf file.

Is there really a need for a -M option, based on the fact that we could enable/disable any debug?
By default, we could enable managermsg.

Another idea could we load all manager.conf in 1 shot, and deal with it when connection comes in for a specific user. I know that would keep in memory a lot of informations, but i doubt there's more then 4-5 users into the manager.conf.

By: () 2005-01-04 15:16:19.000-0600

I have lost interest (and time) in implementing the command-line option.

cyberj: displayconnects_manager.txt is the correct, final patch IMHO.

edited on: 01-04-05 15:19

By: Brian West (bkw918) 2005-01-04 15:49:36.000-0600

KISS - Keep It Stupid Simple :P

Just a config file option only.  Lets get this in and off the tracker NOW.

bkw

By: alric (alric) 2005-01-04 18:23:28.000-0600

In the meantime, can we clean up this plethora of attached files here, as they don't seem to all be applicable anymore?

By: () 2005-01-04 21:03:58.000-0600

displayconnects_manager.txt is the correct patch and manager.conf.sample is a sample configuration. Delete the other files. It has been tested by three people (myself, Junky and cyberjdhef). It is ready for CVS so lets resolve and add to CVS asap.

By: Clod Patry (junky) 2005-01-04 22:40:47.000-0600

so are you saying my patch is fine?
can we port it into CVS now?

By: alric (alric) 2005-01-04 23:07:54.000-0600

Patch applies to 1.0.3, and works great.  It gives a NOTICE for failed to authenticate logins, which I think is good.  Glad someone came up with this patch, any reason we can't commit this?

edited on: 01-04-05 23:18

By: nick (nick) 2005-01-04 23:27:41.000-0600

Tested, works for me.  The new patch uses Unix line endings.

By: Mark Spencer (markster) 2005-01-05 00:20:03.000-0600

Added to CVS, thanks!

By: Digium Subversion (svnbot) 2008-01-15 15:19:56.000-0600

Repository: asterisk
Revision: 4672

U   trunk/configs/manager.conf.sample
U   trunk/manager.c

------------------------------------------------------------------------
r4672 | markster | 2008-01-15 15:19:56 -0600 (Tue, 15 Jan 2008) | 2 lines

Allow connection notifications on manager interface to be hidden (bug ASTERISK-3028)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=4672