asterisk/configs/samples/asterisk.conf.sample

140 lines
6.3 KiB
Plaintext
Raw Permalink Normal View History

[directories](!)
astcachedir => /var/cache/asterisk
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
astkeydir => /var/lib/asterisk
astdatadir => /var/lib/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk
astsbindir => /usr/sbin
[options]
;verbose = 3
;debug = 3
Scope Tracing: A new facility for tracing scope enter/exit What's wrong with ast_debug? ast_debug is fine for general purpose debug output but it's not really geared for scope tracing since it doesn't present its output in a way that makes capturing and analyzing flow through Asterisk easy. How is scope tracing better? Scope tracing uses the same "cleanup" attribute that RAII_VAR uses to print messages to a separate "trace" log level. Even better, the messages are indented and unindented based on a thread-local call depth counter. When output to a separate log file, the output is uncluttered and easy to follow. Here's an example of the output. The leading timestamps and thread ids are removed and the output cut off at 68 columns for commit message restrictions but you get the idea. --> res_pjsip_session.c:3680 handle_incoming PJSIP/1173-00000001 --> res_pjsip_session.c:3661 handle_incoming_response PJSIP/1173 --> res_pjsip_session.c:3669 handle_incoming_response PJSIP/ --> chan_pjsip.c:3265 chan_pjsip_incoming_response_after --> chan_pjsip.c:3194 chan_pjsip_incoming_response P chan_pjsip.c:3245 chan_pjsip_incoming_respon <-- chan_pjsip.c:3194 chan_pjsip_incoming_response P <-- chan_pjsip.c:3265 chan_pjsip_incoming_response_after <-- res_pjsip_session.c:3669 handle_incoming_response PJSIP/ <-- res_pjsip_session.c:3661 handle_incoming_response PJSIP/1173 <-- res_pjsip_session.c:3680 handle_incoming PJSIP/1173-00000001 The messages with the "-->" or "<--" were produced by including the following at the top of each function: SCOPE_TRACE(1, "%s\n", ast_sip_session_get_name(session)); Scope isn't limited to functions any more than RAII_VAR is. You can also see entry and exit from "if", "for", "while", etc blocks. There is also an ast_trace() macro that doesn't track entry or exit but simply outputs a message to the trace log using the current indent level. The deepest message in the sample (chan_pjsip.c:3245) was used to indicate which "case" in a "select" was executed. How do you use it? More documentation is available in logger.h but here's an overview: * Configure with --enable-dev-mode. Like debug, scope tracing is #ifdef'd out if devmode isn't enabled. * Add a SCOPE_TRACE() call to the top of your function. * Set a logger channel in logger.conf to output the "trace" level. * Use the CLI (or cli.conf) to set a trace level similar to setting debug level... CLI> core set trace 2 res_pjsip.so Summary Of Changes: * Added LOG_TRACE logger level. Actually it occupies the slot formerly occupied by the now defunct "event" level. * Added core asterisk option "trace" similar to debug. Includes ability to specify global trace level in asterisk.conf and CLI commands to turn on/off and set levels. Levels can be set globally (probably not a good idea), or by module/source file. * Updated sample asterisk.conf and logger.conf. Tracing is disabled by default in both. * Added __ast_trace() to logger.c which keeps track of the indent level using TLS. It's #ifdef'd out if devmode isn't enabled. * Added ast_trace() and SCOPE_TRACE() macros to logger.h. These are all #ifdef'd out if devmode isn't enabled. Why not use gcc's -finstrument-functions capability? gcc's facility doesn't allow access to local data and doesn't operate on non-function scopes. Known Issues: The only know issue is that we currently don't know the line number where the scope exited. It's reported as the same place the scope was entered. There's probably a way to get around it but it might involve looking at the stack and doing an 'addr2line' to get the line number. Kind of like ast_backtrace() does. Not sure if it's worth it. Change-Id: Ic5ebb859883f9c10a08c5630802de33500cad027
2020-05-14 18:24:19 +00:00
;trace = 0 ; Set the trace level.
;refdebug = yes ; Enable reference count debug logging.
;alwaysfork = yes ; Same as -F at startup.
;nofork = yes ; Same as -f at startup.
;quiet = yes ; Same as -q at startup.
;timestamp = yes ; Same as -T at startup.
;execincludes = yes ; Support #exec in config files.
;console = yes ; Run as console (same as -c at startup).
;highpriority = yes ; Run realtime priority (same as -p at
; startup).
;initcrypto = yes ; Initialize crypto keys (same as -i at
; startup).
;nocolor = yes ; Disable console colors.
;dontwarn = yes ; Disable some warnings.
;dumpcore = yes ; Dump core on crash (same as -g at startup).
;languageprefix = yes ; Use the new sound prefix path syntax.
;systemname = my_system_name ; Prefix uniqueid with a system name for
; Global uniqueness issues.
;autosystemname = yes ; Automatically set systemname to hostname,
; uses 'localhost' on failure, or systemname if
; set.
;mindtmfduration = 80 ; Set minimum DTMF duration in ms (default 80 ms)
; If we get shorter DTMF messages, these will be
; changed to the minimum duration
;maxcalls = 10 ; Maximum amount of calls allowed.
;maxload = 0.9 ; Asterisk stops accepting new calls if the
; load average exceed this limit.
;maxfiles = 1000 ; Maximum amount of openfiles.
;minmemfree = 1 ; In MBs, Asterisk stops accepting new calls if
; the amount of free memory falls below this
; watermark.
;cache_media_frames = yes ; Cache media frames for performance
; Disable this option to help track down media frame
; mismanagement when using valgrind or MALLOC_DEBUG.
; The cache gets in the way of determining if the
; frame is used after being freed and who freed it.
; NOTE: This option has no effect when Asterisk is
; compiled with the LOW_MEMORY compile time option
; enabled because the cache code does not exist.
; Default yes
;cache_record_files = yes ; Cache recorded sound files to another
; directory during recording.
;record_cache_dir = /tmp ; Specify cache directory (used in conjunction
; with cache_record_files).
;transmit_silence = yes ; Transmit silence while a channel is in a
; waiting state, a recording only state, or
; when DTMF is being generated. Note that the
; silence internally is generated in raw signed
; linear format. This means that it must be
; transcoded into the native format of the
; channel before it can be sent to the device.
; It is for this reason that this is optional,
; as it may result in requiring a temporary
; codec translation path for a channel that may
; not otherwise require one.
;transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of
; directly.
;runuser = asterisk ; The user to run as.
;rungroup = asterisk ; The group to run as.
;lightbackground = yes ; If your terminal is set for a light-colored
; background.
;forceblackbackground = yes ; Force the background of the terminal to be
; black, in order for terminal colors to show
; up properly.
;defaultlanguage = en ; Default language
documentation_language = en_US ; Set the language you want documentation
; displayed in. Value is in the same format as
; locale names.
;hideconnect = yes ; Hide messages displayed when a remote console
; connects and disconnects.
;lockconfdir = no ; Protect the directory containing the
; configuration files (/etc/asterisk) with a
; lock.
;stdexten = gosub ; How to invoke the extensions.conf stdexten.
; gosub - Invoke the stdexten using a gosub as
; documented in extensions.conf.sample.
; Default gosub.
;live_dangerously = no ; Enable the execution of 'dangerous' dialplan
; functions and configuration file access from
; external sources (AMI, etc.) These functions
; (such as SHELL) are considered dangerous
; because they can allow privilege escalation.
; Configuration files are considered dangerous
; if they exist outside of the Asterisk
; configuration directory.
; Default no
;entityid=00:11:22:33:44:55 ; Entity ID.
; This is in the form of a MAC address.
; It should be universally unique.
; It must be unique between servers communicating
; with a protocol that uses this value.
; This is currently is used by DUNDi and
; Exchanging Device and Mailbox State
; using protocols: XMPP, Corosync and PJSIP.
;rtp_use_dynamic = yes ; When set to "yes" RTP dynamic payload types
; are assigned dynamically per RTP instance vs.
; allowing Asterisk to globally initialize them
; to pre-designated numbers (defaults to "yes").
;rtp_pt_dynamic = 35 ; Normally the Dynamic RTP Payload Type numbers
; are 96-127, which allow just 32 formats. The
; starting point 35 enables the range 35-63 and
; allows 29 additional formats. When you use
; more than 32 formats in the dynamic range and
; calls are not accepted by a remote
; implementation, please report this and go
; back to value 96.
;hide_messaging_ami_events = no; This option, if enabled, will
; suppress all of the Message/ast_msg_queue channel's
; housekeeping AMI and ARI channel events. This can
; reduce the load on the manager and ARI applications
; when the Digium Phone Module for Asterisk is in use.
;sounds_search_custom_dir = no; This option, if enabled, will
; cause Asterisk to search for sounds files in
; AST_DATA_DIR/sounds/custom before searching the
; normal directories like AST_DATA_DIR/sounds/<lang>.
; Changing the following lines may compromise your security.
;[files]
;astctlpermissions = 0660
;astctlowner = root
;astctlgroup = apache
;astctl = asterisk.ctl