Blog ENI : Toute la veille numérique !
🐠 -25€ dès 75€ 
+ 7 jours d'accès à la Bibliothèque Numérique ENI. Cliquez ici
Accès illimité 24h/24 à tous nos livres & vidéos ! 
Découvrez la Bibliothèque Numérique ENI. Cliquez ici
  1. Livres et vidéos
  2. VoIP et ToIP - Asterisk
  3. Asterisk
Extrait - VoIP et ToIP - Asterisk La téléphonie IP d'entreprise [2ième édition]
Extraits du livre
VoIP et ToIP - Asterisk La téléphonie IP d'entreprise [2ième édition]
2 avis
Revenir à la page d'achat du livre

Annexe C - Principaux fichiers de configuration

Introduction

Comme tout système logiciel, Asterisk a besoin d’un certain nombre de fichiers de configuration pour son fonctionnement.

Il existe plus de soixante fichiers de configuration qui se trouvent tous sous /etc/asterisk et sont caractérisés par un suffixe en .conf.

Asterisk.conf

Le fichier de configuration principal est asterisk.conf ; il indique trois types d’informations :

  • Emplacement des répertoires de travail [directories] ;

    • fichiers de configuration ;

    • fichiers de logs ;

    • fichiers de librairies ;

    • scripts ;

    • modules ;

    • programme du serveur ;

    • spool (transfert des données).

  • Permissions et propriétés [files] ;

  • Comportement des options de démarrage [options].

Ce fichier est généré de façon automatique lors de l’installation d’Asterisk (après le lancement de la commande make samples).

[directories]
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk

; Changing the following lines may compromise your security.
;[files]
;astctlpermissions = 0660
;astctlowner = root
;astctlgroup = apache
;astctl = asterisk.ctl 

Configuration des canaux

1. agents.conf

Ce fichier permet la configuration des postes d’opérateurs de centre d’appel : les agents. Voir le chapitre Implémentation d’un centre d’appels. La section [general] permet de spécifier qu’un agent peut être de type persistant, c’est-à-dire stocké dans la base de données locale à Asterisk (AstDB) et toujours présent même après un redémarrage d’Asterisk. Les agents sont définis dans la section [agents].

[general]
;
; Define whether callbacklogins should be stored in astdb for
; persistence. Persistent logins will be reloaded after
; Asterisk restarts.
;
persistentagents=yes
;
; Agent configuration
;
;
[agents]
;
; Define autologoff times if appropriate.  This is how long
; the phone has to ring with no answer before the agent is
; automatically logged off (in seconds)
;
;autologoff=15
;
; Define ackcall to require an acknowledgement by '#' when
; an agent logs in using agentcallbacklogin.  Default is "no".
;
;ackcall=no
;
; Define wrapuptime.  This is the minimum amount of time when
; after disconnecting before the caller can receive a new call
; note this is in milliseconds.
;
;wrapuptime=5000
;
; Define the default musiconhold for agents
; musiconhold => music_class
;
;musiconhold => default
;
; Define updatecdr. This is whether or not to change the source
; channel in the CDR record...

Configuration du plan de numérotation

1. extensions.conf

Ce fichier est le cœur d’Asterisk et contient le plan de numérotation. Voir les chapitres Conception du plan de numérotation et Amélioration du plan de numérotation relatifs à ce sujet.

2. extensions.ael

Ce fichier fait référence à AEL (Asterisk Extensions Language) qui est un langage d’extension à la syntaxe classique habituelle que nous pouvons trouver dans extensions.conf.

//
// Example AEL config file
//

macro std-exten-ael( ext , dev ) {
        Dial(${dev}/${ext},20);
        switch(${DIALSTATUS}) {
        case BUSY:
                Voicemail(b${ext});
                break;
        default:
                Voicemail(u${ext});
        };
        catch a {
                VoiceMailMain(${ext});
                return;
        };
};

context ael-demo {
        s => {
                Wait(1);
                Answer();
                TIMEOUT(digit)=5;
                TIMEOUT(response)=10;
restart:
                Background(demo-congrats);
instructions:
                for (x=0; ${x} < 3; x=${x} + 1) {
                        Background(demo-instruct);
                        WaitExten();
                };
        };
        2 => {
                Background(demo-moreinfo);
                goto s|instructions;
        };
        3 => {
                LANGUAGE()=fr;
                goto s|restart;
        };
        500 => {
                Playback(demo-abouttotry);
                Dial(IAX2/guest@misery.digium.com);
                Playback(demo-nogo);
                goto s|instructions;
        };
        600 => {
                Playback(demo-echotest);
Echo();
                Playback(demo-echodone);
                goto s|instructions;
        };
        _1234 => &std-exten-ael(${EXTEN}...

Configuration de commandes spécifiques du plan de numérotation

1. festival.conf

Ce fichier permet la configuration de l’application Festival. Voir le chapitre Applications connexes.

;
; Festival Configuration
;
[general]
;
; Host which runs the festival server (default : localhost);
;
host=localhost
;
; Port on host where the festival server runs (default : 1314)
;
port=1314
;
; Use cache (yes, no - defaults to no)
;
usecache=yes
;
; If usecache=yes, a directory to store waveform cache files.
; The cache is never cleared (yet), so you must 
take care of cleaning it
; yourself (just delete any or all files from the cache).
; THIS DIRECTORY *MUST* EXIST and must be writable from 
the asterisk process.
; Defaults to /tmp/
;
cachedir=/var/lib/asterisk/festivalcache/
;
; Festival command to send to the server.
; Defaults to: (tts_textasterisk "%s" 'file)(quit)\n
; %s is replaced by the desired text to say. The command MUST 
end with a
; (quit) directive, or the cache handling mechanism will hang. 
Do not
; forget the \n at the end.
;
festivalcommand=(tts_textasterisk "%s" 'file)(quit)\n
;
; 

2. indications.conf

La définition des tonalités de sonnerie (liste de sons) est définie dans ce fichier ; il est possible de définir des tonalités par pays. L’exemple ci-dessous ne traite que des tonalités en France.

; indications.conf
; Configuration file for location specific tone indications
; used by the pbx_indications module.
;
; NOTE:
;    When adding countries to this file, please keep them
in alphabetical
;    order according to the 2-character country codes!
;
; The [general] category is for certain global variables.
; All other categories are interpreted as location specific 
indications
;
;
[general]
country=us              ; default location


; [example]
; description = string
;      The full name of your country, in English.
; alias = iso[,iso]*
;      List of other countries 2-letter iso codes, 
which have the same
;      tone indications.
; ringcadence = num[,num]*
;      List of durations the physical bell rings.
; dial = tonelist
;      Set of tones to be played when one picks up the hook.
; busy = tonelist
;      Set of tones played when the receiving end is busy.
; congestion = tonelist
;      Set of tones played when there is some congestion 
(on the network?)
; callwaiting = tonelist
;      Set of tones played when there is a call waiting 
in the background.
; dialrecall = tonelist
;      Not well defined; many phone systems play...

Autres fichiers de configuration

1. codecs.conf

Ce fichier concerne certains paramétrages de codecs en vue d’une amélioration des performances. Seul le codec open-source speex (http://www.speex.org) peut être paramétré. Un paramètre intéressant pour les autres codecs est le Packet Loss Concealment (PLC) qui permet de dissimuler la perte de paquets.

[speex]
; CBR encoding quality [0..10]
; used only when vbr = false
quality => 3

; codec complexity [0..10]
; tradeoff between cpu/quality
complexity => 2

; perceptual enhancement [true / false]
; improves clarity of decoded speech
enhancement => true

; voice activity detection [true / false]
; reduces bitrate when no voice detected, used only for CBR
; (implicit in VBR/ABR)
vad => true

; variable bit rate [true / false]
; uses bit rate proportionate to voice complexity
vbr => true

; available bit rate [bps, 0 = off]
; encoding quality modulated to match this target bit rate
; not recommended with dtx or pp_vad - may cause bandwidth spikes
abr => 0

; VBR encoding quality [0-10]
; floating-point values allowed
vbr_quality => 4

; discontinuous transmission [true / false]
; stops transmitting completely when silence is detected
; pp_vad is far more effective but more CPU intensive
dtx => false

; preprocessor configuration
; these options only affect Speex v1.1.8 or newer

; enable preprocessor [true / false]
; allows dsp functionality below but incurs CPU overhead
preprocess => false

; preproc voice activity detection [true / false]
; more advanced equivalent of DTX, based on voice frequencies
pp_vad => false

; preproc automatic gain control [true / false]
pp_agc => false
pp_agc_level => 8000

; preproc denoiser [true / false]
pp_denoise => false

; preproc dereverb [true / false]
pp_dereverb => false
pp_dereverb_decay => 0.4
 pp_dereverb_level => 0.3
[plc]
; for all codecs which do not support...

Enregistrements CDR

1. cdr.conf

Ce fichier permet l’enregistrement des détails d’un appel dans une base de donnés.

;
; Asterisk Call Detail Record engine configuration
;
; CDR is Call Detail Record, which provides logging services 
via a variety of
; pluggable backend modules.  Detailed call information 
can be recorded to
; databases, files, etc.  Useful for billing, fraud prevention, 
compliance with
; Sarbanes-Oxley aka The Enron Act, QOS evaluations, and more.
;

[general]

; Define whether or not to use CDR logging.  Setting 
this to "no" will override
; any loading of backend CDR modules.  Default is "yes".
;enable=yes

; Define the CDR batch mode, where instead of pos-
ting the CDR at the end of
; every call, the data will be stored in a buffer to help 
alleviate load on the
; asterisk server.  Default is "no".
;
; WARNING WARNING WARNING
; Use of batch mode may result in data loss after unsafe 
asterisk termination
; ie. software crash, power failure, kill -9, etc.
; WARNING WARNING WARNING
;
;batch=no

; Define the maximum number of CDRs to accumulate in the buffer 
before posting
; them to the backend engines.  'batch' must be set 
to 'yes'.  Default is 100.
;size=100

; Define the maximum time to accumulate CDRs in the buffer 
before posting them
; to the backend engines.  If this time limit is reached, 
then it will post the
; records, regardless of the value defined for 'size'. 
'batch' must...