Wed Jan 8 2020 09:49:48
Asterisk developer's documentation
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
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 */
38
enum
ast_option_flags
{
39
/*! Allow \#exec in config files */
40
AST_OPT_FLAG_EXEC_INCLUDES
= (1 << 0),
41
/*! Do not fork() */
42
AST_OPT_FLAG_NO_FORK
= (1 << 1),
43
/*! Keep quiet */
44
AST_OPT_FLAG_QUIET
= (1 << 2),
45
/*! Console mode */
46
AST_OPT_FLAG_CONSOLE
= (1 << 3),
47
/*! Run in realtime Linux priority */
48
AST_OPT_FLAG_HIGH_PRIORITY
= (1 << 4),
49
/*! Initialize keys for RSA authentication */
50
AST_OPT_FLAG_INIT_KEYS
= (1 << 5),
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 */
56
AST_OPT_FLAG_NO_COLOR
= (1 << 8),
57
/*! Are we fully started yet? */
58
AST_OPT_FLAG_FULLY_BOOTED
= (1 << 9),
59
/*! Trascode via signed linear */
60
AST_OPT_FLAG_TRANSCODE_VIA_SLIN
= (1 << 10),
61
/*! Dump core on a seg fault */
62
AST_OPT_FLAG_DUMP_CORE
= (1 << 12),
63
/*! Cache sound files */
64
AST_OPT_FLAG_CACHE_RECORD_FILES
= (1 << 13),
65
/*! Display timestamp in CLI verbose output */
66
AST_OPT_FLAG_TIMESTAMP
= (1 << 14),
67
/*! Override config */
68
AST_OPT_FLAG_OVERRIDE_CONFIG
= (1 << 15),
69
/*! Reconnect */
70
AST_OPT_FLAG_RECONNECT
= (1 << 16),
71
/*! Transmit Silence during Record() and DTMF Generation */
72
AST_OPT_FLAG_TRANSMIT_SILENCE
= (1 << 17),
73
/*! Suppress some warnings */
74
AST_OPT_FLAG_DONT_WARN
= (1 << 18),
75
/*! End CDRs before the 'h' extension */
76
AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN
= (1 << 19),
77
/*! Use DAHDI Timing for generators if available (No longer used) */
78
AST_OPT_FLAG_INTERNAL_TIMING
= (1 << 20),
79
/*! Always fork, even if verbose or debug settings are non-zero */
80
AST_OPT_FLAG_ALWAYS_FORK
= (1 << 21),
81
/*! Disable log/verbose output to remote consoles */
82
AST_OPT_FLAG_MUTE
= (1 << 22),
83
/*! There is a per-module debug setting */
84
AST_OPT_FLAG_DEBUG_MODULE
= (1 << 23),
85
/*! There is a per-module verbose setting */
86
AST_OPT_FLAG_VERBOSE_MODULE
= (1 << 24),
87
/*! Terminal colors should be adjusted for a light-colored background */
88
AST_OPT_FLAG_LIGHT_BACKGROUND
= (1 << 25),
89
/*! Count Initiated seconds in CDR's */
90
AST_OPT_FLAG_INITIATED_SECONDS
= (1 << 26),
91
/*! Force black background */
92
AST_OPT_FLAG_FORCE_BLACK_BACKGROUND
= (1 << 27),
93
/*! Hide remote console connect messages on console */
94
AST_OPT_FLAG_HIDE_CONSOLE_CONNECT
= (1 << 28),
95
/*! Protect the configuration file path with a lock */
96
AST_OPT_FLAG_LOCK_CONFIG_DIR
= (1 << 29),
97
/*! Generic PLC */
98
AST_OPT_FLAG_GENERIC_PLC
= (1 << 30),
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
136
enum
ast_compat_flags
{
137
AST_COMPAT_DELIM_PBX_REALTIME
= (1 << 0),
138
AST_COMPAT_DELIM_RES_AGI
= (1 << 1),
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
162
extern
char
record_cache_dir
[
AST_CACHE_DIR_LEN
];
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 */
AST_OPT_FLAG_CONSOLE
Definition:
options.h:46
dahdi_chan_name_len
int dahdi_chan_name_len
AST_OPT_FLAG_EXEC
Definition:
options.h:54
AST_OPT_FLAG_LIGHT_BACKGROUND
Definition:
options.h:88
option_debug
int option_debug
Definition:
asterisk.c:182
AST_OPT_FLAG_HIGH_PRIORITY
Definition:
options.h:48
AST_CHANNEL_NAME
#define AST_CHANNEL_NAME
Definition:
options.h:34
dahdi_chan_name
char dahdi_chan_name[AST_CHANNEL_NAME]
AST_OPT_FLAG_HIDE_CONSOLE_CONNECT
Definition:
options.h:94
AST_OPT_FLAG_LOCK_CONFIG_DIR
Definition:
options.h:96
option_verbose
int option_verbose
Definition:
asterisk.c:181
autoconfig.h
defaultlanguage
char defaultlanguage[]
Definition:
asterisk.c:227
option_maxfiles
int option_maxfiles
Definition:
asterisk.c:185
AST_OPT_FLAG_NO_FORK
Definition:
options.h:42
AST_OPT_FLAG_DEBUG_MODULE
Definition:
options.h:84
AST_OPT_FLAG_MUTE
Definition:
options.h:82
AST_COMPAT_APP_SET
Definition:
options.h:139
AST_OPT_FLAG_REMOTE
Definition:
options.h:52
option_minmemfree
long option_minmemfree
Definition:
asterisk.c:187
AST_OPT_FLAG_VERBOSE_MODULE
Definition:
options.h:86
AST_OPT_FLAG_INIT_KEYS
Definition:
options.h:50
ast_language_is_prefix
int ast_language_is_prefix
Definition:
file.c:63
AST_CACHE_DIR_LEN
#define AST_CACHE_DIR_LEN
Definition:
options.h:32
ast_compat_flags
ast_compat_flags
Definition:
options.h:136
ast_lastreloadtime
struct timeval ast_lastreloadtime
Definition:
asterisk.c:219
AST_OPT_FLAG_GENERIC_PLC
Definition:
options.h:98
AST_OPT_FLAG_DUMP_CORE
Definition:
options.h:62
AST_OPT_FLAG_CACHE_RECORD_FILES
Definition:
options.h:64
ast_compat
struct ast_flags ast_compat
Definition:
asterisk.c:179
AST_OPT_FLAG_RECONNECT
Definition:
options.h:70
AST_OPT_FLAG_TRANSCODE_VIA_SLIN
Definition:
options.h:60
AST_OPT_FLAG_QUIET
Definition:
options.h:44
option_maxload
double option_maxload
Definition:
asterisk.c:183
AST_OPT_FLAG_FULLY_BOOTED
Definition:
options.h:58
ast_flags
Structure used to handle boolean flags.
Definition:
utils.h:200
AST_OPT_FLAG_FORCE_BLACK_BACKGROUND
Definition:
options.h:92
AST_OPT_FLAG_TIMESTAMP
Definition:
options.h:66
record_cache_dir
char record_cache_dir[AST_CACHE_DIR_LEN]
Definition:
asterisk.c:195
ast_startuptime
struct timeval ast_startuptime
Definition:
asterisk.c:218
ast_options
struct ast_flags ast_options
Definition:
asterisk.c:178
AST_OPT_FLAG_TRANSMIT_SILENCE
Definition:
options.h:72
ast_mainpid
pid_t ast_mainpid
Definition:
asterisk.c:199
AST_OPT_FLAG_INTERNAL_TIMING
Definition:
options.h:78
AST_OPT_FLAG_OVERRIDE_CONFIG
Definition:
options.h:68
AST_OPT_FLAG_INITIATED_SECONDS
Definition:
options.h:90
AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN
Definition:
options.h:76
AST_OPT_FLAG_EXEC_INCLUDES
Definition:
options.h:40
AST_COMPAT_DELIM_PBX_REALTIME
Definition:
options.h:137
AST_OPT_FLAG_ALWAYS_FORK
Definition:
options.h:80
ast_option_flags
ast_option_flags
Definition:
options.h:38
option_maxcalls
int option_maxcalls
Definition:
asterisk.c:184
AST_OPT_FLAG_NO_COLOR
Definition:
options.h:56
AST_COMPAT_DELIM_RES_AGI
Definition:
options.h:138
AST_OPT_FLAG_DONT_WARN
Definition:
options.h:74
include
asterisk
options.h
Generated by
1.8.5