Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
What is Asterisk?
Asterisk is an open source framework for building communications applications. Asterisk turns an ordinary computer into a communications server. Asterisk powers IP PBX systems, VoIP gateways, conference servers and more. It is used by small businesses, large businesses, call centers, carriers and governments worldwide. Asterisk is free and open source. Asterisk is sponsored by Digium, t e Asterisk !ompany. Asterisk is "under t e ood# in countless voice communications applications and is capable of interfacing wit many traditional $elcom protocols, VoIP protocols, and codecs. Asterisk provides a staggering list of capabilities and features including% IV& A!D Audio and Video !onferencing Voicemail !all &ecording 'a( termination !D&
ttp%--www.asterisk.org-support
NOTE: Any server accessible from t e public Internet s ould be security ardened, and an
Asterisk is no e(ception. .eneral security best practices are not wit in t e scope of t is /uick +tart .uide0 owever you may see $able , for default IP ports utili1ed by Asterisk. Instructions are provided for t e *ong $erm +upport 2*$+3 version of Asterisk, w ic is currently 4.5.
File Structure
$ e table below contains t e default installation pat s for Asterisk component files and libraries. $ is is not an e( austive list, only t e core components relative to t is /uick +tart .uide are listed%
Table 1 Default I stallatio !aths
Descri"tio !onfiguration files *ocation of binary e(ecutable message2error3 logs and !D& !omponent module libraries
Default !orts
!rotocol +IP IAX, <.!P +!!P &$P <anager @?,? Dundi 9nistim !ort u#ber 6787-6784 :68; ,=,= ,777 47,77 > ,7,777 67?5 4=,7 :6,7 6777 Tra s"ort $!P-9DP 9DP 9DP $!P 9DP $!P $!P 9DP 9DP
$e%uire#e ts
Asterisk can run on multiple base arc itectures including embedded systems and t ere are no strict reAuirements on !P9 speed or memory si1e. $ is document assumes t e use of a standard (58 based processor. Asterisk can run on a number of Bperating +ystems. *inu( is t e only officially supported B+, and it is recommended to use a ,.8.,6 or ig er kernel 2alt oug Asterisk will run on ,.: kernels3. A current and supported release of distributions suc as !entB+ or Debian is recommended. An Internet connection is also reAuired.
De"e de cies
$ ere are a number of packages t at are reAuired to be pre installed on t e ost server to ensure t at Asterisk will compile successfully. $ is .uide provides instructions for obtaining t ese packages for &ed@at and Debian Distributions.
4. *og in to your *inu( mac ine as t e CrootD user 2superuser3. If you are using 9buntu *inu( log in as normal and prefi( eac command wit Csudo.
?. Download t e Ccurre tD Asterisk source tarball to t e ost mac ine. $ is will download t e latest 2minor3 version%
6. Enter t e newly created source directory and e(ecute t e Ci stall("rere%D in t e contrib-scripts subdirectory. $ is will not only install t e reAuired dependencies but also install all packages necessary to build all option Asterisk components.
Copyright 2012 Digium, The Asterisk Company
root@localhost:!usr!src!asterisk%1#-#0# #!con+igure root@localhost:!usr!src!asterisk%1#-#0# make root@localhost:!usr!src!asterisk%1#-#0# make install root@localhost:!usr!src!asterisk%1#-#0# make samples
=. Issue eac command as s own. $ e C#-D 2move3 command is used rename 2backup3 t e provided sample configuration files%
ere to
root@localhost:!user!src!asterisk%1#-#0# root@localhost:!etc!asterisk# m* mo ules#con+ mo ules#con+#sample root@localhost:!etc!asterisk# m* e)tensions#con+ e)tensions#con+#sample root@localhost:!etc!asterisk# m* sip#con+ sip#con+#sample root@localhost:!etc!asterisk# m* ia)#con+ ia)#con+#sample
5. Edit C#odules.co fD and paste in t e configuration provided. $ e ubiAuitous FG+GF. editor C'editD is used for e(ample, alt oug any editor will do. +ave t e file w en done editing%
root@localhost:!etc!asterisk# ge it mo ules#con+
1mo ules2 autoloa 3no loa 3p$).con+ig#so loa 3chan.sip#so loa 3chan.ia)2#so loa 3res.rtp.asterisk# so loa 3app.hangup#so loa 3app. ial#so loa 3co ec.ula"#so loa 3co ec.gsm#so
root@localhost:!etc!asterisk# ge it e)tensions#con+
1 e+ault2 e)ten 34 .#,1,5angup67 1 emo2 e)ten 34 2-00,1,Dial68A92!guest@p$)# igium#com!s@ e+ault7 same 34 n,5angup67
root@localhost:!etc!asterisk# ge it sip#con+
&eplace C0$ANDO1(ST$ING(23D wit an actual randomly generated string. Gou can create t ese random strings of letters and numbers at ttp%--www.random.org-strings-
NOTE: IF 4O5 DO NOT $E!6A)E T7E 0$ANDO1(ST$ING3 4O5$ 1A)7INE IS 8E$4 6I9E64 TO :E )O1!$O1ISED;;
root@localhost:!etc!asterisk# ge it ia)#con+
4?. Download, un1ip, and e(tract t e 1oiper e(ecutable as described. E(ecute eac command in order%
root@localhost:!etc!asterisk# c !usr!src root@localhost:!usr!src# "get http:!!"""#'oiper#com! o"nloa s!+ree!linu)!'oiper21C% linu)#tar#g' root@localhost:!usr!src# tar (')*+ 'oiper21C%linu)#tar#g'
root@localhost:!usr!src# #!'oiper
&
4=. Enter t e +IP account name t at matc es Ctest("ho e(0$ANDO1(ST$ING(13D in C,etc,asterisk,si".co fD. NOTE: Do NOT use the accou t a#e e/actl= as see belo&. )reate =our OWN ra do# stri '. If =ou co"= the accou t a#e belo& =our #achi e &ill 8E$4 6I9E64 be co#"ro#ised;
45. Enter t e account information. a. CDo#ai D must matc t e IP Address of t e Asterisk server b. C5ser a#eD must matc t e account name 2including random string3 t at you created. c. C!ass&ordD must matc t e CsecretD you created in C,etc,asterisk,si".co fD. $ is s ould be a random stringI d. C)aller ID Na#eD can be w atever you like
10
11
12
,4. ! ange C!ortD to C>?@?D. !lick CSa-eD. $ is is only necessary if t e Hoiper client is running on t e ost mac ine running Asterisk.
1,
Gou are now be able to place a test call. Dial t e configured e(tension CAB??D from t e soft) p one. $ is will dial to a Digium server using t e IAX, protocol and you will ear DigiumDs main IV& menu. Gou now ave a running Asterisk server and a configured p one, as well as sample configuration. $ e e(tent of w at you can do wit Asterisk is only limited by your imaginationI
10
4. !onnecting to t e Asterisk !*I $ ere are many options t at you can apply following t e CasteriskD command at t e *inu( terminal. A few of t e most common and useful are listed and described below. Gou can see a detailed list of all t e valid options by running Casterisk ChD. asterisk Cr If youDve started Asterisk using a script or by running CasteriskD at t e *inu( terminal, you can t en connect to t at running instance of asterisk wit t e DErD option. Gou will be presented license and warranty information, followed by t e !*I prompt%
root@localhost:!usr!src# asterisk %r Asterisk 1#-#0, Copyright 6C7 1CCC % 2012 Digium, 8nc# an others# Create $y ?ark @pencer ;markster@ igium#com4 Asterisk comes "ith AD@>EFTGEH => IA<<A=THJ type Kcore sho" "arrantyK +or etails# This is +ree so+t"are, "ith components license un er the A=F Aeneral Lu$lic Eicense *ersion 2 an other licensesJ you are "elcome to re istri$ute it un er certain con itions# Type Kcore sho" licenseK +or etails# 3333333333333333333333333333333333333333333333333333333333333333333333333 Connecte to Asterisk 1#-#0 currently running on localhost6pi 3 &00&:7 localhostMCE84
asterisk Cc
+tarts Asterisk in console mode. $ is assumes you ave not already started asterisk as a background daemon process by running CasteriskD 2or a script3. Gou will immediately be connected to t e Asterisk !*I. &un Ccore sto" nowD at t e !*I to be end t e process and return to t e *inu( prompt.
1:
asterisk C/ $ is will issue a valid !*I command to Asterisk and provide t e standard output to t e $erminal. $ is s ould be immediately followed by t e !*I command in Auotes e.g. Casterisk C/ Fsi" sho& "eersGD
core restart o& Immediately restarts Asterisk. Gou will e(it t e !*I and be returned to t e *inu( prompt.
core sto" o& Immediately stops Asterisk. Gou will e(it t e !*I and be returned to t e *inu( prompt.
si" sho& "eers *ists all configured +IP devices. $ e output includes t e account name used for a given device and its IP address. dial"la sho& Displays all of t e active 2in memory3 dialplan. $ is includes, but is not limited to, t e configuration contained in C,etc,asterisk,e/te sio s.confD.
1-