42#include "../defaults.h" 
   46#include <sys/resource.h> 
   50#define AST_MIN_DTMF_DURATION 80 
   52#define DEFAULT_MONITOR_DIR DEFAULT_SPOOL_DIR "/monitor" 
   53#define DEFAULT_RECORDING_DIR DEFAULT_SPOOL_DIR "/recording" 
   85#if defined(HAVE_SYSINFO) 
  131    .config_dir = DEFAULT_CONFIG_DIR,
 
  132    .module_dir = DEFAULT_MODULE_DIR,
 
  133    .spool_dir = DEFAULT_SPOOL_DIR,
 
  136    .var_dir = DEFAULT_VAR_DIR,
 
  137    .data_dir = DEFAULT_DATA_DIR,
 
  138    .log_dir = DEFAULT_LOG_DIR,
 
  139    .agi_dir = DEFAULT_AGI_DIR,
 
  140    .run_dir = DEFAULT_RUN_DIR,
 
  141    .key_dir = DEFAULT_KEY_DIR,
 
  143    .config_file = DEFAULT_CONFIG_FILE,
 
  144    .db_path = DEFAULT_DB,
 
  145    .sbin_dir = DEFAULT_SBIN_DIR,
 
  146    .pid_path = DEFAULT_PID,
 
  147    .socket_path = DEFAULT_SOCKET,
 
  148    .ctl_file = 
"asterisk.ctl",
 
 
  181    struct rlimit l = {0, 0};
 
  191    if (setrlimit(RLIMIT_NOFILE, &l)) {
 
 
  218        unsigned int dbdir:1;
 
  219        unsigned int keydir:1;
 
  223    int option_debug_new = 0;
 
  224    int option_trace_new = 0;
 
  225    int option_verbose_new = 0;
 
  250        if (!strcasecmp(v->
name, 
"astctlpermissions")) {
 
  252        } 
else if (!strcasecmp(v->
name, 
"astctlowner")) {
 
  254        } 
else if (!strcasecmp(v->
name, 
"astctlgroup")) {
 
  256        } 
else if (!strcasecmp(v->
name, 
"astctl")) {
 
  262        if (!strcasecmp(v->
name, 
"astcachedir")) {
 
  264        } 
else if (!strcasecmp(v->
name, 
"astetcdir")) {
 
  266        } 
else if (!strcasecmp(v->
name, 
"astspooldir")) {
 
  270        } 
else if (!strcasecmp(v->
name, 
"astvarlibdir")) {
 
  275        } 
else if (!strcasecmp(v->
name, 
"astdbdir")) {
 
  278        } 
else if (!strcasecmp(v->
name, 
"astdatadir")) {
 
  283        } 
else if (!strcasecmp(v->
name, 
"astkeydir")) {
 
  286        } 
else if (!strcasecmp(v->
name, 
"astlogdir")) {
 
  288        } 
else if (!strcasecmp(v->
name, 
"astagidir")) {
 
  290        } 
else if (!strcasecmp(v->
name, 
"astrundir")) {
 
  293        } 
else if (!strcasecmp(v->
name, 
"astmoddir")) {
 
  295        } 
else if (!strcasecmp(v->
name, 
"astsbindir")) {
 
  306        if (!strcasecmp(v->
name, 
"verbose")) {
 
  307            option_verbose_new = atoi(v->
value);
 
  309        } 
else if (!strcasecmp(v->
name, 
"timestamp")) {
 
  312        } 
else if (!strcasecmp(v->
name, 
"execincludes")) {
 
  315        } 
else if (!strcasecmp(v->
name, 
"debug")) {
 
  316            option_debug_new = 0;
 
  317            if (sscanf(v->
value, 
"%30d", &option_debug_new) != 1) {
 
  320        } 
else if (!strcasecmp(v->
name, 
"trace")) {
 
  321            option_trace_new = 0;
 
  322            if (sscanf(v->
value, 
"%30d", &option_trace_new) != 1) {
 
  325        } 
else if (!strcasecmp(v->
name, 
"refdebug")) {
 
  329        } 
else if (!strcasecmp(v->
name, 
"nofork")) {
 
  332        } 
else if (!strcasecmp(v->
name, 
"alwaysfork")) {
 
  336        } 
else if (!strcasecmp(v->
name, 
"quiet")) {
 
  339        } 
else if (!strcasecmp(v->
name, 
"console")) {
 
  344        } 
else if (!strcasecmp(v->
name, 
"highpriority")) {
 
  347        } 
else if (!strcasecmp(v->
name, 
"initcrypto")) {
 
  350        } 
else if (!strcasecmp(v->
name, 
"nocolor")) {
 
  353        } 
else if (!strcasecmp(v->
name, 
"dontwarn")) {
 
  356        } 
else if (!strcasecmp(v->
name, 
"dumpcore")) {
 
  359        } 
else if (!strcasecmp(v->
name, 
"cache_record_files")) {
 
  361#if !defined(LOW_MEMORY) 
  363        } 
else if (!strcasecmp(v->
name, 
"cache_media_frames")) {
 
  367        } 
else if (!strcasecmp(v->
name, 
"record_cache_dir")) {
 
  370        } 
else if (!strcasecmp(v->
name, 
"transcode_via_sln")) {
 
  373        } 
else if (!strcasecmp(v->
name, 
"transmit_silence_during_record") || !strcasecmp(v->
name, 
"transmit_silence")) {
 
  375        } 
else if (!strcasecmp(v->
name, 
"mindtmfduration")) {
 
  379        } 
else if (!strcasecmp(v->
name, 
"rtp_use_dynamic")) {
 
  383        } 
else if (!strcasecmp(v->
name, 
"rtp_pt_dynamic")) {
 
  386        } 
else if (!strcasecmp(v->
name, 
"maxcalls")) {
 
  390        } 
else if (!strcasecmp(v->
name, 
"maxload")) {
 
  394                ast_log(
LOG_ERROR, 
"Cannot obtain load average on this system. 'maxload' option disabled.\n");
 
  400        } 
else if (!strcasecmp(v->
name, 
"maxfiles")) {
 
  406        } 
else if (!strcasecmp(v->
name, 
"runuser")) {
 
  409        } 
else if (!strcasecmp(v->
name, 
"rungroup")) {
 
  411        } 
else if (!strcasecmp(v->
name, 
"systemname")) {
 
  413        } 
else if (!strcasecmp(v->
name, 
"autosystemname")) {
 
  424        } 
else if (!strcasecmp(v->
name, 
"languageprefix")) {
 
  426        } 
else if (!strcasecmp(v->
name, 
"defaultlanguage")) {
 
  428        } 
else if (!strcasecmp(v->
name, 
"lockmode")) {
 
  429            if (!strcasecmp(v->
value, 
"lockfile")) {
 
  431            } 
else if (!strcasecmp(v->
value, 
"flock")) {
 
  435                    "defaulting to 'lockfile'\n", v->
value);
 
  438#if defined(HAVE_SYSINFO) 
  439        } 
else if (!strcasecmp(v->
name, 
"minmemfree")) {
 
  446        } 
else if (!strcasecmp(v->
name, 
"entityid")) {
 
  453        } 
else if (!strcasecmp(v->
name, 
"lightbackground")) {
 
  455        } 
else if (!strcasecmp(v->
name, 
"forceblackbackground")) {
 
  457        } 
else if (!strcasecmp(v->
name, 
"hideconnect")) {
 
  459        } 
else if (!strcasecmp(v->
name, 
"lockconfdir")) {
 
  461        } 
else if (!strcasecmp(v->
name, 
"stdexten")) {
 
  463            if (!strcasecmp(v->
value, 
"gosub")) {
 
  465            } 
else if (!strcasecmp(v->
value, 
"macro")) {
 
  469                    "'%s' is not a valid setting for the stdexten option, defaulting to 'gosub'\n",
 
  473        } 
else if (!strcasecmp(v->
name, 
"live_dangerously")) {
 
  475        } 
else if (!strcasecmp(v->
name, 
"hide_messaging_ami_events")) {
 
  477        } 
else if (!strcasecmp(v->
name, 
"sounds_search_custom_dir")) {
 
  479        } 
else if (!strcasecmp(v->
name, 
"channel_storage_backend")) {
 
  481        } 
else if (!strcasecmp(v->
name, 
"disable_remote_console_shell")) {
 
 
Prototypes for public functions only of internal interest,.
int getloadavg(double *list, int nelem)
Asterisk main include file. File version handling, generic pbx functions.
int internal_channel_set_current_storage_driver(const char *driver_name)
static int live_dangerously
Set to true (non-zero) to globally allow all dangerous AMI actions to run.
void astman_live_dangerously(int new_live_dangerously)
Enable/disable the inclusion of 'dangerous' configurations outside of the ast_config_AST_CONFIG_DIR.
int ast_option_rtpusedynamic
int ast_pjproject_max_log_level
int ast_option_disable_remote_console_shell
int ast_option_pjproject_log_level
struct ast_flags64 ast_options
double ast_option_maxload
unsigned int ast_option_rtpptdynamic
unsigned int option_dtmfminduration
int ast_option_pjproject_cache_pools
@ AST_OPT_FLAG_HIGH_PRIORITY
@ AST_OPT_FLAG_HIDE_MESSAGING_AMI_EVENTS
@ AST_OPT_FLAG_TRANSCODE_VIA_SLIN
@ AST_OPT_FLAG_HIDE_CONSOLE_CONNECT
@ AST_OPT_FLAG_EXEC_INCLUDES
@ AST_OPT_FLAG_TRANSMIT_SILENCE
@ AST_OPT_FLAG_ALWAYS_FORK
@ AST_OPT_FLAG_STDEXTEN_MACRO
@ AST_OPT_FLAG_CACHE_MEDIA_FRAMES
@ AST_OPT_FLAG_LOCK_CONFIG_DIR
@ AST_OPT_FLAG_CACHE_RECORD_FILES
@ AST_OPT_FLAG_FORCE_BLACK_BACKGROUND
@ AST_OPT_FLAG_LIGHT_BACKGROUND
@ AST_OPT_FLAG_SOUNDS_SEARCH_CUSTOM
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
void ast_set_lock_type(enum AST_LOCK_TYPE type)
Set the type of locks used by ast_lock_path()
Configuration File Parser.
struct ast_config * ast_config_load2(const char *filename, const char *who_asked, struct ast_flags flags)
Load a config file.
#define CONFIG_STATUS_FILEMISSING
#define CONFIG_STATUS_FILEUNCHANGED
#define CONFIG_STATUS_FILEINVALID
int ast_parse_arg(const char *arg, enum ast_parse_flags flags, void *p_result,...)
The argument parsing routine.
void ast_config_destroy(struct ast_config *cfg)
Destroys a config.
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category_name)
Support for logging to various files, console and syslog Configuration in file logger....
static char hostname[MAXHOSTNAMELEN]
const char * ast_config_AST_KEY_DIR
static struct _cfg_paths cfg_paths
char record_cache_dir[AST_CACHE_DIR_LEN]
#define AST_MIN_DTMF_DURATION
const char * ast_config_AST_CACHE_DIR
const char * ast_config_AST_RUN_GROUP
void load_asterisk_conf(void)
const char * ast_config_AST_SOCKET
#define DEFAULT_MONITOR_DIR
const char * ast_config_AST_RUN_USER
const char * ast_config_AST_CTL_PERMISSIONS
void set_asterisk_conf_path(const char *path)
const char * ast_config_AST_CTL_GROUP
const char * ast_config_AST_MODULE_DIR
const char * ast_config_AST_PID
const char * ast_config_AST_RUN_DIR
const char * ast_config_AST_DATA_DIR
const char * ast_config_AST_CONFIG_DIR
char ast_defaultlanguage[MAX_LANGUAGE]
const char * ast_config_AST_SPOOL_DIR
const char * ast_config_AST_AGI_DIR
#define DEFAULT_RECORDING_DIR
const char * ast_config_AST_VAR_DIR
const char * ast_config_AST_SYSTEM_NAME
const char * ast_config_AST_SBIN_DIR
struct ast_eid ast_eid_default
Global EID.
const char * ast_config_AST_CONFIG_FILE
void set_socket_path(const char *path)
const char * ast_config_AST_MONITOR_DIR
const char * ast_config_AST_LOG_DIR
static void set_ulimit(int value)
Set maximum open files.
const char * ast_config_AST_CTL
const char * ast_config_AST_CTL_OWNER
const char * ast_config_AST_DB
const char * ast_config_AST_RECORDING_DIR
Options provided by main asterisk program.
int ast_language_is_prefix
The following variable controls the layout of localized sound files. If 0, use the historical layout ...
#define AST_CACHE_DIR_LEN
#define AST_DEFAULT_OPTIONS
Asterisk file paths, configured in asterisk.conf.
Core PBX routines and definitions.
void pbx_live_dangerously(int new_live_dangerously)
Enable/disable the execution of 'dangerous' functions from external protocols (AMI,...
Pluggable RTP Architecture.
#define AST_RTP_PT_FIRST_DYNAMIC
String manipulation functions.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true"....
static force_inline int attribute_pure ast_strlen_zero(const char *s)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
char monitor_dir[PATH_MAX]
char config_dir[PATH_MAX]
char config_file[PATH_MAX]
char recording_dir[PATH_MAX]
char socket_path[PATH_MAX]
char module_dir[PATH_MAX]
An Entity ID is essentially a MAC address, brief and unique.
Structure used to handle a large number of boolean flags == used only in app_dial?
Structure used to handle boolean flags.
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next
#define ast_set2_flag64(p, value, flag)
#define ast_clear_flag64(p, flag)
void ast_set_default_eid(struct ast_eid *eid)
Fill in an ast_eid with the default eid of this machine.
#define ast_set_flag64(p, flag)
int ast_str_to_eid(struct ast_eid *eid, const char *s)
Convert a string into an EID.