Wed Jan 8 2020 09:49:48

Asterisk developer's documentation


options.h
Go to the documentation of this file.
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 1999 - 2005, Digium, Inc.
5  *
6  * Mark Spencer <markster@digium.com>
7  *
8  * See http://www.asterisk.org for more information about
9  * the Asterisk project. Please do not directly contact
10  * any of the maintainers of this project for assistance;
11  * the project provides a web site, mailing lists and IRC
12  * channels for your use.
13  *
14  * This program is free software, distributed under the terms of
15  * the GNU General Public License Version 2. See the LICENSE file
16  * at the top of the source tree.
17  */
18 
19 /*! \file
20  * \brief Options provided by main asterisk program
21  */
22 
23 #ifndef _ASTERISK_OPTIONS_H
24 #define _ASTERISK_OPTIONS_H
25 
26 #include "asterisk/autoconfig.h"
27 
28 #if defined(__cplusplus) || defined(c_plusplus)
29 extern "C" {
30 #endif
31 
32 #define AST_CACHE_DIR_LEN 512
33 #define AST_FILENAME_MAX 80
34 #define AST_CHANNEL_NAME 80 /*!< Max length of an ast_channel name */
35 
36 
37 /*! \ingroup main_options */
39  /*! Allow \#exec in config files */
41  /*! Do not fork() */
43  /*! Keep quiet */
44  AST_OPT_FLAG_QUIET = (1 << 2),
45  /*! Console mode */
47  /*! Run in realtime Linux priority */
49  /*! Initialize keys for RSA authentication */
51  /*! Remote console */
52  AST_OPT_FLAG_REMOTE = (1 << 6),
53  /*! Execute an asterisk CLI command upon startup */
54  AST_OPT_FLAG_EXEC = (1 << 7),
55  /*! Don't use termcap colors */
57  /*! Are we fully started yet? */
59  /*! Trascode via signed linear */
61  /*! Dump core on a seg fault */
63  /*! Cache sound files */
65  /*! Display timestamp in CLI verbose output */
67  /*! Override config */
69  /*! Reconnect */
71  /*! Transmit Silence during Record() and DTMF Generation */
73  /*! Suppress some warnings */
75  /*! End CDRs before the 'h' extension */
77  /*! Use DAHDI Timing for generators if available (No longer used) */
79  /*! Always fork, even if verbose or debug settings are non-zero */
81  /*! Disable log/verbose output to remote consoles */
82  AST_OPT_FLAG_MUTE = (1 << 22),
83  /*! There is a per-module debug setting */
85  /*! There is a per-module verbose setting */
87  /*! Terminal colors should be adjusted for a light-colored background */
89  /*! Count Initiated seconds in CDR's */
91  /*! Force black background */
93  /*! Hide remote console connect messages on console */
95  /*! Protect the configuration file path with a lock */
97  /*! Generic PLC */
99 };
100 
101 /*! These are the options that set by default when Asterisk starts */
102 #define AST_DEFAULT_OPTIONS AST_OPT_FLAG_TRANSCODE_VIA_SLIN
103 
104 #define ast_opt_exec_includes ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC_INCLUDES)
105 #define ast_opt_no_fork ast_test_flag(&ast_options, AST_OPT_FLAG_NO_FORK)
106 #define ast_opt_quiet ast_test_flag(&ast_options, AST_OPT_FLAG_QUIET)
107 #define ast_opt_console ast_test_flag(&ast_options, AST_OPT_FLAG_CONSOLE)
108 #define ast_opt_high_priority ast_test_flag(&ast_options, AST_OPT_FLAG_HIGH_PRIORITY)
109 #define ast_opt_init_keys ast_test_flag(&ast_options, AST_OPT_FLAG_INIT_KEYS)
110 #define ast_opt_remote ast_test_flag(&ast_options, AST_OPT_FLAG_REMOTE)
111 #define ast_opt_exec ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC)
112 #define ast_opt_no_color ast_test_flag(&ast_options, AST_OPT_FLAG_NO_COLOR)
113 #define ast_fully_booted ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)
114 #define ast_opt_transcode_via_slin ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSCODE_VIA_SLIN)
115 #define ast_opt_dump_core ast_test_flag(&ast_options, AST_OPT_FLAG_DUMP_CORE)
116 #define ast_opt_cache_record_files ast_test_flag(&ast_options, AST_OPT_FLAG_CACHE_RECORD_FILES)
117 #define ast_opt_timestamp ast_test_flag(&ast_options, AST_OPT_FLAG_TIMESTAMP)
118 #define ast_opt_override_config ast_test_flag(&ast_options, AST_OPT_FLAG_OVERRIDE_CONFIG)
119 #define ast_opt_reconnect ast_test_flag(&ast_options, AST_OPT_FLAG_RECONNECT)
120 #define ast_opt_transmit_silence ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSMIT_SILENCE)
121 #define ast_opt_dont_warn ast_test_flag(&ast_options, AST_OPT_FLAG_DONT_WARN)
122 #define ast_opt_end_cdr_before_h_exten ast_test_flag(&ast_options, AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN)
123 #define ast_opt_internal_timing ast_test_flag(&ast_options, AST_OPT_FLAG_INTERNAL_TIMING)
124 #define ast_opt_always_fork ast_test_flag(&ast_options, AST_OPT_FLAG_ALWAYS_FORK)
125 #define ast_opt_mute ast_test_flag(&ast_options, AST_OPT_FLAG_MUTE)
126 #define ast_opt_dbg_module ast_test_flag(&ast_options, AST_OPT_FLAG_DEBUG_MODULE)
127 #define ast_opt_verb_module ast_test_flag(&ast_options, AST_OPT_FLAG_VERBOSE_MODULE)
128 #define ast_opt_light_background ast_test_flag(&ast_options, AST_OPT_FLAG_LIGHT_BACKGROUND)
129 #define ast_opt_force_black_background ast_test_flag(&ast_options, AST_OPT_FLAG_FORCE_BLACK_BACKGROUND)
130 #define ast_opt_hide_connect ast_test_flag(&ast_options, AST_OPT_FLAG_HIDE_CONSOLE_CONNECT)
131 #define ast_opt_lock_confdir ast_test_flag(&ast_options, AST_OPT_FLAG_LOCK_CONFIG_DIR)
132 #define ast_opt_generic_plc ast_test_flag(&ast_options, AST_OPT_FLAG_GENERIC_PLC)
133 
134 extern struct ast_flags ast_options;
135 
139  AST_COMPAT_APP_SET = (1 << 2),
140 };
141 
142 #define ast_compat_pbx_realtime ast_test_flag(&ast_compat, AST_COMPAT_DELIM_PBX_REALTIME)
143 #define ast_compat_res_agi ast_test_flag(&ast_compat, AST_COMPAT_DELIM_RES_AGI)
144 #define ast_compat_app_set ast_test_flag(&ast_compat, AST_COMPAT_APP_SET)
145 
146 extern struct ast_flags ast_compat;
147 
148 extern int option_verbose;
149 extern int option_maxfiles; /*!< Max number of open file handles (files, sockets) */
150 extern int option_debug; /*!< Debugging */
151 extern int option_maxcalls; /*!< Maximum number of simultaneous channels */
152 extern double option_maxload;
153 #if defined(HAVE_SYSINFO)
154 extern long option_minmemfree; /*!< Minimum amount of free system memory - stop accepting calls if free memory falls below this watermark */
155 #endif
156 extern char defaultlanguage[];
157 
158 extern struct timeval ast_startuptime;
159 extern struct timeval ast_lastreloadtime;
160 extern pid_t ast_mainpid;
161 
163 extern char dahdi_chan_name[AST_CHANNEL_NAME];
164 extern int dahdi_chan_name_len;
165 
166 extern int ast_language_is_prefix;
167 
168 #if defined(__cplusplus) || defined(c_plusplus)
169 }
170 #endif
171 
172 #endif /* _ASTERISK_OPTIONS_H */
int dahdi_chan_name_len
int option_debug
Definition: asterisk.c:182
#define AST_CHANNEL_NAME
Definition: options.h:34
char dahdi_chan_name[AST_CHANNEL_NAME]
int option_verbose
Definition: asterisk.c:181
char defaultlanguage[]
Definition: asterisk.c:227
int option_maxfiles
Definition: asterisk.c:185
long option_minmemfree
Definition: asterisk.c:187
int ast_language_is_prefix
Definition: file.c:63
#define AST_CACHE_DIR_LEN
Definition: options.h:32
ast_compat_flags
Definition: options.h:136
struct timeval ast_lastreloadtime
Definition: asterisk.c:219
struct ast_flags ast_compat
Definition: asterisk.c:179
double option_maxload
Definition: asterisk.c:183
Structure used to handle boolean flags.
Definition: utils.h:200
char record_cache_dir[AST_CACHE_DIR_LEN]
Definition: asterisk.c:195
struct timeval ast_startuptime
Definition: asterisk.c:218
struct ast_flags ast_options
Definition: asterisk.c:178
pid_t ast_mainpid
Definition: asterisk.c:199
ast_option_flags
Definition: options.h:38
int option_maxcalls
Definition: asterisk.c:184