Sei sulla pagina 1di 17

Asterisk Quick Start Guide

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&

About this Quick Start Guide


$ is guide provides step)by)step instructions for compiling and installing Asterisk. Also included are basic instructions on controlling Asterisk via its !ommand *ine Interface, or !*I. +ample Asterisk configuration and +IP soft)p one configuration will also be presented. $ is will culminate in your ability to dial over t e internet using t e IAX, protocol to Digium. 'or furt er reading, a wealt of resources including information on !ommercial +upport provided by Digium, $ e Asterisk !ompany can be found at%

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.

Copyright 2012 Digium, The Asterisk Company

Asterisk Quick Start Guide

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

!ath -etc-asterisk -usr-sbin -var-log-asterisk -usr-lib-asterisk-modules

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.

Copyright 2012 Digium, The Asterisk Company

Asterisk Quick Start Guide

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.

Do& loadi '


$ e Asterisk source packages are available at% ttp%--www.asterisk.org-downloads

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.

,. If you are using an X window system, open a terminal window.

?. Download t e Ccurre tD Asterisk source tarball to t e ost mac ine. $ is will download t e latest 2minor3 version%

root@localhost:~# c !usr!src root@localhost:!usr!src# "get http:!! o"nloa s#asterisk#org!pu$!telephony!asterisk!asterisk%1#&% current#tar#g'

:. 9n1ip and e(tract all of t e contained source files%

root@localhost:!usr!src# tar (')*+ asterisk%1#&%current#tar#g'

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

Asterisk Quick Start Guide

root@localhost:!usr!src# c !asterisk%1#&#1-#0 root@localhost:!usr!src!asterisk%1#&#1-#0# #!contri$!scripts!install.prere/

)o#"ili ' a d I stalli '


8. Issue eac of t ese commands in seAuence%

root@localhost:!usr!src!asterisk%1#&#1-#0# #!con+igure root@localhost:!usr!src!asterisk%1#&#1-#0# make root@localhost:!usr!src!asterisk%1#&#1-#0# make install root@localhost:!usr!src!asterisk%1#&#1-#0# make samples

)o fi'uri ' Asterisk *de#o co fi'+


$ e previous command C#ake sa#"lesD created sample configuration files in t e default directory C,etc,asterisk,D. $ e commands below s ow ow to create backups of some of t ese files and ow to create new simplified configuration for demo or testing purposes.

=. 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#&#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

Copyright 2012 Digium, The Asterisk Company

Asterisk Quick Start Guide

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

;. &epeat for Ce/te sio s.co f%D

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

Copyright 2012 Digium, The Asterisk Company

Asterisk Quick Start Guide

47. &epeat for Csi".co f%

root@localhost:!etc!asterisk# ge it sip#con+

1general2 conte)t3 e+ault allo"guest3no


1test.phone.;<A=D>?.@T<8=A. 142 type3+rien host3 ynamic secret3 ;<A=D>?.@T<8=A.24 conte)t3 emo

&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;;

4,. 'inally, !onfigure Cia/.co fD%

root@localhost:!etc!asterisk# ge it ia)#con+

1 emo2 type3peer username3asterisk secret3supersecret host321-#20B#20:#0B

Copyright 2012 Digium, The Asterisk Company

Asterisk Quick Start Guide

)o fi'uri ' a SI! clie t


$ ere are myriad freely available VoIP clients. $ e soft)p one used in t is e(ample, Hoiper, is available for *inu(, Findows, and <ac B+. No "refere ce or e dorse#e t is i#"lied . $ e instructions provided are for *inu( only.

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'

4:. E(ecute t e binary C<oi"er. $ at is e(tracted into t e C,usr,srcD directory%

root@localhost:!usr!src# #!'oiper

46. !lick t e ig lig ted Co"tio sD button%

Copyright 2012 Digium, The Asterisk Company

Asterisk Quick Start Guide

48. !lick CAdd e& SI! accou tD

Copyright 2012 Digium, The Asterisk Company

&

Asterisk Quick Start Guide

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;

Copyright 2012 Digium, The Asterisk Company

Asterisk Quick Start Guide

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

Copyright 2012 Digium, The Asterisk Company

10

Asterisk Quick Start Guide

4;. ! eck t e ig lig ted CSho& ad-a ced o"tio sD c eckbo(%

Copyright 2012 Digium, The Asterisk Company

11

Asterisk Quick Start Guide

,7. !lick CSI! o"tio sD%

Copyright 2012 Digium, The Asterisk Company

12

Asterisk Quick Start Guide

,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.

Copyright 2012 Digium, The Asterisk Company

1,

Asterisk Quick Start Guide

1aki ' a Test )all


,,. +tart t e Asterisk daemon by simply issuing t e C asteriskD command at t e terminal. Gou s ould see no message output, and are returned to a *inu( prompt%

root@localhost:!usr!src# asterisk root@localhost:!usr!src#

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

Copyright 2012 Digium, The Asterisk Company

10

Asterisk Quick Start Guide

A""e di/ A C The Asterisk )6I

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#&#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#&#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.

Copyright 2012 Digium, The Asterisk Company

1:

Asterisk Quick Start Guide

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

,. @elpful !*I !ommands

core sho& hel" lists valid !*I commands.

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.

Copyright 2012 Digium, The Asterisk Company

1-

Potrebbero piacerti anche