Asterisk - The Open Source Telephony Project
21.4.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
include
asterisk
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
/*! Invoke the stdexten using the legacy macro method. */
62
AST_OPT_FLAG_STDEXTEN_MACRO
= (1 << 11),
63
/*! Dump core on a seg fault */
64
AST_OPT_FLAG_DUMP_CORE
= (1 << 12),
65
/*! Cache sound files */
66
AST_OPT_FLAG_CACHE_RECORD_FILES
= (1 << 13),
67
/*! Display timestamp in CLI verbose output */
68
AST_OPT_FLAG_TIMESTAMP
= (1 << 14),
69
/*! Cache media frames for performance */
70
AST_OPT_FLAG_CACHE_MEDIA_FRAMES
= (1 << 15),
71
/*! Reconnect */
72
AST_OPT_FLAG_RECONNECT
= (1 << 16),
73
/*! Transmit Silence during Record() and DTMF Generation */
74
AST_OPT_FLAG_TRANSMIT_SILENCE
= (1 << 17),
75
/*! Suppress some warnings */
76
AST_OPT_FLAG_DONT_WARN
= (1 << 18),
77
/*! Search custom directory for sounds first */
78
AST_OPT_FLAG_SOUNDS_SEARCH_CUSTOM
= (1 << 19),
79
/*! Reference Debugging */
80
AST_OPT_FLAG_REF_DEBUG
= (1 << 20),
81
/*! Always fork, even if verbose or debug settings are non-zero */
82
AST_OPT_FLAG_ALWAYS_FORK
= (1 << 21),
83
/*! Disable log/verbose output to remote consoles */
84
AST_OPT_FLAG_MUTE
= (1 << 22),
85
/*! There is a per-module debug setting */
86
AST_OPT_FLAG_DEBUG_MODULE
= (1 << 23),
87
/*! There is a per-module trace setting */
88
AST_OPT_FLAG_TRACE_MODULE
= (1 << 24),
89
/*! Terminal colors should be adjusted for a light-colored background */
90
AST_OPT_FLAG_LIGHT_BACKGROUND
= (1 << 25),
91
/*! Make the global Message channel an internal channel to suppress AMI events */
92
AST_OPT_FLAG_HIDE_MESSAGING_AMI_EVENTS
= (1 << 26),
93
/*! Force black background */
94
AST_OPT_FLAG_FORCE_BLACK_BACKGROUND
= (1 << 27),
95
/*! Hide remote console connect messages on console */
96
AST_OPT_FLAG_HIDE_CONSOLE_CONNECT
= (1 << 28),
97
/*! Protect the configuration file path with a lock */
98
AST_OPT_FLAG_LOCK_CONFIG_DIR
= (1 << 29),
99
/*! Generic PLC */
100
AST_OPT_FLAG_GENERIC_PLC
= (1 << 30),
101
/*! Generic PLC onm equal codecs */
102
AST_OPT_FLAG_GENERIC_PLC_ON_EQUAL_CODECS
= (1 << 31),
103
};
104
105
/*! These are the options that set by default when Asterisk starts */
106
#define AST_DEFAULT_OPTIONS (AST_OPT_FLAG_TRANSCODE_VIA_SLIN | AST_OPT_FLAG_CACHE_MEDIA_FRAMES)
107
108
#define ast_opt_exec_includes ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC_INCLUDES)
109
#define ast_opt_no_fork ast_test_flag(&ast_options, AST_OPT_FLAG_NO_FORK)
110
#define ast_opt_quiet ast_test_flag(&ast_options, AST_OPT_FLAG_QUIET)
111
#define ast_opt_console ast_test_flag(&ast_options, AST_OPT_FLAG_CONSOLE)
112
#define ast_opt_high_priority ast_test_flag(&ast_options, AST_OPT_FLAG_HIGH_PRIORITY)
113
#define ast_opt_init_keys ast_test_flag(&ast_options, AST_OPT_FLAG_INIT_KEYS)
114
#define ast_opt_remote ast_test_flag(&ast_options, AST_OPT_FLAG_REMOTE)
115
#define ast_opt_exec ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC)
116
#define ast_opt_no_color ast_test_flag(&ast_options, AST_OPT_FLAG_NO_COLOR)
117
#define ast_fully_booted ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)
118
#define ast_opt_transcode_via_slin ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSCODE_VIA_SLIN)
119
#define ast_opt_dump_core ast_test_flag(&ast_options, AST_OPT_FLAG_DUMP_CORE)
120
#define ast_opt_cache_record_files ast_test_flag(&ast_options, AST_OPT_FLAG_CACHE_RECORD_FILES)
121
#define ast_opt_cache_media_frames ast_test_flag(&ast_options, AST_OPT_FLAG_CACHE_MEDIA_FRAMES)
122
#define ast_opt_timestamp ast_test_flag(&ast_options, AST_OPT_FLAG_TIMESTAMP)
123
#define ast_opt_reconnect ast_test_flag(&ast_options, AST_OPT_FLAG_RECONNECT)
124
#define ast_opt_transmit_silence ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSMIT_SILENCE)
125
#define ast_opt_dont_warn ast_test_flag(&ast_options, AST_OPT_FLAG_DONT_WARN)
126
#define ast_opt_always_fork ast_test_flag(&ast_options, AST_OPT_FLAG_ALWAYS_FORK)
127
#define ast_opt_mute ast_test_flag(&ast_options, AST_OPT_FLAG_MUTE)
128
#define ast_opt_dbg_module ast_test_flag(&ast_options, AST_OPT_FLAG_DEBUG_MODULE)
129
#define ast_opt_trace_module ast_test_flag(&ast_options, AST_OPT_FLAG_TRACE_MODULE)
130
#define ast_opt_light_background ast_test_flag(&ast_options, AST_OPT_FLAG_LIGHT_BACKGROUND)
131
#define ast_opt_force_black_background ast_test_flag(&ast_options, AST_OPT_FLAG_FORCE_BLACK_BACKGROUND)
132
#define ast_opt_hide_connect ast_test_flag(&ast_options, AST_OPT_FLAG_HIDE_CONSOLE_CONNECT)
133
#define ast_opt_lock_confdir ast_test_flag(&ast_options, AST_OPT_FLAG_LOCK_CONFIG_DIR)
134
#define ast_opt_generic_plc ast_test_flag(&ast_options, AST_OPT_FLAG_GENERIC_PLC)
135
#define ast_opt_ref_debug ast_test_flag(&ast_options, AST_OPT_FLAG_REF_DEBUG)
136
#define ast_opt_generic_plc_on_equal_codecs ast_test_flag(&ast_options, AST_OPT_FLAG_GENERIC_PLC_ON_EQUAL_CODECS)
137
#define ast_opt_hide_messaging_ami_events ast_test_flag(&ast_options, AST_OPT_FLAG_HIDE_MESSAGING_AMI_EVENTS)
138
#define ast_opt_sounds_search_custom ast_test_flag(&ast_options, AST_OPT_FLAG_SOUNDS_SEARCH_CUSTOM)
139
140
/*! Maximum log level defined by PJPROJECT. */
141
#define MAX_PJ_LOG_MAX_LEVEL 6
142
/*!
143
* Normal PJPROJECT active log level used by Asterisk.
144
*
145
* These levels are usually mapped to Error and
146
* Warning Asterisk log levels which shouldn't
147
* normally be suppressed.
148
*/
149
#define DEFAULT_PJ_LOG_MAX_LEVEL 2
150
151
/*!
152
* \brief Get maximum log level pjproject was compiled with.
153
*
154
* \details
155
* Determine the maximum log level the pjproject we are running
156
* with supports.
157
*
158
* When pjproject is initially loaded the default log level in
159
* effect is the maximum log level the library was compiled to
160
* generate. We must save this value off somewhere before we
161
* change it to what we want to use as the default level.
162
*
163
* \note This must be done before calling pj_init() so the level
164
* we want to use as the default level is in effect while the
165
* library initializes.
166
*/
167
#define AST_PJPROJECT_INIT_LOG_LEVEL() \
168
do { \
169
if (ast_pjproject_max_log_level < 0) { \
170
ast_pjproject_max_log_level = pj_log_get_level(); \
171
} \
172
pj_log_set_level(ast_option_pjproject_log_level); \
173
} while (0)
174
175
/*! Current linked pjproject maximum logging level */
176
extern
int
ast_pjproject_max_log_level
;
177
178
#define DEFAULT_PJPROJECT_CACHE_POOLS 1
179
180
/*! Current pjproject pool caching enable */
181
extern
int
ast_option_pjproject_cache_pools
;
182
183
/*! Current pjproject logging level */
184
extern
int
ast_option_pjproject_log_level
;
185
186
extern
struct
ast_flags
ast_options;
187
188
extern
int
option_verbose
;
189
extern
int
ast_option_maxfiles
;
/*!< Max number of open file handles (files, sockets) */
190
extern
int
option_debug
;
/*!< Debugging */
191
extern
int
option_trace
;
/*!< Debugging */
192
extern
int
ast_option_maxcalls
;
/*!< Maximum number of simultaneous channels */
193
extern
unsigned
int
option_dtmfminduration
;
/*!< Minimum duration of DTMF (channel.c) in ms */
194
extern
double
ast_option_maxload
;
195
#if defined(HAVE_SYSINFO)
196
extern
long
option_minmemfree
;
/*!< Minimum amount of free system memory - stop accepting calls if free memory falls below this watermark */
197
#endif
198
extern
char
ast_defaultlanguage[];
199
200
extern
struct
timeval ast_startuptime;
201
extern
struct
timeval ast_lastreloadtime;
202
extern
pid_t ast_mainpid;
203
204
extern
char
record_cache_dir[AST_CACHE_DIR_LEN];
205
206
extern
int
ast_language_is_prefix
;
207
208
extern
int
ast_option_rtpusedynamic;
209
extern
unsigned
int
ast_option_rtpptdynamic;
210
211
#if defined(__cplusplus) || defined(c_plusplus)
212
}
213
#endif
214
215
#endif
/* _ASTERISK_OPTIONS_H */
AST_OPT_FLAG_GENERIC_PLC_ON_EQUAL_CODECS
Definition:
options.h:102
ast_option_maxfiles
int ast_option_maxfiles
Definition:
options.c:81
option_dtmfminduration
unsigned int option_dtmfminduration
Definition:
options.c:83
option_debug
int option_debug
Definition:
options.c:69
AST_OPT_FLAG_ALWAYS_FORK
Definition:
options.h:82
AST_OPT_FLAG_TRACE_MODULE
Definition:
options.h:88
AST_OPT_FLAG_FORCE_BLACK_BACKGROUND
Definition:
options.h:94
AST_OPT_FLAG_MUTE
Definition:
options.h:84
ast_pjproject_max_log_level
int ast_pjproject_max_log_level
Definition:
options.c:73
AST_OPT_FLAG_QUIET
Definition:
options.h:44
option_verbose
int option_verbose
Definition:
options.c:67
AST_OPT_FLAG_DEBUG_MODULE
Definition:
options.h:86
AST_OPT_FLAG_EXEC
Definition:
options.h:54
AST_OPT_FLAG_SOUNDS_SEARCH_CUSTOM
Definition:
options.h:78
ast_option_maxload
double ast_option_maxload
Definition:
options.c:77
AST_OPT_FLAG_LOCK_CONFIG_DIR
Definition:
options.h:98
AST_OPT_FLAG_LIGHT_BACKGROUND
Definition:
options.h:90
AST_OPT_FLAG_HIDE_CONSOLE_CONNECT
Definition:
options.h:96
ast_option_maxcalls
int ast_option_maxcalls
Definition:
options.c:79
AST_OPT_FLAG_CONSOLE
Definition:
options.h:46
AST_OPT_FLAG_GENERIC_PLC
Definition:
options.h:100
AST_OPT_FLAG_HIGH_PRIORITY
Definition:
options.h:48
option_minmemfree
long option_minmemfree
Definition:
options.c:86
AST_OPT_FLAG_CACHE_MEDIA_FRAMES
Definition:
options.h:70
AST_OPT_FLAG_RECONNECT
Definition:
options.h:72
ast_language_is_prefix
int ast_language_is_prefix
The following variable controls the layout of localized sound files. If 0, use the historical layout ...
Definition:
file.c:67
AST_OPT_FLAG_CACHE_RECORD_FILES
Definition:
options.h:66
ast_option_pjproject_log_level
int ast_option_pjproject_log_level
Definition:
options.c:74
AST_OPT_FLAG_TRANSCODE_VIA_SLIN
Definition:
options.h:60
ast_option_pjproject_cache_pools
int ast_option_pjproject_cache_pools
Definition:
options.c:75
AST_OPT_FLAG_DONT_WARN
Definition:
options.h:76
AST_OPT_FLAG_TIMESTAMP
Definition:
options.h:68
AST_OPT_FLAG_INIT_KEYS
Definition:
options.h:50
AST_OPT_FLAG_NO_COLOR
Definition:
options.h:56
ast_flags
Structure used to handle boolean flags.
Definition:
utils.h:199
AST_OPT_FLAG_HIDE_MESSAGING_AMI_EVENTS
Definition:
options.h:92
AST_OPT_FLAG_REMOTE
Definition:
options.h:52
AST_OPT_FLAG_STDEXTEN_MACRO
Definition:
options.h:62
AST_OPT_FLAG_TRANSMIT_SILENCE
Definition:
options.h:74
AST_OPT_FLAG_FULLY_BOOTED
Definition:
options.h:58
AST_OPT_FLAG_NO_FORK
Definition:
options.h:42
ast_option_flags
ast_option_flags
Definition:
options.h:38
AST_OPT_FLAG_REF_DEBUG
Definition:
options.h:80
AST_OPT_FLAG_EXEC_INCLUDES
Definition:
options.h:40
AST_OPT_FLAG_DUMP_CORE
Definition:
options.h:64
option_trace
int option_trace
Definition:
options.c:71
Generated on Tue Jul 15 2025 11:50:42 for Asterisk - The Open Source Telephony Project by
1.8.10