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