Professional Documents
Culture Documents
BuyKindleebookBuyaVoIPphone
RonaldLewis
10Minutes:AsteriskPBXonAmazonEC2
BuyKindleebookBuyaVoIPphone
RonaldLewis
10Minutes:AsteriskPBXonAmazonEC2
BuyKindleebookBuyaVoIPphone
10Minutes:
AsteriskPBXonAmazonEC2
RonaldLewis
RonaldLewis
10Minutes:AsteriskPBXonAmazonEC2
BuyKindleebookBuyaVoIPphone
RonaldLewis
CopyrightNotice
Copyright2011byRonaldLewis
Allrightsreserved.PertheU.S.CopyrightActof1976,nopartofthispublication
maybereproduced,distributed,transmitted,orstoredusinganymethodwithout
theexpresswrittenconsentoftheauthorand/orpublisher,exceptinthecaseof
reviewsorarticles.AllinquiriesshouldbeaddressedtoDoxonMillsviaemail:
info@doxonmills.com.
VisitRonaldswebsiteatronaldlewis.comortwitter.com/ronaldlewisDoxonMills
isonlineatdoxonmills.com.
Firstebookedition:2008
Newebookedition:March21,2011
10Minutes:AsteriskPBXonAmazonEC2
BuyKindleebookBuyaVoIPphone
OtherbooksbyRonald
StickittoTheMan(2009),SkyhorsePublishing
RonaldLewis
10Minutes:AsteriskPBXonAmazonEC2
BuyKindleebookBuyaVoIPphone
Welcome!
Thousandsofpeoplearoundtheworldhavereliedon
thissimpleguidetoinstallAsteriskforthefirsttimeon
AmazonEC2.Thankyouforyoursupport!AKindle
editionisavailableforpurchaseifyou'dliketosupport
Ronald'swork,futureupdates,etc.It'sonly99cents!
Yourpurchaseof10Minutes:AsteriskPBXon
AmazonEC2ismuchappreciated.
Thisquickstartguidewillteachanyonehowtodeploya
functionalAsteriskPBXonAmazon'sEC2(Elastic
ComputeCloud)service.Asteriskistheworld'smost
popularopensourcePBX,withmillionsofinstallations
todate.In10minutesorless,you'llbeupandrunning
witharobusttelephonyplatforminthecloud.This
guideisbasedonmonthsofevaluatingandtesting
Asteriskinacloudenvironmentandhasbeenusedfor
EC2deploymentseverywhere.Onceyoulearnhowto
installitonce,you'llneverhaveaprobleminstalling
futureupdates.
RonaldLewis
10Minutes:AsteriskPBXonAmazonEC2
BuyKindleebookBuyaVoIPphone
RonaldLewis
AbouttheAuthor
Constantlyinvestigatinginnovativeandnewideas,
RonaldLewisisouttochangetheworld.Through
hiscareerasanindependentjournalist,Ronaldhas
beenabletoestablishandcultivaterelationshipswith
someofthebiggestnamesintechnologyandthe
mosttalkedaboutnamesinentrepreneurship.
Currently,heisanadvocateforseveralrevolutionary
technologiesandservesasanactivistagainstthe
unknowninjusticeswhichplagueourculture.Hislife
ofresearchandinterestinjustprogramsleadtothe
publicationofhisfirstbook,StickittotheMan,
releasedsummerof2009throughSkyhorse
Publishing.
Ronaldssuccesshasntcomeeasy.Aftermany
starts,failures,andrestartshehasfinallyfoundhisgrooveandestablisheda
wonderfullifeinDenver,Colorado.Hislifeisproofthattheonlyrequirementsfor
beingsuccessfulistoneverlosesightofyourgoalsamessagehehopesto
inspireinothers.
BorninDetroit,Michigantoaverysupportivemotherandaveryneglectfulfather
Ronalddidtheonlythingachildcoulddoatthatage:excelinschool.Hiscuriosity
andappetiteforinformationusuallyplacedhimatthetopofhisclass.Ronald,with
hisinfiniteimagination,madehisfirstcomputeroutofconstructionpaper.Atthe
ageof10Ronaldsneighborhoodlandscapingbusinessservedashisfirststartup
companyandignitedhisentrepreneurialspiritforlife.
ThingsonlywentupforRonaldfromthere.Hisindustriousattitudeandappetitefor
thingsthatwerenewalwaysleadhimtothenextstep.Atayoungagehetaught
himselfhowtoprogramcomputersusingMicrosoftQuickBasicand,later,Visual
Basic.
Attheageof15RonaldattendedanengineeringconferencewherehefirstsawBill
10Minutes:AsteriskPBXonAmazonEC2
BuyKindleebookBuyaVoIPphone
RonaldLewis
Gatesspeak.LewislatersentalettertoGates,expressinghisenthusiasmtowards
histechnologyandhisteamofengineers.Gates,impressedwithhowwellinformed
a15yearoldcouldbe,maintainedcorrespondencewithLewis.Overthecoming
years,Ronaldwouldtestnumeroussoftwareprogramsandwouldreceiveawards
forthisworkincludingtheSpiritofDetroitandMicrosoftMVP.
OverthenextseveralyearsRonaldexperiencedhighsandlows.Athisworst,he
wasindebt,crashingwithfriends,andundergoingmentalandemotionalstress
fromthedeathofhisfatherandthedivorcefromhiswife.Athishighest,hewason
aSouthbySouthwestpanelaboutraceandtechnology,hostinganonlineinterview
showfeaturingguestsfromCisco,CarnegieMelon,andSouthwestAirlines,and
publishingabookabouthowtoskirtourcountrysmajorfinancialinstitutions.
Currently,RonaldlivesandworksinDenver,wherehecontinuestoadvocatenew
technologiessuchasSquare,VoIP,andCloudComputing.Heisalsoanactivist
againstbigbanksandhashostedseveralmajorspeakingengagements.Currently,he
believesinlivingalifewithoutlimitsandproposeseveryonedothesameto
recognizeyourownlimitations,visibleandotherwise,andtonotletthemkeepyou
fromachievingwhatyoumostwantfromlife.
10Minutes:AsteriskPBXonAmazonEC2
BuyKindleebookBuyaVoIPphone
RonaldLewis
Sponsors
Supporttheworld'smostpopularAsteriskPBXonAmazonEC2guidebytryinga
sponsorbelow!Yoursupportofthesesponsorswillenablefutureupdatesand
improvementstothisguide.
VoIPphones
Asteriskappliances/gear
10Minutes:AsteriskPBXonAmazonEC2
BuyKindleebookBuyaVoIPphone
RonaldLewis
Assumptions
YouhaveanactiveAmazonAWSaccount
YouarefamiliarwithlaunchingEC2instances
Requirements
MozillaFirefox(download)
FirefoxPlugin(recommended):ElasticfoxforAmazonEC2(download)
SoftphoneorVoIPphone(buynow)
10minutes
GettingStarted
AsuccessfuldeploymentofAsteriskonAmazonEC2requiresthatyouenable
threecriticalportsonEC2'sfirewall.Withoutthem,Asteriskwillnotwork.
Thus,thefollowingportsarekeytopassingRTPpackets(forvoice)andSIP
signaling(fordevices,DTMFcodes,etc.):
5060(UDP)
4569(UDP)
1000020000(UDP)
22(TCP)(You'llneedthisforSSHaccess)
Nowthatyou'veenabledtheportsnecessaryforAsterisktofunction,it'stimeto
launchaninstance!Let'suseEricHammond'sUbuntuAMI(AmazonMachine
Image),amice44a1a7,andthe1000HZAKI,aki9b00e5f2.ThisAKIis
importantbecauseitisspecificallycompiledforVoIPapplicationssuchas
Asterisk.AnyAKI(AmazonKernelImage)otherthanonesetat1000HZwill
produceundesirableresultsinvoicequalityandfunctionality.
CompilingandCustomizingAsterisk
10Minutes:AsteriskPBXonAmazonEC2
BuyKindleebookBuyaVoIPphone
RonaldLewis
You'veaddedthenecessaryportsandlaunchedtheimageusedforthisguide.
Now,it'stimetocompileafewcomponentswhicharenecessarytobuild
Asterisk.WhycompilethesourcecodeofAsterisk?It'sgreatpracticetolearn
howtoindependentlycreatethebitsfortheworld'sbestopensourcePBX!It's
painless!
Let'sgetstarted:
OpenanSSHconnectiontoyournewlylaunchedinstance
Loginasroot
Enterthefollowingatthecommandline:
:aptgetyinstalllibc6devg++gcclibncurses5devmakesubversion
WARNING:DONOTINTERRUPTTHISPROCESS.PLEASE
WAITUNTILALLCOMPONENTSHAVEBEENINSTALLED
Gettingcloser!
Let'sproceedtodownloadAsterisk'ssourcecode,shallwe?Atthecommandline,
enterthefollowing:
:cd/mnt
:mkdirsource
:cdsource
:svncheckouthttp://svn.digium.com/svn/asterisk/tags/1.4.21.1asterisk
TIP:Asterisk1.4.21.1isanolder,butstableversion.Supplementtheversion
10Minutes:AsteriskPBXonAmazonEC2
BuyKindleebookBuyaVoIPphone
RonaldLewis
numberwithaneweroneifyouprefer
:cdasterisk
:./configure
:cd/mnt
Finally,it'stimetocompileAsterisk!
Asteriskisconfigured!Now,let'scompilethebitsforagreatpieceofsoftware.At
thecommandprompt,enter:
:makeinstall
TIP:Nowisaperfecttimetomakeasandwich,walkthedog,dochores,or
buyaniceVoIPphone.ComebacklaterYou'llneedonlyafewminutesto
completetheinstallation
:makesamples
You'vereachedthefinishline!You'vejustprepared,configuredand
compiledyourveryownworldclassPBX"inthecloud"onAmazonEC2.
Yourfriendswillbejealous.Now,let'sconfigureyourdialplanand
softphonefortesting.
Atthecommandprompt,enter:
:cd/etc/asterisk
:nanosip.conf
10Minutes:AsteriskPBXonAmazonEC2
BuyKindleebookBuyaVoIPphone
RonaldLewis
IMPORTANT!Pleaseeditsip.confaccordingtotheinstructionsbelow.
Find'disallow=all'andremovethe''symbol
Find'allow=ulaw'andremovethe''symbol
Find'externip='andenterthePUBLICIPaddressofYOURinstance(e.g.,
75.75.101.100)
Find'localnet="andenter'10.0.0.0/255.0.0.0'after'='andremove""
Find'nat='andremove''andadd'route'after'='
AddthefollowingtotheENDofthesip.confconfigurationfile(Necessaryto
testyoursoftphonewithAsterisk)
[1234]
type=friend
callerid="Asterisk"<1234>
host=dynamic
canreinvite=no
secret=1234
dtmfmode=rfc2833
context=default
qualify=yes(IMPORTANTOursoftphoneWILLNOTworkwithoutthis
designation)
SavethechangesinNanobypressing'CTRL+X'
EDITEXTENSIONS.CONF
Atthecommandprompt,enter:
:nanoextensions.conf
+++extensions.confisthe'trafficmanager'ofAsterisk.Here,you'lldefine
Asteriskhandlesextensions,phonenumbers,voicemailandmore.
10Minutes:AsteriskPBXonAmazonEC2
BuyKindleebookBuyaVoIPphone
RonaldLewis
AddthefollowingtotheENDofextensions.conf(thiswilltestthedialplanandsee
ifwehaveaudio)
exten=>*98,1,VoiceMailMain
exten=>*98,2,Hangup
StartAsterisk
:asterisk
StartsAsteriskPBX
:asteriskr
LaunchesAsteriskmanagementconsole
ConfigureXLite
username:1234
password:1234
authorizationname:1234
domain:<EC2INSTANCEPUBLICIP>
IMPORTANT!
CHECK'Registerwithdomain'
CHECK'Sendoutboundvia'<DOMAIN>
BesuretoENABLEyourSIPaccount
*TestyourAsteriskinstallation
1.OpenXLite
2.Enter'*98'
10Minutes:AsteriskPBXonAmazonEC2
BuyKindleebookBuyaVoIPphone
RonaldLewis
3.Click'Send'
YoushouldbegreetedwiththeAsteriskVoicemailSystem('ComedianMail').
Congratulations!YouhaveafullyfunctioningAsteriskPBXonAmazon
EC2.Welcometothefutureoftelephony.Ifthisguidewasuseful,whynot
buyacopyforKindle?FollowRonaldonTwitterorvisithiswebsite.