Sat Aug 6 00:39:30 2011

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 #include "asterisk/autoconfig.h"
00027 
00028 #if defined(__cplusplus) || defined(c_plusplus)
00029 extern "C" {
00030 #endif
00031 
00032 #define AST_CACHE_DIR_LEN  512
00033 #define AST_FILENAME_MAX   80
00034 #define AST_CHANNEL_NAME   80
00035 
00036 /*! \ingroup main_options */
00037 enum ast_option_flags {
00038    /*! Allow \#exec in config files */
00039    AST_OPT_FLAG_EXEC_INCLUDES = (1 << 0),
00040    /*! Do not fork() */
00041    AST_OPT_FLAG_NO_FORK = (1 << 1),
00042    /*! Keep quiet */
00043    AST_OPT_FLAG_QUIET = (1 << 2),
00044    /*! Console mode */
00045    AST_OPT_FLAG_CONSOLE = (1 << 3),
00046    /*! Run in realtime Linux priority */
00047    AST_OPT_FLAG_HIGH_PRIORITY = (1 << 4),
00048    /*! Initialize keys for RSA authentication */
00049    AST_OPT_FLAG_INIT_KEYS = (1 << 5),
00050    /*! Remote console */
00051    AST_OPT_FLAG_REMOTE = (1 << 6),
00052    /*! Execute an asterisk CLI command upon startup */
00053    AST_OPT_FLAG_EXEC = (1 << 7),
00054    /*! Don't use termcap colors */
00055    AST_OPT_FLAG_NO_COLOR = (1 << 8),
00056    /*! Are we fully started yet? */
00057    AST_OPT_FLAG_FULLY_BOOTED = (1 << 9),
00058    /*! Trascode via signed linear */
00059    AST_OPT_FLAG_TRANSCODE_VIA_SLIN = (1 << 10),
00060    /*! Enable priority jumping in applications */
00061    AST_OPT_FLAG_PRIORITY_JUMPING = (1 << 11),
00062    /*! Dump core on a seg fault */
00063    AST_OPT_FLAG_DUMP_CORE = (1 << 12),
00064    /*! Cache sound files */
00065    AST_OPT_FLAG_CACHE_RECORD_FILES = (1 << 13),
00066    /*! Display timestamp in CLI verbose output */
00067    AST_OPT_FLAG_TIMESTAMP = (1 << 14),
00068    /*! Override config */
00069    AST_OPT_FLAG_OVERRIDE_CONFIG = (1 << 15),
00070    /*! Reconnect */
00071    AST_OPT_FLAG_RECONNECT = (1 << 16),
00072    /*! Transmit Silence during Record() and DTMF Generation */
00073    AST_OPT_FLAG_TRANSMIT_SILENCE = (1 << 17),
00074    /*! Suppress some warnings */
00075    AST_OPT_FLAG_DONT_WARN = (1 << 18),
00076    /*! End CDRs before the 'h' extension */
00077    AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN = (1 << 19),
00078    /*! Use DAHDI Timing for generators if available */
00079    AST_OPT_FLAG_INTERNAL_TIMING = (1 << 20),
00080    /*! Always fork, even if verbose or debug settings are non-zero */
00081    AST_OPT_FLAG_ALWAYS_FORK = (1 << 21),
00082    /*! Disable log/verbose output to remote consoles */
00083    AST_OPT_FLAG_MUTE = (1 << 22),
00084    /*! Generic PLC */
00085    AST_OPT_FLAG_GENERIC_PLC = (1 << 23),
00086    /*! Send the FullyBooted AMI event when all modules are loaded */
00087    AST_OPT_FLAG_SEND_FULLYBOOTED = (1 << 24),
00088 };
00089 
00090 /*! These are the options that set by default when Asterisk starts */
00091 #if (defined(HAVE_DAHDI_VERSION) && HAVE_DAHDI_VERSION >= 230)
00092 #define AST_DEFAULT_OPTIONS AST_OPT_FLAG_TRANSCODE_VIA_SLIN | AST_OPT_FLAG_INTERNAL_TIMING
00093 #else
00094 #define AST_DEFAULT_OPTIONS AST_OPT_FLAG_TRANSCODE_VIA_SLIN
00095 #endif
00096 
00097 #define ast_opt_exec_includes    ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC_INCLUDES)
00098 #define ast_opt_no_fork       ast_test_flag(&ast_options, AST_OPT_FLAG_NO_FORK)
00099 #define ast_opt_quiet         ast_test_flag(&ast_options, AST_OPT_FLAG_QUIET)
00100 #define ast_opt_console       ast_test_flag(&ast_options, AST_OPT_FLAG_CONSOLE)
00101 #define ast_opt_high_priority    ast_test_flag(&ast_options, AST_OPT_FLAG_HIGH_PRIORITY)
00102 #define ast_opt_init_keys     ast_test_flag(&ast_options, AST_OPT_FLAG_INIT_KEYS)
00103 #define ast_opt_remote        ast_test_flag(&ast_options, AST_OPT_FLAG_REMOTE)
00104 #define ast_opt_exec       ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC)
00105 #define ast_opt_no_color      ast_test_flag(&ast_options, AST_OPT_FLAG_NO_COLOR)
00106 #define ast_fully_booted      ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)
00107 #define ast_opt_transcode_via_slin  ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSCODE_VIA_SLIN)
00108 #define ast_opt_priority_jumping ast_test_flag(&ast_options, AST_OPT_FLAG_PRIORITY_JUMPING)
00109 #define ast_opt_dump_core     ast_test_flag(&ast_options, AST_OPT_FLAG_DUMP_CORE)
00110 #define ast_opt_cache_record_files  ast_test_flag(&ast_options, AST_OPT_FLAG_CACHE_RECORD_FILES)
00111 #define ast_opt_timestamp     ast_test_flag(&ast_options, AST_OPT_FLAG_TIMESTAMP)
00112 #define ast_opt_override_config     ast_test_flag(&ast_options, AST_OPT_FLAG_OVERRIDE_CONFIG)
00113 #define ast_opt_reconnect     ast_test_flag(&ast_options, AST_OPT_FLAG_RECONNECT)
00114 #define ast_opt_transmit_silence ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSMIT_SILENCE)
00115 #define ast_opt_dont_warn     ast_test_flag(&ast_options, AST_OPT_FLAG_DONT_WARN)
00116 #define ast_opt_end_cdr_before_h_exten ast_test_flag(&ast_options, AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN)
00117 #define ast_opt_internal_timing     ast_test_flag(&ast_options, AST_OPT_FLAG_INTERNAL_TIMING)
00118 #define ast_opt_always_fork      ast_test_flag(&ast_options, AST_OPT_FLAG_ALWAYS_FORK)
00119 #define ast_opt_mute       ast_test_flag(&ast_options, AST_OPT_FLAG_MUTE)
00120 #define ast_opt_generic_plc         ast_test_flag(&ast_options, AST_OPT_FLAG_GENERIC_PLC)
00121 #define ast_opt_send_fullybooted ast_test_flag(&ast_options, AST_OPT_FLAG_SEND_FULLYBOOTED)
00122 
00123 extern struct ast_flags ast_options;
00124 
00125 extern int option_verbose;
00126 extern int option_maxfiles;      /*!< Max number of open file handles (files, sockets) */
00127 extern int option_debug;        /*!< Debugging */
00128 extern int option_maxcalls;      /*!< Maximum number of simultaneous channels */
00129 extern double option_maxload; /*!< Max load avg on system */
00130 #if defined(HAVE_SYSINFO)
00131 extern long option_minmemfree;      /*!< Minimum amount of free system memory - stop accepting calls if free memory falls below this watermark */
00132 #endif
00133 extern char defaultlanguage[];
00134 
00135 extern time_t ast_startuptime;
00136 extern time_t ast_lastreloadtime;
00137 extern pid_t ast_mainpid;
00138 
00139 extern char record_cache_dir[AST_CACHE_DIR_LEN];
00140 extern char debug_filename[AST_FILENAME_MAX];
00141 extern const char *dahdi_chan_name;
00142 extern const size_t *dahdi_chan_name_len;
00143 extern const enum dahdi_chan_modes {
00144    CHAN_ZAP_MODE,
00145    CHAN_DAHDI_PLUS_ZAP_MODE,
00146 } *dahdi_chan_mode;
00147    
00148 extern int ast_language_is_prefix;
00149 
00150 #if defined(__cplusplus) || defined(c_plusplus)
00151 }
00152 #endif
00153 
00154 #endif /* _ASTERISK_OPTIONS_H */

Generated on Sat Aug 6 00:39:30 2011 for Asterisk - the Open Source PBX by  doxygen 1.4.7