Pour commencer, logguer vous en tant que Root sur votre machine.
et executez les commandes suivantes afin de créer un dossier dans lequel on mettra les sources d'asterisk....
Code:
servast:~# servast:~# cd /usr/src servast:/usr/src# mkdir asterisk servast:/usr/src# cd asterisk/ servast:/usr/src/asterisk#
Code:
servast:/usr/src/asterisk# wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.6.2.13.tar.gz servast:/usr/src/asterisk# wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-addons-1.6.2.1.tar.gz servast:/usr/src/asterisk# wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-2.4.0+2.4.0.tar.gz
Code:
servast:/usr/src/asterisk# tar zxvf asterisk-1.6.2.13.tar.gz servast:/usr/src/asterisk# tar zxvf asterisk-addons-1.6.2.1.tar.gz servast:/usr/src/asterisk# tar zxvf dahdi-linux-complete-2.4.0+2.4.0.tar.gz
Code:
servast:/usr/src/asterisk#apt-get update servast:/usr/src/asterisk#apt-get upgrade
Code:
apt-get install linux-headers-$(uname -r) bison openssl libssl-dev libeditline0 libeditline-dev libedit-dev gcc make g++ mc php5-cli libxml2-dev libspandsp-dev
Code:
servast:/usr/src/asterisk# cd dahdi-linux-complete-2.4.0+2.4.0
Code:
servast:/usr/src/asterisk/dahdi-linux-complete-2.4.0+2.4.0# make all servast:/usr/src/asterisk/dahdi-linux-complete-2.4.0+2.4.0# make install
Code:
################################################### ### ### DAHDI tools installed successfully. ### If you have not done so before, install init scripts with: ### ### make config ### ################################################### make[1]: quittant le répertoire « /usr/src/asterisk/dahdi-linux-complete-2.4.0+2.4.0/tools »
Code:
servast:/usr/src/asterisk/dahdi-linux-complete-2.4.0+2.4.0# make config
Code:
servast:/usr/src/asterisk/dahdi-linux-complete-2.4.0+2.4.0# vim /etc/dahdi/modules
Sauvegarder et quitter votre editeur (touche [esc] suivi de :wq! pour l'éditeur vim)
continuer ensuite :
Code:
servast:/usr/src/asterisk/dahdi-linux-complete-2.4.0+2.4.0# modprobe dahdi_dummy
Code:
servast:/usr/src/asterisk/dahdi-linux-complete-2.4.0+2.4.0# reboot
Code:
servast:~# cd /usr/src/asterisk/asterisk-1.6.2.13
Code:
servast:/usr/src/asterisk/asterisk-1.6.2.13# ./configure
Code:
.$$$$$$$$$$$$$$$=.. .$7$7.. .7$$7:. .$$:. ,$7.7 .$7. 7$$$$ .$$77 ..$$. $$$$$ .$$$7 ..7$ .?. $$$$$ .?. 7$$$. $.$. .$$$7. $$$$7 .7$$$. .$$$. .777. .$$$$$$77$$$77$$$$$7. $$$, $$$~ .7$$$$$$$$$$$$$7. .$$$. .$$7 .7$$$$$$$7: ?$$$. $$$ ?7$$$$$$$$$$I .$$$7 $$$ .7$$$$$$$$$$$$$$$$ :$$$. $$$ $$$$$$7$$$$$$$$$$$$ .$$$. $$$ $$$ 7$$$7 .$$$ .$$$. $$$$ $$$$7 .$$$. 7$$$7 7$$$$ 7$$$ $$$$$ $$$ $$$$7. $$ (TM) $$$$$$$. .7$$$$$$ $$ $$$$$$$$$$$$7$$$$$$$$$.$$$$$$ $$$$$$$$$$$$$$$$. configure: Package configured for: configure: OS type : linux-gnu configure: Host CPU : i686 configure: build-cpu:vendor:os: i686 : pc : linux-gnu : configure: host-cpu:vendor:os: i686 : pc : linux-gnu :
Code:
servast:/usr/src/asterisk/asterisk-1.6.2.13# make menuselect
Code:
************************************************** Asterisk Module and Build Option Selection ************************************************** Press 'h' for help. ---> Applications Bridging Modules Call Detail Recording Channel Drivers Codec Translators Format Interpreters Dialplan Functions PBX Modules Resource Modules Test Modules Compiler Flags Voicemail Build Options Module Embedding Core Sound Packages Music On Hold File Packages Extras Sound Packages
Code:
************************************************** Asterisk Module and Build Option Selection ************************************************** Press 'h' for help. [\*] app_adsiprog [\*] app_alarmreceiver [\*] app_amd [\*] app_authenticate [\*] app_cdr [\*] app_chanisavail [\*] app_channelredirect [\*] app_chanspy [\*] app_confbridge [\*] app_controlplayback [\*] app_dahdibarge [\*] app_dahdiras [\*] app_dahdiscan [\*] app_db [\*] app_dial [\*] app_dictate [\*] app_directed_pickup [\*] app_directory [\*] app_disa [\*] app_dumpchan [\*] app_echo [\*] app_exec [\*] app_externalivr [\*] app_fax [\*] app_festival [\*] app_flash [\*] app_followme [\*] app_forkcdr [\*] app_getcpeid [\*] app_ices [\*] app_image [ ] app_ivrdemo ... More ... Asterisk ADSI Programming Application Depends on: res_adsi(M)
Code:
[ ] app_ivrdemo XXX app_jack XXX app_osplookup [ ] app_rpt [ ] app_skel
Revenez à la page précédentes en appuyant sur la touche [esc]
aller dans le menu :
Code:
---> Core Sound Packages
(la touche [espace] vous permet de mettre ou d'enlever l'*)
Code:
************************************************** Asterisk Module and Build Option Selection ************************************************** Press 'h' for help. [ ] CORE-SOUNDS-EN-WAV [ ] CORE-SOUNDS-EN-ULAW [ ] CORE-SOUNDS-EN-ALAW [ ] CORE-SOUNDS-EN-GSM [ ] CORE-SOUNDS-EN-G729 [ ] CORE-SOUNDS-EN-G722 [ ] CORE-SOUNDS-EN-SLN16 [ ] CORE-SOUNDS-EN-SIREN7 [ ] CORE-SOUNDS-EN-SIREN14 [ ] CORE-SOUNDS-ES-WAV [ ] CORE-SOUNDS-ES-ULAW [ ] CORE-SOUNDS-ES-ALAW [ ] CORE-SOUNDS-ES-GSM [ ] CORE-SOUNDS-ES-G729 [ ] CORE-SOUNDS-ES-G722 [ ] CORE-SOUNDS-ES-SLN16 [ ] CORE-SOUNDS-ES-SIREN7 [ ] CORE-SOUNDS-ES-SIREN14 [ ] CORE-SOUNDS-FR-WAV [\*] CORE-SOUNDS-FR-ULAW [\*] CORE-SOUNDS-FR-ALAW [\*] CORE-SOUNDS-FR-GSM [ ] CORE-SOUNDS-FR-G729 [ ] CORE-SOUNDS-FR-G722 [ ] CORE-SOUNDS-FR-SLN16 [ ] CORE-SOUNDS-FR-SIREN7 [ ] CORE-SOUNDS-FR-SIREN14
On continue dans le menu :
Code:
---> Music On Hold File Packages
Code:
************************************************** Asterisk Module and Build Option Selection ************************************************** Press 'h' for help. [\*] MOH-OPSOUND-WAV [\*] MOH-OPSOUND-ULAW [\*] MOH-OPSOUND-ALAW [\*] MOH-OPSOUND-GSM [ ] MOH-OPSOUND-G729 [ ] MOH-OPSOUND-G722 [ ] MOH-OPSOUND-SLN16 [ ] MOH-OPSOUND-SIREN7 [ ] MOH-OPSOUND-SIREN14
Puis un petit dernier avec le menu :
Code:
---> Extras Sound Packages
Code:
************************************************** Asterisk Module and Build Option Selection ************************************************** Press 'h' for help. [ ] EXTRA-SOUNDS-EN-WAV [ ] EXTRA-SOUNDS-EN-ULAW [ ] EXTRA-SOUNDS-EN-ALAW [ ] EXTRA-SOUNDS-EN-GSM [ ] EXTRA-SOUNDS-EN-G729 [ ] EXTRA-SOUNDS-EN-G722 [ ] EXTRA-SOUNDS-EN-SLN16 [ ] EXTRA-SOUNDS-EN-SIREN7 [ ] EXTRA-SOUNDS-EN-SIREN14 [\*] EXTRA-SOUNDS-FR-WAV [\*] EXTRA-SOUNDS-FR-ULAW [\*] EXTRA-SOUNDS-FR-ALAW [\*] EXTRA-SOUNDS-FR-GSM [ ] EXTRA-SOUNDS-FR-G729 [ ] EXTRA-SOUNDS-FR-G722 [ ] EXTRA-SOUNDS-FR-SLN16 [ ] EXTRA-SOUNDS-FR-SIREN7 [ ] EXTRA-SOUNDS-FR-SIREN14
apuuyez encore une fois sur [esc], le message suivant apparaitra :
Code:
************************************************** Asterisk Module and Build Option Selection ************************************************** Press 'h' for help. ARE YOU SURE? --- It appears you have made some changes, and you have opted to Quit without saving these changes! Please Enter Y to exit without saving; Enter N to cancel your decision to quit, and keep working in menuselect, or Enter S to save your changes, and exit
On continue ensuite en entrant la commande suivante :
Code:
servast:/usr/src/asterisk/asterisk-1.6.2.13# make
Code:
+--------- Asterisk Build Complete ---------+ + Asterisk has successfully been built, and + + can be installed by running: + + + + make install + +-------------------------------------------+
Code:
servast:/usr/src/asterisk/asterisk-1.6.2.13# make install
Code:
+---- Asterisk Installation Complete -------+ + + + YOU MUST READ THE SECURITY DOCUMENT + + + + Asterisk has successfully been installed. + + If you would like to install the sample + + configuration files (overwriting any + + existing config files), run: + + + + make samples + + + +----------------- or ---------------------+ + + + You can go ahead and install the asterisk + + program documentation now or later run: + + + + make progdocs + + + + **Note** This requires that you have + + doxygen installed on your local system + +-------------------------------------------+
Code:
servast:/usr/src/asterisk/asterisk-1.6.2.13# make samples
Code:
servast:/usr/src/asterisk/asterisk-1.6.2.13# make config
Code:
servast:/usr/src/asterisk/asterisk-1.6.2.13# cd .. servast:/usr/src/asterisk# cd asterisk-addons-1.6.2.1
Code:
servast:/usr/src/asterisk/asterisk-addons-1.6.2.1# ./configure servast:/usr/src/asterisk/asterisk-addons-1.6.2.1# make servast:/usr/src/asterisk/asterisk-addons-1.6.2.1# make install servast:/usr/src/asterisk/asterisk-addons-1.6.2.1# make samples
Code:
servast:/usr/src/asterisk/asterisk-1.6.2.13# reboot
Code:
servast:~# asterisk -r
Code:
Asterisk 1.6.2.13, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark SpencerAsterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.6.2.13 currently running on servast (pid = 2038) servast*CLI>
Code:
servast*CLI> exit
et aller dans le dossier de configuration de votre asterisk :
Code:
servast:~# cd /etc/asterisk/
Code:
servast:/etc/asterisk#mkdir OLD servast:/etc/asterisk#cp sip.conf OLD/sip.conf.old servast:/etc/asterisk#cp extensions.conf OLD/extensions.conf.old servast:/etc/asterisk#cp extensions.ael OLD/extensions.ael.old servast:/etc/asterisk#cp extensions.lua OLD/extensions.lua.old servast:/etc/asterisk#cp iax.conf OLD/iax.conf.old
Code:
servast:/etc/asterisk#rm sip.conf servast:/etc/asterisk#rm extensions.conf servast:/etc/asterisk#rm iax.conf
Pour votre culture personnelle, consulter les exemples fourni dans le dossier OLD cela vous sera toujours utile......
Alors entrons dans le vif du sujet....... commençons par créer un utilisateur SIP.......
créons & Editons (grâce à vim par ex.) le fichier sip.conf
Code:
servast:/etc/asterisk# vim sip.conf
Code:
;************* FICHIER SIP.CONF ************* ;*** PARAMETRES GENERAUX DE CONFIGURATION *** [general] t38pt_udptl = yes language=fr call-limit=50 srvlookup=yes disallow=all allow=ulaw allow=alaw allow=gsm context=Interne dtmfmode=rfc2833 qualify=yes canreinvite=no notifyringing=yes notifyhold=yes subscribecontext=BLF ;************ PARAMETRES DES COMPTES SIP ************* [1001] callerid=SoftPhone <1001> type=friend context=Interne host=dynamic secret=1234 dtmfmode=rfc2833 qualify=yes disallow=all allow=gsm allow=ulaw allow=alaw canreinvite=no nat=yes subscribecontext=BLF [1002] callerid=HardPhone <1002> type=friend context=Interne host=dynamic secret=1234 dtmfmode=rfc2833 qualify=yes disallow=all allow=gsm allow=ulaw allow=alaw canreinvite=no nat=yes subscribecontext=BLF
on continue avec le fichier extensions.conf......
Code:
servast:/etc/asterisk# vim extensions.conf
Code:
[general] [globals] [BLF] ;Contexte gérant les leds sur les téléphones exten => 1001,hint,SIP/1001 exten => 1002,hint,SIP/1002 [Interne] ;Contexte Contenant les téléphone Internes include => AppelSortant include => BLF include => test exten = _XXXX,1,Dial(SIP/${EXTEN},50) exten = _XXXX,n,Hangup() [AppelEntrant] ;Contexte pour les appels entrants [AppelSortant] ;Contexte pour les appels sortants [test] ;Contexte Fourre-tout pour les tests....... A purger de temps en temps ;) exten => **33,1,Answer() exten => **33,n,Wait(1) exten => **33,n,Echo() exten => **33,n,Hangup() exten => **34,1,Answer() exten => **34,n,Wait(1) exten => **34,n,Playback(hello-world) exten => **34,n,Hangup()
connectez vous a asterisk :
Code:
servast:/etc/asterisk# asterisk -r
Code:
servast*CLI> sip reload servast*CLI> dialplan reload
une fois que cela sera fais, en tapant la commande suivante dans la CLI :
Code:
servast*CLI> sip show peers
Code:
servast*CLI> sip show peers Name/username Host Dyn Nat ACL Port Status 1001/1001 192.168.10.102 D N 5060 OK (20 ms) 1002/1002 (Unspecified) D N 5060 UNKNOWN 2 sip peers [Monitored: 1 online, 1 offline Unmonitored: 0 online, 0 offline]
Très bien on peut donc déjà testé asterisk et voir si cela fonctionne.....
Composer le **34 sur votre devices, et vous devriez entendre un doux son qui dira un joli bonjour tout le monde bien connu des tuto de dev.......
Maintenant composer avec votre device le **33 parler dans le micros, et vous devriez entendre le doux son de votre voix....
Alors heureux, vous avez un asterisk qui fonctionne......
si vous avez deux ou plus devices connectez, vous pouvez vous appelez entre eux en composant leur numéro direct. par exemple composez depuis le poste 1001, le 1002.....
Amusez-vous bien......
Message vBulletin