100% found this document useful (2 votes)
129 views134 pages

Asterisk - The Definitive Guide - 100

This document is a guide to installing and using the Asterisk PBX system. It discusses what Asterisk is, its architecture and components. It then covers installing Asterisk on Linux servers and downloading required software. The guide concludes with an overview of configuring basic Asterisk functionality.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
129 views134 pages

Asterisk - The Definitive Guide - 100

This document is a guide to installing and using the Asterisk PBX system. It discusses what Asterisk is, its architecture and components. It then covers installing Asterisk on Linux servers and downloading required software. The guide concludes with an overview of configuring basic Asterisk functionality.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 134

Asterisk™: The Definitive Guide

THIRD EDITION

Asterisk™: The Definitive Guide

!"#$%&'(!)*$+",$-&)$%!..!/!)*$&)'$01((!//$234&)5

Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo


Asterisk™: The Definitive Guide, Third Edition
!"#$%&"'()*$+,"-%."/(+"'$00$1$+,"(+)"23**$11"45!(+6

789!5%0:6";"<=>>"#$%&"'()*$+,"-%."/(+"'$00$1$+,"(+)"23**$11"45!(+6?"@11"5%0:6*"5$*$5A$)?
B5%+6$)"%+"6:$"C+%6$)"D6(6$*"8&"@.$5%E(?

B3 1%*:$)" !"FG2$%11!"'$)%(,"H+E?,">==I"J5(A$+*6$%+"K%0:L(!"M856:,"D$ (*68981,"7@"NIOP<?

FG2$%11!" 88Q*".(!" $"935E:(*$)"&85"$)3E(6%8+(1," 3*%+$**,"85"*(1$*"958.86%8+(1"3*$?"F+1%+$"$)%6%8+*


(5$"(1*8"(A(%1( 1$"&85".8*6"6%61$*"R !!"#$$%&'()*)+,-../(.01,02'3.%S?"T85".85$"%+&85.(6%8+,"E8+6(E6"835
E85985(6$U%+*6%636%8+(1"*(1$*")$9(56.$+6V"RW==S"NNWXNNYW"85"3.+".+)!24.+2,11&'3.%?

Editor: '%Q$"#83Q%)$* Indexer: T5$)"458L+


Production Editor: Z$5$*("[1*$! Cover Designer: ](5$+"'8+608.$5!
Copyeditor: 2(E:$1"K$() Interior Designer: ^(A%)"T36(68
Proofreader: @+)5$("T8\ Illustrator: 28 $56"28.(+8
Production Services: '811!"D:(59

Printing History:
-3+$"<==IV T%5*6"[)%6%8+?"
@303*6"<==PV D$E8+)"[)%6%8+?"
@95%1"<=>>V Z:%5)"[)%6%8+?"

M36*:$11"K(+) 88Q,"6:$"M36*:$11"K(+) 88Q"1808,"(+)"6:$"FG2$%11!"1808"(5$"5$0%*6$5$)"65()$.(5Q*"8&


FG2$%11!"'$)%(,"H+E?"5(!2+,(/#67 2682*,0,!,926:;,<2,"6:$"%.(0$*"8&"*6(5&%*:,"(+)"5$1(6$)"65()$")5$**"(5$
65()$.(5Q*"8&"FG2$%11!"'$)%(,"H+E?
'(+!"8&"6:$")$*%0+(6%8+*"3*$)" !".(+3&(E635$5*"(+)"*$11$5*"68")%*6%+03%*:"6:$%5"958)3E6*"(5$"E1(%.$)"(*
65()$.(5Q*?"_:$5$"6:8*$")$*%0+(6%8+*"(99$(5"%+"6:%*" 88Q,"(+)"FG2$%11!"'$)%(,"H+E?,"L(*"(L(5$"8&"(
65()$.(5Q"E1(%.,"6:$")$*%0+(6%8+*":(A$" $$+"95%+6$)"%+"E(9*"85"%+%6%(1"E(9*?

_:%1$"$A$5!"95$E(36%8+":(*" $$+"6(Q$+"%+"6:$"95$9(5(6%8+"8&"6:%*" 88Q,"6:$"93 1%*:$5"(+)"(36:85*"(**3.$


+8"5$*98+*% %1%6!"&85"$5585*"85"8.%**%8+*,"85"&85")(.(0$*"5$*316%+0"&58."6:$"3*$"8&"6:$"%+&85.(6%8+"E8+X
6(%+$)":$5$%+?

HD4MV"NPWX=XIN`XI>PYOX<

a#DHb

>Y=<>W>PWI
Table of Contents

Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii

1. A Telephony Revolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
@*6$5%*Q"(+)"/8HBV"45%)0%+0"6:$"J(9"4$6L$$+"Z5()%6%8+(1"(+)"M$6L85Q
Z$1$9:8+! <
Z:$"c(9(6("Z$1$9:8+!"B58d$E6 <
'(**%A$"7:(+0$"2$e3%5$*"T1$\% 1$"Z$E:+8180! Y
@*6$5%*QV"Z:$"K(EQ$5G*"B4f O
@*6$5%*QV"Z:$"B58&$**%8+(1G*"B4f I
Z:$"@*6$5%*Q"78..3+%6! I
Z:$"@*6$5%*Q"'(%1%+0"#%*6* `
@*6$5%*Q"_%Q%"D%6$* P
Z:$"H27"7:(++$1* P
@*6$5%*Q"C*$5"J5839* P
Z:$"@*6$5%*Q"^8E3.$+6(6%8+"B58d$E6 W
Z:$"43*%+$**"7(*$ W
78+E13*%8+ W

2. Asterisk Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
'8)31$* >=
@991%E(6%8+* ><
45%)0%+0"'8)31$* >I
7(11"^$6(%1"2$E85)%+0"'8)31$* >I
7:(++$1"[A$+6"#800%+0"'8)31$* >`
7:(++$1"^5%A$5* >P
78)$E"Z5(+*1(685* >W
T85.(6"H+6$595$6$5* >W
^%(191(+"T3+E6%8+* >N
B4f"'8)31$* <>

v
2$*835E$"'8)31$* <>
@))8+"'8)31$* <Y
Z$*6"'8)31$* <O
T%1$"D653E635$ <O
78+&%035(6%8+"T%1$* <O
'8)31$* <O
Z:$"2$*835E$"#% 5(5! <I
Z:$"D9881 <I
#800%+0 <I
Z:$"^%(191(+ <I
K(5)L(5$ <`
@*6$5%*Q"/$5*%8+%+0 <`
B5$A%83*"2$1$(*$"'$6:8)8180%$* <`
Z:$"M$L"2$1$(*$"'$6:8)8180! <P
78+E13*%8+ <W

3. Installing Asterisk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
H+*6(11(6%8+"7:$(6"D:$$6 Y>
^%*65% 36%8+"H+*6(11(6%8+ YI
7$+6FD"D$5A$5 YI
C 3+63"D$5A$5 O=
D8&6L(5$"^$9$+)$+E%$* OO
^8L+18()%+0"_:(6"g83"M$$) O`
J$66%+0"6:$"D835E$"A%("D3 A$5*%8+ OP
J$66%+0"6:$"D835E$"A%("L0$6 OP
K8L"68"H+*6(11"H6 OW
#% B2H OW
^@K^H ON
@*6$5%*Q I=
D$66%+0"T%1$"B$5.%**%8+* I=
4(*$"78+&%035(6%8+ I>
^%*( 1$"D[#%+3\ I>
H+%6%(1"78+&%035(6%8+ I<
.(Q$".$+3*$1$E6 IN
C9)(6%+0"@*6$5%*Q `O
78..8+"H**3$* ``
C905()%+0"@*6$5%*Q `W
78+E13*%8+ `N

4. Initial Configuration Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71


(*6$5%*Q?E8+& P>
Z:$"a)%5$E685%$*b"D$E6%8+ P>
Z:$"a896%8+*b"D$E6%8+ P<

vi | Table of Contents
Z:$"a&%1$*b"D$E6%8+ PI
Z:$"aE8.9(6b"D$E6%8+ PI
.8)31$*?E8+& PI
Z:$"a.8)31$*b"D$E6%8+ P`
%+)%E(6%8+*?E8+& PP
.3*%E8+:81)?E8+& PN
78+A$56%+0"'3*%E"68"("T85.(6"Z:(6"_85Q*"4$*6"L%6:"@*6$5%*Q PN
78+E13*%8+ W>

5. User Device Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83


Z$1$9:8+$"M(.%+0"78+E$96* WO
K(5)9:8+$*,"D8&69:8+$*,"(+)"@Z@* W`
78+&%035%+0"@*6$5%*Q WP
K8L"7:(++$1"78+&%035(6%8+"T%1$*"_85Q"L%6:"6:$"^%(191(+ WW
*%9?E8+& WN
%(\?E8+& NI
'8)%&!%+0"g835"7:(++$1"78+&%035(6%8+"T%1$*"&85"g835"[+A%58+.$+6 NW
#8()%+0"g835"M$L"7:(++$1"78+&%035(6%8+* NW
Z:$"@*6$5%*Q"7#H NN
Z$*6%+0"68"[+*35$"g835"^$A%E$*"K(A$"2$0%*6$5$) NN
@+(180"B:8+$* >==
@"4(*%E"^%(191(+"68"Z$*6"g835"^$A%E$* >=Y
C+)$5"6:$"K88)V"g835"T%5*6"7(11 >=O
78+E13*%8+ >=I

6. Dialplan Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107


^%(191(+"D!+6(\ >=P
78+6$\6* >=W
[\6$+*%8+* >>=
B5%85%6%$* >>>
@991%E(6%8+* >>Y
Z:$"@+*L$5RS,"B1(! (EQRS,"(+)"K(+039RS"@991%E(6%8+* >>Y
@"D%.91$"^%(191(+ >>I
K$118"_851) >>I
43%1)%+0"(+"H+6$5(E6%A$"^%(191(+ >>`
Z:$"J868RS,"4(EQ0583+)RS,"(+)"_(%6[\6$+RS"@991%E(6%8+* >>`
K(+)1%+0"H+A(1%)"[+65%$*"(+)"Z%.$836* >>N
C*%+0"6:$"^%(1RS"@991%E(6%8+ >>N
C*%+0"/(5%( 1$* ><<
B(66$5+"'(6E:%+0 ><I
H+E13)$* ><N
78+E13*%8+ >Y=

Table of Contents | vii


7. Outside Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Z:$"4(*%E*"8&"Z53+Q%+0 >Y>
T3+)(.$+6(1"^%(191(+"&85"F36*%)$"78++$E6%A%6! >Y<
BDZM"7%5E3%6* >YY
Z5()%6%8+(1"BDZM"Z53+Q* >YO
H+*6(11%+0"BDZM"Z53+Q* >Y`
/8HB >OO
BDZM"Z$5.%+(6%8+ >OO
BDZM"F5%0%+(6%8+ >OI
/8HB"68"/8HB >OP
78+&%035%+0"/8HB"Z53+Q* >OP
[.$50$+E!"^%(1%+0 >IO
78+E13*%8+ >I`

8. Voicemail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
78.$)%(+"'(%1 >IP
Z:$"a0$+$5(1b"D$E6%8+ >IW
Z:$"ah8+$.$**(0$*b"D$E6%8+ >``
Z:$"78+6$\6*"D$E6%8+ >`P
@+"H+%6%(1"A8%E$.(%1?E8+&"T%1$ >`W
^%(191(+"H+6$05(6%8+ >`N
Z:$"/8%E$'(%1RS"^%(191(+"@991%E(6%8+ >`N
Z:$"/8%E$'(%1'(%+RS"^%(191(+"@991%E(6%8+ >P>
75$(6%+0"("^%(1X !XM(.$"^%5$E685! >P>
C*%+0"("-%66$5 3&&$5 >P<
D685(0$"4(EQ$+)* >P<
#%+3\"T%1$*!*6$. >P<
F^47 >PY
H'@B >PY
C*%+0"@*6$5%*Q"@*"("D6(+)(18+$"/8%E$.(%1"D$5A$5 >PO
H+6$05(6%+0"@*6$5%*Q"%+68"("DHB"[+A%58+.$+6"@*"("D6(+)(18+$
/8%E$.(%1"D$5A$5 >PO
D'^H"RD%.91%&%$)"'$**(0$"^$*Q"H+6$5&(E$S >PP
78+E13*%8+ >PN

9. Internationalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
^$A%E$*"[\6$5+(1"68"6:$"@*6$5%*Q"D$5A$5 >W<
BDZM"78++$E6%A%6!,"^@K^H,"^%0%3."7(5)*,"(+)"@+(180"B:8+$* >WI
^@K^H"^5%A$5* >WP
@*6$5%*Q >WN
7(11$5"H^ >WN
#(+03(0$"(+)U85"@EE$+6"8&"B58.96* >N=
Z%.$U^(6$"D6(.9*"(+)"B58+3+E%(6%8+ >N>

viii | Table of Contents


78+E13*%8+i[(*!"2$&$5$+E$"7:$(6"D:$$6 >NO

10. Deeper into the Dialplan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195


[\95$**%8+*"(+)"/(5%( 1$"'(+%931(6%8+ >NI
4(*%E"[\95$**%8+* >NI
F9$5(685* >N`
^%(191(+"T3+E6%8+* >NW
D!+6(\ >NW
[\(.91$*"8&"^%(191(+"T3+E6%8+* >NW
78+)%6%8+(1"45(+E:%+0 >NN
Z:$"J868H&RS"@991%E(6%8+ >NN
Z%.$X4(*$)"78+)%6%8+(1"45(+E:%+0"L%6:"J868H&Z%.$RS <=<
'(E58* <=O
^$&%+%+0"'(E58* <=O
7(11%+0"'(E58*"&58."6:$"^%(191(+ <=I
C*%+0"@503.$+6*"%+"'(E58* <=`
J8D3 RS <=P
^$&%+%+0"D3 5836%+$* <=P
7(11%+0"D3 5836%+$*"&58."6:$"^%(191(+ <=W
C*%+0"@503.$+6*"%+"D3 5836%+$* <=N
2$635+%+0"&58."("D3 5836%+$ <>=
#8E(1"7:(++$1* <>>
C*%+0"6:$"@*6$5%*Q"^(6( (*$"R@*6^4S <>O
D685%+0"^(6("%+"6:$"@*6^4 <>O
2$65%$A%+0"^(6("&58."6:$"@*6^4 <>O
^$1$6%+0"^(6("&58."6:$"@*6^4 <>I
C*%+0"6:$"@*6^4"%+"6:$"^%(191(+ <>I
K(+)!"@*6$5%*Q"T$(635$* <>P
c(9(6$11$5RS <>P
7(11"B(5Q%+0 <>P
78+&$5$+E%+0"L%6:"'$$6'$RS <>W
78+E13*%8+ <>N

11. Parking and Paging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221


&$(635$*?E8+& <<>
Z:$"a0$+$5(1b"*$E6%8+ <<<
Z:$"a&$(635$.(9b"D$E6%8+ <<I
Z:$"a(991%E(6%8+.(9b"D$E6%8+ <<I
@991%E(6%8+"'(9"J5839%+0 <<P
B(5Q%+0"#86* <<W
FA$5:$()"(+)"jC+)$5E:%+k"B(0%+0"R(?Q?(?"B3 1%E"@))5$**S <<N
B1(E$*"68"D$+)"g835"B(0$* <Y=
c8+$"B(0%+0 <YI

Table of Contents | ix
78+E13*%8+ <Y`

12. Internet Call Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237


^MD"(+)"DHB"C2H* <YP
Z:$"DHB"C2H <YW
D2/"2$E85)* <YW
@EE$96%+0"7(11*"68"g835"D!*6$. <O=
^%(1%+0"DHB"C2H*"&58."@*6$5%*Q <O`
[MC'"(+)"[?>`O <OP
[?>`O"(+)"6:$"HZC <OP
[MC' <OW
@*6$5%*Q"(+)"[MC' <ON
HDM,"HZ@^,"(+)"&5$$+3.?850 <I=
J86"HDMl <I>
HZ@^"D3 *E5% $5"M3. $5*"RHDM*S <I>
'(+(0$.$+6"8&"H+6$5+$6"M3. $5%+0 <I>
HB"Z$1$9:8+!"@).%+%*65(6%A$"^8.(%+*"RHZ@^*S <I<
75$(6$"("^MD"[+65!"&85"g835"HZ@^ <IY
Z$*6%+0"g835"HZ@^ <IO
C*%+0"HDM*"%+"g835"@*6$5%*Q"D!*6$. <IO
D$E35%6!"(+)"H)$+6%6! <I`
Z811"T5(3) <IP
D9(."8A$5"H+6$5+$6"Z$1$9:8+!"RDBHZS <IW
^%*65% 36$)"^$+%(1"8&"D$5A%E$"@66(EQ* <IW
B:%*:%+0 <IW
D$E35%6!"H*"(+"F+08%+0"B58E$** <IN
78+E13*%8+ <IN

13. Automatic Call Distribution (ACD) Queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261


75$(6%+0"("D%.91$"@7^"m3$3$ <`<
m3$3$"'$. $5* <``
78+65811%+0"m3$3$"'$. $5*"A%("6:$"7#H <``
78+65811%+0"m3$3$"'$. $5*"L%6:"^%(191(+"#80%E <`W
@368.(6%E(11!"#800%+0"H+68"(+)"F36"8&"'316%91$"m3$3$* <P=
@+"H+658)3E6%8+"68"^$A%E$"D6(6$ <PY
Z:$"e3$3$*?E8+&"T%1$ <PI
Z:$"(0$+6*?E8+&"T%1$ <W>
@)A(+E$)"m3$3$* <WY
B5%85%6!"m3$3$"Rm3$3$"_$%0:6%+0S <WY
m3$3$"'$. $5"B5%85%6! <WO
7:(+0%+0"B$+(16%$*"^!+(.%E(11!"Re3$3$531$*?E8+&S <WI
@++83+E$.$+6"78+6581 <WP
FA$5&18L <N>

x | Table of Contents
C*%+0"#8E(1"7:(++$1* <NY
m3$3$"D6(6%*6%E*V"Z:$"e3$3$n180"T%1$ <N`
78+E13*%8+ <NN

14. Device States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301


^$A%E$"D6(6$* Y=>
7:$EQ%+0"^$A%E$"D6(6$* Y=<
[\6$+*%8+"D6(6$* Y=Y
K%+6* Y=Y
7:$EQ%+0"[\6$+*%8+"D6(6$* Y=O
DHB"B5$*$+E$ Y=`
@*6$5%*Q"78+&%035(6%8+ Y=`
C*%+0"73*68."^$A%E$"D6(6$* Y=P
@+"[\(.91$ Y=W
^%*65% 36$)"^$A%E$"D6(6$* Y=N
C*%+0"F9$+@HD Y>=
C*%+0"f'BB Y>O
D:(5$)"#%+$"@99$(5(+E$* Y>W
H+*6(11%+0"6:$"D#@"@991%E(6%8+* Y>W
78+&%035(6%8+"FA$5A%$L Y>N
]$!"D!*6$."[\(.91$"L%6:"@+(180"Z53+Q* Y>N
]$!"D!*6$."[\(.91$"L%6:"DHB"Z53+Q* Y<Y
D:(5$)"[\6$+*%8+"[\(.91$ Y<I
@))%6%8+(1"78+&%035(6%8+ Y<P
#%.%6(6%8+* Y<W
78+E13*%8+ Y<N

15. The Automated Attendant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331


@+"@368"@66$+)(+6"H*"M86"(+"H/2 YY>
^$*%0+%+0"g835"@368"@66$+)(+6 YY<
Z:$"J5$$6%+0 YYY
Z:$"'(%+"'$+3 YYO
Z%.$836 YYI
H+A(1%) YYI
^%(1" !"[\6$+*%8+ YY`
43%1)%+0"g835"@368"@66$+)(+6 YY`
2$E85)%+0"B58.96* YY`
Z:$"^%(191(+ YYW
^$1%A$5%+0"H+E8.%+0"7(11*"68"6:$"@368"@66$+)(+6 YYN
H/2 YO=
78+E13*%8+ YO=

Table of Contents | xi
16. Relational Database Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
H+*6(11%+0"(+)"78+&%035%+0"B8*605$Dm#"(+)"'!Dm# YO<
H+*6(11%+0"B8*605$Dm#"&85"7$+6FD YO<
H+*6(11%+0"B8*605$Dm#"&85"C 3+63 YO<
H+*6(11%+0"'!Dm#"&85"7$+6FD YOY
H+*6(11%+0"'!Dm#"&85"C 3+63 YOY
78+&%035%+0"B8*605$Dm# YOY
78+&%035%+0"'!Dm# YOI
H+*6(11%+0"(+)"78+&%035%+0"F^47 YO`
78+&%035%+0"F^47"&85"B8*605$Dm# YOP
78+&%035%+0"F^47"&85"'!Dm# YON
78+&%035%+0"F^47"&85"'%E58*8&6"Dm# YI=
/(1%)(6%+0"6:$"F^47"78++$E685 YI>
78+&%035%+0"5$*n8) E"68"@118L"@*6$5%*Q"68"78++$E6"Z:5830:"F^47 YI<
'(+(0%+0"^(6( (*$* YIY
Z583 1$*:886%+0"^(6( (*$"H**3$* YIY
@"J$+61$"H+658)3E6%8+"68"&3+En8) E YIO
J$66%+0"T3+Q!"L%6:"&3+En8) EV"K86X^$*Q%+0 YIO
C*%+0"2$(16%.$ Y`W
D6(6%E"2$(16%.$ Y`W
^!+(.%E"2$(16%.$ YP>
D685%+0"7(11"^$6(%1"2$E85)*"R7^2*S YPI
F^47"/8%E$.(%1 YPW
75$(6%+0"6:$"#(50$"F d$E6"Z!9$"&85"B8*605$Dm# YPN
F^47"/8%E$.(%1"D685(0$"Z( 1$"#(!836 YW>
78+&%035%+0"A8%E$.(%1?E8+&"&85"F^47"D685(0$ YW<
Z$*6%+0"F^47"/8%E$.(%1 YWY
78+E13*%8+ YWP

17. Interactive Voice Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389


_:(6"H*"H/2l YWN
78.98+$+6*"8&"(+"H/2 YN=
H/2"^$*%0+"78+*%)$5(6%8+* YN<
^8 YN<
^8+G6 YN<
@*6$5%*Q"'8)31$*"&85"43%1)%+0"H/2* YN<
7C2# YN<
&3+En8) E YN<
@JH YNY
@'H YNY
@"D%.91$"H/2"C*%+0"7C2# YNY
H+*6(11%+0"6:$"EC2#"'8)31$ YNY
Z:$"^%(191(+ YNO

xii | Table of Contents


@"B58.96X2$E85)%+0"@991%E(6%8+ YNO
D9$$E:"2$E80+%6%8+"(+)"Z$\6X68XD9$$E: YNI
Z$\6X68XD9$$E: YNI
D9$$E:"2$E80+%6%8+ YN`
78+E13*%8+ YN`

18. External Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397


7(1$+)(5"H+6$05(6%8+ YNW
78.9%1%+0"7(1$+)(5%+0"D399856"%+68"@*6$5%*Q YNW
78+&%035%+0"7(1$+)(5"D399856"&85"@*6$5%*Q YNN
Z5%00$5%+0"7(1$+)(5"2$.%+)$5*"68"g835"B:8+$ O=<
78+65811%+0"7(11*"4(*$)"8+"7(1$+)(5"H+&85.(6%8+ O=P
_5%6%+0"7(11"H+&85.(6%8+"68"("7(1$+)(5 O=W
78+E13*%8+ O>>
/8%E$'(%1"H'@B"H+6$05(6%8+ O>>
78.9%1%+0"H'@B"/8%E$'(%1"D399856"%+68"@*6$5%*Q O><
C*%+0"f'BB"R-( $5S"L%6:"@*6$5%*Q O>W
78.9%1%+0"-( $5"D399856"%+68"@*6$5%*Q O>N
-( $5"^%(191(+"78..(+)* O>N
E:(+n06(1Q O<I
DQ!9$"H+6$05(6%8+ O<N
H+*6(11(6%8+"8&"DQ!9$"&85"@*6$5%*Q O<N
C*%+0"DQ!9$"&85"@*6$5%*Q O<N
#^@B"H+6$05(6%8+ OYO
78+&%035%+0"F9$+#^@B OYI
78.9%1%+0"#^@B"D399856"%+68"@*6$5%*Q OYP
78+&%035%+0"@*6$5%*Q"&85"#^@B"D399856 OYP
Z$\6X68XD9$$E:"C6%1%6%$* OO=
T$*6%A(1 OO=
7$9*65(1 OO<
78+E13*%8+ OO<

19. Fax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443


_:(6"H*"("T(\l OOY
_(!*"68"K(+)1$"T(\$*"%+"@*6$5%*Q OOY
*9(+)*9 OOO
F 6(%+%+0"*9(+)*9 OOO
78.9%1%+0"(+)"H+*6(11%+0"*9(+)*9 OOO
@))%+0"6:$"*9(+)*9"#% 5(5!"68"g835"1% 9(6: OOI
2$E8.9%1%+0"@*6$5%*Q"L%6:"*9(+)*9"D399856 OOI
^%*( 1%+0"*9(+)*9"RD:831)"g83"_(+6"68"Z$*6"^%0%3."T(\S OO`
^%0%3."T(\"T85"@*6$5%*Q OO`
F 6(%+%+0"^%0%3."TT@ OO`

Table of Contents | xiii


^%*( 1%+0"^%0%3."TT@"RD:831)"g83"_(+6"68"Z$*6"*9(+)*9S OO`
H+E8.%+0"T(\"K(+)1%+0 OOP
T(\"68"ZHTT OOP
T(\"68"[.(%1 OOP
T(\"^$6$E6%8+ OOW
F3608%+0"T(\"K(+)1%+0 OON
Z5(+*.%66%+0"("T(\"&58."@*6$5%*Q OI=
T%1$"T85.(6"&85"T(\%+0 OI=
@+"[\9$5%.$+6"%+"[.(%1"68"T(\ OI>
T(\"B(**XZ:5830: OIO
C*%+0"T(\"43&&$5*"%+"E:(+n)(:)%?E8+& OIO
78+E13*%8+ OII

20. Asterisk Manager Interface (AMI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457


m3%EQ"D6(56 OIP
@'H"8A$5"Z7B OIW
@'H"8A$5"KZZB OIN
78+&%035(6%8+ O`=
.(+(0$5?E8+& O`=
:669?E8+& O`O
B5868E81"FA$5A%$L O`I
'$**(0$"[+E8)%+0 O``
@'H"8A$5"KZZB O`P
^$A$189.$+6"T5(.$L85Q* OP>
7DZ@ OP>
H+6$5$*6%+0"@991%E(6%8+* OP<
@*6$5%*QJCH OP<
T1(*:"F9$5(685"B(+$1 OPY
78+E13*%8+ OPY

21. Asterisk Gateway Interface (AGI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475


m3%EQ"D6(56 OPI
@JH"/(5%(+6* OPP
B58E$**X4(*$)"@JH OPP
^$()@JH"H*"^$() OPW
T(*6@JHi@JH"8A$5"Z7B OPW
@*!+E"@JHi@'HX78+65811$)"@JH OPN
@JH"78..3+%E(6%8+"FA$5A%$L OW=
D$66%+0"C9"(+"@JH"D$**%8+ OW=
78..(+)*"(+)"2$*98+*$* OW<
[+)%+0"(+"@JH"D$**%8+ OW`
^$A$189.$+6"T5(.$L85Q* OWP
78+E13*%8+ OWW

xiv | Table of Contents


22. Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
Z5()%6%8+(1"7(11"7$+6$5* OWN
K! 5%)"D!*6$.* ON=
B35$"@*6$5%*Q,"M8+)%*65% 36$) ON<
@*6$5%*Q"(+)"^(6( (*$"H+6$05(6%8+ ONY
D%+01$"^(6( (*$ ONY
2$91%E(6$)"^(6( (*$* ONI
@*6$5%*Q"(+)"^%*65% 36$)"^$A%E$"D6(6$* ON`
^%*65% 36%+0"^$A%E$"D6(6$*"8A$5"("#@M ON`
^%*65% 36%+0"^$A%E$"D6(6$*"8A$5"("_@M ONP
'316%91$"m3$3$*,"'316%91$"D%6$* ONN
78+E13*%8+ I=>

23. Distributed Universal Number Discovery (DUNDi) . . . . . . . . . . . . . . . . . . . . . . . . . . . 503


K8L"^8$*"^CM^%"_85Ql I=Y
Z:$")3+)%?E8+&"T%1$ I=I
78+&%035%+0"@*6$5%*Q"&85"C*$"L%6:"^CM^% I=P
J$+$5(1"78+&%035(6%8+ I=P
H+%6%(1"^CM^%"B$$5"^$&%+%6%8+ I=N
75$(6%+0"'(99%+0"78+6$\6* I>=
C*%+0"'(99%+0"78+6$\6*"L%6:"B$$5* I><
@118L%+0"2$.86$"78++$E6%8+* I>O
78+65811%+0"2$*98+*$* I>`
B$5&85.%+0"#88Q39*"&58."6:$"^%(191(+ I>N
78+E13*%8+ I<<

24. System Monitoring and Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523


1800$5?E8+& I<Y
2$A%$L%+0"@*6$5%*Q"#80* I<I
#800%+0"68"6:$"#%+3\"*!*180"^($.8+ I<`
/$5%&!%+0"#800%+0 I<P
7(11"^$6(%1"2$E85)* I<P
7^2"78+6$+6* I<P
^%(191(+"@991%E(6%8+* I<N
E)5?E8+& I<N
4(EQ$+)* IY=
[\(.91$"7(11"^$6(%1"2$E85)* IY`
7(A$(6* IYP
7[#"R7:(++$1"[A$+6"#800%+0S IYP
7:(++$1"[A$+6"Z!9$* IYP
7:(++$1"[A$+6"78+6$+6* IYN
^%(191(+"@991%E(6%8+* IO=
E$1?E8+& IO=

Table of Contents | xv
4(EQ$+)* IO=
[\(.91$"7:(++$1"[A$+6* IO`
DM'B II>
H+*6(11%+0"6:$"DM'B"'8)31$"&85"@*6$5%*Q II>
78+&%035%+0"DM'B"&85"@*6$5%*Q"C*%+0"F9$+M'D II<
'8+%685%+0"@*6$5%*Q"L%6:"F9$+M'D IIW
78+E13*%8+ IIN

25. Web Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561


T1(*:"F9$5(685"B(+$1 I`<
m3$3$"D6(63*"(+)"2$9856%+0 I`<
m3$3$"D6(63*"^%*91(! I`Y
m3$3$"2$9856%+0 I`Y
7(11"^$6(%1"2$E85)* I`Y
@<4%11%+0 I`O
78+E13*%8+ I`O

26. Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565


DE(++%+0"&85"/(1%)"@EE83+6* I`I
@36:$+6%E(6%8+"_$(Q+$**$* I`P
T(%1< (+ I`P
H+*6(11(6%8+ I`W
78+&%035(6%8+ I`N
[+E5!96$)"'$)%( IP>
^%(191(+"/31+$5( %1%6%$* IP>
D$E35%+0"@*6$5%*Q"M$6L85Q"@BH* IP<
H@f<"^$+%(1"8&"D$5A%E$ IPY
F6:$5"2%*Q"'%6%0(6%8+ IPO
2$*835E$* IPI
78+E13*%8+i@"4$66$5"H)%86 IP`

27. Asterisk: A Future for Telephony . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577


Z:$"B58 1$.*"L%6:"Z5()%6%8+(1"Z$1$9:8+! IPP
718*$)"Z:%+Q%+0 IPW
#%.%6$)"D6(+)(5)*"78.91%(+E! IPW
D18L"2$1$(*$"7!E1$* IPN
2$&3*%+0"68"#$6"J8"8&"6:$"B(*6"(+)"[. 5(E$"6:$"T3635$ IPN
B(5()%0."D:%&6 IW=
Z:$"B58.%*$"8&"F9$+"D835E$"Z$1$9:8+! IW=
Z:$"H6E:"Z:(6"@*6$5%*Q"DE5(6E:$* IW=
F9$+"@5E:%6$E635$ IW>
D6(+)(5)*"78.91%(+E$ IW<
#%0:6+%+0XT(*6"2$*98+*$"68"M$L"Z$E:+8180%$* IW<

xvi | Table of Contents


B(**%8+(6$"78..3+%6! IW<
D8.$"Z:%+0*"Z:(6"@5$"M8L"B8**% 1$ IW<
Z:$"T3635$"8&"@*6$5%*Q IW`
D9$$E:"B58E$**%+0 IWP
K%0:XT%)$1%6!"/8%E$ IWW
/%)$8 IWW
_%5$1$** IWN
C+%&%$)"'$**(0%+0 IN=
B$$5%+0 IN=
7:(11$+0$* IN>
F998563+%6%$* INO

A. Understanding Telephony . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597

B. Protocols for VoIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617

C. Preparing a System for Asterisk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663

Table of Contents | xvii


Foreword

jZ:$5$G*".85$"6:(+"8+$"L(!"68")8"%6?k"HGA$" $$+"L85Q%+0"L%6:"@*6$5%*Q"&85"+%+$"!$(5*,
(+)"6:%*".8668" $E8.$*".85$"653$"L%6:"$(E:"5$1$(*$,"$(E:"())$)"&$(635$,"(+)"$(E:
E1$A$5"9$5*8+"L:8"(66(EQ*"("6$1$E8..3+%E(6%8+*"958 1$."L%6:"6:%*"%+E5$)% 1!"&1$\% 1$
6881Q%6?" H" :()" 6:$" &(+6(*6%E" 8998563+%6!" 68" L85Q" (*" 6:$" E8..3+%6!" .(+(0$5" &85" 6:$
@*6$5%*Q"958d$E6"(6"^%0%3."&85"6L8"!$(5*,"L:%E:"0(A$".$"8+$"8&"6:$" $*6"A(+6(0$"98%+6*
&85" *$$%+0" 6:$" *E89$" (+)" %.(0%+(6%8+" 8&" 6:$" L851)L%)$" )$A$189.$+6" $&&856" 93*:%+0
@*6$5%*Q"&85L(5)?"Z:$")$96:"(+)" 5$()6:"8&"@*6$5%*Q"%*"*6(00$5%+0i%+*6(11(6%8+*"L%6:
:3+)5$)*"8&"6:83*(+)*"8&"3*$5*"(5$"+8L"E8..8+91(E$?"H"*$$"@*6$5%*Q".(Q%+0")$$9
%+58()*"%+68"6:$"&%+(+E%(1,".%1%6(5!,":8*9%6(1,"T8563+$">=="$+6$595%*$,"*$5A%E$"958A%)$5,
E(11%+0"E(5),"(+)".8 %1$"$+A%58+.$+6*?"H+"&(E6,"6:$5$"5$(11!"(5$+G6"(+!"(5$(*"6:(6"H"E(+
6:%+Q"8&"L:$5$"@*6$5%*Q"%*+G6"+8L"$+65$+E:$)"(*"6:$")$&(316"E:8%E$"L:$+"6:$5$"%*"("+$$)
&85"("0$+$5(1%h$)"A8%E$"6881"68")8"j*63&&?k
@*6$5%*Q":(*" $$+"$. 1$.(6%E"8&"6:$"L(!"6:(6"89$+"*835E$"*8&6L(5$":(*"E:(+0$)" 3*%X
+$**i(+)"E:(+0$)"6:$"L851)?"'!"&(A85%6$"9(56"8&"(+!"@*6$5%*Q"958d$E6"8A$5A%$L"85
E8+&$5$+E$"6(1Q"%*"(+*L$5%+0"e3$*6%8+*"&58."*8.$8+$"+$L"68"@*6$5%*Q?"@*"H"E8+6%+3$
68"(+*L$5"jg$*,"%6"E(+")8"6:(6,k"H"L(6E:"(*"6:$"9$5*8+G*"$!$*"058L"L%)$?"Z:$"9$5*8+
*6(56*"68"*.%1$"L:$+":$"+2)11&"*6(56*"68"6:%+Q"( 836"+$L"6:%+0*"68")8"6:(6":%*"81)"9:8+$
85" E8..3+%E(6%8+" *!*6$." E831)+G6" 98**% 1!" :(A$" )8+$?" 2()%8" %+6$05(6%8+l" D35$?
D65$(.%+0"'BY*"%+68"85"836"8&"9:8+$"E(11*l"F]?"[.(%1%+0"5$E85)$)"E8+&$5$+E$"E(11*"68
6:$" 9(56%E%9(+6*l" M8" 958 1$.?" H+6$05(6%8+" 8&" A8%E$" *$5A%E$*" %+68" $\%*6%+0" -(A(" (99*l
[(*!?"T(\l"H+*6(+6".$**(0$*l"H/2*l"/%)$8l"g$*,"!$*,"!$*,"!$*?
Z:$"(&&%5.(6%A$"(+*L$5*"d3*6"Q$$9"&18L%+0,"(+)"(6"6:(6"98%+6,"6:$" $*6"6:%+0"68")8"%*"68
*%6"6:$"9$5*8+")8L+"(+)"*6(56"*:8L%+0":%."e3%EQ")$.8+*65(6%8+*"8&":8L"@*6$5%*Q"E(+
$"e3%EQ1!")$918!$)"(+)")$A$189$)?"Z:$+,"H"6!9%E(11!"98%+6"6:$"9$5*8+"68L(5)"6:$"&%5*6
$)%6%8+"8&"6:%*" 88Q,"5(!2+,(/#67 26=;!;+26.*67212" .0&,"(+)"*$6":%."188*$?"H+"d3*6"("&$L
:835*"8&")$A$189.$+6"R85"18+0$5,"8&"E835*$S,"E8.9(+%$*"E(+"E:(+0$"6:$"L(!"6:$!")$1%A$5
958)3E6*"68"E3*68.$5*,"+8+958&%6*"E(+"8A$5:(31":8L"6:$%5"3*$5*"%+6$5(E6"L%6:"6:$"*$5AX
%E$*"6:$!"8&&$5,"(+)"%+)%A%)3(1*"E(+"1$(5+"68" 3%1)"("9$5&$E61!"E3*68.%h$)"E(11X:(+)1%+0
*!*6$."&85"6:$%5".8 %1$"(+)":8.$"9:8+$*?"@*6$5%*Q"*E(1$*"39"(+)")8L+"&58."%+)%A%)3(1
1%+$*"68"A(*6".316%*$5A$5"%+*6(11(6%8+*"(E58**".316%91$"E8+6%+$+6*," 36"6:$"L(!"68"*6(56"%*

xix
68"%+*6(11"6:$"9(EQ(0$,"89$+"39"*8.$"8&"6:$"E8+&%035(6%8+"&%1$*,"(+)"*6(56"188Q%+0"(6
$\(.91$*?
T58."6:$" (*%E" $0%++%+0*"8&"("B4f"6:(6"'(5Q"D9$+E$5"E8)$)"%+">NNN,"6:$"@*6$5%*Q
958d$E6,"L%6:"6:$":$19"8&"6:83*(+)*"8&")$A$189$5*,":(*".8A$)"&58."*%.91!"E8++$E6%+0
9:8+$"E(11*"(+)":(*".(635$)"%+68"("91(6&85."6:(6"E(+":(+)1$"A8%E$,"A%)$8,"(+)"6$\6
(E58**" )8h$+*" 8&" A%563(1" (+)" 9:!*%E(1" %+6$5&(E$" 6!9$*?" Z:$" E5$(6%8+" (+)" 058L6:" 8&
@*6$5%*Q"L$5$"6:$"%+$*E(9( 1$"5$*316*"8&"6:$"E8+A$50$+E$"8&"6:$"&835":85*$.$+"8&"6:$
95895%$6(5!" :(5)L(5$" (98E(1!9*$V" 89$+" *835E$" )$A$189.$+6" %)$(*," 6:$" H+6$5+$6,
'885$G*"#(L,"(+)"6:$"913..$6%+0"E8*6*"8&"6$1$E8..3+%E(6%8+*?"[A$+":(5)L(5$"A$+X
)85*"L:8".(!" $"&5%0:6$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+E$96*?"Z:$+"%6"E8+6%+3$*"68"*3EE$$)"(*"6:$"+8A%E$" $E8.$*"(
958"(+)"*6(56*"6(99%+0"6:$"j86:$5"L(!*"68")8"%6k"L%6:".85$"*89:%*6%E(6$)"%.91$.$+6(X
6%8+*,"3*%+0"@JH"L%6:"-(A(,"B$51,"85"B!6:8+"R85"8+$"8&"6:$"86:$5")8h$+"85"*8"*399856$)
1(+03(0$*S,"85"$A$+"L5%6%+0":$5"8L+"E3*68."(99*"6:(6"L85Q"(*"E8.9%1$X6%.$"896%8+*
%+"@*6$5%*Q?"436"6:$"&%5*6"*6$9"&85"(+!8+$,"+8".(66$5"L:(6":%*"85":$5"*Q%11"1$A$1,"%*"68"188Q
(6"$\(.91$*"8&" (*%E"(99*"86:$5*":(A$"L5%66$+?"#$%&,"-%.,"(+)"23**$11":(A$"+86"8+1!"936
680$6:$5"("&(+6(*6%E"E8.9$+)%3."8&"@*6$5%*Q".$6:8)*," 36"6:$!":(A$"(1*8"958A%)$)"(+
$\E$11$+6"1%*6"8&"$\(.91$*"6:(6"L%11"1$6"6:$"+8A%E$"85"$\9$56"e3%EQ1!"1$(5+"+$L"6$E:+%e3$*
(+)"j.85$"6:(+"8+$"L(!"68")8"%6?k
@*6$5%*Q">?>"%*"&(+6(*6%E(11!"98L$5&31"(+)"E(+"*81A$"+$(51!"(+!"A8%E$"958 1$."!83".%0:6
:(A$?" T85" 6:8*$" 8&" !83" 3%1)%+0" 6:$" .8*6" E8.91$\" %+*6(11(6%8+*," 6:$5$" %*" $A$+" .85$
%+6$5$*6%+0"L85QiL:%E:"L%11" $"5$(1%h$)"e3%6$"*88+i%+")$A$189.$+6?"Z:$"E355$+61!X
%+X)$A$189.$+6"@*6$5%*Q"D7T"RDE(1( 1$"78..3+%E(6%8+*"T5(.$L85QS"%*" $%+0" 3%16"(*
(+"()d3+E6"89$+"*835E$"958d$E6"68"(118L"@*6$5%*Q">?>"*!*6$.*"68"*E(1$"%+"$A$+".85$
98L$5&31"L(!*i*6(!"63+$),"85" $66$5"!$6,"0$6"%+A81A$)"L%6:"6:$"958d$E6"(*"(")$A$189$5?

xx | Foreword
H&"!83G5$"(+"$\9$5%$+E$)"@*6$5%*Q")$A$189$5"85"%+6$05(685,"HG."*35$"6:%*" 88Q"L%11":(A$
("&$L"jK$!,"6:(6G*"("+$(6"L(!"68")8"%6pk".8.$+6*"&85"!83,"L:%E:"%*"8+$"8&"6:$"d8!*"8&
@*6$5%*Q?"H&"6:%*"%*"!835"&%5*6"958d$E6"L%6:"@*6$5%*Q,"HG)"1%Q$"68"L$1E8.$"!83"68"6:$":30$
E8..3+%6!"8&"3*$5*"(+)")$A$189$5*")$)%E(6$)"68".(Q%+0"@*6$5%*Q" $66$5?"Z:%*" 88Q"L%11
6(Q$"!83"&58."("A(03$"%)$("8&")8%+0"*8.$6:%+0"L%6:"E8.936$5*"(+)"A8%E$"E8..3+%X
E(6%8+" 68" 6:$" 98%+6" L:$5$" !83G5$" ( 1$" 68" *63+" $A$5!8+$" !83" Q+8L" L%6:" !835" 9:8+$
*!*6$.G*"*89:%*6%E(6$)"65%EQ*?
g83G5$"$+E835(0$)"68"9(56%E%9(6$"%+"6:$"8+1%+$".(%1%+0"1%*6*,"H27"E:(6588.*,"(+)"!$(51!
@*65%78+"E8+&$5$+E$"6:(6"958A%)$"39X68X6:$X*$E8+)"+$L*"(+)")%*E3**%8+"*35583+)%+0
6:$" 958d$E6?" _%6:836" !835" %+6$5$*6," %+936," (+)" E8)$," @*6$5%*Q" L831)+G6" $\%*6?" F9$+
*835E$"958d$E6*"(5$":3+05!"&85"+$L"%)$(*"(+)"$\E$11$+6"E8+65% 36%8+*V"H"$+E835(0$"!83
68" $"("9(56%E%9(+6"%+"6:$"@*6$5%*Q"E8..3+%6!,"(+)"H"188Q"&85L(5)"68"*$$%+0"!835"e3$*X
6%8+*"(+)"$\(.91$*"%+"6:$"+$\6"$)%6%8+"8&"6:%*" 88Q?
i-8:+"Z8))

Foreword | xxi
Preface

Z:%*"%*"(" 88Q"&85"(+!8+$"L:8"3*$*"@*6$5%*Q?
@*6$5%*Q"%*"(+"89$+"*835E$,"E8+A$50$)"6$1$9:8+!"91(6&85.,"L:%E:"%*")$*%0+$)"95%.(5%1!
68"53+"8+"#%+3\?"@*6$5%*Q"E8. %+$*".85$"6:(+">=="!$(5*"8&"6$1$9:8+!"Q+8L1$)0$"%+68
(" 58 3*6" *3%6$" 8&" 6%0:61!" %+6$05(6$)" 6$1$E8..3+%E(6%8+*" (991%E(6%8+*?" Z:$" 98L$5" 8&
@*6$5%*Q"1%$*"%+"%6*"E3*68.%h( 1$"+(635$,"E8.91$.$+6$)" !"3+.(6E:$)"*6(+)(5)*"E8.X
91%(+E$?"M8"86:$5"B4f"E(+" $")$918!$)"%+"*8".(+!"E5$(6%A$"L(!*?
@991%E(6%8+*"*3E:"(*"A8%E$.(%1,":8*6$)"E8+&$5$+E%+0,"E(11"e3$3%+0"(+)"(0$+6*,".3*%E
8+":81),"(+)"E(11"9(5Q%+0"(5$"(11"*6(+)(5)"&$(635$*" 3%16"5%0:6"%+68"6:$"*8&6L(5$?"'85$X
8A$5,"@*6$5%*Q"E(+"%+6$05(6$"L%6:"86:$5" 3*%+$**"6$E:+8180%$*"%+"L(!*"6:(6"E18*$),"958X
95%$6(5!"B4f*"E(+"*E(5E$1!")5$(."8&?
@*6$5%*Q"E(+"(99$(5"e3%6$")(3+6%+0"(+)"E8.91$\"68"("+$L"3*$5,"L:%E:"%*"L:!")8E3X
.$+6(6%8+"%*"*8"%.9856(+6"68"%6*"058L6:?"^8E3.$+6(6%8+"18L$5*"6:$" (55%$5"68"$+65!"(+)
:$19*"9$891$"E8+6$.91(6$"6:$"98**% %1%6%$*?
B58)3E$)" L%6:" 6:$" 0$+$583*" *399856" 8&" FG2$%11!" '$)%(," 5(!2+,(/#" 7 26 82*,0,!,92
:;,<2" %*" 6:$" 6:%5)" $)%6%8+" 8&" L:(6" L(*" &85.$51!" E(11$)" 5(!2+,(/#6 7 26 =;!;+26 .*
7212" .0&?"_$")$E%)$)"68"E:(+0$"6:$"+(.$" $E(3*$"@*6$5%*Q":(*" $$+"*8"L%1)1!"*3EX
E$**&31"6:(6"%6"%*"+8"18+0$5"(+"39X(+)XE8.%+0"6$E:+8180!?"@*6$5%*Q":(*"(55%A$)?
Z:%*" 88Q"L(*"L5%66$+"&85,"(+)" !,".$. $5*"8&"6:$"@*6$5%*Q"E8..3+%6!?

Audience
Z:%*" 88Q"%*"%+6$+)$)"68" $"0$+61$"68L(5)"6:8*$"+$L"68"@*6$5%*Q," 36"L$"(**3.$"6:(6
!83G5$"&(.%1%(5"L%6:" (*%E"#%+3\"().%+%*65(6%8+,"+$6L85Q%+0,"(+)"86:$5"HZ")%*E%91%+$*?
H&" +86," L$" $+E835(0$" !83" 68" $\9185$" 6:$" A(*6" (+)" L8+)$5&31" 1% 5(5!" 8&" 88Q*" 6:(6
FG2$%11!"93 1%*:$*"8+"6:$*$"*3 d$E6*?"_$"(1*8"(**3.$"!83G5$"&(%51!"+$L"68"6$1$E8..3X
+%E(6%8+*"R 86:"65()%6%8+(1"*L%6E:$)"6$1$9:8+!"(+)"6:$"+$L"L851)"8&"/8%E$"8A$5"HBS?
K8L$A$5,"6:%*" 88Q"L%11"(1*8" $"3*$&31"&85"6:$".85$"$\9$5%$+E$)"@*6$5%*Q"().%+%*65(685?
_$"835*$1A$*"3*$"6:$" 88Q"(*"("5$&$5$+E$"&85"&$(635$*"6:(6"L$":(A$+G6"3*$)"&85"("L:%1$?

xxiii
Organization
Z:$" 88Q"%*"850(+%h$)"%+68"6:$*$"E:(96$5*V
? )"!2+6@A6567212" .0&6B29.1;!,.0
Z:%*"%*"L:$5$"L$"E:89"39"6:$"Q%+)1%+0"(+)"1%0:6"6:$"&%5$?"_$1E8.$"68"@*6$5%*Qp
? )"!2+6CA65(!2+,(/65+3 ,!23!;+2
^%*E3**$*"6:$"&%1$"*653E635$"8&"(+"@*6$5%*Q"*!*6$.?
? )"!2+6DA6E0(!)11,0F65(!2+,(/
78A$5*"8 6(%+%+0,"E8.9%1%+0,"(+)"%+*6(11%+0"@*6$5%*Q?
? )"!2+6GA6E0,!,)16?.0*,F;+)!,.067)(/(
^$*E5% $*" *8.$" %+%6%(1" E8+&%035(6%8+" 6(*Q*" &85" !835" +$L" @*6$5%*Q" *!*6$.?" Z:%*
E:(96$5" 08$*" 8A$5" *8.$" 8&" 6:$" E8+&%035(6%8+" &%1$*" 5$e3%5$)" &85" (11" @*6$5%*Q
%+*6(11(6%8+*?
? )"!2+6HA6I(2+6829,326?.0*,F;+)!,.0
B58A%)$*"03%)(+E$"8+"E8+&%035%+0"@*6$5%*Q"68"(118L")$A%E$*"*3E:"(*"6$1$9:8+$*"68
E8++$E6"(+)".(Q$"E(11*?
? )"!2+6JA68,)1"1)06K)(,3(
H+658)3E$*"6:$":$(56"8&"@*6$5%*Q,"6:$")%(191(+?
? )"!2+6LA6M;!(,<26?.0023!,9,!&
^%*E3**$*":8L"68"E8+&%035$"@*6$5%*Q"68"E8++$E6"68"86:$5"*!*6$.*,"*3E:"(*"86:$5
@*6$5%*Q"*$5A$5*,"H+6$5+$6"6$1$9:8+!"*$5A%E$"958A%)$5*,"85"6:$"91(%+"81)"6$1$9:8+$
+$6L85Q?
? )"!2+6NA6O.,32%),1
78A$5*"6:$"3*(0$"8&"8+$"8&"6:$".8*6"98931(5"(991%E(6%8+*"%+E13)$)"L%6:"@*6$5%*Q,
6:$"A8%E$.(%1"*!*6$.?
? )"!2+6PA6E0!2+0)!,.0)1,Q)!,.0
T8E3*$*"8+"%**3$*"6:(6"(+"@*6$5%*Q"().%+%*65(685"*:831)" $"(L(5$"8&"L:$+")$918!X
%+0"("*!*6$."836*%)$"8&"M856:"@.$5%E(?
? )"!2+6@RA6822"2+6,0!.6! 268,)1"1)0
J8$*"8A$5"*8.$".85$"()A(+E$)")%(191(+"E8+E$96*?
? )"!2+6@@A6S)+/,0F6)0<6S)F,0F
^$*E5% $*"6:$"3*(0$"8&"6L8"98931(5"6$1$9:8+!"&$(635$*"%+E13)$)"L%6:"@*6$5%*Q,"E(11
9(5Q%+0"(+)"9(0%+0?
? )"!2+6@CA6E0!2+02!6?)116B.;!,0F
78A$5*"6$E:+%e3$*"&85"5836%+0"E(11*" $6L$$+")%&&$5$+6"().%+%*65(6%A$")8.(%+*"8+
6:$"H+6$5+$6?
? )"!2+6@DA65;!.%)!,36?)1168,(!+,-;!,.06T5?8U6V;2;2(
^%*E3**$*":8L"68" 3%1)"E(11"e3$3$*"%+"@*6$5%*Q?

xxiv | Preface
? )"!2+6@GA6829,326W!)!2(
H+658)3E$*" 6:$" E8+E$96" 8&" )$A%E$" *6(6$*" (+)" :8L" 6:$!" E(+" $" 3*$)" (*" 95$*$+E$
%+)%E(685*?
? )"!2+6@HA67 265;!.%)!2<65!!20<)0!
78A$5*":8L"68" 3%1)"(".$+3%+0"*!*6$."3*%+0"6:$"@*6$5%*Q")%(191(+?
? )"!2+6@JA6B21)!,.0)168)!)-)(26E0!2F+)!,.0
^%*E3**$*"A(5%83*"L(!*"6:(6"@*6$5%*Q"E(+" $"%+6$05(6$)"L%6:"(")(6( (*$?
? )"!2+6@LA6E0!2+)3!,926O.,326B2(".0(2
J8$*"8A$5":8L"@*6$5%*Q"E(+" $"3*$)"68" 3%1)"(991%E(6%8+*"6:(6"(E6"8+"%+936"958A%)$)
!"("E(11$5?
? )"!2+6@NA6X>!2+0)16W2+9,32(
B58A%)$*"%+*653E6%8+*"8+":8L"68"E8++$E6"68"$\6$5+(1"*$5A%E$*"%+E13)%+0"#^@B,"E(1X
$+)(5*,"H'@B"&85"A8%E$.(%1,"f'BB,"DQ!9$,"(+)"6$\6X68X*9$$E:?
? )"!2+6@PA6=)>
^%*E3**$*"6:$"A(5%83*"896%8+*"&85"%+6$05(6%+0"*$+)%+0"(+)"5$E$%A%+0"&(\$*"L%6:"(+
@*6$5%*Q"*!*6$.?
? )"!2+6CRA65(!2+,(/6Y)0)F2+6E0!2+*)326T5YEU
H+658)3E$*"("+$6L85Q"@BH"&85".8+%685%+0"(+)"E8+65811%+0"(+"@*6$5%*Q"*!*6$.?
? )"!2+6C@A65(!2+,(/6:)!2Z)&6E0!2+*)326T5:EU
H+658)3E$*"6:$"@*6$5%*Q"@BH"6:(6"(118L*"E(11"E8+6581"68" $"%.91$.$+6$)"%+"(+!"958X
05(..%+0"1(+03(0$?
? )"!2+6CCA6?1;(!2+,0F
^%*E3**$*"("+3. $5"8&"(9958(E:$*"&85"E13*6$5%+0".316%91$"@*6$5%*Q"*$5A$5*"680$6:$5
8+E$"6:$")$.(+)*"8&"(")$918!.$+6"$\E$$)"6:$"E(9( %1%6%$*"8&"("*%+01$"*$5A$5?
? )"!2+6CDA68,(!+,-;!2<6I0,92+()16[;%-2+68,(3.92+&6T8I[8,U
78A$5*"("9$$5X68X9$$5"95868E81"+(6%A$"68"@*6$5%*Q"6:(6"E(+" $"3*$)"&85"E(11"5836%+0?
? )"!2+6CGA6W&(!2%6Y.0,!.+,0F6)0<6\.FF,0F
H+658)3E$*"*8.$"8&"6:$"%+6$5&(E$*"(A(%1( 1$"&85"1800%+0"(+)".8+%685%+0"(+"@*6$5%*Q
*!*6$.?
? )"!2+6CHA6]2-6E0!2+*)32(
@"*35A$!"8&"*8.$"8&"6:$"L$ "%+6$5&(E$*"6:(6"E8.91$.$+6"(+"@*6$5%*Q"%+*6(11(6%8+?
? )"!2+6CJA6W23;+,!&
^%*E3**$*" *8.$" E8..8+" *$E35%6!" %**3$*" 6:(6" @*6$5%*Q" ().%+%*65(685*" *:831)" $
(L(5$"8&?
? )"!2+6CLA65(!2+,(/#656=;!;+26*.+67212" .0&
H+"E8+E13*%8+,"L$")%*E3**"*8.$"8&"6:$"6:%+0*"L$"$\9$E6"68"*$$"&58."89$+"*835E$
6$1$9:8+!"%+"6:$"+$(5"&3635$?
5""20<,>65A6I0<2+(!)0<,0F67212" .0&
[\9185$*"6:$"6$E:+8180%$*"%+"3*$"%+"65()%6%8+(1"6$1$E8."+$6L85Q*?"Z:%*"3*$)"68" $
("E:(96$5"%+"81)"A$5*%8+*"8&"6:%*" 88Q?"@16:830:"+86")%5$E61!"5$1$A(+6"68"@*6$5%*Q

Preface | xxv
L$"&$16"6:(6"%6".%0:6"*6%11" $"3*$&31"68"*8.$"5$()$5*,"*8"L$GA$"1$&6"%6"%+"6:$" 88Q"(*
(+"(99$+)%\?
5""20<,>6KA6S+.!.3.1(6*.+6O.ES
^$1A$*"%+68"(11"6:$"9(56%E31(5%6%$*"8&"/8%E$"8A$5"HB?"Z:%*"L(*"(1*8"("E:(96$5"%+"81)
A$5*%8+*"8&"6:%*" 88Q?
5""20<,>6?A6S+2")+,0F6)6W&(!2%6*.+65(!2+,(/
78+6(%+*"%+&85.(6%8+"!83"*:831)" $"(L(5$"8&"(+)"6(Q$"%+68"E8+*%)$5(6%8+"L:$+
91(++%+0"(+"@*6$5%*Q")$918!.$+6?

Software
Z:%*" 88Q"%*"&8E3*$)"8+")8E3.$+6%+0"@*6$5%*Q"A$5*%8+">?Wq":8L$A$5,".(+!"8&"6:$"E8+X
A$+6%8+*"(+)".3E:"8&"6:$"%+&85.(6%8+"%+"6:%*" 88Q"%*"A$5*%8+X(0+8*6%E?"#%+3\"%*"6:$
89$5(6%+0"*!*6$."L$":(A$"53+"(+)"6$*6$)"@*6$5%*Q"8+,"(+)"L$":(A$")8E3.$+6$)"%+*6(1X
1(6%8+"%+*653E6%8+*"&85" 86:"7$+6FD"R2$)"K(6"[+6$595%*$"#%+3\r (*$)S"(+)"C 3+63
R^$ %(+X (*$)S"L:$5$"6:$!")%&&$5"&58."$(E:"86:$5?

Conventions Used in This Book


Z:$"&8118L%+0"6!9805(9:%E(1"E8+A$+6%8+*"(5$"3*$)"%+"6:%*" 88QV
E!)1,3
H+)%E(6$*"+$L"6$5.*,"C2#*,"$.(%1"())5$**$*,"&%1$+(.$*,"&%1$"$\6$+*%8+*,"9(6:+(.$*,
)%5$E685%$*," (+)" 9(EQ(0$" +(.$*," (*" L$11" (*" C+%\" 36%1%6%$*," E8..(+)*," 896%8+*,
9(5(.$6$5*,"(+)"(503.$+6*?
Constant width
C*$)" 68" )%*91(!" E8)$" *(.91$*," &%1$" E8+6$+6*," E8..(+)X1%+$" %+6$5(E6%8+*," 1% 5(5!
+(.$*,"(+)")(6( (*$"E8..(+)*?
Constant width bold
H+)%E(6$*"E8..(+)*"85"86:$5"6$\6"6:(6"*:831)" $"6!9$)"1%6$5(11!" !"6:$"3*$5?"@1*8
3*$)"&85"$.9:(*%*"%+"E8)$?
Constant width italic
D:8L*"6$\6"6:(6"*:831)" $"5$91(E$)"L%6:"3*$5X*3991%$)"A(13$*?
[ Keywords and other stuff ]
H+)%E(6$*"896%8+(1"Q$!L85)*"(+)"(503.$+6*?
{ choice-1 | choice-2 }
D%0+%&%$*"$%6:$5"choice-1"85"choice-2?

Z:%*"%E8+"*%0+%&%$*"("6%9,"*300$*6%8+,"85"0$+$5(1"+86$?

xxvi | Preface
Z:%*"%E8+"%+)%E(6$*"("L(5+%+0"85"E(36%8+?

Using Code Examples


Z:%*" 88Q"%*":$5$"68":$19"!83"0$6"!835"d8 ")8+$?"H+"0$+$5(1,"!83".(!"3*$"6:$"E8)$"%+
6:%*" 88Q"%+"!835"95805(.*"(+)")8E3.$+6(6%8+?"g83")8"+86"+$$)"68"E8+6(E6"3*"&85
9$5.%**%8+"3+1$**"!83G5$"5$958)3E%+0"("*%0+%&%E(+6"9856%8+"8&"6:$"E8)$?"T85"$\(.91$,
L5%6%+0"("95805(."6:(6"3*$*"*$A$5(1"E:3+Q*"8&"E8)$"&58."6:%*" 88Q")8$*"+86"5$e3%5$
9$5.%**%8+?"D$11%+0"85")%*65% 36%+0"("7^X2F'"8&"$\(.91$*"&58."FG2$%11!" 88Q*")8$*
5$e3%5$" 9$5.%**%8+?" @+*L$5%+0" (" e3$*6%8+" !" E%6%+0" 6:%*" 88Q" (+)" e386%+0" $\(.91$
E8)$")8$*"+86"5$e3%5$"9$5.%**%8+?"H+E85985(6%+0"("*%0+%&%E(+6"(.83+6"8&"$\(.91$"E8)$
&58."6:%*" 88Q"%+68"!835"958)3E6G*")8E3.$+6(6%8+")8$*"5$e3%5$"9$5.%**%8+?
_$"(995$E%(6$," 36")8"+86"5$e3%5$,"(665% 36%8+?"@+"(665% 36%8+"3*3(11!"%+E13)$*"6:$"6%61$,
(36:85,"93 1%*:$5,"(+)"HD4M?"T85"$\(.91$V"j5(!2+,(/#67 2682*,0,!,926:;,<2,"Z:%5)"[)X
%6%8+," !"#$%&"'()*$+,"-%."/(+"'$00$1$+,"(+)"23**$11"45!(+6"RFG2$%11!S?"789!5%0:6
<=>>"#$%&"'()*$+,"-%."/(+"'$00$1$+,"(+)"23**$11"45!(+6,"NPWX=XIN`XI>PYOX<?k
H&"!83"&$$1"!835"3*$"8&"E8)$"$\(.91$*"&(11*"836*%)$"&(%5"3*$"85"6:$"9$5.%**%8+"0%A$+"( 8A$,
&$$1"&5$$"68"E8+6(E6"3*"(6""2+%,((,.0(4.+2,11&'3.%?

Safari Books Online


_:$+"!83"*$$"("D(&(5%"488Q*"F+1%+$"%E8+"8+"6:$"E8A$5"8&"!835"&(A85%6$
6$E:+8180!" 88Q," 6:(6" .$(+*" 6:$" 88Q" %*" (A(%1( 1$" 8+1%+$" 6:5830:" 6:$
FG2$%11!"M$6L85Q"D(&(5%"488Q*:$1&?
D(&(5%"8&&$5*"("*8136%8+"6:(6G*" $66$5"6:(+"$ 88Q*?"H6G*"("A%563(1"1% 5(5!"6:(6"1$6*"!83"$(*%1!
*$(5E:"6:83*(+)*"8&"689"6$E:" 88Q*,"E36"(+)"9(*6$"E8)$"*(.91$*,")8L+18()"E:(96$5*,
(+)"&%+)"e3%EQ"(+*L$5*"L:$+"!83"+$$)"6:$".8*6"(EE35(6$,"E355$+6"%+&85.(6%8+?"Z5!"%6
&85"&5$$"(6" !!"#$$()*)+,'.+2,11&'3.%?

How to Contact Us
B1$(*$"())5$**"E8..$+6*"(+)"e3$*6%8+*"E8+E$5+%+0"6:%*" 88Q"68"6:$"93 1%*:$5V
FG2$%11!"'$)%(,"H+E?
>==I"J5(A$+*6$%+"K%0:L(!"M856:
D$ (*68981,"7@"NIOP<
RW==S"NNWXNNYW"R%+"6:$"C+%6$)"D6(6$*"85"7(+()(S
RP=PS"W<NX=I>I"R%+6$5+(6%8+(1"85"18E(1S
RP=PS"W<NX=>=O"R&(\S

Preface | xxvii
_$":(A$"("L$ "9(0$"&85"6:%*" 88Q,"L:$5$"L$"1%*6"$55(6(,"$\(.91$*,"(+)"(+!"())%6%8+(1
%+&85.(6%8+?"g83"E(+"(EE$**"6:%*"9(0$"(6V
!!"#$$.+2,11&'3.%$3)!)1.F$PLNRHPJH@LDGC
Z8"E8..$+6"85"(*Q"6$E:+%E(1"e3$*6%8+*"( 836"6:%*" 88Q,"*$+)"$.(%1"68V
-../^;2(!,.0(4.+2,11&'3.%
T85" .85$" %+&85.(6%8+" ( 836" 835" 88Q*," E8+&$5$+E$*," 2$*835E$" 7$+6$5*," (+)" 6:$
FG2$%11!"M$6L85Q,"*$$"835"L$ *%6$"(6V
!!"#$$ZZZ'.+2,11&'3.%
T%+)"3*"8+"T(E$ 88QV" !!"#$$*)32-../'3.%$.+2,11&
T8118L"3*"8+"ZL%66$5V" !!"#$$!Z,!!2+'3.%$.+2,11&%2<,)
_(6E:"3*"8+"g83Z3 $V" !!"#$$ZZZ'&.;!;-2'3.%$.+2,11&%2<,)

Acknowledgments
Z8"^(A%)"^3&&$66,"6:(+Q*"&85"6:$"$\E$11$+6"E:(96$5"8+"%+6$5+(6%8+(1%h(6%8+,"L:%E:"L831)
+86":(A$" $$+"*$5A$)"L$11" !" $%+0"L5%66$+" !"3*"M856:"@.$5%E(+*?
M$\6,"L$"L(+6"68"6:(+Q"835"&(+6(*6%E"$)%685,"'%E:($1"#83Q%)$*,"&85"!835"9(6%$+E$"L%6:
6:%*"6:%5)"$)%6%8+,"L:%E:"688Q"688"18+0"68"0$6"8&&"6:$"0583+),"(+)".(+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%6:"*9$E%&%E"$\9$5%$+E$"%+"A(5%83*"(5$(*?"Z:$%5"0$+$583*"E8+65% 3X
6%8+*"8&"6%.$"(+)"$\9$56%*$"L$5$"%+*653.$+6(1"%+"835"5$*$(5E:?"Z:(+Q*"68"2(+)!"2$*+%EQ,
850(+%h$5"8&"6:$"/8HB"C*$5"J5839q"]$A%+"T1$.%+0"8&"^%0%3.q"#$$"K8L(5),"(36:85"8&
%(\.8)$."(+)":!1(&(\q"-8*:3("7819"8&"^%0%3.q"B:%11%9"'311%*"8&"6:$"Z858+68"@*6$5%*Q
C*$5*"J5839q"@11%*8+"D.%6:,"6:$"/8%E$"8&"@*6$5%*Qq"T1(A%8"[?"J8+E(1A$*,"(36:85"8&" 88Q*

xxviii | Preface
8+"@*6$5%*Q,"F9$+D[2,"(+)"F9$+DHBDq"-?"Fe3$+)8,"D$E35%6!"J353q"Zh(&5%5"78:$+,"&8+6
8&"Q+8L1$)0$"( 836"*$E35%6!"(+)"186*"8&"86:$5"*63&&q"-$&&"J$:1 (E:,"&85"DM'Bq"FA%)%3
D(*,"&85"!835"$+E!E189$)%E"Q+8L1$0$"8&"DHBq"Z8.8"Z(Q$ $,"&85"*8.$"D'^H":$19q"D6$A$
C+)$5L88),"&85":$19"L%6:"&(\"(+)" spandspq"(+)"2%E:(5)"J$+6:+$5"(+)"-8:+"78A$56,
&85":$19%+0"L%6:"#^@B?
@"*9$E%(1"6:(+Q*"*:831)"(1*8"08"68"-8:+"Z8))"&85" $%+0"8+$"8&"6:$"&%5*6"68"L5%6$"E8.X
95$:$+*%A$"@*6$5%*Q":8LX68*,"(11"6:8*$"!$(5*"(08,"(+)"&85"(11"6:$".(+!"86:$5"6:%+0*"!83
)8"R(+)":(A$")8+$S"&85"6:$"@*6$5%*Q"E8..3+%6!?

Open Feedback Publishing System (OFPS)


_:%1$"L$"L$5$"L5%6%+0"6:%*" 88Q,"FG2$%11!"%+658)3E$)"%6*"F9$+"T$$) (EQ"B3 1%*:%+0
D!*6$."RFTBDS,"L:%E:"(118L$)"835" 88Q"68"(99$(5"8+"6:$"_$ "(*"L$"L$5$"L5%6%+0"%6?
78..3+%6!" .$. $5*" L$5$" ( 1$" 68" *3 .%6" &$$) (EQ" (+)" E8..$+6*," L:%E:" L(*" 8&
$+85.83*":$19"68"3*?"Z:$"&8118L%+0"%*"("1%*6"8&"6:$%5"+(.$*"85":(+)1$*sV
'(66:$L" 'E@30:(+," '(66" B3*(6$5%," ^(A%)" /(+" J%++$Q$+," @*6$5%*Q" '(+%(,
J%8A(++%"/(11$*%,"'(5Q"B$6$5*$+,"6:9O,"^(A%)"28L,"6AE><Y,"T5$)$5%E"-$(+,"-8:+
Z8)),"D6$A$+"D8Q81,"#(35$+6"D6$&&(+,"28 $56"^(%1$!,"K8L(5)"K(59$5,"-8*$9:"2$X
+*%+," K8L(5)" _:%6$," -(!" [(.$*," /%+E$+6" Z:8.(**$6," ^(A$" 4(5+8L," D$ (*6%$+
^%8++$,"H085"M%Q81($A,"@5$+)"A(+")$5"]81Q,"@+L(5"K8**(%+,"E5(%0$*.%6:,"+Q( %5,
(+$*6," M%E:81(*" 4(5+$*," @1$\" M$3.(+," -3*6%+" ]85Q%+$5," D6$&(+" DE:.%)6," 9( $X
1(+0$5,"d&%+*658.,"58)$5%EQ.8+608.$5!,"D:($"[5%**8+,"J(*68+"^5(e3$,"2%E:(5)
J$+6:+$5,"'%E:($1"D"7811%+*,"(+)"-$&&"B$$1$5
Z:(+Q*"68"(11"8&"!83"&85"!835"A(13( 1$"E8+65% 36%8+"68"6:%*" 88Q?

Z:(+Q*"68"D$(+"45%0:6,"[)"J3!,"D%.8+"^%6+$5,"(+)"B(31"4$1(+0$5"&85"(**%*6%+0"3*"L%6:
E1(5%&!%+0" $*6"95(E6%E$*"&85"3*$5"(+)"05839"981%E%$*"&85"@*6$5%*Q"%+*6(11(6%8+?"H+"6:$"9(*6
%6"L(*"E8..8+"68"d3*6"%+*6(11"@*6$5%*Q"L%6:"+..!"9$5.%**%8+*," 36"L$":(A$"$1$E6$)"68
)$*E5% $"(+"%+*6(11(6%8+"958E$**"6:(6"%*".85$"%+"Q$$9%+0"L%6:"#%+3\" $*6"95(E6%E$*,t"(+)
6:$*$"&%+$"0$+6*"E8+65% 36$)"68"835")%*E3**%8+*"8+"6:(6?
]3)8*"68"(11"6:$"&81Q*"L85Q%+0"8+"6:$"T5$$D_HZ7K,"g@Z[,"D[2,"](.(%1%8,"F9$+DHBD,
D[2,"*%9f$E*,"_88.$5(,"(+)"(+!"86:$5"89$+"*835E$"6$1$E8."958d$E6*,"&85"*6%.31(6%+0
+$L"6:830:6*,"(+)"&85"93*:%+0"6:$"$+A$189$?
[A$5!8+$"%+"6:$"@*6$5%*Q"E8..3+%6!"(1*8"+$$)*"68"6:(+Q"-%."^%\8+"&85"E5$(6%+0"6:$
&%5*6"89$+"*835E$"6$1$9:8+!":(5)L(5$"%+6$5&(E$*,"*6(56%+0"6:$"5$A8136%8+,"(+)"0%A%+0":%*
E5$(6%8+*"68"6:$"E8..3+%6!"(6"1(50$?

s _$"65%$)"L:$5$A$5"98**% 1$"68"%+E13)$"6:$"E8+65% 3685*G"+(.$*," 36"%+"*8.$"E(*$*"E831)"+86,"(+)"6:$5$&85$


%+E13)$)"6:$%5":(+)1$*"%+*6$()?
t _%6:836"*6(56%+0"(":81!"L(5p

Preface | xxix
T%+(11!," (+)" .8*6" %.9856(+61!," 6:(+Q*" 08" 68" '(5Q" D9$+E$5," 6:$" 85%0%+(1" (36:85" 8&
@*6$5%*Q"(+)"&83+)$5"8&"^%0%3.,"&85"@*6$5%*Q,"&85"B%)0%+"R !!"#$$ZZZ'",<F,0',%S,"(+)
&85"E8+65% 36%+0":%*"E5$(6%8+*"68"6:$"89$+"*835E$"E8..3+%6!?"@*6$5%*Q"%*"!835"1$0(E!p

Leif Madsen
H6"*856"8&"(.(h$*".$"L:$5$"H"*6(56$)"L%6:"@*6$5%*Q,"(+)"L:$5$"HGA$"08+$"L%6:"@*6$5%*Q?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H"E(5)"(+)"E8++$E6
%6"68"6:$"9:8+$"+$6L85Q"L(*"+86"18*6"8+".$?"@&6$5"("E8391$"8&":835*"8&"188Q%+0"(6"6:$
*8&6L(5$"(+)"0$66%+0"%6"E8.9%1$),"H"*6(56$)"6$11%+0"8+$"8&".!"6$(E:$5*"( 836"6:$"B7H
E(5)*" (+)" :8L" .(! $" L$" E831)" 0$6" *8.$" &85" 6:$" E1(**588." &85" 1( *" (+)" *3E:" R835
E1(**588.":()"Y="E8.936$5*"(6">="6( 1$*"8&"YS?"K$"1%Q$)"6:$"%)$("(+)"*6(56$)"6(1Q%+0"68
6:$"95805(."E885)%+(685,"(+)"L%6:%+"( 836"Y=".%+36$*"(+"85)$5":()" $$+"91(E$)"&85
<=" E(5)*?" B5$66!" (.(h%+0" E8+*%)$5%+0" 6:$!" L$5$" Z^'O==B*" )$EQ$)" 836" L%6:" &835
)(30:6$5"E(5)*,"(+)"6:$!":()"8+1!":$(5)"( 836"6:$."(+":835"95%85"68"6:(6?
Z:$+"6:$"8 *$**%8+" $0(+?"H"*9$+6"$A$5!"$\65(".8.$+6"8&"6:(6"*$.$*6$5"L%6:"("E8391$
8&"E8.936$5*")$)%E(6$)"68"@*6$5%*Q"3*$?"H+"6:8*$"6L8".8+6:*,"H"1$(5+$)"("186?"Z:$+"L$
:()"("E8X89" 5$(Q?"H")%)+G6"&%+)"(+!"L85Q"%..$)%(6$1!,"*8"H".8A$)":8.$"(+)"E8+6%+3$)
L85Q%+0"8+"@*6$5%*Q,"*9$+)%+0"6%.$"8+"H27,"5$()%+0"6:5830:"$\(.91$*"98*6$)" !"-8:+
Z8)),"(+)"d3*6"65!%+0"68"L5(9".!":$()"(583+)":8L"6:$"*8&6L(5$"L85Q$)?"#3EQ%1!"H":()
("186"8&":$19"8+"H27"R&85"6:$*$"L$5$"6:$")(!*"95%85"68"(+!")8E3.$+6(6%8+"8+"@*6$5%*QS,
(+)"H"1$(5+$)"("186".85$")35%+0"6:(6"*$.$*6$5?
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%&$".()$S,"(+)" $E8.$"("E8+*316(+6
*9$E%(1%h%+0" %+" )(6( (*$" %+6$05(6%8+" R6:(+Q*" Z%10:.(+" &85" func_odbcS" (+)" E13*6$5%+0
R6:(+Q*"'(5Q"D9$+E$5"&85"^CM^%S?"H"5$(11!"18A$"@*6$5%*Q,"(+)"(11"6:(6"%6G*"(118L$)".$
68")8?
T%5*6,"6:(+Q*"68".!"9(5$+6*"2%EQ"(+)"7(581,"&85"6:$"3+)$5*6(+)%+0"(+)"*399856"%+"$AX
$5!6:%+0"HGA$")8+$"%+".!"1%&$?"T58."6:$"&%5*6"E8.936$5"6:$!"935E:(*$)"&85"&(5"688".3E:
.8+$!"L:$+"H"L(*"%+"05()$"`"RH"*6(56$)"6(Q%+0"(+"%+6$5$*6"%+"E8.936$5*"%+"05()$"<"3*%+0
("78..8)85$"`O,"(+)"6:$!"086".$"("E8.936$5"(&6$5"("9(5$+6X6$(E:$5"%+6$5A%$L"("&$L
!$(5*"1(6$5S"68"1$66%+0".$"3*$"6:$":8.$"9:8+$"1%+$"&85".!"44D"$+)$(A85*"R(+)"$A$+63(11!
0$66%+0".$".!"8L+"9:8+$"1%+$S,"(+)"$A$5!6:%+0"$1*$"6:$!":(A$"$A$5")8+$"&85".$,"H"E(+
+$A$5"6:(+Q"6:$."$+830:?"H"18A$"!83" 86:".85$"6:(+"!83G11"$A$5"%.(0%+$?
Z:(+Q*"68".!"J5(+).("Z"&85"1$66%+0".$"3*$":$5"<W`")35%+0"6:$"!$(5*"L:$+"H")%)+G6
:(A$"("E8.936$5"(6":8.$,"(+)"&85"6(Q%+0".$"*:899%+0"$A$5!"!$(5"8+".!" %56:)(!"&85
>I"!$(5*?"#8A$"186*p
Z8".!" $(36%&31"L%&$,"^(+%$11$,"&85"*$66%+0"6:$"(1(5."$A$5!".85+%+0" $&85$"*:$"1$&6"&85
L85Q,"1$66%+0".$"*1$$9"6:8*$"$\65(">=".%+36$*" $&85$"*6(56%+0"8+"6:%*" 88Q,"(+)"3+)$5X
*6(+)%+0"L:$+"H":()"68"L85Q"1(6$" $E(3*$"H"L$+6"9(*6".!"N"@?'?"*689XL5%6%+0"6%.$,
6:(+Q"!83"(+)"H"18A$"!83"*8".3E:?
Z:$5$"(5$"*8".(+!"9$891$"L:8":$19".$"(+)"6$(E:".$"+$L"6:%+0*"$A$5!")(!," 36"6:$
.8*6" %+&13$+6%(1" 8+" .!" 1%&$" %+" @*6$5%*Q" (5$" 6:$" &8118L%+0V" '(5Q" D9$+E$5" &85" L5%6%+0
*8&6L(5$"6:(6":(*"0%A$+".$"("&(+6(*6%E"E(5$$5,"-8:+"Z8))"&85":%*"$(51!"$\(.91$*,"45%(+
]?"_$*6"&85":%*"$(51!":$19"(+)"$+6:3*%(*."8+"H27,"D6$A$"D8Q81"(+)"F11$"-8:(+**8+"&85
&1!%+0".$"68".!"&%5*6"@*65%78+"R(+)"*3 *$e3$+6"8+$*pS"(+)"1$66%+0".$" $"9(56"8&"6:$"&%5*6
@*6$5%*Q"65(%+%+0"E1(**$*,"-(5$)"D.%6:"&85":$19%+0"*6(56"6:$")8E3.$+6(6%8+"958d$E6"(+)
)8%+0"(11"6:$"%+&5(*653E635$"6:(6"H"E831)"+$A$5":(A$")8+$,"-%."/(+"'$00$1$+"&85"d8%+%+0
%+"$(51!"8+"6:$"958d$E6"(+)"6$(E:%+0".$"+$L"L(!*"68"188Q"(6"1%&$,"(+)"23**$11"45!(+6"&85
$%+0"(+"(.(h%+0"958d$E6"1$()$5"(+)"$(*!"68"L85Q"L%6:"$A$5!")(!,"(+)"&85"+86":81)%+0
("053)0$"( 836"6:$" 3*:?

Jim Van Meggelen


_:$+"L$"*$6"836"68"L5%6$"6:$"A$5!"&%5*6"$)%6%8+"8&"6:%*" 88Q"8A$5"&%A$"!$(5*"(08,"L$"L$5$
E8+&%)$+6"6:(6"@*6$5%*Q"L(*"08%+0"68" $"(":30$"*3EE$**?"M8L,"(":(1&X)$E()$"1(6$5,"L$GA$
L5%66$+"6:%*"6:%5)"$)%6%8+"8&"L:(6"6:$"L851)L%)$"@*6$5%*Q"E8..3+%6!"E(11*"jZ:$"@*6$5%*Q
488Q,k"(+)"L$GA$".(635$)"&58."5$A8136%8+(5%$*"%+68"@*6$5%*Q"958&$**%8+(1*?

Preface | xxxi
@*6$5%*Q":(*"958A$+"6:(6"89$+"*835E$"6$1$E8."%*"("1(*6%+0"%)$(,"(+)"6:$"89$+"*835E$
6$1$E8."1(+)*E(9$"%*"+8L()(!*"E8.91$.$+6$)" !".85$"6:(+"d3*6"@*6$5%*Q?"B58d$E6*"1%Q$
T5$$*L%6E:," *%9f$E*" R&58." D%9T83+)5!S," F9$+D[2U](.(%1%8UF9$+DHBD," (+)" .(+!,
.(+!".85$"R(+)".85$"68"E8.$S":$19"68"583+)"836"6:$"$E8*!*6$.?
H"L(+6"68"6(Q$"6:%*"8998563+%6!"68"6:(+Q".!"A$5!"088)"&5%$+)"#$%&"'()*$+,"L:8":(*
$$+"L%6:".$"6:5830:"(11"6:5$$"$)%6%8+*?"H+"835")(%1!"1%A$*"L$")8+G6"(1L(!*":(A$".(+!
8998563+%6%$*"68"L85Q"L%6:"$(E:"86:$5"R85"$A$+"05( "("9%+6,"6:$*$")(!*pS,"(+)"%6G*"(1L(!*
(")$1%0:6"68"L85Q"L%6:"!83?"H"(1*8"L(+6"68"6:(+Q"23**$11"45!(+6,"L:8"d8%+$)"3*"&85"6:%*
$)%6%8+,"(+)"L:8*$")$)%E(6%8+"68"6:%*"958d$E6"(+)"6:$"@*6$5%*Q"958d$E6"%+"0$+$5(1"%*"(+
%+*9%5(6%8+"68".$?"g83G5$"("2$+(%**(+E$".(+,"23**$11?"Z8"-(5$)"D.%6:,"L:8":$19$)
&83+)"6:$"@*6$5%*Q"^8E3.$+6(6%8+"B58d$E6"(+)"E8(36:85$)"6:$"&%5*6"6L8"$)%6%8+*"L%6:
#$%&"(+)".$"R 36":(*"*%+E$".8A$)"8+"68"6:$"T$)85("958d$E6S,"H"E(+"8+1!"*(!V"@*6$5%*QG*
18**"%*"T$)85(G*"0(%+?
H"L831)"1%Q$"68"6:(+Q".!" 3*%+$**"9(56+$5*"(6"785$"Z$1$E8."H++8A(6%8+*"(+)"%78+X
A$50$)"##7,"L%6:836"L:8."H"E831)"+86")8"(11"6:$"E881"6:%+0*"H"0$6"68")8"%+".!"958&$*X
*%8+(1"E(5$$5?
H"L831)"1%Q$"68"6:(+Q"(11".!"&5%$+)*"%+"6:$"%.958A"E8..3+%6!,"&85":$19%+0".$"68"Q$$9
1(30:%+0"(6"(11"6:$"E:(11$+0$*"6:(6"1%&$"95$*$+6*?
Z:(+Q*"68"(11".!"&(.%1!,"L:8" 5%+0"18A$"%+68".!"1%&$?
T%+(11!,"6:(+Q*"68"!83,"6:$"@*6$5%*Q"E8..3+%6!?"Z:%*" 88Q"%*"835"0%&6"68"!83?"_$":89$
!83"$+d8!"5$()%+0"%6"(*".3E:"(*"L$GA$"$+d8!$)"L5%6%+0"%6?

Russell Bryant
H"*6(56$)"L85Q%+0"8+"@*6$5%*Q"%+"<==O?"H"L(*"("*63)$+6"(6"71$.*8+"C+%A$5*%6!"(+)"L(*
L85Q%+0" (*" (" E8X89" $+0%+$$5" (6" @^Z2@M" %+" K3+6*A%11$," @1( (.(?" '!" &%5*6" d8 " (6
@^Z2@M"L(*"L85Q%+0"%+"6:$"B58)3E6"m3(1%&%E(6%8+")$9(56.$+6?"H"5$.$. $5"L85Q%+0
L%6:"]$%6:"'850(+"68"3*$"@*6$5%*Q"(*"("/8HB"65(&&%E"0$+$5(685"&85"6$*6%+0"m8D"(E58**"(
5836$5"6$*6"+$6L85Q?"'$(+L:%1$,"("&$118L"E8X89"(+)"&5%$+),"@)(."DE:5$% $5,"%+658)3E$)
.$"68"'(5Q"D9$+E$5?"FA$5"6:$"+$\6"*%\".8+6:*,"H"%..$5*$)".!*$1&"%+"@*6$5%*Q?"H"1$(5+$)
(*".3E:"(*"H"E831)"( 836"@*6$5%*Q,"6$1$9:8+!,"(+)"7"95805(..%+0?"_:$+"@*6$5%*Q">?=
L(*"5$1$(*$)"%+"6:$"&(11"8&"<==O,"H"L(*"+(.$)"6:$"5$1$(*$".(%+6(%+$5?
@6"6:$" $0%++%+0"8&"<==I,"H"L(*":%5$)" !"^%0%3."68"E8+6%+3$".!"L85Q"8+"@*6$5%*Q
958&$**%8+(11!?"H":(A$"*9$+6"6:$"9(*6"*%\"(.(h%+0"!$(5*"L85Q%+0"L%6:"^%0%3."68"%.958A$
@*6$5%*Q?"H":(A$"L85Q$)"(*"("*8&6L(5$")$A$189$5,"("*8&6L(5$"6$(."1$(),"(+)"+8L"(*"6:$
$+0%+$$5%+0".(+(0$5"8&"6:$"@*6$5%*Q")$A$189.$+6"6$(.?"H"(."$\65$.$1!"05(6$&31"&85"6:$
8998563+%6!"68"E8+65% 36$"68"*8".(+!"(5$(*"8&"6:$"@*6$5%*Q"958d$E6?"Z:$5$"(5$".(+!
9$891$"6:(6")$*$5A$"6:(+Q*"&85"6:$"*399856"6:$!":(A$"958A%)$)"(18+0"6:$"L(!?

xxxii | Preface
Z8".!"L%&$,"-31%$,"H"E(++86"6:(+Q"!83"$+830:"&85"(11"6:$"18A$"(+)"*399856"!83":(A$
0%A$+".$?"Z:(+Q"!83"&85"Q$$9%+0".!"1%&$" (1(+E$)"(+)":(99!?"g83"(5$"6:$" $*6?"H"18A$
!83p
Z8".!"9(5$+6*,"6:(+Q"!83"&85"0%A%+0".$"*8".(+!"05$(6"8998563+%6%$*"%+".!"1%&$"68"$\9185$
)%&&$5$+6"6:%+0*"(+)"&%+)"L:(6"H"5$(11!"$+d8!?"g83"6(30:6".$"68"L85Q":(5)"(+)"+$A$5
0%A$"39?
Z8"#$%&"(+)"-%.,"6:(+Q"!83"&85"!835"%+A%6(6%8+"68"E8+65% 36$"68"6:%*" 88Q?"H6":(*" $$+
("&3+"958d$E6,"1(50$1!")3$"68"6:$"91$(*35$"8&"L85Q%+0"L%6:"6:$"6L8"8&"!83?"Z:(+Q*"&85
6:$"1(30:*"(+)"&85"!835")$)%E(6%8+"68"6:%*" 88Q"(*"("6$(."$&&856?
H":(A$"1$(5+$)"("186"&58.".(+!"9$891$"(6"^%0%3.?"Z:$5$"(5$"6:5$$"9$891$"L:8"*6(+)"836
6:$".8*6"(*".!".$+685*V"'(5Q"D9$+E$5,"]$A%+"B?"T1$.%+0,"(+)"^(A%)"^$(68+?"Z:(+Q
!83"(11"&85"08%+0"6:$"$\65(".%1$"68"6$(E:".$"(18+0"6:$"L(!?"H"(."$\65$.$1!"05(6$&31?
Z8"6:$"*8&6L(5$")$A$189.$+6"6$(."(6"^%0%3.,"6:(+Q"!83"&85" $%+0"*3E:"(+"(.(h%+0
6$(."68"L85Q"L%6:?"g835")$)%E(6%8+"(+)" 5%11%(+E$"91(!"(":30$"9(56"%+"6:$"*3EE$**"8&
@*6$5%*Q"(+)".(Q$"^%0%3."("05$(6"91(E$"68"L85Q?
Z8"Z5(A%*"@\6$11,"6:(+Q"!83"&85"!835":$19"%+".!"$(51!")(!*"8&"1$(5+%+0"( 836"#%+3\"(+)
&85" $%+0"("088)"&5%$+)?
Z8".!")80*,"7:18$"(+)"4(\6$5,"6:(+Q*"&85"Q$$9%+0".$"E8.9(+!"L:%1$"H"L85Q$)"8+"6:$
88Q"$A$5!".85+%+0?
Z8"(11"8&".!"&5%$+)*"(+)"&(.%1!,"6:(+Q"!83"&85"!835"18A$,"*399856,"(+)"&3+"6%.$*?
Z8"6:$"$+6%5$"@*6$5%*Q"E8..3+%6!,"6:(+Q"!83"&85"3*%+0,"$+d8!%+0,"(+)"E8+65% 36%+0"68
@*6$5%*Q?"_$":89$"!83"$+d8!"6:$" 88Qp

Preface | xxxiii
CHAPTER 1
A Telephony Revolution

=,+(!6! 2&6,F0.+26&.;A6! 206! 2&61);F 6)!6&.;A


! 206! 2&6*,F !6&.;A6! 206&.;6Z,0'
i'(:(6.("J(+):%

_:$+"L$"&%5*6"*$6"836i+$(51!"&%A$"!$(5*"(08i68"L5%6$"(" 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$*"6:$"E8+E$96"8&"*6(+)(5)*"E8.91%(+E$,"L:%1$"(1*8"$+d8!%+0"6:$"&5$$)8."68")$A$189
%6*"8L+"%++8A(6%8+*?"_:(6"!83"E:88*$"68"%.91$.$+6"%*"39"68"!83i@*6$5%*Q"%.98*$*
+8"1%.%6*?
M(635(11!,"6:%*"%+E5$)% 1$"&1$\% %1%6!"E8.$*"L%6:"("95%E$V"@*6$5%*Q"%*"+86"("*%.91$"*!*6$.
68"E8+&%035$?"Z:%*"%*"+86" $E(3*$"%6G*"%1180%E(1,"E8+&3*%+0,"85"E5!96%Eq"8+"6:$"E8+65(5!,"%6
%*"A$5!"*$+*% 1$"(+)"95(E6%E(1?"B$891$G*"$!$*"1%0:6"39"L:$+"6:$!"&%5*6"*$$"(+"@*6$5%*Q
)%(191(+"(+)" $0%+"68"E8+6$.91(6$"6:$"98**% %1%6%$*?"436"L:$+"6:$5$"(5$"1%6$5(11!"6:83X
*(+)*"8&"L(!*"68"(E:%$A$"("5$*316,"6:$"958E$**"+(635(11!"5$e3%5$*"$\65("$&&856?"B$5:(9*"%6
E(+" $"E8.9(5$)"68" 3%1)%+0"(":83*$V"6:$"E8.98+$+6*"(5$"5$1(6%A$1!"$(*!"68"3+)$5*6(+),
36" (" 9$5*8+" E8+6$.91(6%+0" *3E:" (" 6(*Q" .3*6" $%6:$5" (S" $+1%*6" E8.9$6$+6" :$19" 85

1
S" )$A$189" 6:$" 5$e3%5$)" *Q%11*" 6:5830:" %+*653E6%8+," 95(E6%E$," (+)" (" 088)" 88Q" 8+
6:$"*3 d$E6?

Asterisk and VoIP: Bridging the Gap Between Traditional and


Network Telephony
/8%E$"8A$5"HB"R/8HBS"%*"8&6$+"6:830:6"8&"(*"1%661$".85$"6:(+"(".$6:8)"8&"8 6(%+%+0"&5$$
18+0X)%*6(+E$"E(11%+0?"Z:$"5$(1"A(13$"R(+)i1$6G*" $":8+$*6iE:(11$+0$"(*"L$11S"8&"/8HB
%*"6:(6"%6"(118L*"A8%E$"68" $E8.$"+86:%+0".85$"6:(+"(+86:$5"(991%E(6%8+"%+"6:$")(6(
+$6L85Q?
H6"*8.$6%.$*"*$$.*"6:(6"L$GA$"&850866$+"6:(6"6:$"93598*$"8&"6:$"6$1$9:8+$"%*"68"(118L
9$891$"68"E8..3+%E(6$?"H6"%*"("*%.91$"08(1,"5$(11!,"(+)"%6"*:831)" $"98**% 1$"&85"3*"68
.(Q$"%6":(99$+"%+"&(5".85$"&1$\% 1$"(+)"E5$(6%A$"L(!*"6:(+"(5$"E355$+61!"(A(%1( 1$"68
3*?"Z$E:+8180%$*"*3E:"(*"@*6$5%*Q"18L$5"6:$" (55%$5*"68"$+65!?

The Zapata Telephony Project


_:$+" 6:$" @*6$5%*Q" 958d$E6" L(*" *6(56$)" R%+" >NNNS," 6:$5$" L$5$" 86:$5" 89$+X*835E$
6$1$9:8+!"958d$E6*"%+"$\%*6$+E$?"K8L$A$5,"@*6$5%*Q,"%+"E8. %+(6%8+"L%6:"6:$"c(9(6(
Z$1$9:8+!"B58d$E6,"L(*"( 1$"68"958A%)$"93 1%E"*L%6E:$)"6$1$9:8+$"%+6$5&(E$"RBDZMS
%+6$5&(E$*,"L:%E:"5$95$*$+6$)"(+"%.9856(+6".%1$*68+$"%+"65(+*%6%8+%+0"6:$"*8&6L(5$"&58.
*8.$6:%+0"935$1!"+$6L85QX (*$)"68"*8.$6:%+0".85$"95(E6%E(1"%+"6:$"L851)"8&"6$1$E8.
(6"6:(6"6%.$,"L:%E:"L(*"BDZMXE$+65%E?
Z:$"c(9(6("Z$1$9:8+!"B58d$E6"L(*"E8+E$%A$)"8&" !"-%."^%\8+,"("6$1$E8..3+%E(6%8+*
E8+*316%+0"$+0%+$$5"L:8"L(*"%+*9%5$)" !"6:$"%+E5$)% 1$"()A(+E$*"%+"7BC"*9$$)*"6:(6
6:$"E8.936$5"%+)3*65!":(*"+8L"E8.$"68"6(Q$"&85"05(+6$)?"^%\8+G*" $1%$&"L(*"6:(6"&(5
.85$"$E8+8.%E(1"6$1$9:8+!"*!*6$.*"E831)" $"E5$(6$)"%&"("E(5)"$\%*6$)"6:(6":()"+86:%+0
.85$"8+"%6"6:(+"6:$" (*%E"$1$E658+%E"E8.98+$+6*"5$e3%5$)"68"%+6$5&(E$"L%6:"("6$1$9:8+$
E%5E3%6?"2(6:$5"6:(+":(A%+0"$\9$+*%A$"E8.98+$+6*"8+"6:$"E(5),")%0%6(1"*%0+(1"958E$**%+0
R^DBSs"L831)" $":(+)1$)"%+"6:$"7BC" !"*8&6L(5$?"_:%1$"6:%*"L831)"%.98*$"("65$.$+X
)83*"18()"8+"6:$"7BC,"^%\8+"L(*"E$56(%+"6:(6"6:$"18L"E8*6"8&"7BC*"5$1(6%A$"68"6:$%5
9$5&85.(+E$".()$"6:$."&(5".85$"(665(E6%A$"6:(+"$\9$+*%A$"^DB*,"(+),".85$"%.985X
6(+61!,"6:(6"6:%*"95%E$U9$5&85.(+E$"5(6%8"L831)"E8+6%+3$"68"%.958A$"(*"7BC*"E8+6%+3$)
68"%+E5$(*$"%+"98L$5?
#%Q$"*8".(+!"A%*%8+(5%$*,"^%\8+" $1%$A$)"6:(6".(+!"86:$5*"L831)"*$$"6:%*"8998563+%6!,
(+)"6:(6":$".$5$1!":()"68"L(%6"&85"*8.$8+$"$1*$"68"E5$(6$"L:(6"68":%."L(*"(+"8 A%83*
%.958A$.$+6?"@&6$5"("&$L"!$(5*,":$"+86%E$)"6:(6"+86"8+1!":()"+8"8+$"E5$(6$)"6:$*$"E(5)*,

s Z:$" 6$5." ^DB" (1*8" .$(+*" )%0%6(1" *%0+(1" 958E$**85," L:%E:" %*" (" )$A%E$" R3*3(11!" (" E:%9S" 6:(6" %*" E(9( 1$" 8&
%+6$595$6%+0"(+)".8)%&!%+0"*%0+(1*"8&"A(5%83*"*856*?"H+"("A8%E$"+$6L85Q,"^DB*"(5$"95%.(5%1!"5$*98+*% 1$"&85
$+E8)%+0,")$E8)%+0,"(+)"65(+*E8)%+0"(3)%8"%+&85.(6%8+?"Z:%*"E(+"5$e3%5$"("186"8&"E8.936(6%8+(1"$&&856?

2 | Chapter 1:ಗA Telephony Revolution


36"%6"*$$.$)"3+1%Q$1!"6:(6"(+!8+$"L(*"$A$5"08%+0"68?"@6"6:(6"98%+6"%6"L(*"E1$(5"6:(6"%&
:$"L(+6$)"("5$A8136%8+,":$"L(*"08%+0"68":(A$"68"*6(56"%6":%.*$1&?"@+)"*8"6:$"c(9(6(
Z$1$9:8+!"B58d$E6"L(*" 85+V
D%+E$"6:%*"E8+E$96"L(*"*8"5$A8136%8+(5!,"(+)"L(*"E$56(%+"68".(Q$"("186"8&"L(A$*"%+"6:$
%+)3*65!,"H")$E%)$)"8+"6:$"'$\%E(+"5$A8136%8+(5!".86%&,"(+)"+(.$)"6:$"6$E:+8180!"(+)
850(+%h(6%8+"(&6$5"6:$"&(.83*"'$\%E(+"5$A8136%8+(5!"[.%1%(+8"c(9(6(?"H")$E%)$)"68"E(11
6:$"E(5)"6:$"j685.$+6(k"L:%E:,"%+"D9(+%*:,".$(+*"j*685.,k" 36"E8+6$\63(11!"%*"3*3(11!
3*$)"68"%.91!"(" %0"*685.,"1%Q$"(":355%E(+$"85"*3E:?t
B$5:(9*"L$"*:831)" $"E(11%+0"835*$1A$*"@*6$5%*6(*?"2$0(5)1$**,"L$"8L$"-%."^%\8+"(")$ 6
8&"6:(+Q*,"9(561!"&85"6:%+Q%+0"6:%*"39"(+)"9(561!"&85"*$$%+0"%6"6:5830:," 36".8*61!"&85
0%A%+0" 6:$" 5$*316*" 8&" :%*" $&&856*" 68" 6:$" 89$+" *835E$" E8..3+%6!?" @*" (" 5$*316" 8&" -%.G*
E8+65% 36%8+,"@*6$5%*QG*"BDZM"$+0%+$"E(.$"68" $?
FA$5"6:$"!$(5*,"6:$"c(9(6("Z$1$9:8+!"%+6$5&(E$"%+"@*6$5%*Q":(*" $$+".8)%&%$)"(+)"%.X
958A$)?"Z:$"^%0%3."@*6$5%*Q"K(5)L(5$"^$A%E$"H+6$5&(E$"R^@K^HS"Z$1$9:8+!"%+6$5&(E$
%+"3*$"68)(!"%*"6:$"8&&*95%+0"8&"-%."^%\8+G*"E8+65% 36%8+?

Massive Change Requires Flexible Technology


[A$5!"B4f"%+"$\%*6$+E$"*3&&$5*"&58."*:856E8.%+0*?"M8".(66$5":8L"&311!"&$(635$)"%6"%*,
*8.$6:%+0"L%11"(1L(!*" $"1$&6"836," $E(3*$"$A$+"6:$".8*6"&$(635$X5%E:"B4f"L%11"(1L(!*
&(%1"68"(+6%E%9(6$"6:$"E5$(6%A%6!"8&"6:$"E3*68.$5?"@"*.(11"05839"8&"3*$5*"L%11")$*%5$"(+
8))"1%661$"&$(635$"6:(6"6:$")$*%0+"6$(."$%6:$5")%)"+86"6:%+Q"8&"85"E831)"+86"d3*6%&!"6:$
E8*6"8&" 3%1)%+0,"(+),"*%+E$"6:$"*!*6$."%*"E18*$),"6:$"3*$5*"L%11"+86" $"( 1$"68" 3%1)"%6
6:$.*$1A$*?
H&"6:$"H+6$5+$6":()" $$+"6:3*1!":(.9$5$)" !"5$031(6%8+"(+)"E8..$5E%(1"%+6$5$*6*,"%6"%*
)83 6&31"6:(6"%6"L831)":(A$")$A$189$)"6:$"L%)$"(EE$96(+E$"%6"E355$+61!"$+d8!*?"Z:$
89$++$**"8&"6:$"H+6$5+$6".$(+6"6:(6"(+!8+$"E831)"(&&85)"68"0$6"%+A81A$)?"D8,"$A$5!8+$
)%)?"Z:$"6$+*"8&"6:83*(+)*"8&".%+)*"6:(6"E811( 85(6$)"8+"6:$"E5$(6%8+"8&"6:$"H+6$5+$6
)$1%A$5$)"*8.$6:%+0"6:(6"+8"E85985(6%8+"$A$5"E831)":(A$?u
@*"L%6:".(+!"86:$5"89$+"*835E$"958d$E6*,"*3E:"(*"#%+3\"(+)"*8".3E:"8&"6:$"E5%6%E(1
*8&6L(5$"53++%+0"6:$"H+6$5+$6,"6:$")$A$189.$+6"8&"@*6$5%*Q"L(*"&3$1$)" !"6:$")5$(.*
8&"&81Q*"L:8"Q+$L"6:(6"6:$5$":()"68" $"*8.$6:%+0".85$"6:(+"L:(6"65()%6%8+(1"%+)3*65%$*
L$5$"958)3E%+0?"Z:$*$"9$891$"Q+$L"6:(6"%&"8+$"E831)"6(Q$"6:$" $*6"9(56*"8&"A(5%83*
B4f*"(+)"*$9(5(6$"6:$."%+68"%+6$5E8++$E6%+0"E8.98+$+6*i(Q%+"68"(" 8\&31"8&"#[JF
5%EQ*i8+$" E831)" $0%+" 68" E8+E$%A$" 8&" 6:%+0*" 6:(6" L831)" +86" *35A%A$" (" 65()%6%8+(1

t -%."^%\8+,"jZ:$"K%*685!"8&"c(9(6("Z$1$9:8+!"(+)"K8L"H6"2$1(6$*"68"6:$"@*6$5%*Q"B4fk"R !!"#$$ZZZ
')(!2+,(/<.3('.+F$%.<;12($!,0&3.0!20!$,0<2>'" "`,<a@RS?
u _$"5$(1%h$"6:(6"6:$"6$E:+8180!"8&"6:$"H+6$5+$6"&85.$)"836"8&"08A$5+.$+6"(+)"(E()$.%E"%+*6%636%8+*," 36"L:(6
L$G5$"6(1Q%+0"( 836":$5$"%*"+86"6:$"6$E:+8180!"8&"6:$"H+6$5+$6"*8".3E:"(*"6:$"E31635(1"9:$+8.$+8+"8&"%6,
L:%E:"$\918)$)"%+"6:$"$(51!"GN=*?

Massive Change Requires Flexible Technology | 3


E85985(6$"5%*QX(+(1!*%*"958E$**?"_:%1$"+8"8+$"E(+"*$5%83*1!"E1(%."68":(A$"("E8.91$6$
9%E635$"8&"L:(6"6:%*"6:%+0"*:831)"188Q"1%Q$,"6:$5$"%*"+8"*:856(0$"8&"89%+%8+*"(+)"%)$(*?v
'(+!"9$891$"+$L"68"@*6$5%*Q"*$$"%6"(*"3+&%+%*:$)?"B$5:(9*"6:$*$"9$891$"E(+" $"1%Q$+$)
68"A%*%685*"68"(+"(56"*63)%8,"188Q%+0"68"8 6(%+"("*%0+$),"+3. $5$)"95%+6?"Z:$!"8&6$+"1$(A$
)%*(998%+6$)," $E(3*$"6:$!")%*E8A$5"6:(6"@*6$5%*Q"%*"6:$" 1(+Q"E(+A(*,"6:$"63 $*"8&"9(%+6,
6:$"3+3*$)" 53*:$*"L(%6%+0?಩
[A$+"(6"6:%*"$(51!"*6(0$"%+"%6*"*3EE$**,"@*6$5%*Q"%*"+35635$)" !"("05$(6$5"+3. $5"8&"(56%*6*
6:(+"(+!"86:$5"B4f?"'8*6".(+3&(E635$5*")$)%E(6$"+8".85$"6:(+"("&$L")$A$189$5*"68
(+!"8+$"958)3E6q"@*6$5%*Q":(*"*E85$*?"'8*6"95895%$6(5!"B4f*":(A$"("L851)L%)$"*399856
6$(."E8.95%*%+0"("&$L")8h$+"5$(1"$\9$56*q"@*6$5%*Q":(*":3+)5$)*?
Z:$")$96:"(+)" 5$()6:"8&"6:$"$\9$56%*$"6:(6"*35583+)*"6:%*"958)3E6"%*"3+.(6E:$)"%+
6:$" 6$1$E8." %+)3*65!?" @*6$5%*Q" $+d8!*" 6:$" 18A%+0" (66$+6%8+" 8&" 81)" 6$1E8" 03!*" L:8
5$.$. $5" L:$+" 586(5!" )%(1" .(66$5$)," $+6$595%*$" 6$1$E8." 9$891$" L:8" 5$E(11" L:$+
A8%E$.(%1"L(*"6:$":866$*6"+$L"6$E:+8180!,"(+)")(6("E8..3+%E(6%8+*"0$$Q*"(+)"E8)$5*
L:8" :$19$)" 3%1)" 6:$" H+6$5+$6?" Z:$*$" 9$891$" (11" *:(5$" (" E8..8+" $1%$&i6:(6" 6:$
6$1$E8..3+%E(6%8+*"%+)3*65!"+$$)*"(""+."2+"5$A8136%8+?w
@*6$5%*Q"%*"6:$"E(6(1!*6?

Asterisk: The Hacker’s PBX


Z$1$E8..3+%E(6%8+*"E8.9(+%$*"6:(6"E:88*$"68"%0+85$"@*6$5%*Q")8"*8"(6"6:$%5"9$5%1?"Z:$
&1$\% %1%6!"%6")$1%A$5*"E5$(6$*"98**% %1%6%$*"6:(6"6:$" $*6"95895%$6(5!"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)"8+"%6S?"Z:$*$"%+6$5&(E$*"RE:$EQ"836" !!"#$$ZZZ'9.,"b,0*.'.+F$Z,/,$9,2Z$5(!2+,(/
c:IE"&85"(+"%)$("8&":8L".(+!"6:$5$"(5$S")8"+86".(Q$"%6"$(*%$5"68"1$(5+"@*6$5%*Q," $E(3*$"6:$!"*$9(5(6$"!83
&58."6:$"91(6&85."85")%(191(+"E8+&%035(6%8+," 36".(+!"8&"6:$."L%11")$1%A$5"("L85Q%+0"B4f"68"!83".3E:"&(*6$5
6:(+"6:$".85$":(+)*X8+"(9958(E:"L$"$.918!"%+"6:%*" 88Q?
wZ:$" 6$1$E8." %+)3*65!" :(*" $$+" 95$)%E6%+0" (" 5$A8136%8+" *%+E$" $&85$" 6:$" E5(*:q" 6%.$" L%11" 6$11" :8L" L$11" %6
5$*98+)*"68"6:$"."206(.;+32"5$A8136%8+?

4 | Chapter 1:ಗA Telephony Revolution


6:$":(EQ$5*"L%11" $"( 1$"68"e3%EQ1!"5$*98+)"68"E:(+0%+0"65$+)*"%+"*$E35%6!"(+)"&%+$X63+$
6:$"6$1$9:8+$"*!*6$."%+"5$*98+*$"68" 86:"E85985(6$"981%E!"(+)"%+)3*65!" $*6"95(E6%E$*?
#%Q$"86:$5"89$+"*835E$"*!*6$.*,"@*6$5%*Q"L%11" $"( 1$"68"$A81A$"%+68"("&(5".85$"*$E35$
91(6&85."6:(+"(+!"95895%$6(5!"*!*6$.,"+86"%+"*9%6$"8&"%6*":(EQ$5"5886*," 36"5(6:$5" $E(3*$
8&"6:$.?

Asterisk: The Professional’s PBX


M$A$5" %+" 6:$" :%*685!" 8&" 6$1$E8..3+%E(6%8+*" :(*" (" *!*6$." *8" *3%6$)" 68" 6:$" +$$)*" 8&
3*%+$**" $$+"(A(%1( 1$,"(6"(+!"95%E$?"@*6$5%*Q"%*"(+"$+( 1%+0"6$E:+8180!,"(+)"(*"L%6:
#%+3\,"%6"L%11" $E8.$"%+E5$(*%+01!"5(5$"68"&%+)"(+"$+6$595%*$"6:(6"%*"+86"53++%+0"*8.$
A$5*%8+"8&"@*6$5%*Q,"%+"*8.$"E(9(E%6!,"*8.$L:$5$"%+"6:$"+$6L85Q,"*81A%+0"("958 1$."(*
8+1!"@*6$5%*Q"E(+?
Z:%*"(EE$96(+E$"%*"1%Q$1!"68":(99$+".3E:"&(*6$5"6:(+"%6")%)"L%6:"#%+3\,"6:830:,"&85
*$A$5(1"5$(*8+*V
x #%+3\":(*"(15$()!" 1(h$)"6:$"65(%1"6:(6"1$)"68"89$+"*835E$"(EE$96(+E$?"@*6$5%*Q"%*
&8118L%+0"6:(6"1$()?
x Z:$"6$1$E8."%+)3*65!"%*"E5%991$),"L%6:"+8"1$()$5*:%9" $%+0"958A%)$)" !"6:$"0%(+6
%+)3*65!"91(!$5*?"@*6$5%*Q":(*"("E8.9$11%+0,"5$(1%*6%E,"(+)"$\E%6%+0"A%*%8+?
x [+)" 3*$5*" (5$" &$)" 39" L%6:" %+E8.9(6% 1$" (+)" 1%.%6$)" &3+E6%8+(1%6!," (+)" :855% 1$
*399856?"@*6$5%*Q"*81A$*"6:$"&%5*6"6L8"958 1$.*q"$+65$95$+$35*"(+)"6:$"E8..3+%6!
(5$"())5$**%+0"6:$"1(66$5?

The Asterisk Community


F+$"8&"6:$"E8.9$11%+0"*65$+06:*"8&"@*6$5%*Q"%*"6:$"9(**%8+(6$"E8..3+%6!"6:(6")$A$189$)
(+)"*399856*"%6?"Z:%*"E8..3+%6!,"1$)" !"6:$"&%+$"&81Q*"(6"^%0%3.,"%*"Q$$+1!"(L(5$"8&
6:$"E31635(1"*%0+%&%E(+E$"8&"@*6$5%*Q"(+)":(*"(+"896%.%*6%E"A%$L"8&"6:$"&3635$?
F+$"8&"6:$".85$"98L$5&31"*%)$"$&&$E6*"8&"6:$"@*6$5%*Q"E8..3+%6!G*"$+$50!"%*"6:$"E889X
$5(6%8+"%6":(*"*9(L+$)"(.8+0"6$1$E8..3+%E(6%8+*,"+$6L85Q%+0,"(+)"%+&85.(6%8+"6$E:X
+8180!"958&$**%8+(1*"L:8"*:(5$"("18A$"&85"6:%*"9:$+8.$+8+?"_:%1$"6:$*$"E()5$*":(A$
65()%6%8+(11!" $$+"(6"8))*"L%6:"$(E:"86:$5,"%+"6:$"@*6$5%*Q"E8..3+%6!"6:$!")$1%0:6"%+
$(E:"86:$5*G"*Q%11*?"Z:$"*%0+%&%E(+E$"8&"6:%*"E889$5(6%8+"E(++86" $"3+)$5$*6%.(6$)?
H&"6:$")5$(."8&"@*6$5%*Q"%*"68" $"5$(1%h$),"6:$"E8..3+%6!".3*6"E8+6%+3$"68"058Li!$6
8+$"8&"6:$"Q$!"E:(11$+0$*"6:(6"6:$"E8..3+%6!"E355$+61!"&(E$*"%*"("5(9%)"%+&13\"8&"+$L
3*$5*?" Z:$" .$. $5*" 8&" 6:$" $\%*6%+0" E8..3+%6!," :(A%+0" %56:$)" 6:%*" 6:%+0" E(11$)
@*6$5%*Q,"(5$"0$+$5(11!"L$1E8.%+0"8&"+$L"3*$5*," 36"6:$!GA$"058L+"%.9(6%$+6"L%6:" $%+0
(*Q$)"6:$"Q%+)*"8&"e3$*6%8+*"L:8*$"(+*L$5*"E(+"8&6$+" $"8 6(%+$)"%+)$9$+)$+61!,"%&
8+$"%*"L%11%+0"68")$A86$"*8.$"6%.$"68"5$*$(5E:"(+)"$\9$5%.$+6(6%8+?

The Asterisk Community | 5


F A%83*1!,"+$L"3*$5*")8"+86"&%6"(+!"9(56%E31(5"Q%+)"8&".81)?"_:%1$"*8.$"L%11":(99%1!
*9$+)":835*"$\9$5%.$+6%+0"(+)"5$()%+0"A(5%83*" 180*")$*E5% %+0"6:$"65%(1*"(+)"65% 3X
1(6%8+*"8&"86:$5*,".(+!"9$891$"L:8":(A$" $E8.$"$+6:3*%(*6%E"( 836"6:%*"6$E:+8180!
(5$"E8.91$6$1!"3+%+6$5$*6$)"%+"*3E:"935*3%6*?"Z:$!"L(+6"("*%.91$,"*65(%0:6&85L(5),"*6$9X
!X*6$9"03%)$"6:(6G11"0$6"6:$."39"(+)"53++%+0,"&8118L$)" !"*8.$"*$+*% 1$"$\(.91$*
)$*E5% %+0"6:$" $*6".$6:8)*"8&"%.91$.$+6%+0"E8..8+"&3+E6%8+(1%6!"R*3E:"(*"A8%E$.(%1,
(368"(66$+)(+6*,"(+)"6:$"1%Q$S?
Z8"6:$".$. $5*"8&"6:$"$\9$56"E8..3+%6!,"L:8"RE855$E61!S"9$5E$%A$"6:(6"@*6$5%*Q"%*"1%Q$
("L$ ")$A$189.$+6"1(+03(0$,"6:%*"(9958(E:")8$*+G6".(Q$"(+!"*$+*$?"Z8"6:$.,"%6G*"E1$(5
6:(6"!83":(A$"68"%..$5*$"!835*$1&"%+"@*6$5%*Q"68"(995$E%(6$"%6*"*3 61$6%$*?"_831)"8+$
(*Q"&85"("*6$9X !X*6$9"03%)$"68"95805(..%+0"(+)"$\9$E6"68"1$(5+"&58."%6"(11"6:(6"("1(+X
03(0$":(*"68"8&&$5l
71$(51!,"6:$5$G*"+8"8+$"(9958(E:"6:(6G*"5%0:6"&85"$A$5!8+$?"@*6$5%*Q"%*"(")%&&$5$+6"(+%.(1
(1680$6:$5,"(+)"%6"5$e3%5$*"("686(11!")%&&$5$+6".%+)X*$6?"@*"!83"$\9185$"6:$"E8..3+%6!,
6:830:," $"(L(5$"6:(6"%6"%+E13)$*"9$891$"L%6:".(+!")%&&$5$+6"*Q%11"*$6*"(+)"(66%63)$*?
D8.$"8&"6:$*$"&81Q*")8"+86")%*91(!".3E:"9(6%$+E$"L%6:"+$L"3*$5*," 36"6:(6G*"8&6$+")3$
68"6:$%5"9(**%8+"&85"6:$"*3 d$E6,"+86" $E(3*$"6:$!")8+G6"L$1E8.$"!835"9(56%E%9(6%8+?

The Asterisk Mailing Lists


@*"L%6:"(+!"E8..3+%6!,"6:$5$"(5$"91(E$*"L:$5$".$. $5*"8&"6:$"@*6$5%*Q"E8..3+%6!
.$$6"68")%*E3**".(66$5*"8&".363(1"%+6$5$*6?"F&"6:$".(%1%+0"1%*6*"!83"L%11"&%+)"(6" !!"#$$
1,(!('<,F,;%'3.%,"6:$*$"6:5$$"(5$"E355$+61!"6:$".8*6"%.9856(+6V
5(!2+,(/bK,Q
@+!6:%+0"E8..$5E%(1"L%6:"5$*9$E6"68"@*6$5%*Q" $18+0*"%+"6:%*"1%*6?"H&"!83G5$"*$11%+0
*8.$6:%+0"@*6$5%*QX5$1(6$),"*$11"%6":$5$?"H&"!83"L(+6"68" 3!"(+"@*6$5%*Q"*$5A%E$"85
958)3E6,"98*6":$5$?
5(!2+,(/b829
Z:$"@*6$5%*Q")$A$189$5*":(+0"836":$5$?"Z:$"93598*$"8&"6:%*"1%*6"%*"6:$")%*E3**%8+"8&
6:$")$A$189.$+6"8&"6:$"*8&6L(5$"6:(6"%*"@*6$5%*Q,"(+)"%6*"9(56%E%9(+6*"A%08583*1!
)$&$+)"6:(6"93598*$?"[\9$E6"("186"8&":$(6"%&"!83"98*6"(+!6:%+0"68"6:%*"1%*6"+86"*9$X
E%&%E(11!"5$1(6%+0"68"95805(..%+0"85")$A$189.$+6"8&"6:$"@*6$5%*Q"E8)$" (*$?"J$+$5(1
E8)%+0"e3$*6%8+*"R*3E:"(*"e3$5%$*"8+"%+6$5&(E%+0"L%6:"@JH"85"@'HS"*:831)" $")%X
5$E6$)"68"6:$"5(!2+,(/bI(2+("1%*6?

Z:$" @*6$5%*QX^$A" 1%*6" %*" +86" *$E8+)X1$A$1" *399856p" H&" !83" *E5811
6:5830:"6:$".(%1%+0"1%*6"(5E:%A$*,"!83G11"*$$"6:%*"%*"("*65%E6"531$?"Z:$
@*6$5%*QX^$A".(%1%+0"1%*6"%*"( 836")%*E3**%8+"8&"E85$"@*6$5%*Q")$X
A$189.$+6," (+)" e3$*6%8+*" ( 836" %+6$5&(E%+0" !835" $\6$5+(1" 958X
05(.*"A%("@JH"85"@'H"*:831)" $"98*6$)"8+"6:$"5(!2+,(/bI(2+("1%*6?

6 | Chapter 1:ಗA Telephony Revolution


5(!2+,(/bI(2+(
Z:%*"%*"L:$5$".8*6"@*6$5%*Q"3*$5*":(+0"836?"Z:%*"1%*6"0$+$5(6$*"*$A$5(1":3+)5$)
.$**(0$*"9$5")(!"(+)":(*"8A$5"6$+"6:83*(+)"*3 *E5% $5*?"_:%1$"!83"E(+"08":$5$
&85":$19,"!83"(5$"$\9$E6$)"68":(A$")8+$"*8.$"5$()%+0"8+"!835"8L+" $&85$"!83"98*6
("e3$5!?

Asterisk Wiki Sites


Z:$" @*6$5%*Q" _%Q%" RL:%E:" $\%*6*" %+" 1(50$" 9(56" )3$" 68" 6:$" 6%5$1$**" $&&856*" 8&" -(.$*
Z:8.9*8+i! )0/(6d)%2(eS"%*"("*835E$"8&".3E:"$+1%0:6$+.$+6"(+)"E8+&3*%8+?"@+86:$5
%.9856(+6"5$*835E$"%*"6:$"E8..3+%6!X.(%+6(%+$)"5$98*%685!"8&"/8HB"Q+8L1$)0$"(6" !!"#
$$ZZZ'9.,"b,0*.'.+F,"L:%E:"E8+6(%+*"("6531!"%+*9%5%+0"E85+3E89%("8&"&(*E%+(6%+0,"%+&85X
.(6%A$," (+)" &5$e3$+61!" E8+65()%E685!" %+&85.(6%8+" ( 836" .(+!" *3 d$E6*," d3*6" 8+$" 8&
L:%E:"%*"@*6$5%*Q?"D%+E$"@*6$5%*Q")8E3.$+6(6%8+"&85.*" !"&(5"6:$" 31Q"8&"6:$"%+&85.(X
6%8+"8+"6:%*"L$ *%6$,s"(+)"%6"958 ( 1!"E8+6(%+*".85$"@*6$5%*Q"Q+8L1$)0$"6:(+"(11"86:$5
*835E$*"936"680$6:$5"RL%6:"6:$"$\E$96%8+"8&"6:$".(%1%+0"1%*6"(5E:%A$*S,"%6"%*"("98931(5
91(E$"68"08"&85"@*6$5%*Q"Q+8L1$)0$?
@+"%.9856(+6"+$L"L%Q%"958d$E6"%*"6:$"8&&%E%(1"@*6$5%*Q"_%Q%,"&83+)"(6" !!"#$$Z,/,')(!2+,(/
'.+F?"_:%1$"+86"!$6"(*"&311"8&"E8+6$+6"(*"9.,"b,0*.'.+F,"6:%*"L%Q%"L%11" $".85$"&85.(11!
*399856$)"(+)"%*"6:$5$&85$".85$"1%Q$1!"68"E8+6(%+"%+&85.(6%8+"6:(6"%*"Q$96"E355$+6"(+)
(EE35(6$?

The IRC Channels


Z:$" @*6$5%*Q" E8..3+%6!" .(%+6(%+*" H+6$5+$6" 2$1(!" 7:(6" RH27S" E:(++$1*" 8+" ,+3'*+22b
0.<2'02!?"Z:$"6L8".8*6"(E6%A$"E:(++$1*"(5$"f)(!2+,(/"(+)"f)(!2+,(/b<29't"Z8"E36")8L+
8+"*9(.X 86"%+653*%8+*," 86:"8&"6:$*$"E:(++$1*"+8L"5$e3%5$"5$0%*65(6%8+"68"d8%+?u

Asterisk User Groups


FA$5"6:$"9(*6")$E()$,"%+".(+!"E%6$*"(583+)"6:$"L851),"18+$1!"@*6$5%*Q"3*$5*" $0(+"68
5$(1%h$"6:(6"6:$5$"L$5$"86:$5"1%Q$X.%+)$)"9$891$"%+"6:$%5"68L+*?"@*6$5%*Q"C*$5"J5839*
R@CJ*S" $0(+"68"*95%+0"39"(11"8A$5"6:$"91(E$?"_:%1$"6:$*$"05839*")8+G6":(A$"(+!"8&&%E%(1
(&&%1%(6%8+"L%6:"$(E:"86:$5,"6:$!"0$+$5(11!"1%+Q"68"8+$"(+86:$5*G"L$ *%6$*"(+)"L$1E8.$
.$. $5*"&58."(+!L:$5$?"Z!9$"j@*6$5%*Q"C*$5"J5839k"%+68"J8801$"68"65(EQ")8L+"8+$
%+"!835"(5$(?

s '85$"6:(+"Y=y,"(6"1(*6"E83+6?
t Z:$"f)(!2+,(/b<29"E:(++$1"%*"&85"6:$")%*E3**%8+"8&"E:(+0$*"68"6:$"3+)$51!%+0"E8)$" (*$"8&"@*6$5%*Q"(+)"%*"(1*8
+86" *$E8+)X6%$5" *399856?" ^%*E3**%8+*" 5$1(6$)" 68" 95805(..%+0" $\6$5+(1" (991%E(6%8+*" 6:(6" %+6$5&(E$" L%6:
@*6$5%*Q"A%("@JH"85"@'H"(5$".$(+6"68" $"%+"f)(!2+,(/?
u Z8"5$0%*6$5,"53+"$%(F60,3/(2+96 21""L:$+"!83"E8++$E6"68"6:$"*$5A%E$"A%("!835"&(A85%6$"H27"E1%$+6?

The Asterisk Community | 7


The Asterisk Documentation Project
Z:$"@*6$5%*Q"^8E3.$+6(6%8+"B58d$E6"L(*"*6(56$)" !"#$%&"'()*$+"(+)"-(5$)"D.%6:," 36
*$A$5(1"9$891$"%+"6:$"E8..3+%6!":(A$"E8+65% 36$)?
Z:$"08(1"8&"6:$")8E3.$+6(6%8+"958d$E6"%*"68"958A%)$"("*653E635$)"5$98*%685!"8&"L5%66$+
L85Q" 8+" @*6$5%*Q?" H+" E8+65(*6" L%6:" 6:$" &1$\% 1$" (+)" ()" :8E" +(635$" 8&" 6:$" _%Q%," 6:$
^8E*" 958d$E6" %*" 9(**%8+(6$" ( 836" 3%1)%+0" (" .85$" &8E3*$)" (9958(E:" 68" A(5%83*
@*6$5%*QX5$1(6$)"*3 d$E6*?
@*"9(56"8&"6:$"$&&856*"8&"6:$"@*6$5%*Q"^8E*"958d$E6"68".(Q$")8E3.$+6(6%8+"(A(%1( 1$
8+1%+$,"6:%*" 88Q"%*"(A(%1( 1$"(6"6:$" !!"#$$ZZZ')(!2+,(/<.3('.+F"L$ *%6$,"3+)$5"("75$X
(6%A$"78..8+*"1%E$+*$?

The Business Case


H6"%*"A$5!"5(5$"68"&%+)" 3*%+$**$*"6:$*$")(!*"6:(6")8"+86":(A$"68"5$%+A$+6"6:$.*$1A$*"$A$5!
&$L"!$(5*?"H6"%*"$e3(11!"5(5$"68"&%+)"(" 3*%+$**"6:(6"E(+"(&&85)"68"5$91(E$"%6*"E8..3+%X
E(6%8+*"%+&5(*653E635$"$(E:"6%.$"%6"08$*"%+"("+$L")%5$E6%8+?"Z8)(!G*" 3*%+$**$*"+$$)
$\65$.$"&1$\% %1%6!"%+"(11"8&"6:$%5"6$E:+8180!,"%+E13)%+0"6$1$E8.?
H+":%*" 88Q"?+.((,0F6! 26? )(%"RK(59$543*%+$**S,"J$8&&5$!"'885$"89%+$*,"jZ:$"%)$(
6:(6"6:$"A(13$"8&"6:$"*!*6$."L%11" $")%*E8A$5$)"5(6:$5"6:(+"Q+8L+"(6"6:$"6%.$"8&"%+*6(1X
1(6%8+" %.91%$*," %+" 635+," 6:(6" 958)3E6" &1$\% %1%6!" (+)" ()(96( %1%6!," (*" L$11" (*" 8+08%+0
(EE83+6"*$5A%E$,"*:831)" $"E5%6%E(1"E8.98+$+6*"8&"(+!" 3!$5G*"$A(13(6%8+"E:$EQ1%*6?k
_:(6"6:%*".$(+*,"%+"9(56,"%*"6:(6"6:$"653$"A(13$"8&"("6$E:+8180!"%*"8&6$+"+86"Q+8L+"3+6%1
%6":(*" $$+")$918!$)?
K8L" E8.9$11%+0," 6:$+," 68" :(A$" (" *!*6$." 6:(6" :81)*" (6" %6*" A$5!" :$(56" 6:$" E8+E$96" 8&
89$++$**"(+)"6:$"A(13$"8&"E8+6%+383*"%++8A(6%8+?

Conclusion
D8"L:$5$"68" $0%+l"_$11,"L:$+"%6"E8.$*"68"@*6$5%*Q,"6:$5$"%*"&(5".85$"68"6(1Q"( 836"6:(+
L$"E(+"&%6"%+68"8+$" 88Q?"Z:%*" 88Q"E(+"8+1!"1(!")8L+"6:$" (*%E*," 36"&58."6:%*"&83+X
)(6%8+"!83"L%11" $"( 1$"68"E8.$"68"(+"3+)$5*6(+)%+0"8&"6:$"E8+E$96"8&"@*6$5%*Qi(+)
&58."6:(6,"L:8"Q+8L*"L:(6"!83"L%11" 3%1)l

8 | Chapter 1:ಗA Telephony Revolution


CHAPTER 2
Asterisk Architecture

=,+(!6! ,0F(6*,+(!A6-;!60.!60232(()+,1&6,06! )!6.+<2+'


i^8E685"_:8

@*6$5%*Q" %*" A$5!" )%&&$5$+6" &58." 86:$5," .85$" 65()%6%8+(1" B4f*," %+" 6:(6" 6:$" )%(191(+" %+
@*6$5%*Q"65$(6*"(11"%+E8.%+0"E:(++$1*"%+"$**$+6%(11!"6:$"*(.$".(++$5?
H+"("65()%6%8+(1"B4f,"6:$5$"%*"("180%E(1")%&&$5$+E$" $6L$$+"*6(6%8+*"R6$1$9:8+$"*$6*S"(+)
653+Q*"R5$*835E$*"6:(6"E8++$E6"68"6:$"836*%)$"L851)S?"Z:%*".$(+*,"&85"$\(.91$,"6:(6
!83"E(+G6"%+*6(11"(+"$\6$5+(1"0(6$L(!"8+"("*6(6%8+"9856"(+)"5836$"$\6$5+(1"E(11*"68"%6
L%6:836"5$e3%5%+0"!835"3*$5*"68")%(1"6:$"$\6$+*%8+"+3. $5"&%5*6?"@1*8,"6:$"E8+E$96"8&
(+"8&&X*%6$"5$*835E$"R*3E:"(*"("5$E$96%8+")$*QS"%*".3E:".85$")%&&%E316"68"%.91$.$+6"8+
("65()%6%8+(1"B4f," $E(3*$"6:$"*!*6$."L%11"+86"(118L"$\6$5+(1"5$*835E$*"(+!"(EE$**"68
%+6$5+(1"&$(635$*?s
@*6$5%*Q,"8+"6:$"86:$5":(+),")8$*"+86":(A$"(+"%+6$5+(1"E8+E$96"8&"653+Q*"85"*6(6%8+*?"H+
@*6$5%*Q,"$A$5!6:%+0"6:(6"E8.$*"%+68"85"08$*"836"8&"6:$"*!*6$."9(**$*"6:5830:"("E:(++$1"
8&"*8.$"*856?"Z:$5$"(5$".(+!")%&&$5$+6"Q%+)*"8&"E:(++$1*q":8L$A$5,"6:$"@*6$5%*Q")%(191(+"
:(+)1$*"(11"E:(++$1*"%+"("*%.%1(5".(++$5,"L:%E:".$(+*"6:(6,"&85"$\(.91$,"(+"%+6$5+(1
3*$5"E(+"$\%*6"8+"6:$"$+)"8&"(+"$\6$5+(1"653+Q"R$?0?,"("E$11"9:8+$S"(+)" $"65$(6$)" !"6:$
)%(191(+"%+"$\(E61!"6:$"*(.$".(++$5"(*"6:(6"3*$5"L831)" $"%&"*:$"L$5$"8+"(+"%+6$5+(1
$\6$+*%8+?"C+1$**"!83":(A$"L85Q$)"L%6:"("65()%6%8+(1"B4f,"%6".(!"+86" $"%..$)%(6$1!
8 A%83*":8L"98L$5&31"(+)"1% $5(6%+0"6:%*"%*?"T%035$"<X>"%113*65(6$*"6:$")%&&$5$+E$*" $X
6L$$+"6:$"6L8"(5E:%6$E635$*?

s Z8" $"&(%5,".(+!"65()%6%8+(1"B4f*")8"8&&$5"6:%*"*856"8&"&3+E6%8+(1%6!?"K8L$A$5,"%6"%*"0$+$5(11!"Q13)0!,"1%.%6$)
%+"&$(635$*,"(+)"5$e3%5$*"E8.91$\,"95895%$6(5!"*8&6L(5$"68" $"%+*6(11$)"%+"6:$"B4f"R*3E:"(*"A$+)85X*9$E%&%E
95868E81"$\6$+*%8+*S?

9
=,F;+26Cb@'65(!2+,(/69('6SKg6)+3 ,!23!;+2

Modules
@*6$5%*Q"%*" 3%16"8+"%.<;12(?"@".8)31$"%*"("18()( 1$"E8.98+$+6"6:(6"958A%)$*"("*9$E%&%E
&3+E6%8+(1%6!,"*3E:"(*"("E:(++$1")5%A$5"R&85"$\(.91$,"3 )0h(,"'(.S,"85"("5$*835E$"6:(6
(118L*"E8++$E6%8+"68"(+"$\6$5+(1"6$E:+8180!"R*3E:"(*"*;03h.<-3'(.S?"@*6$5%*Q".8)31$*
(5$"18()$)" (*$)"8+"6:$"$2!3$)(!2+,(/$%.<;12('3.0*"&%1$?"_$"L%11")%*E3**"6:$"3*$"8&".(+!
.8)31$*"%+"6:%*" 88Q?"@6"6:%*"98%+6"L$"d3*6"L(+6"68"%+658)3E$"6:$"E8+E$96"8&".8)31$*,
(+)"0%A$"!83"("&$$1"&85"6:$"6!9$*"8&".8)31$*"6:(6"(5$"(A(%1( 1$?
H6"%*"(E63(11!"98**% 1$"68"*6(56"@*6$5%*Q"L%6:836"(+!".8)31$*"(6"(11,"(16:830:"%+"6:%*"*6(6$
%6"L%11"+86" $"E(9( 1$"8&")8%+0"(+!6:%+0?"H6"%*"3*$&31"68"3+)$5*6(+)"6:$".8)31(5"+(635$
8&"@*6$5%*Q"%+"85)$5"68"(995$E%(6$"6:$"(5E:%6$E635$?

g83"E(+"*6(56"@*6$5%*Q"L%6:"+8".8)31$*"18()$)" !")$&(316"(+)"18()"$(E:
)$*%5$)".8)31$".(+3(11!"&58."6:$"E8+*81$," 36"6:%*"%*"+86"*8.$6:%+0
6:(6"!83G)"L(+6"68"936"%+68"958)3E6%8+q"%6"L831)"8+1!" $"3*$&31"%&"!83
L$5$"9$5&85.(+E$X63+%+0"("*!*6$."L:$5$"!83"L(+6$)"68"$1%.%+(6$"$AX
$5!6:%+0"+86"5$e3%5$)" !"!835"*9$E%&%E"(991%E(6%8+"8&"@*6$5%*Q?

Z:$"6!9$*"8&".8)31$*"%+"@*6$5%*Q"%+E13)$"6:$"&8118L%+0V
x @991%E(6%8+*
x 45%)0%+0".8)31$*
x 7(11")$6(%1"5$E85)%+0"R7^2S".8)31$*
x 7:(++$1"$A$+6"1800%+0"R7[#S".8)31$*

10 | Chapter 2:ಗAsterisk Architecture


x 7:(++$1")5%A$5*
x 78)$E"65(+*1(685*
x T85.(6"%+6$595$6$5*
x ^%(191(+"&3+E6%8+*
x B4f".8)31$*
x 2$*835E$".8)31$*
x @))8+*".8)31$*
x Z$*6".8)31$*
H+"6:$"&8118L%+0"*$E6%8+*"L$"L%11"1%*6"$(E:".8)31$"(A(%1( 1$"L%6:%+"6:$*$"E(6$085%$*,
5%$&1!"%)$+6%&!"%6*"93598*$,"(+)"0%A$"835"89%+%8+"8+"%6*"5$1(6%A$"98931(5%6!"(+)U85"%.X
9856(+E$"RL:%1$"*8.$".8)31$*"(5$"958A$+"(+)")$*$5A$)1!"98931(5,"86:$5*"(5$"e3%6$"81),
(5$" (5$1!"$A$5"3*$)"(+!.85$,"(+)"(5$"8+1!".(%+6(%+$)"&85"6:$"93598*$"8&" (EQL(5)X
E8.9(6% %1%6!S?"Z:$")$6(%1*"8&":8L"*9$E%&%E".8)31$*"L85Q"L%11" $"E8A$5$)"%+"A(5%83*
E:(96$5*"6:5830:836"6:$" 88Q,")$9$+)%+0"8+"L:(6"6:$".8)31$"%*"(+)"L:(6"%6")8$*?
D8.$".8)31$*"L%11" $"E8A$5$)"6:85830:1!q"86:$5*".(!"+86" $"E8A$5$)"(6"(11?
2$0(5)%+0" 6:$" B8931(5%6!UD6(63*" E813.+" %+" 6:$" 6( 1$*" 6:(6" &8118L," 6:$" &8118L%+0" 1%*6
E8+6(%+*"835"89%+%8+*"L%6:"5$*9$E6"68"6:$".$(+%+0*"L$":(A$"E:8*$+"R!835".%1$(0$".(!
A(5!SV
E0(,F0,*,3)0!
Z:%*".8)31$"%*"(+E%$+6":%*685!?"H&"!83"3*$"%6," $"(L(5$"6:(6"!83"(5$".8*61!"8+"!835
8L+"L:$+"%6"E8.$*"68"(+!"*856"8&"E8..3+%6!"*399856?
I0+21,)-12
Z:%*".8)31$"%*"+$L"85"$\9$5%.$+6(1,"(+)"%*"+86"*3%6( 1$"&85"958)3E6%8+?
I(2*;1
Z:%*".8)31$"%*"E355$+6,".(%+6(%+$),"98931(5,"(+)"5$E8..$+)$)?
I()-12
Z:%*".8)31$"L85Q*" 36".(!" $"%+E8.91$6$"85"3+98931(5,"(+)U85"%*"+86"5$E8.X
.$+)$)" !"6:$"(36:85*?
[2Z
Z:%*".8)31$"%*"e3%6$"+$L,"(+)"%6*"E8.91$6$+$**"(+)"98931(5%6!"(5$")%&&%E316"68"0(30$
(6"6:%*"6%.$?
82"+23)!2<
Z:%*".8)31$":(*" $$+"5$91(E$)" !"*8.$6:%+0"6:(6"%*"E8+*%)$5$)"*39$5%85?
\,%,!2<
Z:%*".8)31$":(*"1%.%6(6%8+*"6:(6".(!".(Q$"%6"3+*3%6( 1$"68"!835"5$e3%5$.$+6*?
X((20!,)1
Z:%*".8)31$"%*"8+$"!83G11"+$A$5"L(+6"68" $"L%6:836?

Modules | 11
@+)"+8L,"L%6:836"&356:$5"()8,"1$6G*"6(Q$"("188Q"(6"6:$".8)31$*,"05839$)" !".8)31$
6!9$?

Applications
^%(191(+"(991%E(6%8+*"(5$"3*$)"%+"2>!20(,.0('3.0*"68")$&%+$"6:$"A(5%83*"(E6%8+*"6:(6"E(+
$"(991%$)"68"("E(11?"Z:$" Dial()"(991%E(6%8+,"&85"$\(.91$,"%*"5$*98+*% 1$"&85".(Q%+0
83608%+0"E8++$E6%8+*"68"$\6$5+(1"5$*835E$*"(+)"%*"(503( 1!"6:$".8*6"%.9856(+6")%(191(+
(991%E(6%8+?"Z:$"(A(%1( 1$"(991%E(6%8+*"(5$"1%*6$)"%+"Z( 1$"<X>?
7)-126Cb@'68,)1"1)06)""1,3)!,.0(
Name Purpose Popularity/Status
app_adsiprog Loads Analog Display Services Interface (ADSI) scripts into Insignificant
compatible analog phones
app_alarmreceiver Supports receipt of reports from alarm equipment Insignificant
app_amd Detects answering machines Unreliable
app_authenticate Compares dual-tone multi-frequency (DTMF) input against Useful
a provided string (password)
app_cdr Writes ad hoc record to CDR Useful
app_celgenuserevent Generates user-defined events for CEL New
app_chanisavail Checks the status of a channel Unreliable
app_channelredirect Forces another channel into a different part of the Useful
dialplan
app_chanspy Allows a channel to listen to audio on another channel Useful
app_confbridge Provides conferencing (new version) New—not fully featured yet
app_controlplayback Plays back a prompt and offers fast forward and rewind Useful
functions
app_dahdibarge Allows barging in on a DAHDI channel Deprecated—see
app_chanspy
app_dahdiras Creates a RAS server over a DAHDI channel (no modem em- Insignificant
ulation)
app_db Used to add/change/delete records in Asterisk’s built-in Deprecated—see func_db
Berkeley database
app_dial Used to connect channels together (i.e., make phone calls) Essential
app_dictate Plays back a recording and offers start/stop functions Useful
app_directed_pickup Answers a call for another extension Useful
app_directory Presents the list of names from voicemail.conf Useful
app_disa Provides dialtone and accepts DTMF input Usefula
app_dumpchan Dumps channel variables to Asterisk command-line Useful
interface (CLI)

12 | Chapter 2:ಗAsterisk Architecture


Name Purpose Popularity/Status
app_echo Loops received audio back to source channel Useful
app_exec Contains Exec(), TryExec(), and ExecIf(); executes Useful
a dialplan application based on conditions
app_externalivr Controls Asterisk as with an AGI, only asynchronously Useful
app_fax Provides SendFax() and ReceiveFax() Usefulb
app_festival Enables basic text to speech using Festival TTS engine Usable
app_flash Performs a hook-switch flash on channels (primarily Useful
analog)
app_followme Performs find me/follow me functionality based on Useful
followme.conf
app_forkcdr Starts new CDR record on current call Usable
app_getcpeid Gets the ADSI CPE ID Insignificant
app_ices Sends audio to an Icecast server Usable
app_image Transmits an image to supported devices Limited
app_ivrdemo Sample application for developers Insignificant
app_jack Works with JACK Audio Connection Kit to share audio be- Useful
tween compatible applications
app_macro Triggers dialplan macros Deprecated—see GoSub()
app_meetme Provides multiparty conferencing Useful—fully featured
app_milliwatt Generates 1004-Hz tone for testing loss on analog circuits Useful
app_minivm Provides primitive functions to allow you to build your own Usable
voicemail application in dialplan
app_mixmonitor Records both sides of a call and mixes them together Useful
app_morsecode Generates Morse code Usable
app_mp3 Uses mpg123 to play an MP3 Insignificant
app_nbscat Streams audio from Network Broadcast Stream (NBS) Insignificant
app_originate Allows origination of a call Useful
app_osplookup Performs Open Settlement Protocol (OSP) lookup Usable
app_page Creates multiple audio connections to specified devices for Useful
public address (paging)
app_parkandannounce Enables automated announcing of parked calls Usable
app_playback Plays a file to the channel (does not accept input) Useful
app_playtones Plays pairs of tones of specified frequencies Useful
app_privacy Requests input of caller’s phone number if no CallerID is Insignificant
received
app_queue Provides Automatic Call Distribution (ACD) Useful

Modules | 13
Name Purpose Popularity/Status
app_read Requests input of digits from callers and assigns input to a Useful
variable
app_readexten Requests input of digits from callers and passes call to a Usable
designated extension and context
app_readfile Loads contents of a text file into a channel variable Deprecated—see the FILE()
function in func_env
app_record Records received audio to a file Useful
app_rpt Provides a method to interface with an audio board for the Limited
app_rpt project
app_sayunixtime Plays back time in specified format Useful
app_senddtmf Transmits DTMF to calling party Useful
app_sendtext Sends a text string to compatible channels Insignificant
app_setcallerid Sets CallerID on a channel Deprecated—see func_call
erid
app_skel Sample application for developers Usefulc
app_sms Sends SMS message in compatible countries Limited
app_softhangup Requests hangup of channel Useful
app_speech_utils Provides utilities relating to speech recognition Usefuld
app_stack Provides Gosub(), GoSubIf(), Return(), Stack Essential
Pop(), LOCAL(), and LOCAL_PEEK()
app_system Executes commands in a Linux shell Useful
app_talkdetect Similar to app_background, but allows for any received Useful
audio to interrupt playback
app_test Client/server testing application Usable
app_transfer Performs a transfer on the current channel Useful
app_url Passes a URI to the called channel Limited
app_userevent Generates a custom event in the Asterisk Manager Useful
Interface (AMI)
app_verbose Generates a custom event in the Asterisk CLI Useful
app_voicemail Provides voicemail Essential
app_waitforring Waits for a RING signaling event (not to be confused with Insignificant
RINGING); most likely unnecessary, as only chan_dahdi
with analog channels where ringing is received (such as an
FXO port) generates the RING signaling event
app_waitforsilence Includes WaitForSilence() and WaitForNoise(); Useful
listens to the incoming channel for a specified number of
milliseconds of noise/silence
app_waituntil Waits until current Linux epoch matches specified epoch Useful

14 | Chapter 2:ಗAsterisk Architecture


Name Purpose Popularity/Status
app_while Includes While(), EndWhile(), ExitWhile(), and Useful
ContinueWhile(); provides while-loop functionality in
the dialplan
app_zapateller Generates SIT tone to discourage telemarketers Usable
a The use of (DISA) is considered to be a security risk.
b Requires a suitable DSP engine to handle encoding/decoding of fax signaling (see Chapter 19).
c If you are a developer.
d Requires an external speech recognition application.

Bridging Modules
45%)0%+0".8)31$*"(5$"+$L"%+"@*6$5%*Q">?WV"6:$!"9$5&85."6:$"(E63(1" 5%)0%+0"8&"E:(++$1*
%+"6:$"+$L" 5%)0%+0"@BH?"[(E:"958A%)$*")%&&$5$+6"&$(635$*,"L:%E:"0$6"3*$)"%+")%&&$5$+6
*%63(6%8+*")$9$+)%+0"8+"L:(6"(" 5%)0$"+$$)*?"Z:$*$".8)31$*,"1%*6$)"%+"Z( 1$"<X<,"(5$
E355$+61!"8+1!"3*$)"&85"R(+)"(5$"$**$+6%(1"68S"app_confbridge?
7)-126CbC'6K+,<F,0F6%.<;12(
Name Purpose Popularity/Status
bridge_builtin_features Performs bridging when utilizing built-in user features (such as New
those found in features.conf).
bridge_multiplexed Performs complex multiplexing, as would be required in a large New
conference room (multiple participants). Currently only used by
app_confbridge.
bridge_simple Performs simple channel-to-channel bridging. New
bridge_softmix Performs simple multiplexing, as would be required in a large New
conference room (multiple participants). Currently only used by
app_confbridge.

Call Detail Recording Modules


Z:$"7^2".8)31$*,"1%*6$)"%+"Z( 1$"<XY,"(5$")$*%0+$)"68"&(E%1%6(6$"(*".(+!".$6:8)*"8&
*685%+0"E(11")$6(%1"5$E85)*"(*"98**% 1$?"g83"E(+"*685$"7^2*"68"("&%1$"R)$&(316S,"(")(6( (*$,
2@^HCD,"85"(&(1.F?

7(11")$6(%1"5$E85)*"(5$"+86"%+6$+)$)"68" $"3*$)"%+"E8.91$\" %11%+0"(9X


91%E(6%8+*?"H&"!83"5$e3%5$".85$"E8+6581"8A$5" %11%+0"(+)"E(11"5$9856%+0,
!83" L%11" L(+6" 68" 188Q" (6" E:(++$1" $A$+6" 1800%+0," )%*E3**$)" +$\6?" Z:$
()A(+6(0$"8&"7^2"%*"6:(6"%6"d3*6"L85Q*?

Modules | 15
7)-126CbD'6?)116<2!),16+23.+<,0F6%.<;12(
Name Purpose Popularity/Status
cdr_adaptive_odbc Allows writing of CDRs through ODBC frame- Useful
work with ability to add custom fields
cdr_csv Writes CDRs to disk as a comma-separated Usable
values file
cdr_custom As above, but allows for the addition of custom Useful
fields
cdr_manager Outputs CDRs to Asterisk Manager Interface Useful
(AMI)
cdr_odbc Writes CDRs through ODBC framework Usable
cdr_pgsql Writes CDRs to PostgreSQL Useful
cdr_radius Writes CDRs to RADIUS Usable—does not support custom fields
cdr_sqlite Writes CDRs to SQLite2 database Deprecated—use sqlite3_custom
cdr_sqlite3_custom Writes CDRs to SQLite3 with custom fields Useful
cdr_syslog Writes CDRs to syslog Useful
cdr_tds Writes CDRs to Microsoft SQL or Sybase Usable—requires an old version of libtds

_$" L%11" )%*E3**" *8.$" 5$9856%+0" 9(EQ(0$*" 6:(6" !83" .(!" L%*:" 68" 3*$" L%6:" 7^2" %+
7:(96$5"<I?

Channel Event Logging Modules


7:(++$1" $A$+6" 1800%+0" 958A%)$*" .3E:" .85$" 98L$5&31" E8+6581" 8A$5" 5$9856%+0" 8&" E(11
(E6%A%6!?"4!"6:$"*(.$"68Q$+,"%6"5$e3%5$*".85$"E(5$&31"91(++%+0"8&"!835")%(191(+,"(+)" !
+8".$(+*"L%11"%6"L85Q"(368.(6%E(11!?"@*6$5%*QG*"7[#".8)31$*"(5$"1%*6$)"%+"Z( 1$"<XO?
7)-126CbG'6? )002162920!61.FF,0F6%.<;12(
Name Purpose Popularity/Status
cel_custom CEL to disk/file Useful
cel_manager CEL to AMI Useful
cel_odbc CEL to ODBC Useful
cel_pgsql CEL to PostgreSQL Useful
cel_radius CEL to RADIUS Usable—does not support custom fields
cel_sqlite3_custom CEL to Sqlite3 Useful
cel_tds CEL to Microsoft SQL or Sybase Usable—requires an old version of libtds

16 | Chapter 2:ಗAsterisk Architecture


Channel Drivers
_%6:836" E:(++$1" )5%A$5*," @*6$5%*Q" L831)" :(A$" +8" L(!" 68" .(Q$" E(11*?" [(E:" E:(++$1
)5%A$5" %*" *9$E%&%E" 68" 6:$" 95868E81" 85" E:(++$1" 6!9$" %6" *399856*" RDHB," HD^M," $6E?S?" Z:$
E:(++$1".8)31$"(E6*"(*"("0(6$L(!"68"6:$"@*6$5%*Q"E85$?"@*6$5%*QG*"E:(++$1")5%A$5*"(5$
1%*6$)"%+"Z( 1$"<XI?
7)-126CbH'6? )00216<+,92+(
Name Purpose Popularity/Status
chan_agent Provides agent channel for Queue() Useful
|chan_alsa Provides connection to Advanced Linux Sound Useful
Architecture
chan_bridge Used internally by the ConfBridge() application; Essential a
should not be used directly
chan_console Provides connection to portaudio New
chan_dahdi Provides connection to PSTN cards that use DAHDI Useful
channel drivers
chan_gtalk Provides connection to Google Talk Usable
chan_h323 Provides connection to H.323 endpoints Deprecated—see chan_ooh323 in
Table 2-11
chan_iax2 Provides connection to IAX2 endpoints Useful
chan_jingle Provides connection to Jingle-enabled endpoints Usable
chan_local Provides a mechanism to treat a portion of the dialplan Useful
as a channel
chan_mgcp Media Gateway Control Protocol channel driver Usable
chan_misdn Provides connection to mISDN supported ISDN cards Limited
chan_multicast_rtp Provides connection to multicast RTP streams Useful
chan_nbs Network Broadcast Sound channel driver Insignificant
chan_oss Open Sound System driver Useful
chan_phone Linux telephony interface driver (very old) Insignificant
chan_sip Session Initiation Protocol channel driver Essential
chan_skinny Cisco Skinny Client Control Protocol (SCCP) channel Usable
driver
chan_unistim Nortel Unistim protocol channel driver Usable
chan_usbradio Channel driver for CM108 USB cards with Usable
radio interface
chan_vpb Voicetronix channel driver Insignificantb
a If you are using the ConfBridge() application.
b Some Voicetronix hardware is supported by Zaptel using an addon Zaptel module distributed by Voicetronix. However, Zaptel is no longer
supported by Asterisk and this driver has not been ported to DAHDI.

Modules | 17
Codec Translators
Z:$"E8)$E"65(+*1(685*"RZ( 1$"<X`S"(118L"@*6$5%*Q"68"E8+A$56"(3)%8"*65$(."&85.(6*" $X
6L$$+"E(11*?"D8"%&"("E(11"E8.$*"%+"8+"("B2H"E%5E3%6"R3*%+0"J?P>>S"(+)"+$$)*"68" $"9(**$)
836" (" E8.95$**$)" DHB" E:(++$1" R$?0?," 3*%+0" J?P<N," 8+$" 8&" .(+!" E8)$E*" 6:(6" DHB" E(+
:(+)1$S,"6:$"5$1$A(+6"E8)$E"65(+*1(685"L831)"9$5&85."6:$"E8+A$5*%8+?t

H&"("E8)$E"R*3E:"(*"J?P<NS"3*$*"("E8.91$\"$+E8)%+0"(1085%6:.,":$(A!
3*$"8&"65(+*E8)%+0"E(+"91(E$"(".(**%A$" 35)$+"8+"6:$"7BC?"D9$E%(1%h$)
:(5)L(5$"&85"6:$")$E8)%+0U$+E8)%+0"8&"J?P<N"%*"(A(%1( 1$"&58.":(5)X
L(5$".(+3&(E635$5*"*3E:"(*"D(+08.("(+)"^%0%3."R(+)"1%Q$1!"86:$5*S?

7)-126CbJ'6?.<236!+)0(1)!.+(
Name Purpose Popularity/Status
codec_adpcm Adaptive Differential Pulse Coded Modulation codec Insignificant
codec_alaw A-law PCM codec used all over the world (except Canada/USA) on the PSTN Essential
codec_a_mu A-law to mu-law direct converter Useful
codec_dahdi Utilizes proprietary Digium hardware transcoding card Essentiala
codec_g722 Wideband audio codec Useful
codec_g726 Flavor of ADPCM Insignificant
codec_gsm Global System for Mobile Communications (GSM) codec Useful
codec_ilbc Internet Low Bitrate Codec Insignificant
codec_lpc10 Linear Predictive Coding vocoder (extremely low bandwidth) Insignificant
codec_resample Resamples between 8-bit and 16-bit signed linear Usable
codec_speex Speex codec Usable
codec_ulaw Mu-law PCM codec used in Canada/USA on PSTN Essential
a If you are using a Digium codec transcoder card.

Format Interpreters
T85.(6"%+6$595$6$5*"RZ( 1$"<XPS"9$5&85."6:$"&3+E6%8+"8&"E8)$E"65(+*1(685*," 36"6:$!")8
6:$%5"L85Q"8+"&%1$*"5(6:$5"6:(+"E:(++$1*?"H&"!83":(A$"("5$E85)%+0"8+"(".$+3"6:(6":(*
$$+"*685$)"(*"JD',"("&85.(6"%+6$595$6$5"L831)"+$$)"68" $"3*$)"68"91(!"6:(6"5$E85)%+0
68"(+!"E:(++$1*"+86"3*%+0"6:$"JD'"E8)$E?u

t '85$"%+&85.(6%8+"( 836"L:(6"E8)$E*"(5$"(+)":8L"6:$!"L85Q"%*"(A(%1( 1$"%+"j78)$E*k"8+"9(0$"`<I?


u H6"%*"9(561!"&85"6:%*"5$(*8+"6:(6"L$")8"+86"5$E8..$+)"6:$")$&(316"JD'"&85.(6"&85"*!*6$."5$E85)%+0*?"_@/
5$E85)%+0*"L%11"*83+)" $66$5"(+)"3*$"1$**"7BC?

18 | Chapter 2:ಗAsterisk Architecture


H&"!83"*685$"("5$E85)%+0"%+"*$A$5(1"&85.(6*"R*3E:"(*"_@/,"JD',"$6E?S,"@*6$5%*Q"L%11
)$6$5.%+$"6:$"1$(*6"E8*61!"&85.(6v"68"3*$"L:$+"("E:(++$1"5$e3%5$*"6:(6"5$E85)%+0?
7)-126CbL'6=.+%)!6,0!2+"+2!2+(
Name Plays files stored in Popularity/Status
format_g723 G.723 .g723 Insignificant
format_g726 G.726 .g726 Insignificant
format_g729 G.729 .g729 Useful
format_gsm RPE-LTP (original GSM codec) .gsm Usable
format_h263 H.263—video .h263 Usable
format_h264 H.264—video .h264 Usable
format_ilbc Internet Low Bitrate Codec .ilbc Insignificant
format_jpeg Graphic file .jpeg .jpg Insignificant
format_ogg_vorbis Ogg container .ogg Usable
format_pcm Various Pulse-Coded Modulation Useful
formats: .alaw, .al, .alw, .pcm, .ulaw, .ul, .mu, .ulw, .g722, .au
format_siren14 G.722.1 Annex C (14 kHz) .siren14 New
format_siren7 G.722.1 (7 kHz) .siren7 New
format_sln16 16-bit signed linear .sln16 New
format_sln 8-bit signed linear .sln .raw Useful
format_vox .vox Insignificant
format_wav .wav Useful
format_wav_gsm GSM audio in a WAV container .WAV, .wav49 Usable

Dialplan Functions
^%(191(+" &3+E6%8+*," 1%*6$)" %+" Z( 1$" <XW," E8.91$.$+6" 6:$" )%(191(+" (991%E(6%8+*" R*$$
j@991%E(6%8+*k"8+"9(0$"><S?"Z:$!"958A%)$".(+!"3*$&31"$+:(+E$.$+6*"68"6:%+0*"1%Q$
*65%+0":(+)1%+0,"6%.$"(+)")(6$"L5(+01%+0,"(+)"F^47"E8++$E6%A%6!?
7)-126CbN'68,)1"1)06*;03!,.0(
Name Purpose Popularity/Status
func_aes Encrypts/decrypts an AES string Useful
func_audiohookinherit Allows calls to be recorded after transfer Useful
func_base64 Encodes/decodes a base-64 string Usable
func_blacklist Writes/reads blacklist in astdb Useful

v D8.$"E8)$E*"E(+"%.98*$"("*%0+%&%E(+6"18()"8+"6:$"7BC,"*3E:"6:(6"("*!*6$."6:(6"E831)"*399856"*$A$5(1":3+)5$)
E:(++$1*"L%6:836"65(+*E8)%+0".%0:6"8+1!" $"( 1$"68":(+)1$"("&$L")8h$+"L:$+"65(+*E8)%+0"%*"%+"3*$?

Modules | 19
Name Purpose Popularity/Status
func_callcompletion Gets/sets call completion configuration parameters for the channel New
func_callerid Gets/sets CallerID Useful
func_cdr Gets/sets CDR variable Useful
func_channel Gets/sets channel information Useful
func_config Includes AST_CONFIG(); reads variables from config file Usable
func_connectedline Changes connected line information on supported handsets New
func_curl Uses cURL to obtain data from a URI Useful
func_cut Slices and dices strings Useful
func_db Provides astdb functions Useful
func_devstate Gets state of device Useful
func_dialgroup Creates a group for simultaneous dialing Useful
func_dialplan Validates that designated target exists in dialplan Useful
func_enum Performs ENUM lookup Useful
func_env Includes FILE(), STAT(), and ENV(); performs operating system Useful
actions
func_extstate Returns status of a hinted extension Useful
func_global Gets/sets global variables Useful
func_groupcount Gets/sets channel count for members of a group Useful
func_iconv Converts between character sets Usable
func_lock Includes LOCK(), UNLOCK(), and TRYLOCK(); sets a lock that can Useful
be used to avoid race conditions in the dialplan
func_logic Includes ISNULL(), SET(), EXISTS(), IF(), IFTIME(), and Useful
IMPORT(); performs various logical functions
func_math Includes MATH(), INC(), and DEC(); performs mathematical Useful
functions
func_md5 Converts supplied string to an MD5 hash Useful
func_module Checks to see if supplied module is loaded into memory Usable
func_odbc Allows dialplan integration with ODBC resources Useful
func_pitchshift Shifts the pitch of an audio stream Useful
func_rand Returns a random number within a given range Useful
func_realtime Performs lookups within the Asterisk Realtime Architecture (ARA) Useful
func_redirecting Provides access to information about where this call was redirected Useful
from
func_sha1 Converts supplied string to an SHA1 hash Useful
func_shell Performs Linux shell operations and returns results Useful
func_speex Reduces noise and performs dB gain/loss on an audio stream Useful

20 | Chapter 2:ಗAsterisk Architecture


Name Purpose Popularity/Status
func_sprintf Performs string format functions similar to C function of same name Useful
func_srv Perform SRV lookups in the dialplan Useful
func_strings Includes over a dozen string manipulation functions Useful
func_sysinfo Gets system information such as RAM, swap, load average, etc. Useful
func_timeout Gets/sets timeouts on channel Useful
func_uri Converts strings to URI-safe encoding Useful
func_version Returns Asterisk version information Usable
func_vmcount Returns count of messages in a voicemail folder for a particular user Useful
func_volume Sets volume on a channel Useful

PBX Modules
Z:$"B4f".8)31$*"(5$"9$5%9:$5(1".8)31$*"6:(6"958A%)$"$+:(+E$)"E8+6581"(+)"E8+&%03X
5(6%8+".$E:(+%*.*?"T85"$\(.91$," pbx_config"%*"6:$".8)31$"6:(6"18()*"6:$"65()%6%8+(1
@*6$5%*Q")%(191(+?"Z:$"E355$+61!"(A(%1( 1$"B4f".8)31$*"(5$"1%*6$)"%+"Z( 1$"<XN?
7)-126CbP'6SKg6%.<;12(
Name Purpose Popularity/Status
pbx_ael Asterisk Extension Logic (AEL) offers a dialplan scripting language that looks like a Usablea
modern programming language.
pbx_config This is the traditional, and most popular, dialplan language for Asterisk. Without Useful
this module, Asterisk cannot read extensions.conf.
pbx_dundi Performs data lookups on remote Asterisk systems. Useful
pbx_loopback Performs something similar to a dialplan include, but in a deprecated manner. Insignificantb
pbx_lua Allows creation of a dialplan using the Lua scripting language. Useful
pbx_realtime Provides functionality related to the Asterisk Realtime Architecture. Useful
pbx_spool Provides outgoing spool support relating to Asterisk call files. Useful
a We have not found too many people using AEL. We suspect this is because most developers will tend to use AGI/AMI if they do not want
to use traditional dialplans.
b We’ve never heard of this being used in production.

Resource Modules
2$*835E$".8)31$*"%+6$05(6$"@*6$5%*Q"L%6:"$\6$5+(1"5$*835E$*?"T85"$\(.91$," res_odbc
(118L*"@*6$5%*Q"68"%+6$589$5(6$"L%6:"F^47")(6( (*$"E8++$E6%8+*?"Z:$"E355$+61!"(A(%1X
( 1$"5$*835E$".8)31$*"(5$"1%*6$)"%+"Z( 1$"<X>=?

Modules | 21
7)-126Cb@R'6B2(.;+326%.<;12(
Name Purpose Popularity/Status
res_adsi Provides ADSI Essentiala
res_ael_share Provides shared routines for use with pbx_ael Essential if you’re using AEL
res_agi Provides Asterisk Gateway Interface Useful
res_ais Provides distributed message waiting indication (MWI) and Useful
device state notifications via an implementation of the AIS
standard, such as OpenAIS
res_calendar Enables base integration to calendaring systems Useful
res_calendar_caldav Provides CalDAV-specific capabilities Useful
res_calendar_exchange Provides MS Exchange capabilities Useful
res_calendar_icalendar Provides Apple/Google iCalendar capabilities Useful
res_clialiases Creates CLI aliases Useful
res_clioriginate Originates a call from the CLI Usable
res_config_curl Pulls configuration information using cURL Useful
res_config_ldap Pulls configuration information using LDAP Usable
res_config_odbc Pulls configuration information using ODBC Useful
res_config_pgsql Pulls configuration information using PostgreSQL Usable
res_config_sqlite Pulls configuration information using SQLite Usable
res_convert Uses the CLI to perform file conversions Usable
res_crypto Provides cryptographic capabilities Useful
res_curl Provides common subroutines for other cURL modules Useful
res_fax Provides common subroutines for other fax modules Useful
res_fax_spandsp Plug-in for fax using the spandsp package Useful
res_http_post Provides POST upload support for the Asterisk HTTP server Usable
res_jabber Provides Jabber/XMPP resources Useful
res_limit Enables adjusting of system limits on the Asterisk process Usable
res_monitor Provides call recording resources Useful
res_musiconhold Provides music on hold (MOH) resources Essential
res_mutestream Allows muting/unmuting of audio streams New
res_odbc Provides common subroutines for other ODBC modules Useful
res_phoneprov Provisions phones from Asterisk HTTP server New
res_pktccops Provides PacketCable COPS resources New
res_realtime Provides CLI commands for the Asterisk Realtime Useful
Architecture (ARA)
res_rtp_asterisk Provides RTP Essential
res_rtp_multicast Provides multicast-RTP New

22 | Chapter 2:ಗAsterisk Architecture


Name Purpose Popularity/Status
res_security_log Enables security logging New
res_smdi Provides voicemail notification using the SMDI protocol Limited
res_snmp Provides system status information to an SNMP-managed Usable
network
res_speech Generic speech recognition API Limitedb
res_timing_dahdi Provides timing using the DAHDI kernel interface Useful
res_timing_kqueue Provides timing using a kernel feature in some BSDs, in- New
cluding Mac OS X
res_timing_pthread Provides timing using only parts of the standard Useful
pthread API; less efficient but more portable than other
timing modules.
res_timing_timerfd Provides timing using the timerfd API provided by newer Useful
versions of the Linux kernel
a While most of the ADSI functionality in Asterisk is never used, the voicemail application uses this resource.
b Requires a separately licensed product in order to be used.

Addon Modules
@))8+".8)31$*"(5$"E8..3+%6!X)$A$189$)".8)31$*"L%6:")%&&$5$+6"3*(0$"85")%*65% 36%8+
5%0:6*"&58."6:8*$"8&"6:$".(%+"E8)$?"Z:$!"(5$"Q$96"%+"("*$9(5(6$")%5$E685!"(+)"(5$"+86
E8.9%1$)"(+)"%+*6(11$)" !")$&(316?"Z8"$+( 1$"6:$*$".8)31$*,"3*$"6:$"%20;(2123!" 3%1)
E8+&%035(6%8+"36%1%6!?"7355$+61!"(A(%1( 1$"())8+".8)31$*"(5$"1%*6$)"%+"Z( 1$"<X>>?
7)-126Cb@@'65<<.06%.<;12(
Name Purpose Popularity/Status
app_mysql Executes MySQL queries with a Deprecated—see func_odbc
dialplan application
app_saycountpl Says Polish counting words Deprecated—now integrated in say.conf
cdr_mysql Logs call detail records to a MySQL Usable—we recommend cdr_adaptive_odbc instead
database
chan_mobile Enables making and receiving Limiteda
phone calls using cell phones over
Bluetooth
chan_ooh323 Enables making and receiving VoIP Usable
calls using the H.323 protocol
format_mp3 Allows Asterisk to play MP3 files Usable
res_config_mysql Uses a MySQL database as a real- Useful
time configuration backend
a While chan_mobile works great with many phones, problems have been reported with some models. When a problem does occur, it
is very difficult for developers to solve unless they have a phone of the same model to test with.

Modules | 23
Test Modules
Z$*6".8)31$*"(5$"3*$)" !"6:$"@*6$5%*Q")$A$189.$+6"6$(."68"A(1%)(6$"+$L"E8)$?"Z:$!
(5$"E8+*6(+61!"E:(+0%+0"(+)" $%+0"())$)"68,"(+)"(5$"+86"3*$&31"3+1$**"!83"(5$")$A$1X
89%+0"@*6$5%*Q"*8&6L(5$?
H&"!83"(5$"(+"@*6$5%*Q")$A$189$5,":8L$A$5,"6:$"@*6$5%*Q"Z$*6"D3%6$".(!" $"8&"%+6$5$*6"68
!83"(*"!83"E(+" 3%1)"(368.(6$)"6$*6*"&85"@*6$5%*Q"(+)"*3 .%6"6:8*$" (EQ"68"6:$"958d$E6,
L:%E:"53+*"8+"*$A$5(1")%&&$5$+6"89$5(6%+0"*!*6$.*"(+)"6!9$*"8&".(E:%+$*?"4!"$\9(+)%+0
6:$"+3. $5"8&"6$*6*"E8+*6(+61!,"6:$"@*6$5%*Q"958d$E6"(A8%)*"6:$"E5$(6%8+"8&"5$05$**%8+*
%+"E8)$?"4!"*3 .%66%+0"!835"8L+"6$*6*"68"6:$"958d$E6,"!83"E(+"&$$1".85$"E8+&%)$+6"%+
&3635$"3905()$*?
'85$"%+&85.(6%8+"( 836"%+*6(11%+0"6:$"@*6$5%*Q"Z$*6"D3%6$"%*"(A(%1( 1$"%+"6:%*" 180"98*6V
!!"#$$-1.F(')(!2+,(/'.+F$CR@R$RG$CP$,0(!)11,0Fb! 2b)(!2+,(/b!2(!b(;,!2$?" '85$" %+&85.(X
6%8+"( 836" 3%1)%+0"6$*6*"%*"(A(%1( 1$"%+"6:%*")8E3.$+6V" !!"#$$(90')(!2+,(/'.+F$(90$!2(!
(;,!2$)(!2+,(/$!+;0/$BX58YX'!>!"85"!83"E(+"d8%+"6:$"f)(!2+,(/b!2(!,0F"E:(++$1"8+"6:$
T5$$+8)$"H27"+$6L85Q?

File Structure
@*6$5%*Q"%*"("E8.91$\"*!*6$.,"E8.98*$)"8&".(+!"5$*835E$*?"Z:$*$"5$*835E$*".(Q$"3*$
8&"6:$"&%1$*!*6$."%+"*$A$5(1"L(!*?"D%+E$"#%+3\"%*"*8"&1$\% 1$"%+"6:%*"5$0(5),"%6"%*":$19&31"68
3+)$5*6(+)"L:(6")(6("%*" $%+0"*685$),"*8"6:(6"!83"E(+"3+)$5*6(+)"L:$5$"!83"(5$"1%Q$1!
68"&%+)"("9(56%E31(5" %6"8&"*685$)")(6("R*3E:"(*"A8%E$.(%1".$**(0$*"85"180"&%1$*S?

Configuration Files
Z:$" @*6$5%*Q" E8+&%035(6%8+" &%1$*" %+E13)$" 2>!20(,.0('3.0*," (,"'3.0*," %.<;12('3.0*," (+)
)8h$+*"8&"86:$5"&%1$*"6:(6")$&%+$"9(5(.$6$5*"&85"6:$"A(5%83*"E:(++$1*,"5$*835E$*,".8)X
31$*,"(+)"&3+E6%8+*"6:(6".(!" $"%+"3*$?
Z:$*$"&%1$*"L%11" $"&83+)"%+"$2!3$)(!2+,(/?"g83"L%11" $"L85Q%+0"%+"6:%*"&81)$5"("186"(*"!83
E8+&%035$"(+)"().%+%*6$5"!835"@*6$5%*Q"*!*6$.?

Modules
@*6$5%*Q".8)31$*"(5$"3*3(11!"%+*6(11$)"68"6:$"$;(+$1,-$)(!2+,(/$%.<;12("&81)$5?"g83"L%11
+86"+85.(11!":(A$"68"%+6$5(E6"L%6:"6:%*"&81)$5q":8L$A$5,"%6"L%11" $"8EE(*%8+(11!"3*$&31
68"Q+8L"L:$5$"6:$".8)31$*"(5$"18E(6$)?"T85"$\(.91$,"%&"!83"3905()$"@*6$5%*Q"(+)"*$1$E6
)%&&$5$+6".8)31$*")35%+0"6:$"%20;(2123!"9:(*$"8&"6:$"%+*6(11,"6:$"81)"R%+E8.9(6% 1$S
.8)31$*" &58." 6:$" 95$A%83*" @*6$5%*Q" A$5*%8+" L%11" +86" $" )$1$6$)," (+)" !83" L%11" 0$6" (
L(5+%+0"&58."6:$"%+*6(11"*E5%96?"Z:8*$"81)"&%1$*"L%11"+$$)"68" $")$1$6$)"&58."6:$"%.<;12(
&81)$5?"Z:%*"E(+" $")8+$"$%6:$5".(+3(11!"85"L%6:"6:$"j3+%+*6(11k".(Q$"R%)/26;0,0b
(!)11S"6(50$6?

24 | Chapter 2:ಗAsterisk Architecture


The Resource Library
Z:$5$"(5$"*$A$5(1"5$*835E$*"6:(6"5$e3%5$"$\6$5+(1")(6("*835E$*?"T85"$\(.91$,".3*%E"8+
:81)"R'FKS"E(+G6":(99$+"3+1$**"!83":(A$"*8.$".3*%E"68"91(!?"D!*6$."958.96*"(1*8
+$$)"68" $"*685$)"*8.$L:$5$"8+"6:$":(5)")5%A$?"Z:$"$9)+$1,-$)(!2+,(/"&81)$5"%*"L:$5$
*!*6$."958.96*,"@JH"*E5%96*,".3*%E"8+":81),"(+)"86:$5"5$*835E$"&%1$*"(5$"*685$)?

The Spool
Z:$"("..1"%*"L:$5$"#%+3\"*685$*"&%1$*"6:(6"(5$"08%+0"68"E:(+0$"&5$e3$+61!,"85"L%11" $
958E$**$)" !"86:$5"958E$**$*"(6"("1(6$5"6%.$?"T85"$\(.91$,"3+)$5"#%+3\"95%+6"d8 *"(+)
9$+)%+0"$.(%1*"(5$"+85.(11!"L5%66$+"68"6:$"*9881"3+6%1"6:$!"(5$"958E$**$)?
T85" @*6$5%*Q," 6:$" *9881" %*" 3*$)" 68" *685$" 65(+*%$+6" %6$.*" *3E:" (*" A8%E$" .$**(0$*," E(11
5$E85)%+0*,಩"E(11"&%1$*,"(+)"*8"&856:?
Z:$"@*6$5%*Q"*9881"L%11" $"&83+)"3+)$5"6:$"$9)+$("..1$)(!2+,(/")%5$E685!?

Logging
@*6$5%*Q"%*"E(9( 1$"8&"0$+$5(6%+0"*$A$5(1")%&&$5$+6"Q%+)*"8&"180"&%1$*?"Z:$"$9)+$1.F$)(!2+b
,(/"&81)$5"%*"L:$5$"6:%+0*"*3E:"(*"E(11")$6(%1"5$E85)*"R7^2*S,"E:(++$1"$A$+6*"&58."7[#,
)$ 30"180*,"e3$3$"180*,".$**(0$*,"$5585*,"(+)"86:$5"836936"(5$"L5%66$+?
Z:%*"&81)$5"L%11" $"$\65$.$1!"%.9856(+6"&85"(+!"6583 1$*:886%+0"$&&856*"!83"3+)$56(Q$?
_$"L%11"6(1Q".85$"( 836":8L"68".(Q$"3*$"8&"@*6$5%*Q"180*"%+"7:(96$5"<O?

The Dialplan
Z:$")%(191(+"%*"6:$":$(56"8&"@*6$5%*Q?"@11"E:(++$1*"6:(6"(55%A$"%+"6:$"*!*6$."L%11" $"9(**$)
6:5830:"6:$")%(191(+,"L:%E:"E8+6(%+*"6:$"E(11X&18L"*E5%96"6:(6")$6$5.%+$*":8L"6:$"%+X
E8.%+0"E(11*"(5$":(+)1$)?
@")%(191(+"E(+" $"L5%66$+"%+"8+$"8&"6:5$$"L(!*V
x C*%+0"65()%6%8+(1"@*6$5%*Q")%(191(+"*!+6(\"%+"$2!3$)(!2+,(/$2>!20(,.0('3.0*
x C*%+0"(*6$5%*Q"[\6$+*%8+"#80%E"R@[#S"%+"$2!3$)(!2+,(/$2>!20(,.0(')21
x C*%+0"#C@"%+"$2!3$)(!2+,(/$2>!20(,.0('1;)
#(6$5"%+"6:%*" 88Q,"L$G11":(A$")$A86$)"*$A$5(1"E:(96$5*"68"6:$"*3 d$E6"8&":8L"68"L5%6$"(
)%(191(+"3*%+0"65()%6%8+(1")%(191(+"*!+6(\"R !"&(5"6:$".8*6"98931(5"E:8%E$S?"F+E$"!83
1$(5+"6:%*"1(+03(0$,"%6"*:831)" $"&(%51!"$(*!"68"65(+*%6%8+"68"@[#"85"#C@,"*:831)"!83
)$*%5$?

಩ M86"E(11")$6(%1"5$E85)*"R7^2*S," 36"5(6:$5"(3)%8"5$E85)%+0*"8&"E(11*"0$+$5(6$)" !"6:$"MixMonitor()"(+)"5$1(6$)


(991%E(6%8+*?

The Dialplan | 25
Hardware
@*6$5%*Q"%*"E(9( 1$"8&"E8..3+%E(6%+0"L%6:"("A(*6"+3. $5"8&")%&&$5$+6"6$E:+8180%$*?"H+
0$+$5(1,"6:$*$"E8++$E6%8+*"(5$".()$"(E58**"("+$6L85Q"E8++$E6%8+q":8L$A$5,"E8++$EX
6%8+*" 68" .85$" 65()%6%8+(1" 6$1$E8." 6$E:+8180%$*," *3E:" (*" 6:$" BDZM," 5$e3%5$" *9$E%&%E
:(5)L(5$?
'(+!"E8.9(+%$*"958)3E$"6:%*":(5)L(5$,"*3E:"(*"^%0%3."R6:$"*98+*85,"8L+$5,"(+)
95%.(5!" )$A$189$5" 8&" @*6$5%*QS," D(+08.(," 2:%+8," F9$+/8\," B%Q(," /8%E$658+%\,
-3+0:(++*,"^%(180%E,"f85E8.," $58M$6,"(+)".(+!"86:$5*?"Z:$"(36:85*"95$&$5"E(5)*
&58."^%0%3."(+)"D(+08.(q":8L$A$5,"6:$"958)3E6*"8&&$5$)" !"86:$5"@*6$5%*Q":(5)L(5$
.(+3&(E635$5*".(!" $".85$"*3%6( 1$"68"!835"5$e3%5$.$+6*?
Z:$" .8*6" 98931(5" :(5)L(5$" &85" @*6$5%*Q" %*" 0$+$5(11!" )$*%0+$)" 68" L85Q" 6:5830:" 6:$
^%0%3."@*6$5%*Q"K(5)L(5$"^$A%E$"H+6$5&(E$"RQ+8L+"(*"^@K^HS?"Z:$*$"E(5)*"L%11"(11
:(A$")%&&$5$+6"%+*6(11(6%8+"5$e3%5$.$+6*"(+)")%&&$5$+6"&%1$"18E(6%8+*?
H+"7:(96$5"P,"L$"L%11")%*E3**"^@K^H"%+".85$")$6(%1q":8L$A$5,"L$"L%11"1%.%6"835")%*X
E3**%8+"68"^@K^H"8+1!?"g83"L%11"+$$)"68"5$&$5"68"6:$"*9$E%&%E")8E3.$+6(6%8+"958A%)$)
!"6:$".(+3&(E635$5*"8&"(+!"E(5)*"!83"%+*6(11"&85")$6(%1*"8+"6:8*$"E(5)*?

Asterisk Versioning
Z:$"@*6$5%*Q"5$1$(*$".$6:8)8180!":(*"08+$"6:5830:"("E8391$"8&"%6$5(6%8+*"8A$5"6:$"1(*6
&$L"!$(5*,"(+)"6:%*"*$E6%8+"%*")$*%0+$)"68":$19"!83"3+)$5*6(+)"L:(6"6:$"A$5*%8+"+3. $5*
.$(+?" F&" 9(56%E31(5" 5$1$A(+E$" %*" 6:$" E:(+0$" %+" A$5*%8+%+0" 6:(6" :(99$+$)" L%6:" 6:$
>?`?>" *$5%$*" 8&" 5$1$(*$*," L:%E:" &8118L$)" (" )%&&$5$+6" +3. $5%+0" 180%E" 6:(+" (11" 86:$5
@*6$5%*Q"5$1$(*$*"R>?="68">?W"(+)"8+L(5)"&85"6:$"&85$*$$( 1$"&3635$S?

Previous Release Methodologies


_:$+"L$":()"d3*6"@*6$5%*Q">?<"(+)">?O,"(11"+$L")$A$189.$+6"L(*"E(55%$)"836"%+"653+Q
R%6"*6%11"%*S,"(+)"8+1!" 30"&%\$*"L$+6"%+68"6:$">?<"(+)">?O" 5(+E:$*?"Z:$"@*6$5%*Q">?<
5(+E:":(*" $$+".(5Q$)"(*"[F#"R[+)"8&"#%&$S,"(+)"%*"+8"18+0$5"5$E$%A%+0" 30"&%\$*"85
*$E35%6!"39)(6$*?"B5%85"68"6:$">?`?>" 5(+E:$*," 30"&%\$*"L$5$"E(55%$)"836"8+1!"%+"653+Q
(+)"%+"6:$">?O" 5(+E:?
4$E(3*$"(11"+$L")$A$189.$+6"L(*")8+$"%+"653+Q,"3+6%1"6:$">?`" 5(+E:"L(*"E5$(6$)"9$891$
L$5$"3+( 1$"68"0$6"(EE$**"68"6:$"+$L"&$(635$*"(+)"&3+E6%8+(1%6!?"Z:%*"%*+G6"68"*(!"6:$
+$L"&3+E6%8+(1%6!"L(*+G6"(A(%1( 1$," 36"L%6:"(11"6:$"E:(+0$*"6:(6"E(+":(99$+"%+"653+Q,
53++%+0"("958)3E6%8+"*$5A$5" (*$)"8+"%6"5$e3%5$*"("A$5!"@*6$5%*QX*(AA!"R(+)"7"E8)$r
*(AA!S"().%+%*65(685?
Z8"65!"68"5$1%$A$"6:$"95$**35$"8+"().%+%*65(685*,"(+)"68"$+( 1$"&(*6$5"(EE$**"68"+$L
&$(635$*"R%+"6:$"6%.$"&5(.$"8&".8+6:*,"(+)"+86"!$(5*S,"("+$L".$6:8)8180!"L(*"E5$(6$)?
45(+E:$*"%+">?`"L831)"(E63(11!" $".(5Q$)"(*">?`?=,">?`?>,">?`?<,"$6E?,"L%6:"6:$"6:%5)

26 | Chapter 2:ಗAsterisk Architecture


+3. $5"%+E5$(*%+0" !"8+$"$(E:"6%.$"("+$L"&$(635$"5$1$(*$"L(*"E5$(6$)?"Z:$"08(1"L(*
68" 958A%)$" +$L" &$(635$" 5$1$(*$*" $A$5!" YrO" .8+6:*" RL:%E:" L831)" $" 5(+E:$)" &58.
653+QS,"958A%)%+0"("*:856$5"(+)"E1$(5$5"3905()$"9(6:"&85"().%+%*65(685*?"H&"!83"+$$)$)
("+$L"&$(635$,"!83G)"8+1!":(A$"68"L(%6"("&$L".8+6:*"(+)"E831)"6:$+"3905()$"68"6:$
+$\6" 5(+E:?
Z(0*"&58."6:$*$" 5(+E:$*"188Q"1%Q$"6:%*V
x >?`?=?>"XX">?`?=?<"XX">?`?=?Y"XX">?`?=?O"XX"$6E?
x >?`?>?>"XX">?`?>?<"XX">?`?>?Y"XX">?`?>?O"XX"$6E?
x >?`?<?>"XX">?`?<?<"XX">?`?<?Y"XX">?`?<?O"XX"$6E?
T%035$"<X<"0%A$*"("A%*3(1"5$95$*$+6(6%8+"8&"6:$" 5(+E:%+0"(+)"6(00%+0"958E$**"%+"5$1(6%8+
68"@*6$5%*Q"653+Q?

=,F;+26CbC'67 265(!2+,(/6@'J'>6+212)(26"+.32((

D8,"*8"&(5"L$":(A$" 5(+E:$*,"L:%E:"(5$">?<,">?O,">?`?=,">?`?>,"(+)">?`?<"R6:$5$"%*"+8">?`
5(+E:S?" _%6:%+" $(E:" 8&" 6:8*$" 5(+E:$*," L$" E5$(6$" !)F(" R5$1$(*$*S," L:%E:" 188Q" 1%Q$
>?<?>O,">?O?Y=,">?`?=?><,">?`?>?><,"(+)">?`?<?>I?
C+&8563+(6$1!,"%6"$+)$)"39"+86"L85Q%+0"836"6:(6">?`?>" 5(+E:$*"L$5$"E5$(6$)"&58."653+Q
$A$5!"YrO".8+6:*V"6:$")$A$189.$+6"958E$**":(*"1$)"68"(".%+%.3."5$1$(*$"6%.$"8&"`rW
.8+6:*?"M86"8+1!"6:(6," 36"6:$">?`?>"+3. $5%+0".$6:8)8180!"())*"958 1$.*"8&"%6*
8L+?"B$891$"086"E8+&3*$)"(*"68"L:(6"A$5*%8+"68"53+,"(+)"6:(6"6:$">?`?=,">?`?>,"(+)">?`?<
5(+E:$*"L$5$"(11"*$9(5(6$".(d85"A$5*%8+"3905()$*?"_:$+"!83"%+E5$(*$"6:$"+3. $5
&58.">?<"68">?O,"(+)"6:$+"68">?W,"%6"%*"8 A%83*"6:(6"6:8*$"(5$")%*6%+E6" 5(+E:$*"(+)".(d85
A$5*%8+"E:(+0$*?"_%6:">?`?=,">?`?>,"(+)">?`?<,"%6"%*"1$**"8 A%83*?

The New Release Methodology


Z:$")$A$189.$+6"6$(."1$(5+$)"("186"8&"6:%+0*")35%+0"6:$">?`?>"5$1$(*$*?"Z:$"%)$("*35X
583+)%+0"6:$"5$1$(*$*"L(*"+8 1$," 36"6:$"%.91$.$+6(6%8+"$+)$)"39" $%+0"&1(L$)"L:$+
936"%+68"5$(1"3*$?"D8,"L%6:"@*6$5%*Q">?W,"6:$".$6:8)8180!":(*"E:(+0$)"(0(%+,"(+)"L%11
188Q"("186".85$"1%Q$"6:(6"3*$)"%+"6:$">?<"(+)">?O"5$1$(*$*?

Asterisk Versioning | 27
_:%1$"6:$")$A$189.$+6"6$(."*6%11"L(+6*"68"958A%)$"(EE$**"68"+$L"&$(635$*"(+)"E85$
E:(+0$*"8+"(".85$"5$031(5" (*%*"R$A$5!"><".8+6:*" $%+0"6:$"08(1S,"6:$5$"%*"5$E80+%6%8+
6:(6"%6"%*"(1*8"088)"68"958A%)$"18+0X6$5."*399856"68"("*6( 1$,"98931(5"A$5*%8+"8&"@*6$5%*Q?
g83"E(+"6:%+Q"8&"6:$"@*6$5%*Q">?O" 5(+E:"(*" $%+0"("18+0X6$5."*399856"R#ZDS"A$5*%8+?
Z:$">?`?=,">?`?>,"(+)">?`?<" 5(+E:$*"E(+" $"6:830:6"8&"(*"&$(635$"5$1$(*$*"6:(6"E8+6%+3$
68"5$E$%A$" 30"&%\$*"(&6$5"5$1$(*$," 36"(5$"*399856$)"&85"("*:856$5"9$5%8)"8&"6%.$"R( 836
("!$(5S?"Z:$"+$L"#ZD"A$5*%8+"%*"@*6$5%*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%+%8+,":(*"(E:%$A$)"5$.(5Q( 1$" (1(+E$" $6L$$+"&1$\% %1%6!"(+)"E8.91$\%6!?

28 | Chapter 2:ಗAsterisk Architecture


CHAPTER 3
Installing Asterisk

E61.0F6!.6)33.%"1,( 6F+2)!6)0<60.-126!)(/(A6-;!6,!6,(6%&
3 ,2*6<;!&6!.6)33.%"1,( 6 ;%-126!)(/(6)(6! .;F 6! 2&
Z2+26F+2)!6)0<60.-12'67 26Z.+1<6,(6%.92<6)1.0FA60.!
.01&6-&6! 26%,F !&6( .92(6.*6,!(6 2+.2(A6-;!6)1(.6-&6! 2
)FF+2F)!26.*6! 26!,0&6";( 2(6.*62)3 6 .02(!6Z.+/2+'
iK$1$+"]$11$5

H+"6:%*"E:(96$5"L$G5$"08%+0"68"L(1Q"6:5830:"6:$"%+*6(11(6%8+"8&"@*6$5%*Q"&58."6:$"*835E$
E8)$?"'(+!"9$891$"*:!"(L(!"&58."6:%*".$6:8),"E1(%.%+0"6:(6"%6"%*"688")%&&%E316"(+)"6%.$X
E8+*3.%+0?"F35"08(1":$5$"%*"68")$.8+*65(6$"6:(6"%+*6(11%+0"@*6$5%*Q"&58."*835E$"%*"+86
(E63(11!"6:(6")%&&%E316"68")8?"'85$"%.9856(+61!,"L$"L(+6"68"958A%)$"!83"L%6:"6:$" $*6
@*6$5%*Q"91(6&85."8+"L:%E:"68"1$(5+?
H+"6:%*" 88Q"L$"L%11" $":$19%+0"!83" 3%1)"("&3+E6%8+%+0"@*6$5%*Q"*!*6$."&58."*E5(6E:?
H+"6:%*"E:(96$5"!83"L%11" 3%1)"(" (*$"91(6&85."&85"!835"@*6$5%*Q"*!*6$.?"J%A$+"6:(6"L$
(5$"%+*6(11%+0"&58."*835E$,"6:$5$"%*"986$+6%(11!"("186"8&"A(5%(6%8+"%+":8L"!83"E(+")8"6:%*?
Z:$"958E$**"L$")%*E3**":$5$"%*"8+$"6:(6"L$GA$"3*$)"&85".(+!"!$(5*,"(+)"&8118L%+0"%6"L%11
958A%)$"!83"L%6:"("*3%6( 1$"&83+)(6%8+"&85"@*6$5%*Q?
@*"9(56"8&"6:%*"958E$**"L$"L%11"(1*8"$\91(%+"%+*6(11(6%8+"8&"*8.$"8&"6:$"*8&6L(5$")$X
9$+)$+E%$*"8+"6:$"#%+3\"91(6&85."6:(6"L%11" $"+$$)$)"&85"689%E*"E8A$5$)"1(6$5"%+"6:%*
88Q"R*3E:"(*")(6( (*$"%+6$05(6%8+S?"_$"L%11"*:8L"%+*653E6%8+*"&85"%+*6(11%+0"@*6$5%*Q
8+" 86:"7$+6FD"R("2$)"K(6r (*$)")%*65% 36%8+S"(+)"C 3+63"R("^$ %(+X (*$)")%*65%X
36%8+S,"L:%E:"L$" $1%$A$"E8A$5*"6:$"A(*6".(d85%6!"8&"#%+3\")%*65% 36%8+*" $%+0"%+*6(11$)
68)(!?"_$G11"65!"68"Q$$9"6:$"%+*653E6%8+*"0$+$5(1"$+830:"6:(6"6:$!"*:831)" $"3*$&31"8+
(+!")%*65% 36%8+"8&"!835"E:8%E$?s

s H&"!83"(5$"3*%+0"(+86:$5")%*65% 36%8+,"L$G5$"L%11%+0"68" $6"!83"(5$"e3%6$"E8.&856( 1$"L%6:"#%+3\"(+)"*:831)


:(A$"+8"6583 1$"%+*6(11%+0"@*6$5%*Q?

29
_$":(A$"E:8*$+"68"%+*6(11"8+"7$+6FD"(+)"C 3+63" $E(3*$"6:$!"(5$"6:$".8*6"98931(5
896%8+*," 36" @*6$5%*Q" %*" 0$+$5(11!" )%*65% 36%8+X(0+8*6%E?" @*6$5%*Q" L%11" $A$+" %+*6(11" 8+
D81(5%*,"4D^,"85"FD"ft"%&"!83"1%Q$?"_$"L8+G6" $"E8A$5%+0"6:$."%+"6:%*" 88Q,"6:830:,"(*
@*6$5%*Q"%*".8*6":$(A%1!")$A$189$)"8+"6:$"#%+3\"91(6&85.?

Asterisk Packages
Z:$5$" (5$" (1*8" 9(EQ(0$*" 6:(6" $\%*6" &85" @*6$5%*Q" 6:(6" E(+" $" %+*6(11$)" 3*%+0" 98931(5
9(EQ(0$X.(+(0$.$+6"95805(.*"*3E:"(*"&;%"85")"!bF2!?"g83"(5$"L$1E8.$"68"$\9$5%.$+6
L%6:"6:$.?"B5$ 3%16"9(EQ(0$*".(!"+86"(1L(!*" $"Q$96"39X68X)(6$,"6:830:,"*8"&85"6:$
1(6$*6"A$5*%8+"L$"(1L(!*"5$E8..$+)"%+*6(11%+0"&58."*835E$?
g83"E(+"&%+)"9(EQ(0$"%+*653E6%8+*"(6" !!"#$$ZZZ')(!2+,(/'.+F$<.Z01.)<($&;%?

D8.$"E8..(+)*"!83"*$$"%+"6:%*"E:(96$5"L%11" $"*91%6"%+68"*$9(5(6$"58L*,"$(E:"1( $1$)


&85"6:$")%*65% 36%8+"8+"L:%E:"6:$"E8..(+)"*:831)" $"9$5&85.$)?"78..(+)*"&85"L:%E:
)%*65% 36%8+*"(5$"+86"*9$E%&%$)"(5$"&85"E8..8+"E8..(+)*"6:(6"E(+" $"53+"8+" 86:
)%*65% 36%8+*?

Asterisk-Based Projects
'(+!"958d$E6*":(A$" $$+"E5$(6$)"6:(6"3*$"@*6$5%*Q"(*"6:$%5"3+)$51!%+0"91(6&85.?"D8.$
8&"6:$*$,"*3E:"(*"Z5%\ 8\,":(A$" $E8.$"*8"98931(5"6:(6".(+!"9$891$".%*6(Q$"6:$."&85
6:$"@*6$5%*Q"958)3E6"%6*$1&?"Z:$*$"958d$E6*"0$+$5(11!"L%11"6(Q$"6:$" (*$"@*6$5%*Q"958)3E6
(+)"())"("L$ X (*$)"().%+%*65(6%8+"%+6$5&(E$,"("E8.91$\")(6( (*$,"(+)"("5%0%)"*$6"8&
E8+*65(%+6*"8+":8L"E:(+0$*"E(+" $".()$"68"6:$"E8+&%035(6%8+?
_$":(A$"E:8*$+"+86"68"E8A$5"6:$*$"958d$E6*"%+"6:%*" 88Q,"&85"*$A$5(1"5$(*8+*V
>? Z:%*" 88Q"65%$*,"(*".3E:"(*"98**% 1$,"68"&8E3*"8+"@*6$5%*Q"(+)"8+1!"@*6$5%*Q?
<? 488Q*":(A$"(15$()!" $$+"L5%66$+"( 836"*8.$"8&"6:$*$"@*6$5%*QX (*$)"958d$E6*?
Y? _$" $1%$A$"6:(6"%&"!83"1$(5+"@*6$5%*Q"%+"6:$"L(!"6:(6"L$"L%11"6$(E:"!83,"6:$"Q+8L1X
$)0$"L%11"*$5A$"!83"L$11,"5$0(5)1$**"8&"L:$6:$5"!83"$A$+63(11!"E:88*$"68"3*$"8+$
8&"6:$*$"95$9(EQ(0$)"A$5*%8+*"8&"@*6$5%*Q?
O? T85"3*,"6:$"98L$5"8&"@*6$5%*Q"%*"6:(6"%6")8$*"+86"(66$.96"68"*81A$"!835"958 1$.*"&85
!83?"Z:$*$"958d$E6*"(5$"(+"$\E$11$+6"$\(.91$"8&"L:(6"E(+" $" 3%16"L%6:"@*6$5%*Q?
Z:$!"(5$"6531!"(.(h%+0?"K8L$A$5,"%&"!83"(5$"188Q%+0"68" 3%1)"!835"8L+"@*6$5%*Q
(991%E(6%8+"RL:%E:"%*"5$(11!"L:(6"@*6$5%*Q"%*"(11"( 836S,"6:$*$"958d$E6*"L%11"%.98*$
1%.%6(6%8+*"8+"!83," $E(3*$"6:$!"(5$"&8E3*$)"8+"*%.91%&!%+0"6:$"958E$**"8&" 3%1)%+0
(" 3*%+$**"B4f,"+86"8+".(Q%+0"%6"$(*%$5"68"(EE$**"6:$"&311"986$+6%(1"8&"6:$"@*6$5%*Q
91(6&85.?

t #$%&"E(11*"6:%*"jF:X[:XD$\,k" 36"-%."6:%+Q*"%6"*:831)" $"958+83+E$)"jFD"Z$+?k"_$"L(*6$)"*$A$5(1"95$E%83*


.%+36$*"(503%+0"( 836"6:%*?

30 | Chapter 3:ಗInstalling Asterisk


D8.$"8&"6:$".8*6"98931(5"@*6$5%*QX (*$)"958d$E6*"%+E13)$V

AsteriskNOW http://www.asterisk.org/asterisknow
Trixbox http://www.trixbox.org
Elastix http://www.elastix.org
PBX in a Flash http://www.pbxinaflash.net

_$"5$E8..$+)"6:(6"!83"E:$EQ"6:$."836?u

Installation Cheat Sheet


H&"!83"d3*6"L(+6"6:$"+%66!X05%66!"8+":8L"68"0$6"@*6$5%*Q"39"(+)"53++%+0"e3%EQ1!,"9$5&85.
6:$"&8118L%+0"(6"6:$"*:$11"958.96?"_$"$+E835(0$"!83"68"5$()"6:5830:"6:$"$+6%5$"E:(96$5
(6"1$(*6"8+E$,"6:830:,"%+"85)$5"68" $66$5"3+)$5*6(+)"6:$"&311"958E$**?v
Z:$" %+*653E6%8+*" 958A%)$)" :$5$" (**3.$" !83GA$" (15$()!" %+*6(11$)" $%6:$5" 7$+6FD" 85
C 3+63"3*%+0"6:$"*6$9*"8361%+$)"%+"j^%*65% 36%8+"H+*6(11(6%8+k"8+"9(0$"YI?

2$.$. $5"6:(6"C 3+63"5$e3%5$*"E8..(+)*"68" $"95$&%\$)"L%6:"(;<.?

>? B$5&85."("*!*6$."39)(6$"(+)"5$ 886V

CentOS yum update -y && reboot


CentOS 64-bit yum remove *.i386 && yum update -y && reboot
Ubuntu sudo apt-get update && sudo apt-get upgrade && sudo reboot
<? D!+E:58+%h$"6%.$"(+)"%+*6(11"6:$"MZB"RM$6L85Q"Z%.$"B5868E81S")($.8+V

CentOS yum install -y ntp && ntpdate pool.ntp.org && chkconfig ntpd \
on && service ntpd start
CentOS 64-bit yum install -y ntp && ntpdate pool.ntp.org && chkconfig ntpd \
on && service ntpd start
Ubuntu sudo apt-get install ntp

u @&6$5"!83"5$()"835" 88Q,"8&"E835*$?
v F+E$"!83":(A$"$\9$5%$+E$"L%6:"*$A$5(1"@*6$5%*Q"%+*6(11(6%8+*,"!83G11"(05$$"6:(6"%6G*"("e3%EQ"(+)"9(%+1$**"958E$**?
M$A$56:$1$**,"6:%*"E:(96$5".(!".(Q$"6:$"958E$**"188Q"E8.91$\?"Z:%*"%*"*%.91!" $E(3*$"L$":(A$"(+"8 1%0(6%8+
68"$+*35$"!83"(5$"958A%)$)"L%6:"(11"6:$"%+&85.(6%8+"!83"+$$)"68"(EE8.91%*:"("*3EE$**&31"%+*6(11?

Installation Cheat Sheet | 31


D8.$"())%6%8+(1"E8+&%035(6%8+"8&"6$\6"&%1$*"%*"5$e3%5$)"8+"C 3+63?
D$$"j[+( 1$"MZB"&85"(EE35(6$"*!*6$."6%.$k"8+"9(0$"OY?

Y? F+"7$+6FD,"())"("+$L"*!*6$."3*$5V

CentOS (32 and 64 bit) adduser asteriskpbx && passwd asteriskpbx && yum install \
sudo && visudo

D$$"j@))%+0"("*!*6$."3*$5k"8+"9(0$"YN"&85"*9$E%&%E"%+&85.(6%8+?

T85"(+"C 3+63"%+*6(11,"L$"(5$"(**3.%+0"6:(6"6:$"3*$5"E5$(6$)")35%+0
6:$"%+*6(11(6%8+"958E$**"%*")(!2+,(/"->?

O? H+*6(11"*8&6L(5$")$9$+)$+E%$*V

CentOS sudo yum install gcc gcc-c++ make wget subversion \


libxml2-devel ncurses-devel openssl-devel \
vim-enhanced
CentOS 64-bit sudo yum install gcc.x86_64 gcc-c++.x86_64 \
make.x86_64 wget.x86_64 subversion.x86_64 \
libxml2-devel.x86_64 ncurses-devel.x86_64 \
openssl-devel.x86_64 vim-enhanced.x86_64
Ubuntu sudo apt-get install build-essential subversion \
libncurses5-dev libssl-dev libxml2-dev vim-nox
I? 75$(6$"!835")%5$E685!"*653E635$V
$ mkdir -p ~/src/asterisk-complete/asterisk
$ cd ~/src/asterisk-complete/asterisk
`? J$6"6:$"1(6$*6"*835E$"E8)$"A%("D3 A$5*%8+V
$ svn co http://svn.asterisk.org/svn/asterisk/branches/1.8

F5"(16$5+(6%A$1!,"!83"E831)"E:$EQ"836"("*9$E%&%E"6(0V
$ svn co http://svn.asterisk.org/svn/asterisk/tags/1.8.1
P? 43%1)"(+)"%+*6(11"6:$"*8&6L(5$V
$ cd ~/src/asterisk-complete/asterisk/1.8/
$ ./configure

32 | Chapter 3:ಗInstalling Asterisk


$ make
$ sudo make install
$ sudo make config
W? H+*6(11"())%6%8+(1"*83+)"958.96*"&58."%20;(2123!V
$ cd ~/src/asterisk-complete/asterisk/1.8/
$ make menuselect
$ sudo make install
N? '8)%&!"6:$"&%1$"9$5.%**%8+*"8&"6:$")%5$E685%$*"@*6$5%*Q"L(*"%+*6(11$)"68V
$ sudo chown -R asteriskpbx:asteriskpbx /usr/lib/asterisk/
$ sudo chown -R asteriskpbx:asteriskpbx /var/lib/asterisk/
$ sudo chown -R asteriskpbx:asteriskpbx /var/spool/asterisk/
$ sudo chown -R asteriskpbx:asteriskpbx /var/log/asterisk/
$ sudo chown -R asteriskpbx:asteriskpbx /var/run/asterisk/
$ sudo chown asteriskpbx:asteriskpbx /usr/sbin/asterisk
>=? F+"7$+6FD,")%*( 1$"D[#%+3\V
$ sudo vim /etc/selinux/config

7:(+0$"6:$"A(13$"8&"SELINUX"&58."enforcing"68"disabled,"6:$+"+2-..!?
>>? 75$(6$"6:$"$2!3$)(!2+,(/$")%5$E685!"(+)"E89!"6:$",0<,3)!,.0('3.0*"*(.91$"&%1$"%+68"%6V
$ sudo mkdir -p /etc/asterisk
$ sudo chown asteriskpbx:asteriskpbx /etc/asterisk
$ cd /etc/asterisk/
$ cp ~/src/asterisk-complete/asterisk/1.8/configs/indications.conf.sample \
./indications.conf
><? 789!"6:$"*(.91$")(!2+,(/'3.0*"&%1$"%+68"$2!3$)(!2+,(/"(+)"E:(+0$" runuser"(+)" run
group"68":(A$"A(13$*"8&"asteriskpbxV
$ cp ~/src/asterisk-complete/asterisk/1.8/configs/asterisk.conf.sample \
/etc/asterisk/asterisk.conf
$ vim /etc/asterisk/asterisk.conf

D$$"j%+)%E(6%8+*?E8+&"(+)"(*6$5%*Q?E8+&k"8+"9(0$"IY"&85".85$"%+&85.(6%8+?
>Y? 75$(6$"6:$"%.<;12('3.0*"&%1$?"[+( 1$"18()%+0"8&".8)31$*"(368.(6%E(11!,"(+)")%*( 1$
$\65(".8)31$*V
$ cat >> /etc/asterisk/modules.conf

; The modules.conf file, used to define which modules Asterisk should load (or
; not load).
;
[modules]
autoload=yes

; Resource modules currently not needed


noload => res_speech.so
noload => res_phoneprov.so
noload => res_ael_share.so
noload => res_clialiases.so
noload => res_adsi.so

Installation Cheat Sheet | 33


; PBX modules currently not needed
noload => pbx_ael.so
noload => pbx_dundi.so

; Channel modules currently not needed


noload => chan_oss.so
noload => chan_mgcp.so
noload => chan_skinny.so
noload => chan_phone.so
noload => chan_agent.so
noload => chan_unistim.so
noload => chan_alsa.so

; Application modules currently not needed


noload => app_nbscat.so
noload => app_amd.so
noload => app_minivm.so
noload => app_zapateller.so
noload => app_ices.so
noload => app_sendtext.so
noload => app_speech_utils.so
noload => app_mp3.so
noload => app_flash.so
noload => app_getcpeid.so
noload => app_setcallerid.so
noload => app_adsiprog.so
noload => app_forkcdr.so
noload => app_sms.so
noload => app_morsecode.so
noload => app_followme.so
noload => app_url.so
noload => app_alarmreceiver.so
noload => app_disa.so
noload => app_dahdiras.so
noload => app_senddtmf.so
noload => app_sayunixtime.so
noload => app_test.so
noload => app_externalivr.so
noload => app_image.so
noload => app_dictate.so
noload => app_festival.so

Ctrl + D
>O? 78+&%035$"%;(,3.0 .1<'3.0*V
$ cat >> musiconhold.conf

; musiconhold.conf
[default]
mode=files
directory=moh

Ctrl + D

34 | Chapter 3:ಗInstalling Asterisk


>I? D(A$"!835"E:(+0$*"(+)"!835".8)31$"E8+&%035(6%8+"%*")8+$?"g835"*!*6$."%*"5$()!
68"E8+&%035$"!835")%(191(+"(+)"E:(++$1*?

Distribution Installation
4$E(3*$"@*6$5%*Q"5$1%$*"*8":$(A%1!"8+":(A%+0"95%85%6!"(EE$**"68"6:$"7BC,"%6"%*"$**$+6%(1
6:(6"!83"%+*6(11"@*6$5%*Q"8+68"("*$5A$5"L%6:836"(+!"05(9:%E(1"%+6$5&(E$,"*3E:"(*"6:$"f
_%+)8L%+0"*!*6$."RJ+8.$,"]^[,"$6E?S?"486:"7$+6FD"(+)"C 3+63"*:%9"("JCHX&5$$
)%*65% 36%8+")$*%0+$)"&85"*$5A$5"3*(0$?"_$"L%11"E8A$5"%+*653E6%8+*"&85" 86:")%*65% 36%8+*?

CentOS Server
7$+6FD".$(+*"j78..3+%6!"[+6$595%*$"F9$5(6%+0"D!*6$.,k"(+)"%6"%*" (*$)"8+"2$)"K(6
[+6$595%*$"#%+3\"R2K[#S?"T85".85$"%+&85.(6%8+"( 836"L:(6"7$+6FD"%*"(+)"%6*":%*685!,
*$$" !!"#$$ZZZ'320!.('.+F?
g83"L%11"+$$)"68")8L+18()"(+"HDF"&58."6:$"7$+6FD"L$ *%6$,"18E(6$)"(6" !!"#$$%,++.+
'320!.('.+F$320!.($H$,(.($?"D$1$E6"$%6:$5"6:$",DNJ"85">NJhJG")%5$E685!"&85"Y<X %6"85"`OX %6
:(5)L(5$,"5$*9$E6%A$1!?"g83"L%11"6:$+" $"95$*$+6$)"L%6:"("1%*6"8&".%5585*"6:(6"(99$(5"68
$"E18*$"68"!83"9:!*%E(11!?"7:88*$"8+$"8&"6:$".%5585*,"(+)"!83"L%11" $"95$*$+6$)"L%6:
("1%*6"8&"&%1$*"68")8L+18()?"#%Q$1!"!83"L%11"L(+6"6:$"&%5*6"(A(%1( 1$"*$1$E6%8+,"L:%E:"%*"6:$
&%5*6"HDF"&%1$"8&"("*$6?"g83"L%11"8+1!"+$$)"6:$"&%5*6"HDF"&%1$"8&"6:$"*$6"(*"L$G11" $"%+*6(11%+0
())%6%8+(1"*8&6L(5$"L%6:"&;%?
F+E$"!83GA$")8L+18()$)"6:$"HDF"&%1$," 35+"%6"68"("7^"85"^/^"(+)"*6(56"6:$"%+*6(11(6%8+
958E$**?"H&"!83G5$"%+*6(11%+0"%+68"("A%563(1".(E:%+$"RL:%E:"L$")8+G6"5$E8..$+)"&85
958)3E6%8+"3*$,಩" 36"E(+" $"("05$(6"L(!"68"6$*6"836"@*6$5%*QS,"!83"*:831)" $"( 1$"68
.83+6"6:$"HDF"&%1$")%5$E61!"(+)"%+*6(11"&58."6:$5$?

Base system installation


C98+" 886%+0"&58."6:$"7^,"6!9$"1,0;>6!2>!"(+)"6:$+"95$**" [+6$5 ?w
@6"6:%*"98%+6"6:$"6$\6"%+*6(11(6%8+"%+6$5&(E$"L%11"*6(56?"g83"L%11" $"(*Q$)"L:$6:$5"!83
L(+6"68"6$*6"6:$".$)%(?"Z:$*$"%+*653E6%8+*"(**3.$"!83GA$"(15$()!")8+$"*8,"(+)"6:$5$&85$
E(+"*Q%9"6:(6"*6$9?
7$+6FD"L%11"6:$+"L$1E8.$"!83"68"6:$"%+*6(11(6%8+?"B5$**" [+6$5 "68"E8+6%+3$?

಩ @E63(11!,"*8.$"9$891$":(A$"05$(6"*3EE$**"53++%+0"@*6$5%*Q"%+*%)$"A%563(1".(E:%+$*?"H6")8$*")$9$+)"L:(6"!83G5$
91(++%+0"8+"3*%+0"%6"&85"6:830:,"(*"!83G11":(A$"1%.%6$)"(EE$**"68":(5)L(5$,"&85"$\(.91$?
wg83"*:831)"6$*6"6:$".$)%("6:$"&%5*6"6%.$"!83"(5$"3*%+0"6:(6"9(56%E31(5"7^U^/^?

Distribution Installation | 35
7:88*$"!835"1(+03(0$"(+)".(Q$"("Q$! 8(5)"*$1$E6%8+?s"H&"!83G5$"%+"M856:"@.$5%E(,"!83
L%11"958 ( 1!"d3*6"*$1$E6"6:$")$&(316*?
H&"!83GA$"95$A%83*1!"&85.(66$)"!835":(5)")5%A$,"!83"L%11" $"(*Q$)"68"%+%6%(1%h$"6:$")5%A$,
L:%E:"L%11"$5(*$"(11")(6(?"D$1$E6" g$* ?
Z:$"%+*6(11$5"L%11"(*Q"%&"!83"L(+6"68"5$.8A$"6:$"$\%*6%+0"9(56%6%8+%+0"*E:$.$"(+)"E5$(6$
("+$L"8+$?"D$1$E6"B2%.926)116")+!,!,.0(6.06(2123!2<6<+,92(6)0<63+2)!26<2*);1!61)&.;!?"H&"(
.85$"(995895%(6$"896%8+"$\%*6*,"*$1$E6"6:(6"%+*6$()?"H+"6:$")5%A$"L%+)8L,"A$5%&!"6:(6"6:$
E855$E6")%*Q")5%A$"%*"*$1$E6$)?"RB5$**%+0" Z( "L%11"E!E1$"6:5830:"6:$"*$1$E6%8+*"8+"6:$
*E5$$+?S"F+E$"6:$")5%A$"L%+)8L"%*"*$1$E6$),"!83"E(+"*E5811"39"(+)")8L+"R95$*3.%+0
!83":(A$".316%91$")5%A$*S"(+)"*$1$E6"L:%E:":(5)")5%A$"!83"L%*:"68"%+*6(11"68?"Z8001$"6:$
*$1$E6%8+*" !"95$**%+0" *9(E$" (5 ?"/$5%&!"6:(6"6:$"E855$E6")5%A$"%*"*$1$E6$),"95$**" Z(
3+6%1"6:$" F] " 3668+"%*":%0:1%0:6$),"(+)"95$**" [+6$5 ?
@".$**(0$"E8+&%5.%+0"6:(6"!83"L(+6"68"5$.8A$"(11"#%+3\"9(56%6%8+*"(+)"E5$(6$"6:$"+$L
9(56%6%8+"*E:$.$"L%11" $"95$*$+6$)?"D$1$E6" g$* ?
g83"L%11" $"(*Q$)"68"5$A%$L"6:$"9(56%6%8+%+0"1(!836?"T$$1"&5$$"68".8)%&!"6:$"9(56%6%8+
*E:$.$"%&"!83"95$&$5"*8.$6:%+0")%&&$5$+6"R*$$"6:$"&8118L%+0"*%)$ (5"&85"*8.$"()A%E$"8+
6:%*Sq":8L$A$5,"6:$")$&(316"(+*L$5" M8 "%*"&%+$"&85"1%0:6"958)3E6%8+"3*$"L:$5$"*685(0$
5$e3%5$.$+6*"L%11" $"18L?t

Separating the /var Mount Point to Its Own Partition


F+"("*!*6$.")$)%E(6$)"68"@*6$5%*Q,"6:$")%5$E685!"L%6:"6:$"1(50$*6"*685(0$"5$e3%5$.$+6
%*"$9)+?"Z:%*"%*"L:$5$"@*6$5%*Q"L%11"*685$"5$E85)%+0*,"A8%E$.(%1*,"180"&%1$*,"958.96*,"(+)
(".!5%()"8&"E8+*6(+61!"058L%+0"%+&85.(6%8+?"H+"+85.(1"89$5(6%8+,"%6"%*"3+1%Q$1!"6:(6
@*6$5%*Q"L%11"&%11"6:$":(5)")%*Q?"K8L$A$5,"%&"!83":(A$"$\6$+*%A$"1800%+0"635+$)"8+"85"(5$
5$E85)%+0"(11"E(11*,"6:%*"E831),"%+"6:$85!,"8EE35?"RZ:%*"%*"1%Q$1!"68":(99$+"*$A$5(1".8+6:*
(&6$5"!83GA$"E8.91$6$)"6:$"%+*6(11"(+)"68"6(Q$"!835"$+6%5$"*6(&&" !"*3595%*$?S
H&"6:$")5%A$"6:$"89$5(6%+0"*!*6$."%*".83+6$)"8+"&%11*"39,"6:$5$"%*"6:$"986$+6%(1"&85"("Q$5+$1
9(+%E?"4!"*$9(5(6%+0"$9)+"&58."6:$"5$*6"8&"6:$":(5)")5%A$,"!83"*%0+%&%E(+61!"18L$5"6:$"5%*Q
8&"("*!*6$."&(%135$?

K(A%+0"("&311"A813.$"%*"*6%11"(".(d85"958 1$.q":8L$A$5,"!83"L%11"(6
1$(*6" $"( 1$"68"180"%+68"6:$"*!*6$."68"5$E6%&!"6:$"*%63(6%8+?

s 4$(5"%+".%+)"6:(6"@*6$5%*Q"%*")$A$189$)"3*%+0"6:$"CD"Q$! 8(5)"(+)"1(+03(0$,"(+)"L$G5$"+86"(L(5$"8&"(+!
6$*6%+0":(A%+0" $$+")8+$"8+"(+!6:%+0"86:$5"6:(+"CD"[+01%*:?
t ^3$" 68" 6:$" $A$5X%+E5$(*%+0" *%h$" 8&" :(5)" )5%A$*," E(9(E%6!" %*" $E8.%+0" 1$**" 8&" (" 958 1$.?" @" *!*6$." L%6:" (
>"6$5( !6$")5%A$"E(+"*685$"*8.$L:$5$"%+"6:$"5(+0$"8&"<".%11%8+".%+36$*"8&"6$1$9:8+!Xe3(1%6!"5$E85)%+0*?

36 | Chapter 3:ಗInstalling Asterisk


@6"6:$"B29,2Z6)0<6%.<,*&6! 26")+!,!,.0,0F61)&.;!"*E5$$+,"!83"E(+"E5$(6$"("*$9(5(6$"A81X
3.$"&85"$9)+?"D$1$E6%+0" g$* "L%11" 5%+0"39"6:$"S)+!,!,.0,0F"6881?"Z8"9(56%6%8+"6:$")5%A$
(EE35(6$1!,"!83"+$$)"68"Q+8L"L:(6"6:$":(5)")5%A$"*%h$"%*q"6:%*".(!"+86"d% $"L%6:"L:(6
%*"*6(.9$)"8+"6:$"836*%)$"8&"6:$")5%A$" $E(3*$"!83":(A$"68"6$11"6:$"6881":8L"68"E:89"39
6:$")5%A$?"@"1%.%6(6%8+"8&"6:$"6881"%*"6:(6"6:$5$"%*"+8"896%8+"68"*(!"j3*$"(11"(A(%1( 1$
*9(E$kq"6:(6"%*,"!83"E(+G6"*%.91!"E831)"3*$"I=="'4"8+"6:$"$"9(56%6%8+"(+)"6:$+"*(!"j3*$
6:$"5$*6"&85"$9)+k?"Z:$"L85Q(583+)"%*"68".(Q$"("+86$"8&"6:$"*%h$"%6":(*"*$1$E6$)"&85" /
E355$+61!,"(*"6:(6"%*"6:$"&311"*9(E$,"*3 65(E6"I=="'4"&58."6:(6,"(+)".(Q$"6:(6"6:$"*%h$
&85"6:$"/"9(56%6%8+?"Z:$"*3 65(E6$)"(.83+6"L%11"6:$+" $"5$*$5A$)"&85"$9)+?

@".$**(0$"L%11"(99$(5"(*Q%+0"%&"!83G)"1%Q$"68"E8+&%035$"6:$"2! R"+$6L85Q"%+6$5&(E$"8+
!835"*!*6$.?"D$1$E6"g$* ?"4$"*35$"6:$"53!,9)!26.06-..!"(+)"X0)-126ES9G6(;"".+!"896%8+*
(5$"$+( 1$),"6:$+"*$1$E6" F] ?
H&" !835" +$6L85Q" 958A%)$*" (368.(6%E" HB" 958A%*%8+%+0" A%(" ^K7B," !83" E(+" d3*6" *$1$E6
F] ?"F6:$5L%*$,"*$1$E6"Y)0;)16)<<+2((63.0*,F;+)!,.0,"$+6$5"6:$"(995895%(6$"%+&85.(X
6%8+,"(+)"6:$+"*$1$E6" F] ?
M$\6,"!83G11" $"(*Q$)"68"958A%)$"(":8*6+(.$?"g83"E(+"$%6:$5"(118L"6:$"^K7B"*$5A$5"68
958A%)$"8+$"&85"!83"R%&"!835"+$6L85Q"(**%0+*":8*6+(.$*"(368.(6%E(11!S"85"$+6$5"8+$
.(+3(11!,"6:$+"*$1$E6" F] ?
g83"L%11" $"95$*$+6$)"L%6:"("1%*6"8&"6%.$"h8+$*?"K%0:1%0:6"!835"18E(1"6%.$"h8+$"(+)"*$1$E6
F] ?
@6"6:%*"98%+6,"!83"L%11" $"(*Q$)"&85"("5886"9(**L85)?"[+6$5"("*$E35$"9(**L85)"(+)"6!9$
%6"(0(%+"68"E8+&%5.?"@&6$5"$+6$5%+0"!835"*$E35$"9(**L85),"*$1$E6" F] ?
M$\6"39"L%11" $"6:$"9(EQ(0$"*$1$E6%8+?"D$A$5(1"9(EQ(0$*"6:(6"!83")8+G6"+$$)"68"%+*6(11
R(+)"6:(6"5$e3%5$"())%6%8+(1"HDF"&%1$*"!83"958 ( 1!":(A$+G6")8L+18()$)S"(5$"*$1$E6$)
!")$&(316?"^$*$1$E6"(11"896%8+*"%+"6:$"1%*6"3*%+0"6:$" *9(E$" (5,"6:$+"*$1$E6"6:$"?;(!.%,Q2
(.*!Z)+26(2123!,.0"896%8+?"F+E$"!83GA$")8+$"6:(6,"*$1$E6" F] ?
g83"L%11"6:$+" $"95$*$+6$)"L%6:"6:$"S)3/)F26:+.;"6W2123!,.0"*E5$$+?"DE5811"6:5830:"6:$
L:81$"1%*6,")$*$1$E6%+0"$(E:"%6$.?"H&"(+!"9(EQ(0$*"(5$"*$1$E6$),"!83G11" $"958.96$)"&85
())%6%8+(1"7^*"6:(6"!83":(A$"+86")8L+18()$)?"_$G11" $"%+*6(11%+0"())%6%8+(1"9(EQ(0$*
L%6:"6:$"&;%"(991%E(6%8+"(&6$5"6:$"89$5(6%+0"*!*6$."%*"%+*6(11$)?"F+E$"!83GA$")$*$1$E6$)
(11"9(EQ(0$*,"*$1$E6" F] ?
@" )$9$+)$+E!" E:$EQ" L%11" 6:$+" $" 9$5&85.$)" (+)" (" E8+&%5.(6%8+" 6:(6" %+*6(11(6%8+" %*
5$()!"68" $0%+"L%11" $"95$*$+6$)?"D$1$E6"F] "68"*6(56"6:$"%+*6(11(6%8+?"Z:$"&%1$*!*6$."L%11
6:$+" $"&85.(66$),"6:$"%+*6(11(6%8+"%.(0$"65(+*&$55$)"68"6:$":(5)")5%A$,"(+)"%+*6(11(6%8+
8&" 6:$" *!*6$." 9(EQ(0$*" 9$5&85.$)?" C98+" %+*6(11(6%8+," !83" L%11" $" (*Q$)" 68" 5$ 886?
2$.8A$"(+!".$)%("%+"6:$")5%A$*"(+)"*$1$E6"6:$" 2$ 886 " 3668+?

Distribution Installation | 37
Base system update
F+E$"!83GA$"5$ 886$)"!835"*!*6$.,"!83"+$$)"68"53+"6:$"&;%6;"<)!2"E8..(+)"68".(Q$
*35$"!83":(A$"6:$"1(6$*6" (*$"9(EQ(0$*?"Z8")8"6:%*,"180"%+"3*%+0"6:$"3*$5+(.$"+..!"(+)
6:$"9(**L85)"!83"E5$(6$)")35%+0"%+*6(11(6%8+?"F+E$"1800$)"%+,"53+"6:$"&8118L%+0V
# yum update
Is this ok [y/N]: y

_:$+"958.96$)"68"%+*6(11"6:$"1(6$*6"9(EQ(0$*,"95$**" ! "(+)"L(%6"&85"6:$"9(EQ(0$*"68
39)(6$?"H&"!83G5$"(*Q$)"68"(EE$96"("JBJ"Q$!,"95$**"! ?"_:$+"E8.91$6$,"5$ 886"6:$"*!*6$.
(*"%6"%*"1%Q$1!"6:$"Q$5+$1"L%11":(A$" $$+"39)(6$)uV
# reboot

H&"!83G5$"53++%+0"7$+6FD"D$5A$5"`OX %6,"!83G11"+$$)"68"5$.8A$"(11"6:$
Y<X %6"1% 5(5%$*".(+3(11!?"F+E$"!83GA$"5$ 886$),"85"d3*6"95%85"68"5$ 886,
53+"6:$"&8118L%+0"E8..(+)V
# yum remove *.i386 -y

Z:%*"L%11"5$.8A$"(11"6:$"Y<X %6"1% 5(5%$*"8+"!835"`OX %6"*!*6$.,"L:%E:


E(+"86:$5L%*$"E(3*$"E8+&1%E6*"(+)"%**3$*"L:$+"E8.9%1%+0"@*6$5%*Q"(+)
86:$5"*8&6L(5$?

78+05(631(6%8+*p"g83GA$"*3EE$**&311!"%+*6(11$)"(+)"39)(6$)"6:$" (*$"7$+6FD"*!*6$.?

Enabling NTP for accurate system time


]$$9%+0"(EE35(6$"6%.$"%*"$**$+6%(1"8+"!835"@*6$5%*Q"*!*6$.," 86:"&85".(%+6(%+%+0"(EE3X
5(6$"E(11")$6(%1"5$E85)*"(+)"&85"*!+E:58+%h(6%8+"L%6:"!835"86:$5"95805(.*?"g83")8+G6
L(+6"6:$"6%.$*"8&"!835"A8%E$.(%1"+86%&%E(6%8+*"68" $"8&&" !">="85"<=".%+36$*,"(*"6:%*"E(+
1$()"68"E8+&3*%8+"(+)"9(+%E"&58."6:8*$"L:8".%0:6"6:%+Q"6:$%5"A8%E$.(%1"+86%&%E(6%8+*
(5$"6(Q%+0"688Q"688"18+0"68" $")$1%A$5$)?"Z:$"0!"<"E8..(+)"E(+" $"3*$)"68"$+*35$"6:(6
6:$"6%.$"8+"!835"@*6$5%*Q"*$5A$5"5$.(%+*"%+"*!+E"L%6:"6:$"5$*6"8&"6:$"L851)V
# yum install ntp
...
Is this ok [y/N]: y
...
# ntpdate pool.ntp.org
# chkconfig ntpd on
# service ntpd start

Z:$")$&(316*"*:%99$)"L%6:"7$+6FD"(5$"*3&&%E%$+6"68"*!+E:58+%h$"6:$"6%.$"(+)"Q$$9"6:$
.(E:%+$G*"6%.$"%+"*!+E"L%6:"6:$"5$*6"8&"6:$"L851)?

u Z:%*"5$ 886"*6$9"%*"$**$+6%(1"95%85"68"%+*6(11%+0"@*6$5%*Q?

38 | Chapter 3:ಗInstalling Asterisk


Adding a system user
Z:$"C 3+63"*$5A$5"%+*6(11"958E$**"(*Q*"!83"68"())"("*!*6$."3*$5"86:$5"6:(+"5886," 36
7$+6FD")8$*"+86?"H+"85)$5"68" $"E8+*%*6$+6"%+"6:$" 88Q"(+)"68" $".85$"*$E35$,"L$G5$
08%+0"68"())"(+86:$5"*!*6$."3*$5"(+)"958A%)$"%6"(;<."(EE$**?v"Z8"())"6:$"+$L"3*$5,
$\$E36$"6:$")<<;(2+"E8..(+)V
# adduser asteriskpbx
# passwd asteriskpbx
Changing password for user asteriskpbx.
New UNIX password:
Retype new UNIX password:

M8L"L$"+$$)"68"958A%)$"6:$")(!2+,(/"->"3*$5"(;<."(EE$**?"_$")8"6:%*" !".8)%&!%+0"6:$
(;<.2+("&%1$"L%6:"6:$"9,(;<."E8..(+)?"g83G11"+$$)"68"%+*6(11"9,(;<."6:$"&%5*6"6%.$"!83
3*$"%6V
# yum install sudo

_%6:"6:$"(;<.X5$1(6$)"(991%E(6%8+*"(+)"&%1$"%+*6(11$),"L$"E(+".8)%&!"6:$"(;<.2+("&%1$?
[\$E36$"6:$"9,(;<."E8..(+)"(+)"188Q"&85"6:$"1%+$*"*:8L+" $18LV
# visudo

## Allows people in group wheel to run all commands


%wheel ALL=(ALL) ALL

_%6:"6:$"%wheel"1%+$"3+E8..$+6$)"(*"*:8L+"%+"835"$\(.91$,"*(A$"6:$"&%1$" !"95$**%+0
[*E ,"6:$+"6!9%+0":wq"(+)"95$**%+0" [+6$5 ?"M8L"89$+"6:$"$2!3$F+.;""&%1$"%+"!835"&(A85%6$
$)%685"R0)0."%*"$(*!"68"3*$S"(+)"&%+)"6:$"1%+$"6:(6"*6(56*"L%6:"6:$"L85)"wheel?"'8)%&!"%6
1%Q$"*8V
wheel:x:10:root,asteriskpbx

D(A$"6:$"&%1$,"180"836"&58."+..!" !"6!9%+0" exit,"(+)"180"%+"(*"6:$")(!2+,(/"->"3*$5"!83


E5$(6$)?"Z$*6"!835"(;<."(EE$**" !"53++%+0"6:$"&8118L%+0"E8..(+)V
$ sudo ls /root/
[sudo] password for asteriskpbx:

@&6$5"6!9%+0"!835"9(**L85),"!83"*:831)"0$6"6:$"836936"8&"6:$"$+..!$")%5$E685!?"H&"!83
)8+G6,"08" (EQ"(+)"A$5%&!"6:$"*6$9*"68".(Q$"*35$"!83")%)+G6"*Q%9"85".%*6!9$"(+!6:%+0?
Z:$"5$*6"8&"6:$"%+*653E6%8+*"%+"6:%*"E:(96$5"L%11"(**3.$"6:(6"!83G5$"6:$")(!2+,(/"->"3*$5
(+)"6:(6"!83":(A$"(;<."(EE$**?
F+$"1(*6"6:%+0"+$$)*"68")8+$,"L:%E:"L%11"(118L"!83"68"$+6$5"E8..(+)*"L%6:836":(A%+0
68"$+6$5"6:$"&311"9(6:?"4!")$&(316"8+1!"+..!":(*"$(-,0$"(+)"$;(+$(-,0$"%+"6:$")$&(316"*!*6$.
PATH," 36"L$G11"())"%6"68"835")(!2+,(/"->"3*$5"(*"L$11"*%+E$"L$G11" $"53++%+0".(+!"(9X
91%E(6%8+*"18E(6$)"%+"6:8*$")%5$E685%$*?

v (;<."%*"(+"(991%E(6%8+"6:(6"(118L*"("3*$5"68"$\$E36$"E8..(+)*"(*"(+86:$5"3*$5,"*3E:"(*"5886,"85"6:$"*39$53*$5?

Distribution Installation | 39
D6(56" !"89$+%+0"6:$":%))$+"&%1$"'-)( h"+.*,12"18E(6$)"L%6:%+"6:$")(!2+,(/"->":8.$")%X
5$E685!"L%6:"(+"$)%685?"_$G5$"6:$+"08%+0"68"(99$+)":/usr/sbin:/sbin"68"6:$"$+)"8&"6:$
1%+$"*6(56%+0"L%6:"PATHV
$ vim ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/sbin:/sbin

@*"95$A%83*1!,"*(A$"6:$"&%1$" !"95$**%+0" [*E "(+)"6:$+"6!9%+0":wq"(+)"95$**%+0" [+6$5 ?


_%6:"6:$"89$5(6%+0"*!*6$."%+*6(11$),"!83G5$"5$()!"68"%+*6(11"6:$")$9$+)$+E%$*"5$e3%5$)
&85"@*6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+"%6"68"("7^"(+)"*6(56"6:$"%+*6(11(6%8+"958E$**?
H&"!83G5$"%+*6(11%+0"%+68"("A%563(1".(E:%+$"RL:%E:"L$")8+G6"5$E8..$+)"&85"958)3E6%8+
3*$," 36"E(+" $"("05$(6"L(!"68"6$*6"836"@*6$5%*QS,"!83"*:831)" $"( 1$"68".83+6"6:$"HDF
&%1$")%5$E61!"(+)"%+*6(11"&58."6:$5$?

Base system installation


C98+" 886%+0"&58."6:$"7^,"!83"L%11" $"95$*$+6$)"L%6:"("*E5$$+"L:$5$"!83"E(+"*$1$E6
!835"1(+03(0$"8&"E:8%E$?"4!")$&(316"[+01%*:"%*"6:$"*$1$E6$)"1(+03(0$,"(+)"(&6$5"("6%.$836
9$5%8),"%6"L%11" $"(368.(6%E(11!"*$1$E6$)?"@&6$5"*$1$E6%+0"!835"1(+03(0$,"95$**" [+6$5 ?
Z:$" +$\6" *E5$$+" L%11" 0%A$" !83" *$A$5(1" 896%8+*," 6:$" &%5*6" 8&" L:%E:" %*" E0(!)116 I-;0!;
W2+92+?"D$1$E6"%6" !"95$**%+0" [+6$5 ?
g83"L%11"6:$+" $"(*Q$)"L:%E:"1(+03(0$"68"3*$"&85"6:$"%+*6(11(6%8+"R!$*,"6:%*"%*"*1%0:61!
5$)3+)(+6S?"D$1$E6"!835"1(+03(0$"8&"E:8%E$"R6:$")$&(316"%*"[+01%*:S,"(+)"95$**" [+6$5 ?

಩ F&"E835*$,"958d$E6*"E(+"E:(+0$"6:$%5"L$ *%6$*"L:$+$A$5"6:$!"L(+6?"K89$&311!"6:$"%+*653E6%8+*"L$GA$"958A%)$)
:$5$"(5$"(EE35(6$"$+830:"68":$19"03%)$"!83"6:5830:"6:$"*%6$"$A$+"%+"6:$"$A$+6"8&"E:(+0$*?

40 | Chapter 3:ಗInstalling Asterisk


g83"L%11" $"95$*$+6$)"L%6:"("1%*6"8&"E83+65%$*?"F+E$"!83GA$"&83+)"!835"E83+65!"(+)
:%0:1%0:6$)"%6,"95$**" [+6$5 ?
g83"L%11"6:$+" $"(*Q$)"%&"!83"L831)"1%Q$"68"3*$"6:$"Q$! 8(5)"1(!836")$6$E685?"H&"!83
Q+8L"L:%E:"Q$! 8(5)"6!9$"!83":(A$,"!83"E(+"*$1$E6"M8 "(+)"6:$+"9%EQ"%6"&58."("1%*6"8&
&85.(6*?
H&"!83"(5$"36%1%h%+0"6:$"Q$! 8(5)"1(!836")$6$E685,"!83"L%11" $"958.96$)"68"95$**"("*$5%$*
8&"Q$!*?"H&"!83"3*$"6:$"Q$! 8(5)")$6$E685"(+)"%6")8$*"+86")$6$E6"!835"Q$! 8(5)"E855$E61!
R6!9%E(1"L:$+"%+*6(11%+0"%+68"("A%563(1".(E:%+$"A%("("5$.86$"E8+*81$S,"!83"E(+"08" (EQ
(+)"*$1$E6"&58."("1%*6".(+3(11!?
F+E$"!83GA$"9%EQ$)"!835"Q$! 8(5),"6:$"%+*6(11(6%8+"L%11"E8+6%+3$" !"(66$.96%+0"68"*$6
39"!835"+$6L85Q"(368.(6%E(11!?"H&"(11"08$*"L$11,"!83"L%11" $"958.96$)"68"$+6$5"(":8*6X
+(.$" &85" !835" *!*6$.?" g83" E(+" 9%EQ" (+!6:%+0" !83" L(+6" :$5$," 3+1$**" !835" +$6L85Q
5$e3%5$*" !835" *!*6$." 68" (" :(A$" (" *9$E%&%E" :8*6+(.$?" H+936" %6" +8L" (+)" 6:$+" 95$**
[+6$5 ?
Z:$"%+*6(11$5"L%11"(66$.96"68"E8+6(E6"("M$6L85Q"Z%.$"B5868E81"RMZBS"*$5A$5"68"*!+X
E:58+%h$"!835"E18EQ?"C 3+63"L%11"6:$+"65!"68"(368)$6$E6"!835"6%.$"h8+$"(+)"95$*$+6
!83"L%6:"%6*"E:8%E$?"H&"E855$E6,"*$1$E6"g$* ,"86:$5L%*$,"*$1$E6"M8 "(+)"!83G11" $"95$*$+6$)
L%6:"("1%*6"8&"6%.$"h8+$*"68"*$1$E6"&58.?"D$1$E6"!835"6%.$"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+*6(11(6%8+"%*"E8.91$6$,"!83G11" $"(*Q$)"68"$+6$5"6:$"=;1160)%26.*6! 2602Z
;(2+,"&58."L:%E:"("3*$5+(.$"L%11" $"0$+$5(6$)?"Z:$"*!*6$."L%11"*300$*6"("3*$5+(.$,
36"!83"(5$"&5$$"68"E:(+0$"6:$"3*$5+(.$"68"L:(6$A$5"!83"1%Q$?

Distribution Installation | 41
@&6$5"$+6$5%+0"!835"3*$5+(.$,"!83G11" $"(*Q$)"68"*3991!"("9(**L85),"(+)"6:$+"(*Q$)"68
E8+&%5."6:$"9(**L85)"!83GA$"$+6$5$)?"C 3+63")8$*"("088)"d8 "8&"958A%)%+0"("*$E35$
*!*6$." !"+86"958A%)%+0")%5$E6"(EE$**"68"5886," 36"5(6:$5"3*%+0"6:$"(;<."(991%E(6%8+,
L:%E:"(118L*"!83"68"53+"E8..(+)*"(*"5886"L%6:836" $%+0"6:$"5886"3*$5?"[+6$5"("3*$5X
+(.$,w"*3E:"(*")(!2+,(/"->,"(+)"("*$E35$"9(**L85)"68"E8+6%+3$?"g83G11"3*$"6:$*$"68"180
%+68"6:$"*!*6$."8+E$"6:$"%+*6(11$5"$+)*?"Z:$"%+*6(11$5"L%11"6:$+"(*Q"!83"%&"!83"L(+6"68
$+E5!96"!835":8.$")%5$E685!?"Z:%*"%*"+86"+$E$**(5!"(+)"L%11"())"7BC"8A$5:$()?

Z:$"5$*6"8&"6:$"%+*6(11(6%8+"%+*653E6%8+*"L%11"(**3.$"6:(6")(!2+,(/"->"L(*
E:8*$+"(*"6:$"3*$5+(.$?

H&"!835"*!*6$."%*" $:%+)"("L$ "958\!,"$+6$5"6:$"958\!"%+&85.(6%8+"+8L?"H&"!83G5$"+86


$:%+)"("958\!,"85")8+G6"Q+8L"%&"!83"(5$,"*%.91!"95$**" [+6$5 ?
g83"L%11"6:$+" $"(*Q$)"%&"!83"L(+6"68"%+*6(11"39)(6$*"(368.(6%E(11!?"Z:$")$&(316"%*"68
9$5&85."+8"(368.(6%E"39)(6$*,"L:%E:"%*"L:(6"L$"5$E8..$+)?"D:831)"("*!*6$."5$ 886
8EE35,"(+"39)(6$"68"6:$"Q$5+$1"L%11"5$+)$5"@*6$5%*Q"+8+*6(56( 1$"3+6%1"!83"5$E8.9%1$
%6s"RL:%E:"L8+G6".(Q$"!83"98931(5S?"H6"%*" $66$5"95(E6%E$"68"%)$+6%&!"39)(6$*"8+"("5$031(5
(*%*"(+)"9$5&85."6:$.".(+3(11!"%+"("E8+65811$)".(++$5?"M85.(11!,"!83"L831)"L(+6
68"()A%*$"!835"3*$5*"8&"6:$"$\9$E6$)")8L+6%.$"(+)"*E:$)31$"6:$")8L+6%.$"68":(99$+
(&6$5" 3*%+$**" :835*" R85" L:%1$" (" 5$)3+)(+6" *!*6$." %*" 53++%+0S?" D$1$E6" [.6 );!.%)!,3
;"<)!2("(+)"95$**" [+6$5 ?
D%+E$" L$G11" $" %+*6(11%+0" 835" )$9$+)$+E%$*" L%6:" )"!bF2!," L$" 8+1!" +$$)" 68" *$1$E6" 8+$
9(EQ(0$")35%+0"6:$"%+*6(11V"F9$+DDK"*$5A$5?"DDK"%*"$**$+6%(1"%&"!83"L%*:"68"9$5&85.
5$.86$"L85Q"8+"6:$"*!*6$.?"K8L$A$5,"%&"!835"18E(1"981%E!"*6(6$*"6:(6"!835"*$5A$5"+$$)*
68" $".(+(0$)")%5$E61!,"!83".(!"+86"L(+6"68"%+*6(11"6:$"F9$+DDK"*$5A$5?

B5$**%+0"6:$" [+6$5 "Q$!"L%11"(EE$96"6:$"E355$+6"*$1$E6%8+*"(+)".8A$"8+


L%6:"6:$"%+*6(11?"g83"+$$)"68"3*$" *9(E$" (5 "68"68001$"!835"*$1$E6%8+*?

@&6$5"!83GA$"*$1$E6$)"F9$+DDK"*$5A$5,"95$**" [+6$5 ?
H&"6:%*"%*"6:$"8+1!"89$5(6%+0"*!*6$."8+"6:$".(E:%+$"RL:%E:"%6"1%Q$1!"%*S,"C 3+63"L%11"0%A$
!83"6:$"896%8+"68"%+*6(11"6:$"J2C4" 88618()$5"8+"!835"*!*6$.?"H6"958A%)$*"6:%*"958.96
%+"85)$5"68"0%A$"!83"6:$"896%8+"8&"*Q%99%+0"6:$"J2C4"%+*6(11(6%8+,"(*"%6"L%11".8)%&!"6:$
.(*6$5" 886"5$E85)"R'42S"8+"!835"*!*6$.?"H&"6:$5$"%*"(+86:$5"89$5(6%+0"*!*6$."%6":(*

wC 3+63":(*"5$*$5A$)"6:$"3*$5+(.$")(!2+,(/"%+6$5+(11!?
s _:%1$"L$"*(!"@*6$5%*Q":$5$,"*9$E%&%E(11!"%6"%*"^@K^H"6:(6"%*"6:$"958 1$.?"^@K^H"%*"("*$6"8&"#%+3\"Q$5+$1
.8)31$*"3*$)"L%6:"@*6$5%*Q?

42 | Chapter 3:ಗInstalling Asterisk


&(%1$)"68")$6$E6"6:(6":(*"%+&85.(6%8+"18()$)"%+68"6:$"'42,"%6G*"+%E$"68" $"( 1$"68"*Q%9
.8)%&!%+0"%6?"H&"6:%*"%*"6:$"8+1!"89$5(6%+0"*!*6$."%+*6(11$)"8+"!835"*$5A$5,"*$1$E6" g$* ?
_:$+"6:$"*!*6$.":(*"&%+%*:$)"6:$"%+*6(11,"!83G11" $"(*Q$)"68"5$.8A$"(+!".$)%("%+"6:$
)5%A$*"(+)"68"5$ 886"6:$"*!*6$." !"*$1$E6%+0"?.0!,0;2,"(6"L:%E:"98%+6"6:$"%+*6(11(6%8+
L%11" $"E8.91$6$"(+)"6:$"*!*6$."L%11"5$ 886?

Base system update


M8L" 6:(6" L$GA$" E8.91$6$)" %+*6(11%+0" C 3+63" D$5A$5," L$" +$$)" 68" 9$5&85." (" *!*6$.
39)(6$"L%6:")"!bF2!"68".(Q$"*35$"L$":(A$"6:$"1(6$*6"9(EQ(0$*"%+*6(11$)?"g83G11" $"95$X
*$+6$)"L%6:"("180%+"958.96"L:$5$"!83G11"180"%+"L%6:"6:$"3*$5+(.$"(+)"9(**L85)"!83
E5$(6$)"%+"6:$"%+*6(11$5"R$?0?,")(!2+,(/"->S?"F+E$"1800$)"%+,"53+"6:$"&8118L%+0"E8..(+)V
$ sudo apt-get update
[sudo] password for asteriskpbx:
...
Reading package lists... Done

$ sudo apt-get upgrade


Reading state information... Done
...
Do you want to continue [Y/n]? y

Z:$"9(**L85)"6:(6"(;<."L(+6*"%*"6:$"9(**L85)"!83"d3*6"1800$)"%+"L%6:?

B5$**"[+6$5 "L:$+"958.96$)"68"E8+6%+3$,"(6"L:%E:"98%+6"6:$"1(6$*6"9(EQ(0$"39)(6$*"L%11
$"%+*6(11$)?"_:$+"E8.91$6$,"5$ 886"6:$"*!*6$."&85"6:$"E:(+0$*"68"6(Q$"$&&$E6"(*"6:$
Q$5+$1":(*"958 ( 1!" $$+"39)(6$)?
$ sudo reboot

78+05(631(6%8+*p" g83GA$" *3EE$**&311!" %+*6(11$)" (+)" 39)(6$)" 6:$" (*$" C 3+63" D$5A$5
*!*6$.?

Enable NTP for accurate system time


]$$9%+0"(EE35(6$"6%.$"%*"$**$+6%(1"8+"!835"@*6$5%*Q"*!*6$.," 86:"&85".(%+6(%+%+0"(EE3X
5(6$"E(11")$6(%1"5$E85)*"(*"L$11"(*"&85"*!+E:58+%h(6%8+"L%6:"!835"86:$5"95805(.*?"g83
)8+G6"L(+6"6:$"6%.$*"8&"!835"A8%E$.(%1"+86%&%E(6%8+*"68" $"8&&" !">="85"<=".%+36$*,"(*
6:%*"E(+"1$()"68"E8+&3*%8+"(+)"9(+%E"&58."6:8*$"L:8".%0:6"6:%+Q"6:$%5"A8%E$.(%1"+86%X
&%E(6%8+"688Q"688"18+0"68" $")$1%A$5$)V
$ sudo apt-get install ntp

Distribution Installation | 43
Z:$")$&(316"8+"C 3+63"%*"68"53+"("6%.$"*!+E"*$5A$5"L%6:836"$A$5"E:(+0%+0"6:$"6%.$"8+
!835" 8L+" .(E:%+$?" Z:%*" L8+G6" L85Q" &85" 835" +$$)*," *8" L$G11" +$$)" 68" E:(+0$" 6:$
E8+&%035(6%8+"&%1$"*1%0:61!?"4$E(3*$"8&"6:%*,"L$"+$$)"68"03%)$"!83"6:5830:"3*%+0"("E8.X
.(+)"1%+$"$)%685?"Z:$"0)0."$)%685"%*"(15$()!"%+*6(11$)"8+"!835"C 3+63".(E:%+$"(+)"%*
5$.(5Q( 1!"$(*!"68"3*$tV
$ sudo nano /etc/ntp.conf

g835"6$5.%+(1"L%11"*L%6E:"68"&311X*E5$$+"836936?
C*$"!835"(558L"Q$!*"68".8A$")8L+"68"6:$"*$E6%8+"6:(6"188Q*"1%Q$
# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

@))"6L8"+$L"1%+$*"(&6$5"6:%*"*$E6%8+,"68"(118L"0!"<"68"*!+E:58+%h$"!835"6%.$"L%6:"6:$
836*%)$"L851),"*3E:"6:(6"6:$"( 8A$"*$E6%8+"+8L"188Q*"1%Q$
# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

restrict -4 127.0.0.1
restrict -6 ::1

Z:(6G*"$A$5!6:%+0"L$"+$$)"68"E:(+0$,"*8"$\%6"6:$"$)%685" !"95$**%+0" 7651 z f !"#$%


&'()&*$+!,#$*#$'!*(!-./$!*#$!)(+0102.*0(%-3!&'$--! 4 5! ! "!,066!.++0*0(%.667!.-8!7(9
1('!*#$!106$%.)$ !:9-*!#0*! ;%*$' !*(!2(%10')!*#$!+$1.96*!#$%&# %'(&" )
<(,!'$-*.'*!*#$!<=>!+.$)(%?
$ sudo /etc/init.d/ntp restart

"0*#!*#$!(&$'.*0%@!-7-*$)!0%-*.66$+3!7(9A'$!'$.+7!*(!0%-*.66!*#$!+$&$%+$%20$-!'$B90'$+
1('!C-*$'0-8 !=#$!%$D*!-$2*0(%!&'(/0+$-!.%!0%E+$&*#!'$/0$,!(1!*#$!0%-*.66.*0(%!&'(2$--
F1!7(9A/$!.6'$.+7!'$/0$,$+!*#$!0%1(').*0(%!0%!GH(1*,.'$!I$&$%+$%20$-J!(%!&.@$!KK3
7(9!).7!,.%*!*(!'$1$'!L.28!*(!GF%-*.66.*0(%!M#$.*!H#$$*J!(%!&.@$!NO!1('!.!#0@#E6$/$6
'$/0$,!(1!#(,!*(!0%-*.66!C-*$'0-8

Software Dependencies
=#$!10'-*!*#0%@!7(9!%$$+!*(!+(!(%2$!7(9A/$!2()&6$*$+!*#$!0%-*.66.*0(%!(1!7(9'!(&$'.*0%@
-7-*$)!0-!*(!0%-*.66!*#$!-(1*,.'$!+$&$%+$%20$-!'$B90'$+!L7!C-*$'0-8 !=#$!2()).%+-
60-*$+!0%!=.L6$!NEO!#./$!L$$%!-&60*!0%*(!*,(!2(69)%-3!1('!PL9%*9!H$'/$'!.%+!M$%*QH
H$'/$' ! =#$-$! &.28.@$-! ,066! .66(,! 7(9! *(! L906+! .! L.-02! C-*$'0-8! -7-*$)3! .6(%@! ,0*#
ICRIF!.%+!S0L>TF !<(*!$/$'7!)(+96$!,066!L$!./.06.L6$!.*!2()&06$!*0)$!,0*#!*#$-$

U F1!7(9A'$!.6'$.+7!1.)060.'!,0*#!.%(*#$'!$+0*('3!@(!.#$.+!.%+!9-$!0* !=#$! ! "!$+0*('!#.-!L$$%!-$6$2*$+!1('!0*-


$.-$!(1!9-$!.%+!0*-!#.%+7!(%E-2'$$%!0%-*'92*0(%- !"$!$/$%!8%(,!.!+$/$6(&$'!.*!I0@09)!,#(!9-$-!0*!,#06$
,'0*0%@!2(+$!1('!C-*$'0-83!*#(9@#!)(-*!&$(&6$!*$%+!*(!9-$!)('$!2()&6$D!$+0*('-!-92#!.-!$*!&+!('!,-*

44 | Chapter 3:ಗInstalling Asterisk


+$&$%+$%20$-5! (%67! *#$! )(-*! 2())(%67! 9-$+! )(+96$-! ,066! L$! L906* ! F1! .++0*0(%.6
+$&$%+$%20$-!.'$!'$B90'$+!1('!(*#$'!)(+96$-!9-$+!6.*$'!0%!*#$!L((83!0%-*'92*0(%-!,066
L$!&'(/0+$+!.-!%$2$--.'7

>6$.-$!L$!.,.'$!*#.*!*#$!+$&$%+$%27!0%1(').*0(%!(%!M$%*QH!VKEL0*!+($-
%(*!*.8$!0%*(!.22(9%*!*#.*!NWEL0*!60L'.'0$-!-#(96+!%(*!L$!0%-*.66$+ !F1!-92#
60L'.'0$-!.'$!0%-*.66$+3!7(9!,066!$%+!9&!,0*#!.++0*0(%.6!&.28.@$-!*#.*!9-$
+0-8! -&.2$! .%+! 2.%! 2.9-$! 2(%1602*-! 01! *#$! -7-*$)! .**$)&*-! *(! 2()&06$
[email protected]%-*!.!NWEL0*!60L'.'7!0%-*$.+!(1!0*-!VKEL0*!2(9%*$'&.'* !F%!('+$'!*(!'$E
-(6/$!*#0-!&'(L6$)3!.++!(./0102!*(!*#$!$%+!(1!$.2#!&.28.@$!%.)$!,#$%
0%-*.660%@!0* !H(3!1('!$D.)&6$3!0%-*$.+!(1!$D$29*0%@!34*5- +%!665 &47+$+8
9$,$63! 7(9! ,066! $D$29*$! 34*5 - +%!665 &47+$+89$,$6(./0102 ! =#0-! 0-! %(*
%$2$--.'7!(%!.!NWEL0*!&6.*1(')

:!;6$5<8=(5>")%?!7$59$'$ 9$ &-$+5)"75@+%$7-+A5" 5B;4 %45>$7,$75! 95C$ %D>5>$7,$7


Ubuntu CentOS
sudo apt-get install build-essential \ sudo yum install gcc gcc-c++ make wget \
subversion libncurses5-dev libssl-dev \ subversion libxml2-devel ncurses-devel \
libxml2-dev vim-nox openssl-devel vim-enhanced

=#$-$! &.28.@$-! ,066! @$*! 7(9! )(-*! (1! ,#.*! 7(9A66! %$$+! *(! @$*! -*.'*$+! ,0*#! 0%-*.660%@
C-*$'0-83!ICRIF3!.%+!S0L>TF !<(*$!*#.*!7(9!,066!.6-(!'$B90'$!*#$!-(1*,.'$!+$&$%+$%E
20$-! 1('! $.2#! &.28.@$! *#.*! ,$! 0%+02.*$! %$$+-! *(! L$! 0%-*.66$+ ! =#$-$! ,066! L$! '$-(6/$+
.9*().*02.667!1('!7(9!,#$%!7(9!9-$!$0*#$'!34*!('!!'%8E$%
"$!#./$!.6-(!0%269+$+!*#$!Q&$%HHS!+$/$6(&)$%*!60L'.'0$-3!,#02#!.'$!%(*!-*'02*67!%$2E
$--.'7!*(!2()&06$!C-*$'0-83!L9*!.'$!@((+!*(!#./$?!*#$7!$%.L6$!8$7!-9&&('*!.%+!(*#$'
$%2'7&*0(%!19%2*0(%.60*7
"$!#./$!0%-*.66$+!,-*!.-!(9'!$+0*('3!L9*!7(9!2.%!2#((-$!.%7*#0%@!7(9!,.%*3!-92#!.-
! "3!F"$3!('!$*!&+
C-*$'0-8!2(%*.0%-!.!-2'0&*!*#.*!,066!0%-*.66!*#$!+$&$%+$%20$-!1('!.66!1$.*9'$-!0%!C-*$'0-8
C*!*#0-!*0)$!0*!0-!2()&6$*$!1('!PL9%*9!L9*!+($-!%(*!60-*!.66!'$B90'$+!&.28.@$-!1('!M$%*QH
Q%2$!7(9!#./$!+(,%6(.+$+!C-*$'0-8!9-0%@!*#$!0%-*'92*0(%-!0%!GI(,%6(.+0%@!"#.*
4(9!<$$+J!(%!&.@$!KV3!9-$!*#$!1(66(,0%@!2()).%+-!01!7(9!,(96+!608$!*(!'9%!0*?
$ cd ~/src/asterisk-complete/asterisk/1.8
$ sudo ./contrib/scripts/install_prereq install
$ sudo ./contrib/scripts/install_prereq install-unpackaged

Software Dependencies | 45
Third-Party Repositories
X('! 2$'*.0%! -(1*,.'$! +$&$%+$%20$-3! .! *#0'+E&.'*7! '$&(-0*('7! ).7! L$! %$2$--.'7 ! =#0-
.&&$.'-!*(!L$!)(-*!(1*$%!*#$!2.-$!,#$%!9-0%@!M$%*QH !C!2(9&6$!(1!'$&(-0*('0$-!*#.*
-$$)!*(!L$!.L6$!*(!&'(/0+$!.66!*#$!$D*'.!+$&$%+$%20$-!'$B90'$+!.'$!T>Y1('@$!ZG%%'H##9!E
(?-$$7+(&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*#0%!*#$!#()$!+0E
'$2*('7!1('!*#$!!+%$7-+A';.!9-$'!(%!*#$!-7-*$) !Q%2$!$/$'7*#0%@!0-!L906*3!0*!,066!L$!0%E
-*.66$+!,0*#!*#$!+49"!2()).%+ !"$A66!*#$%!@(!L.28!.%+!2#.%@$!*#$!&$')0--0(%-!.%+
(,%$'-#0&!(1!*#$!0%-*.66$+!106$-!0%!('+$'!*(!L906+!.!-$29'$!-7-*$) !=(!L$@0%3!0--9$!*#$
1(66(,0%@!2()).%+?
$ mkdir -p ~/src/asterisk-complete/asterisk

<(,!*#.*!,$A/$!2'$.*$+!.!+0'$2*('7!-*'92*9'$!*(!#(6+!$/$'7*#0%@3!6$*A-!@$*!*#$!-(9'2$
2(+$ !M#((-$!(%$!(1!*#$!1(66(,0%@!*,(!)$*#(+-!*(!@$*!7(9'!106$-?
O H9L/$'-0(%
W ?E$%

46 | Chapter 3:ಗInstalling Asterisk


Getting the Latest Version
C-*$'0-8!0-!.!2(%-*.%*67!$/(6/0%@!&'(^$2*3!.%+!*#$'$!.'$!).%7!+011$'$%*!/$'-0(%-!(1!*#$
-(1*,.'$!*#.*!7(9!2.%!0)&6$)$%*
F%! M#.&*$'! W3! ,$! *.68$+! .L(9*! C-*$'0-8! /$'-0(%0%@ ! =#$! 2(%2$&*! (1! #(,! C-*$'0-8! 0-
/$'-0(%$+!0-!0)&('*.%*!*(!9%+$'-*.%+!L$2.9-$!*#$!/$'-0(%0%@!-7-*$)!1('!C-*$'0-8!#.-
9%+$'@(%$!.!1$,!2#.%@$-!(1!)$*#(+(6(@7!(/$'!*#$!7$.'- !H(3!01!7(9A'$!%(*!9&!*(!-&$$+
(%!C-*$'0-8!/$'-0(%0%@3!,$!-*'(%@67!'$2())$%+!*#.*!7(9!@(!L.28!.%+!'$.+!GC-*$'0-8
_$'-0(%0%@J!(%!&.@$!WV
R./0%@!-.0+!.66!*#.*3!0%!)(-*!2.-$-!.66!7(9!%$$+!*(!+(!0-!@'.L!*#$!6.*$-*!/$'-0(%!1'()!*#$
G%%'H##???(!+%$7-+A("7E#9"? 6"!9+!,$L-0*$ !"$!,066!L$!0%-*.660%@!.%+!9-0%@!C-*$'0-8!O `
*#'(9@#(9*!*#0-!L((8

Getting the Source via Subversion


H9L/$'-0(%!0-!.!/$'-0(%!2(%*'(6!-7-*$)!*#.*!0-!9-$+!L7!+$/$6(&$'-!*(!*'.28!2#.%@$-!*(
2(+$!(/$'!.!&$'0(+!(1!*0)$ !;.2#!*0)$!*#$!2(+$!0-!)(+010$+3!0*!)9-*!10'-*!L$!2#$28$+!(9*
(1! *#$! '$&(-0*('75! *#$%! 0*! )9-*! L$! 2#$28$+! L.28! 0%3! .*! ,#02#! &(0%*! *#$! 2#.%@$-! .'$
6(@@$+ !=#9-3!01!.!2#.%@$!2'$.*$-!.!'$@'$--0(%3!*#$!+$/$6(&$'-!2.%!@(!L.28!*(!*#.*!2#.%@$
.%+!'$)(/$!0*!01!%$2$--.'7 !=#0-!0-!.!&(,$'196!.%+!'(L9-*!-7-*$)!1('!+$/$6(&)$%*!,('8
F*!.6-(!#.&&$%-!*(!L$!9-$196!1('!C-*$'0-8!.+)0%0-*'.*('-!-$$80%@!*(!'$*'0$/$!*#$!-(1*,.'$
=(!+(,%6(.+!*#$!-(9'2$!2(+$!*(!*#$!6.*$-*!/$'-0(%!(1!C-*$'0-8!O `3!9-$!*#$-$!2()).%+-?
$ cd ~/src/asterisk-complete/asterisk
$ svn co http://svn.asterisk.org/svn/asterisk/branches/1.8

4(9!2.%!%(,!-80&!+0'$2*67!*(!GR(,!*(!F%-*.66!F*J!(%!&.@$!K`

=#$!&'$2$+0%@!2()).%+-!,066!'$*'0$/$!*#$!6.*$-*!2#.%@$-!*(!*#$!-(9'2$
0%!*#.*!&.'*0296.'!L'.%2#3!,#02#!.'$!2#.%@$-!*#.*!#./$!L$$%!).+$!.1*$'
*#$!6.*$-*!'$6$.-$ !F1!7(9!,(96+!&'$1$'!*(!9-$!.!'$6$.-$+!/$'-0(%3!&6$.-$
'$1$'!*(!*#$!%$D*!-$2*0(%

Getting the Source via wget


=(!(L*.0%!*#$!6.*$-*!'$6$.-$+!/$'-0(%-!(1!ICRIF3!S0L>TF3!.%+!C-*$'0-8!9-0%@!*#$!?E$%
.&&602.*0(%3!0--9$!*#$!1(66(,0%@!2()).%+-?
$ cd ~/src/asterisk-complete/asterisk
$ wget \
http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.8-current.tar.gz
$ tar zxvf asterisk-1.8-current.tar.gz

=#$!%$D*!-*$&!0-!*(!2()&06$!.%+!0%-*.66!*#$!-(1*,.'$3!-(!(%,.'+!*(!*#$!%$D*!-$2*0(%

Downloading What You Need | 47


How to Install It
"0*#!*#$!-(9'2$!106$-!+(,%6(.+$+!7(9!2.%!2()&06$!*#$!-(1*,.'$!.%+!0%-*.66!0* !=#$!('+$'
1('!0%-*.660%@!0-?
O S0L>TFa
W ICRIFb
N C-*$'0-8಩
F%-*.660%@! 0%! *#0-! ('+$'! $%-9'$-! *#.*! .%7! +$&$%+$%20$-! 1('! ICRIF! .%+! C-*$'0-8! .'$
0%-*.66$+!&'0('!*(!'9%%0%@!*#$!2(%10@9'.*0(%!-2'0&*-3!,#02#!,066!-9L-$B9$%*67!$%-9'$!*#.*
.%7!)(+96$-!+$&$%+$%*!(%!S0L>TF!('!ICRIF!,066!L$!L906*
H(3!6$*A-!@$*!-*.'*$+

LibPRI
S0L>TF!0-!.!60L'.'7!*#.*!.++-!-9&&('*!1('!FHI<!Z>TF!.%+!]TF[ !=#$!9-$!(1!S0L>TF!0-
(&*0(%.63!L9*!-0%2$!0*!*.8$-!/$'7!60**6$!*0)$!*(!0%-*.663!+($-%A*!0%*$'1$'$!,0*#!.%7*#0%@3
.%+!,066!2()$!0%!#.%+7!01!7(9!$/$'!,.%*!*(!.++!2.'+-!*(!.!-7-*$)!.*!.!6.*$'!&(0%*3!,$
'$2())$%+!*#.*!7(9!0%-*.66!0*!%(,
M#$28!(9*!*#$!6.*$-*!/$'-0(%!(1!S0L>TF!.%+!2()&06$!0*!608$!-(?
$ cd ~/src/asterisk-complete/
$ mkdir libpri
$ cd libpri/
$ svn co http://svn.asterisk.org/svn/libpri/tags/1.4.<your version number>
$ cd 1.4.<your version number>
$ make
$ sudo make install

4(9!2.%!.6-(!+(,%6(.+!*#$!-(9'2$!/0.!?E$%!1'()!G%%'H##9"? 6"!9+(!+%$7
-+A("7E#'4;#%$6$'G" 3#6-;'7-#

"0*#!S0L>TF!0%-*.66$+3!,$!2.%!%(,!0%-*.66!ICRIF

a H*'02*67!-&$.80%@3!01!7(9!.'$!%(*!@(0%@!*(!L$!9-0%@!.%7!FHI<!2(%%$2*0(%-!Z]TF!.%+!>TF[3!7(9!2.%!0%-*.66!C-*$'0-8
,0*#(9*!S0L>TF !R(,$/$'3!,$!.'$!@(0%@!*(!0%-*.66!0*!1('!*#$!-.8$!(1!2()&6$*$%$--
b =#0-!&.28.@$!2(%*.0%-!*#$!8$'%$6!+'0/$'-!*(!.66(,!C-*$'0-8!*(!2(%%$2*!*(!*'.+0*0(%.6!>H=<!20'290*- !F*!0-!.6-(
'$B90'$+!1('!*#$!MeetMe()!2(%1$'$%20%@!.&&602.*0(% [email protected]%3!,$!,066!0%-*.66!*#0-!1('!2()&6$*$%$--
಩ F1!7(9!+(%A*!0%-*.66!*#0-3!%(%$!(1!*#$!$D.)&6$-!0%!*#0-!L((8!,066!,('83!L9*!0*!2(96+!-*066!).8$!.!@'$.*!L.*#'(()
'$.+$' !:9-*!-.70%A

48 | Chapter 3:ಗInstalling Asterisk


DAHDI
=#$!L-E-4*5@+%$7-+A5M!79?!7$5L$,-&$5N %$7)!&$3!('!ICRIF!Z1(')$'67!8%(,%!.-!c.&*$6[3
0-!*#$!-(1*,.'$!C-*$'0-8!9-$-!*(!0%*$'1.2$!,0*#!*$6$&#(%7!#.'+,.'$ !"$!'$2())$%+!*#.*
7(9!0%-*.66!0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!0)&('*.%*!*#.*!*#$!8$'%$6!/$'-0(%!L$0%@!9-$+!).*2#!$D.2*67!*#.*!(1!*#$!8$'%$6!-(9'2$
L$0%@!0%-*.66$+ !4(9!2.%!9-$!4 !*$58!!*(!/$'017!*#$!29''$%*67!'9%%0%@!8$'%$6!/$'-0(%?
d M$%*QH?!sudo yum install kernel-devel-`uname -r`
d PL9%*9?!sudo apt-get install linux-headers-`uname -r`
=#$!9-$!(1!4 !*$587!-9''(9%+$+!L7!L.28*028-!Z`[!0-!1('!10660%@!0%!*#$!29''$%*67!'9%%0%@
8$'%$6!/$'-0(%!-(!*#$!.&&'(&'0.*$!&.28.@$!0-!0%-*.66$+
=#$! 1(66(,0%@! 2()).%+-! -#(,! #(,! *(! 0%-*.66! L@MLN86- 4.8&"*'6$%$5 O(2(PQO(2(P
=#$'$! ).7! L$! .! %$,$'! /$'-0(%! ./.06.L6$! L7! *#$! *0)$! 7(9! .'$! '$.+0%@! *#0-3! -(! 2#$28
9"? 6"!9+(!+%$7-+A("7E!10'-* !F1!*#$'$!0-!.!%$,$'!/$'-0(%!./.06.L6$3!^9-*!'$&6.2$!*#$!/$'-0(%
%9)L$'!0%!*#$!2()).%+-?
$ cd ~/src/asterisk-complete/
$ mkdir dahdi
$ cd dahdi/
$ svn co http://svn.asterisk.org/svn/dahdi/linux-complete/tags/2.4.0+2.4.0
$ cd 2.4.0+2.4.0
$ make
$ sudo make install
$ sudo make config

How to Install It | 49
4(9!,066!%$$+!*(!#./$!F%*$'%$*!.22$--!,#$%!'9%%0%@!*#$!*!A$5!66!2()E
).%+3!.-!0*!,066!.**$)&*!*(!+(,%6(.+!*#$!6.*$-*!#.'+,.'$!10'),.'$!1'()
*#$!I0@09)!-$'/$'-

C1*$'!0%-*.660%@!ICRIF3!,$!2.%!)(/$!(%!*(!0%-*.660%@!C-*$'0-8

4(9!2.%!.6-(!+(,%6(.+!*#$!-(9'2$!/0.!?E$%!1'()!G%%'H##9"? 6"!9+(!+%$7
-+A("7E#'4;#%$6$'G" 3#9!G9-86- 4.8&"*'6$%$#

Asterisk
"0*#!L(*#!ICRIF!.%+!S0L>TF!0%-*.66$+3!,$!2.%!%(,!0%-*.66!C-*$'0-8?
$ cd ~/src/asterisk-complete/asterisk/1.8
$ ./configure
$ make
$ sudo make install
$ sudo make config

"0*#!*#$!106$-!%(,!0%-*.66$+!0%!*#$0'!+$1.96*!6(2.*0(%-3!,$!%$$+!*(!)(+017!*#$!&$')0-E
-0(%-!(1!*#$!+0'$2*('0$-!.%+!*#$0'!2(%*$%*-

=#$'$!0-!.%!.++0*0(%.6!-*$&!*#.*!0-!%(*!-*'02*67!'$B90'$+3!L9*!0-!B90*$!2()E
)(%!Z.%+!.'@9.L67!0)&('*.%*[?!*#$!*!A$5*$ 4+$6$&%!2()).%+3!,#02#
&'(/0+$-! .! @'.&#02.6! 0%*$'1.2$! *#.*! .66(,-! +$*.06$+! -$6$2*0(%! (1! ,#02#
)(+96$-!.%+!1$.*9'$-!,066!L$!2()&06$+ !"$!,066!+0-29--!*#0-!0%!G).8$
)$%9-$6$2*J!(%!&.@$!ef

Setting File Permissions


F%!('+$'!*(!'9%!(9'!-7-*$)!)('$!-$29'$673!,$A66!L$!0%-*.660%@!C-*$'0-8!.%+!*#$%!'9%%0%@
0*!.-!*#$!!+%$7-+A';.!9-$' !C1*$'!0%-*.660%@!*#$!106$-!0%*(!*#$0'!+$1.96*!6(2.*0(%-3!,$!%$$+
*(!2#.%@$!*#$!106$!&$')0--0(%-!*(!).*2#!*#(-$!(1!*#$!9-$'!,$A'$!@(0%@!*(!L$!'9%%0%@!.-
;D$29*$!*#$!1(66(,0%@!2()).%+-!.1*$'!'9%%0%@!*!A$5- +%!66!Z,#02#!,$!+0+!&'$/0(9-67[?
$ sudo chown -R asteriskpbx:asteriskpbx /usr/lib/asterisk/
$ sudo chown -R asteriskpbx:asteriskpbx /var/lib/asterisk/
$ sudo chown -R asteriskpbx:asteriskpbx /var/spool/asterisk/
$ sudo chown -R asteriskpbx:asteriskpbx /var/log/asterisk/
$ sudo chown -R asteriskpbx:asteriskpbx /var/run/asterisk
$ sudo chown asteriskpbx:asteriskpbx /usr/sbin/asterisk

F%! ('+$'! *(! 9-$! MeetMe()! .%+! ICRIF! ,0*#! C-*$'0-8! .-! %(%E'((*3! 7(9! )9-*! 2#.%@$
*#$!#$%&#49$,#746$+(9#9!G9-(746$+!-(!*#.*!*#$!OWNER!.%+!GROUP!10$6+-!).*2#!*#$!%(%E'((*
9-$'!C-*$'0-8!,066!L$!'9%%0%@!.- !F%!*#0-!2.-$3!,$A'$!9-0%@!*#$!!+%$7-+A';.!9-$'

50 | Chapter 3:ಗInstalling Asterisk


M#.%@$!*#$!6.-*!60%$!(1!*#$!9!G9-(746$+!106$!*(!*#$!1(66(,0%@?
SUBSYSTEM=="dahdi", OWNER="asteriskpbx", GROUP="asteriskpbx", MODE="0660"

"0*#!*#.*!(9*!(1!*#$!,.73!,$!2.%!)(/$!(%!*(!&$'1(')0%@!*#$!L.-$!2(%10@9'.*0(%!*#.*
-#(96+!L$!+(%$!.1*$'!.66!0%-*.66.*0(%-

Base Configuration
<(,!*#.*!,$A/$!@(*!C-*$'0-8!0%-*.66$+3!,$!2.%!@$*!(9'!-7-*$)!9&!.%+!'9%%0%@ !=#$
&9'&(-$!#$'$!0-!*(!@$*!C-*$'0-8!6(.+$+!9&!.%+!'$.+7!*(!@(3!.-!0*!0-%A*!+(0%@!.%7*#0%@
9-$196!7$* !=#$-$!.'$!*#$!-*$&-!*#.*!.66!-7-*$)!.+)0%0-*'.*('-!,066!%$$+!*(!-*.'*!(9*!,0*#
,#$%!0%-*.660%@!.!%$,!-7-*$) !F1!*#$!2()).%+-!*#.*!%$$+!*(!L$!'9%!+011$'!(%!M$%*QH
.%+!PL9%*93!7(9!,066!-$$!.!*.L6$!,0*#!'(,-!6.L$6$+!1('!$.2#!+0-*'0L9*0(%5!(*#$',0-$3
7(9!,066!-$$!.!-0%@6$!2()).%+!*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20%@!*#$!P!,0*#!.!=?
$ sudo echo 1 > /selinux/enforce

Base Configuration | 51
=(!+0-.L6$!H;S0%9D!&$').%$%*673!)(+017!*#$!#$%&#+$6- 4.#&" )-E!106$?
$ cd /etc/selinux/
$ sudo vim config

M#.%@$!*#$!SELINUX!(&*0(%!1'()!enforcing!*(!disabled

C6*$'%.*0/$673! 7(9! 2.%! 2#.%@$! *#$! /.69$! (1! enforcing! *(! permissive3
,#02#!-0)&67!6(@-!*#$!$''('-!0%-*$.+!(1!$%1('20%@!*#$!&(6027

"#$%!7(9A'$!+(%$!)(+0170%@!*#$!2(%10@9'.*0(%!106$3!7(9A66!#./$!*#$!1(66(,0%@?
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

# SETLOCALDEFS= Check local definition changes


SETLOCALDEFS=0

H0%2$!7(9!2.%A*!+0-.L6$!H;S0%9D!,0*#(9*!'$L((*0%@3!7(9A66!%$$+!*(!+(!*#.*!%(,?
$ sudo reboot

Initial Configuration
F%!('+$'!*(!@$*!C-*$'0-8!9&!.%+!'9%%0%@!26$.%673!,$!%$$+!*(!2'$.*$!-()$!2(%10@9'.*0(%
106$- !"$!2(96+!&(*$%*0.667!0%-*.66!*#$!-.)&6$!106$-!*#.*!2()$!,0*#!C-*$'0-8!ZL7!$D$29*0%@
*#$!*!A$5+!*'6$+!2()).%+!0%!(9'!C-*$'0-8!-(9'2$[!.%+!*#$%!)(+017!*#(-$!106$-!*(!-90*
(9'!%$$+-3!L9*!*#$!*!A$5+!*'6$+!2()).%+!0%-*.66-!).%7!-.)&6$!106$-3!)(-*!(1!*#$)
1('!)(+96$-!*#.*!7(9!,066!%$/$'!9-$ !"$!,.%*!*(!60)0*!,#02#!)(+96$-!,$!.'$!6(.+0%@3
.%+!,$!.6-(!L$60$/$!*#.*!0*A-!$.-0$'!*(!9%+$'-*.%+!C-*$'0-8!2(%10@9'.*0(%!01!7(9!L906+
7(9'!2(%10@!106$-!1'()!-2'.*2#3!-(!,$A'$!@(0%@!*(!2'$.*$!(9'!(,%!)0%0).6!-$*!(1!2(%10@E
9'.*0(%!106$- g
=#$!10'-*!*#0%@!,$!%$$+!*(!+(!Z.--9)0%@!0*!+($-!%(*!.6'$.+7!$D0-*[!0-!2'$.*$!*#$! #$%&#
!+%$7-+A#!+0'$2*('7!,#$'$!(9'!2(%10@9'.*0(%!106$-!,066!60/$?
$ sudo mkdir /etc/asterisk/
$ sudo chown asteriskpbx:asteriskpbx /etc/asterisk/

gF1!7(9'!#$%&#!+%$7-+A#!1(6+$'!#.-!106$-!0%!0*!.6'$.+73!)(/$!*#(-$!106$-!*(!.%(*#$'!+0'$2*('73!('!+$6$*$!*#$)!01!7(9
.'$!-9'$!7(9!+(%A*!%$$+!,#.*!0-!*#$'$

52 | Chapter 3:ಗInstalling Asterisk


T9%%0%@!*!A$5+!*'6$+!(%!.!-7-*$)!*#.*!.6'$.+7!#.-!2(%10@9'.*0(%!106$-
,066!(/$','0*$!*#$!$D0-*0%@!106$-

Using make samples to Create Sample


Configuration Files for Future Reference
;/$%!*#(9@#!,$!.'$!%(*!@(0%@!*(!9-$!*#$!-.)&6$!2(%10@9'.*0(%!106$-!*#.*!2()$!,0*#
C-*$'0-83!*#$!1.2*!0-!*#.*!*#$7!.'$!.%!$D2$66$%*!'$1$'$%2$ !F1!*#$'$!0-!.!)(+96$!*#.*!7(9
.'$!%(*!29''$%*67!9-0%@!L9*!,0-#!*(!&9*!0%*(!&'(+92*0(%3!*#$!-.)&6$!106$!,066!-#(,!7(9
$D.2*67!,#.*!-7%*.D!*(!9-$3!.%+!,#.*!(&*0(%-!.'$!./.06.L6$!1('!*#.*!)(+96$
T9%%0%@!*#$!+49"5*!A$5+!*'6$+!2()).%+!0%!7(9'!C-*$'0-8!-(9'2$!+0'$2*('7h!0-!#.')6$--
(%!.!%$,!-7-*$)!*#.*!#.-!^9-*!L$$%!L906*3!L9*!0*!0-!/$'7!+.%@$'(9-!*(!'9%!(%!.!-7-*$)
*#.*!.6'$.+7!#.-!2(%10@9'.*0(%!106$-3!.-!*#0-!2()).%+!,066!(/$','0*$!.%7!$D0-*0%@!106$-
Z,#02#!,(96+!L$!.!+0-.-*$'!1('!7(9!01!7(9!+(!%(*!#./$!.!29''$%*!L.289&[
F1!7(9A/$!'9%!*#$!+49"5*!A$5+!*'6$+!2()).%+3!7(9!,066!,.%*!*(!)(/$!*#$!106$-!*#.*!0*
#.-! 2'$.*$+! 0%! #$%&#!+%$7-+A#! *(! .%(*#$'! 1(6+$' ! "$! 608$! *(! 2'$.*$! .! 1(6+$'! 2.66$+! #$%&#
!+%$7-+A#4 4+$9#!.%+!&9*!.%7!-.)&6$\9%9-$+!2(%10@9'.*0(%!106$-!0%!*#$'$3!L9*!1$$6!1'$$
*(!-*('$!*#$)!,#$'$/$'!7(9!608$

"$A'$!%(,!@(0%@!*(!-*$&!*#'(9@#!.66!*#$!106$-!*#.*!.'$!'$B90'$+!*(!@$*!.!-0)&6$!C-*$'0-8
-7-*$)!9&!.%+!'9%%0%@

indications.conf and asterisk.conf


=#$!10'-*!106$!%$$+$+!0-!- 9-&!%-" +(&" )3!.!106$!*#.*!2(%*.0%-!0%1(').*0(%!.L(9*!#(,!*(
+$*$2*!+011$'$%*!*$6$&#(%7!*(%$-!1('!+011$'$%*!2(9%*'0$- !=#$'$!0-!.!&$'1$2*67!@((+!-.)&6$
106$!*#.*!,$!2.%!9-$!0%!*#$!C-*$'0-8!-(9'2$3!-(!6$*A-!2(&7!0*!0%*(!(9'!#$%&#!+%$7-+A#!+0'$2*('7?
$ cp ~/src/asterisk-complete/asterisk/1.8/configs/indications.conf.sample \
/etc/asterisk/indications.conf

]$2.9-$!,$A'$!'9%%0%@!C-*$'0-8!.-!%(%E'((*3!,$!%$$+!*(!*$66!C-*$'0-8!,#02#!9-$'!*(!'9%
.- !=#0-!0-!+(%$!,0*#!*#$!!+%$7-+A(&" )!106$ !"$!2.%!2(&7!.!-.)&6$!/$'-0(%!(1!0*!1'()!*#$
C-*$'0-8!-(9'2$!*(!#$%&#!+%$7-+A?
$ cp ~/src/asterisk-complete/asterisk/1.8/configs/asterisk.conf.sample \
/etc/asterisk/asterisk.conf

=#$!!+%$7-+A(&" )!106$!2(%*.0%-!).%7!(&*0(%-!*#.*!,$!,(%A*!@(!(/$'!#$'$!Z*#$7!.'$!2(/E
$'$+!0%!G.-*$'0-8 2(%1J!(%!&.@$!iO[3!L9*!,$!+(!%$$+!*(!).8$!.%!.+^9-*)$%* !<$.'!*#$
$%+!(1!*#$! [options]!-$2*0(%3!*#$'$!.'$!*,(!(&*0(%-!,$!%$$+!*(!$%.L6$?! runuser!.%+
rungroup

h #4+7#+7&#!+%$7-+A8&"*'6$%$#!+%$7-+A#!+%$7-+A8=(/(R3"475,$7+-" S#

Base Configuration | 53
Q&$%!*#$!!+%$7-+A(&" )!106$!,0*#!.%!$+0*('!-92#!.-! ! "!('!,-*?!P%2())$%*!*#$! run
user!.%+!rungroup!60%$-3!.%+!)(+017!*#$)!-(!*#.*!*#$7!$.2#!2(%*.0%!asteriskpbx!.-!*#$
.--0@%$+!/.69$ !Q&$%!*#$!#$%&#!+%$7-+A#!+%$7-+A(&" )!106$!,0*#!/0)?
$ vim /etc/asterisk/asterisk.conf

=#$%!)(+017!*#$!106$!L7!9%2())$%*0%@!*#$!*,(!60%$-!-*.'*0%@!,0*#! runuser!.%+! run


group!.%+!)(+0170%@!*#$!/.69$!*(!asteriskpbx
runuser=asteriskpbx
rungroup=asteriskpbx

"$! %(,! #./$! .66! *#$! 2(%10@9'.*0(%! 106$-! '$B90'$+! *(! -*.'*! .! /$'7! )0%0).6! /$'-0(%! (1
C-*$'0-8 U!j0/$!0*!.!-#(*!L7!-*.'*0%@!C-*$'0-8!9&!0%!*#$!1('$@'(9%+?
$ /usr/sbin/asterisk -cvvv

"$!.'$!-&$20170%@!*#$!1966!&.*#!*(!*#$!!+%$7-+A!L0%.'73!L9*!01!7(9!)(+017
7(9'! PATH!-7-*$)!/.'0.L6$!*(!0%269+$!*#$!#4+7#+;- #!+0'$2*('7!7(9!+(%A*
%$$+!*(!-&$2017!*#$!1966!&.*# !H$$!GC++0%@!.!-7-*$)!9-$'J!(%!&.@$!Nf!1('
0%1(').*0(%!.L(9*!)(+0170%@!*#$!$PATH!$%/0'(%)$%*!/.'0.L6$

C-*$'0-8!,066!-*.'*!-922$--19667!,0*#(9*!.%7!$''('-!('!,.'%0%@-!Z.6*#(9@#!0*!+($-!,.'%
7(9!*#.*!-()$!106$-!.'$!)0--0%@[3!.%+!&'$-$%*!*(!7(9!*#$!C-*$'0-8!2()).%+E60%$!0%*$'1.2$
ZMSF[ !C*!*#0-!&(0%*!*#$'$!.'$!%(!)(+96$-3!)0%0).6!2('$!19%2*0(%.60*73!.%+!%(!2#.%%$6
)(+96$-!,0*#!,#02#!*(!2())9%02.*$3!L9*!C-*$'0-8!0-!9&!.%+!'9%%0%@
;D$29*0%@!*#$!*"946$5+G"?!2()).%+!.*!*#$!C-*$'0-8!MSF!-#(,-!*#.*!*#$'$!.'$!%(!$DE
*$'%.6!)(+96$-!6(.+$+?
*CLI> module show
Module Description Use Count
0 modules loaded

"$A/$!+(%$!*#0-!-0)&67!*(!+$)(%-*'.*$!*#.*!C-*$'0-8!2.%!L$!'9%!0%!.!/$'7!)0%0).6!-*.*$3
.%+!+($-%A*!'$B90'$!*#$!+(k$%-!(1!)(+96$-!*#.*!.!+$1.96*!0%-*.66!,066!$%.L6$ !S$*A-!-*(&
C-*$'0-8!,0*#!*#$!&"7$5+%"'5 "?!MSF!2()).%+?
*CLI> core stop now

U H(!)0%0).63!0%!1.2*3!*#.*!0*A-!2()&6$*$67!9-$6$--!.*!*#0-!&(0%* !]9*!,$!+0@'$--

54 | Chapter 3:ಗIn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$1!+%$7-+A3!,#02#!0-!'9%!+9'0%@!*#$!- -%!&'(2$--!(1!S0%9D!$.2#!*0)$!7(9!L((*
=#$!+!)$1!+%$7-+A!-2'0&*!&'(/0+$-!*#$!1(66(,0%@!L$%$10*-?
d T$-*.'*-!C-*$'0-8!.9*().*02.667!.1*$'!.!2'.-#
d M.%!L$!2(%10@9'$+!*(!$).06!*#$!.+)0%0-*'.*('!01!.!2'.-#!#.-!(229''$+
d I$10%$-!,#$'$!2'.-#!106$-!.'$!-*('$+!Z#%*'!L7!+$1.96*[
d ;D$29*$-!.!-2'0&*!01!.!2'.-#!#.-!(229''$+
4(9!+(%A*!%$$+!*(!8%(,!*((!)92#!.L(9*!*#0-!-2'0&*3!(*#$'!*#.%!*(!9%+$'-*.%+!*#.*!0*
-#(96+!%(').667!L$!'9%%0%@ !F%!)(-*!$%/0'(%)$%*-!*#0-!-2'0&*!,('8-!10%$!0%!0*-!+$1.96*
1(').*

modules.conf
H(3!,$A/$!).%.@$+!*(!@$*!C-*$'0-8!'9%%0%@3!L9*!0*A-!%(*!.L6$!*(!+(!.%7*#0%@!9-$196!1('
9-!7$* !=(!*$66!C-*$'0-8!,#.*!)(+96$-!,$!$D&$2*!0*!*(!6(.+3!,$A66!%$$+!.!*"946$+(&" )!106$
M'$.*$!*#$!106$!*"946$+(&" )!0%!7(9'!#$%&#!+%$7-+A#!+0'$2*('7!,0*#!*#$!1(66(,0%@!2()).%+
Z'$&6.2$!*#$!mm!,0*#!m!01!7(9!0%-*$.+!,.%*!*(!(/$','0*$!.%!$D0-*0%@!106$[?
$ cat >> /etc/asterisk/modules.conf

=7&$! Z('! &.-*$[! *#$! 1(66(,0%@! 60%$-3! .%+! &'$--! M*'6 n I ! (%! .! %$,! 60%$! ,#$%! 7(9A'$
10%0-#$+?
; The modules.conf file, used to define which modules Asterisk should load (or
; not load).
;
[modules]
autoload=yes

56 | Chapter 3:ಗInstalling Asterisk


Using cat to Quickly Create Files and Add Content to Them
=#$'$!.'$!).%7!2.-$-!0%!.!S0%9D!-7-*$)!,#$'$!0*!0-!%$2$--.'7!*(!2'$.*$!.!106$3!.%+!*#$%
.++!-()$!2(%*$%*!*(!0* !=#0-!0-!2())(%67!+(%$!L7!9-0%@!*#$!%"4&G!2()).%+!*(!2'$.*$
*#$!106$3!.%+!*#$%!(&$%0%@!0*!,0*#!.%!$+0*('!*(!.++!*#$!2(%*$%* !R(,$/$'3!*#$'$!0-!.!6$--E
8%(,%!,.7!(1!+(0%@!*#0-!*#.*!6$*-!7(9!2'$.*$!*#$!106$!.%+!.++!*#$!2(%*$%*!.66!.*!(%2$?
d P-$!*#$!&!%!&'(@'.)!*(!'$+0'$2*!(9*&9*!*(!*#$!106$!7(9!,.%*!Z9-$!SS!*(!.&&$%+3!('
S!*(!(/$','0*$[
d >.-*$!('!*7&$!*#$!2(%*$%*!7(9!,.%*!*(!.++!*(!*#$!106$
d >'$--! M*'6 n I !*(!2()&6$*$!7(9'!2#.%@$-
>'$-*(o!X06$!2'$.*$+!.%+!2(%*$%*!.++$+

=#$! autoload=yes!60%$!,066!*$66!C-*$'0-8!*(!.9*().*02.667!6(.+!.66!)(+96$-!6(2.*$+!0%
*#$!#4+7#6-;#!+%$7-+A#*"946$+#!+0'$2*('7 !F1!7(9!,.%*$+!*(3!7(9!2(96+!6$./$!*#$!106$!608$
*#0-3!.%+!C-*$'0-8!,(96+!-0)&67!6(.+!.%7!)(+96$-!0*!1(9%+!0%!*#$!*"946$+!1(6+$'
"0*#!7(9'!%$,!*"946$+(&" )!106$!0%!&6.2$3!-*.'*0%@!C-*$'0-8!,066!2.9-$!.!,#(6$!-6$,!(1
)(+96$-!*(!L$!6(.+$+ !4(9!2.%!/$'017!*#0-!L7!-*.'*0%@!C-*$'0-8!.%+!'9%%0%@!*#$!*"946$
+G"?!2()).%+?
$ asterisk -c
*CLI> module show
Module Description Use Count
res_speech.so Generic Speech Recognition API 0
res_monitor.so Call Monitoring Resource 0
...
func_math.so Mathematical dialplan function 0
171 modules loaded

"$!%(,!#./$!).%7!)(+96$-!6(.+$+3!.%+!).%7!.++0*0(%.6!+0.6&6.%!.&&602.*0(%-!.%+
19%2*0(%-!.*!(9'!+0-&(-.6 !"$!+(%A*!%$$+!.66!*#$-$!'$-(9'2$-!6(.+$+3!*#(9@#3!-(!6$*A-
106*$'!(9*!-()$!(1!*#$!)('$!(L-29'$!)(+96$-!*#.*!,$!+(%A*!%$$+!.*!*#$!)()$%* !Y(+017
7(9'!*"946$+(&" )!106$!*(!2(%*.0%!*#$!1(66(,0%@!noload!60%$-3!,#02#!,066!*$66!C-*$'0-8!*(
-80&!6(.+0%@!*#$!0+$%*010$+!)(+96$-?
; Resource modules
noload => res_speech.so
noload => res_phoneprov.so
noload => res_ael_share.so
noload => res_clialiases.so
noload => res_adsi.so

; PBX modules
noload => pbx_ael.so
noload => pbx_dundi.so

Base Configuration | 57
; Channel modules
noload => chan_oss.so
noload => chan_mgcp.so
noload => chan_skinny.so
noload => chan_phone.so
noload => chan_agent.so
noload => chan_unistim.so
noload => chan_alsa.so

; Application modules
noload => app_nbscat.so
noload => app_amd.so
noload => app_minivm.so
noload => app_zapateller.so
noload => app_ices.so
noload => app_sendtext.so
noload => app_speech_utils.so
noload => app_mp3.so
noload => app_flash.so
noload => app_getcpeid.so
noload => app_setcallerid.so
noload => app_adsiprog.so
noload => app_forkcdr.so
noload => app_sms.so
noload => app_morsecode.so
noload => app_followme.so
noload => app_url.so
noload => app_alarmreceiver.so
noload => app_disa.so
noload => app_dahdiras.so
noload => app_senddtmf.so
noload => app_sayunixtime.so
noload => app_test.so
noload => app_externalivr.so
noload => app_image.so
noload => app_dictate.so
noload => app_festival.so

=#$'$!.'$3!(1!2(9'-$3!(*#$'!)(+96$-!*#.*!7(9!2(96+!'$)(/$3!.%+!(*#$'-!*#.*!7(9!).7
10%+!$D*'$)$67!9-$1963!-(!1$$6!1'$$!*(!*,$.8!*#0-!106$!.-!7(9!,0-# !F+$.6673!7(9!-#(96+!L$
6(.+0%@!(%67!*#$!)(+96$-!*#.*!7(9!%$$+!1('!*#$!-7-*$)!7(9!.'$!'9%%0%@ !=#$!$D.)&6$-
0%!*#0-!L((8!.--9)$!*#.*!7(9'!*"946$+(&" )!106$!6((8-!608$!(9'!$D.)&6$!#$'$
C++0*0(%.6!0%1(').*0(%!.L(9*!*#$!*"946$+(&" )!106$!2.%!L$!1(9%+!0%!*#$!-$2*0(%!G)(+E
96$- 2(%1J!(%!&.@$!ie

musiconhold.conf
=#$!*4+-&" G"69(&" )!106$!+$10%$-!*#$!26.--$-!1('!)9-02!(%!#(6+!0%!7(9'!C-*$'0-8!-7-*$)
]7!+$10%0%@!+011$'$%*!26.--$-3!7(9!2.%!-&$2017!+011$'$%*!#(6+!)9-02!*(!L$!9-$+!0%!/.'0(9-
-0*9.*0(%-3!-92#!.-!+011$'$%*!.%%(9%2$)$%*-!*(!L$!&6.7$+!,#06$!#(6+0%@!0%!.!B9$9$3!('
+011$'$%*!#(6+!)9-02!01!7(9!#./$!)96*0&6$!>]p-!#(-*$+!(%!*#$!-.)$!-7-*$) !X('!%(,3

58 | Chapter 3:ಗInstalling Asterisk


,$A66!^9-*!2'$.*$!.!+$1.96*!)9-02!(%!#(6+!26.--!-(!*#.*!,$!#./$!.*!.!)0%0)9)!-()$!#(6+
)9-02!,#$%!&6.20%@!2.66$'-!(%!#(6+?
$ cd /etc/asterisk/
$ cat >> musiconhold.conf
; musiconhold.conf
[default]
mode=files
directory=moh

Ctrl + D

"$A/$! 2'$.*$+! .! *4+-&" G"69(&" )! 106$! .%+! +$10%$+! (9'! [default]! #(6+! )9-02! 26.--
"$A'$!.6-(!.--9)0%@!7(9!0%-*.66$+!*#$!#(6+!)9-02!1'()!*#$!*$ 4+$6$&%!-7-*$)5!L7!+$E
1.96*!*#$'$!0-!.*!6$.-*!(%$!)9-02!(%!#(6+!&.28.@$!0%-*.66$+3!-(!9%6$--!7(9!+0-.L6$+!0*3
7(9!-#(96+!#./$!)9-02!0%!.*!6$.-*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0-8!(%67!0%-*.66-!*#$!2('$!-(9%+!&'()&*!106$-3!.%+!(%67!0%!jHY!1(').*
C6-(3!*#$!*#'$$!Q&H(9%+!)9-02!(%!#(6+!106$-!./.06.L6$!1('!+(,%6(.+!.'$!(%67!-$6$2*$+
0%!(?!,!1(').* a

a C!@((+!,.7!*(!&9*!*#$!10%.6!*(92#$-!(%!7(9'!%$,!-7-*$)!0-!*(!0%-*.66!-()$!.&&'(&'0.*$!-(9%+!106$-!*(!L$!9-$+
.-!)9-02!(%!#(6+ !=#$'$!.'$!(%67!*#'$$!-(%@-!0%-*.66$+!L7!+$1.96*3!.%+!2.66$'-!,066!B902867!*0'$!(1!60-*$%0%@!*(
*#$!-.)$!*#'$$!-(%@-!(/$'!.%+!(/$'[email protected]% !"$A66!+0-29--!*#0-!)('$!0%!G)9-02(%#(6+ 2(%1J!(%!&.@$!if

Base Configuration | 59
"$A'$!@(0%@!*(!,.%*!$D*'.!-(9%+!&'()&*-!0%-*.66$+!0%-*$.+!(1!^9-*!*#$!+$1.96*!2('$!-(9%+
&'()&*-3!.%+!0%!.!L$**$'E-(9%+0%@!1(').*!*#.%!jHY !"$!2.%!+(!*#0-!,0*#!*#$!*$ 48
+$6$&%!-7-*$)!L7!'9%%0%@!*!A$5*$ 4+$6$&%!0%!*#$!C-*$'0-8!-(9'2$!+0'$2*('7 !]$1('$!$DE
&6('0%@!*#.*3!*#(9@#3!6$*A-!*.68!.L(9*!*#$!+011$'$%*!*$ 4+$6$&%!0%*$'1.2$-

menuselect interfaces
=#$'$!.'$!*,(!0%*$'1.2$-!./.06.L6$!1('!*$ 4+$6$&%?!29'-$-!.%+!%$,* !F1!*#$!libnewt!60L'.E
'0$-!.'$!0%-*.66$+3!7(9!,066!@$*!*#$!L69$!.%+!'$+!0%*$'1.2$!-#(,%!0%!X0@9'$!NEO !Q*#$',0-$3
L7!+$1.96*!*$ 4+$6$&%!,066!9-$!*#$!29'-$-!ZL6.28!.%+!,#0*$[!0%*$'1.2$!-#(,%!0%!X0@9'$!NEW

=#$!)0%0)9)!-2'$$%!-0k$!1('!*#$!29'-$-!0%*$'1.2$!0-!`lDWi3!,#02#!)$.%-
0*! ).7! %(*! 6(.+! 01! 7(9A'$! 9-0%@! *#$! +$1.96*! *$')0%.6! -0k$! 1('! .! -0)&6$
+0-*'0L9*0(%!0%-*.66.*0(% !=#0-!0-!%(*!.!&'(L6$)!,#$%!7(9A'$!9-0%@!HHR
*(!'$.2#!*#$!-$'/$'!'$)(*$673!.-!*7&02.667!7(9'!*$')0%.6!2.%!L$!'$-0k$+3
L9*! 01! 7(9A'$! ,('80%@! .*! *#$! *$')0%.6! +0'$2*67! 7(9! ).7! %$$+! *(! #./$
-2'$$%!L911$'-!0%-*.66$+!*(!$%.L6$!.!#0@#$'!'$-(69*0(%3!,#02#!0-!%(*!'$2E
())$%+$+! 1('! .! -7-*$)! '9%%0%@! C-*$'0-8 ! =#$! -(69*0(%! 0-! *(! 9-$! *#$
%$,*EL.-$+!*$ 4+$6$&%!-7-*$)

V-E47$5<8=(5*$ 4+$6$&%54+- E5%G$5 $?%5- %$7)!&$

60 | Chapter 3:ಗInstalling Asterisk


V-E47$5<8O(5*$ 4+$6$&%54+- E5%G$5&47+$+5- %$7)!&$

Installing Dependencies for newt-Based menuselect


=(!@$*!*#$!%$,*EL.-$+!*$ 4+$6$&%!,('80%@3!7(9!%$$+!*(!#./$!*#$!libnewt!+$/$6(&)$%*
60L'.'0$-!0%-*.66$+?
d M$%*QH?!sudo yum install libnewt-devel
d PL9%*9?!sudo apt-get install libnewt-dev
F1!7(9A/$!&'$/0(9-67!9-$+!*$ 4+$6$&%!,0*#!*#$!29'-$-!0%*$'1.2$3!7(9!%$$+!*(!'$L906+ !4(9
2.%!+(!*#0-!,0*#!*#$!1(66(,0%@!2()).%+-?
$ cd ~/src/asterisk-complete/asterisk/1.8.<your version>/
$ cd menuselect
$ make clean
$ ./configure
$ cd ..
$ make menuselect

C1*$'!*#.*!7(9!-#(96+!#./$!*#$!%$,*EL.-$+!0%*$'1.2$!./.06.L6$!*(!7(9

Using menuselect
T9%!*#$!1(66(,0%@!2()).%+-!*(!-*.'*!*$ 4+$6$&%?
$ cd ~/src/asterisk-complete/asterisk/1.8.<your version>/
$ make menuselect

Base Configuration | 61
4(9!,066!L$!&'$-$%*$+!,0*#!.!-2'$$%!-92#!.-!*#.*!0%!X0@9'$!NEO!('!X0@9'$!NEW !4(9!2.%
9-$!*#$!.''(,!8$7-!(%!7(9'!8$7L(.'+!*(!)(/$!9&!.%+!+(,% !=#$! '0@#*!.''(, !8$7!,066
*.8$!7(9!0%*(!.!-9L)$%93!.%+!*#$! 6$1*!.''(, !8$7!,066!*.8$!7(9!L.28 !4(9!2.%!9-$!*#$
-&.2$!L.' !('! ;%*$' !8$7!*(!-$6$2*!.%+!+$-$6$2*!)(+96$- !>'$--0%@!*#$! B !8$7!,066!B90*
,0*#(9*!-./0%@3!,#06$!*#$! D !8$7!,066!-./$!7(9'!-$6$2*0(%-!.%+!*#$%!B90*

Module Dependencies
Y(+96$-!*#.*!#./$!XXX!0%!1'(%*!(1!*#$)!.'$!)(+96$-!*#.*!2.%%(*!L$!2()&06$+!L$2.9-$
*#$!&" )-E47$!-2'0&*!,.-!%(*!.L6$!*(!10%+!*#$!+$&$%+$%20$-!'$B90'$+!Z1('!$D.)&6$3!01!7(9
+(%A*!#./$!*#$!4 -.DLWC!+$/$6(&)$%*!&.28.@$!0%-*.66$+3!7(9!,066!%(*!L$!.L6$!*(!2()E
&06$! func_odbcb[ !"#$%$/$'!7(9!0%-*.66!.!+$&$%+$%273!7(9!,066!.6,.7-!%$$+!*(!'$'9%
&" )-E47$!L$1('$!7(9!'9%!*$ 4+$6$&%3!-(!*#.*!*#$!%$,!+$&$%+$%27!,066!L$!&'(&$'67!6(E
2.*$+ !=#$!+$&$%+.%*!)(+96$!,066!.*!*#.*!&(0%*!L$!./.06.L6$!0%!*$ 4+$6$&% !F1!*#$!)(+96$
-$6$2*0(%!-*066!2(%*.0%-!XXX3!$0*#$'!*#$!&" )-E47$!-2'0&*!0-!-*066!9%.L6$!*(!10%+!*#$!+$&$%+E
$%27!('!%(*!.66!+$&$%+$%20$-!#./$!L$$%!-.*0-10$+

Q%2$! 7(9A/$! -*.'*$+! *$ 4+$6$&%3! -2'(66! +(,%! *(! Core Sound Packages! .%+! &'$--! *#$
'0@#*! .''(, ! 8$7! Z('! ;%*$' [! *(! (&$%! *#$! )$%9 ! 4(9! ,066! L$! &'$-$%*$+! ,0*#! .! 60-*! (1
./.06.L6$!(&*0(%- !=#$-$!(&*0(%-!'$&'$-$%*!*#$!2('$!-(9%+!106$-!0%!/.'0(9-!6.%@9.@$-!.%+
1(').*- !]7!+$1.96*3!*#$!(%67!-$*!(1!106$-!-$6$2*$+!0-! CORE-SOUNDS-EN-GSM3!,#02#!0-!*#$
;%@60-#E6.%@9.@$!M('$!H(9%+-!&.28.@$!0%!jHY!1(').*
H$6$2*!CORE-SOUNDS-EN-WAV!.%+!CORE-SOUNDS-EN-ULAW!Z('!ALAW!01!7(9A'$!(9*-0+$!(1!<('*#
C)$'02.!('!:.&.%಩[3!.%+!.%7!(*#$'!-(9%+!106$-!*#.*!).7!L$!.&&602.L6$!0%!7(9'!%$*,('8

=#$!'$.-(%!,$!#./$!)96*0&6$!1(').*-!1('!*#$!-.)$!106$-!0-!*#.*!C-*$'0-8
2.%!&6.7!L.28!*#$!.&&'(&'0.*$!1(').*!+$&$%+0%@!(%!,#02#!2(+$2!0-!%$E
@(*0.*$+!L7!.%!$%+&(0%* !=#0-!2.%!6(,$'!*#$!M>P!6(.+!(%!.!-7-*$)!-0@E
%0102.%*67

C1*$'!-$6$2*0%@!*#$!.&&'(&'0.*$!-(9%+!106$-3!&'$--!*#$! 6$1*!.''(, !8$7!*(!@(!L.28!*(!*#$


).0%!)$%9 !=#$%!-2'(66!+(,%!*,(!60%$-!*(!*#$!Extra Sound Packages!)$%9!.%+!&'$--
*#$! '0@#*!.''(, !8$7!Z('! ;%*$' [ !4(9!,066!%(*02$!*#.*!L7!+$1.96*!*#$'$!.'$!%(!&.28.@$-
-$6$2*$+ !C-!,0*#!*#$!2('$!-(9%+!106$-3!-$6$2*!*#$!.&&'(&'0.*$!6.%@9.@$!.%+!1(').*!*(!L$
0%-*.66$+ !C!@((+!(&*0(%!0-!&'(L.L67!*(!0%-*.66!*#$!;%@60-#!-(9%+!106$-!0%!*#$!WAV3!ULAW3
.%+!ALAW!1(').*-

b "#02#!,$!,066!2(/$'!0%!M#.&*$'!OV3!.6(%@!,0*#!).%7!(*#$'!2((6!*#0%@-
಩ F1! 7(9! ,.%*! *(! 9%+$'-*.%+! .66! .L(9*! )9E6.,! .%+! CE6.,3! 7(9! 2.%! '$.+! *#$! -$2*0(%! GS(@.'0*#)02
2()&.%+0%@J!(%!&.@$!Vli !C66!7(9!%$$+!*(!8%(,!#$'$!0-!*#.*!(9*-0+$!(1!<('*#!C)$'02.!.%+!:.&.%3!CE6.,!0-
9-$+

62 | Chapter 3:ಗInstalling Asterisk


Q%2$! 7(9A/$! 2()&6$*$+! -$6$2*0%@! *#$! -(9%+! 106$-3! &'$--! *#$! D ! 8$7! *(! -./$! .%+! $D0*
*$ 4+$6$&% !4(9!*#$%!%$$+!*(!0%-*.66!7(9'!%$,!&'()&*-!L7!+(,%6(.+0%@!*#$)!1'()!*#$
C-*$'0-8!+(,%6(.+-!-0*$ !=#0-!0-!+(%$!-0)&67!L7!'9%%0%@!*!A$5- +%[email protected]%?
$ sudo make install
$ sudo chown -R asteriskpbx:asteriskpbx /var/lib/asterisk/sounds/

=#$!106$-!,066!L$!+(,%6(.+$+3!$D*'.2*$+3!.%+!0%-*.66$+!0%*(!*#$!.&&'(&'0.*$!6(2.*0(%
Z#,!7#6-;#!+%$7-+A#+"4 9+#R6! E4!E$S#!L7!+$1.96*[ !4(9'!C-*$'0-8!-$'/$'!,066!%$$+!*(!#./$
.!,('80%@!F%*$'%$*!2(%%$2*0(%!0%!('+$'!*(!'$*'0$/$!*#$!106$-

Scripting menuselect
C+)0%0-*'.*('-!(1*$%!L906+!*((6-!,#$%!&$'1(')0%@!0%-*.66.*0(%-!(%!-$/$'.6!).2#0%$-3
.%+!C-*$'0-8!0-!%(!$D2$&*0(% !F1!7(9!%$$+!*(!0%-*.66!C-*$'0-8!(%*(!-$/$'.6!).2#0%$-3!7(9
).7!,0-#!*(!L906+!.!-$*!(1!-2'0&*-!*(!#$6&!.9*().*$!*#0-!&'(2$-- !=#$!*$ 4+$6$&%!-7-*$)
2(%*.0%-!2()).%+E60%$!(&*0(%-!*#.*!7(9!2.%!9-$!*(!$%.L6$!('!+0-.L6$!*#$!)(+96$-!*#.*
.'$!L906*!.%+!0%-*.66$+!L7!C-*$'0-8
F1!7(9!.'$!-*.'*0%@!,0*#!.!1'$-#!2#$28(9*!(1!C-*$'0-83!7(9!)9-*!10'-*!$D$29*$!*#$!&" )-E8
47$!-2'0&*!0%!('+$'!*(!+$*$')0%$!,#.*!+$&$%+$%20$-!.'$!0%-*.66$+!(%!*#$!-7-*$) !=#$%
7(9!%$$+!*(!L906+!*#$!*$ 4+$6$&%!.&&602.*0(%!.%+!'9%!*#$!*!A$5*$ 4+$6$&%8%7$$!2()E
).%+!*(!L906+!*#$!0%0*0.6!*'$$!-*'92*9'$?
$ cd ~/src/asterisk-complete/asterisk/1.8.<your version>/
$ ./configure
$ cd menuselect
$ make menuselect
$ cd ..
$ make menuselect-tree
Generating input for menuselect ...

X('!+$*.06-!.L(9*!*#$!(&*0(%-!./.06.L6$3!'9%!*$ 4+$6$&%#*$ 4+$6$&%588G$6'!1'()!*#$!*(&


6$/$6!(1!7(9'!C-*$'0-8!-(9'2$!+0'$2*('7 !4(9!,066!L$!'$*9'%$+!(9*&9*!608$!*#$!1(66(,0%@?
Usage: menuselect/menuselect [--enable <option>] [--disable <option>]
[--enable-category <category>] [--enable-all]
[--disable-category <category>] [--disable-all] [...]
[<config-file> [...]]
Usage: menuselect/menuselect { --check-deps | --list-options
| --list-category <category> | --category-list | --help }
[<config-file> [...]]

=#$!(&*0(%-!+0-&6.7$+!2.%!*#$%!L$!9-$+!*(!2(%*'(6!,#02#!)(+96$-!.'$!0%-*.66$+!/0.!*#$
*$ 4+$6$&%!.&&602.*0(% !X('!$D.)&6$3!01!7(9!,.%*$+!*(!+0-.L6$!.66!)(+96$-!.%+!0%-*.66
.!L.-$!-7-*$)!Z,#02#!,(96+%A*!L$!(1!)92#!9-$[!7(9!2(96+!9-$!*#$!2()).%+?
$ menuselect/menuselect --disable-all menuselect.makeopts

F1!7(9!*#$%!6((8!.*!*#$!*$ 4+$6$&%(*!A$"'%+!106$3!7(9!,066!-$$!.!6.'@$!.)(9%*!(1!*$D*!*#.*
+0-&6.7-!.66!*#$!)(+96$-!.%+!2.*$@('0$-!*#.*!#./$!L$$%!+0-.L6$+ !S$*A-!-.7!7(9!%(,!,.%*
*(!$%.L6$!*#$!HF>!2#.%%$6!.%+!*#$!Dial()!.&&602.*0(% !;%.L60%@!*#(-$!)(+96$-!2.%!L$

Base Configuration | 63
+(%$!,0*#!*#$!1(66(,0%@!2()).%+3!L9*!L$1('$!+(0%@!*#.*!6((8!.*!*#$!29''$%*!*$ 4+$8
6$&%(*!A$"'%+! Z.1*$'! +0-.L60%@! .66! *#$! )(+96$-[! .%+! 6(2.*$! app_dial! 0%! *#$! MENUSE
LECT_APPS!2.*$@('7!.%+!chan_sip!0%!*#$!MENUSELECT_CHANNELS!2.*$@('7 !C1*$'!$D$29*0%@
*#$!1(66(,0%@!2()).%+3!6((8!.*!*#$!*$ 4+$6$&%(*!A$"'%[email protected]%3!.%+!7(9!,066!-$$
*#.*!*#(-$!)(+96$-!.'$!%(!6(%@$'!60-*$+?
$ menuselect/menuselect --disable-all --enable chan_sip \
--enable app_dial menuselect.makeopts

=#$!)(+96$-!60-*$+!0%!*#$!*$ 4+$6$&%(*!A$"'%+!106$!.'$!*#(-$!*#.*!,066
%(*!L$!L906*q)(+96$-!*#.*!.'$!%(*!60-*$+!,066!L$!L906*!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!7(9!1(66(,!*#$!-.)$!0%-*'92*0(%-!(9*60%$+!0%!*#$!-$2*0(%
GR(,!*(!F%-*.66!F*J!(%!&.@$!K`

C++0*0(%.6673!01!7(9A/$!2#$28$+!(9*!.!%$,!+0'$2*('7!1('!*#0-!/$'-0(%!(1
C-*$'0-8!Z/$'-9-!'9%%0%@!+, 54'!(%!.!2#$28$+E(9*!L'.%2#[3!.%+!&'$/0E
(9-67!9-$+!*$ 4+$6$&%!*(!*,$.8!*#$!)(+96$-!*(!L$!2()&06$+3!7(9!2.%
2(&7!*#$!*$ 4+$6$&%(*!A$"'%+!106$!1'()!(%$!+0'$2*('7!*(!.%(*#$'!&'0('
*(! '9%%0%@! (#&" )-E47$ ! ]7! 2(&70%@! *$ 4+$6$&%(*!A$"'%+! 1'()! *#$! (6+
/$'-0(%!*(!*#$!%$,!/$'-0(%3!7(9!-./$!*#$!-*$&!(1!#./0%@!*(!Z+$[-$6$2*!.66
7(9'!)([email protected]%

64 | Chapter 3:ಗInstalling Asterisk


=#$!L.-02!-*$&-!.'$?
$ cd ~/src/asterisk-complete/asterisk/1.8.<your version number>/
$ ./configure
$ make
$ make install

4(9!+(%A*!%$$+!*(!'9%!+49"5*!A$5- +%!66!L$2.9-$!,$A/$!.6'$.+7!-$*!*#$
+0'$2*('7!(,%$'-#0&!*(!*#$!!+%$7-+A';.!9-$' !4(9!-#(96+!L$!.L6$!*(!0%-*.66
%$,!106$-!+0'$2*67!0%*(!*#$!.&&'(&'0.*$!+0'$2*('0$-

P&(%!0%-*.66.*0(%3!#(,$/$'3!7(9!).7!@$*!.!)$--.@$!608$!*#$!1(66(,0%@?
WARNING WARNING WARNING

Your Asterisk modules directory, located at


/usr/lib/asterisk/modules
contains modules that were not installed by this
version of Asterisk. Please ensure that these
modules are compatible with this version before
attempting to run Asterisk.

chan_mgcp.so
chan_oss.so
chan_phone.so
chan_skinny.so
chan_skype.so
codec_g729a.so
res_skypeforasterisk.so

WARNING WARNING WARNING

=#0-!,.'%0%@!)$--.@$!0-!0%+02.*0%@!*#.*!)(+96$-!0%-*.66$+!0%!*#$!#4+7#6-;#!+%$7-+A#*"98
46$+#!+0'$2*('7!.'$!%(*!2()&.*0L6$!,0*#!*#$!/$'-0(%!7(9A/$!^9-*!0%-*.66$+ !=#0-!)(-*!(1*$%
(229'-!,#$%!7(9!#./$!0%-*.66$+!)(+96$-!0%!(%$!/$'-0(%!(1!C-*$'0-83!.%+!*#$%!0%-*.66$+
.!%$,!/$'-0(%!(1!C-*$'0-8!,0*#(9*!2()&060%@!*#(-$!)(+96$-!Z.-!*#$!0%-*.66.*0(%!&'(2$--
,066!(/$','0*$!.%7!)(+96$-!*#.*!$D0-*$+!&'$/0(9-673!'$&6.20%@!*#$)!,0*#!*#$0'!9&@'.+$+
/$'-0(%-[
=(!@$*!.'(9%+!*#$!,.'%0%@!)$--.@$3!7(9!2.%!26$.'!(9*!*#$!#4+7#6-;#!+%$7-+A#*"946$+#
+0'$2*('7!&'0('!*(!'9%%0%@!*!A$5- +%!66 !=#$'$!0-!.!2./$.*!#$'$3!*#(9@#?!01!7(9A/$!0%-*.66$+
*#0'+E&.'*7!)(+96$-3!-92#!.-!2())$'20.6!)(+96$-!1'()!I0@09)!Z0%269+0%@!chan_skype3
codec_g729a3!$*2 [3!7(9!,066!%$$+!*(!'$0%-*.66!*#(-$!01!7(9A/$!26$.'$+!(9*!7(9'!)(+96$-
+0'$2*('7
F*!0-!'$2())$%+$+!*#.*!7(9!8$$&!.!+0'$2*('7!,0*#!7(9'!*#0'+E&.'*7!)(+96$-!0%!0*!*#.*
7(9!2.%!'$0%-*.66!1'()!9&(%!9&+.*$!(1!7(9'!C-*$'0-8!-7-*$) !H(3!1('!$D.)&6$3!7(9!)0@#*
2'$.*$!*#$!#4+7#+7&#!+%$7-+A8&"*'6$%$#%G-79'!7%3#=(/!+0'$2*('7!.-!1(66(,-?

Updating Asterisk | 65
$ cd ~/src/asterisk-complete/
$ mkdir thirdparty/
$ mkdir thirdparty/1.8/

I(,%6(.+0%@!*#0'+E&.'*7!)(+96$-!0%*(!*#0-!+0'$2*('7!.66(,-!7(9!*(!$.-067!'$0%-*.66!*#(-$
)(+96$-!,#$%!7(9!9&@'.+$ !:9-*!1(66(,!*#$!0%-*.66.*0(%!0%-*'92*0(%-!1('!7(9'!)(+96$3
).%7!(1!,#02#!,066!L$!.-!-0)&6$!.-!'$'9%%0%@!*!A$5- +%!66!1'()!*#$!*"946$+!-(9'2$
+0'$2*('7!('!2(&70%@!*#$!&'$2()&06$+!L0%.'7!*(!*#$!#4+7#6-;#!+%$7-+A#*"946$+#!+0'$2*('7

]$!-9'$!*(!2#.%@$!*#$!106$!&$')0--0(%-!*(!).*2#!*#(-$!(1!*#$!9-$'!'9%%0%@
C-*$'0-8o

Common Issues
F%! *#0-! -$2*0(%! ,$A'$! @(0%@! *(! 2(/$'! -()$! 2())(%! 0--9$-! 7(9! ).7! '9%! 0%*(! ,#06$
2()&060%@!C-*$'0-83!ICRIF3!('!S0L>TF !Y(-*!(1!*#$!0--9$-!7(9A66!'9%!0%*(!#./$!*(!+(
,0*#! )0--0%@! +$&$%+$%20$- ! F1! *#.*! 0-! *#$! 2.-$3! &6$.-$! '$/0$,! GH(1*,.'$! I$&$%+$%E
20$-J!(%!&.@$!KK!*(!).8$!-9'$!7(9A/$!0%-*.66$+!$/$'7*#0%@!7(9!%$$+

C%7! *0)$! 7(9! 0%-*.66! .++0*0(%.6! &.28.@$-3! 7(9! ,066! %$$+! *(! '9%
*#$!(#&" )-E47$!-2'0&*!0%!7(9'!C-*$'0-8!-(9'2$!0%!('+$'!1('!*#$!%$,!&.28.@$
*(!L$!+$*$2*$+

-bash: wget: command not found


=#0-!)$--.@$!)$.%-!7(9!#./$!%(*!0%-*.66$+!*#$!?E$%!.&&602.*0(%3!,#02#!0-!'$B90'$+!1('
7(9!*(!+(,%6(.+!&.28.@$-!1'()!*#$!C-*$'0-8!+(,%6(.+-!-0*$3!1('!C-*$'0-8!*(!+(,%6(.+
-(9%+!106$-3!('!1('!ICRIF!*(!+(,%6(.+!10'),.'$!1('!#.'+,.'$

Ubuntu CentOS
$ sudo apt-get install wget $ sudo yum -y install wget

configure: error: no acceptable C compiler found in $PATH


=#0-!)$.%-!*#.*!*#$!C-*$'0-8!&" )-E47$!-2'0&*!0-!9%.L6$!*(!10%+!7(9'!M!2()&06$'3!,#02#
*7&02.667!)$.%-!7(9!#./$!%(*!7$*!0%-*.66$+!(%$ !]$!-9'$!*(!0%-*.66!*#$!E&&!&.28.@$!1('
7(9'!-7-*$)

Ubuntu CentOS
$ sudo apt-get install gcc $ sudo yum install gcc

66 | Chapter 3:ಗInstalling Asterisk


make: gcc: command not found
=#0-!)$.%-!*#.*!*#$!C-*$'0-8!&" )-E47$!-2'0&*!0-!9%.L6$!*(!10%+!7(9'!M!2()&06$'3!,#02#
*7&02.667!)$.%-!7(9!#./$!%(*!7$*!0%-*.66$+!(%$ !]$!-9'$!*(!0%-*.66!*#$!E&&!&.28.@$!1('
7(9'!-7-*$)

Ubuntu CentOS
$ sudo apt-get install gcc $ sudo yum install gcc

configure: error: C++ preprocessor “/lib/cpp” fails sanity check


=#0-!$''('!0-!&'$-$%*$+!L7!*#$!C-*$'0-8!&" )-E47$!-2'0&*!,#$%!7(9!#./$!%(*!0%-*.66$+!*#$
jMM!Mnn!&'$&'(2$--('

Ubuntu CentOS
$ sudo apt-get install g++ $ sudo yum install gcc-c++

configure: error: *** Please install GNU make. It is required to build Asterisk!
=#0-!$''('!0-!$%2(9%*$'$+!,#$%!7(9!#./$!%(*!0%-*.66$+!*#$!*!A$!.&&602.*0(%3!,#02#!0-
'$B90'$+!*(!L906+!C-*$'0-8

Ubuntu CentOS
$ sudo apt-get install make $ sudo yum install make

configure: *** XML documentation will not be available because the


‘libxml2’ development package is missing.
4(9!,066!$%2(9%*$'!*#0-!$''('!,#$%!*#$!pYS!&.'-$'!60L'.'0$-!.'$!%(*!0%-*.66$+ !=#$-$
.'$!'$B90'$+!L7!C-*$'0-8!O `!.%+!6.*$'3!-0%2$!2(%-(6$!+(29)$%*.*0(%!Z$ @ 3!,#$%!7(9
'9%!&"7$5+G"?5!''6-&!%-" 59-!6!(%!*#$!C-*$'0-8!MSF[!0-!@$%$'.*$+!1'()!pYS

Ubuntu CentOS
$ sudo apt-get install libxml2-dev $ sudo yum install libxml2-devel

configure: error: *** termcap support not found


=#0-!$''('!#.&&$%-!,#$%!7(9!+(%A*!#./$!*#$! ncurses!+$/$6(&)$%*!60L'.'7!0%-*.66$+3
,#02#!0-!'$B90'$+!L7!*$ 4+$6$&%!.%+!1('!(*#$'!2(%-(6$!(9*&9*!0%!C-*$'0-8

Ubuntu CentOS
$ sudo apt-get install ncurses-dev $ sudo yum install ncurses-devel

Common Issues | 67
You do not appear to have the sources for the 2.6.18-164.6.1.el5 kernel
installed.
4(9!,066!@$*!*#0-!$''('!,#$%!.**$)&*0%@!*(!L906+!ICRIF!,0*#(9*!#./0%@!0%-*.66$+!*#$
S0%9D!#$.+$'-3!,#02#!.'$!'$B90'$+!1('!L906+0%@!S0%9D!+'0/$'-

Ubuntu CentOS
$ sudo apt-get install linux-headers-`uname -r` $ sudo yum install kernel-devel

E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?


F1!7(9!$%2(9%*$'!*#0-!$''('!0*A-!608$67!*#.*!7(9!1('@(*!*(!&'$&$%+!+49"!*(!*#$!-*.'*!(1!*#$
2()).%+!7(9!,$'$!'9%%0%@3!,#02#!'$B90'$-!'((*!&$')0--0(%-

Upgrading Asterisk
P&@'.+0%@!C-*$'0-8!L$*,$$%!).^('!/$'-0(%-3!-92#!.-!1'()!O W!*(!O K!('!1'()!O V W!*(
O `!0-!.80%!*(!9&@'.+0%@!.%!(&$'.*0%@!-7-*$) !Q%2$!.!&#(%$!-,0*2#!0-!0%!&'(+92*0(%3!0*
0-!*$''0L67!+0-'9&*0/$!1('!*#.*!-7-*$)!*(!L$!9%./.06.L6$!1('!%$.'67!.%7!6$%@*#!(1!*0)$3!.%+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!.!19%2E
*0(%.6!C-*$'0-8!-7-*$)!*#.*!,066!-$'/$!9-!,$66 !F%!*#$!1(66(,0%@!2#.&*$'-!,$!,066!$D&6('$

gY('$!0%1(').*0(%!.L(9*!C-*$'0-8!'$6$.-$-!.%+!*#$0'!-9&&('*!-2#$+96$!0-!./.06.L6$!.*!G%%'+H##?-A-(!+%$7-+A("7E#
?-A-#9-+'6!3#@>:#@+%$7-+AQ[$7+-" +

Conclusion | 69
#(,!*(!2(%%$2*!+$/02$-!*(!(9'!C-*$'0-8!-7-*$)!0%!('+$'!*(!-*.'*!&6.20%@!2.66-!0%*$'%.667
.%+!#(,!*(!2(%%$2*!C-*$'0-8!*(!(9*-0+$!-$'/02$-!0%!('+$'!*(!&6.2$!&#(%$!2.66-!*(!$%+E
&(0%*-!2(%%$2*$+!*(!*#$!>H=<!.%+!.22$&*!2.66-!1'()!*#(-$!$%+&(0%*-

70 | Chapter 3:ಗInstalling Asterisk


CHAPTER 4
Initial Configuration Tasks

C!7$)46(5\$59" ]%5?! %5%"56$!7 5)7"*5%G-+(


qM.6/0%!r!R(LL$-

F%!*#$!6.-*!2#.&*$'3!,$!2(/$'$+!#(,!*(!0%-*.66!C-*$'0-8 !]9*!,#$'$!-#(96+!7(9!@$*!-*.'*$+
,0*#!2(%10@9'.*0(%s!=#.*!0-!*#$!B9$-*0(%!*#0-!2#.&*$'!.%-,$'- !=#$'$!.'$!.!1$,!2())(%
2(%10@9'.*0(%!106$-!*#.*!.'$!'$6$/.%*!'$@.'+6$--!(1!,#.*!7(9!.'$!9-0%@!C-*$'0-8!*(!.2E
2()&60-# !F%!-()$!2.-$-!*#$7!).7!%(*!'$B90'$!.%7!)(+0102.*0(%3!L9*!7(9!%$$+!*(!L$
.,.'$!(1!*#$)

asterisk.conf
=#$!!+%$7-+A(&" )!2(%10@9'.*0(%!106$!.66(,-!7(9!*(!*,$.8!/.'0(9-!-$**0%@-!*#.*!2.%!.11$2*
#(,!C-*$'0-8!'9%-!.-!.!,#(6$
=#$'$!0-!.!-.)&6$!!+%$7-+A(&" )!106$!0%269+$+!,0*#!*#$!C-*$'0-8!-(9'2$ !F*!0-!%(*!%$2$--.'7
*(!#./$!*#0-!106$!0%!7(9'!#$%&#!+%$7-+A!1(6+$'!0%!('+$'!*(!#./$!.!,('80%@!-7-*$)3!L9*!7(9
).7!10%+!*#.*!-()$!(1!*#$!&(--0L6$!(&*0(%-!,066!L$!(1!9-$!*(!7(9

C-*$'0-8!,066!6((8!1('!!+%$7-+A(&" )!0%!*#$!+$1.96*!2(%10@9'.*0(%!6(2.*0(%3
,#02#!0-!9-9.667!#$%&#!+%$7-+A !=(!-&$2017!.!+011$'$%*!6(2.*0(%!1('!!+%$78
-+A(&" )3!9-$!*#$!8C!2()).%+E60%$!(&*0(%?
$ sudo asterisk -C /custom/path/to/asterisk.conf

The [directories] Section


X('!)(-*!0%-*.66.*0(%-!(1!C-*$'0-83!2#.%@0%@!*#$!+0'$2*('0$-!0-!%(*!%$2$--.'7 !R(,$/$'3
*#0-!2.%!L$!9-$196!1('!'9%%0%@!)('$!*#.%!(%$!0%-*.%2$!(1!C-*$'0-8!.*!*#$!-.)$!*0)$3!('
01!7(9!,(96+!608$!106$-!-*('$+!0%!%(%-*.%+.'+!6(2.*0(%-

71
=#$!+$1.96*!+0'$2*('7!6(2.*0(%-!.%+!*#$!(&*0(%-!7(9!2.%!9-$!*(!)(+017!*#$)!.'$!60-*$+
0%!=.L6$!KEO !X('!.++0*0(%.6!0%1(').*0(%!.L(9*!*#$!9-.@$!(1!*#$-$!+0'$2*('0$-3!-$$!*#$
X06$!H*'92*9'$!-$2*0(%!(1!M#.&*$'!W
:!;6$528=(5!+%$7-+A(&" )5^9-7$&%"7-$+_5+$&%-"
Option Value/Example Notes
astetcdir /etc/asterisk The location where the Asterisk configuration files are stored.
astmoddir /usr/lib/asterisk/ The location where loadable modules are stored.
modules
astvarlibdir /var/lib/asterisk The base location for variable state information used by various parts of Asterisk.
This includes items that are written out by Asterisk at runtime.
astdbdir /var/lib/asterisk Asterisk will store its internal database in this directory as a file called astdb.
astkeydir /var/lib/asterisk Asterisk will use a subdirectory called keys in this directory as the default location
for loading keys for encryption.
astdatadir /var/lib/asterisk This is the base directory for system-provided data, such as the sound files that
come with Asterisk.
astagidir /var/lib/asterisk/ Asterisk will use a subdirectory called agi-bin in this directory as the default
agi-bin location for loading AGI scripts.
astspooldir /var/spool/asterisk The Asterisk spool directory, where voicemail, call recordings, and the call orig-
ination spool are stored.
astrundir /var/run/asterisk The location where Asterisk will write out its UNIX control socket as well as its
process ID (PID) file.
astlogdir /var/log/asterisk The directory where Asterisk will store its log files.

The [options] Section


=#0-!-$2*0(%!(1!*#$!!+%$7-+A(&" )!106$!2(%10@9'$-!+$1.96*-!1('!@6(L.6!'9%*0)$!(&*0(%- !=#$
./.06.L6$! (&*0(%-! .'$! 60-*$+! 0%! =.L6$! KEW ! Y(-*! (1! *#$-$! .'$! .6-(! 2(%*'(66.L6$! /0.
2()).%+E60%$! &.'.)$*$'-! *(! *#$! !+%$7-+A! .&&602.*0(% ! X('! .! 2()&6$*$! 60-*! (1! *#$
2()).%+E60%$!(&*0(%-!*#.*!'$6.*$!*(!*#$-$!(&*0(%-3!-$$!*#$!C-*$'0-8!).%&.@$?
$ man asterisk

:!;6$528O(5!+%$7-+A(&" )5^"'%-" +_5+$&%-"


Option Value/Example Notes
verbose 3 Sets the default verbose setting for the Asterisk logger. This value is also set by
the -v command-line option. The verbose level is 0 by default.
debug 3 Sets the default debug setting for the Asterisk logger. This value is also set by
the -d command-line option. The debug level is 0 by default.
alwaysfork yes Forking forces Asterisk to always run in the background. This option is set to
no by default.
nofork yes Forces Asterisk to always run in the foreground. This option is set to no by default.

72 | Chapter 4:ಗInitial Configuration Tasks


Option Value/Example Notes
quiet yes Quiet mode reduces the amount of output seen at the console when Asterisk is
run in the foreground. This option is set to no by default.
timestamp yes Adds timestamps to all output except output from a CLI command. This option
is set to no by default.
execincludes yes Enables the use of #exec in Asterisk configuration files. This option is set to
no by default.
console yes Runs Asterisk in console mode. Asterisk will run in the foreground and will
present a prompt for CLI commands. This option is set to no by default.
highpriority yes Runs the Asterisk application with real-time priority. This option is set to no by
default.
initcrypto yes Loads keys from the astkeydir at startup. This option is set to no by default.a
nocolor yes Suppresses color output from the Asterisk console. This is useful when saving
console output to a file. This option is set to no by default.
dontwarn yes Disables a few warning messages. This option was put in place to silence warn-
ings that are generally correct, but may be considered to be so obvious that
they become an annoyance. This option is set to no by default.
dumpcore yes Tells Asterisk to generate a core dump in the case of a crash. This option is set
to no by default.b
languageprefix yes Configures how the prompt language is used in building the path for a sound
file. By default, this is yes, which places the language before any subdirectories,
such as en/digits/1.gsm. Setting this option to no causes Asterisk to behave as
it did in previous versions, placing the language as the last directory in the path,
(e.g. digits/en/1.gsm).
internal_timing yes Uses a timing source to synchronize audio that will be sent out to a channel in
cases such as file playback or music on hold. This option is set to yes by default
and should be left that way; its usefulness has greatly diminished over the last
few major versions of Asterisk.
systemname my_system_name Gives this instance of Asterisk a unique name. When this has been set, the system
name will be used as part of the uniqueid field for channels. This is incredibly
useful if more than one system will be logging CDRs to the same database table.
By default, this option is not set.
autosystemname yes Automatically sets the system name by using the hostname of the system. This
option is set to no by default.
maxcalls 100 Sets a maximum number of simultaneous inbound channels. No limit is set by
default.
maxload 0.9 Sets a maximum load average. If the load average is at or above this threshold,
Asterisk will not accept new calls. No threshold is set by default.
maxfiles 1000 Set the maximum number of file descriptors that Asterisk is allowed to have
open. The default limit imposed by the system is commonly 1024, which is not
enough for heavily loaded systems. It is common to set this limit to a very high
number. The default system-imposed limit is used by default.

asterisk.conf | 73
Option Value/Example Notes
minmemfree 1 Sets the minimum number of megabytes of free memory required for Asterisk
to continue accepting calls. If Asterisk detects that there is less free memory
available than this threshold, new calls will not be accepted. This option is not
set by default.
cache_record_files yes When doing recording, stores the file in the record_cache_dir until re-
cording is complete. Once complete, it will be moved into the originally specified
destination. The default for this option is no.
record_cache_dir /tmp Sets the directory to be used when cache_record_files is set to yes. The
default location is a directory called tmp within the astspooldir.
transmit_silence yes Transmits silence to the caller in cases where there is no other audio source.
This includes call recording and the Wait() family of dialplan applications,
among other things. The default for this option is no.c
transcode_via_sln yes When building a codec translation path, forces signed linear to be one of the
steps in the path. The default for this option is yes.
runuser asterisk Sets the system user that the Asterisk application should run as. This option is
not set by default, meaning that the application will continue to run as the user
that executed the application.
rungroup asterisk Sets the system group that the Asterisk application should run as. This option
is not set by default.
lightbackground yes When using colors in the Asterisk console, it will output colors that are com-
patible with a light-colored background. This option is set to no by default, in
which case Asterisk uses colors that look best on a black background.
documenta- en_US The built-in documentation for Asterisk applications, functions, and other things
tion_language is included in an external XML document. This option specifies the preferred
language for documentation. If it is not available, the default of en_US will be
used.
hideconnect yes Setting this option to yes causes Asterisk to not display notifications of remote
console connections and disconnections at the Asterisk CLI. This is useful on
systems where there are scripts that use remote consoles heavily. The default
setting is no.
lockconfdir no When this option is enabled, the Asterisk configuration directory will be pro-
tected with a lock. This helps protect against having more than one application
attempting to write to the same file at the same time. The default value is no.
a If any of the keys require a passphrase, this will block the startup process of Asterisk. An alternative is to run keys init at the Asterisk command
line.
b This is critical for debugging crashes. However, Asterisk must be compiled with the DONT_OPTIMIZE option enabled in menuselect for
the core dump to be useful.
c There is an important caveat to note when this option is enabled. The silence is generated in uncompressed signed linear format, which
means that it will have to be transcoded into the format that the caller’s channel expects. The result may be that transcoding is required
for a call that would not normally require it.

74 | Chapter 4:ಗInitial Configuration Tasks


The [files] Section
=#0-!-$2*0(%!(1!!+%$7-+A(&" )!0%269+$-!(&*0(%-!'$6.*$+!*(!*#$!C-*$'0-8!2(%*'(6!-(28$* !F*
0-!&'0).'067!9-$+!L7!'$)(*$!2(%-(6$-!Z!+%$7-+A587[ !=#$!./.06.L6$!(&*0(%-!.'$!60-*$+!0%
=.L6$!KEN
:!;6$528<(5!+%$7-+A(&" )5^)-6$+_5+$&%-"
Option Value/Example Notes
astctlpermissions 0660 Sets the permissions for the Asterisk control socket.
astctlowner root Sets the owner for the Asterisk control socket.
astctlgroup apache Sets the group for the Asterisk control socket.
astctl asterisk.ctl Sets the filename for the Asterisk control socket. The default is asterisk.ctl.

The [compat] Section


Q22.-0(%.667!*#$!C-*$'0-8!+$/$6(&)$%*!*$.)!+$20+$-!*#.*!*#$!L$-*!,.7!1(',.'+!0%/(6/$-
).80%@!.!2#.%@$!*#.*!0-!%(*!L.28,.'+E2()&.*0L6$ !=#0-!-$2*0(%!2(%*.0%-!-()$!(&*0(%-
Z60-*$+!0%!=.L6$!KEK[!*#.*!.66(,!'$/$'*0%@!L$#./0('!(1!2$'*.0%!)(+96$-!L.28!*(!&'$/0(9-
L$#./0('
:!;6$5282(5!+%$7-+A(&" )5^&"*'!%_5+$&%-"
Option Value/Example Notes
pbx_realtime 1.6 In versions earlier than Asterisk 1.6.x, the pbx_realtime module would automatically
convert pipe characters into commas for arguments to Asterisk applications. This is no
longer done by default. To enable this previous behavior, set this option to 1.4.
res_agi 1.6 In versions earlier than Asterisk 1.6.x, the EXEC AGI command would automatically convert
pipe characters into commas for arguments to Asterisk applications. This is no longer done
by default. To enable this previous behavior, set this option to 1.4.
app_set 1.6 Starting with the Asterisk 1.6.x releases, the Set() application only allows setting the
value of a single variable. Previously, Set() would allow setting more than one variable
by separating them with a &. This was done to allow any characters in the value of a
variable, including the & character, which was previously used as a separator. MSet() is
a new application that behaves like Set() used to. However, setting this option to
1.4 makes Set() behave like MSet().

modules.conf
=#0-!106$!0-!%(*!-*'02*67!'$B90'$+!0%!.%!C-*$'0-8!0%-*.66.*0(%5!#(,$/$'3!,0*#(9*!.%7!)(+E
96$-!C-*$'0-8!,(%A*!'$.667!L$!.L6$!*(!+(!.%7*#0%@3!-(!1('!.66!&'.2*02.6!&9'&(-$-3!7(9!%$$+
.!*"946$+(&" )!106$!0%!7(9'!#$%&#!+%$7-+A!1(6+$' !F1!7(9!-0)&67!+$10%$!autoload=yes!0%!7(9'
*"946$+(&" )!106$3!C-*$'0-8!,066!-$.'2#!1('!.66!)(+96$-!0%!*#$!#4+7#6-;#!+%$7-+A#*"946$+
1(6+$'!.%+!6(.+!*#$)!.*!-*.'*9&

modules.conf | 75
C6*#(9@#!)(-*!)(+96$-!+(!%(*!9-$!)92#!0%!*#$!,.7!(1!'$-(9'2$-3!.%+!*#$7!.66!6(.+
/$'7!B9028673!0*!^9-*!-$$)-!26$.%$'!*(!(9'!)0%+-!*(!6(.+!(%67!*#(-$!)(+96$-!*#.*!7(9
.'$!&6.%%0%@!(%!9-0%@!0%!7(9'!-7-*$) !C++0*0(%.6673!*#$'$!.'$!-$29'0*7!L$%$10*-!*(!%(*
6(.+0%@!)(+96$-!*#.*!.22$&*!2(%%$2*0(%-!(/$'!.!%$*,('8
F%!*#$!&.-*!,$!1$6*!*#.*!$D&6020*67!6(.+0%@!$.2#!+$-0'$+!)(+96$!,.-!*#$!L$-*!,.7!*(!#.%+6$
*#0-3!L9*!,$!#./$!-0%2$!1(9%+!*#.*!*#0-!&'.2*02$!2'$.*$-!$D*'.!,('8 !C1*$'!$/$'7!9&@'.+$
,$!1(9%+!(9'-$6/$-!#./0%@!*(!$+0*!*#$!*"946$+(&" )!106$!*(!2(''$2*!.66!*#$!)(+96$!+01E
1$'$%2$-!L$*,$$%!'$6$.-$-3!.%+!*#$!,#(6$!&'(2$--!$%+$+!9&!L$0%@!%$$+6$--67!2()&60E
2.*$+ !"#.*!,$!&'$1$'!*(!+(!*#$-$!+.7-!0-!*(!.66(,!C-*$'0-8!*(!.9*().*02.667!6(.+!*#$
)(+96$-!*#.*!0*!10%+-3!L9*!*(!$D&6020*67!*$66!C-*$'0-8!%(*!*(!6(.+!.%7!)(+96$-!,$!+(!%(*
,.%*!6(.+$+!L7!9-$!(1!*#$!noload!+0'$2*0/$ !C!-.)&6$!*"946$+(&" )!106$!2.%!L$!1(9%+!0%
G)(+96$- 2(%1J!(%!&.@$!eV

Using menuselect to Control Which Modules Are Compiled and Installed


Q%$!(*#$'!,.7!*#.*!7(9!2.%!2(%*'(6!,#02#!)(+96$-!C-*$'0-8!6(.+-!0-!*(!-0)&67!%(*
2()&06$!.%+!0%-*.66!*#$)!0%!*#$!10'-*!&6.2$ !I9'0%@!*#$!C-*$'0-8!0%-*.66.*0(%!&'(2$--3!*#$
*!A$5 *$ 4+$6$&%! 2()).%+! &'(/0+$-! 7(9! ,0*#! .! )$%9! 0%*$'1.2$! *#.*! .66(,-! 7(9! *(
-&$2017!).%7!+011$'$%*!+0'$2*0/$-!*(!*#$!2()&06$'3!0%269+0%@!,#02#!)(+96$-!*(!2()&06$
.%+!0%-*.66 !F1!7(9!%$/$'!2()&06$!.%+!0%-*.66!.!)(+96$3!*#$!$11$2*!(1!*#0-!.*!6(.+!*0)$!0-
*#.*!0*!,(%A*!$D0-*3!.%+!*#$'$1('$!,(%A*!L$!6(.+$+ !F1!7(9!.'$!%$,!*(!S0%9D!.%+!C-*$'0-83
*#0-!).7!2'$.*$!2(%19-0(%!1('!7(9!01!7(9!6.*$'!,.%*!*(!9-$!.!)(+96$!.%+!+0-2(/$'!*#.*
0*!+($-%A*!$D0-*!(%!7(9'!-7-*$)
Y('$!0%1(').*0(%!.L(9*!*$ 4+$6$&%!0-!./.06.L6$!0%!G).8$!)$%9-$6$2*J!(%!&.@$!ef

The [modules] Section


=#$!*"946$+(&" )!106$!2(%*.0%-!.!-0%@6$!-$2*0(% !=#$!(&*0(%-!./.06.L6$!0%!*#0-!-$2*0(%!.'$
60-*$+!0%!=.L6$!KEe !"0*#!*#$!$D2$&*0(%!(1!autoload3!.66!(1!*#$!(&*0(%-!).7!L$!-&$2010$+
)('$!*#.%!(%2$

C!60-*!(1!.66!6(.+.L6$!)(+96$-!0-!./.06.L6$!0%!M#.&*$'!W3!,0*#!%(*$-!(%
(9'!(&0%0(%!'$@.'+0%@!*#$!&(&96.'0*7\-*.*9-!(1!$.2#!(1!*#$)

76 | Chapter 4:ಗInitial Configuration Tasks


:!;6$528`(5*"946$+(&" )5^*"946$+_5+$&%-"
Option Value/Example Notes
autoload yes Instead of explicitly listing which modules to load, you can use this directive to tell Asterisk
to load all modules that it finds in the modules directory, with the exception of modules listed
as not to be loaded using the noload directive. The default, and our recommendation, is to
set this option to yes.
preload res_odbc.so Indicates that a module should be loaded at the beginning of the module load order. This
directive is much less relevant than it used to be; modules now have a load priority built into
them that solves the problems that this directive was previously used to solve.
load chan_sip.so Defines a module that should be loaded. This directive is only relevant if autoload is set to
no.
noload chan_alsa.so Defines a module that should not be loaded. This directive is only relevant if autoload is
set to yes.
require chan_sip.so Does the same thing as load; additionally, Asterisk will exit if this module fails to load for
some reason.
preload- res_odbc.so Does the same thing as preload; additionally, Asterisk will exit if this module fails to load
require for some reason.

indications.conf
=#$!-(9%+-!*#.*!&$(&6$!$D&$2*!1'()!*#$!*$6$&#(%$!%$*,('8!/.'7!0%!+011$'$%*!&.'*-!(1
*#$!,('6+ !I011$'$%*!2(9%*'0$-!('!'$@0(%-!&'$-$%*!+011$'$%*!-(9%+-!1('!$/$%*-!-92#!.-
+0.6*(%$3!L9-7!-0@%.63!'0%@L.283!2(%@$-*0(%3!.%+!-(!1('*#
=#$!- 9-&!%-" +(&" )!106$!+$10%$-!*#$!&.'.)$*$'-!1('!*#$!/.'0(9-!-(9%+-!*#.*!.!*$6$&#(%$
-7-*$)!)0@#*!L$!$D&$2*$+!*(!&'(+92$3!.%+!.66(,-!7(9!*(!29-*()0k$!*#$) !F%!*#$!$.'67
+.7-!(1!C-*$'0-8!*#0-!106$!(%67!2(%*.0%$+!-(9%+-!1('!.!60)0*$+!%9)L$'!(1!2(9%*'0$-3!L9*
0*!0-!%(,!B90*$!2()&'$#$%-0/$
=(!.--0@%!*#$!*(%$-!2())(%!1('!7(9'!'$@0(%!*(!2#.%%$6-3!7(9!2.%!-0)&67!.--0@%!*#$
*(%$k(%$!9-0%@!*#$!CHANNEL()!19%2*0(%3!.%+!*#.*!*(%$k(%$!,066!.&&67!1('!*#$!+9'.*0(%
(1!*#$!2.66!Z9%6$--!2#.%@$+!6.*$'[?
Set(CHANNEL(tonezone)=[yourcountry]) ; i.e., uk, de, etc.

R(,$/$'3!-0%2$!-0@%.60%@!1'()!.!2.66!2(96+!2()$!1'()!/.'0(9-!&6.2$-!Z1'()!*#$!2.''0$'3
1'()! C-*$'0-83! ('! $/$%! 1'()! *#$! -$*! 0*-$61[3! 7(9! -#(96+! %(*$! *#.*! -0)&67! -$**0%@! *#$
*(%$k(%$!0%!7(9'!+0.6&6.%!+($-!%(*!@9.'.%*$$!*#.*!*#(-$!*(%$-!,066!L$!&'$-$%*$+!0%!.66
-0*9.*0(%-

indications.conf | 77
Hacking indications.conf for Fun and Profit
F1!7(9!#./$!*((!)92#!*0)$!(%!7(9'!#.%+-3!7(9!2.%!+(!.66!-('*-!(1!&(0%*6$--!L9*!$%*$'E
*.0%0%@! *#0%@-! ,0*#! 7(9'! 0%+02.*0(%- ! X('! $D.)&6$3! 1.%-! (1! >%!75 \!7+! 2.%! ).8$! *#$
1(66(,0%@!2#.%@$!*(!*#$!$%+!(1!*#$0'!- 9-&!%-" +(&" )!106$-?
[starwars](us)
description = Star Wars Theme Song
ring = 262/400,392/500,0/100,349/400,330/400,294/400,524/400,392/500,0/100,349/400, \
330/400,294/400,524/400,392/500,0/100,349/400,330/400,349/400,294/500,0/2000

F1!7(9!*#$%!9-$!*#$!2(9%*'7!%.)$+!tstarwarst!0%!7(9'!2(%10@9'.*0(%!106$-!('!+0.6&6.%3!.%7
'0%@0%@!7(9!&.--!L.28!,066!-(9%+!B90*$!+011$'$%*!1'()!*#$!-*.%+.'+!'0%@!7(9!.'$!9-$+
*( !='7!*#$!1(66(,0%@!+0.6&6.%!2(+$!*(!*$-*!(9*!7(9'!%$,!'0%@0%@!-(9%+?
exten => 500,1,Answer()
same => n,Set(CHANNEL(tonezone)=starwars)
same => n,Dial(SIP/0000FFFF0002) ; or whatever your channel is named in sip.conf

I$&$%+0%@!(%!*#$!*7&$!(1!+$/02$!9-$+!*(!2.66!0%*(!*#0-!$D.)&6$3!7(9
).7!,(%+$'!01!0*!,066!.2*9.667!,('8 !HF>!&#(%$-3!1('!$D.)&6$3!*7&0E
2.667!@$%$'.*$!*#$0'!(,%!*(%$-!0%-*$.+!(1!#./0%@!C-*$'0-8!@$%$'.*$
*#$) !=#0-!$D.)&6$!,.-!2.'$19667!2'.1*$+!*(!$%-9'$!*#.*!C-*$'0-8!,066
@$%$'.*$!.!'0%@L.28!*(%$!*(!*#$!2.66$' !=#$!8$7!0-!*#$!Answer()!*#.*!0-
$D$29*$+!10'-* !S.*$'3!,#$%!.%!(9*L(9%+!2.66!0-!).+$!*(!.%(*#$'!+$E
/02$3!*#$!(%67!)$*#(+!C-*$'0-8!#.-!./.06.L6$!*(!&.--!L.28!.!'0%@0%@
0%+02.*0(%!*(!*#$!2.66$'!0-!L7!@$%$'.*0%@!0%L.%+!.9+0(3!-0%2$!.-!1.'!.-
*#$!2.66$'A-!&#(%$!0-!2(%2$'%$+3!*#0-!2.66!#.-!.6'$.+7!L$$%!.%-,$'$+

"#06$!C-*$'0-8!,066!'9%!,0*#(9*!.%!- 9-&!%-" +(&" )!106$3!0*!0-!-*'(%@67!'$2())$%+$+!*#.*


7(9!0%269+$!(%$?!2(&7!*#$!-.)&6$!(/$'!1'()!#4+7#+7&#!+%$7-+A8&"*'6$%$#=(/#&" )-E+#- 9-8
&!%-" +(&" )(+!*'6$3!)(+017!*#$! country!&.'.)$*$'!0%!*#$! [general]!-$2*0(%!*(!).*2#
7(9'!'$@0(%3!.%+!'$-*.'*!C-*$'0-8

chan_dahdi Ignores indications.conf


ICRIF!+($-!%(*!9-$!*#$!- 9-&!%-" +(&" )!106$!1'()!C-*$'0-83!L9*!'.*#$'!#.-!*#$!*(%$-
2()&06$+!0% !X('!)('$!0%1(').*0(%3!-$$!M#.&*$'!i

F1! 7(9'! -7-*$)! -9&&('*-! )96*0&6$! 2(9%*'0$-! Z1('! $D.)&6$3! 01! 7(9! #./$! .! 2$%*'.60k$+
C-*$'0-8!-7-*$)!*#.*!#.-!9-$'-!1'()!+011$'$%*!'$@0(%-[3!7(9!).7!%(*!L$!.L6$!*(!-0)&67
+$10%$!*#$!+$1.96*!2(9%*'7 !F%!*#0-!2.-$3!7(9!#./$!.!2(9&6$!(1!(&*0(%-?
O I$10%$!*#$!2(9%*'7!0%!*#$!2#.%%$6!+$10%0*0(%!106$!1('!*#$!9-$'
W I$10%$!*#$!2(9%*'7!0%!*#$!+0.6&6.%!9-0%@!*#$!CHANNEL(tonezone)!19%2*0(%

78 | Chapter 4:ಗInitial Configuration Tasks


X('!)('$!0%1(').*0(%!.L(9*!9-0%@!C-*$'0-8!0%!+011$'$%*!2(9%*'0$-3!-$$!M#.&*$'!f

musiconhold.conf
F1!7(9!&6.%!(%!-$660%@!C-*$'0-8EL.-$+!*$6$&#(%$!-7-*$)-!.%+!7(9!+(!%(*!2#.%@$!*#$
+$1.96*!)9-02!(%!#(6+!*#.*!-#0&-!,0*#!C-*$'0-83!7(9!.'$!-$%+0%@!*#$!)$--.@$3!6(9+!.%+
26$.'3!*#.*!7(9!+(%A*!'$.667!8%(,!,#.*!7(9!.'$!+(0%@ h
>.'*!(1!*#$!&'(L6$)!,0*#!)9-02!(%!#(6+!0-!*#.*!,#06$!0%!*#$!&.-*!0*!,.-!2())(%!*(!^9-*
&69@!.!'.+0(!('!MI!&6.7$'!0%*(!*#$!&#(%$!-7-*$)3!*#[email protected]!'$.60*7!0-!*#.*!)(-*!)9-02
602$%-$-!+(!%(*!.2*9.667!.66(,!7(9!*(!+(!*#0- !=#.*A-!'0@#*?!01!7(9!,.%*!*(!&6.7!)9-02!(%
#(6+3!-()$L(+73!-()$,#$'$3!*7&02.667!,.%*-!7(9!*(!&.7!*#$)!1('!*#$!&'0/06$@$
H(!#(,!*(!+$.6!,0*#!*#0-s!=#$'$!.'$!*,([email protected]!,.7-?!O[!&.7!1('!.!)9-02!(%!#(6+!602$%-$
1'()!*#$!2(&7'0@#*!#(6+$'3!('!W[!10%+!.!-(9'2$!(1!)9-02!*#.*!0-!'$6$.-$+!9%+$'!.!602$%-$
-90*.L6$!1('!C-*$'0-8
"$A'$!%(*!#$'$!*(!@0/$!7([email protected]!.+/02$5!7(9!.'$!'$-&(%-0L6$!1('!9%+$'-*.%+0%@!,#.*!0-
'$B90'$+!(1!7(9!0%!('+$'!*(!9-$!.!&.'*0296.'!&0$2$!(1!)9-02!.-!7(9'!)9-02!(%!#(6+!-(9'2$
"#.*!,$!,066!+(3!#(,$/$'3!0-!-#(,!7(9!#(,!*(!*.8$!*#$!)9-02!7(9!#./$!.%+!).8$!0*
,('8!,0*#!C-*$'0-8

Getting Free Music


=#$'$!.'$!-$/$'.6!,$L-0*$-!*#.*!(11$'!)9-02!*#.*!#.-!L$$%!'$6$.-$+!9%+$'!M'$.*0/$!M()E
)(%-!('!(*#$'!602$%-$- !S.*$673!,$A/$!L$$%!$%^(70%@!)9-02!1'()!:.)$%+( !;.2#!-(%@
).7!#./$!0*-!(,%!602$%-0%@!'$B90'$)$%*-3!.%+!^9-*!L$2.9-$!7(9!2.%!+(,%6(.+!.!-(%@
1('!1'$$!+($-!%(*!)$.%!7(9!#./$!&$')0--0(%!*(!9-$!0*!.-!)9-02!(%!#(6+ !]$!.,.'$!(1!*#$
602$%-0%@!*$')-!1('!*#$!)9-02!7(9!.'$!&6.%%0%@!*(!9-$!1('!7(9'!)9-02!(%!#(6+

Converting Music to a Format That Works Best with Asterisk


F*A-!B90*$!2())(%!*(!#./$!)9-02!0%!Y>N!1(').*!*#$-$!+.7- !"#06$!C-*$'0-8!2.%!9-$
Y>N-!.-!.!)9-02!-(9'2$3!*#0-!)$*#(+!0-!%(*!.*!.66!0+$.6 !Y>N-!.'$!#$./067!2()&'$--$+3
.%+!0%!('+$'!*(!&6.7!*#$)!*#$!M>P!#.-!*(!+(!-()$!-$'0(9-!,('8!*(!+$2()&'$--!*#$)
0%!'$.6!*0)$ !=#0-!0-!10%$!,#$%!7(9!.'$!(%67!&6.70%@!(%$!-(%@!.%+!,.%*!*(!-./$!-&.2$!(%
7(9'!0>(+3!L9*!1('!)9-02!(%!#(6+3!*#$!&'(&$'!*#0%@!*(!+(!0-!2(%/$'*!*#$!Y>N!*(!.!1(').*
*#.*!0-!$.-0$'!(%!*#$!M>P

h <(*$!*#.*!S$01!9-$-!*#$!+$1.96*!)9-023!L9*!#0-!$D29-$!0-!*#.*!#$A-!6.k7!.%+!,.%*-!*(!@(!.%+!&6.7!X('k.!(%!#0-
pL(D !=#$!2(LL6$'A-!80+-!#./$!%(!-#($-

musiconhold.conf | 79
CentOS Prerequisite
H0%2$!M$%*QH!+($-!%(*!#./$!Y>N!2.&.L060*7!0%-*.66$+!,0*#!+".3!7(9!,066!#./$!*(!0%-*.66
*'E=O<!L$1('$!7(9!2.%!2(%/$'*!Y>N!106$-!1('!9-$!,0*#!C-*$'0-8
X0'-*!7(9!,066!%$$+!*(!0%-*.66!*#$!7'*)"7E$!'$&(-0*('7 !=(!10%+!(9*!,#02#!/$'-0(%!7(9
%$$+3!(&$%!7(9'!,$L!L'(,-$'!.%+!@(!*(!G%%'H##9!E(?-$$7+(&"*#7'*#V@a('G'bW !H$6$2*
*#$!*$D*!1('!*#$!/$'-0(%\.'2#0*$2*9'$!7(9!,.%*!*(!0%-*.66!.%+!&.-*$!0*!0%*(!7(9'!-#$66?
$ rpm -Uhv http://apt.sw.be/redhat ...

4(9!%$$+!*(!).8$!-9'$!*#0-!%$,!'$&(-0*('7!0-!9-$+!2(''$2*673!-(!'9%!*#$!1(66(,0%@?
$ yum install yum-priorities

ZF1!7(9!,.%*!*(!8%(,!)('$!.L(9*!34*!&'0('0*0$-3!-$$!*#0-!-0*$?!G%%'H##?-A-(&$ %"+("7E#
J!&A!E$c! !E$*$ %#d4*#J7-"7-%-$+ [
Q%2$!*#$!'$&(-0*('7!#.-!L$$%!.++$+3!7(9!2.%!&'(2$$+!*(!@$*!*'E=O<?
$ yum install mpg123

Q%2$! *#.*A-! +(%$3! 7(9'! M$%*QH! -7-*$)! 0-! '$.+7! *(! 2(%/$'*! Y>N! 106$-! 1('! 9-$! ,0*#
C-*$'0-8

F1!7(9!.'$!1.)060.'!,0*#!*#$!106$!1(').*-!.%+!#./$!-()$!$D&$'0$%2$!,('80%@!,0*#!.9+0(
$%@0%$$'0%@!-(1*,.'$!-92#!.-!C9+.20*73!7(9!2.%!2(%/$'*!*#$!106$-!(%!7(9'!>M!.%+!9&6(.+
*#$)!*(!C-*$'0-8 !"$!10%+!0*!0-!-0)&6$'!*(!9&6(.+!*#$!-(9'2$!Y>N!106$-!*(!*#$!C-*$'0-8
-$'/$'!Z-.73!*(!*#$!#%*'!1(6+$'[3!.%+!*#$%!2(%/$'*!*#$)!1'()!*#$!2()).%+!60%$
=(!2(%/$'*!7(9'!Y>N!106$-!*(!.!1(').*!*#.*!C-*$'0-8!9%+$'-*.%+-3!7(9!%$$+!*(!'9%!*#$
2()).%+-!(9*60%$+!#$'$!Z0%!*#0-!$D.)&6$!,$!.'$!9-0%@!.!106$!%.)$+!>-6$ %C-%3(*'<[

CentOS
X0'-*3!2(%/$'*!*#$!Y>N!106$!*(!.!"C_!106$?
$ mpg123 -w SilentCity.wav SilentCity.mp3

=#$%3!+(,%-.)&6$!*#$!'$-96*0%@!"C_!106$!*(!.!-.)&60%@!'.*$!*#.*!C-*$'0-8!9%+$'-*.%+-?
$ sox SilentCity.wav -t raw -r 8000 -s -w -c 1 SilentCity.sln

Ubuntu
F1!7(9!#./$!%(*!+(%$!-(!.6'$.+73!0%-*.66!+".3!.%+!*#$!libsox-fmt-all!&.28.@$?
# sudo apt-get install sox libsox-fmt-all

=#$%3!2(%/$'*!7(9'!Y>N!106$!+0'$2*67!*(!*#$!9%2()&'$--$+!HS<!1(').*?
$ sox SilentCity.mp3 -t raw -r 8000 -s -w -c 1 SilentCity.sln

80 | Chapter 4:ಗInitial Configuration Tasks


F%! %$,$'! /$'-0(%-! (1! +".! Z$ @ 3! /$'-0(%! OK N l3! ,#02#! -#0&&$+! ,0*#
PL9%*9!Ol Ol[3!*#$!8?!(&*0(%!#.-!2#.%@$+!*(!8O

Completing file conversion


=#$!'$-96*0%@!106$!,066!$D0-*!0%!*#$!#%*'!1(6+$'!Z('!,#$'$/$'!7(9!9&6(.+$+!*([!.%+!%$$+-
*(!L$!2(&0$+!*(!*#$!#,!7#6-;#!+%$7-+A#*"G!1(6+$'?
$ cp *.sln /var/lib/asterisk/moh

4(9!%(,!%$$+!*(!'$6(.+!*4+-&" G"69!0%!C-*$'0-8!0%!('+$'!*(!#./$!0*!'$2(@%0k$!7(9'!%$,
106$-?
$ asterisk -rx "module unload res_musiconhold.so"
$ asterisk -rx "module load res_musiconhold.so"

=(!*$-*!*#.*!7(9'!)9-02!0-!,('80%@!2(''$2*673!.++!*#$!1(66(,0%@!*(!*#$![UserServices]
2(%*$D*!0%!7(9'!+0.6&6.%?
exten => 664,1,NoOp()
same => n,Progress()
same => n,MusicOnHold()

I0.60%@!664!1'()!(%$!(1!7(9'!-$*-!-#(96+!&6.7!.!'.%+()!106$!1'()!7(9'!*"G!+0'$2*('7

Conclusion
=#0-!2#.&*$'!#$6&$+!7(9!2()&6$*$!-()$!0%0*0.6!2(%10@9'.*0(%!(1!C-*$'0-8 !X'()!#$'$
7(9!2.%!)(/$!(%!*(!-$**0%@!9&!-()$!&#(%$-!.%+!*.80%@!.+/.%*.@$!(1!*#$!).%7!1$.*9'$-
C-*$'0-8!#.-!*(!(11$'

Conclusion | 81
CHAPTER 5
User Device Configuration

N59" ]%5!6?!3+5A "?5?G!%5N]*5%!6A- E5!;"4%T


;4%5N5A "?5N]*57-EG%(
qY9#.)).+!C60

F%! *#0-! 2#.&*$'! ,$A66! +$6/$! 0%*(! *#$! 9-$'! +$/02$-! *#.*! 7(9! )0@#*! ,.%*! *(! 2(%%$2*! *(
C-*$'0-83!*7&02.667!_(F>!*$6$&#(%$-!(1!-()$!-('* !M(%10@9'0%@!.!2#.%%$6!0%!C-*$'0-8!1('
*#$!+$/02$!*(!2(%%$2*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09-!I9'.X(%!+$/02$-3!,#02#
.'$!$D&$%-0/$3!L9*!0)&'$--0/$

Configuring Asterisk | 87
C-*$'0-8! .66(,-! +$/02$-! 9-0%@! ).%7! +011$'$%*! &'(*(2(6-! *(! -&$.8! *(! 0*
Z.%+!*#$'$1('$!*(!$.2#!(*#$'[ !R(,$/$'3!*#$!HF>!.%+!FCpW!&'(*(2(6-!.'$
*#$!)(-*!&(&96.'!.%+!).*9'$!_(F>!)(+96$-3!-(!,$!,066!1(29-!(9'!.*E
*$%*0(%!(%!*#$) !X('!7(9'!10'-*!C-*$'0-8!L906+3!7(9!)0@#*!L$!L$-*!(11!%(*
L(*#$'0%@! ,0*#! *#$! (*#$'! &'(*(2(6-! Z-92#! .-! H80%%7\HMM>3! P%0-*0)3
R NWN3! .%+! YjM>[3! .%+! @$**0%@! 2()1('*.L6$! ,('80%@! ,0*#! HF>! .%+
FCpW!10'-* !=#$!2(%10@9'.*0(%!1('!*#$!(*#$'!&'(*(2(6-!0-!-0)06.'3!.%+!*#$
-.)&6$!2(%10@9'.*0(%!106$-!.'$!1966!(1!0%1(').*0(%!.%+!$D.)&6$-3!-(!(%2$
7(9! #./$! *#$! L.-02-! +(,%3! (*#$'! &'(*(2(6-! -#(96+! L$! 1.0'67! $.-7! *(
,('8!,0*#

=#$!2#.%%$6!2(%10@9'.*0(%!106$-3!-92#!.-!+-'(&" )!.%+!-!.(&" )3!2(%*.0%!*#$!2(%10@9'.*0(%


1('!*#$!2#.%%$6!+'0/$'3!-92#!.-!&G! 1-!.O(+"!('!&G! 1+-'(+"3!.6(%@!,0*#!*#$!0%1(').*0(%
.%+!2'$+$%*0.6-!'$B90'$+!1('!.!*$6$&#(%7!+$/02$!*(!2(%*.2*!.%+!0%*$'.2*!,0*#!C-*$'0-8
M())(%!0%1(').*0(%!.L(9*!*#$!2#.%%$6!+'0/$'!0-!2(%*.0%$+!.*!*#$!*(&!(1!*#$!2(%10@9E
'.*0(%!106$3!0%!*#$![general]!-$2*0(%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7(9!'$.+!(%

How Channel Configuration Files Work with the Dialplan


"#06$!,$!#./$%A*!+0-29--$+!C-*$'0-8!+0.6&6.%-!7$*3!0*!0-!9-$196!*(!L$!.L6$!*(!/0-9.60k$!*#$
'$6.*0(%-#0&!L$*,$$%!*#$!2#.%%$6!2(%10@9'.*0(%!106$-!Z+-'(&" )3!-!.(&" )[!.%+!*#$!+0.6&6.%
Z$.%$ +-" +(&" )[ !=#$!+0.6&6.%!0-!*#$!#$.'*!(1!.%!C-*$'0-8!-7-*$)?!0*!2(%*'(6-!#(,!2.66
6(@02!0-!.&&60$+!*(!.%7!2(%%$2*0(%!1'()!.%7!2#.%%$63!-92#!.-!,#.*!#.&&$%-!,#$%!.
+$/02$!+0.6-!$D*$%-0(%!101!('!.%!0%2()0%@!2.66!1'()!.%!$D*$'%.6!&'(/0+$'!0-!'(9*$+ !](*#

88 | Chapter 5:ಗUser Device Configuration


*#$!'$6$/.%*!2#.%%$6!2(%10@9'.*0(%!106$!.%+!*#$!$.%$ +-" +(&" )!106$!&6.7!.!'(6$!0%!)(-*
2.66-!'(9*$+!*#'(9@#!*#$!-7-*$) !X0@9'$!eEO!&'(/0+$-!.!@'.&#02.6!'$&'$-$%*.*0(%!(1!*#$
'$6.*0(%-#0&!L$*,$$%!*#$!+-'(&" )!.%+!$.%$ +-" +(&" )!106$-
"#$%!.!2.66!2()$-!0%*(!C-*$'0-83!*#$!0+$%*0*7!(1!*#$!0%2()0%@!2.66!0-!).*2#$+!0%!*#$
2#.%%$6!2(%10@9'.*0(%!106$!1('!*#$!&'(*(2(6!0%!9-$!Z$ @ 3!+-'(&" )[ !=#$!2#.%%$6!2(%10@9E
'.*0(%!106$!.6-(!#.%+6$-!.9*#$%*02.*0(%!.%+!+$10%$-!,#$'$!*#.*!2#.%%$6!,066!$%*$'!*#$
+0.6&6.%
Q%2$!C-*$'0-8!#.-!+$*$')0%$+!#(,!*(!#.%+6$!*#$!2#.%%$63!0*!,066!&.--!2.66!2(%*'(6!*(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$-!0%!C-*$'0-8 !=#0-!0-!+9$!*(!*#$!$%(')(9-!&(&96.'0*7!(1!*#$!HF>!&'(*(2(63!,#02#

g=#$!HF>!TXM!0-!.!6(%@!'$.+3!L9*!.L(9*!*#$!10'-*!We!&.@$-!.'$!.!@((+!0%*'(+92*0(% !M#$28!0*!(9*!.*!G%%'H##???
(-$%)("7E#7)&#7)&<O0=(%.%

Configuring Asterisk | 89
#.-!*.8$%!(/$'!*#$!_(F>\*$6$2()!0%+9-*'7!.%+!L$$%!0)&6$)$%*$+!0%!*#(9-.%+-!(1!+$E
/02$-!.%+!>]p- !F1!7(9!6((8!*#'(9@#!*#$!+-'(&" )(+!*'6$!106$!0%!*#$!(#&" )-E+!-9L+0'$2*('7
(1!7(9'!C-*$'0-8!-(9'2$!7(9!,066!%(*02$!.!,$.6*#!(1!(&*0(%-!./.06.L6$ !X('*9%.*$673!*#$
+$1.96*!(&*0(%-!.'$!%(').667!.66!7(9!%$$+3!.%+!*#$'$1('$!7(9!2.%!2'$.*$!.!/$'7!-0)&6$
2(%10@9'.*0(%!106$!*#.*!,066!.66(,!)(-*!-*.%+.'+!HF>!*$6$&#(%$-!*(!2(%%$2*!,0*#!C-*$'0-8
=#$!10'-*!*#0%@!7(9!%$$+!*(!+(!0-!2'$.*$!.!2(%10@9'.*0(%!106$!0%!7(9'!#$%&#!+%$7-+A!+0'$2*('7
2.66$+!+-'(&" )
>.-*$!('!*7&$!*#$!1(66(,0%@!0%1(').*0(%!0%*(!*#$!106$?
[general]
context=unauthenticated ; default context for incoming calls
allowguest=no ; disable unauthenticated calls
srvlookup=yes ; enabled DNS SRV record lookup on outbound calls
udpbindaddr=0.0.0.0 ; listen for UDP requests on all interfaces
tcpenable=no ; disable TCP support

[office-phone](!) ; create a template for our devices


type=friend ; the channel driver will match on username first, IP second
context=LocalSets ; this is where calls from the device will enter the dialplan
host=dynamic ; the device will register with asterisk
nat=yes ; assume device is behind NAT
; *** NAT stands for Network Address Translation, which allows
; multiple internal devices to share an external IP address.
secret=s3CuR#p@s5 ; a secure password for this device -- DON'T USE THIS PASSWORD!
dtmfmode=auto ; accept touch-tones from the devices, negotiated automatically
disallow=all ; reset which voice codecs this device will accept or offer
allow=ulaw ; which audio codecs to accept from, and request to, the device
allow=alaw ; in the order we prefer

; define a device name and use the office-phone template


[0000FFFF0001](office-phone)

; define another device name using the same template


[0000FFFF0002](office-phone)

Q&$%!*#$!+-'(&" )!106$!7(9A/$!^9-*!2'$.*$+3!.%+!,$A66!@(!(/$'!$.2#!0*$)
"$A/$!2'$.*$+!1(9'!-$2*0(%-3!*#$!10'-*!(%$!L$0%@!*#$![general]!-$2*0(% !=#0-!0-!.!-*.%+.'+
-$2*0(%!*#.*!.&&$.'-!.*!*#$!*(&!(1!*#$!2(%10@9'.*0(%!106$!1('!.66!2#.%%$6!)(+96$-3!.%+
)9-*!.6,.7-!L$!%.)$+!0%!*#0-!,.7 !=#$![general]!-$2*0(%!2(%*.0%-!@$%$'.6!2(%10@9'.E
*0(%!(&*0(%-!1('!#(,!*#.*!&'(*(2(6!'$6.*$-!*(!7(9'!-7-*$)3!.%+!2.%!L$!9-$+!*(!+$10%$
+$1.96*!&.'.)$*$'-!.-!,$66
X('!$D.)&6$3!,$A/$!+$10%$+!*#$!+$1.96*!2(%*$D*!.-!unauthenticated3!*(!$%-9'$!*#.*!,$
#./$!$D&6020*67!+$26.'$+!,#$'$!9%.9*#$%*02.*$+!@9$-*!2.66-!,066!$%*$'!*#$!+0.6&6.%!Z'.*#$'
*#.%!6$./0%@!*#.*!*(!2#.%2$[ !"$A/$!%.)$+!0*!unauthenticated!*(!).8$!0*!(L/0(9-!*#.*
2.66-!&'(2$--$+!0%!*#0-!2(%*$D*!.'$!%(*!*'9-*$+3!.%+!*#9-!-#(96+!%(*!L$!.L6$!*(!+(!*#0%@-
-92#!.-!).8$!(9*L(9%+!2.66-!*(!*#$!>H=<!Z,#02#!2(96+!&(*$%*0.667!2(-*!)(%$73!('
'$&'$-$%*!0+$%*0*7!*#$1*[ !4(9!-#(96+!L$!.,.'$!*#.*!,$!2(96+!#./$!9-$+!.%7!%.)$!,$

90 | Chapter 5:ಗUser Device Configuration


,.%*$+3! .%+! .6-(! *#.*! *#$'$! %$$+-! *(! L$! .%! 0+$%*02.667! %.)$+! 2(%*$D*! 0%! !" #$
%&'#%()'#* !" #$%&'$ !($ )*++ %+", %"- .'*.!($'!&)*!$# )*++/0
1($ '$2! "3!&"' &/ allowguest4 ,(&)( ,$56$ #&/*7+$# */ ,$ #"'5! ,*'! !" *))$3! *'8
.'*.!($'!&)*!$# )*++/ *! !(&/ !&9$0 :$$3 &' 9&'# !(*! %"- /"9$ )(*''$+/ 8". 9*8 *);
!.*++8 ,*'! !" *))$3! .'*.!($'!&)*!$# )*++/0 < )"99"' ./$ %"- *++",&'= .'*.!($'!&;
)*!$# )*++/ &/ %"- )"93*'&$/ !(*! *++", #&*+&'= 78 .'&%"-9 -$/".-)$ &#$'!&%&$-/ >?@A/B4
+&C$ $9*&+ *##-$//$/0 A% ,$ ,*'!$# !" *++", )./!"9$-/ !" )*++ ./ %-"9 !($&- 3("'$/
,&!(".! (*6&'= !" *.!($'!&)*!$4 ,$ )".+# $'*7+$ =.$/! )*++/ *'# (*'#+$ !($9 &' !($
unauthenticated )"'!$2! #$%&'$# 78 !($ 3-$6&"./ "3!&"'0

D". 9*8 7$ ,"'#$-&'= ,(8 8". 9&=(! $6$- ,*'! !" *++", .'*.!($'!&;
)*!$# )*++/0 1($ -$*/"' &/ !(*! &% 8". 3.7+&/( 8".- EAF ?@A "' 8".- 7./&;
'$// )*-#/ >$0=04 %&+,- &*(./0% #1%2&*" &32"('43B4 )*++/ !" !(*! ?@A ,&++
%*&+ &% 8".- .'*.!($'!&)*!$# )"'!$2! /&93+8 (*'=/ .30 G(*! 8". ,*'!
&'/!$*# &/ %"- 8".- .'*.!($'!&)*!$# )"'!$2! !" 3.! &')"9&'= )*++/ &'!" *
)"'!-"++$# $'6&-"'9$'!0 D". 9*8 ,&/( !" *++", !($ )*++/4 7.! 8". ,"'5!
'$)$//*-&+8 !-./! !($90H

1($ srvlookup "3!&"' &/ ./$# !" $'*7+$ </!$-&/C !" 3$-%"-9 * +""C.3 6&* * IJE E@K
-$)"-#4 ,(&)( &/ !83&)*++8 ./$# %"- ".!7".'# )"''$)!&"'/ !" /$-6&)$ 3-"6&#$-/0 G$5++
!*+C 9"-$ *7".! </!$-&/C *'# IJE &' L(*3!$- MN0
1($ udpbindaddrO"3!&"' !*C$/ !($ 6*+.$ "% *' AF *##-$// "- 0.0.0.0 !" !$++ </!$-&/C ,(&)(
'$!,"-C &'!$-%*)$ &! /(".+# +&/!$' !" %"- -$P.$/!/ )*--&$# 78 !($ ?IF '$!,"-C !-*'/3"-!
3-"!")"+ >,(&)( &/ !($ 3-"!")"+ !(*! *)!.*++8 )*--&$/ !($ 6"&)$ )(*''$+/B0 Q8 #$%&'&'=
0.0.0.04 ,$5-$ &'/!-.)!&'= !($ )(*''$+ #-&6$- !" +&/!$' "' *++ *6*&+*7+$ &'!$-%*)$/0 <+!$-;
'*!&6$+84 ,$ )".+# +&9&! K"AF )"''$)!&"'/ %"- !(&/ 3-"!")"+ !" * /&'=+$ &'!$-%*)$ 78
#$%&'&'= !($ AF *##-$// "% * /3$)&%&) '$!,"-C &'!$-%*)$ "' ".- /8/!$90

L.--$'!+8 &' </!$-&/C !($ udpbindaddr *'# tcpbindaddr "3!&"'/ *-$ *'
*++;"-;"'$ 3-"3"/&!&"'0 A' "!($- ,"-#/4 &% 8". (*6$ !(-$$ JAL/ &' 8".-
/8/!$94 8". )*'5! -$/!-&)! K"AF !-*%%&) !" !," "% !($9R &!5/ $&!($- "'$ "'+84
"- *++ "% !($90

H 1($ ,("+$ )"')$3! "% /$).-&!8 *'# !-./! "' * K"AF '$!,"-C &/ /"9$!(&'= !(*! )*' 7$)"9$ P.&!$
)"93+$20 E3*99$-/ *-$ *+-$*#8 (*-# *! ,"-C %&=.-&'= ".! !(&/ !$)('"+"=84 *'# 8". '$$# !" 7$
*,*-$ "% !($ )"')$3!/0 G$5++ )"6$- !(&/ &' 9"-$ #$3!( +*!$- &' !($ 7""C4 /.)( */ &' L(*3!$- S
*'# L(*3!$- NT0
O 1($ )"93+$9$'! !" !(&/ "3!&"' &/ tcpbindaddr4 ./$# %"- +&/!$'&'= %"- -$P.$/!/ )*--&$# 6&* !($ 1LF '$!,"-C
!-*'/3"-! 3-"!")"+0

Configuring Asterisk | 91
IPv6 in sip.conf
</ "% 6$-/&"' M0U4 </!$-&/C /.33"-!/ AF6T %"- 7"!( EAF *'# @1F !-*%%&)0 <++ "% !($ )"';
%&=.-*!&"' "3!&"'/ &' 5 ")5/%" 4&%65%&+()'#* -$+*!$# !" AF *##-$//$/ )*' *))$3! $&!($- *'
AF6V "- *' AF6T *##-$//0 </ *' $2*93+$4 )"'/&#$- !($ #&%%$-$'! 6*+.$/ %"- !($ udpbin
daddr "3!&"'R

udpbindaddr value Description


192.168.100.50 Bind to a specific IPv4 address.
2001:db8::1 Bind to a specific IPv6 address
0.0.0.0 Bind to all IPv4 addresses on the system.
:: Bind to all IPv4 and IPv6 addresses.

1($ tcpenable "3!&"' *++",/ ./ !" *))$3! -$P.$/!/ 6&* !($ 1LF '$!,"-C !-*'/3"-! 3-";
!")"+0 W"- '", ,$56$ #&/*7+$# &!4 */ !($ ?IF 9$!("# &/ ).--$'!+8 9"-$ 9*!.-$ >*'#
9"-$ 3"3.+*-B *'# ,$5-$ *!!$93!&'= !" $+&9&'*!$ */ 9*'8 7*--&$-/ */ 3"//&7+$0 X*6&'=
/*&# !(*!4 %$$+ %-$$ !" !$/! 1LF /.33"-! "')$ 8".5-$ )"9%"-!*7+$ )"'%&=.-&'= 8".-
#$6&)$/0

1($-$ *-$ *+/" tlsenable *'# tlsbindaddr "3!&"'/ %"- $'*7+&'= EAF "6$-
1YE >$')-83!$# EAFB0 G$5++ )"6$- !($ )"'%&=.-*!&"' "% EAF ,&!( 1YE &'
L(*3!$- S0

1($ '$2! /$)!&"' ,$56$ #$%&'$# &/ * !$93+*!$ ,$ (*6$ )("/$' !" '*9$ [office-phone]
(!)0 G$56$ )-$*!$# &! */ * !$93+*!$ /" !(*! ,$ )*' ./$ !($ 6*+.$/ ,&!(&' &! %"- *++ "% ".-
#$6&)$/0

W"++",&'= !($ /$)!&"' '*9$ ,&!( (!) !$++/ </!$-&/C !" !-$*! !(&/ /$)!&"'
*/ * !$93+*!$0 Q8 #"&'= !(&/ ,$ $+&9&'*!$ !($ '$$# !" -$3$!&!&6$+8 *##
*'# )(*'=$ )"'%&=.-*!&"' "3!&"'/ %"- $6$-8 #$6&)$ ,$ )(""/$ !" #$%&'$0
1$93+*!$/ *-$ $2!-$9$+8 ./$%.+ *'# *-$ *6*&+*7+$ &' *++ "% </!$-&/C5/
)"'%&=.-*!&"' %&+$/0 A% 8". ,*'! !" )(*'=$ /"9$!(&'= %"- *' &'#&6&#.*+
#$6&)$ !(*! ,*/ 3-$6&"./+8 #$%&'$# &' !($ !$93+*!$ %"- !(*! #$6&)$4 8".
)*' #" !(*! .'#$- !($ /$)!&"' ($*#$-4 *'# &! ,&++ "6$--&#$ ,(*! ,*/ #$;
%&'$# 78 !($ !$93+*!$0 A! &/ '"! '$)$//*-8 !" ./$ !$93+*!$/4 7.! !($8 *-$
$2!-$9$+8 (*'#84 *'# ,$ ./$ !($9 $2!$'/&6$+80

92 | Chapter 5:ಗUser Device Configuration


A' !($ [office-phone] !$93+*!$ ,$56$ #$%&'$# /$6$-*+ "3!&"'/ -$P.&-$# %"- *.!($'!&)*;
!&"' *'# )"'!-"+ "% )*++/ !" *'# %-"9 #$6&)$/ !(*! ./$ !(*! !$93+*!$0 1($ %&-/! "3!&"'
,$56$ )"'%&=.-$# &/ !($ type4 ,(&)( ,$56$ /$! !" friend0 1(&/ !$++/ !($ )(*''$+ #-&6$- !"
*!!$93! !" 9*!)( "' '*9$ %&-/!4 *'# !($' AF *##-$//0

SIP Configuration Matching and the type Option


A' !($ $2*93+$ ,$ (*6$ 3-"6&#$#4 !($ )"'%&=.-*!&"' %"- EAF 3("'$/ &/ /$! ,&!(
type=friend0 1($-$ *-$ !," "!($- !83$ #$%&'&!&"'/ 8". )*' ./$R user *'# peer0 1($
#&%%$-$')$ 7$!,$$' !($9 (*/ !" #" ,&!( (", </!$-&/C &'!$-3-$!/ &')"9&'= EAF -$P.$/!/0
1($ -.+$/ *-$ )"6$-$# &' !(&/ !*7+$R

type = Description
peer Match incoming requests to a configuration entry using the source IP address and port number.
user Match incoming requests to a configuration entry using the username in the From header of the SIP
request. This name is matched to a section in sip.conf with the same name in square brackets.
friend This enables matching rules for both peer and user. This is the setting most commonly used for SIP phones.

G($' * -$P.$/! %-"9 * !$+$3("'$ &/ -$)$&6$# *'# *.!($'!&)*!$# 78 </!$-&/C4 !($ -$;
P.$/!$# $2!$'/&"' '.97$- &/ (*'#+$# 78 !($ #&*+3+*' &' !($ context #$%&'$# &' !($ #$6&)$
)"'%&=.-*!&"'Z &' ".- )*/$4 !($ )"'!$2! '*9$# LocalSets0
1($ host "3!&"' &/ ./$# ,($' ,$ '$$# !" /$'# * -$P.$/! !" !($ !$+$3("'$ >/.)( */ ,($'
,$ ,*'! !" )*++ /"9$"'$B0 </!$-&/C '$$#/ !" C'", ,($-$ !($ #$6&)$ &/ "' !($ '$!,"-C0
Q8 #$%&'&'= !($ 6*+.$ */ dynamic4 ,$ +$! </!$-&/C C'", !(*! !($ !$+$3("'$ ,&++ !$++ ./
,($-$ &! &/ "' !($ '$!,"-C &'/!$*# "% (*6&'= &!/ +")*!&"' #$%&'$# /!*!&)*++80 A% ,$ ,*'!$#
!" #$%&'$ !($ *##-$// /!*!&)*++84 ,$ )".+# -$3+*)$ dynamic ,&!( *' AF *##-$// /.)( */
192.168.128.300
1($ nat "3!&"' &/ ./$# !" !$++ </!$-&/C !" $'*7+$ /"9$ !-&)C/ !" 9*C$ 3("'$ )*++/ ,"-C
,($' * EAF 3("'$ 9*8 7$ +")*!$# 7$(&'# * J<10 1(&/ &/ &93"-!*'! 7$)*./$ !($ EAF
3-"!")"+ &')+.#$/ AF *##-$//$/ &' 9$//*=$/0 A% * 3("'$ &/ "' * 3-&6*!$ '$!,"-C4 &! 9*8
$'# .3 3+*)&'= 3-&6*!$ *##-$//$/ &' EAF 9$//*=$/4 ,(&)( *-$ "%!$' '"! ./$%.+0
1($ 3*//,"-# %"- !($ #$6&)$ &/ #$%&'$# 78 !($ secret 3*-*9$!$-0 G(&+$ !(&/ &/ '"! /!-&)!+8
-$P.&-$#4 8". /(".+# '"!$ !(*! &! &/ P.&!$ )"99"' %"- .'/*6"-8 %"+C/ !" -.' 3(&/(&'=
/)-&3!/ !(*! +""C %"- $23"/$# K"AF *))".'!/ ,&!( &'/$).-$ 3*//,"-#/ *'# /&93+$ #$6&)$
'*9$/ >/.)( */ * #$6&)$ '*9$ "% 100 ,&!( * 3*//,"-# "% 1234B0 Q8 .!&+&[&'= *' .')"9;
9"' #$6&)$ '*9$ /.)( */ * \<L *##-$//4 *'# * 3*//,"-# !(*! &/ * +&!!+$ (*-#$- !" =.$//4
,$ )*' /&='&%&)*'!+8 +",$- !($ -&/C !" ".- /8/!$9 /(".+# ,$ '$$# !" $23"/$ &! !" !($
".!/&#$ ,"-+#0

Configuring Asterisk | 93
Name Purpose Popularity/Status
func_sprintf Performs string format functions similar to C function of same name Useful
func_srv Perform SRV lookups in the dialplan Useful
func_strings Includes over a dozen string manipulation functions Useful
func_sysinfo Gets system information such as RAM, swap, load average, etc. Useful
func_timeout Gets/sets timeouts on channel Useful
func_uri Converts strings to URI-safe encoding Useful
func_version Returns Asterisk version information Usable
func_vmcount Returns count of messages in a voicemail folder for a particular user Useful
func_volume Sets volume on a channel Useful

PBX Modules
1($ FQ] 9"#.+$/ *-$ 3$-&3($-*+ 9"#.+$/ !(*! 3-"6&#$ $'(*')$# )"'!-"+ *'# )"'%&=.;
-*!&"' 9$)(*'&/9/0 W"- $2*93+$4 pbx_config &/ !($ 9"#.+$ !(*! +"*#/ !($ !-*#&!&"'*+
</!$-&/C #&*+3+*'0 1($ ).--$'!+8 *6*&+*7+$ FQ] 9"#.+$/ *-$ +&/!$# &' 1*7+$ N;^0
7/8- 9:$;(9<=>9.'0?- %
Name Purpose Popularity/Status
pbx_ael Asterisk Extension Logic (AEL) offers a dialplan scripting language that looks like a Usablea
modern programming language.
pbx_config This is the traditional, and most popular, dialplan language for Asterisk. Without Useful
this module, Asterisk cannot read extensions.conf.
pbx_dundi Performs data lookups on remote Asterisk systems. Useful
pbx_loopback Performs something similar to a dialplan include, but in a deprecated manner. Insignificantb
pbx_lua Allows creation of a dialplan using the Lua scripting language. Useful
pbx_realtime Provides functionality related to the Asterisk Realtime Architecture. Useful
pbx_spool Provides outgoing spool support relating to Asterisk call files. Useful
a We have not found too many people using AEL. We suspect this is because most developers will tend to use AGI/AMI if they do not want
to use traditional dialplans.
b We’ve never heard of this being used in production.

Resource Modules
@$/".-)$ 9"#.+$/ &'!$=-*!$ </!$-&/C ,&!( $2!$-'*+ -$/".-)$/0 W"- $2*93+$4 res_odbc
*++",/ </!$-&/C !" &'!$-"3$-*!$ ,&!( _IQL #*!*7*/$ )"''$)!&"'/0 1($ ).--$'!+8 *6*&+;
*7+$ -$/".-)$ 9"#.+$/ *-$ +&/!$# &' 1*7+$ N;M`0

Modules | 21
Hardphones, Softphones, and ATAs
1($-$ *-$ !(-$$ !83$/ "% $'#3"&'!/ 8". ,".+# !83&)*++8 3-"6&#$ 8".- ./$-/ ,&!( !(*!
)".+# /$-6$ */ * !$+$3("'$ /$!0 1($8 *-$ 3"3.+*-+8 -$%$--$# !" */ (*-#3("'$/4 /"%!;
3("'$/4 *'# <'*+"= 1$-9&'*+ <#*3!"-/ ><1</B0
< 2/40+2'# &/ * 3(8/&)*+ #$6&)$0 A! +""C/ a./! +&C$ *' "%%&)$ !$+$3("'$R &! (*/ * (*'#/$!4
'.97$-$# 7.!!"'/4 $!)0 A! )"''$)!/ #&-$)!+8 !" !($ '$!,"-C4 *'# &!5/ ,(*! 3$"3+$ *-$
-$%$--&'= !" ,($' !($8 !*+C *7".! * K"AF !$+$3("'$ >"- * EAF !$+$3("'$B0
< %'*"+2'# &/ * /"%!,*-$ *33+&)*!&"' !(*! -.'/ "' * +*3!"3 "- #$/C!"30 1($ *.#&" 9./!
3*// !(-".=( !($ FL5/ /".'# /8/!$94 /" 8". '"-9*++8 '$$# * ($*#/$! !(*! ,&++ ,"-C
,$++ ,&!( !$+$3("'8 *33+&)*!&"'/0 \"-$ -$)$'!+84 /"%!3("'$ *33+&)*!&"'/ (*6$ 7$$'
,-&!!$' %"- /9*-! 3("'$/ !(*! *++", 8". !" )"''$)! !" "!($- '$!,"-C/ "!($- !(*' a./!
!($ )$++.+*- '$!,"-C0 1($ &'!$-%*)$ "% !($ /"%!3("'$ &/ "%!$' /!8+$# !" +""C +&C$ * 3(8/&)*+
!$+$3("'$4 7.! !(&/ &/ '"! '$)$//*-80
<' @7@ &/ #$/&='$# !" *++", !-*#&!&"'*+ *'*+"= !$+$3("'$/ >*'# "!($- *'*+"= #$6&)$/4
/.)( */ %*2 9*)(&'$/4 )"-#+$// 3("'$/4 3*=&'= *93+&%&$-/4 *'# /.)(B !" )"''$)! !" * EAF
'$!,"-C4b *'# ,&++ !83&)*++8 7$ * /*'#,&)(;/&[$# 7"2 !(*! )"'!*&'/ *' @c;MM )"''$)!"-
%"- !($ 3("'$ >)"99"'+8 -$%$--$# !" */ *' W]E 3"-!B4 *' @c;Vd )"''$)!"- %"- !($ '$!;
,"-C4 *'# * 3",$- )"''$)!"-0 E"9$ <1</ 9*8 /.33"-! 9"-$ !(*' "'$ 3("'$0
X*-#3("'$/ (*6$ !($ *#6*'!*=$ !(*! !($ (*'#/$!/ (*6$ =""# *)"./!&) 3-"3$-!&$/ %"-
6"&)$ )"99.'&)*!&"'/0 <'8 #$)$'!;P.*+&!8 !$+$3("'$ &/ $'=&'$$-$# !" 3&)C .3 !($ %-$;
P.$')&$/ "% !($ (.9*' 6"&)$4 %&+!$- ".! .',*'!$# 7*)C=-".'# '"&/$4 *'# '"-9*+&[$ !($
-$/.+!&'= ,*6$%"-90 F$"3+$ (*6$ 7$$' ./&'= !$+$3("'$/ %"- */ +"'= */ !($ !$+$3("'$
'$!,"-C (*/ $2&/!$#4 *'# ,$ !$'# !" +&C$ ,(*! &/ %*9&+&*-4 /" (*6&'= * #$6&)$ !(*! )"9;
9.'&)*!$/ ,&!( </!$-&/C ./&'= * %*9&+&*- &'!$-%*)$ ,&++ 7$ *!!-*)!&6$ !" 9*'8 ./$-/0 <+/"4
* (*-#3("'$ #"$/ '"! -$P.&-$ 8".- )"93.!$- !" 7$ -.''&'= *++ !($ !&9$0
I&/*#6*'!*=$/ !" (*-#3("'$/ &')+.#$ !(*! !($8 *-$ '"'3"-!*7+$ *'# $23$'/&6$4 -$+*!&6$
!" !($ 9*'8 P.*+&!8 /"%!3("'$/ "' !($ 9*-C$! !"#*8 !(*! *-$ *6*&+*7+$ %"- %-$$0 <+/"4
!($ $2!-* )+.!!$- "' 8".- #$/C 9*8 '"! 7$ #$/&-*7+$ &% 8". (*6$ +&9&!$# ,"-C /3*)$4 *'#
&% 8". 9"6$ *-".'# * +"! *'# *-$ '"! =$'$-*++8 *! !($ /*9$ +")*!&"'4 * (*-#3("'$ &/ '"!
+&C$+8 !" /.&! 8".- '$$#/ >*+!(".=(4 "'$ *! $*)( +")*!&"' 8". %-$P.$'! 9&=(! 7$ * 6*+&#
/"+.!&"'B0
E"%!3("'$/ /"+6$ !($ 3"-!*7&+&!8 &//.$ 78 7$&'= &'/!*++$# "' * #$6&)$ !(*! &/ +&C$+8 *+-$*#8
9"6&'= ,&!( 8".4 /.)( */ 8".- +*3!"3 "- /9*-! 3("'$0 <+/"4 !($&- 9&'&9*+ )"/! >!83&;
)*++8 %-$$4 "- *-".'# !($ ef` 3-&)$ -*'=$ %"- * %.++8 %$*!.-$# "'$B &/ *!!-*)!&6$0 Q$)*./$
9*'8 /"%!3("'$/ *-$ %-$$4 &! &/ +&C$+8 !(*! !($ %&-/! !$+$3("'$ /$! 8". )"''$)! !" </!$-&/C
,&++ 7$ * /"%!3("'$0 <+/"4 7$)*./$ /"%!3("'$/ *-$ a./! /"%!,*-$4 !($8 *-$ $*/8 !" &'/!*++
*'# .3=-*#$4 *'# !($8 )"99"'+8 (*6$ "!($- %$*!.-$/ !(*! .!&+&[$ "!($- 3$-&3($-*+/4 +&C$

b _- *'8 "!($- '$!,"-C4 %"- !(*! 9*!!$-0 <1</ )".+# 9"-$ %"-9*++8 7$ /*&# !" 7$ *'*+"=;!";#&=&!*+ =*!$,*8/4
,($-$ !($ '*!.-$ "% !($ #&=&!*+ 3-"!")"+ 9*8 6*-8 >$0=04 3-"3-&$!*-8 <1</ "' !-*#&!&"'*+ FQ]/B0

86 | Chapter 5:ಗUser Device Configuration


@.''&'= ./6 9%/.+- % "' * /8/!$9 !(*! *+-$*#8 (*/ )"'%&=.-*!&"' %&+$/
,&++ "6$-,-&!$ !($ $2&/!&'= %&+$/0

Using make samples to Create Sample


Configuration Files for Future Reference
g6$' !(".=( ,$ *-$ '"! ="&'= !" ./$ !($ /*93+$ )"'%&=.-*!&"' %&+$/ !(*! )"9$ ,&!(
</!$-&/C4 !($ %*)! &/ !(*! !($8 *-$ *' $2)$++$'! -$%$-$')$0 A% !($-$ &/ * 9"#.+$ !(*! 8".
*-$ '"! ).--$'!+8 ./&'= 7.! ,&/( !" 3.! &'!" 3-"#.)!&"'4 !($ /*93+$ %&+$ ,&++ /(", 8".
$2*)!+8 ,(*! /8'!*2 !" ./$4 *'# ,(*! "3!&"'/ *-$ *6*&+*7+$ %"- !(*! 9"#.+$0
@.''&'= !($ %?0'9./6 9%/.+- % )"99*'# &' 8".- </!$-&/C /".-)$ #&-$)!"-8H &/ (*-9+$//
"' * '$, /8/!$9 !(*! (*/ a./! 7$$' 7.&+!4 7.! &! &/ 6$-8 #*'=$-"./ !" -.' "' * /8/!$9
!(*! *+-$*#8 (*/ )"'%&=.-*!&"' %&+$/4 */ !(&/ )"99*'# ,&++ "6$-,-&!$ *'8 $2&/!&'= %&+$/
>,(&)( ,".+# 7$ * #&/*/!$- %"- 8". &% 8". #" '"! (*6$ * ).--$'! 7*)C.3B0
A% 8".56$ -.' !($ %?0'9./6 9%/.+- % )"99*'#4 8". ,&++ ,*'! !" 9"6$ !($ %&+$/ !(*! &!
(*/ )-$*!$# &' 5 ")5/%" 4&%65 !" *'"!($- %"+#$-0 G$ +&C$ !" )-$*!$ * %"+#$- )*++$# 5 ")5
/%" 4&%65?#?% 05 *'# 3.! *'8 /*93+$h.'./$# )"'%&=.-*!&"' %&+$/ &' !($-$4 7.! %$$+ %-$$
!" /!"-$ !($9 ,($-$6$- 8". +&C$0

G$5-$ '", ="&'= !" /!$3 !(-".=( *++ !($ %&+$/ !(*! *-$ -$P.&-$# !" =$! * /&93+$ </!$-&/C
/8/!$9 .3 *'# -.''&'=0

indications.conf and asterisk.conf


1($ %&-/! %&+$ '$$#$# &/ &#0&)/"&'#%()'#*4 * %&+$ !(*! )"'!*&'/ &'%"-9*!&"' *7".! (", !"
#$!$)! #&%%$-$'! !$+$3("'8 !"'$/ %"- #&%%$-$'! )".'!-&$/0 1($-$ &/ * 3$-%$)!+8 =""# /*93+$
%&+$ !(*! ,$ )*' ./$ &' !($ </!$-&/C /".-)$4 /" +$!5/ )"38 &! &'!" ".- 5 ")5/%" 4&%65 #&-$)!"-8R
$ cp ~/src/asterisk-complete/asterisk/1.8/configs/indications.conf.sample \
/etc/asterisk/indications.conf

Q$)*./$ ,$5-$ -.''&'= </!$-&/C */ '"';-""!4 ,$ '$$# !" !$++ </!$-&/C ,(&)( ./$- !" -.'
*/0 1(&/ &/ #"'$ ,&!( !($ /%" 4&%6()'#* %&+$0 G$ )*' )"38 * /*93+$ 6$-/&"' "% &! %-"9 !($
</!$-&/C /".-)$ !" 5 ")5/%" 4&%6R
$ cp ~/src/asterisk-complete/asterisk/1.8/configs/asterisk.conf.sample \
/etc/asterisk/asterisk.conf

1($ /%" 4&%6()'#* %&+$ )"'!*&'/ 9*'8 "3!&"'/ !(*! ,$ ,"'5! =" "6$- ($-$ >!($8 *-$ )"6;
$-$# &' i*/!$-&/C0)"'%j "' 3*=$ SMB4 7.! ,$ #" '$$# !" 9*C$ *' *#a./!9$'!0 J$*- !($
$'# "% !($ [options] /$)!&"'4 !($-$ *-$ !," "3!&"'/ ,$ '$$# !" $'*7+$R runuser *'#
rungroup0

H 5?%45%4)5/%" 4&%6$)'.+- " 5/%" 4&%65/%" 4&%6$A(B(CD'?49E 4%&'#F5

Base Configuration | 53
1(&/ &)"' &'#&)*!$/ * ,*-'&'= "- )*.!&"'0

Using Code Examples


1(&/ 7""C &/ ($-$ !" ($+3 8". =$! 8".- a"7 #"'$0 A' =$'$-*+4 8". 9*8 ./$ !($ )"#$ &'
!(&/ 7""C &' 8".- 3-"=-*9/ *'# #").9$'!*!&"'0 D". #" '"! '$$# !" )"'!*)! ./ %"-
3$-9&//&"' .'+$// 8".5-$ -$3-"#.)&'= * /&='&%&)*'! 3"-!&"' "% !($ )"#$0 W"- $2*93+$4
,-&!&'= * 3-"=-*9 !(*! ./$/ /$6$-*+ )(.'C/ "% )"#$ %-"9 !(&/ 7""C #"$/ '"! -$P.&-$
3$-9&//&"'0 E$++&'= "- #&/!-&7.!&'= * LI;@_\ "% $2*93+$/ %-"9 _5@$&++8 7""C/ #"$/
-$P.&-$ 3$-9&//&"'0 <'/,$-&'= * P.$/!&"' 78 )&!&'= !(&/ 7""C *'# P."!&'= $2*93+$
)"#$ #"$/ '"! -$P.&-$ 3$-9&//&"'0 A')"-3"-*!&'= * /&='&%&)*'! *9".'! "% $2*93+$ )"#$
%-"9 !(&/ 7""C &'!" 8".- 3-"#.)!5/ #").9$'!*!&"' #"$/ -$P.&-$ 3$-9&//&"'0
G$ *33-$)&*!$4 7.! #" '"! -$P.&-$4 *!!-&7.!&"'0 <' *!!-&7.!&"' ./.*++8 &')+.#$/ !($ !&!+$4
*.!("-4 3.7+&/($-4 *'# AEQJ0 W"- $2*93+$R i@%" 4&%6,972 9G *&#&"&E 9H?&0 4 1(&-# g#;
&!&"'4 78 Y$&% \*#/$'4 c&9 K*' \$==$+$'4 *'# @.//$++ Q-8*'! >_5@$&++8B0 L"38-&=(!
N`MM Y$&% \*#/$'4 c&9 K*' \$==$+$'4 *'# @.//$++ Q-8*'!4 ^SU;`;d^T;dMSfV;N0j
A% 8". %$$+ 8".- ./$ "% )"#$ $2*93+$/ %*++/ ".!/&#$ %*&- ./$ "- !($ 3$-9&//&"' =&6$' *7"6$4
%$$+ %-$$ !" )"'!*)! ./ *! + 4.&%%&'#%1'4 &--D()'.0

Safari Books Online


G($' 8". /$$ * E*%*-& Q""C/ _'+&'$ &)"' "' !($ )"6$- "% 8".- %*6"-&!$
!$)('"+"=8 7""C4 !(*! 9$*'/ !($ 7""C &/ *6*&+*7+$ "'+&'$ !(-".=( !($
_5@$&++8 J$!,"-C E*%*-& Q""C/($+%0
E*%*-& "%%$-/ * /"+.!&"' !(*!5/ 7$!!$- !(*' $7""C/0 A!5/ * 6&-!.*+ +&7-*-8 !(*! +$!/ 8". $*/&+8
/$*-)( !("./*'#/ "% !"3 !$)( 7""C/4 ).! *'# 3*/!$ )"#$ /*93+$/4 #",'+"*# )(*3!$-/4
*'# %&'# P.&)C *'/,$-/ ,($' 8". '$$# !($ 9"/! *)).-*!$4 ).--$'! &'%"-9*!&"'0 1-8 &!
%"- %-$$ *! 2""+,55%/*/4&('4 &--D()'.0

How to Contact Us
F+$*/$ *##-$// )"99$'!/ *'# P.$/!&"'/ )"')$-'&'= !(&/ 7""C !" !($ 3.7+&/($-R
_5@$&++8 \$#&*4 A')0
M``d k-*6$'/!$&' X&=(,*8 J"-!(
E$7*/!"3"+4 L< ^dVSN
>U``B ^^U;^^fU >&' !($ ?'&!$# E!*!$/ "- L*'*#*B
>S`SB UN^;`dMd >&'!$-'*!&"'*+ "- +")*+B
>S`SB UN^;`M`V >%*2B

Preface | xxvii
Asterisk™: The Definitive Guide
The Asterisk CLI
1($ 7$/! ,*8 !" /$$ ,(*! &/ (*33$'&'= ,&!( 8".- </!$-&/C /8/!$9 &/ !(-".=( !($ </!$-&/C
LYA0 1(&/ &'!$-%*)$ 3-"6&#$/ 6*-&"./ +$6$+/ "% ".!3.! !" +$! 8". C'", ,(*! &/ (*33$'&'=
"' 8".- /8/!$94 *'# "%%$-/ * ,$*+!( "% ./$%.+ .!&+&!&$/ !" *++", 8". !" *%%$)! 8".- -.''&'=
/8/!$90 Q$=&' 78 )*++&'= .3 !($ </!$-&/C LYA *'# -$+"*#&'= !($ )"'%&=.-*!&"' %&+$/ %"-
8".- )(*''$+ 9"#.+$/R
$ sudo asterisk -r
*CLI> module reload chan_sip.so
*CLI> module reload chan_iax2.so

K$-&%8 !(*! 8".- '$, )(*''$+/ (*6$ 7$$' +"*#$#R


*CLI> sip show peers
*CLI> sip show users
*CLI> iax2 show peers
*CLI> iax2 show users

<! !(&/ 3"&'! 8".- </!$-&/C /8/!$9 /(".+# 7$ )"'%&=.-$# !" (*'#+$ -$=;
&/!-*!&"'/ %-"9 !($ #$%&'$# #$6&)$/0 L*++/ !" *'# %-"9 !($ /$!/ ,&++ '"!
,"-C .'!&+ !($ )"'%&=.-*!&"' "' !($ #$6&)$/ (*/ 7$$' )"93+$!$#0 E&')$
$*)( #$6&)$ &/ #&%%$-$'! &' !(&/ -$=*-#4 #$!*&+$# )"'%&=.-*!&"' &'/!-.)!&"'/
%"- $*)( 9"#$+ *-$ ".!/&#$ "% !($ /)"3$ "% !(&/ 7""C0

Testing to Ensure Your Devices Have Registered


_')$ 8".- #$6&)$ (*/ -$=&/!$-$# !" </!$-&/C4 8". ,&++ 7$ *7+$ !" P.$-8 !($ +")*!&"' *'#
/!*!$ "% !($ #$6&)$ %-"9 !($ </!$-&/C LYA0

A! &/ * )"99"' 9&/)"')$3!&"' !(*! -$=&/!-*!&"' &/ (", * #$6&)$ *.!($';


!&)*!$/ &!/$+% %"- !($ 3.-3"/$ "% "7!*&'&'= 3$-9&//&"' !" 9*C$ )*++/0 1(&/
&/ &')"--$)!0 1($ "'+8 3.-3"/$ "% -$=&/!-*!&"' &/ !" *++", * #$6&)$ !"
&#$'!&%8 &!/ +")*!&"' "' !($ '$!,"-C4 /" !(*! </!$-&/Cl C'",/ ,($-$ !"
/$'# )*++/ &'!$'#$# %"- !(*! #$6&)$0
<.!($'!&)*!&"' %"- ".!="&'= )*++/ &/ *' $'!&-$+8 /$3*-*!$ 3-")$// *'# *+;
,*8/ (*33$'/ "' * 3$-;)*++ 7*/&/4 -$=*-#+$// "% ,($!($- * /$! (*/ -$=&/;
!$-$#0 1(&/ 9$*'/ !(*! 8".- /$! 9*8 7$ *7+$ !" 9*C$ )*++/4 7.! '"! -$)$&6$
!($90 1(&/ ,&++ '"-9*++8 (*33$' ,($' !($ /$! (*/ '"! -$=&/!$-$# /.);
)$//%.++8 >/" </!$-&/C #"$/ '"! C'", ,($-$ &! &/B4 *'# 8$! (*/ !($ )"--$)!
)-$#$'!&*+/ %"- 9*C&'= )*++/ >/" </!$-&/C &/ ,&++&'= !" *))$3! )*++/ %-"9 &!B0

1" )($)C !($ -$=&/!-*!&"' /!*!./ "% * #$6&)$4 /&93+8 )*++ .3 !($ </!$-&/C LYAR
$ sudo asterisk -r

l_- *'8 "!($- EAF -$=&/!-*- /$-6$-4 %"- !(*! 9*!!$-0

Testing to Ensure Your Devices Have Registered | 99


183&'= !($ %"++",&'= )"99*'# -$!.-'/ * +&/!&'= "% *++ !($ 3$$-/ !(*! </!$-&/C C'",/
*7".! >-$=*-#+$// "% !($&- /!*!$BR
*CLI> sip show peers
Name/username Host Dyn Nat ACL Port Status
0000FFFF0001/0000FFFF0001 192.168.1.100 D N 5060 Unmonitored
0000FFFF0002/0000FFFF0002 192.168.1.101 D N 5060 Unmonitored

D". 9*8 '"!&)$ !(*! !($ Name/username %&$+# #"$/ '"! *+,*8/ /(", !($
%.++ '*9$ "% !($ #$6&)$0 1(&/ &/ 7$)*./$ !(&/ %&$+# &/ +&9&!$# !" Nd
)(*-*)!$-/0

J"!$ !(*! !($ Status &' ".- $2*93+$ &/ /$! !" Unmonitored0 1(&/ &/ 7$)*./$ ,$ *-$ '"!
./&'= !($ qualify=yes "3!&"' &' ".- %&+()'#* %&+$0

Analog Phones
1($-$ *-$ !," 3"3.+*- 9$!("#/ %"- )"''$)!&'= *'*+"= 3("'$/ !" </!$-&/C0 1($ %&-/! &/
78 ./&'= *' <1< !(*! 9"/! )"99"'+8 )"''$)!/ !" </!$-&/C ./&'= !($ EAF 3-"!")"+0 1($
</!$-&/C )"'%&=.-*!&"' %"- *' <1< &/ !($ /*9$ */ &! ,".+# 7$ %"- *'8 "!($- EAF;7*/$#
(*'#/$!0 1($ "!($- 9$!("# &/ !" #&-$)!+8 )"''$)! !($ 3("'$/ !" !($ </!$-&/C /$-6$- ./&'=
!$+$3("'8 (*-#,*-$ %-"9 * 6$'#"- /.)( */ I&=&.90 I&=&.9 /$++/ !$+$3("'8 )*-#/ !(*!
)*' 7$ *##$# !" 8".- /$-6$- !" 3-"6&#$ W]E 3"-!/ %"- )"''$)!&'= *'*+"= 3("'$/ >"- %*2
9*)(&'$/B0 W"- !($ 3.-3"/$/ "% #$9"'/!-*!&'= !($ )"'%&=.-*!&"'4 ,$5-$ ="&'= !" /(",
!($ )"'%&=.-*!&"' -$P.&-$# &% 8". (*# * I&=&.9 <g]VV`g )*-#4 ,(&)( &/ *' <g]VM`
(*+%;+$'=!( FLA;g23-$// ,&!( %".- W]E 9"#.+$/ *'# (*-#,*-$;7*/$# $)(" )*')$++*!&"'0

@$=*-#+$// "% ,(&)( (*-#,*-$ 8". *-$ ./&'=4 )"'/.+! 8".- 6$'#"-5/
#").9$'!*!&"' %"- *'8 (*-#,*-$;/3$)&%&) )"'%&=.-*!&"' -$P.&-$9$'!/0

W&-/!4 $'/.-$ !(*! 7"!( </!$-&/C *'# I<XIA *-$ &'/!*++$# >-$%$- 7*)C !" iX", !" A'/!*++
A!j "' 3*=$ VU %"- &'/!-.)!&"'/B0 J"!$ !(*! I<XIA 9./! 7$ &'/!*++$# 7$%"-$ 8". &'/!*++
</!$-&/C0 G($' 8". &'/!*++ I<XIA4 7$ /.-$ !" &'/!*++ !($ &#&" /)-&3! */ ,$++0 1(&/ ,&++
$'/.-$ !(*! 8".- (*-#,*-$ &/ 3-"3$-+8 &'&!&*+&[$# ,($' !($ /8/!$9 7""!/ .30 1($ &#&"
/)-&3! &/ &'/!*++$# %-"9 !($ G@IGJ$"''-% 3*)C*=$0

100 | Chapter 5:ಗUser Device Configuration

You might also like