42#include "../defaults.h"
45#include <sys/resource.h>
49#define AST_MIN_DTMF_DURATION 80
51#define DEFAULT_MONITOR_DIR DEFAULT_SPOOL_DIR "/monitor"
52#define DEFAULT_RECORDING_DIR DEFAULT_SPOOL_DIR "/recording"
84#if defined(HAVE_SYSINFO)
130 .config_dir = DEFAULT_CONFIG_DIR,
131 .module_dir = DEFAULT_MODULE_DIR,
132 .spool_dir = DEFAULT_SPOOL_DIR,
135 .var_dir = DEFAULT_VAR_DIR,
136 .data_dir = DEFAULT_DATA_DIR,
137 .log_dir = DEFAULT_LOG_DIR,
138 .agi_dir = DEFAULT_AGI_DIR,
139 .run_dir = DEFAULT_RUN_DIR,
140 .key_dir = DEFAULT_KEY_DIR,
142 .config_file = DEFAULT_CONFIG_FILE,
143 .db_path = DEFAULT_DB,
144 .sbin_dir = DEFAULT_SBIN_DIR,
145 .pid_path = DEFAULT_PID,
146 .socket_path = DEFAULT_SOCKET,
147 .ctl_file =
"asterisk.ctl",
180 struct rlimit l = {0, 0};
190 if (setrlimit(RLIMIT_NOFILE, &l)) {
217 unsigned int dbdir:1;
218 unsigned int keydir:1;
222 int option_debug_new = 0;
223 int option_trace_new = 0;
224 int option_verbose_new = 0;
248 if (!strcasecmp(v->
name,
"astctlpermissions")) {
250 }
else if (!strcasecmp(v->
name,
"astctlowner")) {
252 }
else if (!strcasecmp(v->
name,
"astctlgroup")) {
254 }
else if (!strcasecmp(v->
name,
"astctl")) {
260 if (!strcasecmp(v->
name,
"astcachedir")) {
262 }
else if (!strcasecmp(v->
name,
"astetcdir")) {
264 }
else if (!strcasecmp(v->
name,
"astspooldir")) {
268 }
else if (!strcasecmp(v->
name,
"astvarlibdir")) {
273 }
else if (!strcasecmp(v->
name,
"astdbdir")) {
276 }
else if (!strcasecmp(v->
name,
"astdatadir")) {
281 }
else if (!strcasecmp(v->
name,
"astkeydir")) {
284 }
else if (!strcasecmp(v->
name,
"astlogdir")) {
286 }
else if (!strcasecmp(v->
name,
"astagidir")) {
288 }
else if (!strcasecmp(v->
name,
"astrundir")) {
291 }
else if (!strcasecmp(v->
name,
"astmoddir")) {
293 }
else if (!strcasecmp(v->
name,
"astsbindir")) {
304 if (!strcasecmp(v->
name,
"verbose")) {
305 option_verbose_new = atoi(v->
value);
307 }
else if (!strcasecmp(v->
name,
"timestamp")) {
310 }
else if (!strcasecmp(v->
name,
"execincludes")) {
313 }
else if (!strcasecmp(v->
name,
"debug")) {
314 option_debug_new = 0;
315 if (sscanf(v->
value,
"%30d", &option_debug_new) != 1) {
318 }
else if (!strcasecmp(v->
name,
"trace")) {
319 option_trace_new = 0;
320 if (sscanf(v->
value,
"%30d", &option_trace_new) != 1) {
323 }
else if (!strcasecmp(v->
name,
"refdebug")) {
327 }
else if (!strcasecmp(v->
name,
"nofork")) {
330 }
else if (!strcasecmp(v->
name,
"alwaysfork")) {
334 }
else if (!strcasecmp(v->
name,
"quiet")) {
337 }
else if (!strcasecmp(v->
name,
"console")) {
342 }
else if (!strcasecmp(v->
name,
"highpriority")) {
345 }
else if (!strcasecmp(v->
name,
"initcrypto")) {
348 }
else if (!strcasecmp(v->
name,
"nocolor")) {
351 }
else if (!strcasecmp(v->
name,
"dontwarn")) {
354 }
else if (!strcasecmp(v->
name,
"dumpcore")) {
357 }
else if (!strcasecmp(v->
name,
"cache_record_files")) {
359#if !defined(LOW_MEMORY)
361 }
else if (!strcasecmp(v->
name,
"cache_media_frames")) {
365 }
else if (!strcasecmp(v->
name,
"record_cache_dir")) {
368 }
else if (!strcasecmp(v->
name,
"transcode_via_sln")) {
371 }
else if (!strcasecmp(v->
name,
"transmit_silence_during_record") || !strcasecmp(v->
name,
"transmit_silence")) {
373 }
else if (!strcasecmp(v->
name,
"mindtmfduration")) {
377 }
else if (!strcasecmp(v->
name,
"rtp_use_dynamic")) {
381 }
else if (!strcasecmp(v->
name,
"rtp_pt_dynamic")) {
384 }
else if (!strcasecmp(v->
name,
"maxcalls")) {
388 }
else if (!strcasecmp(v->
name,
"maxload")) {
392 ast_log(
LOG_ERROR,
"Cannot obtain load average on this system. 'maxload' option disabled.\n");
398 }
else if (!strcasecmp(v->
name,
"maxfiles")) {
404 }
else if (!strcasecmp(v->
name,
"runuser")) {
407 }
else if (!strcasecmp(v->
name,
"rungroup")) {
409 }
else if (!strcasecmp(v->
name,
"systemname")) {
411 }
else if (!strcasecmp(v->
name,
"autosystemname")) {
422 }
else if (!strcasecmp(v->
name,
"languageprefix")) {
424 }
else if (!strcasecmp(v->
name,
"defaultlanguage")) {
426 }
else if (!strcasecmp(v->
name,
"lockmode")) {
427 if (!strcasecmp(v->
value,
"lockfile")) {
429 }
else if (!strcasecmp(v->
value,
"flock")) {
433 "defaulting to 'lockfile'\n", v->
value);
436#if defined(HAVE_SYSINFO)
437 }
else if (!strcasecmp(v->
name,
"minmemfree")) {
444 }
else if (!strcasecmp(v->
name,
"entityid")) {
451 }
else if (!strcasecmp(v->
name,
"lightbackground")) {
453 }
else if (!strcasecmp(v->
name,
"forceblackbackground")) {
455 }
else if (!strcasecmp(v->
name,
"hideconnect")) {
457 }
else if (!strcasecmp(v->
name,
"lockconfdir")) {
459 }
else if (!strcasecmp(v->
name,
"stdexten")) {
461 if (!strcasecmp(v->
value,
"gosub")) {
463 }
else if (!strcasecmp(v->
value,
"macro")) {
467 "'%s' is not a valid setting for the stdexten option, defaulting to 'gosub'\n",
471 }
else if (!strcasecmp(v->
name,
"live_dangerously")) {
473 }
else if (!strcasecmp(v->
name,
"hide_messaging_ami_events")) {
475 }
else if (!strcasecmp(v->
name,
"sounds_search_custom_dir")) {
Prototypes for public functions only of internal interest,.
Asterisk main include file. File version handling, generic pbx functions.
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_pjproject_log_level
double ast_option_maxload
unsigned int ast_option_rtpptdynamic
struct ast_flags ast_options
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()
int getloadavg(double *list, int nelem)
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 boolean flags.
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next
void ast_set_default_eid(struct ast_eid *eid)
Fill in an ast_eid with the default eid of this machine.
#define ast_set2_flag(p, value, flag)
#define ast_clear_flag(p, flag)
#define ast_set_flag(p, flag)
int ast_str_to_eid(struct ast_eid *eid, const char *s)
Convert a string into an EID.