Vous êtes sur la page 1sur 45

VoIP4DPrimer

BuildingVoiceInfrastructureinDevelopingRegions

Authors:

AlbertoEscuderoPascual LouiseBerthilson

BuildingVoiceInfrastructureinDevelopingRegions VoIP4DPrimer

TableofAbbreviations
Abbreviation ATA DECT FXO FXS GSM IAX(IAX2) IETF ITU IVR NAT PBX(PABX) PCM PSTN QoS RFC RTP SCCP SIP SS7 TA UDP VoIP VSAT Description AnalogueTelephoneAdapter DigitalEnhancedCordlessTelecommunications ForeignExchangeOffice ForeignExchangeStation GlobalSystemforMobilecommunication InterAsteriskeXchangeprotocol(version2) InternetEngineeringTaskForce InternationalTelecommunicationsUnion InteractiveVoiceResponse NetworkAddressTranslator Private(Automatic)BranchExchange PulseCodeModulation PublicSwitchedTelephoneNetwork QualityofService RequestForComment RealtimeTransportProtocol SkinnyCallControlProtocol SessionInitiationProtocol SignallingSystem7 TelephoneAdapter UserDataProtocol VoiceoverIP VerySmallApertureTerminal

BuildingVoiceInfrastructureinDevelopingRegions VoIP4DPrimer

Descriptionofillustrations

BuildingVoiceInfrastructureinDevelopingRegions VoIP4DPrimer

Table of Contents
1.Introduction.....................................................................................................................................................1 2.Themagicpotion.............................................................................................................................................2 2.1VoIP............................................................................................................................................................2 2.2OpenStandardsandFreeandOpenSourceSoftware................................................................................3 2.3Asterisk.......................................................................................................................................................4 3.Therecipe........................................................................................................................................................4 3.1PBX............................................................................................................................................................4 3.2PSTN..........................................................................................................................................................5 3.3Signallingintraditionaltelephony..............................................................................................................6 3.3.1Analoguesignalling..............................................................................................................................6 3.3.2TelephoneExchangeSignalling............................................................................................................7 3.4SignallinginIPTelephony........................................................................................................................7 3.4.1SessionInitiationProtocol(SIP)..........................................................................................................7 3.4.2ProxyServers.......................................................................................................................................8 3.4.3RealTimeProtocolandNAT..............................................................................................................8 3.4.4InterAsteriskeXchange(IAX).............................................................................................................9 3.5VoIPHardware.........................................................................................................................................10 3.5.1VoIPPhones.......................................................................................................................................10 3.5.2SoftPhones........................................................................................................................................10 3.5.3PSTNinterfacecards.........................................................................................................................10 3.5.4AnalogueTelephoneAdaptors............................................................................................................11 3.6Codecs.......................................................................................................................................................11 3.7QualityofService.....................................................................................................................................12 3.7.1Latency...............................................................................................................................................12 3.7.2Jitter...................................................................................................................................................13 4.HandsonBuildingyourPBX.....................................................................................................................14 4.1WhatdoIneed?.......................................................................................................................................14 4.1.1InstallationTips.................................................................................................................................14 5.InstallingAsterisk..........................................................................................................................................15 5.1CompilingAsterisk...................................................................................................................................15 5.2FetchingAsteriskPackages.......................................................................................................................16 5.3BasicAsteriskCommands........................................................................................................................17 5.4ConfigurationFiles...................................................................................................................................18 5.5Peers,UsersandFriends...........................................................................................................................19 6.SCENARIOA Privatetelephonynetworkinaruralcommunity...........................................................................................20 6.1Background...............................................................................................................................................20 6.2ConfiguringtheVoIPclients....................................................................................................................20 6.2.1CommunityLibrary............................................................................................................................20 6.2.2Hospital.............................................................................................................................................21 6.2.3PrimarySchool..................................................................................................................................22 6.2.4Farmers'Association..........................................................................................................................23 6.3ConfiguringAsterisk................................................................................................................................24 7.SCENARIOB ReachingthePSTN.......................................................................................................................................27 7.1AddingsupportfortheTDM400Pcard...................................................................................................27 7.1.1HandlingPSTNincomingcalls..........................................................................................................28 7.1.2MakingthePSTNavailablefromthedialplan...................................................................................29 7.2AttachingananaloguephonetothePBX................................................................................................29

BuildingVoiceInfrastructureinDevelopingRegions VoIP4DPrimer

7.3UpdatingtheDialplan..............................................................................................................................31 8.SCENARIOC InterconnectingcommunitiesusingVoIP.......................................................................................................32 8.1Typicalsatelliteconnectionissues............................................................................................................32 8.2InterconnectingoftwoAsteriskservers....................................................................................................33 8.2.1Telecentre..........................................................................................................................................33 8.2.2TrainingCentre..................................................................................................................................34 8.2.3Theregistercommand........................................................................................................................35 9.Learningmore................................................................................................................................................35 10.Conclusion....................................................................................................................................................35 11.Acknowledgements.......................................................................................................................................36

BuildingVoiceInfrastructureinDevelopingRegions 1.Introduction

1.Introduction
Itwasnotuntilspring2004Ifirstheardaboutapieceoffreesoftwarethatwasabletodo exactlywhatIneeded.IwaslivinginTanzaniawithanunreliablephonelineandprohibitive phonetariffs.AssoonasImanagedtogetInternetaccess,Istartedtocallabroadusinga wellknownproprietarytelephonysoftwarebutIsoonfeltfrustratedbecauseitdidnotgive metheflexibilityIneeded.WhatIreallywantedwastousemyInternetaccessinTanzania tobeabletoplacephonecallsviamyownofficeinSwedenandbeabletoofferthatvoice connectiontoothers. TheideaofusingtheInternetasanalternativetothetelephonenetworkwasnotnew,butthe softwarethatmadeitpossiblecertainlywasrevolutionary.Thepieceofsoftwarethatcould convertanycomputertoatelephoneexchangewascalledAsterisk.1Itdidnottakememuch time torealise thatthatpieceof freesoftwarewasabletodofarmorethatIcouldever imagine and opened an unimaginable world of opportunities for communities in both the developedanddevelopingworld.Thefeelingwasmuchlikemyveryfirstconnectiontothethe WorldWideWebin1994. Nodoubt,theexperienceoflearninghowtosetup Asterisk waspainfulandalthoughsome verygoodbooksarenowavailable,Ihavenotseenanydocumentthatintroducessomebasic concepts tocommonhumanbeingsinanintuitivemanner. Thisprimerisanattemptto introduceyoutothoseessentialsofIPtelephonyandgiveyousomeconcreteexamplesofthe potentialuseindevelopingregions. Asthegoalwastocreateashortbutnotnecessarily simplisticdocument,abigpartofthisefforthasbeentobeaspedagogicalaspossible. Bepatient.Yourpersistenceisthekeyforselflearning. Beforedescribinghowyoucanbuildyourowntelephonysystem,weintroducetheessentialsof telephonyovertheInternet(Sections2and3).Takethetimetoreadthroughthesesections inthelongrun,understandingthebasicconceptsisfarmoreimportantthaninstallingthe software. Forthosewhowanttoputtheoryintopractice,thetwofollowingsectionscoverhowtobuild aPBXincludingassemblingthehardware(Section4)andinstallingthesoftware(Section5). Insteadoflistingallpossiblecommandsandendlessconfigurationoptions,wehaveselected threepracticalscenariosasbasicexamples.Rememberthatthegoalistogetyoustarted.The threescenariosare:

Privatetelephonyinaruralcommunity(Section6) ConnectingthelocaltelephonenetworktothePSTN(Section7) Interconnectingtworemotecommunities(Section8)

1. Asteriskisanopensourceprojectbasedonideasofthe Zapata Telephony Project. http://www.asteriskdocs.org/modules/tinycontent/index.php?id=10

BuildingVoiceInfrastructureinDevelopingRegions 1.Introduction

Finally,weconcludewithalistofusefulreferencesandpointerstoresourcestolearnmore (Section9).

2.Themagicpotion
Three magic elements will enable you to deploy a flexible and selfmanaged telephony infrastructure:VoIP,openstandardsandfreeandopensourcesoftware.

2.1VoIP
AgeneraldefinitionofVoiceoverIP(alsoknownasIPtelephony)isthepossibilityofcarrying telephone conversations as IP packets. When we talk about VoIP, we refer to Internet telephony in the broad sense. We are not referring to any of the concrete mechanisms availabletocarryvoicesignalsovertheInternet.Dozensoftechnicalalternativesallowsuch conversationstotakeplace.VoIPalternativescaneasilybedividedintotwomaingroups: closedproprietaryandopensystems.InthefirstgroupwefindtheverypopularSkypeandthe legendaryCisco'sSkinny(SCCP).2Amongthesecondgroupwefindopenstandardsbasedon SIP,3H.3234andIAX2.5 TheH.323,aprotocoldevelopedbytheITU,wasinitiallythemostpopularprotocolbecause it was widely used in the core backbones of the largest carriers. SIP has increased its popularityasVoIPhasmovedtothe"localloop."6Latelywehaveseenanothernewcomer, IAX,whichisheavilybasedoncommunitydevelopment,haslearnedfromthepast,andseems tobeabletoaddressmanyofthelimitationsofitspredecessors.AlthoughIAXisnotan officialstandardprotocol(RFC),7itisenormouslyrespectedbythecommunityandhasallthe prerequisitestobecomeadefactoreplacementofSIP. OneofthekeyissueswithalltraditionalVoIPprotocolsisthewastedbandwidthusedfor packetheaders.Thisproblembecomesmoreimportantindevelopingregionswhereaccessto internationalbandwidthishighlylimitedandthecostsforInternetaccessareatleast100 timeshigherthaninEuropeandNorthAmerica.8 TogetasenseofhowbigtheoverheadcanbewhensendingvoiceovertheInternet,consider thefactthata5.6kbit/scompressedaudiowillrequire18kbit/sofbandwidth.Thedifference betweenthe5.6kbit/sand18kbit/sisthepacketheaders.Thepacketheadersareallthe
2. TheSkinnyClientControlProtocolisaproprietaryterminalcontrolprotocoloriginallydevelopedbySelsius CorporationandnowownedanddefinedbyCiscoSystems,Inc.OneofthemostfamousSkinnyclientsisthe Cisco7900seriesofIPphones. 3. TheSignallingInitiationProtocol(SIP)isaprotocolfromtheIETFthatdescribeshowtohandlesessionswith oneormoreparticipants. 4. H.323isanumbrellarecommendationfromtheITUTthatdefinestheprotocolstoprovideaudiovisual communicationsessionsonanypacketnetwork.ItistheprotocolusedbyfamousapplicationsasNetmeeting. 5. IAX2isatheInterAsteriskprotocolusedbyAsterisk,anopensourcePBXserver.ItenablesVoIPconnections betweenAsteriskserversandIAX2clients. 6. Thelocalloopisthephysicallinkthatconnectsacustomertotheedgeofthetelecommunicationservice provider. 7. RequestforComments(RFCs)isaseriesofnumberedInternetinformationaldocumentsandstandards 8. 1MbpsinEastAfricacostsmorethan1000USD/monthwhilethesamecapacityinSwedencostslessthan10 USD/month.

BuildingVoiceInfrastructureinDevelopingRegions 2.Themagicpotion

information that is necessary to carry the voice packets to the recipient. IAX2 has done excellentworkinreducingthatoverheadbylimitingtheamountofextrabitsperpacket.It hasalsotakenadvantageoftheconceptofbundlingconversationsthatareheadingtothe samedestinationandwrappingthemupinsidethesamepackets. Someofthetestsperformedduringthewritingofthisprimer(usingadialupconnectionto theInternet)haveevidencedthatanIPbasedphoneconversationusingIAX2ismorefeasible thanaconversationwithSIP.9

2.2OpenStandardsandFreeandOpenSourceSoftware
We can not talk about the freedom of building our own telephone network without open standardsandfreeandopensourcesoftware.Openstandardsalloweveryonetoimplement interoperable communication systems. With interoperability, we can build our private telephonenetworkandlaterplugitintotheglobalnetwork.Withfreesoftware,wecanlearn fromexistingexperiences,integratesolutionsandultimatelyshareourresultswithothers. Oneofthefirstquestions that needs anansweris: Why shouldwe buildourown VoIP infrastructureandnotrelyonfreeserviceslikeSkype? Theanswerissimple:sustainabilityandflexibility.Freeservicesmightsolveourimmediate problem, but do not guarantee technology ownership and hence cannot guarantee our independenceinthelongrun.Thequestionisnotjustaboutwhichtechnologyisbetter,but ratherwhichtechnologyenablescommunitiestoowntheirdevelopmentprocessandadaptit totheirownneeds. Itisdifficulttoimagesustainabledevelopmentwithoutknowledgetransferandtechnology ownership.Asolutionbasedonopenstandardsandfreeandopensourcesoftwaredoesnot onlyprovideagoodtechnicalsolutionbutalsoenablesthepossibilityofadaptingittofit everyone'srequirements. Tounderstandwhyopenstandardsareimportant,letusstartbyprovidingasimpledefinition ofastandard.Astandardisasetofrules,conditions,orrequirementsdescribingmaterials, products,systems,services,orpractices.Intelephony,technicalstandardshaveensuredthat telephoneexchangesaroundtheglobecaninteroperatewitheachother.Withoutstandardsa telephonesystemofoneregionmightnotinteroperatewithanothersystemafewkilometres away.Althoughmanyofthetelephonystandardsarepubliclyavailable,telephonyhasalways been under the control of a few vendors capable of negotiating contracts at regional or nationallevels.Thisfactmightexplainwhyitisextremelycommontoseethesametypeof telephoneequipmentallovera particularcountry.Talkingabouttelephony equipment has always meant discussing technology built specifically to serve a single purpose, known as dedicatedhardwareandsoftware.Althoughtherules(orstandards)thatgoverntelephony havebeenrelativelyopen,therulesthatgovernthehardwarehavealwaysbeenkeptsecret.

9. AphoneconversationusingavoicecompressionalgorithmlikeG.729(8Kbps)willrequire30KbpsusingSIP and24KbpsusingIAX2.Ifwebundlefivecallstogetherthebitratepercallis13Kbps.

BuildingVoiceInfrastructureinDevelopingRegions 2.Themagicpotion

Open standards was one of the conditions needed to allow anyone to build telephony infrastructure,butwhatcreatedthisnewrevolutionwasthepossibilityofemulatingthose expensivetelephonysystems(hardwarebased)withapersonalcomputerandsoftware.Allthe requiredelementsarenowinplace:

wehaveaccesstothesoftwareandhardwaretoexchangephonecalls wehaveanopenandpublicnetworktoexchangethecalls(theInternet) weareabletoadaptandmodifyalltheseelementstomeetourownneeds

2.3Asterisk
Asterisk is a free and open source implementation of a telephone exchange. The software allowsanumberofattachedphonestomakecallstooneanotherandtoconnecttotheglobal telephonynetwork.ThecodewasoriginallycreatedbyMarkSpencer(Digium)basedonthe ideasandpreviousworkofJimDixon(ZapataTelephonyProject).Thesoftwareanditsmany newfeatures(includingbugreports)havebeencontributedbytheopensourcecommunity. Although Asterisk canrunonseveralplatforms,GNU/Linuxisthebestsupportedoperating system. TorunAsterisk,youonlyneedapersonalcomputer(PC)butyouneedspecialhardwareif youwishtoattachordinarytelephonesorconnecttothetelephonenetwork.

3.Therecipe
ThissectionsummarizesthebasicconceptsbehindVoIP.Understandingeachofthemwillbe veryusefulwhenyoustartconfiguringanysoftwarerelatedtoIPtelephony.AlthoughVoIPis a vast knowledge area, we have carefully selected a few essential concepts. This section providesabasicbutstillsolidunderstandingofwhatyouneedtoknowtogetstartedand buildyourfirsttelephonesystem.

3.1PBX
A PBX or a PABX is a non selfexplanatory technical acronym that stands for Private (Automatic)BranchExchange.Insimplewords,themostcommonuseofaPBXistoshare oneorseveraltelephonelineswithmultipleusers.APBXsitsbetweenthetelephonelinesand severalphones(voiceterminals).APBXhastheabilitytoredirectincomingcallstoagiven phone,ortoallowphonestochooseaspecifictelephonelinetoplaceaphonecall.Inthesame waythatanInternetrouterisresponsibleofredirectingdatapacketsfromasourcetooneor moredestinations,aPBXroutesphonecalls. TheconceptofprivateintheacronymPBXmeansthattheownerofthesystemmanages theunitanddecideshowtosharetheexternalphonelineswithitsusers.

BuildingVoiceInfrastructureinDevelopingRegions 3.Therecipe

A PBX does not only allow you to share a telephone line among several users but also providesvalueaddedservicessuchastransferringcalls,threewaycalling,10voicemail(orvoice toemail),11InteractiveVoiceResponse(IVR)12services,etc. APBXcanbeveryusefulinseveraldifferentscenarios.Forexample,indevelopingregions, accesstothetelephonynetworkoftenimplyavisittoacallingpoint(privatephonebooth)or alongwalktoaTelecentre.Acommonsituationisthatonlyonetelephonelineisavailablein anofficebuildingorinaruralareabutseveralorganizations,locatedintheneighbourhood, wanttobeabletoreceiveandplacephonecalls.APBXpermitsorganizationsandindividuals inaruralvillagetoconnectandshareasingleavailablephoneline.

3.2PSTN
PSTNstandsforpublicswitchedtelephonenetwork,thetelephonenetworkofthetelephone networksormostcommonlyknownasthetelephonenetwork. Inthesamewaythatthe Internet is the global IP network, the PSTN is the amalgamation of all circuitswitched telephonenetworksintheworld.AnimportantdifferencebetweenthePSTNandtheInternet isthemeaningofflowofinformation.Intelephony(PSTN)aflowofinformationisone completephonecallwhileintheInternetasingledatapacketisaflowofinformationby itself. The PSTN and the Internet are conceptually very different and represent two very different(technicalandpolitical)philosophies.Ifa phonecallisplacedoverthePSTN,a dedicatedchannel(circuit)of64Kbpsneedstobereserved.Ifthephonecallisplacedover the Internet it coexists with many other services simultaneously. Although this difference mightseemirrelevantatfirstsight,ithashugeimplicationsforthedeploymentofICTsin developedanddevelopingregions.Inthetraditionalmodel,acoppercableprovidesaccessto thePSTNandoffersonesingletypeofservice:ananaloguevoicechannel.Ifthesamecableis usedtoreachapacketswitchednetwork,suchastheInternet,anytypeofIPbasedservicecan beprovided. ThePSTNhashistoricallybeengovernedbytechnicalstandardscreatedbytheITU 13while theInternetisgovernedbyIETF14standards.Bothnetworks,thePSTNandtheInternet,use addressestoroutetheirflowsofinformation.WhileinthePSTN,telephonenumbersareused toswitchcallsbetweentelephoneexchanges.IPaddressesareusedtoswitchpacketsbetween Internetrouters.

10. Threewaycallingisthepossibilityofhavingmorethantwopeopletalkinginthesameconversation. 11. Avoicetoemailserviceallowsonetorecordamessage(likeinanansweringmachine)andforwardittoane mailaccount. 12. AnInteractiveVoiceResponsesystemallowsthetelephonecallertoselectanoptionfromavoicemenuby pressinganumberonthetelephonekeypad. 13. TheITUistheistheInternationalTelecommunicationsUnion,anorganizationresponsibleforstandardization, allocationofradiospectrumandandorganizinginterconnectionarrangementsbetweendifferentcountriesto allowinternationalphonecalls.ItispartoftheUnitedNationssystemwithaformalmembershipstructure. 14. TheIETFistheInternetEngineeringTaskForce,anorganizationresponsiblefordevelopingandpromoting Internetstandards.Itisanopen,allvolunteerstandardsorganization,withnoformalmembershipormembership requirements.

BuildingVoiceInfrastructureinDevelopingRegions 3.Therecipe

3.3Signallingintraditionaltelephony
TelephoneexchangesaretheroutersofthePSTN.AForeignExchangeOffice(FXO)isany devicethat,fromthepointofviewofatelephoneexchange,actslikearegulartelephone.An FXOshouldbeabletoacceptringsignals,goonhookandoffhook,andsendandreceivevoice signals.ImagineanFXOasatelephoneoranythingthatrings(likeafaxmachineora modem). AForeignExchangeStation(FXS)iswhatisontheothersideofatraditionaltelephoneline. AFXSdeliversthedialtoneandringtonetothephones.Inanaloguelines,anFXSsupplies theringtoneandthepowertothephonestowork.Togiveyouanidea,anFXS(telephone line)providesaround48VoltsDCtothephoneduringconversation,andupto80VoltsAC (20Hz)whengeneratingaringtone. APBXthatintegratesFXOandFXSinterfacescanconnecttothePSTNorhosttelephones. Telephone lines coming from an operator need to be connected to an FXO interface. Telephone(s)inyourofficemustbeconnectedtotheFXSinterface(s)ofthePBX. Twosimplerulesthatyoushouldrememberare: 1. 2. An FXS needs to be connected to an FXO (like a telephone line needs to be connectedtoaphone)orviceversa. AnFXSsuppliespower(active)tothephoneFXO(passive).

Image1:a)AphoneisaFXOconnectedtoaFXS(thePSTN)b)APBXcanhostbothFXO'sand FXS's.c)AnATAactsasaFXSwhenconnectingaphone(FXO).

3.3.1Analoguesignalling
Asetofsignalsaresenteverytimeyouuseatelephonelinetoprovidefeedbackandstatus informationtotheuser.Amongthesesignalsarethedialandbusytones,thering,andtheon and offhook status. These signals are transmitted between the FXS and FXO using a signallingprotocol. Unfortunately, there are many ways to generate these kindof signals. Each mechanismis knownasasignallingmethod.Signallingmethodsvaryfromoneplacetoanother,soyou need to know which type is used in your telephony lines. Two common access signalling

BuildingVoiceInfrastructureinDevelopingRegions 3.Therecipe

methods are known as loop start and ground start. If you do not know which signalling methodisusedbetweenyourphonesandyourphonelinesyoucanstartbytestingwithloop start.Acommoneffectofchoosingthewrongsignallingmethodisunexpectedhangsinthe phoneline.

3.3.2TelephoneExchangeSignalling
SS7isasetofstandardsdevelopedbyAT&TandtheITUthatamongotherthingsdealwith theestablishmentofcallsandcallroutingbetweentelephoneexchangesinthePSTN.The importantthingtounderstandhereisthatintraditionalphonenetworksthevoiceandthe signallingareseparated.Thismeansthatthereisonecircuitforthevoice(theconversation) andanothercircuittoexchangeadditional(supervisory)informationnecessaryforthecallto beestablished.ThisadditionalbutverynecessaryinformationisexchangedusingtheSS7 protocol. Thefactthatsignallingandvoiceareseparatedmeansthattheydonotnecessarilyusethe samephysicalpathfortheirtransmissions.Thephoneconversationscantravelbyonecable whilethenumbersofthecallerandcalleegobyanothercable.Thisconceptisimportantto understandforthenextconcept:signallinginIPTelephony.

3.4SignallinginIPTelephony
VoiceoverIPsignallingfollowsaphilosophysimilartotraditionalPSTNsignalling.Signals andconversationsareclearlydifferentiated.InthissectionweintroducetwoVoIPprotocols thatwearegoingtointegrateintoourPBX:SIPandIAX2.

3.4.1SessionInitiationProtocol(SIP)
TheSessionInitiationProtocol(SIP)isanInternetprotocoldevelopedbyIETFtoprovide someofthefunctionalityofSS7,butinIPbasedcommunicationnetworksovertheInternet. TheSIPprotocolisresponsibleforsettingupthecallsandsignalling.Rememberthatwhen wetalkaboutsignallinginthecontextofvoicecalls,wearetalkingaboutindicatingabusy line,ringtones,orthatsomeonehasansweredontheotherendoftheline. ThreeimportantthingsthatSIPdoesare: 1. 2. 3. Dealingwithauthentication Negotiatingthequality15ofthephonecall Handling the IP addresses and port numbers to use when sending the voice conversations

15. AbigdifferencebetweentraditionaltelephonyandIPtelephonyisthatthequalityofthephoneconversationcan benegotiated.

BuildingVoiceInfrastructureinDevelopingRegions 3.Therecipe

3.4.2ProxyServers
Although two SIP devices (IP phones) can communicate directly, SIP makes use of some additionalelementscalledproxyserverstofacilitatetheestablishmentofaphonecall.With Internettelephonyyoucanphysicallymoveyourphonenumbertoanylocationintheworld. Thephonenumbersarenottiedtoagivenphysicallocation.Oneofthefunctionalitiesofa SIPProxyServeristoactasanintermediarythatknowshowtofindacertainphonenumber inthenetwork.ASIPProxyServerlearnswhereusersarelocatedbyaprocessknownas registration.

Image2: TheregisteringprocessbetweenclientsandaSIPproxyserver.Signalling(SIP)andvoice (RTP)travelviadifferentpaths.

3.4.3RealTimeProtocolandNAT
In the Internet, SIP voice calls are streams of small packets that are carried by another protocolknownasRTP.TheRealtimeTransportProtocol(RTP)isthecarrieroftheactual voicecontentitself.RTPdefinesastandardizedpacketformatfordeliveringaudioandvideo overtheInternet.Asanormalconversationinvolvestwocommunicationparties,anIPbased conversationalsoinvolvestwodifferentandseparatedRTPstreams. NetworkAddressTranslators(NATs)arethebigenemiesofRTP.ANATnetworkconsistsof severalcomputersthatshareonepublicIPaddresswiththeexternalworld.Computersthat areinsideofaNATnetworkuseprivateaddresses.NATsareveryusefultoeasilyconnect manycomputerstotheInternet,butatthepricethatthecomputersarenotfullyreachable (routable)fromtheoutsideofthenetwork. ThereareseveralproblemsrelatedtoNATandVoIP.Themostcommonproblemcausedby NATs is known as one way audio. Remember that a normal conversation involves two separatedRTPstreams.InthepresenceofaNAT,onlyoneoftheRTPstreams(fromthe inside to the outside) flows, while the second RTP stream (fromoutside to the inside) is blocked.Thisresultsinthecallingpartybeingunabletohearthecalledparty. Unfortunately, private addresses are almost omnipresent in developing regions Hence, problemsrelatedtoNATswilloccurfrequentlyinVoIPimplementations.

BuildingVoiceInfrastructureinDevelopingRegions 3.Therecipe

SettingupaSIPbasedVoIPinthepresenceofNATsisnotstraightforward.Somegeneral guidelinesareincludedinthescenariosprovidedinthisprimer.

3.4.4InterAsterisk eXchange(IAX)
The InterAsterisk eXchange (version 2) protocol (IAX2)16 is an alternative to signalling protocolslikeSIP.IAX2wascreatedaspartoftheopensourcePBXAsterisk.UnlikeSIPthat usestwopairsofdatastreams(oneforsignallingandoneforvoice),IAXusesonesingledata stream to communicate between the endpoints (a telephone or a telephone switch). Both signallinganddata(thevoiceconversation)aretransmittedbythesamechannel(inband)in contrasttoSIPthatusesoutofband17datastreams(RTP)todeliverthedata. Asmentionedbefore,NATsarequitecommonindevelopingregions,soIAX2isafriendly protocolformanyscenariosinsuchenvironments.Furthermore,IAX2allowsmultiplecallsto bemergedinasinglesetofIPpackets,asoneIPpacketcancontaininformationformore thanoneactivecall.Thismechanismisknownastrunking.WithIAX2,trunkingprovides bandwidthsavings. Theconceptoftrunkingcanbeexplainedwiththefollowingmetaphor:Imaginethatyouneed tosendfiveletterstopeoplelivinginanothercountry.Youcanuseoneenvelopeperletter,or includethefivelettersinasingleenvelopeandincludethenameofthefinalrecipientinthe firstlineofeachletter.Trunkingoperatesinthesameformandallowsyoutosendmultiple letters(calls)inasingleenvelop(IPpacket). Insummary,IAX2isafriendlyprotocolforVoIPindevelopingregionsforthreereasons: 1. 2. 3. Minimizestheuseofbandwidthpersinglecall ProvidesnativesupportforNATs(easiertousebehindfirewalls) Minimizestheuseofbandwidthforseveralcalls(bymeansoftrunking)

16. IAX2isalowoverheadandlowbandwidthVoIPprotocoldesignedtoallowmultipleAsteriskPBX'sto communicatewithoneanother.Payloadissentwithaheaderoverheadofonly4octets(32bits).Themore complexheaderof12octetsisusedforcontrolfunctionsandsomepayloadpackets(oneperminuteapprox). 17. TheideaofsendingsignallinginbandimpliesthatthePBXneedstoseparatecarefullywhatisvoicefromwhatis signalwithinthedatastream.Althoughthisrequiresmoreprocessingpower,IAX2hastheadvantageofbeing firewallandNATfriendly

BuildingVoiceInfrastructureinDevelopingRegions 3.Therecipe

3.5VoIPHardware
3.5.1VoIPPhones
AVoIPphoneisdedicatedhardwarethatconnectstoaVoIPnetwork.VoIPphonescanrun oneorseveralVoIPprotocols.18 SomeinterestingfeaturesthatyoushouldconsiderwhenbuyingaVoIPphoneare: Lowbandwidth:supportforhighcompressioncodecs(e.g.G.729,Speex) Goodadministrationinterface:Webinterface Audio interface: An external audio output and handsfree headset support (for teletraining) SeveralmodelsthatcandomorethanyouwilleverneedandworksmoothlywithAsteriskare availableinthepricerangeof100120USD.19

3.5.2SoftPhones
AnalternativetoahardwareVoIPphoneistoinstallsoftwareinaPC.AVoIPphonethat runsinacomputerisknownasasoftwarephoneorsoftphone.Theonlyrequirementisa workingsoundcardandtoensurethatyourpersonalfirewallisnotblockingtheapplication.20 Ifyouwanttotakeadvantageofbandwidthsavings,considerusingasoftphonethatsupports IAX2.

3.5.3PSTNinterfacecards
If you want to route calls from your VoIP terminals to the traditional telephone network (PSTN)youneedtoincludededicatedhardwareinthePBXforthatpurpose.Amodular solutionforAsteriskthatallowsyoutoconnectanaloguelinesandphonesisaPCIcardfrom Digium:TDM400Pwildcard. ThecardisknownasaTDM wildcardbecauseitprovidesthepossibilityofinsertingany combinationofFXOorFXSmodulesinto4ports.ThismeansthatthesamePCIcardcanbe usedtoconnectfourincominglines(4FXOmodules),ortwoincominglines(2FXO)andtwo analoguephones(2FXSmodules),etc. Togetyoustarted,considerbuyingtheTDM400PwithoneFXOmodule(toconnectone phone line)and one FXS(toconnectananaloguephone). Ifyouneedtoexpandinthe future,youcanalwaysbuyextramodules.

18. AsSeptember2006,severalcompaniesaremanufacturingVoIPphoneswithIAX2 19. Thefollowingmodelshavebeenevaluatedaspartofthisprimer:SwissVoiceIP10S(150USD),ThomsonST2030 (100USD),GulfstreamBudgetome(75USD),Cisco7940(300USD). 20. Thefollowingsoftphoneshavebeenevaluatedaspartofthisprimer:IAXClient(IAX2),XLite(SIP)

10

BuildingVoiceInfrastructureinDevelopingRegions 3.Therecipe

Image3:A4portTDM400wildcard.Twoports(Port1:FXO,Port2:FXS)areoccupiedwhilethe remaining(Port3and4)areidleforfutureuse.

3.5.4AnalogueTelephoneAdaptors
AnAnalogueTelephoneAdaptor(ATA)oraTelephoneAdaptor(TA)connectsastandard analogue telephonetoaVoIPnetwork.AnATAhasanRJ11(phonejack)andan RJ45 (Ethernet)jack. AnATA actslike anFXSadaptor,talkinganaloguewiththephoneand digitalwiththeVoIPnetwork.Ifyouwanttoimplementanetworkinadevelopingregionyou mightconsiderusingATAsastheyarenormallycheaperthanVoIPphones.ATAsarealso smallerandcustomsfriendlyforimport.OneoftheadvantagesofusingATAsisthatyoucan attachanytypeofphonetoit,includingapayphone,afax,oracordlessphone(DECT)21. OnepopularATAsolutionthatsupportsIAX2isthes101ifromDigium.TheATAisalso knownasIAXy22.

3.6Codecs
Acompressor/decompressor(codec)algorithmisasetoftransformationsusedtodigitizevoice intodataorconvertdigitizedvoicebacktoananaloguesignal.Acodectakesananalogue signalandconvertsthesignal intoabinaryformat(0sand1s).Therearemanyways to digitize the audio sound resulting in many different type of codecs. You can assume that highercompressionleadstomoredistortion(poorerquality).Onecodecisbetterthananother ifitprovidesbettervoicequalityusingsimilaramountofbandwidth.
21. ThefollowingATAmodelshavebeenevaluatedaspartofthisprimer:SipuraSPA3000,GlobelTexIAD 22. TheIAXyisaverysmallformfactorATAboxwithIAX2support.Itdoesnotsupporthighcompressioncodecs.

11

BuildingVoiceInfrastructureinDevelopingRegions 3.Therecipe

AbasicdigitalcircuitinthePSTN(youreverydayphone)normallyusesacodecknownas PulseCodeModulation(PCM).PCMisahighqualitycodecbutrequiresasmuchas64kbps. TwocommonPCMcompressionstandardsaremicrolawandalaw.Thesestandardsarealso knownasG711uandG711arespectively.WhilemicrolawiscommonlyusedinNorthAmerica, alawiscommonlyusedinEurope.G711codecsdonotrequiremuchprocessingpowerandare availableinmost(ifnotall)VoIPappliances. Indevelopingcountries,theuseofG.711requiresjusttoomuchbandwidthforasinglephone callandyouneedtoconsidertheuseofothertypeofcodecs. GoodandfreecodecsthatuselowbandwidthareGSMandSpeex.G.729isanothergood codecbutitrequiresalicenceforcommercialusage.23

3.7QualityofService
QualityofService(QoS)istheabilityofanetworktoprovideimproved(better)serviceto selected network traffic. One of the main challenges of implementing VoIP, especially in developingregions,istoensurethatbandwidthfortelephonecallswillalwaysbeavailableno matterhowbusytheInternetconnectionis.WhendesigningaVoIPnetworkyoushouldtryto optimizedtheavailablebandwidth,controljitter,andminimizelatency.24

3.7.1Latency
Latencyisasynonymfordelay,andmeasureshowmuchtimeittakesforapacketofdatato getfromonedesignatedpointtoanother.ToimprovethequalityofyourVoIPconversations, trytominimizethedelaybygivingprioritytothevoicetraffic.Givingprioritytothevoice trafficmeansthatyouallowthevoicepacketstojumptoabetterpositioninthequeueof packagestobetransmitted. Ifthecommunicationrequirestheuseofasatellite,alatencyof~300msisunavoidable.In ordertominimizethedelay,youneedtopayspecialattentiontoyourroutersandswitches along the route. Conversations are still feasible if the connection requires more than one satellitehop,butbereadytowaitatleastonesecondwithouttalkingfortheotherpartyto answer. A rule of the thumb for minimizing latency is to place your PBX in the least congestedorsaturatedpartofthenetwork.

3.7.2Jitter
In VoIP, jitter is the variation in the time between packets arriving caused by network congestion,timingdrift,orroutechanges.Ajitterbuffercanbeusedtohandlejitterand
23. G.729isan8kbpsaudiocodec(approx.30KbpsusingSIPperstream).Thecodecwasdevelopedbya consortiumoforganisations:FranceTelecom,MitsubishiElectricCorporation,NipponTelegraphandTelephone Corporation(NTT),andUniversitdeSherbrooke.Thepriceforthecodecisaround10USD. 24. SpecialattentionneedstobetakeniftheVoIPconnectionsruninawirelessnetworksuchastheonesbasedon IEEE802.11b/g/a,toensuretrafficprioritizationforVoIP.

12

BuildingVoiceInfrastructureinDevelopingRegions 3.Therecipe

decreaseitsnegativeeffects.Thebasicideaofajitterbufferistoimprovethequalityofthe phonecallbydeliberatelydelayingtheplaybackoftheconversation,thusensuringthatthe lazypacketshavearrived. VoIPapplianceswillallowyoutosetajitterbuffer.Ajitterbufferisashareddataarea wherevoicepacketscanbecollected,stored,andsenttothevoiceprocessorinevenlyspaced intervals. The jitter buffer, which is located at the receiving end of the voice connection, intentionallydelaysthearrivingpacketssothattheenduserexperiencesaclearconnection withlittlesounddistortion. Thetwokindsofjitterbuffersarecalledstaticanddynamic.Astaticjitterbufferishardware basedandisconfiguredbythemanufacturer.Adynamicjitterbufferissoftwarebasedandcan beconfiguredbytheuser.Acommonvalueforadynamicjitterbufferis100ms.Youcan improvethequalityoftheconversation(goodnoise)byincreasingthebufferbutwiththe drawbackofincreasingtheoveralldelay.

13

BuildingVoiceInfrastructureinDevelopingRegions 3.Therecipe

PART2Handson
4.HandsonBuildingyourPBX
4.1WhatdoIneed?
The first thing that you are going to need is a personal computer. Any computer manufacturedafteryear2000shouldbepowerfulenoughtorunAsteriskandgetyoustarted. ThecomputershouldrunanyflavouroftheLinuxoperatingsystem.25 Thecheapestandeasiestoptiontostartlearningistousesoftphones.Thefirstexercise shouldbetolearnhowtoplaceaphonecallbetweentwocomputersusingyourownPBX. Thesimplesttestbedtogetyoustartedistwocomputerswithsoundcardsonwhichtoinstall twoVoIPsoftwareclients,andathirdcomputertoinstallAsterisk. InthecasethatyouwanttouseVoIPhardwareclients(suchasVoIPphonesorATAs),orto interfacewiththePSTN, youaregoingtoneedsomeofthehardwaredescribedinSection 3.5.26 Ifyouplan tobuilda portable PBXthat runs withlow power, have a look at miniITX boards.TheEPIAM10000board(knownasNehemiah)hastwoPCIslotswhereyoucanplug aDigiumTDM400PCard.27

4.1.1InstallationTips
Thisisalistofinstallationtips: IfyouneedtoinstallaTDM400Pcard BesurethatyourPChasanempty2.2PCIslot. IfyouaregoingtouseanFXSmoduleintheTDM400Pcard,youneedtohavea freebigmolexconnector28 IfyouareusingasmallformfactormotherboardasaminiITXyouneedaPCI raisercardtobeablefittheTDM400Pbyturningthecardposition90degrees Donotconnectaphoneline(FXS)intoanFXSport.Itwillbreaktheport.

25. IfyouareanewcomertoLinuxconsiderdownloadingororderaCDofUbuntu.http://www.ubuntu.com 26. AgoodsupplierofVoIPhardwarewithspecialdiscountsfornonprofitprojectsishttp://www.avanzada7.com 27. AportablePBXwillallowyoutoshowcasethetechnologywiththeamazingadvantageofbeingabletocarry yourownTelephoneExchangeashandluggage. 28. AMolexconnectorisa4pinpowerconnectorusedinPCs.Yellowandredwiresprovide+12Vand+5V respectively,withblankwiresbeingground.

14

BuildingVoiceInfrastructureinDevelopingRegions 4.HandsonBuildingyourPBX

Image4:AportablePBXrunninginaminiITXboardwithaDigiumTDM400PCard.

5.InstallingAsterisk
Asterisk is a huge piece of software. Its powerful architecture and flexibility implies a complexitythatcomesfromthenumerousoptionsandconfigurationfiles.Asteriskallowsyou toaccomplishalmostanythingyoucanimagine,sothestartcanbequiteapainfulexperience. LearningtoconfigureAsteriskremindedmeabouttheendlessnightslearningotherpowerful piecesofsoftwaresuchasApachewebserverandSendmailtenyearsago.Theycandosomuch thatdoingverylittlesometimesbecomesachallenge. The approach we are taking in this short guide is not to include a listing of all possible commandsbutrathertowalkthroughthreebasicscenarioswhereAsterisk isused.Weare intentionallykeepingthingsassimpleaspossible.Weareawareofthattheincludedexamples canbesolvedinmanydifferentways,sodonothesitatetoexperimentyourself.

5.1CompilingAsterisk
Aswithmuchotherfreesoftware,thereare two methodstoget Asterisk workinginyour computer.ThefirstmethodistodownloadandcompileAsteriskfromtheitssourcecode.The secondmethodistodownloadprecompiledpackages.

15

BuildingVoiceInfrastructureinDevelopingRegions 5.InstallingAsterisk

IfyoudecidetocompileAsteriskfromthesourcethefollowingtipscanfacilitateyourwork:

DownloadAsterisksourcecodefromhttp://www.asterisk.org29 Forthebasicconfigurations,youdonotneedtheaddonsormusicpackages Asterisk sourcecoderequiresothersoftwareinyoursystemtocompile.Ensurethat youhavethefollowingpackagesinstalledinyoursystem: bison(aparsergenerator) zlibandzlibdevel(compressionlibrarydevelopment) opensslandopenssldev(libssldev)(SSLdevelopmentlibraries) libc6dev(GNUCdevelopmentlibraryandheaders) gccandmake(TheCcompilerandthemakeutility)

CompilingAsteriskisnotdifferentfromotherfreeLinuxsoftware: Tocompile:
# make

Toinstall:
# make install

Toinstallthestartupscripts:
# make config

Toinstalldefault(samples)configurationfiles:
# make samples

IfyouplantouseaDigiumWildcard(tm)Interfacewith Asterisk,youwillneedtocompile andinstallthezaptelkernelmoduledevicedriverforyourcard.

DownloadtheZaptelsourcecodefromhttp://www.asterisk.org.Unfortunately,the ZapteldrivermoduleisnotpartoftheLinuxkernel,soyouwillneedtobuildthe modulesyourself. Ensurethatyouhavethekernelheaderspackageinstalledinyoursystem30

5.2FetchingAsteriskPackages
ItisalsopossibletogetAsteriskprecompiled.Precompiledsoftwarecomesintheformofa package.CommonformatsforLinuxpackages(dependonyourdistribution)arerpm,debor tgz.IfyouareusingaDebianbaseddistribution,downloadandinstall(usingaptgetinstall) thefollowingpackages:

29. AsSeptember2006,Asterisklatestreleaseis1.2.12.LatestdriverversionforthefamilyofZapatacardsis1.2.9 30. Youcancheckthekernelversionofyoursystemusingthecommand#unamea.ForexampleforaminiITX (x386)systemrunningUbuntuDapper,installthefollowingheaderslinuxheaders2.6.1525386

16

BuildingVoiceInfrastructureinDevelopingRegions 5.InstallingAsterisk

Package Asteriskclassic(mandatory) Asteriskconfig(suggested) Asteriskdev(optional) Asteriskdoc(suggested) Asterisksoundsextra(optional) Asterisksoundsmain(optional)

Description Open Source Private Branch Exchange (PBX) original Digiumversion configfilesforAsterisk developmentfilesforAsterisk documentationforAsterisk AdditionalsoundfilesfortheAsteriskPBX SoundfilesforAsterisk

Astoday,noprecompiledversionofthezaptelkernelmodulesyetexists.Youdonothaveany optionotherthanfollowingthesamemethoddescribedintheprevioussection.Downloadthe zaptelkerneldriversourcecodeandcompileit.Beforecompilingthezapteldriversyoumust installthekernelheadersforyourkernelversion. Package zaptel(mandatory) zaptelsource(mandatory) linuxheaders2.6.1525386(distro dependent) Description ZaptelUtilities Zaptelkerneldriversourcecode LinuxKernelHeadersforUbuntuDapperx386Kernel

5.3BasicAsteriskCommands
Asteriskhastwobuiltincomponents:aserverthatnormallyrunsasabackgroundprocess,and aclient(CLI)thatcanmonitortheserver.Bothserverandclientareinvokedusingthesame commandAsteriskbutappendingdifferentflags(options). OnceyouhavesuccessfullyinstalledAsterisk,youshouldknowsomeofthebasiccommands: Start/StopAsteriskfromarunlevel TorunAsterisk(forkstobackground)
#/etc/init.d/asterisk (start|stop)

StartAsteriskfromthecommandline Alternatively,runAsteriskfromthecommandline(asadaemon) #asterisk RuntheAsteriskserverwithverboseinformation(vvv)andopenaclientconsole(c)(the clientconsoleorCLIallowsyoutomonitorwhatisgoingonintheAsteriskserver)


# asterisk -vvvc

Iftheserverisalreadyrunning,openaclientterminalandconnecttotheservertomonitor itsstatus(r).
# asterisk -r

17

BuildingVoiceInfrastructureinDevelopingRegions 5.InstallingAsterisk

CLIbasiccommands Reloadstheconfigurationfiles
#CLI>reload

TurnondebuginformationforSIPorIAX2
#CLI> IAX2 debug #CLI> SIP debug

TurnoffdebuginformationforSIPorIAX2
#CLI> IAX2 no debug #CLI> SIP no debug

Showthestatusinformationofusers,peersandchannelsforSIPorIAX2
#CLI> #CLI> #CLI> #CLI> #CLI> #CLI> sip show users sip show peers sip show channels iax2 show peers iax2 show users iax2 show channels

5.4ConfigurationFiles
ThenumberofconfigurationfilesthatyouneedtoeditinordertorunAsteriskdependson thetypesofVoIPtechnologiesthatyouwanttousesimultaneouslyinyouractualinstallation. ThebasiclogicbehindtheconfigurationofAsteriskcanbesummarizedintwosteps: Step1:DefineandConfigureCommunicationChannels First,youneedtodefineandconfigurethecommunicationchannelsthatyouwanttouse.A simplewaytopicture acommunicationchannelisaphonewire. Thechannelsarethe logicalwirestoyourPBX.AstheInternetallowsyoutohaveseveralandsimultaneousvoice sessionsrunningusingthesamewire,youneedtodefineeachofthosechannelsoperating insidethetangibleInternetwire. RememberthatAsteriskallowsyoutointerconnectdevicesrunningdifferentVoIPprotocols. ThismeansthatyoucaninterconnectseveraltypesofIP(VoIPphones,ATA,Softphones) andnonIPbasedtelephonydevices.Theconfigurationfilesthatyouneedtopreparedepend onthetypeofVoIPtechnologytobeused.Donotforgettoinstallthesamplesfilesthatcan serveasaguideline. Step2:DefineRulesforExtensions(Createadialplan) Secondly,youneedtodescribetherulesofhowthosechannelswillinteractwitheachother. ThevoicecallscometoorleaveyourPBXviathepreviouslydefinedchannels,butthose channelscaninteractwitheachotherinmanydifferentways.Forexample,youmightprefer thatanincomingcallfromthePSTNbeforwardedautomaticallytoaVoIPphoneor,you mightwanttointerconnecttwoIPphonesinawirelessnetworktwentykilometresapart.All thatkindofintelligencebetweenthechannelsisdoneinaconfigurationfileknownasthe extensionsfile.Theextensionsfilecontainsalltherulesknownasadialplan.

18

BuildingVoiceInfrastructureinDevelopingRegions 5.InstallingAsterisk

TogetabetterpictureoftheseVoIPconcepts,thinkoftheoldtelephonytimeswhenaperson (theoperator)wasresponsibleforconnectingtelephone wiresmanually.Inordertoplacea call between two telephone lines (the communication channels) it was necessary first to contacttheoperator(thePBX)andthenindicatewhowewantedtocall(extensionsfile).The channel configuration files describes the type of telephone lines in use, and the extension configurationfilesreplacethefunctionalityofthephoneoperator. Wewillusethesefivebasicconfigurationfilesinthreedifferentscenarios: Configurationfile /etc/asterisk/extensions.conf (alwaysmandatory) /etc/asterisk/sip.conf /etc/asterisk/iax.conf /etc/asterisk/zapata.conf /etc/zaptel.conf Description Laysoutthedialplanandbringschannelstogether Used to configure SIP based channels (SIP VoIP phonesandSIPproviders) UsedtoconfigureIAX2basedchannels Usedtoconfigurethehardwarethatinterfaceswith thePSTN.UsedbyAsteriskatstartup Lowlevelconfigurationofzaptelinterfacecard.Used by Zaptel Configurator tool ztcfg before starting Asterisk

5.5Peers,UsersandFriends
OneofthemoreconfusingconceptsforabeginnerusingAsterisk(oratleastitwasformefor alongwhile)isthatofpeersandusersintheiax.confandsip.confconfigurationfiles. Theterms peer,user and friend areusedtoclassifyincomingandoutgoingcalls. Whilea userisaconnectionthatauthenticatestous(i.e.anincomingcall),apeerisanoutgoing connection.Userscallusandwecallpeers.31Afriendisaconnectionthatcanbeeither incomingoroutgoing. Whenwegetanincomingcallfromauserorafriendweneedthedefinewhattodowith it. Thetermcontext is usedtodefinewhichrule,orgroupofrulesfromthedialplan (extensions.conf) should be applied for that concrete call. A context associated to an incomingcallistheentrypointofthatcallinthedialplan. The extensions.conf file contains all the numbers that can be accessed from the PBX separatedindifferentsections(contexts).Everyuser(incomingcalls)definedineachofthe communicationchannelsisassociatedwithacertainsectionofthedialplan(extensions.conf).

31. Youshouldkeepinmindoneexceptiontothissimplisticdefinition.Whenactingasaproxy,anincoming connectioncomingfromoneofourpeerswillbehandledinthepeersection(insteadofausersection).Thatis, apeeractingasaproxycannotauthenticateonbehalfofotherusersandtheonlyinformationavailablefor authenticationisthepeerIPaddress.Insummary,anoutgoingconnectionisalwaysapeer,anincoming connectioncanbeauser,orapeerwhenactingasaproxy.

19

BuildingVoiceInfrastructureinDevelopingRegions 5.InstallingAsterisk

PART3Scenarios
6.SCENARIOA Privatetelephonynetworkinaruralcommunity
6.1Background
Inourfirstscenario,wewanttoplaceaPBXinaruralTelecentreandprovideIPtelephony to four organizations in the neighbourhood. After completing the installation, each organizationwillbeabletoplacefree32phonecallstoboththeTelecentreandtoeachother. The table below summarizes the information of the four organizations and the different technologiesthatcanbeusedtoconnectthemtoourPBX.Tomakethecaseasillustrativeas possible,wehavechosenseveraldifferentmechanismstointerconnecttheorganizations.Ina real roll out, you should consider reducing the amount of different appliances to facilitate supportandmaintenance. Organization CommunityLibrary RegionalHospital PrimarySchool Farmers'Association Technology VoIPphoneusingSIPprotocol ATAusingSIPprotocol ATAusingIAX2protocol TwoSoftwarePhonesusingSIPandIAX2 Extension 462 463 464 465,466

6.2ConfiguringtheVoIPclients
Before describinghow toconfigurethePBX,let us start by setting upeach of the VoIP clients.

6.2.1CommunityLibrary
Thefirstclientisplacedinapubliclibrarythatis1kmfromtheTelecentre.TheVoIPSIP phoneisdirectlyconnectedtoourPBXbymeansofadedicatedwirelesslink(apointtopoint bridgedconnection).TheIPaddressoftheVoIPphone(192.168.46.2)isinthesamenetwork asourPBX(192.168.46.1)sowedonotneedtoworryaboutanyNATrelatedproblem.

32. Oncetheinfrastructureisinplace,thetariffsforinternalphonecallscouldcoverthemaintenancecosts.A communitymodelcanbeexploredwhereinternalcallsarefree.

20

BuildingVoiceInfrastructureinDevelopingRegions 6.SCENARIOAPrivatetelephonynetworkinaruralcommunity

WhenconfiguringanykindofVoIPphone,startbyreadingtheuserguidetofindouthowto log into the web interface.33 When you are logged in, try to locate the following basic parametersinthewebadministrationinterface.

Parameter IPaddressoftheVoIPphone IPaddressoftheSIPProxy(ourPBX) Registration Username/Authname CallerID Authenticationpassword Codec

Setting 192.168.46.2 192.168.46.1 YES 462 462 462pass G.711(ulaw)

Image5:TheLibraryisconnectedtothePBXviaapointtopointwirelessbridge.AVoIPterminalis usedinthelibrarytoplaceandreceivephonecalls.

6.2.2Hospital
The second client of our internal telephony network is an ATA box placed in the local hospital.ThelocalhospitalisacrossthestreetfromtheTelecentreandisconnectedbymeans ofa100meterCat5Ethernetcable.ConfiguringanATAisnotverydifferentfromconfiguring a VoIPphone. Followingthesamestepsasinthepreviousexample,wewillusetheweb administrationinterfacetoconfiguretheATAwiththefollowingdata: Parameter IPaddressoftheATA IPaddressoftheSIPProxy(ourPBX) Registration Username/Authname CallerID Authenticationpassword Codec

Setting 192.168.46.3 192.168.46.1 YES 463 463 463pass G.711(ulaw)

33. TherearethreemainmechanismstologintoawebinterfaceofaVoIPphone.KeypadMethod:settheIP addressofthephoneusingthetelephonekeypad.DHCPMethod:plugthephoneintoanetworkwithDHCP andmonitortheleasedIPaddress.FactoryIPmethod:findoutwhatthedefaultIPaddress(factory)issetto.

21

BuildingVoiceInfrastructureinDevelopingRegions 6.SCENARIOAPrivatetelephonynetworkinaruralcommunity

Insteadofusingatraditionalfixedphone,wedecidetoconnectacordlessDECTphonebase station34totheRJ11portoftheATAbox.Theresultisthatwecanhaveacordlessphonein anypartofthehospital.TheATAboxbridgesthecordlessphonewiththeVoIPnetwork.

Image6:TheHospitalisconnectedviaa100meterCat5EthernettotheTelecentre.ADECTphoneis connectedtoaATA(runningSIP)thathasregisteredwiththePBXoftheTelecentre.

6.2.3PrimarySchool
The third client in our network, the Primary school, is in a building adjacent to the Telecentreandcanthereforealsobeconnectedbyatwistedpaircable. AnotherATAbox,thistimerunningIAX2insteadofSIP,isplacedintheprimaryschool.We areusingasimpleATAbox(FXSinterface)knownass101iorIAXy.TotheATAbox,we connectanykindofanaloguephonethatwecanfind. TheIAXydoesnotprovideawebconfigurationinterface.Theeasiestwaytoconfigurethe IAXyistouse Asterisk itself.ThefirsttimethatyouconnecttheATA,itwillgrabanIP address via DHCP, check the logs of your DHCP server and write down the assigned IP address.Thenextstepistoeditthefile /etc/asterisk/iaxprov.conf andaddasectionthat lookslikethis:
[iaxy_school] ip: 192.168.46.4 netmask: 255.255.255.0 gateway: 192.168.46.1 codec: ulaw server: 192.168.46.1.2 user: 464 pass: 464pass register

34. DECT,orDigitalEnhanced(formerlyEuropean)CordlessTelecommunications,isastandardfordigitalportable phonesoperatingin1.9Ghz.

22

BuildingVoiceInfrastructureinDevelopingRegions 6.SCENARIOAPrivatetelephonynetworkinaruralcommunity

Assumethatyourlocal DHCPserverassignstheIPaddress192.168.46.100totheIAXy. Then,fromtheAsteriskconsolerunthefollowingcommand:


#asterisk -r <ENTER> #CLI> iax2 provision 192.164.46.100 iaxy_school

AnalternativetouseAsterisktoprovisiontheIAXyisavailableforWindowsusers.35

Image7:ThePrimaryschoolisconnectedtotheTelecentreusingatwistedpaircable(Ethernet).An ATAboxrunningIAX2isusedtoconnectananaloguephonetothetelephonysystem.

6.2.4Farmers'Association
ThefourthclientinthenetworkistheFarmers'Association,whichislocated20kmfromthe Central Office (PBX). They have two computers already connected to the Telecentre by meansofawirelessNAT.ThewirelessNAThastheIPaddress192.168.46.5andalsoservesan internalnetwork(10.10.46.0/24). The most challenging configuration is going to be the SIP softphone. To ensure that bidirectionalaudioworksproperlywithSIPweneedtodothefollowing: Inthesoftphone: Enableregistration. Enablekeepalivepackets.36 Enablethepossibilityofreceivingaudiobythesameportthatwesendaudio. InthePBX: InformAsteriskthatthesoftphoneisinsideofaNAT.

AgoodsoftphonerunningSIPthatworkswellinsideofaNATisXLitefromXten.37

35. TheWindowsclienttoprovisionIAXyisavailableathttp://dacosta.dynip.com/asterisk 36. KeepalivepacketsareemptypackagesthatensurethattheNATisopenforreceivingcalls. 37. Afreeversioncanbedownloadedfromhttp://www.xten.com/index.php?menu=download

23

BuildingVoiceInfrastructureinDevelopingRegions 6.SCENARIOAPrivatetelephonynetworkinaruralcommunity

IAX2softphonesinsideofaNATshouldnotpresentmajorproblems.EnsurethattheIAX2 UDPport4569isnotblocked.AgoodsoftphonerunningIAX2isiaxcomm.38 Fromtheconceptualpointofview,theconfigurationofthesoftphoneisnotmuchdifferent fromanyotherVoIPclient.Usetheuser/password465/465passand466/466passineachof thesoftphones.EnsurethattheG711(ulaw)codecisenableandthattheIPaddressofour PBXissetto:192.168.46.1

Image8:TheFarmers'AssociationisconnectedtotheTelecentreusingawirelessNAT.Asoftphoneis installedineachofthetwocomputers.ThefirstclientisusingSIPwhilethesecondusesIAX2.

6.3ConfiguringAsterisk
Step1:DefineandConfigureCommunicationChannels Inthisfirstscenariowehavetwotypesofcommunicationchannels:SIPandIAX2,which impliesthatweneedtoeditthefilessip.confandiax.conf. NotethatcommentsinAsteriskconfigurationfilesstartwithasemicolon. Insip.conf,thefollowingdatashouldbeadded:
[462] type=friend secret=462pass context=internal_calls host=192.168.46.2 callerid=Library disallow=all allow=ulaw [463] type=friend secret=463pass 38. IaxCommcanbedownladedfromhttp://iaxclient.sourceforge.net ; We can call and receive calls ; All incoming calls are associated ; to the context internal_calls

; First we disallow all codecs ; Then we list all the codecs we accept

24

BuildingVoiceInfrastructureinDevelopingRegions 6.SCENARIOAPrivatetelephonynetworkinaruralcommunity

context=internal_calls host=192.168.46.3 callerid=Hospital disallow=all allow=ulaw [465] type=friend secret=465pass context=internal_calls host=dynamic registers callerid=Farmers1 disallow=all allow=ulaw ; NAT specific options follows: nat=yes qualify=yes ; Voice data is sent to IP,port of the NAT ; We send dummy traffic to keep the NAT open

; We do not know the IP address in advance. ; We expect to learn the IP when the

user

Iniax.conf,thefollowingdatashouldbeadded:
[464] type=friend secret=464pass context=internal_calls host=192.168.46.4 callerid=School disallow=all allow=ulaw [466] type=friend secret=466pass context=internal_calls host=dynamic callerid=Farmers2 disallow=all allow=ulaw

; To learn the visible IP and port ; of the IAX2 client

Step2:DefineRulesforExtensions(Createdialplan) In the first scenario, we have placed all users are in the same context [internal_calls]. Therefore,onlyonesinglecontextneedstobedefinedinthedialplaninextensions.conf(see below).
[internal_calls] exten => 462,1,Dial(SIP/462) exten => 463,1,Dial(SIP/463) exten => 465,1,Dial(SIP/465) exten => 464,1,Dial(IAX2/464) exten => 466,1,Dial(IAX2/466) exten => t,1,Hangup() ; Special extension (Timeout) exten => i,1,Hangup() ; Special extension (Invalid) exten => s,1,Hangup() ; Special extension (No routing information)

25

BuildingVoiceInfrastructureinDevelopingRegions 6.SCENARIOAPrivatetelephonynetworkinaruralcommunity

Thesyntaxoftheextensions.conffileisintuitive.

Thebrackets[context_name]indicateswherethecontextstartsandthenameofthe contextasitisdefinedinthesip.confandiax.conf. Eachlinewithinacontextisanextensionwiththefollowingformat:


exten => number, priority,application-action

Inthissimpleconfigurationfilewearesayingthateachoftheextensionnumbers462466is reachablebyexecutingthecommand Dial andcreatinga SIPorIAX2 channel tothepeers withthesameusername.

26

BuildingVoiceInfrastructureinDevelopingRegions 7.SCENARIOBReachingthePSTN

7.SCENARIOB ReachingthePSTN
OursecondcasestudyisanextensionofourinitialinternalVoIPnetwork.Inthissecond scenariowewanttoalloweachVoIPclienttoreachthePSTN.Inordertodosoweneeda specialhardwarethatconnectsthePBXtothePSTN. In this example, we are using the TDM400P PCIcard from Digium with one FXO port. Remember that the TDM400P card is a versatile card that allows a maximum of four FXS/FXOmodulesandthat one FXOmoduleallowsthePBXtoconnectto one analogue telephoneline.

7.1AddingsupportfortheTDM400Pcard
FourbasicstepsareneededtogettheTDMwildcardupandrunning.

Step1:InsertthePCIcard ThefirststepistoplugthehalflengthPCIcardinafreeslotandconnectthebigmolex(12/5 volt)connectortothe computerpowersupply. TheTDMcardgetspowerbymeansof a female molex connector(itisthesame4pinconnectorthatcomesinastandardIDEhard drive).Ifyoudonothaveafreemalemolexconnector,youneedtopurchaseapowersplitter. Step2:Installthehardwaredrivers Thesecondstepistoensurethat thehardwaredrivershavebeenproperlycompiledand loaded.Byrunning #lsmod youshouldseethatthe wctdm driverisloaded. Youshould alsoseethatthewctdmdriverdependsonthezapteldriverthatdependsonthecrc_ccitt module.

# lsmod zaptel crc_ccitt

191748 2304

7 wctdm 3 hisax,zaptel,irda

Step3:ConfiguringtheTDM400PCardwithztcfg Thethirdstepistoconfigurethehardware.Thewctdm driversaregeneralpurposesoftware for all versions of the TDM400P card (remember that the PCI board can host up to 4 FXS/FXOports).Westartbyindicatingthat wehaveplacedanFXOmoduleinthefirst portofthePCIcard. Thesimplest/etc/zaptel.confconfigurationfileforthiscaseis:
fxsls=1 loadzone=us defaultzone=us

27

BuildingVoiceInfrastructureinDevelopingRegions 7.SCENARIOBReachingthePSTN

Thefirstline(fxsls=1)meansthatweareusingFXSsignallingoftypeLoopstartinPort1of theTDM400P.RememberthattheFXOmoduleneedstobesignalledwithanFXSmodule. Thesecondandthirdparametersofthezaptelconfigurationfileindicatesthetypeoftone usedinthisregion.39 Thezaptelconfigurationutility/sbin/ztcfgthatisinstalledaspartoftheAsterisksourcecode distribution(orthepackagezaptel)readsthe/etc/zaptel.confconfigurationfile. Atypicaloutputappearsasfollows:


# ztcfg -vv Zaptel Configuration ========================= Channel map: Channel 01: FXS Loopstart (Default) (Slaves: 01) 1 channels configured.

Step4:ConfiguringAsterisktousetheZapataHardware Theforthandfinalstepistoconfigure Asterisk tousethehardware.Thisisdoneinthe /etc/asterisk/zapata.conffile:


[channels] usecallerid=yes hidecallerid=no callwaiting=no threewaycalling=yes transfer=yes echocancel=yes echotraining=yes context=incoming_pstn signalling=fxs_ls channel => 1

Thelastthreelinesoftheconfigurationfilearethemostimportantforadefaultconfiguration. Thelinecontext=incoming_pstnindicatesthatallincomingcallsareassociatedwiththat context.Thenexttwolinessetthesignalling(fxs_ls)forthiszapatachannel(channel =>


1).

Oncewehaveconfiguredthisnewtypeofchannel(zapatachannel),wearealmostreadyto receiveandplacephonecallstoandfromthePSTN.

7.1.1HandlingPSTNincomingcalls
ThedesirablebehaviourforincomingPSTNcalls isthefollowing:onceanincomingphone call arrives by the analogue telephone line, we want an interactive voice response (IVR) systemtoaskthecallerforanextension.AswehaveseveralinternalVoIPclientsinour internaltelephonynetwork,wewanttomakethemavailabletoanyonewhocallstothePBX's
39.Alistoftonespecificationsisavailableat:http://www.itu.int/ITUT/inr/forms/files/tones0203.pdf

28

BuildingVoiceInfrastructureinDevelopingRegions 7.SCENARIOBReachingthePSTN

analogueline.Thisintelligenceisimplementedintheextensions.conffilebyaddingasection [incoming_pstn] asfollows:


[incoming_pstn] exten => s,1,Answer() ; We answer the call exten => s,2,DigitTimeout(10) ; Setting Timeout values in seconds exten => s,3,ResponseTimeout(20) exten => s,4,Background(vm-extension) ; Voice asking for an extension exten => i,1,Goto(incoming_pstn,s,1) ; Ask again if invalid extension exten => t,1,Hangup() ; Hang up if timeout include => internal_calls ; Makes internal_calls extensions available

Note:Thefinalandcompleteversionofthe extensions.conffileisavailableinSection7.3of thisdocument.

7.1.2MakingthePSTNavailablefromthedialplan
InordertomakethePSTNphonelineavailabletoallourVoIPclients,wefirstneedtoadda newcontexttoourextensions.conffile.
[outgoing_calls] exten => _0.,1,Dial(Zap/1/${EXTEN:1}) exten => t,1,Hangup()

ThismeansthatthattoreachthePSTNlineyouneedtostartbyincludingthenumber0. The command Dial() will bridge the phone call with the Zap channel number 1. The ${EXTEN:1} partofthecommandmeansthatthefirstnumber(inthiscase,the0)willbe removedwhendiallingout. Addinganewcontexttothedialplanisnotenough.Wealsoneedtomakeitavailabletoour VoIP clients. The easiest way to do this is to add the following line at the end of the [internal_calls]section:
include => outgoing_calls

7.2AttachingananaloguephonetothePBX
InthefirstscenarioweconfiguredfiveVoIPclientsinfourlocations,leavingtheTelecentre withoutaphone.AneasywaytoprovidetheTelecentrewithaphoneconnectionistooadda second(FXS)moduletotheexistingTDM400Pcard.AddinganFXSmoduletothesecond portoftheTDMcardpermitstheconnectionofanyanaloguephonetothePBX. Theprocessissimple;afterpoweringoffthePBX,wepluganFXSmoduleintothesecond portoftheTDMcard.Afterpoweringonthesystemagain,weaddonemorelinetothe /etc/zaptel.confconfigurationfile.
fxsls=1 fxols=2 loadzone=us defaultzone=us

29

BuildingVoiceInfrastructureinDevelopingRegions 7.SCENARIOBReachingthePSTN

Toensurethatthenewporthasbeendetectedandconfiguredwerunthezaptelconfiguration toolwiththefollowingresult:
#ztcfg -vv Zaptel Configuration ========================= Channel map: Channel 01: FXS Loopstart (Default) (Slaves: 01) Channel 02: FXO Loopstart (Default) (Slaves: 02) 2 channels configured.

Wealsoneedtoaddanewsectiontothe /etc/asterisk/zapata.conf whereweassociatethe callscomingfromtheanaloguephone(port2oftheTDMcard)tothecontext[internal_calls]


[channels] usecallerid=yes hidecallerid=no callwaiting=no threewaycalling=yes transfer=yes echocancel=yes echotraining=yes context=incoming_pstn signalling=fxs_ls channel => 1 context=internal_calls signalling=fxo_ls channel => 2

Image 9. TheTelecentre uses aTDM400P wildcard to:(1) connectthe PBX to thePSTN (FXO module)and(2)routecallstoananaloguephone(FXSmodule).

30

BuildingVoiceInfrastructureinDevelopingRegions 7.SCENARIOBReachingthePSTN

7.3UpdatingtheDialplan
Anewdialplanisneededto: 1. 2. Allowincomingandoutgoingcallsviathezapatachannel1(thePSTN) Interconnecttheanaloguephoneconnectedtothezapatachannel2soitcanplace andreceivecalls

Theextensions.conffileforthesecondscenariolooksasfollowing:
[incoming_pstn] exten => s,1,Answer() exten => s,2,DigitTimeout(10) exten => s,3,ResponseTimeout(20) exten => s,4,Background(vm-extension) exten => i,1,Goto(incoming_pstn,s,1) exten => t,1,Hangup() include => internal_calls [internal_calls] exten => 461,1,Dial(Zap/2) exten => 462,1,Dial(SIP/462) exten => 463,1,Dial(SIP/463) exten => 465,1,Dial(SIP/465) exten => 464,1,Dial(IAX2/464) exten => 466,1,Dial(IAX2/466) exten => t,1,Hangup() exten => s,1,Hangup() exten => i,1,Hangup() include => outgoing_calls

; Extension 461 calls via Zap channel 2

; PSTN available to the VoIP clients

[outgoing_calls] exten => _0.,1,Dial(Zap/1/${EXTEN:1}) exten => t,1,Hangup()

; Remove 0 before dial out

31

BuildingVoiceInfrastructureinDevelopingRegions 7.SCENARIOBReachingthePSTN

8.SCENARIOC InterconnectingcommunitiesusingVoIP
Inourthird scenario,wewouldliketolinkourTelecentretoaTrainingCentreinanother countryusinganexistingInternetVSATsatellitelink.Oncetheconnectionissetup,wecan useittoplaceinternationalphoneconferencesnotonlytothecountryoftheTrainingCentre buttootherdestinations.

Image10:TheTelecentreandtheTrainingCentreareequippedwithonePBXeach.ThePBX'sare InterconnectedviaaVSATsatellitelink.

8.1Typicalsatelliteconnectionissues
TheInternetconnectionattheTelecentrehasaverylimitedbandwidth(128/64Kbps)soour solutionneedstooptimizethebandwidthusage.Inthenextexampleweproposetolinktwo PBX'susingAsterisk andIAX2.Toensuregoodbandwidthusageweproposetouseahigh compressioncodecsuchasG.729orSpeex.Finally,wewillenablecalltrunkingtoensurethat simultaneousphonecallscanbebundledtogethertoreducetheheaders'overhead. A typical scenario in a VSAT Internet connection is that the satellite border router is connectedtotheInternetwithveryfewpublicIPaddresses.Ifwedonothaveanyspare publicIPaddressforourAsteriskboxweneedtoensurethattheIAX2communicationport 4569 is correctly mapped to the internal PBX. The mechanism to create a port mapping dependsonthetypeofproductinstalledastheborderrouter.

32

BuildingVoiceInfrastructureinDevelopingRegions 8.SCENARIOCInterconnectingcommunitiesusingVoIP

IfyouhaveaCiscorouterrunningNATyouwillneedtoissuesomethinglike:
#ip nat inside source static udp 192.168.46.1 4569 interface fastEthernet 0/0 4569

IfyourborderrouterisrunningLinux,youneedtoforwardallconnectionstoport 4569totheinternalmachine(192.168.46.1)usingiptables
#/sbin/iptables -t nat -A PREROUTING -p udp --dport 4569 -i eth0 -j DNAT --todestination 192.168.46.1:4569

TheimportantthingtorememberisthatthePBX'sneedtobereachablefromthepublic InternetbyUDPport4569.40

8.2InterconnectingoftwoAsteriskservers
8.2.1Telecentre
Theiax.confconfigurationfileintheTelecentrelookslikethefollowing:

[general] bindaddr = 0.0.0.0 tos = lowdelay disallow = all allow = ulaw allow = g729

; We add the G.729 codec

register => server2:server2pass@training_voip.org ; server2:server2pass is the user ; and password used for registration ; This is the user account for the other server to register with us [server1] type=friend user=server1 secret=server1pass host=dynamic ; The IP address is learnt when the ; user registers context=incoming_training_centre_calls auth=md5 ; Add security to the authentication disallow=all allow=g729 trunk=yes ; We enable trunking

ToreachtheTrainingCentreviatheInternetweaddanewcontexttotheextensions.conf. Whenacallstartswith99,itisforwardedtoserver1thatisinthecountryoftheTraining CentreviatheInternet.

40. Port4569isthedefaultcommunicationportforIAX2.

33

BuildingVoiceInfrastructureinDevelopingRegions 8.SCENARIOCInterconnectingcommunitiesusingVoIP

[outgoing_training_centre_calls] exten => _99.,1,Dial(IAX2/server2:server2pass@server1/${EXTEN:2}) exten => _99.,2,Congestion ; By failure, a Congestion sound is returned

NextweneedtodecidewhatdowiththecallscomingfromtheTrainingCentre.
[incoming_training_centre_calls] exten => s,1,Dial(Zap/2) ; Calls from the Training Centre ring ; the Telecentre Phone

8.2.2TrainingCentre
Theiax.confconfigurationfileintheTrainingCentrelookslikethis:
[general] bindaddr = 0.0.0.0 tos = lowdelay disallow = all allow = ulaw allow = g729

; We add the G.729 codec ; If you do not have a licence use Speex

register => server1:server1pass@rural.telecentres.org ; server1 is the user for registration [server2] type=friend user=server2 secret=server2pass host=dynamic ; The IP address is learnt when the user registers context=incoming_telecentres_calls auth=md5 disallow=all allow=g729 trunk=yes

; Add security to the authentication

Then we add a new context to extensions.conf so that when a call starts with 88, it is forwardedtotheTelecentre(peer[server2])iniax.conf.
[outgoing_telecentres_calls] exten => _88.,1,Dial(IAX2/server1:server1pass@server2/${EXTEN:2}) exten => _88.,2, Congestion

IntheTrainingCentrewedecidethatallcallscomingfromanyTelecentreareforwardedusing SIPtothesupportdesk.
[incoming_telecentres_calls] exten => _X.,1,Dial(SIP/support-desk) ; Calls from any Telecentre ; are forwarded to Support Desk41

41. TheDial()totheSIPsupportdeskneedstoconfiguredinthesip.confoftheTrainingCenter.

34

BuildingVoiceInfrastructureinDevelopingRegions 8.SCENARIOCInterconnectingcommunitiesusingVoIP

8.2.3Theregistercommand
WhentheIPaddressofthepeerisunknown,wehavenowaytoplaceacall.Imaginethe situationwhenoneofthePBX'shasastaticIPaddressbutthePBXattheotherenddoes not.Tocompensateforthis,thePBXthathasadynamicaddressneedstoactively register withtheotherunit.Inourpreviousexampleweareusingtworegistercommands,althoughin thestrictsensetheregistercommandisonlyneededwhenoneofthePBX'shasadynamicIP address.WhentheIPaddressoftheotherpeerisknownwecanreplacethe host=dynamic statementintheconfigurationfilewithhost=<ip_addressordomain>

9.Learningmore

OneofthebestbooksaboutAsteriskis:Asterisk,TheFutureofTelephony,JimVan Meggelen,JaredSmith,LeifMadsen.O'Really2005.UnderCreativeCommons. http://www.oreilly.com/catalog/asterisk/ Freedownload:http://www.asteriskdocs.org/modules/tinycontent/index.php?id=11 To keep an eye of what is going on in emerging telephony. http://www.oreillynet.com/etel/ TheVoIPinfowebsiteisahugewikiwithlotsoftipsandtricks.Findingwhatyou exactlyneedcanrequiresomededicatedbrowsingthough. http://www.voipinfo.org/wikiAsterisk+tips+and+tricks

10.Conclusion
ThisprimerisanattempttointroducesomeoftheessentialsofIPtelephony.Bygivingafew concretescenarios,wehopetohavecreatedawarenessabouttheendlessopportunitiesthat VoIPbringsindevelopingregions.VoIPinconjunctionwithlowcostwirelesstechnologiescan bring voice and data services to digitally excluded areas, while promoting the creation of communityoperatedandmanagedtelephonenetworks. The samples files that we included are intended to serve as a guideline to get your first telephonysystemupandrunning.Nodocumentcanreplaceanyoneelse'sexperience,sobe patient.Yourperseveranceiskeyfor(your)success.Youarenotaloneyoucanalwaysask forhelpinmanyonlineforumsandshareyouruniqueexperiencewithothers.Welcometoa boomingcommunityofVoIPenthusiasts!

Wewanttohear(from)you.VoIPus!

35

BuildingVoiceInfrastructureinDevelopingRegions 11.Acknowledgements

11.Acknowledgements
Wewouldliketothankallpeoplethathavemadethisworkpossible: AdelElZaim(ArabicandFrencheditor),AnasTawileh(Arabictranslator), IakiCvicoy Sylvia Cadena (Spanish editors), Johan Bilien (French translator) and Martin Benjamin (Englisheditor).

36

Allmaterialinthispublicationislicensedunder CreativeCommonsAttributionNonCommercialShareAlike2.5 http://creativecommons.org/licenses/byncsa/2.5/

This work was carried out with the aid of a grant from the Acacia InitiativeoftheInternationalDevelopmentResearchCentreofCanada.

Canadas International Development Research Centre (IDRC)isoneoftheworldsleadinginstitutionsinthe generationandapplicationofnewknowledgetomeet thechallengesofinternationaldevelopment.Formore than30years,IDRChasworkedinclosecollaboration with researchers from the developing world in their searchforthemeanstobuildhealthier,moreequitable, andmoreprosperoussocieties.

IT+46,www.it46.seDecember2006

Vous aimerez peut-être aussi