[asterisk-commits] twilson: trunk r168585 - in /trunk: ./ include/asterisk/ main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jan 13 17:00:28 CST 2009
Author: twilson
Date: Tue Jan 13 17:00:27 2009
New Revision: 168585
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168585
Log:
Add option to hide console connect messages
(closes issue #14222)
Reported by: jamesgolovich
Patches:
asterisk-hideconnect.diff.txt uploaded by jamesgolovich (license 176)
Tested by: otherwiseguy
Modified:
trunk/Makefile
trunk/include/asterisk/options.h
trunk/main/asterisk.c
Modified: trunk/Makefile
URL: http://svn.digium.com/svn-view/asterisk/trunk/Makefile?view=diff&rev=168585&r1=168584&r2=168585
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Tue Jan 13 17:00:27 2009
@@ -726,6 +726,7 @@
echo ";rungroup = asterisk ; The group to run as" ; \
echo ";lightbackground = yes ; If your terminal is set for a light-colored background" ; \
echo "documentation_language = en_US ; Set the Language you want Documentation displayed in. Value is in the same format as locale names" ; \
+ echo ";hideconnect = yes ; Hide messages displayed when a remote console connects and disconnects" ; \
echo "" ; \
echo "; Changing the following lines may compromise your security." ; \
echo ";[files]" ; \
Modified: trunk/include/asterisk/options.h
URL: http://svn.digium.com/svn-view/asterisk/trunk/include/asterisk/options.h?view=diff&rev=168585&r1=168584&r2=168585
==============================================================================
--- trunk/include/asterisk/options.h (original)
+++ trunk/include/asterisk/options.h Tue Jan 13 17:00:27 2009
@@ -88,6 +88,8 @@
AST_OPT_FLAG_INITIATED_SECONDS = (1 << 26),
/*! Force black background */
AST_OPT_FLAG_FORCE_BLACK_BACKGROUND = (1 << 27),
+ /*! Hide remote console connect messages on console */
+ AST_OPT_FLAG_HIDE_CONSOLE_CONNECT = (1 << 28),
};
/*! These are the options that set by default when Asterisk starts */
@@ -119,6 +121,7 @@
#define ast_opt_verb_file ast_test_flag(&ast_options, AST_OPT_FLAG_VERBOSE_FILE)
#define ast_opt_light_background ast_test_flag(&ast_options, AST_OPT_FLAG_LIGHT_BACKGROUND)
#define ast_opt_force_black_background ast_test_flag(&ast_options, AST_OPT_FLAG_FORCE_BLACK_BACKGROUND)
+#define ast_opt_hide_connect ast_test_flag(&ast_options, AST_OPT_FLAG_HIDE_CONSOLE_CONNECT)
extern struct ast_flags ast_options;
Modified: trunk/main/asterisk.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/main/asterisk.c?view=diff&rev=168585&r1=168584&r2=168585
==============================================================================
--- trunk/main/asterisk.c (original)
+++ trunk/main/asterisk.c Tue Jan 13 17:00:27 2009
@@ -1212,7 +1212,9 @@
break;
}
}
- ast_verb(3, "Remote UNIX connection disconnected\n");
+ if (!ast_opt_hide_connect) {
+ ast_verb(3, "Remote UNIX connection disconnected\n");
+ }
close(con->fd);
close(con->p[0]);
close(con->p[1]);
@@ -1289,8 +1291,9 @@
fdprint(s, "No more connections allowed\n");
ast_log(LOG_WARNING, "No more connections allowed\n");
close(s);
- } else if (consoles[x].fd > -1)
+ } else if ((consoles[x].fd > -1) && (!ast_opt_hide_connect)) {
ast_verb(3, "Remote UNIX connection\n");
+ }
}
}
}
@@ -2953,6 +2956,8 @@
ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_LIGHT_BACKGROUND);
} else if (!strcasecmp(v->name, "forceblackbackground")) {
ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_FORCE_BLACK_BACKGROUND);
+ } else if (!strcasecmp(v->name, "hideconnect")) {
+ ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_HIDE_CONSOLE_CONNECT);
}
}
for (v = ast_variable_browse(cfg, "compat"); v; v = v->next) {
More information about the asterisk-commits
mailing list