Vous êtes sur la page 1sur 14

HENALLUX

IESN – Institut Enseignement Supérieur de Namur


Rue Joseph Calozet, 19 – 5000 NAMUR – Belgique
Tel : + 32 (0) 81 46 86 10 Site Internet : http://www.iesn.be/

Nom : Bonesso
Prénom : Julien
Classe : 3 TI A
Enseignant : Mr Vandamme Benjamin
Année 2018-2019

Flux Mobiles
Laboratoire
VoIP Asterisk

Ce document est mis à disposition selon les termes de la licence Creative Commons

« Attribution - Pas d'utilisation commerciale 4.0 International ».


Contenu
Schéma .......................................................................................................................................................... 3
Configuration de base ................................................................................................................................... 3
iax.conf (trunk entre les deux serveurs) ....................................................................................................... 5
sip.conf (différents compte SIP).................................................................................................................... 5
confbridge.conf (créer conférence) .............................................................................................................. 6
voicemail.conf (créer voicemail) ................................................................................................................... 7
extensions.conf (créer dialplan contexte base) ............................................................................................ 7
Nommer contexte ..................................................................................................................................... 7
Horaires ..................................................................................................................................................... 7
Test (hello-world) (210) ............................................................................................................................ 7
Déclaration 3 numéros vers comptes SIP ................................................................................................. 7
Permet l’appel vers l’autre serveur via le trunk avec l’indicatif 0 ............................................................ 7
Création conférence (900) ........................................................................................................................ 7
Création voicemail pour John ................................................................................................................... 7
Écoute voicemail par John ........................................................................................................................ 7
Permettre le pickup avec BLF.................................................................................................................... 7
Accès à l’IVR Asterisk ................................................................................................................................ 8
Enregistrement IVR avec sa propre voix ................................................................................................... 8
Accès à l’IVR avec sa propre voix .............................................................................................................. 8
Accès à l’IVR Google .................................................................................................................................. 8
Extensions autres contexts ........................................................................................................................... 9
Horaires spécifiques .................................................................................................................................. 9
IVR Asterisk ............................................................................................................................................... 9
BLF ............................................................................................................................................................. 9
IVR propre voix........................................................................................................................................ 10
IVR Google............................................................................................................................................... 10
A installer: ........................................................................................................................................... 10
Context ................................................................................................................................................ 10
Configuration des téléphones ..................................................................................................................... 11
Grandstream ........................................................................................................................................... 11
Linksys ..................................................................................................................................................... 12
Configuration dialplate ............................................................................................................................... 13

Julien Bonesso 3TIA 2


Schéma

Configuration de base
- apt-get update
- apt-get install wget
- apt-get install make
- apt-get install linux-headers-$(uname -r)
- cd /usr/local/src
- wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz
- tar -zxvf asterisk-16-current.tar.gz
- cd asterisk-16.0.1
- cd contrib
- cd scripts
- ./install_prereq install
- Choisir préfixe +32
- ./install_prereq install-unpackaged

Julien Bonesso 3TIA 3


- cd /usr/local/src/asterisk-16.0.1
- ./configure --with-pjproject-bundled
- ./configure --with-jansson-bundled
- Make menuselect
- Cocher:
o Utilities -> aelparse
o Core Sound Packages -> wav, ulaw, alaw,gsm (en FR et EN)
o Music On Hold File Packages -> wav, ulaw, alaw,gsm
o Dans Extra Sound Packages -> wav, ulaw, alaw,gsm (en FR et EN)

Julien Bonesso 3TIA 4


- make
- make install
- make samples
- make config
- make install-logrotate
- cd /etc/init.d
- asterisk start
- asterisk status
- Exploring sound prompts : cd /var/lib/asterisk/sounds
- cd /etc/asterisk
- mv extensions.conf extensions.bkp
- mv sip.conf sip.bkp
- mv iax.conf iax.bkp
- mv voicemail.conf voicemail.bkp
- mv confbridge.conf confbridge.bkp

Commandes de vérification

- asterisk –rvvvvvvvvv
o Reload
o Dialplan reload
o Sip show peers
o Iax2 show peers

iax.conf (trunk entre les deux serveurs)


[Huy_trunk]
type=friend
host=10.1.31.84
username=Namur_trunk → (nom autre IAX)
context=labo_VoIP
permit=10.1.31.0/255.255.255.0 (permit du réseau utilisé)
secret=Tigrou007 → (secret le même dans les deux iax.conf)
trunk=yes
language=fr
qualify=yes
timezone=Europe/Brussels

sip.conf (différents compte SIP)


[general]
context=labo_VoIP
language=fr

[101]
type=friend
context=labo_VoIP

Julien Bonesso 3TIA 5


host=dynamic
username=101
secret=101
disallow=all
allow=ulaw
language=fr
subscribecontext=BLF
call-limit=20

[102]
type=friend
context=labo_VoIP
host=dynamic
secret=102
disallow=all
allow=ulaw
language=fr
subscribecontext=BLF
call-limit=20

[103]
type=friend
context=labo_VoIP
host=dynamic
secret=103
disallow=all
allow=ulaw
language=fr
subscribecontext=BLF
call-limit=20

confbridge.conf (créer conférence)


[myconference]
type=user
admin=no
music_on_hold_when_empty=yes
announce_user_count=yes
pin=1234

[ConfRoom_1]
type=bridge
max_members=10

Julien Bonesso 3TIA 6


voicemail.conf (créer voicemail)
[mvm]
200 = 123, Phillipe → (numéro boite voc, password, nom user)

extensions.conf (créer dialplan contexte base)


Nommer contexte
[labo_VoIP]

Horaires
include = open,08:00-16:00,mon,*,*
include = open,08:00-16:00,thu,*,*
include = closed

Test (hello-world) (210)


exten = 210,1,Answer()
same = n,Wait(1)
same = n,Playback(hello-world)
same = n,Hangup()

Déclaration 3 numéros vers comptes SIP


exten = 101,1,DIAL(SIP/101)
exten = 102,1,DIAL(SIP/102)
exten = 103,1,DIAL(SIP/103)

Permet l’appel vers l’autre serveur via le trunk avec l’indicatif 0


exten = _0XXX,1,Wait(1)
exten = _0XXX,2,DIAL(IAX2/Huy_trunk/${EXTEN:1},30)
exten = _0XXX,3,Hangup()

Création conférence (900)


exten = 900,1,Answer()
exten = 900,n,ConfBridge(Room_1,ConfRoom_1,myconference) → nom à choisir, nomsdansconfbridge

Création voicemail pour John


exten = 200,1,Dial(SIP/John,5) → 5= nombre de secondes d’attente
exten = 200,n,VoiceMail(200@mvm)
exten = 200,n,Hangup()

Écoute voicemail par John


exten = 299,1,VoiceMailMain(200@mvm)
exten = 299,n,Hangup()

Permettre le pickup avec BLF


exten = _**XXX,1,Pickup(${EXTEN:2})
exten = _**XXX,2,Hangup()

Julien Bonesso 3TIA 7


Accès à l’IVR Asterisk
exten = 789,1,Goto(mIVR,s,1)

Enregistrement IVR avec sa propre voix


exten=332,1,Answer(500)
same=n,Record(fr/custom-menu.ulaw)
same=n,Wait(1)
same=n,Playback(custom-menu)
same=n,Hangup()

Accès à l’IVR avec sa propre voix


exten=333,1,Goto(ivrownvoice,s,1)

Accès à l’IVR Google


exten=360,1,Goto(googleivr,s,1)

Julien Bonesso 3TIA 8


Extensions autres contexts
Horaires spécifiques
[open]
exten = 123,1,Dial(SIP/101,5) → 5= nombre de secondes d’attente
exten = 123,2,Dial(SIP/102,3)
exten = 123,3,Playback(please-hang-up-and-try-again)
exten= 123,4,Hangup()

[closed]
exten = 123,1,Answer()
exten = 123,2,Wait(1)
exten = 123,3,Playback(were-sorry)
exten= 123,4,Hangup()

IVR Asterisk
[mIVR]
exten = s,1,Answer(500)
same = n,Set(TIMEOUT(response)=10)
same = n(loop), Background(press-1&or&press-2)
same = n,WaitExten()

exten = 1,1,Playback(you-entered)
same = n,SayNumber(1)
same = n,Goto(labo_VoIP,101,1) → Si numéro 1 entré, appelle le 101

exten = 2,1,Playback(you-entered)
same = n,SayNumber(2)
same = n,Goto(labo_VoIP,102,1)

exten = 3,1,Playback(you-entered)
same = n,SayNumber(3)
same = n,Goto(labo_VoIP,103,1)

exten=t,1,Goto(mIVR,s,3) → redirection vers context mIVR

BLF
[BLF]
exten = 101,hint,SIP/101
exten = 102,hint,SIP/102
exten = 103,hint,SIP/103

Julien Bonesso 3TIA 9


IVR propre voix
[ivrownvoice]
exten=s,1,Answer(500)
same=n(loop),Background(custom-menu)
same=n,WaitExten()

exten=1,1,Goto(labo_VoIP,101,1)
exten=2,1,Goto(labo_VoIP,102,1)

exten=i,1,Playback(option-is-invalid)
same=n,Goto(s,loop) → Quand option invalide, revient au début

exten=t,1,Playback(are-you-still-there)
same=n,Goto(s,loop)

IVR Google
A installer:
apt-get install perl
apt-get install libwww-perl
apt-get install sox
apt-get install mpg123

Dossier /var/lib/asterisk/agi-bin/ et y mettre le fichier googletts.agi :

cd /var/lib/asterisk/agi-bin
wget https://raw.github.com/zaf/asterisk-googletts/master/googletts.agi
chmod +x googletts.agi

Context
[googleivr]
exten = s,1,Answer()
same = n,agi(googletts.agi, “J’aime les pommes”, fr)
same = n,Hangup()

Julien Bonesso 3TIA 10


Configuration des téléphones
Grandstream

Julien Bonesso 3TIA 11


Linksys

Julien Bonesso 3TIA 12


Configuration dialplate

Julien Bonesso 3TIA 13


Julien Bonesso 3TIA 14

Vous aimerez peut-être aussi