Fri Sep 25 19:28:13 2009

Asterisk developer's documentation


options.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 1999 - 2005, Digium, Inc.
00005  *
00006  * Mark Spencer <markster@digium.com>
00007  *
00008  * See http://www.asterisk.org for more information about
00009  * the Asterisk project. Please do not directly contact
00010  * any of the maintainers of this project for assistance;
00011  * the project provides a web site, mailing lists and IRC
00012  * channels for your use.
00013  *
00014  * This program is free software, distributed under the terms of
00015  * the GNU General Public License Version 2. See the LICENSE file
00016  * at the top of the source tree.
00017  */
00018 
00019 /*! \file
00020  * \brief Options provided by main asterisk program
00021  */
00022 
00023 #ifndef _ASTERISK_OPTIONS_H
00024 #define _ASTERISK_OPTIONS_H
00025 
00026 #if defined(__cplusplus) || defined(c_plusplus)
00027 extern "C" {
00028 #endif
00029 
00030 #define AST_CACHE_DIR_LEN  512
00031 #define AST_FILENAME_MAX   80
00032 
00033 /*! \ingroup main_options */
00034 enum ast_option_flags {
00035    /*! Allow \#exec in config files */
00036    AST_OPT_FLAG_EXEC_INCLUDES = (1 << 0),
00037    /*! Do not fork() */
00038    AST_OPT_FLAG_NO_FORK = (1 << 1),
00039    /*! Keep quiet */
00040    AST_OPT_FLAG_QUIET = (1 << 2),
00041    /*! Console mode */
00042    AST_OPT_FLAG_CONSOLE = (1 << 3),
00043    /*! Run in realtime Linux priority */
00044    AST_OPT_FLAG_HIGH_PRIORITY = (1 << 4),
00045    /*! Initialize keys for RSA authentication */
00046    AST_OPT_FLAG_INIT_KEYS = (1 << 5),
00047    /*! Remote console */
00048    AST_OPT_FLAG_REMOTE = (1 << 6),
00049    /*! Execute an asterisk CLI command upon startup */
00050    AST_OPT_FLAG_EXEC = (1 << 7),
00051    /*! Don't use termcap colors */
00052    AST_OPT_FLAG_NO_COLOR = (1 << 8),
00053    /*! Are we fully started yet? */
00054    AST_OPT_FLAG_FULLY_BOOTED = (1 << 9),
00055    /*! Trascode via signed linear */
00056    AST_OPT_FLAG_TRANSCODE_VIA_SLIN = (1 << 10),
00057    /*! Enable priority jumping in applications */
00058    AST_OPT_FLAG_PRIORITY_JUMPING = (1 << 11),
00059    /*! Dump core on a seg fault */
00060    AST_OPT_FLAG_DUMP_CORE = (1 << 12),
00061    /*! Cache sound files */
00062    AST_OPT_FLAG_CACHE_RECORD_FILES = (1 << 13),
00063    /*! Display timestamp in CLI verbose output */
00064    AST_OPT_FLAG_TIMESTAMP = (1 << 14),
00065    /*! Override config */
00066    AST_OPT_FLAG_OVERRIDE_CONFIG = (1 << 15),
00067    /*! Reconnect */
00068    AST_OPT_FLAG_RECONNECT = (1 << 16),
00069    /*! Transmit Silence during Record() */
00070    AST_OPT_FLAG_TRANSMIT_SILENCE = (1 << 17),
00071    /*! Suppress some warnings */
00072    AST_OPT_FLAG_DONT_WARN = (1 << 18),
00073    /*! End CDRs before the 'h' extension */
00074    AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN = (1 << 19),
00075    /*! Use Zaptel Timing for generators if available */
00076    AST_OPT_FLAG_INTERNAL_TIMING = (1 << 20),
00077    /*! Always fork, even if verbose or debug settings are non-zero */
00078    AST_OPT_FLAG_ALWAYS_FORK = (1 << 21),
00079    /*! Disable log/verbose output to remote consoles */
00080    AST_OPT_FLAG_MUTE = (1 << 22)
00081 };
00082 
00083 /*! These are the options that set by default when Asterisk starts */
00084 #define AST_DEFAULT_OPTIONS AST_OPT_FLAG_TRANSCODE_VIA_SLIN
00085 
00086 #define ast_opt_exec_includes    ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC_INCLUDES)
00087 #define ast_opt_no_fork       ast_test_flag(&ast_options, AST_OPT_FLAG_NO_FORK)
00088 #define ast_opt_quiet         ast_test_flag(&ast_options, AST_OPT_FLAG_QUIET)
00089 #define ast_opt_console       ast_test_flag(&ast_options, AST_OPT_FLAG_CONSOLE)
00090 #define ast_opt_high_priority    ast_test_flag(&ast_options, AST_OPT_FLAG_HIGH_PRIORITY)
00091 #define ast_opt_init_keys     ast_test_flag(&ast_options, AST_OPT_FLAG_INIT_KEYS)
00092 #define ast_opt_remote        ast_test_flag(&ast_options, AST_OPT_FLAG_REMOTE)
00093 #define ast_opt_exec       ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC)
00094 #define ast_opt_no_color      ast_test_flag(&ast_options, AST_OPT_FLAG_NO_COLOR)
00095 #define ast_fully_booted      ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)
00096 #define ast_opt_transcode_via_slin  ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSCODE_VIA_SLIN)
00097 #define ast_opt_priority_jumping ast_test_flag(&ast_options, AST_OPT_FLAG_PRIORITY_JUMPING)
00098 #define ast_opt_dump_core     ast_test_flag(&ast_options, AST_OPT_FLAG_DUMP_CORE)
00099 #define ast_opt_cache_record_files  ast_test_flag(&ast_options, AST_OPT_FLAG_CACHE_RECORD_FILES)
00100 #define ast_opt_timestamp     ast_test_flag(&ast_options, AST_OPT_FLAG_TIMESTAMP)
00101 #define ast_opt_override_config     ast_test_flag(&ast_options, AST_OPT_FLAG_OVERRIDE_CONFIG)
00102 #define ast_opt_reconnect     ast_test_flag(&ast_options, AST_OPT_FLAG_RECONNECT)
00103 #define ast_opt_transmit_silence ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSMIT_SILENCE)
00104 #define ast_opt_dont_warn     ast_test_flag(&ast_options, AST_OPT_FLAG_DONT_WARN)
00105 #define ast_opt_end_cdr_before_h_exten ast_test_flag(&ast_options, AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN)
00106 #define ast_opt_internal_timing     ast_test_flag(&ast_options, AST_OPT_FLAG_INTERNAL_TIMING)
00107 #define ast_opt_always_fork      ast_test_flag(&ast_options, AST_OPT_FLAG_ALWAYS_FORK)
00108 #define ast_opt_mute       ast_test_flag(&ast_options, AST_OPT_FLAG_MUTE)
00109 
00110 extern struct ast_flags ast_options;
00111 
00112 extern int option_verbose;
00113 extern int option_debug;      /*!< Debugging */
00114 extern int option_maxcalls;      /*!< Maximum number of simultaneous channels */
00115 extern double option_maxload;
00116 extern char defaultlanguage[];
00117 
00118 extern time_t ast_startuptime;
00119 extern time_t ast_lastreloadtime;
00120 extern pid_t ast_mainpid;
00121 
00122 extern char record_cache_dir[AST_CACHE_DIR_LEN];
00123 extern char debug_filename[AST_FILENAME_MAX];
00124 
00125 extern int ast_language_is_prefix;
00126 
00127 #if defined(__cplusplus) || defined(c_plusplus)
00128 }
00129 #endif
00130 
00131 #endif /* _ASTERISK_OPTIONS_H */

Generated on Fri Sep 25 19:28:13 2009 for Asterisk - the Open Source PBX by  doxygen 1.5.5