Preface

Whatever

Asterisk Administrator Guide

1. zapata.conf: Zapata telephony interface

;
; Configuration file
;
; You need to restart Asterisk to re-configure the Zap channel
; CLI> reload chan_zap.so
;             will reload the configuration file,
;             but not all configuration options are
;             re-configured during a reload (signalling, as well as
;               PRI and SS7-related settings cannot be changed on a
;               reload.
;
; This file documents many configuration variables.  Normally unless you
; know what a variable means or that it should be changed, there's no
; reason to unrem lines.
;
; remmed-out examples below (those lines that begin with a ';' but no
; space afterwards) typically show a value that is not the defauult value,
; but would make sense under cetain circumstances. The default values
; are usually sane. Thus you should typically not touch them unless you
; know what they mean or you know you should change them.

1.1. Trunk Groups

[trunkgroups]
;
; Trunk groups are used for NFAS or GR-303 connections.
;

1.1.1. trunkgroup

; Group: Defines a trunk group.
;        trunkgroup => <trunkgroup>,<dchannel>[,<backup1>...]
;
;        trunkgroup  is the numerical trunk group to create
;        dchannel    is the zap channel which will have the
;                    d-channel for the trunk.
;        backup1     is an optional list of backup d-channels.
;
;trunkgroup => 1,24,48
;trunkgroup => 1,24
;

1.1.2. spanmap

; Spanmap: Associates a span with a trunk group
;        spanmap => <zapspan>,<trunkgroup>[,<logicalspan>]
;
;        zapspan     is the zap span number to associate
;        trunkgroup  is the trunkgroup (specified above) for the mapping
;        logicalspan is the logical span number within the trunk group to use.
;                    if unspecified, no logical span number is used.
;
;spanmap => 1,1,1
;spanmap => 2,1,2
;spanmap => 3,1,3
;spanmap => 4,1,4

1.2. channels

[channels]
;

1.2.1. language

; Defines the language of the channel
;
;language=en
;

1.2.2. context

; Context for calls. Defaults to 'default'
;
;context=incoming
;

1.2.3. switchtype

; Switchtype:  Only used for PRI.
;
; national:     National ISDN 2 (default)
; dms100:       Nortel DMS100
; 4ess:           AT&T 4ESS
; 5ess:                 Lucent 5ESS
; euroisdn:       EuroISDN (common in Europe)
; ni1:            Old National ISDN 1
; qsig:           Q.SIG
;
;switchtype=euroisdn
;

1.2.4. nfs

; Some switches (AT&T especially) require network specific facility IE
; supported values are currently 'none', 'sdn', 'megacom', 'tollfreemegacom', 'accunet'
;
; nsf cannot be changed on a reload.
;
;nsf=none
;

1.2.5. pridialplan

  ; PRI Dialplan:  Only RARELY used for PRI.
  ; PRI Local Dialplan:  Only RARELY used for PRI (sets the calling number's
  ; numbering plan)
  ; pridialplan and prilocaldialplan cannot be changed on a reload.
  ;
  ; unknown:        Unknown
  ; private:        Private ISDN
  ; local:          Local ISDN
  ; national:       National ISDN
  ; international:  International ISDN
  ; dynamic:        Dynamically selects the appropriate dialplan
  ; redundant:      Same as dynamic, except that the underlying number is not
  ;                 changed (not common)
  ;
  ;pridialplan=national
  ;prilocaldialplan=national
  ;
  ; pridialplan may be also set at dialtime, by prefixing the dialled number with
  ; one of the following letters:
  ; U - Unknown
  ; I - International
  ; N - National
  ; L - Local (Net Specific)
  ; S - Subscriber
  ; V - Abbreviated
  ; R - Reserved (should probably never be used but is included for completeness)
  ;
  ; Additionally, you may also set the following NPI bits (also by prefixing the
  ; dialled string with one of the following letters):
  ; u - Unknown
  ; e - E.163/E.164 (ISDN/telephony)
  ; x - X.121 (Data)
  ; f - F.69 (Telex)
  ; n - National
  ; p - Private
  ; r - Reserved (should probably never be used but is included for completeness)
  ;
  ; You may also set the prilocaldialplan in the same way, but by prefixing the
  ; Caller*ID Number, rather than the dialled number.  Please note that telcos
  ; which require this kind of additional manipulation of the TON/NPI are *rare*.
  ; Most telco PRIs will work fine simply by setting pridialplan to unknown or
  ; dynamic.
  ;
  ;
  ; PRI caller ID prefixes based on the given TON/NPI (dialplan)
  ; This is especially needed for EuroISDN E1-PRIs
  ;
  ; None of the prefix settings can be changed on reload.
  ;
  ; sample 1 for Germany
  ;internationalprefix = 00
  ;nationalprefix = 0
  ;localprefix = 0711
  ;privateprefix = 07115678
  ;unknownprefix =
  ;
  ; sample 2 for Germany
  ;internationalprefix = +
  ;nationalprefix = +49
  ;localprefix = +49711
  ;privateprefix = +497115678
  ;unknownprefix =
  ;
  ; PRI resetinterval: sets the time in seconds between restart of unused
  ; B channels; defaults to 'never'.
  ;
  ;resetinterval = 3600
  ;
  ; Overlap dialing mode (sending overlap digits)
  ; Cannot be changed on a reload.
  ;
  ;overlapdial=yes
  ;
  ; PRI Out of band indications.
  ; Enable this to report Busy and Congestion on a PRI using out-of-band
  ; notification. Inband indication, as used by Asterisk doesn't seem to work
  ; with all telcos.
  ;
  ; outofband:      Signal Busy/Congestion out of band with RELEASE/DISCONNECT
  ; inband:         Signal Busy/Congestion using in-band tones (default)
  ;
  ; priindication cannot be changed on a reload.
  ;
  ;priindication = outofband
  ;
  ; If you need to override the existing channels selection routine and force all
  ; PRI channels to be marked as exclusively selected, set this to yes.
  ;
  ; priexclusive cannot be changed on a reload.
  ;
  ;priexclusive = yes
  ;
  ; ISDN Timers
  ; All of the ISDN timers and counters that are used are configurable.  Specify
  ; the timer name, and its value (in ms for timers).
  ; K:    Layer 2 max number of outstanding unacknowledged I frames (default 7)
  ; N200: Layer 2 max number of retransmissions of a frame (default 3)
  ; T200: Layer 2 max time before retransmission of a frame (default 1000 ms)
  ; T203: Layer 2 max time without frames being exchanged (default 10000 ms)
  ; T305: Wait for DISCONNECT acknowledge (default 30000 ms)
  ; T308: Wait for RELEASE acknowledge (default 4000 ms)
  ; T309: Maintain active calls on Layer 2 disconnection (default -1,
  ;       Asterisk clears calls)
  ;       EuroISDN: 6000 to 12000 ms, according to (N200 + 1) x T200 + 2s
  ;       May vary in other ISDN standards (Q.931 1993 : 90000 ms)
  ; T313: Wait for CONNECT acknowledge, CPE side only (default 3000 ms)
  ;
  ;pritimer => t200,1000
  ;pritimer => t313,4000
  ;
  ; To enable transmission of facility-based ISDN supplementary services (such
  ; as caller name from CPE over facility), enable this option.
  ; Cannot be changed on a reload.
  ;
  ;facilityenable = yes
  ;
  ; pritimer cannot be changed on a reload.
  ;
  ; Signalling method. The default is "auto". Valid values:
  ; auto:           Use the current value from Zaptel.
  ; em:             E & M
  ; em_e1:          E & M E1
  ; em_w:           E & M Wink
  ; featd:          Feature Group D (The fake, Adtran style, DTMF)
  ; featdmf:        Feature Group D (The real thing, MF (domestic, US))
  ; featdmf_ta:     Feature Group D (The real thing, MF (domestic, US)) through
  ;                 a Tandem Access point
  ; featb:          Feature Group B (MF (domestic, US))
  ; fgccama       Feature Group C-CAMA (DP DNIS, MF ANI)
  ; fgccamamf     Feature Group C-CAMA MF (MF DNIS, MF ANI)
  ; fxs_ls:         FXS (Loop Start)
  ; fxs_gs:         FXS (Ground Start)
  ; fxs_ks:         FXS (Kewl Start)
  ; fxo_ls:         FXO (Loop Start)
  ; fxo_gs:         FXO (Ground Start)
  ; fxo_ks:         FXO (Kewl Start)
  ; pri_cpe:        PRI signalling, CPE side
  ; pri_net:        PRI signalling, Network side
  ; gr303fxoks_net: GR-303 Signalling, FXO Loopstart, Network side
  ; gr303fxsks_cpe: GR-303 Signalling, FXS Loopstart, CPE side
  ; sf:           SF (Inband Tone) Signalling
  ; sf_w:                 SF Wink
  ; sf_featd:       SF Feature Group D (The fake, Adtran style, DTMF)
  ; sf_featdmf:     SF Feature Group D (The real thing, MF (domestic, US))
  ; sf_featb:       SF Feature Group B (MF (domestic, US))
  ; e911:           E911 (MF) style signalling
  ; ss7:            Signalling System 7
  ;
  ; The following are used for Radio interfaces:
  ; fxs_rx:         Receive audio/COR on an FXS kewlstart interface (FXO at the
  ;                 channel bank)
  ; fxs_tx:         Transmit audio/PTT on an FXS loopstart interface (FXO at the
  ;                 channel bank)
  ; fxo_rx:         Receive audio/COR on an FXO loopstart interface (FXS at the
  ;                 channel bank)
  ; fxo_tx:         Transmit audio/PTT on an FXO groundstart interface (FXS at
  ;                 the channel bank)
  ; em_rx:          Receive audio/COR on an E&M interface (1-way)
  ; em_tx:          Transmit audio/PTT on an E&M interface (1-way)
  ; em_txrx:        Receive audio/COR AND Transmit audio/PTT on an E&M interface
  ;                 (2-way)
  ; em_rxtx:        Same as em_txrx (for our dyslexic friends)
  ; sf_rx:          Receive audio/COR on an SF interface (1-way)
  ; sf_tx:          Transmit audio/PTT on an SF interface (1-way)
  ; sf_txrx:        Receive audio/COR AND Transmit audio/PTT on an SF interface
  ;                 (2-way)
  ; sf_rxtx:        Same as sf_txrx (for our dyslexic friends)
  ; ss7:            Signalling System 7
  ;
  ; signalling of a channel can not be changed on a reload.
  ;
  ;signalling=fxo_ls
  ;
  ; If you have an outbound signalling format that is different from format
  ; specified above (but compatible), you can specify outbound signalling format,
  ; (see below). The 'signalling' format specified will be the inbound signalling
  ; format. If you only specify 'signalling', then it will be the format for
  ; both inbound and outbound.
  ;
  ; outsignalling can only be one of:
  ;   em, em_e1, em_w, sf, sf_w, sf_featd, sf_featdmf, sf_featb, featd,
  ;   featdmf, featdmf_ta, e911, fgccama, fgccamamf
  ;
  ; outsignalling cannot be changed on a reload.
  ;
  ;signalling=featdmf
  ;
  ;outsignalling=featb
  ;
  ; For Feature Group D Tandem access, to set the default CIC and OZZ use these
  ; parameters (Will not be updated on reload):
  ;
  ;defaultozz=0000
  ;defaultcic=303
  ;
  ; A variety of timing parameters can be specified as well
  ; The default values for those are "-1", which is to use the
  ; compile-time defaults of the Zaptel kernel modules. The timing
  ; parameters, (with the standard default from Zaptel):
  ;
  ;    prewink:     Pre-wink time (default 50ms)
  ;    preflash:    Pre-flash time (default 50ms)
  ;    wink:        Wink time (default 150ms)
  ;    flash:       Flash time (default 750ms)
  ;    start:       Start time (default 1500ms)
  ;    rxwink:      Receiver wink time (default 300ms)
  ;    rxflash:     Receiver flashtime (default 1250ms)
  ;    debounce:    Debounce timing (default 600ms)
  ;
  ; None of them will update on a reload.
  ;
  ; How long generated tones (DTMF and MF) will be played on the channel
  ; (in milliseconds).
  ;
  ; This is a global, rather than a per-channel setting. It will not be
  ; updated on a reload.
  ;
  ;toneduration=100
  ;
  ; Whether or not to do distinctive ring detection on FXO lines:
  ;
  ;usedistinctiveringdetection=yes
  ;
  ; enable dring detection after caller ID for those countries like Australia
  ; where the ring cadence is changed *after* the caller ID spill:
  ;
  ;distinctiveringaftercid=yes
  ;
  ; Whether or not to use caller ID:
  ;
usecallerid=yes
  ;
  ; Hide the name part and leave just the number part of the caller ID
  ; string. Only applies to PRI channels.
  ;hidecalleridname=yes
  ;
  ; Type of caller ID signalling in use
  ;     bell     = bell202 as used in US (default)
  ;     v23      = v23 as used in the UK
  ;     v23_jp   = v23 as used in Japan
  ;     dtmf     = DTMF as used in Denmark, Sweden and Netherlands
  ;     smdi     = Use SMDI for caller ID.  Requires SMDI to be enabled (usesmdi).
  ;
  ;cidsignalling=v23
  ;
  ; What signals the start of caller ID
  ;     ring        = a ring signals the start (default)
  ;     polarity    = polarity reversal signals the start
  ;     polarity_IN = polarity reversal signals the start, for India,
  ;                   for dtmf dialtone detection; using DTMF.
  ;                   (see doc/India-CID.txt)
  ;
  ;cidstart=polarity
  ;
  ; Whether or not to hide outgoing caller ID (Override with *67 or *82)
  ; (If your dialplan doesn't catch it)
  ;
  ;hidecallerid=yes
  ;
  ; The following option enables receiving MWI on FXO lines.  The default
  ; value is no.  When this is enabled, and MWI notification indicates on or off,
  ; the script specified by the mwimonitornotify option is executed.  Also, an
  ; internal Asterisk MWI event will be generated so that any other part of
  ; Asterisk that cares about MWI state changes will get notified, just as if
  ; the state change came from app_voicemail. The energy level that must be seen
  ; before starting the MWI detection process can be set with 'mwilevel'.
  ;
  ;mwimonitor=no
  ;mwilevel=512
  ;
  ; This option is used in conjunction with mwimonitor.  This will get executed
  ; when incoming MWI state changes.  The script is passed 2 arguments.  The
  ; first is the corresponding mailbox, and the second is 1 or 0, indicating if
  ; there are messages waiting or not.
  ;
  ;mwimonitornotify=/usr/local/bin/zapnotify.sh
  ;
  ; Whether or not to enable call waiting on internal extensions
  ; With this set to 'yes', busy extensions will hear the call-waiting
  ; tone, and can use hook-flash to switch between callers. The Dial()
  ; app will not return the "BUSY" result for extensions.
  ;
callwaiting=yes
  ;
  ; Whether or not restrict outgoing caller ID (will be sent as ANI only, not
  ; available for the user)
  ; Mostly use with FXS ports
  ;
  ;restrictcid=no
  ;
  ; Whether or not use the caller ID presentation for the outgoing call that the
  ; calling switch is sending.
  ; See README.callingpres. FIXME: file no longer exists.
  ;
usecallingpres=yes
  ;
  ; Some countries (UK) have ring tones with different ring tones (ring-ring),
  ; which means the caller ID needs to be set later on, and not just after
  ; the first ring, as per the default (1).
  ;
  ;sendcalleridafter = 2
  ;
  ;
  ; Support caller ID on Call Waiting
  ;
callwaitingcallerid=yes
  ;
  ; Support three-way calling
  ;
threewaycalling=yes
  ;
  ; For FXS ports (either direct analog or over T1/E1):
  ;   Support flash-hook call transfer (requires three way calling)
  ;   Also enables call parking (overrides the 'canpark' parameter)
  ;
  ; For digital ports using ISDN PRI protocols:
  ;   Support switch-side transfer (called 2BCT, RLT or other names)
  ;   This setting must be enabled on both ports involved, and the
  ;   'facilityenable' setting must also be enabled to allow sending
  ;   the transfer to the ISDN switch, since it sent in a FACILITY
  ;   message.
  ;
transfer=yes
  ;
  ; Allow call parking
  ; ('canpark=no' is overridden by 'transfer=yes')
  ;
canpark=yes
  ;
  ; Support call forward variable
  ;
cancallforward=yes
  ;
  ; Whether or not to support Call Return (*69, if your dialplan doesn't
  ; catch this first)
  ;
callreturn=yes
  ;
  ; Stutter dialtone support: If a mailbox is specified without a voicemail
  ; context, then when voicemail is received in a mailbox in the default
  ; voicemail context in voicemail.conf, taking the phone off hook will cause a
  ; stutter dialtone instead of a normal one.
  ;
  ; If a mailbox is specified *with* a voicemail context, the same will result
  ; if voicemail received in mailbox in the specified voicemail context.
  ;
  ; for default voicemail context, the example below is fine:
  ;
  ;mailbox=1234
  ;
  ; for any other voicemail context, the following will produce the stutter tone:
  ;
  ;mailbox=1234@context
  ;
  ; Enable echo cancellation
  ; Use either "yes", "no", or a power of two from 32 to 256 if you wish to
  ; actually set the number of taps of cancellation.
  ;
  ; Note that when setting the number of taps, the number 256 does not translate
  ; to 256 ms of echo cancellation.  echocancel=256 means 256 / 8 = 32 ms.
  ;
  ; Note that if any of your Zaptel cards have hardware echo cancellers,
  ; then this setting only turns them on and off; numeric settings will
  ; be treated as "yes". There are no special settings required for
  ; hardware echo cancellers; when present and enabled in their kernel
  ; modules, they take precedence over the software echo canceller compiled
  ; into Zaptel automatically.
  ;
  ;
echocancel=yes
  ;
  ; As of Zaptel 1.4.8, some Zaptel echo cancellers (software and hardware)
  ; support adjustable parameters; these parameters can be supplied as
  ; additional options to the 'echocancel' setting. Note that Asterisk
  ; does not attempt to validate the parameters or their values, so if you
  ; supply an invalid parameter you will not know the specific reason it
  ; failed without checking the kernel message log for the error(s)
  ; put there by Zaptel.
  ;
  ;echocancel=128,param1=32,param2=0,param3=14
  ;
  ; Generally, it is not necessary (and in fact undesirable) to echo cancel when
  ; the circuit path is entirely TDM.  You may, however, change this behavior
  ; by enabling the echo canceller during pure TDM bridging below.
  ;
echocancelwhenbridged=yes
  ;
  ; In some cases, the echo canceller doesn't train quickly enough and there
  ; is echo at the beginning of the call.  Enabling echo training will cause
  ; Zaptel to briefly mute the channel, send an impulse, and use the impulse
  ; response to pre-train the echo canceller so it can start out with a much
  ; closer idea of the actual echo.  Value may be "yes", "no", or a number of
  ; milliseconds to delay before training (default = 400)
  ;
  ; WARNING:  In some cases this option can make echo worse!  If you are
  ; trying to debug an echo problem, it is worth checking to see if your echo
  ; is better with the option set to yes or no.  Use whatever setting gives
  ; the best results.
  ;
  ; Note that these parameters do not apply to hardware echo cancellers.
  ;
  ;echotraining=yes
  ;echotraining=800
  ;
  ; If you are having trouble with DTMF detection, you can relax the DTMF
  ; detection parameters.  Relaxing them may make the DTMF detector more likely
  ; to have "talkoff" where DTMF is detected when it shouldn't be.
  ;
  ;relaxdtmf=yes
  ;
  ; You may also set the default receive and transmit gains (in dB)
  ;
  ; Gain Settings: increasing / decreasing the volume level on a channel.
  ;                The values are in db (decibells). A positive number
  ;                increases the volume level on a channel, and a
  ;                negavive value decreases volume level.
  ;
  ;                There are several independent gain settings:
  ;   rxgain: gain for the rx (receive - into Asterisk) channel. Default: 0.0
  ;   txgain: gain for the tx (transmit - out of Asterisk Asterisk) channel.
  ;           Default: 0.0
  ;   cid_rxgain: set the gain just for the caller ID sounds Asterisk
  ;               emits. Default: 5.0 .
  ;rxgain=2.0
  ;txgain=3.0
  ;
  ; Logical groups can be assigned to allow outgoing roll-over.  Groups range
  ; from 0 to 63, and multiple groups can be specified. By default the
  ; channel is not a member of any group.
  ;
  ; Note that an explicit empty value for 'group' is invalid, and will not
  ; override a previous non-empty one. The same applies to callgroup and
  ; pickupgroup as well.
  ;
group=1
  ;
  ; Ring groups (a.k.a. call groups) and pickup groups.  If a phone is ringing
  ; and it is a member of a group which is one of your pickup groups, then
  ; you can answer it by picking up and dialing *8#.  For simple offices, just
  ; make these both the same.  Groups range from 0 to 63.
  ;
callgroup=1
pickupgroup=1
; Channel variable to be set for all calls from this channel
;setvar=CHANNEL=42
;
; Specify whether the channel should be answered immediately or if the simple
; switch should provide dialtone, read digits, etc.
; Note: If immediate=yes the dialplan execution will always start at extension
; 's' priority 1 regardless of the dialed number!
;
;immediate=yes
;
; Specify whether flash-hook transfers to 'busy' channels should complete or
; return to the caller performing the transfer (default is yes).
;
;transfertobusy=no
;
; caller ID can be set to "asreceived" or a specific number if you want to
; override it.  Note that "asreceived" only applies to trunk interfaces.
; fullname sets just the
;
; fullname: sets just the name part.
; cid_number: sets just the number part:
;
;callerid = 123456
;
;callerid = My Name (2564286000)
; Which can also be written as:
;cid_number = 2564286000
;fullname = My Name
;
;callerid = asreceived
;
; should we use the caller ID from incoming call on zap transfer?
;
;useincomingcalleridonzaptransfer = yes
;
; AMA flags affects the recording of Call Detail Records.  If specified
; it may be 'default', 'omit', 'billing', or 'documentation'.
;
;amaflags=default
;
; Channels may be associated with an account code to ease
; billing
;
;accountcode=lss0101
;
; ADSI (Analog Display Services Interface) can be enabled on a per-channel
; basis if you have (or may have) ADSI compatible CPE equipment
;
;adsi=yes
;
; SMDI (Simplified Message Desk Interface) can be enabled on a per-channel
; basis if you would like that channel to behave like an SMDI message desk.
; The SMDI port specified should have already been defined in smdi.conf.  The
; default port is /dev/ttyS0.
;
;usesmdi=yes
;smdiport=/dev/ttyS0
;
; On trunk interfaces (FXS) and E&M interfaces (E&M, Wink, Feature Group D
; etc, it can be useful to perform busy detection either in an effort to
; detect hangup or for detecting busies.  This enables listening for
; the beep-beep busy pattern.
;
;busydetect=yes
;
; If busydetect is enabled, it is also possible to specify how many busy tones
; to wait for before hanging up.  The default is 3, but it might be
; safer to set to 6 or even 8.  Mind that the higher the number, the more
; time that will be needed to hangup a channel, but lowers the probability
; that you will get random hangups.
;
;busycount=6
;
; If busydetect is enabled, it is also possible to specify the cadence of your
; busy signal.  In many countries, it is 500msec on, 500msec off.  Without
; busypattern specified, we'll accept any regular sound-silence pattern that
; repeats <busycount> times as a busy signal.  If you specify busypattern,
; then we'll further check the length of the sound (tone) and silence, which
; will further reduce the chance of a false positive.
;
;busypattern=500,500
;
; NOTE: In make menuselect, you'll find further options to tweak the busy
; detector.  If your country has a busy tone with the same length tone and
; silence (as many countries do), consider enabling the
; BUSYDETECT_COMPARE_TONE_AND_SILENCE option.
;
; To further detect which hangup tone your telco provider is sending, it is
; useful to use the ztmonitor utility to record the audio that main/dsp.c
; is receiving after the caller hangs up.
;
; Use a polarity reversal to mark when a outgoing call is answered by the
; remote party.
;
;answeronpolarityswitch=yes
;
; In some countries, a polarity reversal is used to signal the disconnect of a
; phone line.  If the hanguponpolarityswitch option is selected, the call will
; be considered "hung up" on a polarity reversal.
;
;hanguponpolarityswitch=yes
;
; polarityonanswerdelay: minimal time period (ms) between the answer
;                        polarity switch and hangup polarity switch.
;                        (default: 600ms)
;
; On trunk interfaces (FXS) it can be useful to attempt to follow the progress
; of a call through RINGING, BUSY, and ANSWERING.   If turned on, call
; progress attempts to determine answer, busy, and ringing on phone lines.
; This feature is HIGHLY EXPERIMENTAL and can easily detect false answers,
; so don't count on it being very accurate.
;
; Few zones are supported at the time of this writing, but may be selected
; with "progzone".
;
; progzone also affects the pattern used for buzydetect (unless
; busypattern is set explicitly). The possible values are:
;   us (default)
;   ca (alias for 'us')
;   cr (Costa Rica)
;   br (Brazil, alias for 'cr')
;   uk
;
; This feature can also easily detect false hangups. The symptoms of this is
; being disconnected in the middle of a call for no reason.
;
;callprogress=yes
;progzone=uk
;
; Set the tonezone. Equivalent of the defaultzone settings in
; /etc/zaptel.conf . This sets the tone zone by number.
; Note that you'd still need to load tonezones (loadzone in zaptel.conf).
; The default is -1: not to set anything.
;tonezone = 0 ; 0 is US
;
; FXO (FXS signalled) devices must have a timeout to determine if there was a
; hangup before the line was answered.  This value can be tweaked to shorten
; how long it takes before Zap considers a non-ringing line to have hungup.
;
; ringtimeout will not update on a reload.
;
;ringtimeout=8000
;
; For FXO (FXS signalled) devices, whether to use pulse dial instead of DTMF
; Pulse digits from phones (FXS devices, FXO signalling) are always
; detected.
;
;pulsedial=yes
;
; For fax detection, uncomment one of the following lines.  The default is *OFF*
;
;faxdetect=both
;faxdetect=incoming
;faxdetect=outgoing
;faxdetect=no
;
; This option specifies a preference for which music on hold class this channel
; should listen to when put on hold if the music class has not been set on the
; channel with Set(CHANNEL(musicclass)=whatever) in the dialplan, and the peer
; channel putting this one on hold did not suggest a music class.
;
; If this option is set to "passthrough", then the hold message will always be
; passed through as signalling instead of generating hold music locally. This
; setting is only valid when used on a channel that uses digital signalling.
;
;mohinterpret=default
;
; This option specifies which music on hold class to suggest to the peer channel
; when this channel places the peer on hold.
;
;mohsuggest=default
;
; PRI channels can have an idle extension and a minunused number.  So long as
; at least "minunused" channels are idle, chan_zap will try to call "idledial"
; on them, and then dump them into the PBX in the "idleext" extension (which
; is of the form exten@context).  When channels are needed the "idle" calls
; are disconnected (so long as there are at least "minidle" calls still
; running, of course) to make more channels available.  The primary use of
; this is to create a dynamic service, where idle channels are bundled through
; multilink PPP, thus more efficiently utilizing combined voice/data services
; than conventional fixed mappings/muxings.
;
; Those settings cannot be changed on reload.
;
;idledial=6999
;idleext=6999@dialout
;minunused=2
;minidle=1
;
; Configure jitter buffers in Zapata (each one is 20ms, default is 4)
; This is set globally, rather than per-channel.
;
;jitterbuffers=4
;
;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
; jbenable = yes              ; Enables the use of a jitterbuffer on the receiving side of a
                            ; ZAP channel. Defaults to "no". An enabled jitterbuffer will
                            ; be used only if the sending side can create and the receiving
                            ; side can not accept jitter. The ZAP channel can't accept jitter,
                            ; thus an enabled jitterbuffer on the receive ZAP side will always
                            ; be used if the sending side can create jitter.
; jbmaxsize = 200             ; Max length of the jitterbuffer in milliseconds.
; jbresyncthreshold = 1000    ; Jump in the frame timestamps over which the jitterbuffer is
                            ; resynchronized. Useful to improve the quality of the voice, with
                            ; big jumps in/broken timestamps, usually sent from exotic devices
                            ; and programs. Defaults to 1000.
; jbimpl = fixed              ; Jitterbuffer implementation, used on the receiving side of a ZAP
                            ; channel. Two implementations are currently available - "fixed"
                            ; (with size always equals to jbmax-size) and "adaptive" (with
                            ; variable size, actually the new jb of IAX2). Defaults to fixed.
; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
;-----------------------------------------------------------------------------------
;
; You can define your own custom ring cadences here.  You can define up to 8
; pairs.  If the silence is negative, it indicates where the caller ID spill is
; to be placed.  Also, if you define any custom cadences, the default cadences
; will be turned off.
;
; This setting is global, rather than per-channel. It will not update on
; a reload.
;
; Syntax is:  cadence=ring,silence[,ring,silence[...]]
;
; These are the default cadences:
;
;cadence=125,125,2000,-4000
;cadence=250,250,500,1000,250,250,500,-4000
;cadence=125,125,125,125,125,-4000
;cadence=1000,500,2500,-5000
;
; Each channel consists of the channel number or range.  It inherits the
; parameters that were specified above its declaration.
;
; For GR-303, CRV's are created like channels except they must start with the
; trunk group followed by a colon, e.g.:
;
; crv => 1:1
; crv => 2:1-2,5-8
;
;
;callerid="Green Phone"<(256) 428-6121>
;channel => 1
;callerid="Black Phone"<(256) 428-6122>
;channel => 2
;callerid="CallerID Phone" <(630) 372-1564>
;channel => 3
;callerid="Pac Tel Phone" <(256) 428-6124>
;channel => 4
;callerid="Uniden Dead" <(256) 428-6125>
;channel => 5
;callerid="Cortelco 2500" <(256) 428-6126>
;channel => 6
;callerid="Main TA 750" <(256) 428-6127>
;channel => 44
;
; For example, maybe we have some other channels which start out in a
; different context and use E & M signalling instead.
;
;context=remote
;sigalling=em
;channel => 15
;channel => 16
;signalling=em_w
;
; All those in group 0 I'll use for outgoing calls
;
; Strip most significant digit (9) before sending
;
;stripmsd=1
;callerid=asreceived
;group=0
;signalling=fxs_ls
;channel => 45
;signalling=fxo_ls
;group=1
;callerid="Joe Schmoe" <(256) 428-6131>
;channel => 25
;callerid="Megan May" <(256) 428-6132>
;channel => 26
;callerid="Suzy Queue" <(256) 428-6233>
;channel => 27
;callerid="Larry Moe" <(256) 428-6234>
;channel => 28
;
; Sample PRI (CPE) config:  Specify the switchtype, the signalling as either
; pri_cpe or pri_net for CPE or Network termination, and generally you will
; want to create a single "group" for all channels of the PRI.
;
; switchtype cannot be changed on a reload.
;
; switchtype = national
; signalling = pri_cpe
; group = 2
; channel => 1-23
;
;  Used for distinctive ring support for x100p.
;  You can see the dringX patterns is to set any one of the dringXcontext fields
;  and they will be printed on the console when an inbound call comes in.
;
;  dringXrange is used to change the acceptable ranges for "tone offsets".  Defaults to 10.
;  Note: a range of 0 is NOT what you might expect - it instead forces it to the default.
;  A range of -1 will force it to always match.
;  Anything lower than -1 would presumably cause it to never match.
;
;dring1=95,0,0
;dring1context=internal1
;dring1range=10
;dring2=325,95,0
;dring2context=internal2
;dring2range=10
; If no pattern is matched here is where we go.
;context=default
;channel => 1
; ---------------- Options for use with signalling=ss7 -----------------
; None of them can be changed by a reload.
;
; Variant of SS7 signalling:
; Options are itu and ansi
;ss7type = itu
; SS7 Called Nature of Address Indicator
;
; unknown:        Unknown
; subscriber:     Subscriber
; national:     National
; international:  International
; dynamic:      Dynamically selects the appropriate dialplan
;
;ss7_called_nai=dynamic
;
; SS7 Calling Nature of Address Indicator
;
; unknown:        Unknown
; subscriber:     Subscriber
; national:     National
; international:  International
; dynamic:      Dynamically selects the appropriate dialplan
;
;ss7_calling_nai=dynamic
;
;
; sample 1 for Germany
;ss7_internationalprefix = 00
;ss7_nationalprefix = 0
;ss7_subscriberprefix =
;ss7_unknownprefix =
;
; All settings apply to linkset 1
;linkset = 1
; Point code of the linkset.  For ITU, this is the decimal number
; format of the point code.  For ANSI, this can either be in decimal
; number format or in the xxx-xxx-xxx format
;pointcode = 1
; Point code of node adjacent to this signalling link (Possibly the STP between you and
; your destination).  Point code format follows the same rules as above.
;adjpointcode = 2
; Default point code that you would like to assign to outgoing messages (in case of
; routing through STPs, or using A links).  Point code format follows the same rules
; as above.
;defaultdpc = 3
; Begin CIC (Circuit indication codes) count with this number
;cicbeginswith = 1
; What the MTP3 network indicator bits should be set to.  Choices are
; national, national_spare, international, international_spare
;networkindicator=international
; First signalling channel
;sigchan = 48
; Channels to associate with CICs on this linkset
;channel = 25-47
;
; For more information on setting up SS7, see the README file in libss7 or
; the doc/ss7.txt file in the Asterisk source tree.
; ----------------- SS7 Options ----------------------------------------

Asterisk Developer Guide

1. Asterisk Coding Guidelines

This document gives some basic indication on how the asterisk code is structured. The first part covers the structure and style of individual files. The second part (TO BE COMPLETED) covers the overall code structure and the build architecture.

Please read it to the end to understand in detail how the asterisk code is organized, and to know how to extend asterisk or contribute new code.

We are looking forward to your contributions to Asterisk - the Open Source PBX! As Asterisk is a large and in some parts very time-sensitive application, the code base needs to conform to a common set of coding rules so that many developers can enhance and maintain the code. Code also needs to be reviewed and tested so that it works and follows the general architecture and guide- lines, and is well documented.

Asterisk is published under a dual-licensing scheme by Digium. To be accepted into the codebase, all non-trivial changes must be disclaimed to Digium or placed in the public domain. For more information see http://bugs.digium.com

Patches should be in the form of a unified (-u) diff, made from a checkout from subversion.

/usr/src/asterisk$ svn diff > mypatch

If you would like to only include changes to certain files in the patch, you can list them in the "svn diff" command:

/usr/src/asterisk$ svn diff somefile.c someotherfile.c > mypatch

1.1. PART ONE: CODING GUIDELINES

1.1.1. General rules

1.1.2. File structure and header inclusion

Every C source file should start with a proper copyright and a brief description of the content of the file. Following that, you should immediately put the following lines:

#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 104176 $")

"asterisk.h" resolves OS and compiler dependencies for the basic set of unix functions (data types, system calls, basic I/O libraries) and the basic Asterisk APIs. ASTERISK_FILE_VERSION() stores in the executable information about the file.

Next, you should #include extra headers according to the functionality that your file uses or implements. For each group of functions that you use there is a common header, which covers OS header dependencies and defines the external API of those functions (the equivalent of public members of a class). As an example:

asterisk/module.h
    if you are implementing a module, this should be included in one
    of the files that are linked with the module.
asterisk/fileio.h
    access to extra file I/O functions (stat, fstat, playing with
    directories etc)
asterisk/network.h
    basic network I/O - all of the socket library, select/poll,
    and asterisk-specific (usually either thread-safe or reentrant
    or both) functions to play with socket addresses.
asterisk/app.h
    parsing of application arguments
asterisk/channel.h
    struct ast_channel and functions to manipulate it

For more information look at the headers in include/asterisk/ . These files are usually self-sufficient, i.e. they recursively #include all the extra headers they need.

The equivalent of private members of a class are either directly in the C source file, or in files named asterisk/mod_*.h to make it clear that they are not for inclusion by generic code.

Keep the number of header files small by not including them unnecessarily. Don't cut&paste list of header files from other sources, but only include those you really need. Apart from obvious cases (e.g. module.h which is almost always necessary) write a short comment next to each #include to explain why you need it.

1.1.3. Declaration of functions and variables

1.1.4. Use the internal API

1.1.5. Code formatting

Roughly, Asterisk code formatting guidelines are generally equivalent to the following:

# indent -i4 -ts4 -br -brs -cdw -lp -ce -nbfda -npcs -nprs -npsl -nbbo -saf -sai -saw -cs -l90 foo.c

this means in verbose: -i4: indent level 4 -ts4: tab size 4 -br: braces on if line -brs: braces on struct decl line -cdw: cuddle do while -lp: line up continuation below parenthesis -ce: cuddle else -nbfda: dont break function decl args -npcs: no space after function call names -nprs: no space after parentheses -npsl: dont break procedure type -saf: space after for -sai: space after if -saw: space after while -cs: space after cast -ln90: line length 90 columns

Function calls and arguments should be spaced in a consistent way across the codebase. GOOD: foo(arg1, arg2); GOOD: foo(arg1,arg2); / Acceptable but not preferred / BAD: foo (arg1, arg2); BAD: foo( arg1, arg2 ); BAD: foo(arg1, arg2,arg3);

Don't treat keywords (if, while, do, return) as if they were functions; leave space between the keyword and the expression used (if any). For return, don't even put parentheses around the expression, since they are not required.

There is no shortage of whitespace characters :-) Use them when they make the code easier to read. For example:

for (str=foo;str;str=str->next)

is harder to read than

for (str = foo; str; str = str->next)

Following are examples of how code should be formatted.

int foo(int a, char *s)
{
      return 0;
}
if (foo) {
      bar();
} else {
      blah();
}
switch (foo) {
case BAR:
      blah();
      break;
case OTHER:
      other();
      break;
}
for (x = 0; x < 5; x++)
        if (foo)
                if (bar)
                        baz();

instead do:

for (x = 0; x < 5; x++) {
        if (foo) {
                if (bar) {
                        baz();
                }
        }
}
if (foo) {
      /* .... 50 lines of code ... */
} else {
      result = 0;
      return;
}

Instead, try to minimize the number of lines of code that need to be indented, by only indenting the shortest case of the if statement, like so:

if (!foo) {
      result = 0;
      return;
}

.... 50 lines of code ....

When this technique is used properly, it makes functions much easier to read and follow, especially those with more than one or two setup operations that must succeed for the rest of the function to be able to execute.

Proper use of this technique may occasionally result in the need for a label/goto combination so that error/failure conditions can exit the function while still performing proper cleanup. This is not a bad thing! Use of goto in this situation is encouraged, since it removes the need for excess code indenting without requiring duplication of cleanup code.

Make sure you never use an uninitialized variable. The compiler will usually warn you if you do so. However, do not go too far the other way, and needlessly initialize variables that do not require it. If the first time you use a variable in a function is to store a value there, then initializing it at declaration is pointless, and will generate extra object code and data in the resulting binary with no purpose. When in doubt, trust the compiler to tell you when you need to initialize a variable; if it does not warn you, initialization is not needed.

1.1.6. Function naming

All public functions (those not marked static), must be named "ast_<something>" and have a descriptive name.

As an example, suppose you wanted to take a local function "find_feature", defined as static in a file, and used only in that file, and make it public, and use it in other files. You will have to remove the "static" declaration and define a prototype in an appropriate header file (usually in include/asterisk). A more specific name should be given, such as "ast_find_call_feature".

1.1.7. Variable naming

Name global variables (or local variables when you have a lot of them or are in a long function) something that will make sense to aliens who find your code in 100 years. All variable names should be in lower case, except when following external APIs or specifications that normally use upper- or mixed-case variable names; in that situation, it is preferable to follow the external API/specification for ease of understanding.

Make some indication in the name of global variables which represent options that they are in fact intended to be global. e.g.: static char global_something[80]

Don't use typedef just to shorten the amount of typing; there is no substantial benefit in this: struct foo { int bar; }; typedef struct foo foo_t;

In fact, don't use variable type suffixes at all; it's much preferable to just type struct foo rather than foo_s.

enum option {
  OPT_FOO = 1
  OPT_BAR = 2
  OPT_BAZ = 4
};

static enum option global_option;

static handle_option(const enum option opt)
{
  ...
}
Note
The compiler will not force you to pass an entry from the enum as an argument to this function; this recommendation serves only to make the code clearer and somewhat self-documenting. In addition, when using switch/case blocks that switch on enum values, the compiler will warn you if you forget to handle one or more of the enum values, which can be handy.

1.1.8. String handling

Don't use strncpy for copying whole strings; it does not guarantee that the output buffer will be null-terminated. Use ast_copy_string instead, which is also slightly more efficient (and allows passing the actual buffer size, which makes the code clearer).

Don't use ast_copy_string (or any length-limited copy function) for copying fixed (known at compile time) strings into buffers, if the buffer is something that has been allocated in the function doing the copying. In that case, you know at the time you are writing the code whether the buffer is large enough for the fixed string or not, and if it's not, your code won't work anyway! Use strcpy() for this operation, or directly set the first two characters of the buffer if you are just trying to store a one-character string in the buffer. If you are trying to empty the buffer, just store a single NULL character (\0) in the first byte of the buffer; nothing else is needed, and any other method is wasteful.

In addition, if the previous operations in the function have already determined that the buffer in use is adequately sized to hold the string you wish to put into it (even if you did not allocate the buffer yourself), use a direct strcpy(), as it can be inlined and optimized to simple processor operations, unlike ast_copy_string().

1.1.9. Use of functions

When making applications, always ast_strdupa(data) to a local pointer if you intend to parse the incoming data string.

if (data)
        mydata = ast_strdupa(data);

If you do the same or a similar operation more than one time, make it a function or macro.

Make sure you are not duplicating any functionality already found in an API call somewhere. If you are duplicating functionality found in another static function, consider the value of creating a new API call which can be shared.

1.1.10. Handling of pointers and allocations

Always dereference or localize pointers to things that are not yours like channel members in a channel that is not associated with the current thread and for which you do not have a lock. channame = ast_strdupa(otherchan->name);

Use const on pointer arguments which your function will not be modifying, as this allows the compiler to make certain optimizations. In general, use const on any argument that you have no direct intention of modifying, as it can catch logic/typing errors in your code when you use the argument variable in a way that you did not intend.

As a common example of this point, make an effort to use the lockable linked-list macros found in include/asterisk/linkedlists.h. They are efficient, easy to use and provide every operation that should be necessary for managing a singly-linked list (if something is missing, let us know!). Just because you see other open-coded list implementations in the source tree is no reason to continue making new copies of that code… There are also a number of common string manipulation and timeval manipulation functions in asterisk/strings.h and asterisk/time.h; use them when possible.

Avoid needless malloc(), strdup() calls. If you only need the value in the scope of your function try ast_strdupa() or declare structs on the stack and pass a pointer to them. However, be careful to never call alloca(), ast_strdupa() or similar functions in the argument list of a function you are calling; this can cause very strange stack arrangements and produce unexpected behavior.

-Allocations for structures

When allocating/zeroing memory for a structure, use code like this:

struct foo *tmp;
...
tmp = ast_calloc(1, sizeof(*tmp));

Avoid the combination of ast_malloc() and memset(). Instead, always use ast_calloc(). This will allocate and zero the memory in a single operation. In the case that uninitialized memory is acceptable, there should be a comment in the code that states why this is the case.

Using sizeof(*tmp) instead of sizeof(struct foo) eliminates duplication of the struct foo identifier, which makes the code easier to read and also ensures that if it is copy-and-pasted it won't require as much editing.

The ast_* family of functions for memory allocation are functionally the same. They just add an Asterisk log error message in the case that the allocation fails for some reason. This eliminates the need to generate custom messages throughout the code to log that this has occurred.

-String Duplications

The functions strdup and strndup can not accept a NULL argument. This results in having code like this:

if (str)
        newstr = strdup(str);
else
        newstr = NULL;

However, the ast_strdup and ast_strdupa functions will happily accept a NULL argument without generating an error. The same code can be written as:

newstr = ast_strdup(str);

Furthermore, it is unnecessary to have code that malloc/calloc's for the length of a string (+1 for the terminating \0) and then using strncpy to copy the copy the string into the resulting buffer. This is the exact same thing as using ast_strdup.

1.1.11. CLI Commands

New CLI commands should be named using the module's name, followed by a verb and then any parameters that the command needs. For example:

*CLI> iax2 show peer <peername>

not

*CLI> show iax2 peer <peername>

1.1.12. New dialplan applications/functions

There are two methods of adding functionality to the Asterisk dialplan: applications and functions. Applications (found generally in the apps/ directory) should be collections of code that interact with a channel and/or user in some significant way. Functions (which can be provided by any type of module) are used when the provided functionality is simple… getting/retrieving a value, for example. Functions should also be used when the operation is in no way related to a channel (a computation or string operation, for example).

Applications are registered and invoked using the ast_register_application function; see the apps/app_skel.c file for an example.

Functions are registered using struct ast_custom_function structures and the ast_custom_function_register function.

1.1.13. Doxygen API Documentation Guidelines

When writing Asterisk API documentation the following format should be followed. Do not use the javadoc style.

/*!
 * \brief Do interesting stuff.
 * \param thing1 interesting parameter 1.
 * \param thing2 interesting parameter 2.
 *
 * This function does some interesting stuff.
 *
 * \return zero on success, -1 on error.
 */
int ast_interesting_stuff(int thing1, int thing2)
{
        return 0;
}

Notice the use of the \param, \brief, and \return constructs. These should be used to describe the corresponding pieces of the function being documented. Also notice the blank line after the last \param directive. All doxygen comments must be in one /! / block. If the function or struct does not need an extended description it can be left out.

Please make sure to review the doxygen manual and make liberal use of the \a, \code, \c, \b, \note, \li and \e modifiers as appropriate.

When documenting a static function or an internal structure in a module, use the \internal modifier to ensure that the resulting documentation explicitly says for internal use only.

Structures should be documented as follows.

/*!
 * \brief A very interesting structure.
 */
struct interesting_struct
{
        /*! \brief A data member. */
        int member1;

        int member2; /*!< \brief Another data member. */
}

Note that /! / blocks document the construct immediately following them unless they are written, /!< /, in which case they document the construct preceding them.

It is very much preferred that documentation is not done inline, as done in the previous example for member2. The first reason for this is that it tends to encourage extremely brief, and often pointless, documentation since people try to keep the comment from making the line extremely long. However, if you insist on using inline comments, please indent the documentation with spaces! That way, all of the comments are properly aligned, regardless of what tab size is being used for viewing the code.

1.1.14. Finishing up before you submit your code

When you achieve your desired functionality, make another few refactor passes over the code to optimize it.

Before submitting a patch, read the actual patch file to be sure that all the changes you expect to be there are, and that there are no surprising changes you did not expect. During your development, that part of Asterisk may have changed, so make sure you compare with the latest CVS.

If you are asked to make changes to your patch, there is a good chance the changes will introduce bugs, check it even more at this stage. Also remember that the bug marshal or co-developer that adds comments is only human, they may be in error :-)

If you are going to reuse a computed value, save it in a variable instead of recomputing it over and over. This can prevent you from making a mistake in subsequent computations, making it easier to correct if the formula has an error and may or may not help optimization but will at least help readability.

Just an example (so don't over analyze it, that'd be a shame):

const char *prefix = "pre";
const char *postfix = "post";
char *newname;
char *name = "data";

if (name && (newname = alloca(strlen(name) + strlen(prefix) + strlen(postfix) + 3)))
        snprintf(newname, strlen(name) + strlen(prefix) + strlen(postfix) + 3, "%s/%s/%s", prefix, name, postfix);

...vs this alternative:

const char *prefix = "pre";
const char *postfix = "post";
char *newname;
char *name = "data";
int len = 0;

if (name && (len = strlen(name) + strlen(prefix) + strlen(postfix) + 3) && (newname = alloca(len)))
        snprintf(newname, len, "%s/%s/%s", prefix, name, postfix);

1.1.15. Creating new manager events?

If you create new AMI events, please read manager.txt. Do not re-use existing headers for new purposes, but please re-use existing headers for the same type of data.

Manager events that signal a status are required to have one event name, with a status header that shows the status. The old style, with one event named "ThisEventOn" and another named "ThisEventOff", is no longer approved.

Check manager.txt for more information on manager and existing headers. Please update this file if you add new headers.

1.2. PART TWO: BUILD ARCHITECTURE

The asterisk build architecture relies on autoconf to detect the system configuration, and on a locally developed tool (menuselect) to select build options and modules list, and on gmake to do the build.

The first step, usually to be done soon after a checkout, is running "./configure", which will store its findings in two files:

+ include/asterisk/autoconfig.h
    contains C macros, normally #define HAVE_FOO or HAVE_FOO_H ,
    for all functions and headers that have been detected at build time.
    These are meant to be used by C or C++ source files.
+ makeopts
    contains variables that can be used by Makefiles.
    In addition to the usual CC, LD, ... variables pointing to
    the various build tools, and prefix, includedir ... which are
    useful for generic compiler flags, there are variables
    for each package detected.
    These are normally of the form FOO_INCLUDE=... FOO_LIB=...
    FOO_DIR=... indicating, for each package, the useful libraries
    and header files.

The next step is to run "make menuselect", to extract the dependencies existing between files and modules, and to store build options. menuselect produces two files, both to be read by the Makefile:

+ menuselect.makeopts
    Contains for each subdirectory a list of modules that must be
    excluded from the build, plus some additional informatiom.
+ menuselect.makedeps
    Contains, for each module, a list of packages it depends on.
    For each of these packages, we can collect the relevant INCLUDE
    and LIB files from makeopts. This file is based on information
    in the .c source code files for each module.

The top level Makefile is in charge of setting up the build environment, creating header files with build options, and recursively invoking the subdir Makefiles to produce modules and the main executable.

The sources are split in multiple directories, more or less divided by module type (apps/ channels/ funcs/ res/ …) or by function, for the main binary (main/ pbx/).

TO BE COMPLETED

Welcome to the Asterisk development community! Meet you on the asterisk-dev mailing list. Subscribe at http://lists.digium.com!

Mark Spencer, Kevin P. Fleming and the Asterisk.org Development Team