Summary:ASTERISK-15233: [patch] [branch] New CLI command: manager show settings
Reporter:Paul Belanger (pabelanger)Labels:
Date Opened:2009-11-28 17:34:48.000-0600Date Closed:2010-05-04 19:44:38
Versions:Frequency of
Environment:Attachments:( 0) issue16343.patch.v3
( 1) issue16343.patch.v5
( 2) manager_show_settings.patch
( 3) manager_show_settings.patch2
Description:Since looking at source is the best way to find default settings for values, it is not the easy way to find tho.  Following 'sip show settings', I've added logic to the manager.  

It also helps to see what values are set within Asterisk.


If no major issues with this patch, I plan to submit more for other core functions in Asterisk.

Branch for this issue:  http://svn.digium.com/svn/asterisk/team/pabelanger/issue16343/
Comments:By: Paul Belanger (pabelanger) 2009-11-28 17:46:43.000-0600

Version 2: Clean up whitespaces, tabbing.

By: Tilghman Lesher (tilghman) 2009-11-29 22:55:54.000-0600

1) Instead of defining a new function called cli_yesno, make it a macro instead.
2) Tabs are verboten within lines.  Use spaces within lines, tabs only at the beginning of lines.  Tabs are ESPECIALLY verboten within constant strings.
3) You have introduced a rather major memory leak with manager_channelvars.  Additionally, you have violated the coding guidelines by causing a variable declaration to no longer be at the beginning of a code block.

By: Paul Belanger (pabelanger) 2009-12-02 10:51:29.000-0600

tilghman: I have made the changes you have requested, but looking for more information about your '...violated the coding guidelines...' statement.  How would you like to see the declaration?

By: Tilghman Lesher (tilghman) 2009-12-02 12:08:03.000-0600

@@ -5627,6 +5678,7 @@
} else if (!strcasecmp(var->name, "httptimeout")) {
newhttptimeout = atoi(val);
} else if (!strcasecmp(var->name, "channelvars")) {
+                 manager_channelvars = ast_strdup(val);
struct manager_channel_variable *mcv;
char *remaining = ast_strdupa(val), *next;

Variable declarations must all be at the beginning of a code block.  With this addition, not only will you leak a string every time channelvars is encountered in the configuration file, but the following two variable declarations are now no longer at the beginning of a code block, which is a violation of the coding guidelines.

By: Leif Madsen (lmadsen) 2010-01-07 10:43:36.000-0600

Pinging reporter -- any updates here?

By: Paul Belanger (pabelanger) 2010-03-14 12:01:50

Sorry for the delay.  I will get a new patch this week.

By: Paul Belanger (pabelanger) 2010-04-26 15:54:02

Created a branch for testing:

By: Paul Belanger (pabelanger) 2010-04-28 20:56:55

Final patch from reviewboard URL.

By: Digium Subversion (svnbot) 2010-05-04 19:44:37

Repository: asterisk
Revision: 261180

U   trunk/CHANGES
U   trunk/include/asterisk/cli.h
U   trunk/include/asterisk/manager.h
U   trunk/main/manager.c

r261180 | pabelanger | 2010-05-04 19:44:37 -0500 (Tue, 04 May 2010) | 12 lines

New 'manager show settings' CLI command.

See the CHANGES file for more details.

(closes issue ASTERISK-15233)
Reported by: pabelanger
     issue16343.patch.v5 uploaded by pabelanger (license 224)
Tested by: pabelanger, tilghman, lmadsen

Review: https://reviewboard.asterisk.org/r/630/