2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 1999 - 2005, Digium, Inc.
6 * Mark Spencer <markster@digium.com>
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.
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.
20 * \brief Options provided by main asterisk program
23 #ifndef _ASTERISK_OPTIONS_H
24 #define _ASTERISK_OPTIONS_H
26 #if defined(__cplusplus) || defined(c_plusplus)
30 #define AST_CACHE_DIR_LEN 512
31 #define AST_FILENAME_MAX 80
33 /*! \ingroup main_options */
34 enum ast_option_flags
{
35 /*! Allow \#exec in config files */
36 AST_OPT_FLAG_EXEC_INCLUDES
= (1 << 0),
38 AST_OPT_FLAG_NO_FORK
= (1 << 1),
40 AST_OPT_FLAG_QUIET
= (1 << 2),
42 AST_OPT_FLAG_CONSOLE
= (1 << 3),
43 /*! Run in realtime Linux priority */
44 AST_OPT_FLAG_HIGH_PRIORITY
= (1 << 4),
45 /*! Initialize keys for RSA authentication */
46 AST_OPT_FLAG_INIT_KEYS
= (1 << 5),
48 AST_OPT_FLAG_REMOTE
= (1 << 6),
49 /*! Execute an asterisk CLI command upon startup */
50 AST_OPT_FLAG_EXEC
= (1 << 7),
51 /*! Don't use termcap colors */
52 AST_OPT_FLAG_NO_COLOR
= (1 << 8),
53 /*! Are we fully started yet? */
54 AST_OPT_FLAG_FULLY_BOOTED
= (1 << 9),
55 /*! Trascode via signed linear */
56 AST_OPT_FLAG_TRANSCODE_VIA_SLIN
= (1 << 10),
57 /*! Enable priority jumping in applications */
58 AST_OPT_FLAG_PRIORITY_JUMPING
= (1 << 11),
59 /*! Dump core on a seg fault */
60 AST_OPT_FLAG_DUMP_CORE
= (1 << 12),
61 /*! Cache sound files */
62 AST_OPT_FLAG_CACHE_RECORD_FILES
= (1 << 13),
63 /*! Display timestamp in CLI verbose output */
64 AST_OPT_FLAG_TIMESTAMP
= (1 << 14),
65 /*! Override config */
66 AST_OPT_FLAG_OVERRIDE_CONFIG
= (1 << 15),
68 AST_OPT_FLAG_RECONNECT
= (1 << 16),
69 /*! Transmit Silence during Record() and DTMF Generation */
70 AST_OPT_FLAG_TRANSMIT_SILENCE
= (1 << 17),
71 /*! Suppress some warnings */
72 AST_OPT_FLAG_DONT_WARN
= (1 << 18),
73 /*! End CDRs before the 'h' extension */
74 AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN
= (1 << 19),
75 /*! Use Zaptel Timing for generators if available */
76 AST_OPT_FLAG_INTERNAL_TIMING
= (1 << 20),
77 /*! Always fork, even if verbose or debug settings are non-zero */
78 AST_OPT_FLAG_ALWAYS_FORK
= (1 << 21),
79 /*! Disable log/verbose output to remote consoles */
80 AST_OPT_FLAG_MUTE
= (1 << 22)
83 /*! These are the options that set by default when Asterisk starts */
84 #define AST_DEFAULT_OPTIONS AST_OPT_FLAG_TRANSCODE_VIA_SLIN
86 #define ast_opt_exec_includes ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC_INCLUDES)
87 #define ast_opt_no_fork ast_test_flag(&ast_options, AST_OPT_FLAG_NO_FORK)
88 #define ast_opt_quiet ast_test_flag(&ast_options, AST_OPT_FLAG_QUIET)
89 #define ast_opt_console ast_test_flag(&ast_options, AST_OPT_FLAG_CONSOLE)
90 #define ast_opt_high_priority ast_test_flag(&ast_options, AST_OPT_FLAG_HIGH_PRIORITY)
91 #define ast_opt_init_keys ast_test_flag(&ast_options, AST_OPT_FLAG_INIT_KEYS)
92 #define ast_opt_remote ast_test_flag(&ast_options, AST_OPT_FLAG_REMOTE)
93 #define ast_opt_exec ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC)
94 #define ast_opt_no_color ast_test_flag(&ast_options, AST_OPT_FLAG_NO_COLOR)
95 #define ast_fully_booted ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)
96 #define ast_opt_transcode_via_slin ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSCODE_VIA_SLIN)
97 #define ast_opt_priority_jumping ast_test_flag(&ast_options, AST_OPT_FLAG_PRIORITY_JUMPING)
98 #define ast_opt_dump_core ast_test_flag(&ast_options, AST_OPT_FLAG_DUMP_CORE)
99 #define ast_opt_cache_record_files ast_test_flag(&ast_options, AST_OPT_FLAG_CACHE_RECORD_FILES)
100 #define ast_opt_timestamp ast_test_flag(&ast_options, AST_OPT_FLAG_TIMESTAMP)
101 #define ast_opt_override_config ast_test_flag(&ast_options, AST_OPT_FLAG_OVERRIDE_CONFIG)
102 #define ast_opt_reconnect ast_test_flag(&ast_options, AST_OPT_FLAG_RECONNECT)
103 #define ast_opt_transmit_silence ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSMIT_SILENCE)
104 #define ast_opt_dont_warn ast_test_flag(&ast_options, AST_OPT_FLAG_DONT_WARN)
105 #define ast_opt_end_cdr_before_h_exten ast_test_flag(&ast_options, AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN)
106 #define ast_opt_internal_timing ast_test_flag(&ast_options, AST_OPT_FLAG_INTERNAL_TIMING)
107 #define ast_opt_always_fork ast_test_flag(&ast_options, AST_OPT_FLAG_ALWAYS_FORK)
108 #define ast_opt_mute ast_test_flag(&ast_options, AST_OPT_FLAG_MUTE)
110 extern struct ast_flags ast_options
;
112 extern int option_verbose
;
113 extern int option_debug
; /*!< Debugging */
114 extern int option_maxcalls
; /*!< Maximum number of simultaneous channels */
115 extern double option_maxload
;
116 extern char defaultlanguage
[];
118 extern time_t ast_startuptime
;
119 extern time_t ast_lastreloadtime
;
120 extern pid_t ast_mainpid
;
122 extern char record_cache_dir
[AST_CACHE_DIR_LEN
];
123 extern char debug_filename
[AST_FILENAME_MAX
];
125 extern int ast_language_is_prefix
;
127 #if defined(__cplusplus) || defined(c_plusplus)
131 #endif /* _ASTERISK_OPTIONS_H */