Asterisk - The Open Source Telephony Project GIT-master-2de1a68
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
36
37/*! \ingroup main_options */
39 /*! Allow \#exec in config files */
41 /*! Do not fork() */
43 /*! Keep quiet */
45 /*! Console mode */
47 /*! Run in realtime Linux priority */
49 /*! Initialize keys for RSA authentication */
51 /*! Remote console */
53 /*! Execute an asterisk CLI command upon startup */
55 /*! Don't use termcap colors */
57 /*! Are we fully started yet? */
59 /*! Trascode via signed linear */
61 /*! Invoke the stdexten using the legacy macro method. */
63 /*! Dump core on a seg fault */
65 /*! Cache sound files */
67 /*! Display timestamp in CLI verbose output */
69 /*! Cache media frames for performance */
71 /*! Reconnect */
73 /*! Transmit Silence during Record() and DTMF Generation */
75 /*! Suppress some warnings */
77 /*! Search custom directory for sounds first */
79 /*! Reference Debugging */
81 /*! Always fork, even if verbose or debug settings are non-zero */
83 /*! Disable log/verbose output to remote consoles */
84 AST_OPT_FLAG_MUTE = (1 << 22),
85 /*! There is a per-module debug setting */
87 /*! There is a per-module trace setting */
89 /*! Terminal colors should be adjusted for a light-colored background */
91 /*! Make the global Message channel an internal channel to suppress AMI events */
93 /*! Force black background */
95 /*! Hide remote console connect messages on console */
97 /*! Protect the configuration file path with a lock */
99 /*! Generic PLC */
101 /*! Generic PLC onm equal codecs */
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 */
177
178#define DEFAULT_PJPROJECT_CACHE_POOLS 1
179
180/*! Current pjproject pool caching enable */
182
183/*! Current pjproject logging level */
185
186extern struct ast_flags ast_options;
187
188extern int option_verbose;
189extern int ast_option_maxfiles; /*!< Max number of open file handles (files, sockets) */
190extern int option_debug; /*!< Debugging */
191extern int option_trace; /*!< Debugging */
192extern int ast_option_maxcalls; /*!< Maximum number of simultaneous channels */
193extern unsigned int option_dtmfminduration; /*!< Minimum duration of DTMF (channel.c) in ms */
194extern double ast_option_maxload;
195#if defined(HAVE_SYSINFO)
196extern long option_minmemfree; /*!< Minimum amount of free system memory - stop accepting calls if free memory falls below this watermark */
197#endif
198extern char ast_defaultlanguage[];
199
200extern struct timeval ast_startuptime;
201extern struct timeval ast_lastreloadtime;
202extern pid_t ast_mainpid;
203
205
206extern int ast_language_is_prefix;
207
208extern int ast_option_rtpusedynamic;
209extern unsigned int ast_option_rtpptdynamic;
210
211#if defined(__cplusplus) || defined(c_plusplus)
212}
213#endif
214
215#endif /* _ASTERISK_OPTIONS_H */
int ast_option_rtpusedynamic
Definition: options.c:88
int ast_option_maxfiles
Definition: options.c:81
int option_debug
Definition: options.c:69
int ast_pjproject_max_log_level
Definition: options.c:73
int ast_option_maxcalls
Definition: options.c:79
int ast_option_pjproject_log_level
Definition: options.c:74
double ast_option_maxload
Definition: options.c:77
unsigned int ast_option_rtpptdynamic
Definition: options.c:89
int option_verbose
Definition: options.c:67
struct ast_flags ast_options
Definition: options.c:61
unsigned int option_dtmfminduration
Definition: options.c:83
int ast_option_pjproject_cache_pools
Definition: options.c:75
long option_minmemfree
Definition: options.c:86
int option_trace
Definition: options.c:71
ast_option_flags
Definition: options.h:38
@ AST_OPT_FLAG_TRACE_MODULE
Definition: options.h:88
@ AST_OPT_FLAG_HIGH_PRIORITY
Definition: options.h:48
@ AST_OPT_FLAG_GENERIC_PLC
Definition: options.h:100
@ AST_OPT_FLAG_HIDE_MESSAGING_AMI_EVENTS
Definition: options.h:92
@ AST_OPT_FLAG_TRANSCODE_VIA_SLIN
Definition: options.h:60
@ AST_OPT_FLAG_HIDE_CONSOLE_CONNECT
Definition: options.h:96
@ AST_OPT_FLAG_EXEC_INCLUDES
Definition: options.h:40
@ AST_OPT_FLAG_NO_COLOR
Definition: options.h:56
@ AST_OPT_FLAG_DEBUG_MODULE
Definition: options.h:86
@ AST_OPT_FLAG_NO_FORK
Definition: options.h:42
@ AST_OPT_FLAG_REF_DEBUG
Definition: options.h:80
@ AST_OPT_FLAG_TRANSMIT_SILENCE
Definition: options.h:74
@ AST_OPT_FLAG_ALWAYS_FORK
Definition: options.h:82
@ AST_OPT_FLAG_QUIET
Definition: options.h:44
@ AST_OPT_FLAG_GENERIC_PLC_ON_EQUAL_CODECS
Definition: options.h:102
@ AST_OPT_FLAG_STDEXTEN_MACRO
Definition: options.h:62
@ AST_OPT_FLAG_MUTE
Definition: options.h:84
@ AST_OPT_FLAG_CACHE_MEDIA_FRAMES
Definition: options.h:70
@ AST_OPT_FLAG_TIMESTAMP
Definition: options.h:68
@ AST_OPT_FLAG_LOCK_CONFIG_DIR
Definition: options.h:98
@ AST_OPT_FLAG_EXEC
Definition: options.h:54
@ AST_OPT_FLAG_CACHE_RECORD_FILES
Definition: options.h:66
@ AST_OPT_FLAG_FULLY_BOOTED
Definition: options.h:58
@ AST_OPT_FLAG_INIT_KEYS
Definition: options.h:50
@ AST_OPT_FLAG_CONSOLE
Definition: options.h:46
@ AST_OPT_FLAG_DONT_WARN
Definition: options.h:76
@ AST_OPT_FLAG_FORCE_BLACK_BACKGROUND
Definition: options.h:94
@ AST_OPT_FLAG_LIGHT_BACKGROUND
Definition: options.h:90
@ AST_OPT_FLAG_REMOTE
Definition: options.h:52
@ AST_OPT_FLAG_DUMP_CORE
Definition: options.h:64
@ AST_OPT_FLAG_RECONNECT
Definition: options.h:72
@ AST_OPT_FLAG_SOUNDS_SEARCH_CUSTOM
Definition: options.h:78
char record_cache_dir[AST_CACHE_DIR_LEN]
Definition: options.c:96
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:337
struct timeval ast_startuptime
Definition: asterisk.c:336
pid_t ast_mainpid
Definition: asterisk.c:315
char ast_defaultlanguage[]
Definition: options.c:98
Structure used to handle boolean flags.
Definition: utils.h:199