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) 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")) {
325 #if HAVE_WORKING_FORK 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")) {
413 if (!gethostname(hostname,
sizeof(hostname) - 1)) {
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")) {
const char * ast_config_AST_AGI_DIR
void set_asterisk_conf_path(const char *path)
struct ast_variable * next
Asterisk main include file. File version handling, generic pbx functions.
#define DEFAULT_CONFIG_FILE
void ast_set_lock_type(enum AST_LOCK_TYPE type)
Set the type of locks used by ast_lock_path()
unsigned int option_dtmfminduration
String manipulation functions.
const char * ast_config_AST_RUN_GROUP
#define DEFAULT_CACHE_DIR
static int live_dangerously
Set to true (non-zero) to globally allow all dangerous dialplan functions to run. ...
#define ast_set2_flag(p, value, flag)
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category_name)
const char * ast_config_AST_CTL_GROUP
void set_socket_path(const char *path)
#define AST_DEFAULT_OPTIONS
const char * ast_config_AST_SBIN_DIR
#define ast_set_flag(p, flag)
int ast_pjproject_max_log_level
#define CONFIG_STATUS_FILEINVALID
struct ast_config * ast_config_load2(const char *filename, const char *who_asked, struct ast_flags flags)
Load a config file.
Structure for variables, used for configurations and for channel variables.
const char * ast_config_AST_SYSTEM_NAME
char module_dir[PATH_MAX]
void ast_set_default_eid(struct ast_eid *eid)
Fill in an ast_eid with the default eid of this machine.
double ast_option_maxload
#define AST_RTP_PT_FIRST_DYNAMIC
#define AST_MIN_DTMF_DURATION
const char * ast_config_AST_CONFIG_FILE
const char * ast_config_AST_SOCKET
An Entity ID is essentially a MAC address, brief and unique.
#define ast_strlen_zero(foo)
const char * ast_config_AST_RUN_DIR
const char * ast_config_AST_MONITOR_DIR
Configuration File Parser.
char ast_defaultlanguage[MAX_LANGUAGE]
#define DEFAULT_MONITOR_DIR
const char * ast_config_AST_VAR_DIR
const char * ast_config_AST_DB
Asterisk file paths, configured in asterisk.conf.
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
void ast_config_destroy(struct ast_config *config)
Destroys a config.
int ast_str_to_eid(struct ast_eid *eid, const char *s)
Convert a string into an EID.
int ast_option_pjproject_log_level
char recording_dir[PATH_MAX]
char monitor_dir[PATH_MAX]
const char * ast_config_AST_CTL_OWNER
const char * ast_config_AST_RECORDING_DIR
Core PBX routines and definitions.
#define CONFIG_STATUS_FILEUNCHANGED
const char * ast_config_AST_CONFIG_DIR
void load_asterisk_conf(void)
const char * ast_config_AST_CTL_PERMISSIONS
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true". This function checks to see whether a string passed to it is an indication of an "true" value. It checks to see if the string is "yes", "true", "y", "t", "on" or "1".
int ast_option_pjproject_cache_pools
const char * ast_config_AST_DATA_DIR
const char * ast_config_AST_PID
char record_cache_dir[AST_CACHE_DIR_LEN]
const char * ast_config_AST_LOG_DIR
char config_dir[PATH_MAX]
const char * ast_config_AST_KEY_DIR
void pbx_live_dangerously(int new_live_dangerously)
Enable/disable the execution of 'dangerous' functions from external protocols (AMI, etc.).
int ast_parse_arg(const char *arg, enum ast_parse_flags flags, void *result,...)
The argument parsing routine.
const char * ast_config_AST_SPOOL_DIR
Prototypes for public functions only of internal interest,.
Structure used to handle boolean flags.
#define ast_clear_flag(p, flag)
Support for logging to various files, console and syslog Configuration in file logger.conf.
#define CONFIG_STATUS_FILEMISSING
#define DEFAULT_RECORDING_DIR
#define DEFAULT_SPOOL_DIR
struct ast_flags ast_options
static void set_ulimit(int value)
Set maximum open files.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
char socket_path[PATH_MAX]
const char * ast_config_AST_CTL
static struct ast_str * hostname
int getloadavg(double *list, int nelem)
int ast_option_rtpusedynamic
static struct _cfg_paths cfg_paths
Options provided by main asterisk program.
#define DEFAULT_MODULE_DIR
#define DEFAULT_CONFIG_DIR
char config_file[PATH_MAX]
const char * ast_config_AST_MODULE_DIR
Pluggable RTP Architecture.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
const char * ast_config_AST_CACHE_DIR
unsigned int ast_option_rtpptdynamic
const char * ast_config_AST_RUN_USER
struct ast_eid ast_eid_default
Global EID.