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%
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


? Dundi 9nistim !ort u#ber 6787-6784 :68. $ is is not an e( austive list..!P +!!P &$P <anager @?.8.Asterisk Quick Start Guide File Structure $ e table below contains t e default installation pat s for Asterisk component files and libraries. The Asterisk Company 2 .77 > .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.7. An Internet connection is also reAuired. . only t e core components relative to t is /uick +tart .777 67?5 4=. A current and supported release of distributions suc as !entB+ or Debian is recommended.=.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.6 or ig er kernel 2alt oug Asterisk will run on . *inu( is t e only officially supported B+.777 47. $ is document assumes t e use of a standard (58 based processor.= .: kernels3.7 :6. Copyright ©2012 Digium. and it is recommended to use a .. Asterisk can run on a number of Bperating +ystems.. <.

*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. $ 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' :. open a terminal window. The Asterisk Company . 9n1ip and e(tract all of t e contained source files% root@localhost:!usr!src# tar (')*+ asterisk%1#&%current#tar#g' 4.uide provides instructions for obtaining t ese packages for &ed@at and Debian Distributions. . Download t e Ccurre tD Asterisk source tarball to t e ost mac ine. Copyright ©2012 Digium.asterisk. Do& loadi ' $ e Asterisk source packages are available at% ttp%--www. ?. 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. $ is .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. If you are using an X window system.. .

$ 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. =.prere/ )o#"ili ' a d I stalli ' 8. Issue eac command as s own. 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. The Asterisk Company .etc.Asterisk Quick Start Guide root@localhost:!usr!src# c !asterisk%1#&#1-#0 root@localhost:!usr!src!asterisk%1#&#1-#0# #!contri$!scripts!install.D. $ 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.asterisk.

0 .

&epeat for Ce/te sio s.5angup67 Copyright ©2012 Digium.1.ia)2#so loa 3res.gsm#so .con+ig#so loa 3chan. Edit C#odules. ial#so loa 3co ec.Asterisk Quick Start Guide 5.#. alt oug any editor will do.ula"#so loa 3co ec.rtp.sip#so loa f%D root@localhost:!etc!asterisk# ge it e)tensions#con+ 1 e+ault2 e)ten 34 .. The Asterisk Company : .1. $ e ubiAuitous FG+GF.asterisk# so loa 3app. +ave t e file w en done editing% root@localhost:!etc!asterisk# ge it mo ules#con+ 1mo ules2 autoloa 3no loa 3p$).Dial68A92!guest@p$)# igium#com!s@ e+ault7 same 34 n.hangup#so loa fD and paste in t e configuration provided.5angup67 1 emo2 e)ten 34 2-00. editor C'editD is used for e(ample.

random. fD% root@localhost:!etc!asterisk# ge it ia)#con+ 1 emo2 type3peer username3asterisk secret3supersecret host321-#20B#20:#0B Copyright ©2012 NOTE: IF 4O5 DO NOT $E!6A)E T7E 0$ANDO1(ST$ING3 4O5$ 1A)7INE IS 8E$4 6I9E64 TO :E )O1!$O1ISED.@T<8=A. &epeat for Csi".<A=D>?.Asterisk Quick Start Guide 47. 142 type3+rien host3 ynamic secret3 .@T< f% root@localhost:!etc!asterisk# ge it sip#con+ 1general2 conte)t3 e+ault allo"guest3no<A=D>?. Gou can create t ese random strings of letters and numbers at ttp%--www...24 conte)t3 emo &eplace C0$ANDO1(ST$ING(23D wit an actual randomly generated string. The Asterisk Company - . !onfigure Cia/. 'inally.

Findows. 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:. Download. !lick t e ig lig ted Co"tio sD button% Copyright ©2012 Digium. is available for *inu(. The Asterisk Company B .Asterisk Quick Start Guide )o fi'uri ' a SI! clie t $ ere are myriad freely available VoIP clients. 4?. No "refere ce or e dorse#e t is i#"lied .srcD directory% root@localhost:!usr!src# #!'oiper 46. $ e soft)p one used in t is e(ample. $ at is e(tracted into t e C. E(ecute t e binary C<oi"er.usr. and e(tract t e 1oiper e(ecutable as described. Hoiper. and <ac B+. un1ip. $ e instructions provided are for *inu( only.

The Asterisk Company & . !lick CAdd e& SI! accou tD Copyright ©2012 Digium.Asterisk Quick Start Guide 48.

Copyright ©2012 fD. If =ou co"= the accou t a#e belo& =our #achi e &ill 8E$4 6I9E64 be co#"ro#ised. NOTE: Do NOT use the accou t a#e e/actl= as see belo&. Enter t e +IP account name t at matc es Ctest("ho e(0$ANDO1(ST$ING(13D in".Asterisk Quick Start Guide 4=. The Asterisk Company C . )reate =our OWN ra do# stri '.etc.

c. $ is s ould be a random stringI d.Asterisk Quick Start Guide 45. Enter t e account information.etc.asterisk. CDo#ai D must matc t e IP Address of t e Asterisk server". C5ser a#eD must matc t e account name 2including random string3 t at you created. C)aller ID Na#eD can be w atever you like Copyright ©2012 Digium. C!ass&ordD must matc t e CsecretD you created in C. a. The Asterisk Company 10 .

! 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 4..

!lick CSI! o"tio sD% Copyright ©2012 Digium.Asterisk Quick Start Guide . The Asterisk Company 12 .7.

The Asterisk Company 1. ! ange C!ortD to C>?@?D. .4.Asterisk Quick Start Guide . Copyright ©2012 Digium. !lick CSa-eD. $ is is only necessary if t e Hoiper client is running on t e ost mac ine running Asterisk.

+tart t e Asterisk daemon by simply issuing t e C asteriskD command at t e terminal. The Asterisk Company 10 .. Gou now ave a running Asterisk server and a configured p one. $ is will dial to a Digium server using t e IAX. Gou s ould see no message output. protocol and you will ear DigiumDs main IV& menu. $ e e(tent of w at you can do wit Asterisk is only limited by your imaginationI Copyright ©2012 Digium.. as well as sample configuration. 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.Asterisk Quick Start Guide 1aki ' a Test )all .

Copyright 6C7 1CCC % 2012 Digium. 8nc# an others# Create $y ?ark @pencer . A few of t e most common and useful are listed and described below. asterisk Cr If youDve started Asterisk using a script or by running CasteriskD at t e *inu( terminal. "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. followed by t e !*I prompt% root@localhost:!usr!src# asterisk %r Asterisk 1#&#1-#0. Gou can see a detailed list of all t e valid options by running Casterisk ChD. The Asterisk Company 1: . !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. Copyright ©2012 Digium. Gou will immediately be connected to t e Asterisk !*I.markster@ igium#com4 Asterisk comes "ith AD@>EFTGEH => IA<<A=THJ type Kcore sho" "arrantyK +or etails# This is +ree so+t"are. Gou will be presented license and warranty information.Asterisk Quick Start Guide A""e di/ A C The Asterisk )6I 4. &un Ccore sto" nowD at t e !*I to be end t e process and return to t e *inu( prompt. you can t en connect to t at running instance of asterisk wit t e DErD option. $ is assumes you ave not already started asterisk as a background daemon process by running CasteriskD 2or a script3.

Copyright ©2012 Digium.etc. Gou will e(it t e !*I and be returned to t e *inu( prompt.confD. but is not limited to. Casterisk C/ Fsi" sho& "eersGD .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.g.asterisk. dial"la sho& Displays all of t e active 2in memory3 dialplan. $ is includes. si" sho& "eers *ists all configured +IP devices.. $ is s ould be immediately followed by t e !*I command in Auotes e.e/te sio s. t e configuration contained in C. @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. $ e output includes t e account name used for a given device and its IP address. core sto" o& Immediately stops Asterisk. The Asterisk Company 1- .