Академический Документы
Профессиональный Документы
Культура Документы
TableofContents
ABOUTTHEAUTHORS.........................................................................................................................1 PREFACE...................................................................................................................................................2 CHAPTER1:VoIPOverview....................................................................................................................3 HowVoIPWorksforDummies.............................................................................................................3 WheretoStart?......................................................................................................................................4 WhatIsInternetTelephony?..................................................................................................................5 CHAPTER2:Becomingauser.................................................................................................................7 PCtoPCInternetTelephoneCall.........................................................................................................7 Usingsoftphone...................................................................................................................................11 InstallingXLite..............................................................................................................................11 XliteConfiguration........................................................................................................................15 InstallEkiga....................................................................................................................................19 ConfiguringEkiga...........................................................................................................................19 ConfiguringAccountinEkiga........................................................................................................27 TestyourSIPSoftphone......................................................................................................................30 CHAPTER3:VoIPHardwareforexperiencedUsers..............................................................................35 LinksysPAP2AnalogTelephoneAdapter........................................................................................36 LinksysIPPhoneSPA941..................................................................................................................41 WiFiIPPhone......................................................................................................................................46 LinksysWirelessGIPPhone.........................................................................................................47 HewlettPackardIpaq6395.............................................................................................................56 ActivatingIpaq6395'sWirelessCapability...............................................................................56 RunningSJPhone.......................................................................................................................58 SJPhoneFeatures.......................................................................................................................64 UsingSJPhonetoplacecallthroughIpaq6395........................................................................65 Nokia...............................................................................................................................................68 NokiaWirelessConfiguration..................................................................................................69 SIPServerandAccountConfigurationinNokiaE61................................................................73 InternetTelephoneConfigurationinNokia...............................................................................76 RegisteringtoVoIPSoftswitch..................................................................................................77 CallingusingInternetTelephoneinNokiaE61.........................................................................80 VoIPinADSLModem........................................................................................................................82 ADSLModemConfiguration........................................................................................................83 VoIPConfigurationinLinksysWAG54GP2..................................................................................86 CHAPTER4:InterconnectivityandTelephoneNumberAllocation.......................................................93 GettingFreeWashingtonStateTelephoneNumber.............................................................................94 FreeInternetCountry:CountryCode+882........................................................................................97 IntroducingyourcountrycodetoInternationalVoIPnetwork..........................................................104 VoIPRakyat'sENUM
...........................................................................................................................................................106 ConnectingtoPSTNandCellularUsingVoIPDiscount...................................................................116 VoIPCheap........................................................................................................................................118 CHAPTER5:AsteriskSoftswitch.........................................................................................................120 MinimalResourceforAsterisk.........................................................................................................121 AsteriskInstallation...........................................................................................................................121 CompileAsterisk...............................................................................................................................122 ConfiguringAsterisk.........................................................................................................................124 ENUM.CONFConfiguration............................................................................................................124 SIP.CONFConfiguration..................................................................................................................125 EXTENSIONS.CONFConfiguration...............................................................................................126 CHAPTER6:AsteriskforIncomingandOutgoingcalls.....................................................................129 DefiningSIPChannelinsip.conf.....................................................................................................129 AsteriskasSIPClient........................................................................................................................129 GenericSIPconfiguration................................................................................................................131 DAHDIUsageForVoIPCards..........................................................................................................141 DAHDIArchitecture.....................................................................................................................142 Kernel.......................................................................................................................................142 Tools.........................................................................................................................................142 DAHDISampleinstallation..........................................................................................................143 DAHDIextensions.conf.....................................................................................................................146 CHAPTER7:BrikerSoftswitch.............................................................................................................148 Briker'sInstallationProcess...............................................................................................................148 Briker'sConsole.................................................................................................................................154 Briker'sWebConfiguration...............................................................................................................156 ZaptelConfiguration.........................................................................................................................159 SIPTrunk...........................................................................................................................................160 IAX2Trunk.......................................................................................................................................163 H323Trunk........................................................................................................................................165 ZAPTrunk.........................................................................................................................................167 OutboundRoutes...............................................................................................................................168 InboundRoutes..................................................................................................................................170 InteractiveVoiceResponse................................................................................................................171 SetupRecordings...............................................................................................................................171 RingGroups.......................................................................................................................................172 PinSets...............................................................................................................................................174 CHAPTER8:OpenSIPSHighPerformanceSoftswitch........................................................................175 CompileOpenSIPS............................................................................................................................175 PrepareUserDatabaseServer............................................................................................................176 Useopensipsctl..................................................................................................................................178 SomeRoutingTechniqueinOpenSIPS.............................................................................................178 HowtoroutetoPSTNandCellular..............................................................................................179 HowtorouteusingAreaCodeforinterconnectedSIPServers....................................................180
HowtorouteENUMQueryinOpenSIPS....................................................................................181 TestENUMQueryinOpenSIP.....................................................................................................181 ENUMRoutingTableinOpenSIPSconfiguration.......................................................................182 CHAPTER9:ENUM.............................................................................................................................184 ExampleofENUMService...............................................................................................................184 DelegationConceptinENUM...........................................................................................................184 ENUMImplementation.....................................................................................................................186 BINDInstallation..........................................................................................................................186 SetupBINDforENUMServer.....................................................................................................186 TestDNSforENUMQuery..........................................................................................................188 ENUMDelegationinBIND..............................................................................................................189 CHAPTER10:ConferenceServeronAsterisk.....................................................................................191 ConfiguringConferenceRoomMeetMe...........................................................................................191 ConfiguringDialplanforConference...............................................................................................192 ActivatingConferencewhileOperating...........................................................................................193 CHAPTER11:TrunkPeeringinAsterisk..............................................................................................195 CHAPTER12:NATandFirewall..........................................................................................................196 CHAPTER13:VoicemailinAsterisk....................................................................................................198 CHAPTER14:MoreonAsterisk'sDialplan..........................................................................................201 PatternExtension..............................................................................................................................201 Attachingcontext..............................................................................................................................201 TheExtensionPattern.......................................................................................................................202 Extension......................................................................................................................................203 PredefinedExtensionNames.......................................................................................................203 DefiningExtension......................................................................................................................204 AninterestingExtensionExamples..............................................................................................206 VariableandEquation.......................................................................................................................208 Reloading...........................................................................................................................................208 ForwardingtoanotherAsterisk.........................................................................................................208 CHAPTER15:VoIPIPPBXHardware.................................................................................................210 LinksysSPA9000...............................................................................................................................210 LinksysSPA9000Configuration..................................................................................................211 ConfiguringVoIPonLinksysSPA9000......................................................................................214 CHAPTER16:AnalogTelephoneAdapterforconnectiontoPSTN....................................................219 LinksysSPA3000AnalogTelephoneAdapter.................................................................................220 ConfigureLinksysSPA3000.........................................................................................................221 LinksysSPA3000ATAStatus......................................................................................................225 LevelOneVOI2100AnalogTelephoneAdapter...............................................................................227 LinksysSPA400withfourFXOs......................................................................................................246 UsingtheSPA400withAsterisk..................................................................................................246 ConfigureAsterisktotalktoLinksysSPA400.............................................................................248 ConnectPSTNusingLinksysSPA9000andLinksysSPA400.....................................................251 ConfigureLinksysSPA9000totalktoLinksysSPA400..............................................................260
CHAPTER17:OpenBTS.......................................................................................................................261 OpenGSMInfrastructure..................................................................................................................261 History...............................................................................................................................................261 FieldTest............................................................................................................................................261 Niue...................................................................................................................................................262 GNURadio.........................................................................................................................................262 LibraryInstallation.......................................................................................................................263 WxWidgetInstallation..................................................................................................................263 SWIGInstallation.........................................................................................................................264 QWTInstallation..........................................................................................................................264 GNURadioInstallation.................................................................................................................265 USRPHandling............................................................................................................................265 USRPVerification........................................................................................................................266 OpenBTSInstallation........................................................................................................................269 AGlimpseonOpenBTSConfiguration............................................................................................270 smqueueConfiguration.....................................................................................................................272 AsteriskConfigurationtoworkwithOpenBTS................................................................................273 AutomaticSIMRegistration.........................................................................................................274 OpenBTSOperation..........................................................................................................................275 CHAPTER18:PeeringAmongProviders..............................................................................................276 FreeSIPProxyServers......................................................................................................................278 BecomingaPeerinSIPNetwork ...........................................................................................................................................................278 CHAPTER19:InternetTelephonyBandwidth.....................................................................................280 CodingDecoding(CODEC).............................................................................................................280 MeanOpinionScore(MOS)..............................................................................................................281 MOSandRFactorvaluesforG.711,G.723,andG.729....................................................................283 CalculatingTheRequiredBandwidth...............................................................................................284 CalculationforCallCenter................................................................................................................287 VoIPCapacityPlanning....................................................................................................................289 CHAPTER20:VoIPEvaluation............................................................................................................293 EvaluateVoIPPerformanceusingVQManager................................................................................293 VQManagerInstallation..............................................................................................................293 SomeoftheImportantScriptsofVQManager.............................................................................294 ActivateVQManagerWebService...............................................................................................295 ChangingtheMonitoredInterface................................................................................................303 InsertingnewInterface................................................................................................................303 MonitorVoIPPerformance...........................................................................................................304 EvaluateVoIPPerformanceusingSIPp.............................................................................................313 InstallationofSIPp........................................................................................................................313 InstallationofSIPpWebfrontend..................................................................................................313 TransactionOrientedTestusingSIPp...........................................................................................314 AccesstotheSIPpWebfrontend...................................................................................................317
CHAPTER21:VoIPTroubleshooting...................................................................................................328 CODECandVocoder........................................................................................................................328 PreparingAVoIPReadyNetwork.....................................................................................................329 Minimalrequirement/configuration................................................................................................329 Testpriortooperationofthesystem.................................................................................................329 SomeUsefulReferencesForVoIPTroubleshooting........................................................................330 References..............................................................................................................................................331 VoIPHardware...................................................................................................................................331 VoIPSoftswitch.................................................................................................................................331 VoIPClientSoftware.........................................................................................................................331 TestingSoftware................................................................................................................................331 APPENDIXA:Exampleof/etc/sip.conf...............................................................................................333 APPENDIXB:SIPpCOMMANDS......................................................................................................343 APPENDIXC:File/usr/local/etc/opensips/cfgtestuas.cfg................................................................350
AntonRaharjaisthefounderofthelargestcommunitybasedSIPSoftswitchVoIPRakyatin
Indonesia.HeisalsotheleaddeveloperofBriker,anopensourceSIPsoftswitchappliance.Besides Briker,Antonactivesindevelopingseveralopensourceapplications,suchas,PlaySMS(SMS Gateway),PlayVoIP(theVoIPRakyatEngine),PlayBilling(InternetCafeBillingSystem),WiFiRakyat etc.HehasservedinmanytalkandseminarsonVoIPandOpenSourcesoftware.Heiscurrentlythe TechnicalDirectorofPT.JelajahMediaInformatika,WANDKI,JakartaandtheCEOofPT.Infotech MediaNusantara,Jakarta.In2008,hereceivedaFOSSAwardfromtheIndonesianMinistryof InformationandCommunication.Hisprofileisathttp://www.antonraharja.web.id/curriculumvitae/
VoIPCookbook:1
PREFACE
Thisbookisaimedtoprovideapracticalknowledgetosetupacommunitybasedtelephonenetwork basedovertheInternetInfrastructureA.K.A.InternetTelephoneorVoiceoverInternetProtocol(VoIP). Manyrealworldexampleonequipmentandapplicationsoftwaresetupandinstallationsareprovided. Wewouldliketothankmanyfriendsathttp://www.asterisk.org,http://www.opensips.org, http://www.voiprakyat.or.idhttp://www.e164.org , aswellasmanyforumandmailinglistswithout whomitwouldbeimpossibleforustogainalotofknowledgeandideas. Iwouldliketothankmanyofourcomradesthatmanagedtokeeptheirspirithighinmakinga significantchangeinIndonesiantelecommunicationarea.SomeofthemareSumaryo,DonnyBU, BasukiSuhardiman,HariyantoPribadi,M.Ichsan,HeruNugroho,MichaelSunggiardi,andJudi Prasetyo;aswellasmanyfriendsonthemailinglists. OnnoW.PurbowouldliketothanktheInternationalDevelopmentResearchCenter(IDRC) http://www.idrc.catosupporthisearlierworkonVoIP.EspeciallytoICT4Dgroup,specially,Richard Fuchs,RenaldLafond,GrahamTodd,JoshSkinner,SteveSong,NancySmyth,HeloiseEmdon, MireilleLerouxandFrankTulus. WewouldliketothankInformationSocietyInnovationFundISIFhttp://www.isif.asia,especially SylviaCadenaandherteamforsupportingusindocumentingourknowledgeoncommunitybased InternetTelephony. Wehopethisbookwillenablemorecommunitybasedtelecommunicationandtelephoneprovidersover theregionalInternet.Furthermore,wehopeitwillenablealowcostaccesstotelecommunicationinthe region. Jakarta,February2011 TheAuthors
VoIPCookbook:2
VoIPCookbook:3
Where to Start?
Thebookisdesignedtomeettheneedfor ThosewhowishtotryandtobecomeaVoIPuseronly. ThosewhowishtoexploreonhowtosetupmoreadvanceVoIPuserappliances. ThosewhowishtofindVoIPcorporatesolutions. Thosewhowishtoexploreonsettingupahomebrewsoftswitch. AdvancedtechiesthatwantstoknowindepthhowtooperateaTelcooverInternet. ForVoIPnewbieusers,equipedwithPC,soundcardandaccesstotheInternet,mightwanttoread Becomingauser(CHAPTER2)andlittlebitofInterconnectivityandTelephoneNumber Allocation(CHAPTER4). VoIPCookbook:4
ForthosewhowishtoexploreVoIPappliancesmightinterestedinVoIPHardwareforexperienced Users(CHAPTER3).Chapter3coversalotofhardwares,including,IPPhone,WifiPhone,Analog TelephoneAdapter,ADSLModem. ThosewhoaremoreinterestedincorporatesolutionsmightbeinterestedinVoIPIPPBXHardware (CHAPTER15)andAnalogTelephoneAdapterforconnectiontoPSTN(CHAPTER16).Any materialsonVoIPHardwareforexperiencedUsers(CHAPTER3)wouldalsohelp. ForthosewhowishtosetupahomebrewVoIPsoftswitch,itisbeneficialtoreadBrikerSoftswitch (CHAPTER7)andwithlittleefforttoreadAsteriskSoftswitch(CHAPTER5)andOpenSIPS HighPerformanceSoftswitch(CHAPTER8).ForadvancehomebreweratopiconENUM (CHAPTER9)mightbeofinteresttosetthesystemtorecognize+<countrycode><areacode> <subscribernumber>numberingformatasusedinTelconetwork. Therestofthetopics,suchas,VoIPBandwidth,conferenceserver,detailedondialplan,trunking, peering,evaluationofVoIPperformance,VoIPtroubleshootingareaimedformoreadvancedusersthat reallywantstofinetunetheInfrastructure.
DespitethatVoIPcommunicationcanbeprovidedforfree,youstillneedtomeetsomebasic requirements.Theyincludetherequiredequipmentsandsoftware.Attheveryleast,youneedanIP basednetworkusingTCP/IPandacomputerwithsoundcards,headsets,microphonespeakerandhave thecomputerbeconnectedtoanetworkortheInternet.Softphone,thesoftwarerequiredforVoIP communication,isprovidedforfree. Ifyouhavemoremoneytospend,youcanbuyVoIPreadyequipmentsthatcanbeoperatedwithno needforconfigurationorveryminimalconfiguration.Inaddition,youcanavoidthehassleofturning onyourcomputereachtimeyouwanttocommunicatethroughVoIP.Attheminimum,youcanbuyan IPPhone,aphonethatcanbepluggedintoLANnetwork.SomeoftheseIPPhoneshaveWiFi capability,allowingyoutousethephonewhenconnectedtoahotspotnetwork.Therearemanydevices enablingVoIPcommunication,someofwhichmayormaynotneedconfigurations. Ifyou'rebuildingamuchmorecomplicatednetwork,youcanimplementIPPBXorInternetTelephony GatewayalsoknownasAnalogTelephonyAdapeter(ATA),amediumbetweeninternettelephony networkandconventionalphonenetwork.
VoIPCookbook:6
VoIPCookbook:7
VoIPCookbook:8
VoIPCookbook:9
VoIPCookbook:10
Using softphone
Selecttherightsoftphoneforyourcomputer.MostofthesesoftphonescanbedownloadedfromVoIP Rakyathttp://voiprakyat.or.id/download/,oryoucanfindeachofthemfromitswebsite. Cubix Idefisk SJPhone Xlite Ekiga http://www.virbiage.com/cubix.php http://www.asteriskguru.com/idefisk/free/ http://www.sjlabs.com/sjp.html http://www.xten.com/index.php?menu=download http://ekiga.org
Youneedonlyoneofsoftphones,dependingonwhicheverworksorsuitableforyou;
InstallingXLite
Oncexliteinstallerprogramisrun,wewillbedirectedtoaWelcomingDialogProperties.Clickon Nexttoproceedtothenextstepoftheinstallationprocess.
VoIPCookbook:11
Whicheverfolderyouchoose,clickNexttocontinuetheinstallationprocess.
Forquickerandeasierwayofusingxlite,youcanaddxliteasadesktopiconorevensetittoactivate whenWindowsstarts(SeeFigure2.7).ClickNexttoproceed.
Xlitethenextractsallfilesrequiredfortheprogram(SeeFigure2.8).
VoIPCookbook:13
Oncetheinstallationprocessiscompleted,youcandirectlyrunXLitebycheckingtheLaunchXLite boxandclickingFinishbutton.
VoIPCookbook:14
XliteConfiguration
AlthoughXLitecouldrunthemomentyoucompletedtheinstallationprocess,itdoesnotmeanyou canuseitimmediately.Youstillhavetoconfigurethesoftphone.Itsconfigurationmenucanbeopened byrightclickingonXlite.XLite3.0hastwolinesthatcanbeoperatedsimultaneously.Thisimplies wecanestablishtwoconcurrentcalls,eachtodifferentdestination. Figure2.18 XLiteappears justlikean ordinaryphone
VoIPCookbook:15
VoIPCookbook:16
VoIPCookbook:17
IntheTopologytab,youcanactivateXlite'sabilitytopenetrateFirewall/NAT,toidentifythepublicIP addressthatisusedandsoon.Youcanalsousethedefaultsettingsthatwillautomaticallyknowthe publicIPaddressthatweuse.However,NATmaystillbeproblematic,asnotallconfigurationcanbe traversedbysignalingprotocolandmediausedaSIPprovider. ForPresenceandAdvancedtabs,usethedefaultvalues.Someparametersyoucanchangearethetime intervalsusedtoperiodicallyregisterouraccounttotheSIPserver.ThisensuresthattheSIPaccount remainsregistered.Afterall configurationsarecompleted, clickOktoactivatethe configurations. Figure2.17: Withthebox underEnabled columnticked, youcannowuse yourSIPaccount VoIPCookbook:18
InstallEkiga
Ekiga(formelyknownasGnomeMeeting)isanopensourceSoftPhone,VideoConferencingand InstantMessengerapplicationovertheInternet.ItsupportsHDsoundqualityandvideouptoDVDsize andquality.Ekigaisinteroperablewithmanyotherstandardcompliantsoftwares,hardwaresand serviceprovidersasitusesboththemajortelephonystandards(SIPandH.323). ToInstallEkigainUbuntu, sudoaptgetinstallekiga
ConfiguringEkiga
Principally,Weneedtodo Ekiga>Edit>Accounts>AddaSIPAccount Theneededinformartionwouldbe Name Registrar User AuthenticationUser Password :VoIPnumber :SIPServer :VoIPnumber :VoIPnumber :passwordVoIP
IntheearlystartofEkiga,weneedtosetseveralparameters.Wemaycanceltheearlyconfiguration VoIPCookbook:19
forwardtheconfigurationprocess.
Figure2.19EnterFullName. Thefirststep,weneedtoenterourfullnameintoEkiga.ThenpressForwardbutton.
VoIPCookbook:21
VoIPCookbook:22
VoIPCookbook:23
VoIPCookbook:24
VoIPCookbook:25
VoIPCookbook:26
ConfiguringAccountinEkiga
ConfiguringanAccountinEkigamaybedonethroughmenu Ekiga>Edit>Accounts or Ekiga>CtrlE
ThedetailedofVoIPAccountconfigurationinEkigaisasfollows,
Figure2.15StartAccountConfiguration. AftertheAccountmenuisactivated,wewillseetheabovefigure.
Figure2.16AddSIPAccount. ClickonAccounts>AddaSIPAccount
VoIPCookbook:27
Figure2.17AddSIPAccountinformation. IntheaboveExample,weentertheparametertouseSIPaccountinVoIPRakyat.Enterthedata, namely, Name Registrar User AuthenticationUser Password NabilSuhaemi voiprakyat.or.id 123456 123456 <yourpasswordinvoiprakyat.or.od>
VoIPCookbook:28
Figure2.18AddSIPAccountinformation. Intheabovefigure,wesettheparameterforlocalVoIPsoftswitchatIPaddress192.168.0.3.
VoIPCookbook:29
administratortodowhatistoldhere.
Figure 2.21: Just like other VoIP Providers, VoIP Rakyat provides its users with some numbers with which the users can use for testing their VoIP quality
VoIPCookbook:31
Figure 2.22: Through VoIP Rakyat's Phonebook, you can see who's online
VoIPCookbook:32
Function
SIP Provider
SIP
Enum
Autoattendant BC Wireless 1000@mutual.bcwireless. 1 604 484 5289 x8600 (http://www.bcwireless.net/moin.cgi/N net through E164.org etworkServices/VoiceServices/PublicC onferenceRoom). Enum2go (http://enum2go.com/) Echo Test N3 Network Lab. (http://www.n3network.ch/) 878107472000010@sip2g o.com Echo test sip: echo@n3network.ch sip: 905100@n3network.ch (no G.729) Mouselike.org (http://www.mouselike.org/) VoipTalk (http://www.voiptalk.org/) Reread Called ID Welcome Line FWD Ewing IT Xmission (http://xmission.com/transmission) UCLA (http://internet2.edu/sip.edu) TELL U. Philippines (UK) 904@mouselike.org UK 904@voiptalk.org 95861111@mutual.bcwire less.net 55555@fwd.pulver.com 611300766674@sip.like2f one.com xmission@pbx.xmission.c om (tidak ada G.729) 13108254321@ucla.edu (tidak ada G.729) 18005558355@proxy01.si pphone.com 0116329818500@proxy01 .sipphone.com +441483604781
VoIPCookbook:33
SipPhoneDirectory) Patton Electronics (http://www.patton.com/support) Party Line support@patton.com (tidak ada G.729) 17475552663@proxy01.si pphone.com (VoIP conference setiap sabtu jam 20:00 GMT) music@trysip.ingate.com 16172531000@proxy01.si pphone.com
VoIPCookbook:34
However,VoIPhardwareisnotfree,asyoustillhavetospendsomemoneyforbuyingtheequipment. ForaboutUS$100,youcangetasetofdecentVoIPhardwareproducedfromChinaorTaiwan.But despitethiscost,VoIPhardwarearehighlyrecommended,asyoumayfindthebenefitsthehardware bringoutweighthecostyouhavetocover,intermsofeaseofuseandenergyefficiency. ThisChapterwillexplainseveralhardwareavailableinthemarketandhowtoconfigurethem:IP Phone,InternetTelephoneGatewayorbetterknownasAnalogTelephoneAdapter(ATA),andWireless IPPhone.TheywayyouconfigureVoIPhardwareisnotmuchdifferentfromwhatyoudowith softphone.BasicallyallyouhavetoconfigurearetheIPsettings(IPaddress,subnetmask,and gateway)andregistrationtoSIPserverorproxyserver(Usernameortelephonenumber,passwordand hostnameserver).Often,IPsettingsisconfiguredautomaticallyusingDHCPserveroperatingina network,soyoudon'thavetosettheIPaddress,subnetmaskandgateway.
VoIPCookbook:35
FXOtobeconnectedtoPSTN/Telcoline/PABXextension. FXStobeconnectedtoTelephoneline/FAX.
Press*repeatedlyonthephonekeypaduntilyouhearsomeonetalkingthroughyourphone. Press110#tolistentotheIPaddressfortheLinksysPAP2configuration.
Figure3.2:TheinitialmenuthatwillappearisthestatusofLinksysPAP2 ClickAdminLogin,whichisonthetoprighttobegintheconfigurationasanadministrator.
VoIPCookbook:37
VoIPCookbook:38
VoIPCookbook:39
Figure3.4:Line2taboftheadministrationpanel Fewimportantstepstodoinactivatinganaccountinbothmenus: SetLineEnabletoyes. Fillinyouraccountusingthefollowingparameters: Proxy UserID Password UseAuthID voiprakyat.or.id telephonenumbergivenbyVoipRakyat thepasswordgivenbyvoiprakyat no
otherparametersthatcanbeconfigured,butforanormaloperation,itisnotnecessarytoconfigure them.Soitissufficientforustousethedefaultconfigurationvalues.
Figure3.5:AnIPPhoneFigure3.6:IPPhonetypicallyhastwoRJ45ports WhatIPPhonehasinsteadistheRJ45portforitsLANconnection(ethernetsocket).Asyoucanseeat thebackofIPPhone(showninfigure3.6),bothportsareofRJ45,onetobeconnectedtoaLAN whileanothertothecomputer.Thisallowsustousethephonewhileusingthecomputerforthe internet.Howeverkeepinmindthatyourbandwidthmaynotbesufficientforboth.Soonlyusebothat thesametimewhenyouthinkyouhaveenoughbandwidthtoensurethequalityofyourVoIP communicationremainsgood.AnIPPhonecanusuallybeconfiguredthroughtheweb. ThereareabundanttypesofIPPhoneinthemarket.Youcanfindthematthefollowinglink: http://www.voipinfo.org/wiki/view/VOIP+Phones. ThesortofIPPhoneweuseasanexampleisSPA941.ToobtainitsIPaddress,wehavetodothe following:
Figure3.7:ThefirstappearanceyouwillseeisthestatusofLinksysSPA941. GotoLinksysSPA941webthroughhttp://ipadressspa941.
VoIPCookbook:42
VoIPCookbook:43
VoIPCookbook:44
Figure3.10:ByclickingonExt1tab,youcansetsomeimportantparametersofExt1line TherearetwostepsneededtoactivateanaccountatmenuExt1orExt2: SetLineEnabletoyes. Fillinthethefollowingparameterswiththeinformationpertainingtoyouraccount: Proxy UserID Password UseAuthID voiprakyat.or.id thetelephonenumbergivenbyVoIPRakyat thepasswordgivenbyVoIPRakyat no
IfUseAuthIDissettoyes,thenfilltheinAuthIDwiththetelephonenumbergivenbyVoIP Rakyat.DothesamefortheotherSIPaccountyouwanttoregistertoExt2ofLinksysSPA941.
VoIPCookbook:45
WiFi IPPhone
WiFiPhonescanbeusedforinternettelephonyconnectedtoIPPBXviaWiFiorHotSpot.Inother words,thephonecanbeusedasanextensionofaPABXoraphonewhichisconnectedtoahotspot. SomeoftheseWiFiPhonemayhavedualfunctionsGSMmodeandVoIPitallowsthepossibility ofreceivingaGSMcallorVoIPcallthroughWiFimodeasanextensiontoanIPPBX. VoIPCookbook:46
LinksysWirelessGIPPhone
LinksyslaunchedaWirelessGIPPhoneadedicatedWiFiPhone.ItisnotaPDAnorordinary cellphone(Seefigure3.12).IfyouhavetheWiFiPhoneproperlyconfigured,connectedtotheWireless AccessPointandregisteredtoaVoIPSoftswitch,thenwhatshouldappearonthescreenofthephoneis thenameoftheaccesspointandthetelephonenumberofthephone.Underthiscircumstance,theWiFi Phoneisreadytobeusedforcalling.
Figure 3.13: WiFi Phone can be used for VoIP call when it is properly configured
VoIPCookbook:47
Figure3.14: Throughthephone menu,youcan makedirect configurationin ordertomakeyour phoneVoIPenabled
VoIPCookbook:48
VoIPCookbook:49
VoIPCookbook:50
VoIPCookbook:51
VoIPCookbook:52
VoIPCookbook:53
VoIPCookbook:54
VoIPCookbook:55
HewlettPackardIpaq6395
PersonalDigitalAssistance(PDA)whichusesPocketPC(PPC)operatingsystem,suchasIpaq6395or otherkindofIpaqhavingWiFicapability,canbeusedforVoIPcommunication.Oneofthesoftware thatcanbeusedforthisPDAisSJPhonePPC,whichcanbedownloadedfrom http://www.sjlabs.com/sjp.html.Alsoavailableinthissitearethemanualsnecessaryforoperatingthe softphone.SJPhoneinstallationcanbedoneinthefollowingsteps:connectIpaqtoPCthroughthe providedUSBcableandrunthesoftwareonPC,andSJPhonePPCwillbeautomaticallyinstalledin Ipaq.
Figure3.23:Hewlett PackardIpaq6395
ActivatingIpaq6395'sWirelessCapability
VoIPCookbook:56
Ifallgoeswell,thecoloroftheWiFibuttonwillturngreen,asignwhichindicatesthatthedeviceis properlyconnectedtothewirelessnetwork.
Figure3.26: Byclickingthe Settingsiconnextto theWiFiicon,you canseetowhich networkyourphone isconnected
VoIPCookbook:57
RunningSJPhone
Tapthemenubutton.Inmenu,wecanentertheinformationpertainingtotheuser,whichincludes name,emailaddress,locationandevenanypicturewewanttouseasourimage.
Tapthecalloptiontab.Throughthistab,youcanconfiguresomethingslike:
VoIPCookbook:59
Ingeneral,theseparametersdonotneedtobechanged,possiblyexceptfortheAutomaticallyAccept IncomingCallstocompensateforthesmallPDAscreen.
Figure3.32: Undertheprofilestab, youcaneithermake newprofile;edit,use, initialize,renameor deleteexistingprofile
Intheprofiledialog,wecanmakedetailconfigurationforeachaccount.Basically,aprofiledefinesan account.,whichcanbeeitheraSIPaccountorH.323account.Thelatterisatechnologyonceusedby manyVoIPproviders.TheformerisatechnologyusedinVoIPRakyat.Thereareseveraloptions availableintheprofilemenu: Newtocreatenewprofile Edittoeditexistingprofile Deletetodeleteexistingprofile Usetouseexistingprofile Initializetoinitializeaprofile Renametochangethenameofexistingprofile
Figure3.33: Enterthenameof theprofile,thetype ofinterfaceituses, andthenameofthe profilefile
VoIPCookbook:60
VoIPCookbook:61
VoIPCookbook:62
VoIPCookbook:63
VoIPCookbook:64
Toaddacontact,simplytapAdd,whichisavailableinPhonebooktab.
VoIPCookbook:65
Incomingcallstatisticscanbeaccessedonthetabavailableatthebottomofthescreen,withthetab appearingasaphonewithatriangulararrowpointingtowardthephone.
Nokia
Aspartofcellularmajorindustry,Nokiaseemstohaverecognizedthatinternettelephonywillbe instrumentalinthefuture.AssuchNokiamakesitpossibleforSymbianoperatingsystemtooperatein Nokiahandphone,providingcustomerswithacellularthatcanbereadilyusedforinternettelephony.In theexample,wewilluseseveralNokiahandphone,suchas,NokiaE61,NokiaE71andNokiaN80.The formerismoreofPDAtypecellularphonewhilethelatterissmallintermsofdimension.NokiaE61, NokiaE71andNokiaN80areWiFiPhone. TheWiFiphoneconfigurationforallNokiaissomewhatsimilar,withminordifferencesintermsof menuappearance.Sogenerally,thosewhoareusedtoSymbianshouldnotencountersignificant challengesinturningtothesephones.
Figure3.48:NokiaN80
VoIPCookbook:68
Figure3.49:NokiaE61
NokiaWirelessConfiguration
Figure3.50: Nokia'sconsole
Nokia'sconsoledisplaylookslikewhatisshowninFigure3.51.Therearethingstobeconfiguredso thatNokiacanbeconnectedtobothWiFiandVoIP:
VoIPCookbook:69
Clicktheglobeicontoopenthemenu.
Figure3.51:Byclicking themenuicon,wecan selectavarietyofoptions .
Withthemenuopen,selecttools.Throughthisoption,wecanconfigureWiFi,SIP,internetphoneand othersettings.
Figure3.52: Therearemanyoptions availableinToolsmenu.
WiththeToolsiconselected,selectSettingsinordertoaccessconnectionmenuallowingusto configureWiFi,InternetTelephoneandSIPsettings.
VoIPCookbook:70
IntheConnectionmenuthereareafewmoreoptions.Weneedtoconfigureonlythreeofthem:Access Points,SIPSettingsandInternetTelephonySettings.SelectAccesspoints.
VoIPCookbook:71
WiththeAccesspointmenuopen,wecanaddAccessPoint,byselectingtheOptionsmenulocatedat thebottomleftfthedisplay.
Figure3.58: Youcaneithermake newaccesspointoredit ordeleteexistingaccess points.
ForcreatinganAccessPointprofile,weneedtosettheConnectionname,typeofconnection(Data bearer),andthenameofWLANnetwork.Fordatabearer,chooseWirelessLAN.
VoIPCookbook:72
ThroughSIPSettings,wecanconfigureSIPaccountsthatwillbeusedforcalling.Thesettingsisdone throughOptionsmenuinSIPSetting.
VoIPCookbook:73
VoIPCookbook:74
Figure3.64: Proxyserversettings
InternetTelephoneConfigurationinNokia
Figure3.66: InternetTelephony settings
InInternetTelephonySettings,wecancreateaprofileofInternettelephonyfacilitythatwillbeused usingNokia.Tosettheprofile,selectOptionsoftheInternetTelephonySettings.
VoIPCookbook:76
Figure3.68: Selectingaprofile
Figure3.69: ConnectivitySettings
VoIPCookbook:77
Figure3.70:Internet telephonysettings
IfwechooseWhenneededintheRegistrationparameterinSIPSettings,thestatusofinitial conditionofinternettelephonysetting,whenInternettelephonyisactive,isNotregistered.
Figure3.72: EnableWLANconnection inofflinemodesoNokia E61canbeconnectedtoa WiFinetwork
VoIPCookbook:78
OnceconnectedtoaWiFinetwork,wehavetowaitforawhiletoletNokiaregisteritselfwiththe Softswitch.
Figure3.74: Theregistrationis completed
CallingusingInternetTelephoneinNokiaE61
Figure3.75: InitialdisplayofNokia E61
PlacingacallusinginternettelephoneinNokiaissimilartohowwecallusingotherphone:Wejust needtotypethephonenumbertowhichwewantdial.
Figure3.76: Oncethenumberis dialed,weneedtochoose thetypeofcall.
VoIPCookbook:80
Whenthecallisestablished,wewillgetanotificationonthescreenthatourtelephonenumberis connectedtothedestinationnumber.
Figure3.78: Youcaneithermutethe sound,activatehandset, endactivecall,holdthe ]call,makethecallopen activestandbyandplace newcall
Todisconnectacall,simplyselectEndactivecall.
VoIPCookbook:81
VoIPCookbook:82
ADSLModemConfiguration
VoIPCookbook:83
VoIPCookbook:84
Eachofthesehassubmenu,whichwewillnotexplainanyfurther,aswewillfocusmoreontheVoIP featureofthemodem.
VoIPCookbook:85
VoIPConfigurationinLinksysWAG54GP2
InordertosettheSIPaccount,weneedtochangethebasicviewtoadvancedviewintheAdminmode. VoIPCookbook:86
VoIPCookbook:87
VoIPCookbook:88
VoIPCookbook:89
Figure3.87:TheSystemsubtaboftheVoicetabofthemodemadministrationpanel Insystemmenu,ifnecessary,wecanincludePrimaryandSecondaryDNSparameters.
VoIPCookbook:90
VoIPCookbook:91
VoIPCookbook:93
Figure 4.1: You can get a free phone number from IPKall
Figure4.2:Youcanlogonusinganexistingaccount,orcreateanewaccountonthespot VoIPCookbook:95
OncewehaveaSIPaccount,thenextstepwehavetodoissignuptowww.ipkall.cominordertoget WashingtonState'stelephonenumber.Inthesignuppane,chooseanyofthefollowingtheareacode: 206,253,360,and425.Whichevernumberyouchoose,enteradditionalinformationontheSIPphone numbergivenbyaSIPProvider(inourcase,it'sthenumbergivenbyVoIPRakyat),SIPProxy (voiprakyat.or.id),ouremailaddressforconfirmingtheaccountwearecreating,andthepasswordfor makingchangesinIPKallaccount.TypeintheCaptchagraphicalwords.Afterallparametersarefilled correctly,clickSubmittoproceed. Normally,wehavetowaitforaboutanhourtoreceivetheconfirmationsentthroughemail.Toactivate yourIPKallaccount,clicktheURLobtainedfromtheemail.Withtheaccountconfirmed,younow havetheStateofWashingtonphonenumberwithwhichyoucanreceivecallsfromotherPSTNacross theworldthroughyourSIPaccount.
VoIPCookbook:96
VoIPCookbook:97
The latter, e164.org, is the informal level domain provided by communities, the sort that are concerned with how people can minimize telecommunication cost. This is the domain we will use for our VoIP communication. We can register in http://www.e164.org to get an account that can be used to obtain a phone number and register the number.
Figure 4.4: To use e164.org, simply follow the instructions shown in http://www.e164.org/wiki/AsteriskExamples
VoIPCookbook:99
Figure 4.5: Before you can be connected to e164.org, you have to sign up first
Figure 4.8: You can obtain +822 number assigned by e164.org via https://www.e164.org/freenumadd.php
VoIPCookbook:105
Figure4.11:Indonesia'sEnumdirectorydevelopedbyVoIPRakyat
VoIPCookbook:106
VoIPCookbook:107
VoIPCookbook:108
Oncetheregistrationiscompleted,ENUMVoIPRakyatwillsendusanemailcontainingtheusername andpasswordwesetwhenregisteringtoENUMVoIPRakyat.
VoIPCookbook:109
Figure 4.15: In order to access ENUM VoIP Rakyat, you need to enter your username and password
Nowthatyourusernamehasbeenregistered,logonusingitandthepasswordprovided.Clickloginto proceed.
VoIPCookbook:110
Figure 4.16: ENUM VoIP Rakyat main Window after you logged in
InENUMVoIPRakyat,ontheleftofthepage,therearesomeusefuloptionsyoucanchoosefrom: PreferencesandPhoneNumber.First,clickPreferences.
VoIPCookbook:111
Figure 4.17: By clicking on Preferences, you can edit your login and personal information
WiththePreferencesoptionclicked,youcanchecktheinformationyouenteredearlierwhenyoudid theregistration,andmakenecessarychanges.
VoIPCookbook:112
Figure 4.18: By clicking on Phone number, you can add your phone number
ClickPhonenumber.ClickAddphonenumber.
VoIPCookbook:113
Figure 4.19: By clicking on Add Phone number, you will be able to register your phone
Theinformationyouneedtoenteriscountrycode,areacodeandlocalnumber.Oncetheseinformation areincluded,clickAddsothatthenumberwillbeaddedtoVoIPRakyatENUMdomain.
VoIPCookbook:114
Figure 4.20: Before a number is added, ENUM VoIP Rakyat will confirm whether you really want to add the number
VoIPCookbook:115
Figure 4.21: With VoIP Discount, you can make free or inexpensive calls over the Internet
VoIPCookbook:116
TouseVoIPDiscount,youneedto:
Onceallthesestepsarecompleted,youwillbeabletodialanynumberthewayyoudialusingyour PSTNnumber,withcountrycode,areacodeandtelephonenumber. IfyouuseSIPIPPhoneorATA,youneedtodothefollowingconfiguration: SIPport:5060 Registrar:sip.voipdiscount.com Proxyserver:sip.voipdiscount.com Outboundproxyserver:leaveempty Accountname:yourVoipDiscountusername Password:yourVoipDiscountpassword Displayname/number:yourVoipDiscountusernameorvoipnumber Stunserver(option):stun.voipdiscount.com
VoIPCookbook:117
VoIP Cheap
SimilartoVoIPDiscount,VoIPCheap(http://www.voipcheap.com/en/index.html)alsoprovidesfreeor relativelyinexpensivecallsovertheinternet.ThestepstouseitissomewhatsimilartoVoIPDiscount, exceptthatyouneedtodownloadthesoftwarefromhttp://www.voipcheap.com/getfrommirror.php? file=voipcheapCOM&lang=en.ForVoIPCheapcallingrate,goto http://www.voipcheap.com/en/rates.html
Figure 4.22: With VoIP Cheap, you can make free or inexpensive calls over the Internet
VoIPCookbook:119
configurationsandtheirmaximalcapability,whichareavailableathttp://www.voipinfo.org.Through thissite,youwillalsofindthescriptsrequiredtosimulateacallandputsomeloadonthesystem. Basedontheseconsiderations,youwillknowhowmuchmoneyyoureallyneedtospend.Spend sometimebrowsingtheinternettomakesomecomparisononinternettelephonyequipmentsandhow muchtheycost.However,manufacturers,normally,donotshowthepriceoftheitemstheysellintheir site.Thesepricetagsareusuallyshowninsitessellinginternettelephonyequipments,someofthem are: Digiumcardshttp://www.digiumcards.com/ VoIPonsolutionshttp://www.voipon.co.uk/ TheVoIPConnectionhttp://www.thevoipconnection.com/ Thepricesmayvary,rangingfromUS$15toUS$50perFXOorFXS.Meanwhile,IPPhoneeachcost betweenUS$50toUS$150.Youwillofcoursegetforlesswhenyoupurchasetheminlargequantities. ThecheapestyoucangetaretheequipmentsproducedinTaiwanorChina.SomeofthemareLevelOne andNexus.
Asterisk Installation
Assuming,theUbunturepositoryat/etc/apt/sources.listhasbeencorrectlyset.Onecaneasilyinstall Asteriskusingcommand #aptgetinstallasterisk
VoIPCookbook:121
Compile Asterisk
Forthosewhowishtocompileasterisksoftswitchfromsourcecode,wecandoitthroughthe followings, Preparethefollowingapplications #aptgetinstallkernelpackagelibncurses5devfakerootwget\ bzip2g++libssldevlibxml2devdoxygen WecandownloadmostofthesourcecodefromAsterisksite,suchas,
http://www.asterisk.org
http://downloads.asterisk.org/pub/telephony/dahdilinuxcomplete/releases/dahdilinuxcomplete2.4.0+2.4.0.tar.gz
Whilempg123applicationcanbedownloadedfrom
cpmpg1231.12.5.tar.bz2/usr/local/src/ Openthesourcecode cd/usr/local/src tarzxvfasterisk1.8.0.tar.gz tarzxvflibpri1.4.11.4.tar.gz tarzxvfasterisksounds1.2.1.tar.gz tarjxvfmpg1231.12.5.tar.bz2 tarzxvfdahdilinuxcomplete2.4.0+2.4.0.tar.gz tarzxvflibss71.0.2.tar.gz CompileMPG123 cd/usr/local/src/mpg1231.12.5/ ./configure make makeinstall CompileLibpri cd/usr/local/src/libpri1.4.11.4/ makeall makeinstall CompileDAHDI.MakesurewehaveanInternetconnectionasweneedtodownloadthefirmware duringdahdiinstallationprocess. cd/usr/local/src/dahdilinuxcomplete2.4.0+2.4.0/ make makeinstall makeconfig CompileLibSS7.Dothisafterdahdi;beforecompilingasterisk. cd/usr/local/src/libss71.0.2/ make makeinstall
VoIPCookbook:123
Compileasterisk.MakesurewehaveInternetconnectionasweneedtodownloadtheoperationvoice duringasteriskinstallationprocess. cd/usr/local/src/asterisk1.8.0 ./configure makemenuselect makeall make makeinstall makesamples Pleasenotethatmakemenuselectisoptional,wecandothecompalitionprocesswithoutmake menuselect.Ifyouliketoinstallthedocumentation,pleasedo aptgetinstalldoxygen makeprogdocs
Configuring Asterisk
AstheAsteriskinstalled,weneedtoconfigureitsoAsteriskfunctionsthewayyouwantittobe.All filesthatyouneedtoconfigurearestoredinthefolder: /etc/asterisk Theminimalconfigurationfilesneedtoeditedare: sip.confforuserauthenticationwithaphonenumberandpassword. extensions.conftosetthedialplan. enum.confforENUM,forexample,forcountrycode+62. Asidefromthesefiles,therearemoreconfigurationfilesforthosewhoareseriouslyinterestedtostudy theasterisk.Fornow,itissufficientforyoutolearnconfiguringthosethreefiles.
ENUM.CONF Configuration
ThereisnotmuchtobechangedinENUM.CONF.However,youneedtomakesurethattherearethe followingentries: VoIPCookbook:124
SIP.CONF Configuration
Theuserdatabaseisstoredin/etc/asterisk/sip.conf.Anexampleforanaccountwithphonenumber 2099,password123456,dynamicIPaddressusingDHCPisasfollows: [2099] context=default type=friend username=2099 secret=123456 host=dynamic dtmfmode=rfc2833 mailbox=2099@default ToensurethatthedialtoneishandledproperlyinAsterisk1.6,wemayaddthefollowingentry: rfc2833compensate=yes Entertheaboveentryforeachuser.Atthispoint,eachusermayregisterhisorherselftotheAsterisk. TheregisteredusersmaycalleachotheronthesameAsteriskserver. ToconnectourAsteriskservertoVoIPRakyatoranyotherSIPproxyavailableintheinternet,weneed toregisterourAsterisktotheSIPproxyserver.Thecommandsusedis: register=>2345:password@sip_proxy/1234 whichmeansuser1234inourasteriskserverthatweoperateistheuser2345insip_proxyloggedinto theserverusingthepasswordpassword.Forexample,user2000hasanaccount20345in voiprakyat.or.idserverwithpasswordsecret,thentheformatusedis: VoIPCookbook:125
EXTENSIONS.CONF Configuration
Thedialplanorroutingtableofasoftswitchisnormallystoredin/etc/asterisk/extensions.conf.In extensions.confwecanconfigurewhatAsteriskneedstodoasitreceivesacallonacertainextension. Thesimplestexampleofdialplanis: exten=>_20XX,1,Dial(SIP/${EXTEN},20,rt) exten=>_20XX,2,HangUp whichmeansthatifthereissomeonewhocallsextension20XX,thenthefirststepcarriedoutbythe syntaxistohaveDIALoftheextensionuseSIPtechnology,waitfor20secondsandifthereisno response,carryouttimeout(rt).Thesecondstepistohangup.Ofcourseyouneedtodoasmall configurationofthecommandsoitwillfityourcircumstanceinhowyouuseyourSIPserver. Somecommandsconsidereddangerousbutoftensoughtbyuser/adminareasfollows: exten=>_0711.,1,Dial(SIP/${EXTEN:4}@2031,20.rt) whichmeansthatthereissomeonewhocalls0711.Thedot.impliesthatanynumberafter0711is ignored.DIALusesSIPtechnologytoconnectto2031.Alsonotecarefullythecode{EXTEN:4}hasto bereadomitthefirst4digitsofthedialednumber.Forexample:07115551234becomes5551234. IfweusePABXbetweenATAandPSTN,thecommandusedisasthefollowing: exten=>_021X.,1,Dial(SIP/9${EXTEN:3}@2031,20.rt) Thesyntaxaboveimpliesthatthereissomeonewhocalls021X.Noticethatthedot.placedafterX impliesthatanynumberplacedafterXisignored.DIALusesSIPtechnologytoconnectto2031.Also notecarefullythecode9{EXTEN:3}hastobereadomitthefirst3digitsofthedialednumberand addtheprefix9infrontofthenumber.Forexample:0215551234becomes95551234 Thismeansthatifthenumber2031originatesfromanAnalogTelephoneAdapter(ATA)suchasthe SPA3000locatedintheJakartaandisconnectedtoaPABXinJakarta,anyoneinsuchaVoIPnetwork VoIPCookbook:126
willbeabletocallJakartawithouthavingtopaylongdistanceorinternationalcall.Whattheyneedto payisjustthelocalrateforcallingtheintendednumberinJakartacity. ThesamewaycanbedevelopedforcallingmobilephoneinIndonesiabyconnectingtheATAweuse toPSTNoranyFixedWirelessTerminal(FWT)device.Thecommandusedisasfollows exten=>_08X.,1,Dial(SIP/${EXTEN}@2031,20.rt) Ofcourse,anofficethatisconnectedtoapublicVoIPnetworkwillnotopenitsaccesssothatonly certainuserscancallanymobilenumberorTelkom,andthusweusuallydonotuse021X.code,nor 08X.ButwewillentereachofthenumbersallowedtobecalledthroughVoIP.Forexample: exten=>_0811567854,1,Dial(SIP/${EXTEN}@2031,20.rt) exten=>_0216575675,1,Dial(SIP/${EXTEN}@2031,20.rt) exten=>_0216755675,1,Dial(SIP/${EXTEN}@2031,20.rt) Thismeansthatonlynumber0811567854,0216575675and0216755675canbecontactedviaVoIP numbers.Otherthanthesenumberscannotbecontacted. ToadoptthephonenumberformatsimilartoTelco,e.g.,+62XXXorothernumberswemayinclude ENUMLOOKUPcommand,forexample, exten=>_00.,1,Set(enumresult=${ENUMLOOKUP(+${EXTEN:2},,,,e164.id)}) exten=>_00.,n,Dial(SIP/${enumresult}) exten=>_+.,1,Set(enumresult=${ENUMLOOKUP(${EXTEN},,,,e164.id)}) exten=>_+.,n,Dial(SIP/${enumresult}) Inanenvironmentwheretherearemanyasterisk/SIPservers,sometimesweneedtocreateanarea codetobeabletocalltoeachotheramongtheseservers.Forexamples, AreaCode SIPServerIPAddress 021 203.159.31.99 022 203.159.31.123 023 203.159.31.48
Thedialplanwouldbe VoIPCookbook:127
VoIPCookbook:128
Example: register=>2345:password@mysipprovider.com/1234 Theabovecommandwillregister2345tomysipprovider.comandwillbeidentifiedasextension1234 inAsteriskwhichweoperate.Intheexampleabovetheparametersusedare: usertheuseridfortheSIPserver(example:2345) authuseruserauthorization(optional)totheSIPserver secrettheuserpassword hostservername(example:mysipprovider.com) porttheSIPportinServer.Thedefaultis5060. extensionthelocalextensionnumberinAsterisk(example:1234). TheextensionnumberisusedtocontactlocalextensionoftheAsteriskSIPserverwhichwesignedup. Ifthereisnoextension,Asteriskwillautomaticallyenterextension"s". ToseeifAsteriskhassuccessfullyregistereditselfwiththeSIPServer,wecanuseAsteriskInterface CommandLine,whichcanbeaccessedthroughtheasteriskcommandrintheshell. #asteriskr Registrationstatuscanbeviewedthroughthecommand: sipshowregistry ItseemsthatthiscommandwillbeomittedinAsteriskversion1.4,andwillbechangedinto sipregistrylist Toseethephone/extensionlistedinAsteriskwhichweoperate,wecanusethefollowingcommand sipshowpeers InAsterisk1.6,thecommandseemstobereplacedby sippeerslist
VoIPCookbook:130
TomakeacalltoaSIPserveroutsideofAsterisk,weneedtodefinesip.conflikethefollowing example: [mysipproviderout] type=peer secret=password username=2345 host=sipserver.mysipprovider.com fromuser=2345 fromdomain=fwd.pulver.com nat=yes context=frommysipprovider ;isfurtherdefinedinextensions.conf Inextensions.conf,weneedtoaddacommandlike: exten=>_9.,1,Dial(SIP/${EXTEN:1}@mysipproviderout,30,r) Pleasenotethatthevariable${EXTEN:1}herewilltakeallthecharacters/lettersfromtheincoming extensionexceptforthefirstcharacter,whichinthiscase,isthenumber9. Meanwhile,SIPextensionconfigurationextensions.confforreceivingcallscomingfromtheSIP servercanalsobedevelopedusingthefollowingcommand: [frommysipprovider] exten=>1234.1,Answer ;1234istheextensioncontact.Thedefaultextensioncontactis"s" exten=>1234.2,Dial(SIP/111,25,Ttr) ;IncomingcallsareredirectedtoaSIPtelephonenumber111 exten=>1234.3,Hangup
VoIPCookbook:131
disallow=all ;disallowallcodecstobeused. allowexternalinvites=yes|no ;EnableorDisableINVITE&REFERtononlocaldomain.Thedefaultisyes. allowguest=yes|no ;Allowsorrejectscallsfromguest(thedefaultisyes). allguest=yes|no ;Allowsordeniesthecallfromguests.Thedefaultisyes. Autocreatepeer=yes|no ;Ifitissettoyes,everyonecaneasilyloginasapeerwithoutapassword, itisusuallybeneficialfor operatingwithSER.Thedefaultisno. autodomain=yes|no ;Enable/disabletheabilityofAsterisktoaddlocalhostnamesand localIPaddresstodomainlist.The defaultisno. bindaddr=IP_Address ;IPAddressboundasaplaceforlisteningtoconnection.Thedefaultis0.0.0.0(anyinterface). bindport=Number ;TheUDPportinbindforlisteningtoincomingconnections.Thedefaultis5060. callerid=<string> ;CallerIDinformationthatwillbeusedifthereisnootherinformation.Thedefaultisasterisk. canreinvite=update|yes|no ;Thedefaultisyes. checkmwi=Number ;Theintervalinsecondstocheckthemailbox.Thedefaultis10seconds. compactheaders=yes|no ;whetherAsteriskwillsendaSIPheaderincompactorcompleteform.Thedefaultisno. context=<contextname> VoIPCookbook:132
;Thisisthedefaultcontextthatwillbeusedfortelephonesthatdonothavecontext. Thecontentofthecontextcanbesetinextensions.conf. defaultexpirey=Number ;Thedefaultlengthoftime(inseconds)ofanincomingoroutgoingregistration. Thedefault120seconds. dtmfmode=inband|info|rfc2833(globalsetting) ;Thedefaultisrfc2833. domain=domains ;listofdomainsseparatedbycomma,alistforwhichAsteriskisresponsible. dumphistory=yes|no ;EnablessupportfordumpingSIPtransactionsinLOG_DEBUG.Thedefaultisno. externip=IP_Addressorhostnames ;TheaddresswewillplaceintheSIPmessagesifwearebehindNAT. Ifthehostnameisused,thentheIPaddressassociatedwiththehostnamewillbereadonce atthetimeofreadingsip.conf.IfwewanttousethehostnameofthedynamicIP, useexternhostparameters. externhost=hostname.tld externrefresh=Number ;determineshowoften(inseconds)DNScheckingiscarriedoutfor'externhost'. Thedefaultis10seconds. ignoreregexpire=yes|no ;setswhetherContactinformationfromapeerisstillusedeventheinformationhasexpired. Thedefaultisno. language=<string> ;ThedefaultlanguageusedbyPlayback()/Background(). localnet=NetAddress/Netmask ;Localnetworkandmask. fromdomain=<domain> VoIPCookbook:133
;SetdefaultFrom:domaininSIPmessageatthetimeitoperatesasaSIPua(client) insecure=very|yes|no|invite|port ;Sethowtohandleconnectionswithpeers.Thedefaultisno(authenticateallconnections). maxexpirey=Number :Lengthoftime(inseconds)ofincomingregistration.Thedefaultis3600seconds. musicclass=oneofclassesthatisusedinmusiconhold.conf musdiconhold=similartomusicclass nat=yes|no|never|route ;Thedefaultisno,whichmeansthatrfc3581techniqueisused. notifymimetype=mediatype/subtype ;AllowstooverridemimetypeinMWINOTIFYusedinvoicemailonlinemessage. Thedafaultis application/simplemessagesummary. notifyringing=yes|no ;Callnotificationisincludedinringingstage.Thedefaultisyes. outboundproxy=IP_address/DNSSRVname(excluding_sip._udpprefix) ;SRVname,hostname,orIPaddressoftheoutboundSIPProxy. outboundproxyport=Number ;UDPportnumberforOutboundSIPProxy. pedantic=yes|no ;enableaslowprocesstocheckCallID,SIPheaderwithmanylines, andtheURIencodedheaders.The defaultisno. port=<portno> ;ThedefaultportforSIPpeer.ThisportisnottheportofAsteriskforlisteningto incomingcalls(seebindport). progressinband=never|no|yes ;whetherweshouldgenerateinbandringing.Thedefaultisnever.
VoIPCookbook:134
promiscredir=yes|no ;Allowssupportfor302Redirects;(Note:itwillredirectalltolocalextensionavailable incontact,nottoextensiononthefinaldestination). Thedefaultisno. qualify=yes|no|milliseconds ;Checkwhethertheclientcanbecontacted.Ifsettoyes,thenthecheckingwillbecarried outevery2000milliseconds(2seconds). Thedefaultisno. realm=myrealm ;Changeauthenticationrealmfortheasterisk(default)towhatwewant. recordhistory=yes|no. ;EnableloggingofSIPtransactions. Thedefaultisno. regcontext=context ;DefaultcontextusedtorespondtotheSIPREGISTERofSIPRegistrar. register=><username>:<password>:[authid]@<sipclient/peeridinsip.conf>/<contact> ;RegistertoSIPprovider registerattempts=Number ;thenumberofSIPREGISTERmessagesenttotheSIPRegistrarbeforegivingup. Thedefaultis0(nolimit). registertimeout=Number ;ThenumberofsecondsallocatedtowaitforrespondsfromtheSIPRegistrarbeforetheSIP REGISTER'stimeisup. Thedefaultis20seconds. relaxdtmf=yes|no ;Thedefaultisno. rtautoclear=yes|no|number ;AutoExpirefriendsmadewhileoperating.Ifitissettoyes, autoexpirewilltakeplacein120seconds. Thedefaultisyes. VoIPCookbook:135
rtcachefriends=yes|no ;Cacherealtimefriendsbyaddingthemtotheinternallistlikefriends. Thisisaddedtotheconfigfile. Defaultisno. rtpholdtimeout=Number ;Lengthoftimeinsecondsduringwhichthereisnoactivitybeforedisconnecting acallonhold. Default is0(nolimit). rtpkeepalive=Number ;NumberofsecondsoftheintervalforRTPkeepalivepacketifthereisnopassingtraffic. Defaultis0 (noRTPkeepalive). rtptimeout=Number ;NumberofsecondsforwaitingforRTPtrafficbeforewehungup. Defaultis0(noRTPtimeout). rtupdate=yes|no ;SendregistryupdatestothedatabasewhenusingRealtimesupport.Thedefaultisyes. sendrpid=yes|no ;whethertheSIPheaderRemotePartyIDSIPshouldbesent. Thedefaultisno. sipdebug=yes|no. ThedefaultsettingthatdetermineswhethertheSIPdebugisenabledwhenloadingsip.conf. Thedefault isno. srvlookup=yes|no ;EnableDNSSRVcheckswhencalledupon.Thedefaultisno. tos=<value> ;SetQoSofIPparametersforoutgoingmediastreams (numericvaluesareacceptable,suchastos= 184) trustrpid=yes|no ;whethertheSIPheaderRemotePartyIDSIPcanbetrusted.Thedefaultisno. VoIPCookbook:136
useclientcode=yes|no: usereqphone=yes|no ;Indicateswhetherweneedtoadd";user=phone"toURI.Thedefaultisno. useragent=<string> ;ChangestheSIPheader"UserAgent".Thedefaultisasterisk. videosupport=yes|no ;EnablessupportforSIPvideo.Thedefaultisno. vmexten=<string> ;Dialplanextensiontocallmailbox.Thedefaultisasterisk.ConfiguringSIPpeerandclient Thefollowingvariablescanbeusedineverypeerdefinition accountcode=<string> ;theuserswhocanbeassociatedtoaccountcode.Itisrecommended thatyoureadtheconceptonAsteriskbilling. allow=<codec> ;theCODECwhichisallowedbasedonorderpreferences. Usefirstdisallow=ALLbeforeallowing CODEC. disallow=all ;DisallowalltheCODECstoagivenpeeroruserdefinition. allowguest=yes|no ;Alloworrejectcallsfromunknownperson. Thedefaultisyes.OSPcanalsobesetifAsteriskiscompiledtosupportOSP. auth=<authname> ;ThecontentoftheDigestusername=onaSIPheader. callerid=<string> ;ThecallerIDinuseifnoinformationisavailable.Thedefaultisasterisk. calllimit=number VoIPCookbook:137
;Thenumberofsimultaneoustelephoneconnectionsthatcanbemadetoaspecificuse/peer. callgroup=num1,num2num3 ;Definesacallgroupthatcancallthistool. callingpres=number|descriptive_text ;SetappearanceofCallerIDofaconnection/call. Descriptivetextvaluesthatcanbefilledinareallowed_not_screened, allowed_passed_screen,allowed_failed_screen,allowed,prohib_not_screened, prohib_passed_screen,prohib_failed_screen,prohib,andunavailable. ThedefaultisAllowed_not_screened. canreinvite=update|yes|no ;whethertheclientisabletosupportSIPreinvites.Thedefaultisyes. context=<context_name> ;Iftype=user,contextisforthecallgoingtotheSIPuserdefinition. Iftype=peer,contextinthe dialplanisforoutboundcallofaSIPpeerdefinition. Iftype=friend,contextisusedforallinboundandoutboundconnectionsto theSIPentitydefinition. defaultip=ip.add.res.s ;ThedefaultIPaddressfortheclienthost=ifnotspecifiedasDYNAMIC. Thisisusediftheclienthad neverbeenregisteredtousedifferentIPaddress. Onlyvalidifthetype=peer. dtmfmode=inband|info|rfc2833 ;HowtheclienthandlesDTMFsignal.Defaultisrfc2833. fromuser=<from_ID> ;Determinestheusertobeputin"from"otherthanthecallerid(overridecallerid) whenconductingcalls_to_peer(toanotherSIPproxy).Validonlyfortype=peer. fromdomain=<domain> ;SetdefaultFrom:domaininSIPmessagewhenconductingcalls_to_peer. Validonlyinthe[general] ortype=peersection. fullcontact=<sip:uri_contact> ;SIPURIcontactforrealtimepeer.Validonlyforrealtimepeers. VoIPCookbook:138
host=dynamic|hostname|IPAddr ;ClientIPaddressorhostname.Ifyouwantthephonetoregisteritself, usedynamickeywordsinstead ofhostIP. incominglimitandoutgoinglimit=Number ;Limitationofthenumberofsimultaneousactivecallsthatcanbeperformedby aSIPclient.Validonly fortype=peer. insecure=very|yes|no|invite|port ;Determineshowtodealwithpeerconnection. Thedefaultisno(authenticationforallconnections). ipaddr=ip.addr.from.peer ;Validonlyforrealtimepeer. language=languagecodeasdefinedinindications.conf ;Definingalanguageforgreetings mailbox=mailbox ;ExtensionforVoicemail.Validonlyfortype=peer. md5secret=MD5Hashof"<user>:asterisk:<secret>" ;Canbeusedasasubstitutetosecret. Musicclass=determinesoneofclasseswritteninmusiconhold.conf name=<name> ;Thenameoftherealtimepeer.Validonlyforrealtimepeeronly. nat=yes|no ;ThisvariabledeterminestheactionpatternofAsteriskforclientsbehindtheNAT. Butitstilldoesnot solvetheproblemifAsteriskisbehindNAT. Thedefaultisno,whichmeansusingtheRFC3581 technique. outboundproxy=IP_addressorDNSSRVname ;SRVname,hostname,orIPaddressoftheoutboundSIPProxy. Validonlyinthe[general]andtype= peersection.
VoIPCookbook:139
seconds).
regseconds=seconds ;TimeinsecondsbetweenSIPREGISTERS.Validonlyforrealtimepeeronly. rtpkeepalive=seconds ;Thetime,inseconds,ofsendingRTPkeepalivepacketifthereis noRTPtrafficontheconnection. Default0(noRTPkeepalive). Validonlyforthe[general]andtype=peersection. rtptimeout=seconds ;DisconnectaconnectionifwithinxsecondsthereisnoRTPactivityand wearenotinonholdposition. Validonlyinthe[general]andtype=peersection. rtpholdtimeout=seconds ;DisconnectaconnectionifwithinxsecondsthereisnoRTPactivityand weareinonholdposition. Validonlyforthesection[general]andtype=peer. secret=password ;IfAsteriskfunctionsasaSIPServer,thenSIPclientmustloginusing"password". IfAsteriskfunctionsasaSIPclienttoaremoteSIPserver, itrequiresSIPINVITEauthentication,thenthecontentsofsecret isused forSIPINVITEauthenticationthatissentbyAsterisktotheremoteserver. sendrpid=yes|no ;whetherRemotePartyIDSIPheadershouldbesent.Defaultisno. setvar=variable=value VoIPCookbook:140
;Variablechannelwhichshouldbesetforallconnectionstothispeer/user. subscribecontext=<context_name> ;SetaspecificcontextforSIPSUBSCRIBErequests trustrpid=yes|no ;whetherRemotePartyIDSIPheadercanbetrusted.Thedefaultisno. type=user|peer|friend ;connectiontotheclient,outboundproviderorafullclient? usereqphone=yes|no ;Showingwhethertoadd";user=phone"totheURI.Defaultno. Validonlyforthe[general]and type=peersection. username=<username[@realm]> ;IffunctioningasaSIPclienttoaremoteSIPserverthatrequires SIPINVITEauthentication,thenthisparameterisusedforSIPINVITEauthentication, whichissentbyAsterisktoaremoteSIPserver;forpeerswhowillregistertoAsterisk, theusernameisusedinINVITEuntiltheyareregistered. vmexten=<string> ;Dialplanextensiontoreachmailbox.Defaultasterisk. Onlyvalidinthe[general]ortype=peersection.
Therearethree(3)mainconfigurationfiles,namely, /etc/dahdi/system.conf /etc/asterisk/chan_dahdi.conf /etc/asterisk/dahdichannels.conf In/etc/dahdi/system.conf,unlikezaptel.conf,youhavetoexplicitlysettheechocancellerforeach channel. Thereareanumberofotherconfigurationfilesunder/etc/dahdi /etc/dahdi/init.conf Replaces/etc/default/zaptel(onDebians)and/etc/sysconfig/zaptel(onmostothersystems) thisisashellscriptsnippetthatissourcedbythedahdiinit.dscript.Allvaluesthereare optional(noneedtoexplicitlydefineTELEPHONY=no).ThevariableMODULES,however,is nolongerreadfromit.ITisreadfrom: /etc/dahdi/modules Alistofmodulestoload.ReplacesthevariableMODULESfromtheaboveconfigurationfile. /etc/dahdi/genconf_parameters Finetuningparametersfordahdi_genconf(replaceszapconfandalsodeprecates genzaptelconf).
DAHDIArchitecture
Thepackageiscomposedoftwosubpackages: Kernel Includekernelmodulesandminilahelperfiles(firmwares) Tools TheuserspacetoolstocontrolDAHDIspans/channels: dahdi_cfg TheDAHDIConfigurator,whichparsessystem.conf dahdi_genconf VoIPCookbook:142
Generates/etc/dahdi/system.conf,soit'sbetterthatyoudon'thandeditsystem.conf.Uses /etc/dahdi/genconf_parameterstodefineit'sactions. dahdi_hardware DisplayslistingofDAHDIhardwaredetected dahdi_monitor Monitorssignallevelonanalogchannelallowsyoutorecordaudiofromit Usage:dahdi_monitor<channelnum>vmopllimitfFILEsFILErFILE1tFILE2F FILESFILERFILE1TFILE2 example:dahdi_monitor1vv note:extremlyusefull,butotherwisenotmentioned,thattherawformatoutputis8Khz16bit signed.Usesoxtoconverttoawav.soxr8000swrx.rawrx.wav dahdi_scan GeneratesalistofthingsDAHDIchannels,withsomedetails dahdi_test MeasuresaccuracyoftheFXO/FXSboardsoftwaredigitalsignalprocessing dahdi_tool Anicetooltoseewhatyourboardsaredoing.
DAHDISampleinstallation
Aftercompilingandinstallingofdahdiandasterisk,youhavetoperformsomefurtherstepstouseyour hardware.ThisexamplewillshowyouafewstepshowtogetasteriskandtwoDigiumcardsenabled:
VoIPCookbook:143
Checkthechanneltype /etc/init.d/dahdirestart dahdi_scan Wewillseesomethinglike active=yes alarms=OK description=WildcardTDM410PBoard1 name=WCTDM/0 manufacturer=Digium devicetype=WildcardTDM410P location=PCIBus03Slot03 basechan=1 totchans=4 irq=23 type=analog port=1,FXO port=2,FXO port=3,FXS port=4,FXS
VoIPCookbook:144
Restartdahditounloadandreloadallmodulesanddrivers #/etc/init.d/dahdirestart
Pointfile/etc/asterisk/chan_dahdi.confto/etc/asterisk/dahdichannels.conf #openchan_dahdi.confandincludeitunderthesection[channels] # #NOTE:Youcaneditandconfigure/etc/asterisk/dahdichannels.confatanytime #tosetupyourspecificoptionsthere. ... [channels] #include/etc/asterisk/dahdichannels.conf ... In/etc/asterisk/dahdichannels.confwewillseesomethinglike signalling=fxs_ks callerid=asreceived group=0 context=frompstn VoIPCookbook:145
channel=>1 callerid= group= context=default signalling=fxo_ks callerid="Channel3"<4003> mailbox=4003 group=5 context=frominternal channel=>3 callerid= mailbox= group= context=default
Restartasterisk #/etc/init.d/asteriskrestart
Verifyyourcurrentsystemstatus.Youshouldgetsomeoutputlikethis:
asteriskr asterisk*CLI>dahdishowstatus DescriptionAlarmsIRQbpviolCRC4FraCodiOptionsLBO DAHDI_DUMMY/1(source:HRtimer)1UNCONFI000CASUnkYEL0db(CSU)/0133feet(DSX1) WildcardTDM410PBoard1OK800CASUnkYEL0db(CSU)/0133feet(DSX1)
Verifyyourconfiguredchannels
asterisk*CLI>dahdishowchannels ChanExtensionContextLanguageMOHInterpretBlockedState pseudodefaultdefaultInService 1frompstndefaultInService 2frompstndefaultInService 3frominternaldefaultInService 4frominternaldefaultInService
DAHDI extensions.conf
AnexampleofDAHDIdialplanisasfollows. [frominternal] VoIPCookbook:146
exten=>1000,1,Dial(DAHDI/1,20,rt) exten=>1000,2,Voicemail(1000,u) exten=>1000,102,Voicemail(1000,b) exten=>2000,1,Dial(DAHDI/2,20,rt) exten=>2000,2,Voicemail(2000,u) exten=>2000,102,Voicemail(2000,b) exten=>8500,1,VoiceMailMain exten=>8501,1,MusicOnHold exten=>1001,1,Dial(DAHDI/3,20,rt) exten=>1001,2,Voicemail(1000,u) exten=>1001,102,Voicemail(1000,b) exten=>1002,1,Dial(DAHDI/4,20,rt) exten=>1002,2,Voicemail(2000,u) exten=>1002,102,Voicemail(2000,b) exten=>_9.,1,Dial(DAHDI/g0/www${EXTEN:1}) exten=>_9.,2,Congestion exten=>_91.,1,Dial(DAHDI/1/www${EXTEN:2}) exten=>_91.,2,Congestion exten=>_92.,1,Dial(DAHDI/2/www${EXTEN:2}) exten=>_92.,2,Congestion [frompstn] exten=>s,1,Answer exten=>s,2,Dial(DAHDI/g1,20,rt) exten=>s,3,Voicemail(1000,u) exten=>s,103,Voicemail(1000,b) Wehavetomakesureacoupleofthings: [frominternal]and[frompstn]shouldbereflectedin/etc/asterisk/dahdichannels.conf [frominternal]and[frompstn]mustexistsin/etc/asterisk/extensions.conf. Ifunsure,replace[frominternal]and[frompstn]withdefault. MakesureDAHDI/1,DAHDI/2,DAHDI/3,DAHDI/4,DAHDI/g1etcarecorrectasreflectedin /etc/asterisk/dahdichannes.conf
VoIPCookbook:147
VoIPCookbook:148
Defaultconsolelogin(SSHport22): Username :support Password :Briker Defaultweblogin(HTTPport80): Username :administrator Password :Briker defaultIPaddress: IPaddress :192.168.2.2 Subnetmask :255.255.255.0
Figure 7.2: Briker checks whether there's a CD-ROM Briker automatically checks the hardware components installed and finding the installer CD-ROM.
VoIPCookbook:149
VoIPCookbook:150
VoIPCookbook:151
Figure7.5:Installingrequiredsoftware TheBrikerautomaticallyinstallsthebasesystemandothersoftwarerequired.
VoIPCookbook:152
VoIPCookbook:153
Briker's Console
Figure 7.7: With the installation completed, you will be able to begin the configuration process
Afterinstallingthesoftware,wecanbeginconfiguringthroughtheconsole,bychangingtheIP address,dateetc.Allcommandsfortheloginconsolecanbecarriedoutonlyafteryouauthenticate yourselfasarootuser.Thecommandsforconfigurationthroughtheconsolewillnotworkunlessyou enterthefollowingentries: $sudosu Thepasswordyouhavetoenteristheonesimilartothatofusersupport(defaultpassword).For securityreason,youshouldchangethedefaultpasswordbydoingthefollowing: #passwd ThedefaultIPaddressoftheBrikeris192.168.2.2.ChangethisaddresssothatBrikerwillbeableto adjustanynetworktopologyandobtainIPaddressallocation,byfirstofalleditingfile /etc/network/interfaces: #vi/etc/network/interfaces
VoIPCookbook:154
Figure 7.8: The default IP address of Briker The above figure shows that the IP address is 192.168.2.2. Make necessary changes and save the configuration by pressing F2 and exit the editing platform by pressing F10. Then restart the networking services to activate the configuration, by executing the following syntax: # /etc/init.d/networking restart
Next we have to make sure that the date and time of the Briker are set properly.Check them by typing the
following syntax: # date If they are not set properly, then adjust them. For example, if we want to set the time to 08.00 and date to July 1, 2008, then the syntax would be: # date -s "2008-07-01 08:00:00" Setting the date and time properly is particularly important if you are using Briker for commercial use.
VoIPCookbook:155
Figure7.10:Preferencessettings
VoIPCookbook:156
VoIPCookbook:157
Figure7.12:menutoconfigureIPPBXfeaturesisavailableinBriker,someofwhichare extensions,trunksandroutesconfiguration. IPPBXstatusindicatesSystemStatisticsshowingthepercentageofLoadAverage,CPU,Memoryand Swapbeingused,theusageofharddiskspaceandthespeedofReceiveandTransmitEthernet.Also availabeinthisdisplayisIPPBXStatisticsshowingTotalActiveCalls,InternalCalls,ExternalCalls, TotalActiveChannels,andUptimeBriker.Thesedataarerealtime,updatedperiodicallyand automatically,aprocessthatconsumesaconsiderableamountofCPUresources.Soitisrecommended thatyoudonotkeepaccessingthismainpage. Whenyouarefamiliarwiththemaindisplay,itistimeforyoutoaddExtension,userwhowilluse Brikerservices.ClickExtensiononIPPBXAdministrationmenu.Throughthisoption,youwillbe abletoaddnewaccount,omitorreplaceanyexistingone. ClickAddExtensions.Thenchoosethesortofprotocolsusedbytheaccount:SIP,IAX2,ZAP,or Custom(protocolotherthanthefirstthree).Withanyoftheseprotocolselected,clicksubmit(shownin Figure7.13).
VoIPCookbook:158
Zaptel Configuration
Zaptelisacollectionoftoolsanddriversdetectinghardwareintheformofanaloganddigitaltelephony cardinstalledonPCIorminiPCIslot.ThetelephonycardisusedtoconnectthebrikertoPlainOld TelephonySystem(POTS)networkortoanalogtelephone. Forexample,connectingthebrikertoanalogPBXrequiresanalogtelephonycard.Sodoesthebriker whenitisconnectedtoPublicSwitchTelephoneNetwork(PSTN),connectedthroughatelephonecable providedbytelecommunicationoperator.Theanalogordigitalcardtobeused,however,dependson thetypeoftechnologybeingusedbytheoperator.
VoIPCookbook:159
ToconfigureZaptel,firstofall,loginthroughtheconsole.Asthisinstallationrequiresrootprivileges, loginasarootbyexecutingthefollowingcommands: $sudosu Thenrungenzaptelconfcommand #genzaptelconf Tocheckwhetherzaptelhassuccessfullydetectedwhatitislookingfor,docheckingbyexecutingthe followingcommand: #ztcfgvvv Thenrestartzaptel,byexecutingthefollowingcommand: #/etc/init.d/zaptelrestart
SIP Trunk
VoIPCookbook:160
Figure7.15:AddingaTrunk InIPPBXAdministrationmenu,chooseTrunksmenu,chooseAddSIPTrunk.
Figure7.16:ThegeneralsettingsofAddSIPTrunk
VoIPCookbook:162
IAX2 Trunk
GotoTrunkmenu,asifyouliketoconfiguretheAIX2Trunk.ChooseAddIAX2.
Figure7.19:ThegeneralsettingsofAddIAX2Trunk
Figure7.20:ThegeneralsettingsofAddIAX2Trunk
VoIPCookbook:163
Figure7.21:ThegeneralsettingsofAddIAX2Trunk ForIAX2Trunk,makethesameconfigurationasshowninFigure7.19,7.20,and7.21.
VoIPCookbook:164
H323 Trunk
GototheTrunksmenuinIPPBXAdministrationmenu.
VoIPCookbook:165
ThenchooseAddCustomTrunk.
Figure7.23:Thegeneralsettings ofAddCustomTrunk
ForcustomizedTrunk,fillintheCustomDialStringbyusingtheformatH323/<h323gateway address>/$OUTNUM$.AsshowninFigure5.23,thegatewayaddressofH323is119.18.159.20.Then clickSubmitChanges. Openaterminalconsole,theneditthe/etc/asterisk/h323.conffile: #mcedit/etc/asterisk/h323.conf Editthefollowingoptionsavailableinthe/etc/asterisk/h323.conffile: Port=1720 bindaddr=<IPBrikeraddress> Thenrestartasterisk,byexecutingthefollowingcommand: #/etc/init.d/amportalrestart
VoIPCookbook:166
ZAP Trunk
ThistypeofTrunkisconnectedtoPSTNline,throughanalogcard(TDMxxx)ordigitalcard(TExxx). Afterdoingthezaptelconfiguration,dotheconfigurationinIPPBX,byfirstofallloggingintoIPPBX Administration.
ChooseTrunksmenuandchooseAddZapTrunk.Amenufortrunkconfigurationshouldappearas showninFigure7.25.
Figure7.25:GeneralsettingsofAdd ZapTrunk
VoIPCookbook:167
Outbound Routes
Outboundroutesareusedtomanagewherethecallshouldgoto,theonegoingoutthroughthetrunk.It istheseOutboundroutesthatdefinealltheoutgoingcalls.Forexample,forconnectingtoPSTN,Briker usesprefix9,whichisfollowedbythedestinationnumber.Thefollowingisanexampleofits configuration.
VoIPCookbook:168
VoIPCookbook:169
Inbound Routes
InboundRoutesfunctionstomanagethedestinationofthecallcomingfromthetrunk.Whenacall comesfromthetrunk,thesystemwillcheckwhetherthecallisincompliantwiththeInboundRoutes configuration.Ifitis,thenthecallwillbeforwardedtoitsdestinationaccordingtotheconfiguration. InIPPBXAdministrationmenu,chooseInboundRoutes.ThenchooseAddIncomingRoute.
ThenclickSubmit
VoIPCookbook:170
Setup Recordings
MakearecordforIVRthatyouwilluse(youcanusetheMS.Recorderapplication).Forexample,you canrecordWelcometoPTJelajahMediaInformation,press1foroperator,andsettheencodeto16 bit,8,000Hz,andsaveitusingthe.wavextension(i.e.Welcomejmi.wav).Uploadthe.wavfileyou havejustcreatedtothemenu:IPPBXAdministration>SystemRecordings,uploadandnamethefile, forexample,welcomejmi,andsaveit. IVRSetup InIPPBXAdministrationmenu,chooseIVR.ThenchooseAddIVR.
Figure7.30:IVRSettings VoIPCookbook:171
Filltheparameterswiththefollowingdata: ChangeName:WelcomeJMI Timeout:10 EnableDirectory:no/unchecked DirectoryContext:default/empty EnableDirectDial:yes/check Announcement:WelcomeJMI(recording) OptionsavailableintheFigure7.30implythatauserwhocalltheIVRcouldpress1andbeforwarded toOptionJMIEnglish,providedthattheIVROptionJMIEnglishisactivated.Oncethedataand optionsareconfigured,clickSaveandchooseApplyconfigurationchanges.
Ring Groups
RingGroupisoneofmanyfeaturesusedtomanagegroupcall.Forexample,inacompanywith5 telephoneoperators/agents,thefiveoperatorscanbeincludedasagroup,whichisnamed,forexample, 'operatorhelp.'Wheneverthereisanincomingcall,thecallwillbedirectedtotheRingGroup'operator help.'Whenthefirstoperatorisbusy,thecallwillbeforwardedtothesecondoperatorandsoon.The followingistheRingGroupconfigurationinthebriker. ChooseRingGroupsinIPPBXAdministrationmenu.ThenchooseAddRingGroups
VoIPCookbook:172
Figure7.31:RingGroupssettings Usethefollowingconfiguration
UsethesettingsshowninFigure7.31.Thesettingsimpliesthatifagroupoperatordoesnotrespond, thenthecallerwillbedirectedtoIVR'WelcomeJMI.'
Pin Sets
PinSetsfunctionsassystemauthentication,afeatureactivatedwhenauserdoeshisorhercallthrough thetrunkandenteredthepasswordrequired. ChoosePinSetsinIPPBXAdministrationmenu,thenchooseAddPasswordSet.
VoIPCookbook:174
Compile OpenSIPS
Preparethesupportingsoftware.InUbuntu9.10andUbuntu10.04,itcanbepreparedbyusingthe followingcommand. #aptgetinstallflexbisongccmakelibperl5.10libperldevlibxmlrpcc3libxmlrpcc3dev\ unixodbcunixodbcdevlibradiusclientng2libradiusclientngdevlibxml2openssllibsctp1\ libsctpdevlibexpat1libexpat1devlibldap2.42libldap2devlibsnmp15libsnmpdev\ libconfuse0libconfusedevlibmysqlclient16libmysqlclientdevmysqlclient5.1mysqlserver\ zlib1gzlib1gdevlibmysql++3libmysql++devlibpcre3libpcre3dbglibpcre3dev InUbuntu10.10,itcanbedoneasfollows #aptgetinstallflexbisongccmakelibperl5.10libperldevlibxmlrpcc3libxmlrpcc3dev\ unixodbcunixodbcdevlibradiusclientng2libradiusclientngdevlibxml2openssllibsctp1\ libsctpdevlibexpat1libexpat1devlibldap2.42libldap2devlibsnmp15libsnmpdev\ libconfuse0libconfusedevlibmysqlclientdevmysqlclient5.1mysqlserverzlib1gzlib1gdev\ libmysql++3libmysql++devlibpcre3libpcre3dbglibpcre3dev GetsourcecodeofOpenSIPS,suchas,opensipsXXXtls_src.tar.gz,from http://opensips.org/pub/opensips/ http://www.opensips.org/index.php?n=Resources.Downloads#osippub http://www.opensips.org/index.php?n=Resources.Downloads#osipsf VoIPCookbook:175
IfwewouldliketouseopensipswithTLS,weneedtodothefollowings. $sudosu #cpopensips1.6.42tls_src.tar.gz/usr/local/src/ #cd/usr/local/src/ #tarzxvfopensips1.6.42tls_src.tar.gz #cdopensips1.6.42tls Compileandinstallthefollowingmodules,i.e.,"acc","mysql","textops","sl","db_mysql"and"enum" usingthefollowingcommand, #cdopensips1.6.42tls #makeall&&makeinclude_modules="accmysqltextopsslenumdb_mysql"modules #makeinstall Itseems,weneedtocopysomescriptsto/usr/local/src/opensips/opensipsctl #cpRf/usr/local/src/opensips1.6.42tls/scripts/*/usr/local/lib/opensips/opensipsctl That'sit.OpenSIPSiscompiledandinstallandreadytouse.OpenSIPSconfigurationfileislocatedat /usr/local/etc/opensips Checkforanyproblemintheconfigurationfilecanbedoneusingthefollowingcommand, #opensipscf/usr/local/etc/opensips/opensips.cfg ToRunopensips,putin/etc/rc.local opensipsf/usr/local/etc/opensips/opensips.cfg Pleasenoteweremovecswitch
andmakesureitworksusingthefollowingcommand, #aptgetinstallmysqlserverlibmysqlclientdevmysqlclient5.0 #/etc/init.d/mysqlrestart Tosetupthedatabaseserver,weneedtoedit/usr/local/etc/opensips/opensipsctlrcor /etc/opensips/opensipsctlrc,suchas, or #vi/usr/local/etc/opensips/opensipsctlrc vi/etc/opensips/opensipsctlrc Makesure, DBENGINE=MYSQL DBHOST=localhost DBNAME=opensips DBRWUSER=opensips DBRWPW="opensipsrw" DBROUSER=opensipsro DBROPW=opensipsro DBROOTUSER="root" Copyscriptsto/usr/local/lib/opensips/opensipsctl #cpRf/usr/local/src/opensips1.6.42tls/scripts/*/usr/local/lib/opensips/opensipsctl/ Initializedtheuserdatabaseusingopensipsdbctlcommandasfollow, #cd/usr/local/lib/opensips/opensipsctl #opensipsdbctlcreate Followthefollowingcommad MySQLpasswordforroot:<enterMySQLrootpassword> INFO:testservercharset INFO:creatingdatabaseopensips... INFO:CoreOpenSIPStablessuccesfullycreated.
VoIPCookbook:177
Use opensipsctl
OpensipsctlisausefulltoolprovidedbyOpenSIPS,thatcanbeusedfor,
VoIPCookbook:178
HowtoroutetoPSTNandCellular
Basically,weneedanAnalogTelephoneAdapter(ATA)tointerconnectaVoIPnetworktoPSTNor Cellularnetwork.Inthisexample,weassume
HowtorouteusingAreaCodeforinterconnectedSIPServers
ForexamplewehaveseveralSIPServersinournetwork,suchas, AreaCode SIPServerIPAddress
021 203.159.31.99 022 203.159.31.123 023 203.159.31.48 ThedialplanforOpenSIPSwouldbesomethinglike, if(uri=~"^sip:021[09]*@*"){ strip(3); rewritehostport("203.159.31.99:5060"); route(1); }; if(uri=~"^sip:022[09]*@*"){ strip(3); rewritehostport("203.159.31.123:5060"); route(1); }; if(uri=~"^sip:023[09]*@*"){ strip(3); VoIPCookbook:180
rewritehostport("203.159.31.48:5060"); route(1); };
HowtorouteENUMQueryinOpenSIPS
StepstorouteENUMqueryinOpenSIPSisasfollows,
PrepareENUMmodulinOpenSIPSconfiguration CreateroutingtableforENUM
ENUMqueryinOpenSIPSisbasicallytransformtheURIaddressfromENUMtoURISIP.Call processisnormallydoneusingtheURISIP. TopreparetheENUMmoduleinOpenSIPSconfiguration,weneedtoedit /usr/local/etc/opensips/opensips.cfgor/etc/opensips/opensips.cfg #vi/usr/local/etc/opensips/opensips.cfg Enterthefollowingcommand loadmodule"enum.so" modparam("enum","domain_suffix","e164.arpa.") modparam("enum","i_enum_suffix","e164.arpa.") Wecanchangee164.arpatootherENUMtopleveldomain,suchas,e164.idore164.th.
TestENUMQueryinOpenSIP
Assuming:
VoIPCookbook:181
Testtestroutingtablewouldbe rewriteuri("sip:62555666666600@192.168.0.2"); prefix("+"); enum_query("e164.id."); route(1); route[1]{ #senditoutnow;usestatefulforwardingasitworksreliably #evenforUDP2TCP if(!t_relay()){ sl_reply_error(); }; exit; }
ENUMRoutingTableinOpenSIPSconfiguration
Theshortversion if(uri=~"^sip:00[19][09]*@*"){ strip(2); prefix("+"); }; if(uri=~"sip:\+[09]+@*") enum_query("e164.id."); TheaboveexamplewillallowallclientfromallservertoaccessourENUMqueryrouting.Amore completeversionofENUMquerymaybeasfollows, #Somewhereintheroute[x]section: #ifyouwanttomakeENUMworkwithnumbersstartingwith"00", #usethefollowingtoconvert"00"itintoa"+" if(uri=~"^sip:00[19][09]*@example\.net"){ VoIPCookbook:182
#stripleading"00" #(changeexample.nettoyourdomainnameorskipthestuffafterthe"@") strip(2); #(adjust,ifyourinternationalprefixissomethingelsethan"00") prefix("+"); }; #checkifrequesturistartswithaninternationalphone #number(+X.),ifyes,trytoENUMresolveine164.arpa. #ifnoresult,tryinnrenum.net if(uri=~"sip:\+[09]+@example\.net"){ #(changeexample.nettoyourdomainnameorskipthestuffafterthe"@") if(!enum_query("e164.arpa.")){ enum_query("nrenum.net."); }; }; Anotheralternativethatmaybeextendedisasfollows, #isthisanENUMdestination(leading+?) if(method=="INVITE"&&uri=~"sip:\+[09]+atiptel\.org"){ if(!enum_query("voice"))#ifparameterempty,itdefaultsto"e2u+sip" enum_query("");#E2U+sip } Yetanotheralternativethatcanbetried/expandedisasfollows, if(is_from_user_enum()){ enum_query(""); }
VoIPCookbook:183
CHAPTER 9: ENUM
ENUMisbasicallyamappingmechanismtomapTelconumber,suchas,+628113334567or +62555334567,toanumberrecognizeinVoIPnetworksuchas,20333@voiprakyat.or.idor 5007987@fwd.pulver.com.Thus,inprinciple,ENUMismerelyatable. ENUMisnotlimitedtomappingonly.ENUMrecognizeprioritizing.Forexample,aphonenumber +6255534567mayhaveseveralclientwithpriority,suchas, +6255534567 +6255534567 +6255534567 +6255534567 +6255534567 priority1 priority2 priority3 priority4 priority5 245678@voiprakyat.or.id 6543686@fwd.pulver.com +62215678976(nomorkantor) +62856789654(nomorhandphone) mail:oknum@salemba.co.id
PleasenotethattheENUMnumberisreversedasopposetotheknownnormalphonenumber.
VoIPCookbook:184
TounderstandhowENUMworks,oneneedstounderstandhowaDomainNameSystem(DNS)works asENUMusesDNSServer.Thus,ENUMworksfairlysimilartoDNSbuttomapandtodelegatea phonenumber.PleasenotethatENUMisdifferentfromaSIPServer. ImagineatnationallevelthereisanallocationofareacodeforSIPnetworkon+62555.Itcanbe mappedtoENUMunderthedomain,forexample,5.5.5.2.6.e164.id.ItmayhaveseveralENUMName Server(NS)suchas, ENUMServerDomain5.5.5.2.6.e164.id +62555 ENUMNS 202.123.123.124 +62555 ENUMNS 235.123.123.234 Pleasenotethatatnationallevel,theENUMServermaynothaveacompleteinformationonthe subscribers. Forexample,acommunityoracorporateoratelecomunicationoperator,assigned4444areacodefor itsnetwork,suchthat,itmayuse +6255544440000+6255544449999 basically,itmayallocatephonenumberfor10.000subscribers.Thus,thecommunitymayruntheir ownENUMserverunderthesubdomain4.4.4.4.5.5.5.2.6.e164.id,forexample ENUMServerDomain4.4.4.4.5.5.5.2.6.e164.id +62555444 ENUMNS 212.234.234.234 +62555444 ENUMNS 212.234.234.235 Inthedelegationprocess,theNSinformationofENUM4.4.4.4.5.5.5.2.6.e164.idmustbewrittenin ENUM5.5.5.2.6.e164.idthattells 4.4.4.4.5.5.5.2.6.e164.id 4.4.4.4.5.5.5.2.6.e164.id INNS 212.234.234.234 INNS 212.234.234.235
handle6.6.6.6.6.6.5.5.5.2.6.e164.id,suchas NUMServerDomain6.6.6.6.6.6.5.5.5.2.6.e164.id 62555666666 ENUMNS 212.234.234.4 62555666666 ENUMNS 212.234.234.5 DelegationprocessforNSof6.6.6.6.6.6.5.5.5.2.6.e164.idmustbeenteredintothemainENUMServer for5.5.5.2.6.e164.idttotell 6.6.6.6.6.6.5.5.5.2.6.e164.id INNS 212.234.234.4 6.6.6.6.6.6.5.5.5.2.6.e164.id INNS 212.234.234.5 TheENUMdelegationconceptisclearlyshownthatisnotlimitedtooperator.Anyentitiesmayhave theirveryownphonenumber.Thus,amorecomprehensiveauthenticationprocessmaybeneededto makesurethephonenumberisproperlydelegated.
ENUM Implementation
ENUMServerisprincipallyaDNSServer.Thus,ifonehasaDNSServer,onemayreadilyrunan ENUMServer.ToInstallanENUMSever,oneneedto,
BINDInstallation
InstallBINDasfollows, aptgetinstalldnsutilsbind9
SetupBINDforENUMServer
Forexample,weareassignedfor+625XXXX.Weneedtoedit,
VoIPCookbook:186
/etc/bind/named.conf.local Entryfordomain5.2.6.e164.id zone"5.2.6.e164.id"IN{ typemaster; file"/etc/bind/5.2.6.e164.id.db"; }; Allsubscribernumbersmustbelistedin/etc/bind/5.2.6.e164.id.db.AnexampleoftheDNSfileof /etc/bind/5.2.6.e164.id.dbisasfollows, $TTL86400 @ INSOAns.warnet.co.idadmin.warnet.co.id.( 42;serial(d.adams) 3H;refresh 15M;retry 1W;expiry 1D);minimum INNS ns.warnet.co.id. 0.0.0.2 NAPTR10100"u""E2U+sip""!^.*$!sip:2000@192.168.0.3!". 1.0.0.2 NAPTR10100"u""E2U+sip""!^.*$!sip:2001@192.168.0.3!". 2.0.0.2 NAPTR10100"u""E2U+sip""!^.*$!sip:2002@192.168.0.3!". 3.0.0.2 NAPTR10100"u""E2U+sip""!^.*$!sip:2003@192.168.0.3!". 4.0.0.2 NAPTR10100"u""E2U+sip""!^.*$!sip:2004@192.168.0.3!". 5.0.0.2 NAPTR10100"u""E2U+sip""!^.*$!sip:2005@192.168.0.3!". 0.2.0.2 NAPTR10100"u""E2U+sip""!^.*$!sip:2020@192.168.0.3!". 1.2.0.2 NAPTR10100"u""E2U+sip""!^.*$!sip:2021@192.168.0.3!". 2.2.0.2 NAPTR10100"u""E2U+sip""!^.*$!sip:2022@192.168.0.3!". 0.3.0.2 NAPTR10100"u""E2U+sip""!^.*$!sip:2030@192.168.0.3!". 1.3.0.2 NAPTR10100"u""E2U+sip""!^.*$!sip:2031@192.168.0.3!". 2.3.0.2 NAPTR10100"u""E2U+sip""!^.*$!sip:2032@192.168.0.3!". 3.3.0.2 NAPTR10100"u""E2U+sip""!^.*$!sip:2033@192.168.0.3!". 0.5.0.2 NAPTR10100"u""E2U+sip""!^.*$!sip:2050@192.168.0.3!". 1.5.0.2 NAPTR10100"u""E2U+sip""!^.*$!sip:2051@192.168.0.3!". Forexample,itmeansthemappingnumbersisasfollows, VoIPCookbook:187
Aftertheeditingprocess,pleaserestartheDNSServerusingthecommand #/etc/init.d/bind9restart
TestDNSforENUMQuery
WecanusethedigcommandonthelocalhostoftheDNSservertoquerytheENUMentries,for example, $digNAPTR0.0.0.2.5.2.6.e164.id@127.0.0.1 Theoutputwouldbeapproximately ;<<>>DiG9.6.1P1<<>>NAPTR0.0.0.2.5.2.6.e164.id@127.0.0.1 ;;globaloptions:+cmd ;;Gotanswer: ;;>>HEADER<<opcode:QUERY,status:NOERROR,id:10744 ;;flags:qraardra;QUERY:1,ANSWER:1,AUTHORITY:1,ADDITIONAL:1 ;;QUESTIONSECTION: ;0.0.0.2.5.2.6.e164.id. IN NAPTR NAPTR 10100"u""E2U+sip""!^.*$!
;;ANSWERSECTION: 0.0.0.2.5.2.6.e164.id. 86400 IN sip:2000@192.168.0.3!". ;;AUTHORITYSECTION: 5.2.6.e164.id. 86400 IN ;;ADDITIONALSECTION: ns.warnet.co.id. 86335 IN ;;Querytime:0msec
NS A
ns.warnet.co.id. 76.163.126.2
VoIPCookbook:188
VoIPCookbook:189
zone"4.4.5.3.5.7.9.e164.bt"{ typeslave; masters{ 202.154.1.10; }; file"/var/lib/bind/4.4.5.3.5.7.9.e164.bt.hosts"; }; zone"2.4.3.3.5.7.9.e164.bt"{ typeslave; masters{ 222.119.6.45; }; file"/var/lib/bind/2.4.3.3.5.7.9.e164.bt.hosts"; }; zone"8.6.7.5.5.7.9.e164.bt"{ typeslave; masters{ 231.167.31.20; }; file"/var/lib/bind/8.6.7.5.5.7.9.e164.bt.hosts"; }; zone"3.4.2.7.5.7.9.e164.bt"{ typeslave; masters{ 204.19.1.5; }; file"/var/lib/bind/3.4.2.7.5.7.9.e164.bt.hosts"; }; Whereon203.159.31.100,202.154.1.10,222.119.6.45,231.167.31.20and204.19.1.5,wemustrunmaster DNSserverforeachrespectiveENUM.
VoIPCookbook:190
VoIPCookbook:191
VoIPCookbook:192
include=>marketing_team_conference_room IftheestablishedconferencegivesthecallerstheopportunitytolistentospeechesfromtheBoss withoutinterruptingthespeech,thenwehavetodothefollowing: [marketing_team_conference_room] exten=>300,1,MeetMe,2500|m|1234 Newcallerswhohavejoinedtheconferencecanfindouthowmanypeopleintheconferenceuse MeetMeCountapplications,byexecutingthefollowingcommand: [marketing_team_conference_room] exten=>300,1,Playback(there_are) exten=>300,2,MeetMeCount,2500 exten=>300,3,Playback(callers) exten=>300,4,MeetMe,2500 Ofcourseyouneedtosavetwosoundfilesthatsomewhatreads"Thereare"and"Callerspresentinthe conference".Aftereditingextensions.conf,donotforgettoreloadthenewconfiguration.Inorderto preventanomaliesencounteredduringoperation,wecanrunasteriskconsoleandexecutethefollowing command: #asteriskr asterisk1*CLI>extensionsreload
[gen_conference] Ifweneedestablishanewconference,wecanimmediatelymakeitthroughCLI,withthefollowing command: localhost*CLI>addextension400,1,Dial,3500intogen_conference Extension'400,1,Dial,3500'addedinto'gen_conference'context Hereextension400willbeaddedwithpriority1togen_conference.Ofcourse,thisextensionwill disappearifwerestarttheasterisk,orwecandeleteitthroughthefollowingcommand: localhost*CLI>removeextension400@gen_conference Wholeextension400@gen_conferenceremoved Inmultilineextensions,wecanomitasinglelineorcommandbygivingapriority,forexample localhost*CLI>removeextension400@gen_conference2 Extension400@gen_conferencewithpriority2removed
VoIPCookbook:194
Onthisoccasion,youwillbeshownatrunkpeeringprocessusingVoIPRakyat.Thesamemechanism canbeappliedtootherSIPproxyacrosstheworld. Inaddition,wewillalsodiscusstherealproblemswefaceinconfiguringnetworkinvolving NAT/ProxyServer,asmostnetworksareprotectedbyfirewallthatblocksVoIPsignal. WepresumethatwealreadyhaveanaccountinVoIPRakyat.Inthissense,thegivennumberand passwordare: number number 2012345passwordabcdef 2055555password123456
VoIPCookbook:195
Ingeneral,thesetupcanworkwiththeexistingconfiguration,ofcourse,dependingonthe configurationoftheclient,NAT,serverandmanyotherfactors,especiallythefirewallconfiguration. Ofthosesetups,number3and6aredifficulttodobecauseSIPisapeertopeerprotocolandmost NATsallowonlyclientsinsidetheirnetworktoconnecttoaserverlocatedoutsidebutnotviceversa. 1. 2. 3. 4. 5. 6. 7. 8. RunningwithaproxyserverthatsupportsNAT RunningwithnoNATinbetween RunningbydoingportforwardingintheNAT/proxyserver RunningwithnoNATinbetween RunningwithnoNATinbetween RunningbydoingportforwardingontheNAT/Proxyserver RunningwithnoNATinbetween Runningwithconfigurationnat=yesandqualify=xxxinsip.conf.SomeclientsusingXLikeuse STUNandsendUDPkeepalivepackets.QualifywillsendakeepalivepacketsfromAsterisk toanyclientintheNAT
VoIPCookbook:197
openmailbox777inmb_tutorialcontext.Oncethecallerhasleftamessage,Asteriskwillcarryout playback(rewindthemessage)andhangupthecall.Playback(vmgoodbye)willexecutevmgoodbye filethatshouldbeavailablein/var/lib/asterisk/sounds/. TheVoicemailmessageisrecordedin /var/spool/asterisk/voicemail/<context>/<mailbox>/INBOX/ ThereforethefullpathtoIvanis /var/spool/asterisk/voicemail/mb_tutorial/777/INBOX/. Tolistentothemessagestoredinthemailbox,wecanplaceacallbyusingVoiceMailMaincommand inAsterisk.Thecommandisasfollows: VoiceMailMain(mailbox@context) InthedefaultconfigurationofAsterisk,ifthesampleconfigurationremainsaswhatis,VoiceMailMain canbecontactedusingthenumber8500. Theconfigurationsampleofextensions.confforaccessingVoiceMailMainis: exten=>9999.1,VoiceMailMain(777@mb_tutorial) Bydialing9999,wewillbeabletogointomailbox777,ofcourseafterweenteredthecorrect passwordforthismailbox,whichis1212. VariousoptionsareavailablewhenaccessingmailboxesusingVoiceMailMain: 0Mailboxoptions 1Recordunavailablemessage 2Recordbusymessage 3Recordourname 4Changeourpassword *Backtomainmenu 1Listentooldmessages 2Changefolders 3Advancedoptions 1Sendreply VoIPCookbook:199
2Callback 3Envelope 4Outgoingcall 5Leavemessage *Backtomainmenu 4Playpreviousmessage 5Repeatmessage 6Playnextmessage 7Deletethismessage 8Forwardmessagetoanothermailbox 9Savemessageinafolder *Help;duringmessageplayback:Rewind #Exit;duringmessageplayback:FastForward Whenwelistentoavoicemailmessagerecording,wecanusethefollowingbuttonstonavigate,ie, *torewind(goingback) #toFastForward(forward) Note:the'#'and'*'buttonsworkonlywhenthemessageisintheprocessofplayback.
VoIPCookbook:200
Pattern Extension
Whenwedefineextensionsinacontext,notonlycanweuseordinarynumbers,namesorletters,but wecanalsodefinetheextensionsthatmatchasetofnumbersdialedusingextensionpattern.
Attaching context
Acontextcontainingextensionscanbeincorporatedintoorassociatedwithothers.Forexample, considerthefollowingcontext: Context"default": Extension 101 102 Note MarkSpencer WillMeadows VoIPCookbook:201
Operator
Context"local": Extension Note _9NXXXXXX Localcalls include=>"default" Context"longdistance": Extension Note _91NXXNXXXXXX Longdistancecalls include=>"local" Wehavedefinedthreeextensions: Operator.Defaultcontextallowsustodial3telephoneextensions:Mark,Willandtheoperator Localcontexthasonlyoneextensionthatallowsustodial7digitnumber.Inaddition,ifwe incorporatethedefaultcontextintothelocalone,wecanalsodialMark,Willandtheoperator. Thelongdistancecontexthasanextensionpatternallowingustoplacealongdistancecall. Thiscontextalsoincludeslocalcontext,andthusalsoallowsustocallalocalnumberoreven theextensionofMark,Wilandtheoperator.
Extension
Anextensioncanbeaseriesofnumbersorapattern.Extensioncanbeaseriesofnumber,like123,and mayalsocontainsomestandardsymbols*and#,whichareavailableonthephonekeypad.So34#76is avalidextensionnumber.SomekeypadsarelabeledA,B,C,andD.Becauseofthis,extensioncan alsobedefinedbasedonletters.Sobasicallyanextensioncanbedefinedusingbothlettersand numbers.KeepinnotethattherearemanyVoIPphonesthatcancallextensionnumbersconsistingof textSembang,like"Office".ThereforeitisnotaproblemtodefinesuchanextensionnameinAsterisk. Areextensionnamescasesensitive?Yesandno.ExtensioncasearesensitivebecausewhenAsterisk attemptstomatchtheextensiondialedbyausertoextensionthatisdefinedincontext,theextension nameshouldbepreciselymatched,includinguppercaselettersandsmall.Therefore,ifausercalls extension"OFFICE"throughtheirVoIPphone,Asteriskwillnotimmediatelyrunthecommandswe defineforextension"Office".Butinreality,extensionnamesarenotcasesensitiveinthesensethatwe cannotdefinedifferentextensionsbasedonlyonuppercase/lowercaseletters.Itmeanswedonotdefine thecommandforextension"Office"and"OFFICE"inacontext.
PredefinedExtensionNames
Asteriskdefinesanumberofextensionnamesforspecificneeds.Theseextensionsare: i s :Invalid :Start VoIPCookbook:203
h t T o
andmanymore.
DefiningExtension
UnliketheextensionsintraditionalPABX,wheretheextensionisusuallyassociatedwithaphone, interfaceormenuin,theextensioninAsteriskisdefinedasasetofcommandstorun.Thesecommands areusuallyexecutedaccordingtotheirlevelofpriority.Somecommands,suchasDialorGotoIf,have theabilitytofollowothercommandsdependingonacertaincircumstance. Atthetimewhentheextensionisdialed,thecommandmarkedas1willbeexecuted,followedby commandnumber2andsoon,untilthephoneishungup. Inthesyntaxusedinextensions.conffile,astepinagivenextensioniswrittenusingthefollowing format: exten=extension,priority,Command(parameter) Thesignequalto=canalsobewrittenusing=>,justliketheformoftenusedinmanyexamples. Inconclusion,a"context"hasaname,suchas"john".Ineveryofthem,wecandefineoneormore "extension".Inanextension,wecandefineasetofcommands.Howdowedefinetheseextensionsand thecommandsrequiredtohandlethem?Todefineboth,weneedtoeditextensions.conffileusingatext editor.Thereareseveraltoolsthatallowustoeditthemusinggraphic/web. Thecomponentsthatbuildthestagesofextensioncommandorthecommandlineareasfollows: Extensionisthelabelofanextension,whichcanbeastring(containingallowednumbers, lettersandsymbols).Extensionisapatternthatmustbeevaluateddynamicallyirordertomatch manypossiblephonenumbers.Everycommandlinethatbecomespartofaparticularextension shouldhavethesamelabel. Priorityusuallyisofintegernumber.Itisthesequenceofacommandthatmustberunwithina givenextension.Thefirstcommandthatwillberunmustbeginwithpriority1.Ifthereisno VoIPCookbook:204
Forexample: exten=>123,1,Answer exten=>123,2,Playback(ttweasels) exten=>123,3,Voicemail(44) exten=>123,4,Hangup Withthesedefinitions,anextensionisnumbered"123".Whenacallisdialedtothisextension,Asterisk willrespondtothecall,executingasoundfilewiththenamettweaselsandgivethecallerthechance toentervoicemailintomailbox33,andwillbeendedupwithahangup. Asteriskitselfdoesnotreallycareabouttheorderoflineplacementinextensions.conf.Sowithrandom placementoflines,thecommandwewanttoexecutewillstillbecarriedoutaccordingtotheorderwe want. exten=>123,4,Hangup exten=>123,1,Answer exten=>123,3,Voicemail(44) exten=>123,2,Playback(ttweasels) AnotherwayindefiningthecommandistouseCallerIDtomatchthecaller. exten=>123/100,1,Answer() exten=>123/100,2,Playback(ttweasels) exten=>123/100,3,Voicemail(123) exten=>123/100,4,Hangup() Withsuchcommand,compabilitywithextension123willbepossibleonlywhentheCallerIDofthe VoIPCookbook:205
calleris100.Thiscanalsobedonethroughpatternmatchingprocess,suchasthefollowing: exten=>1234/_256NXXXXXX,1,Answer() andsoon Thisway,thecompabilitywithextension1234willonlypossibleiftheCallerIDbeginswithjustthe codeareanumber256. Wecanevendothefollowing: exten=>s,1,Answer exten=>s/9184238080,2,Set(CALLERID(name)=EVILBASTARD) exten=>s,2,Set(CALLERID(name)=GoodPerson) exten=>s,3,Dial(SIP/goodperson)
Inthesecondpriority,itisshownthatwecanmarkanypersonwedislike,whileanypersonotherthan theonewedislike,afterthirdpriority,willreturntothepathspecified.
AninterestingExtensionExamples
Asteriskisabletotransfercalls.Thiscanbedonebyaddingtheparametert(lowercaps)totheuser context,suchasinthefollowingsyntax: exten=>250,1,Dial(SIP/alrac,10,rt) Thisway,thecalltransfercanbedonebypressing"#",followedbytheextensionnumber.Asteriskwill say"transfer"whenyoupress"#"andsoundsadialtoneuntilweentertheextensionnumbertowhich wewishtocall. Asteriskhastwentyparkingspaces,number701720.Transferthecallthatyouwanttoparkat extension#700andAsteriskwillautomaticallyparkitatanyemptylotandprovideyouwithextension ofwhereitisparked.Toretrievethecall,youonlyhavetodialtheextensionnumber.temparextension mendialenoughparking. Thestepsnecessaryforparkingcallsareasthefollowing: Addinclude=>parkedcallstothedefaultcontext,ortheonethatyouwishtohaveparkcall facility. VoIPCookbook:206
YouneedtorestartyourAsteriskserverthroughtheconsole,asreloadingisnotsufficient.Youcan attemptitintheinternalextension.Soifthereisanincomingcall,thecallcanbeparkedbypressing #700,andAsteriskwillsaytheextensionnumberofwherethecallisparked.Thecallerwillheara beautifulmusicplayedthroughMusicOnHold.Whentheparkingtimeisup,thenourextension numberfirstdialedwillbedialedagainandwehavetheoptionwhethertoreceivethecallornotto receiveandforwardthecalltovoicemail. Theparameter"t"(lowercase)meansthatonlytherecipientofthecallcantransfercalls.Thismeanswe canonlyparkacalljustonce.Butifweaddtheparameter"T"(capitalized),suchas: exten=>250,1,Dial(SIP/alrac,10,rT) thenwecantransferthecalls,whetherassomeonewhoreceivethecallsorasthecaller.Allthisalso meansthatwecanunparkacall,parkthecallandtransferthecall. Asteriskcanbeconfiguredforhuntingtelephonenumbers.Ahuntgroupisalistofphonenumbers whichwillberangconsecutivelyuntilwepickupthephone.Theexampleshowstwophoneextensions andamobilephonenumber.Thecallersimplycallextension100andAsteriskwilldotherestofthe tasks.Eachphonewillringfor20seconds,andwhennobodypickitup,Asteriskwilldialthenext phone. [alracfollowme] exten=>100,1,Dial(SIP/350,20,r) exten=>100,2,Dial(SIP/351,20,r) exten=>100,3,Dial(Zap/1/1231234567,20,r) exten=>100,4,VoiceMail(u350) exten=>100,dial+101,VoiceMail(b350) Othervariationofthehuntingtechniqueaboveisthatallnumberscouldringatthesametime.Thisis knownasgroupring.Youcanringallthephonesinadepartmentifyouwishthemtodoso.The VoIPCookbook:207
Reloading
Afterwemadesomechangestothedialplanandotherthings,wehavetoapplythesechangeswe appliedtoasteriskbydoingthefollowingCLIasteriskcommand: CLI>reload Alargeconfigurationfilesizeormanysmallerfilesize? Throughthecommand#include<filename>inextensions.conf,otherfilescanbeincluded.Thisway, wecanconfigureextensions.conftobethemainfile,users.confthatcontainslocaluser,services.conf thatcontainsvariousserviceslikeconferencing.Bydoingso,itiseasiertomaintainthedialplanwe create.
VoIPCookbook:208
VoIPCookbook:209
Linksys SPA9000
LinksysSPA9000Configuration
ThewayLinksysSPA9000operatesissomewhatsimilartootherLinksysVoIPequipments.To configureLinksysSPA9000,weneedtohave: 1. informationonIPaddressforbothWANandLANports. 2. SIPaccountofaproviderintheinternettoallowSPA9000toregisteritselftofourdifferentSIP accounts. 3. NumberallocationforextensionlinesofthePBXtoSPA9000toprovideaddressupto16 telephonenumbersautomatically. Numbersallocatedforeachextensionarespecific,distinguishinganIPPBXfromotherVoIP appliances.Normally,atypicalVoIPequipmentdoesnotprovidetelephonenumberallocation.Soif youwanttoconnectyourconventionalphonetoLinksysSPA9000throughtheinternetorWANport, thefirstthingyouhavetodoisfindtheinternet/WANIPaddressofLinksysSPA9000solateryouwill beabletoconfigureusingtheweb,bydoingthefollowingsteps:
VoIPCookbook:211
VoIPCookbook:212
IntheWANsetup,wegettwooptions:
UsingastaticIP(requiringIPaddress,Netmask,gatewayetc.) UsingautomaticIP(connectiontypeshouldbesettoDHCP).
VoIPCookbook:213
Figure 15.4: The LAN Setup Tab of Linksys SPA9000 Administration Panel
ConfiguringVoIPonLinksysSPA9000
Basically,thereareseveraltypesoftelephoneconnectioninavailableinLinksysSPA9000:
VoIPCookbook:214
Figure 15.5: FXS 1 Tab under Voice Tab of Linksys SPA9000 Administration Panel
OnthemenuofLine1toLine4,wecanconfiguretowhichSIPservereachoftheselineswillbe registeredto.MakesureLineEnableissettoYes.
VoIPCookbook:216
OnLinksysSPA9000wecouldsetfourSIPaccountstoberegisteredtoanySIPProxy,eachaccount connectedonlytoaline.Someimportantthingstodothisareasthefollowing:
IfyousetUseAuthIDtoye,thenfillthatparameterwiththenumberofyourVoIPRakyataccount. VoIPCookbook:217
DothesametoyourotherSIPaccount(s)fortherestofthelines(Line2,Line3andLine4).
VoIPCookbook:218
FXOtobeconnectedtoPSTN/Telcoline/PABXextension. FXStobeconnectedtoTelephoneline/FAX.
VoIPCookbook:219
Figure 16.1: ATA Linksys SPA3000 has two RJ-15 sockets on one of its sides
Figure 16.2: ATA Linksys SPA3000 has a RJ-45 socket, power socket and LED indicator on the other side
OnthebackofLinksysSPA9000,thereisRJ45plugthatcanbeconnectedtoLANcableforcomputer andtheInternet.
VoIPCookbook:220
ConfigureLinksysSPA3000
VoIPCookbook:221
VoIPCookbook:222
RegistrationtotheSIPserverforthetelephoneiscarriedoutthroughLine1menu.Weneedtoenter someinformation: LineEnableyes ProxytheSIPServer. DisplayNamethephonenumberintheSIPserver. UserIDthephonenumberintheSIPserver. AuthIDthephonenumberintheSIPserver. PasswordthepasswordtoregistertotheSIPserver. Onceyoucompletedallthese,theconfigurationforregistrationtoSIPserverfortelephoneconnected tophone/FXSinterfaceiscompleted.
VoIPCookbook:223
ForconnectivitytoPSTN,theconfigurationforPSTNLineregistrationissimilartoLineconfiguration, usingthefollowingconfiguration: LineEnableyes ProxyIPaddress/hostnameofSIPServer. DisplayNamethephonenumberintheSIPserver. UserIDaphonenumberintheSIPserver. AuthIDaphonenumberintheSIPserver. PasswordpasswordtoregistertotheSIPserver. Oncethesearecompleted,soistheconfigurationforregisteringthePSTNLinetoSIPserverfor telephonecableconnectedtoFXOinterface.
VoIPCookbook:224
LinksysSPA3000ATAStatus
AtthebeginningoftheSPA3000configurationmenuisthestatusandinformationmenu.Slightly below,thereisastatusofSPA3000PSTNline.Despitethemanyparametersavailableinthisstatus, youhavetobeconcernedwithjusttwoofthem:registrationstateandLineVoltage.Fortheformer, makesurethattheparameterregistrationstatesaysregistered.ThisimpliesthatSPA3000isproperly registeredtoaSIPproxy.Forthelatter,checkthevoltagelevelattheconnectiontoPSTN/PABX.PSTN andanumberofPABXusuallyhavetheirvoltagelevelat48Vand24Vrespectively.Whilethe voltagelevelofthePSTNisfine,PABX'svoltagelevelwillbeproblematicforSPA3000,asitsdefault voltagethresholdisconfiguredonlytohaveSPA3000connectedtoPSTNorPABXwhentheirvoltage levelisabove30V.WhenyoudomakeacallusingthelineconnectedtotheunrecognizedPABX(or PSTN),SPA3000willgiveabusytone.TohaveSPA3000recognizeaPABXwhosevoltagelevelis below30V,wehavetochangetheparameteravailableinthePSTNLinemenu,whichyoucould accesswhenyou'reloggedinasadmin. VoIPCookbook:225
VoIPCookbook:226
VoIPCookbook:227
AtthebeginningoftheLevelOneVOI2100menuisthestatusoftheVOI2100,suchasMACAddress, SystemUptime,etc..VariousconfigurationsofVOI2100isavailableontheleft.
VoIPCookbook:228
Figure 16.11: The WAN Status tab of LevelOne VoIP Administration Panel
VoIPCookbook:229
Figure 16.12: The WAN Settings tab of LevelOne VoIP Administration Panel
VoIPCookbook:230
InWANmenu,clickPPPoE.Coincidentally,thereisafeaturetoauthenticateADSLthatusesPPPoE. Thus,ifyoulikepleasefeelfreetoentertheusernameandpasswordofPPPoE.
VoIPCookbook:231
VoIPCookbook:232
OnthemenuLAN,clickLANSettings.HerewecansettheIPaddressandSubnetMaskofthe EthernetLANthatweuse.
VoIPCookbook:233
VoIPCookbook:234
VoIPCookbook:235
VoIPCookbook:236
ThemostimportantpartofVOI2100istheSIPconfiguration.OntheSIPmenu,clickSIPtab.This tabsallowsyoutochangekeyparametersenablingVOI2100toenterSIPnetwork.Someoftheseare:
VoIPCookbook:237
AdditionalinformationpertainingtoSIPaccountinaSIPProxyserverneedstobeincludedalsoonSIP menu,atheverybottomofthemenu.Theseinformationinclude: PhonenumberusernameintheSIPProxyServer Phonenumber,whichistheusernameofaSIPProxyServer CallerID,thecallerIDwewanttouse Password,theonetobeusedtoregistertoSIPProxyserver TherearetwoSIPaccountsthatcanberegisteredwithSIPProxyServer:Line1canbeconnectedto thetelephonelinewhileline2toPSTNlinewhichplugisavailableinLevelOneVOI2100.UnderSIP menu,thereareothersubmenussuchasSIPExtension,OutofBand(OOB)Signaling,ToSetc. However,youdon'thavetochangetheseparameters,asVOI2100canstilloperatewithouttheneedto changetheseparameters.
VoIPCookbook:238
VoIPCookbook:239
NowclickonSystem,thentosecurity.Underthistab,wecanchangethewebadministratorpassword neededtoaccessLevelOneVOI2100webmenu.
VoIPCookbook:240
NowclicktheAutoUpdatetab,nexttoSecurity.Thesubmenuunderthistaballowsyoutoupdate firmwareofLevelOneVOI2100automaticallythroughtheInternet.
VoIPCookbook:241
NowclickLocalization.Setthetimetosynchronizeourtimetotheserver'sintheinternetandalsoset ourlocationtothetimezoneforourlocation.
VoIPCookbook:242
Figure 16.25: The Gain Control tab of LevelOne VoIP Administration Panel
VoIPCookbook:243
NowclickCallerID.ChoosethesortofcallerIDyouwanttouse.
VoIPCookbook:244
VoIPCookbook:245
UsingtheSPA400withAsterisk
StepsthatneedtobecarriedouttolinkSPA400toAsteriskareasfollows: ConfiguringtheSPA400IPaddress ConfiguringSPA400IPaddress ConfiguringAsteriskaccountinSPA400 Configuringsip.confinAsterisktohaveitregisteredtoSPA400 Conguringextensions.confinAsterisksoitdialoutusingSPA400 Makingalltheseconfigurationsisnotdifficultandcanbedonethroughtheweb.Thedefaultusername isAdmin(Casesensitive)withoutapassword. VoIPCookbook:246
VoIPCookbook:247
ConfigureAsterisktotalktoLinksysSPA400
OnAsterisk/etc/asterisk/sip.conf,youneedtoconfiguretheaccountexactlysimilartoUserIDof SPA400 Theentriesinsip.conftoenableAsteriskregistertoSPA400areasfollow: [general] register=>9000@192.168.0.6/9000 VoIPCookbook:248
Replace9000withthevalueyouenteredintheUserIDofSPA400,andreplace192.168.0.2withtheIP addressoftheSPA400. CreateaSIPentryforSPA400,withthefollowinginformation: 901user:UserIDofSPA400 902host:IPaddressofSPA400 903context:thecontextthatwillbeusedtohandleinboundcallsfromSPA400 SIPentrytoreceivecallsfromSPA400areasthefollowing: [9000] type=friend user=9000 host=192.168.0.6 dtmfmode=rfc2833 canreinvite=no context=fromtrunk insecure=very ToseewhetheryouareregisteredtoAsteriskornot,youcancarryoutthefollowingcommand: localhost*CLI>sipshowregistry HostUsernameRefreshState 192.168.0.6:50609000105Registered InExtension.conffilewecanconfiguretheroutingfordialoutusingSPA400.Anexampleofageneric configurationfordialoutroutebypressing9andenterSPA400FXOtrunkisasfollows: [general] Trunk=SIP/9000 TRUNKMSD=1 [trunkint] ; ;Internationallongdistancethroughtrunk ; exten=>_9011.,1,Macro(dundie164,${EXTEN:4}) VoIPCookbook:249
exten=>_9011.,n,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}}) [trunkld] ; ;Longdistancecontextaccessedthroughtrunk ; exten=>_91NXXNXXXXXX,1,Macro(dundie164,${EXTEN:1}) exten=>_91NXXNXXXXXX,n,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}}) [trunklocal] ; ;Localsevendigitdialingaccessedthroughtrunkinterface ; exten=>_9NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}}) [trunktollfree] ; ;Longdistancecontextaccessedthroughtrunkinterface ; exten=>_91800NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}}) exten=>_91888NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}}) exten=>_91877NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}}) exten=>_91866NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}}) NotethattheSPA400'saccountnumberinAsteriskis9000,thenumberweareusingasanexample. Incomingcallroutingismorecomplex.Ifweassumetheincomingcallwillbeconnectedtoextension 200,thentheconfigurationisapproximatelyasfollows: [fromtrunk] include=>frompstn ... [frompstn] include=>frompstncustom ... [frompstncustom] exten=>9000,1,Goto(extlocal,200,1) VoIPCookbook:250
ConnectPSTNusingLinksysSPA9000andLinksysSPA400
ConnectingPBXsoftswitchlikeLinksysSPA9000tothePSTNcanbecarriedoutinseveralways.One ofthemistousetheLinksysSPA400asmediatortoPSTN.WhatyouhavetodoistomakeSPA400's IPaddresstobefixed,enableUserIDtoregisteritselftoSPA400,enableSPA9000toregisteritselfto SPA400,andenableSPA9000touseSPA400'strunkforPSTNcalls.SPA400configurationcanbe donethroughtheweb,usingthegivendefaultusernamewithoutapassword.
VoIPCookbook:251
VoIPCookbook:252
OntheSetupmenu,clickVoice.Herewecanconfigurethesortofcodecwewanttouseandother settingparameterssuchasWaitforAnswertime.
VoIPCookbook:253
VoIPCookbook:254
ThroughtheSetupmenu,clicktheVoicemailServertab.Herewecansetsomeimportantparametersof theVoicemailserver,suchas:
VoIPCookbook:255
VoIPCookbook:256
GotoAdministration,thenclickManagement.Herewecanconfigureourusernameandpasswordfrom GatewayAdministrator.ThedefaultusernameisAdmin,withoutapassword.
VoIPCookbook:257
VoIPCookbook:258
VoIPCookbook:259
ConfigureLinksysSPA9000totalktoLinksysSPA400
TohaveSPA9000capableofcommunicatingwithSPA400,youneedtoregistertheuserIDyouhave setinSPA9000toSPA400.Gotoadminmenu,chooseAdvancedandchooseoneofthefourlines. UndertheSubscriberInformation,youneedtosetthefollowingparameters: DisplayNameaccordingtoSPA400. DisplayNameaccordingtoSPA400 UserIDaccordingtoSPA400 Passwordjustleaveitblank UserAuthIDshouldbeNo ProxySPA400IPaddress OutboundProxySPA400IPaddress
VoIPCookbook:260
History
TheprojectisstartedbyHarvindSamrahttp://www.linkedin.com/in/harvindsamraandDavidA. Burgesshttp://ecommconf.com/2009/speakers/davidburgess/.Theaimoftheprojectistoreducethe GSMcostinruralanddevelopingcountriestobeunderUS$1/month/subscriber.
Field Test
FieldtestisdoneinNevadaandNorthCalifornia,US.Temporaryradiolicenseforashortperiodis obtainedthroughKestrelSignalProcessing(KSP)usedtobeaconsultingfrimofthedeveloperof OpenBTS. VoIPCookbook:261
Niue
In2010,anOpenBTSispermanentlyinstalledinNieuanditisforthefirsttimeacellularBTS connectedtothelocaltelecommunicationoperator.Niueisasmallcountrywith1700inhabitantamd notsomuchattractingmobileoperator.CoststructureofOpenBTSfitstoNiuewhichunabletoprocure theconventionalGSMBaseStation.
GNURadio
Referencehttp://gnuradio.org/redmine/wiki/gnuradio/UbuntuInstall.Theneededdevelopmenttoolsare:
Theneededlibraryforruntimeandcompilationprocessesare
pythondev FFTW3.X(fftw3,fftw3dev) cppunit(libcppunitandlibcppunitdev) Boost1.35(orlater) libusbandlibusbdev wxWidgets(wxcommon)andwxPython(pythonwxgtk2.8) pythonnumpy(viapythonnumpyext)(forSVNonorafter2007May28) ALSA(alsabase,libasound2andlibasound2dev) Qt(libqt3mtdevforversionsearlierthan8.04;version4worksfor8.04andlater) SDL(libsdldev) GSLGNUScientificLibrary(libgsl0dev>=1.10requiredforSVNtrunk,notinbinary repositoriesfor7.10andearlier)
VoIPCookbook:262
LibraryInstallation
Update sudoaptgetupdate ForMaverick(Ubuntu10.10)wecanusethefollowingcommand sudoaptgetyinstalllibfontconfig1devlibxrenderdevlibpulsedevswigg++automake\ libtoolpythondevlibfftw3devlibcppunitdevlibboostalldevlibusbdevfort77sdcc\ sdcclibrarieslibsdl1.2devpythonwxgtk2.8subversiongitcoreguile1.8dev\ libqt4devpythonnumpyccachepythonopengllibgsl0devpythoncheetahpythonlxml\ doxygenqt4devtoolslibqwt5qt4devlibqwtplot3dqt4devpyqt4devtools\ libpcre3libpcre3dbglibpcre3devlibpcrecpp0
WxWidgetInstallation
Althoughthisseemstobenotcritical.ThosewhowishtoinstallthelatestWxWidgetcanfollowthe followingcommand. Edit/etc/apt/sources.list #wxWidgets/wxPythonrepositoryatapt.wxwidgets.org debhttp://apt.wxwidgets.org/DISTwxmain debsrchttp://apt.wxwidgets.org/DISTwxmain
sudoaptgetinstallpythonwxgtk2.8pythonwxtoolswx2.8i18n sudoaptgetinstallpythonwxgtk2.8pythonwxtoolswx2.8i18nlibwxgtk2.8devlibgtk2.0dev
SWIGInstallation
TomanuallyinstallSWIG,weneedtodownloadthesourcecodefrom http://sourceforge.net/projects/swig/files/swig/ Thendothefollowings cpswig2.0.1.tar.gz/usr/local/src/ cd/usr/local/src/ tarzxvfswig2.0.1.tar.gz cd/usr/local/src/swig2.0.1/ ./configure make makeinstall
QWTInstallation
TomanuallyinstallQWT,weneedtodownloadthesourcecodefrom http://sourceforge.net/projects/qwt/files/ Thendothefollowings cpqwt5.2.1.tar.bz2/usr/local/src/ cd/usr/local/src/ tarjxvfqwt5.2.1.tar.bz2 cd/usr/local/src/qwt5.2.1/ qmake make makeinstall Forthosewhobravemayusethebetaversionsuchas cpqwt6.0.0rc5.tar.bz2/usr/local/src/ cd/usr/local/src/ VoIPCookbook:264
GNURadioInstallation
Downloadthesourcecodefrom http://gnuradio.org/redmine/wiki/gnuradio/Download compilethesourcecode cpgnuradio3.3.0.tar.gz/usr/local/src/ cd/usr/local/src/ tarzxvfgnuradio3.3.0.tar.gz cd/usr/local/src/gnuradio3.3.0/ ./configure make makecheck makeinstall
USRPHandling
Ubuntuusesudevtohandlehotplugdevices,andbydefaultgivenoaccesstononroottoUSRP.The followingscriptwillgiveaccesstousertohandelUSRPviaUSBforeitherliveorhotplug. sudoaddgroupusrp sudousermodGusrpa<YOUR_USERNAME> echo'ACTION=="add",BUS=="usb",SYSFS{idVendor}=="fffe", SYSFS{idProduct}=="0002",GROUP:="usrp",MODE:="0660"'>tmpfile sudochownroot.roottmpfile sudomvtmpfile/etc/udev/rules.d/10usrp.rules Atthispoint,UbuntuhasbeenconfiguredtoknowwhatitshoulddowhendetectingUSRPintheUSB. "udev"mustbereloadrulestoloadournewrules.Thefollowingsmaydothetrickwithoutbootingthe VoIPCookbook:265
USRPVerification
NextweneedtoverifywetherGNURadiocanworkproperlywithUSRP.Atthispointweneedto connectUSRPtocomputer. ChecktheUSBspeedtoUSRP cd/usr/local/src/gnuradio3.3.0/gnuradioexamples/python/usrp ./usrp_benchmark_usb.py Wewillseesomethinglike Testing2MB/sec...usb_throughput=2M ntotal=1000000 nright=999918 runlength=999918 delta=82 OK VoIPCookbook:266
Testing4MB/sec...usb_throughput=4M ntotal=2000000 nright=1999492 runlength=1999492 delta=508 OK Testing8MB/sec...usb_throughput=8M ntotal=4000000 nright=3998860 runlength=3998860 delta=1140 OK Testing16MB/sec...usb_throughput=16M ntotal=8000000 nright=7997680 runlength=7997680 delta=2320 OK Testing32MB/sec...usb_throughput=32M ntotal=16000000 nright=15995986 runlength=15995986 delta=4014 OK MaxUSB/USRPthroughput=32MB/sec C++interfacetoUSRP,provideestimatemaximumthroughputbetweenPCandUSRP cd/usr/local/src/gnuradio3.3.0/usrp/host/apps ./test_usrp_standard_tx ./test_usrp_standard_rx TypicalresultfromUSRP_standard_txtest which:0 interp:16 rf_freq:1 amp:10000.000000 nsamples:3.2e+07 VoIPCookbook:267
SubdevicenameisFlex900TxMIMOB Subdevicefreqrange:(7.5e+08,1.05e+09) mux:0x000098 basebandrate:8e+06 target_freq:900000000.000000 ok:true r.baseband_freq:904000000.000000 r.dxc_freq:4000000.000000 r.residual_freq:0.000000 r.inverted:0 tx_underrun tx_underrun tx_underrun tx_underrun tx_underrun tx_underrun tx_underrun tx_underrun tx_underrun xfered3.2e+07bytesin1.01seconds.3.154e+07bytes/sec.cputime=0.16 9underruns TypicalresultfromUSRPstandardRXtest xfered1.34e+08bytesin4.19seconds.3.2e+07bytes/sec.cputime=0.8681 noverruns=0 Ifneeded,wecanupgradethewholesystem sudoaptgetyupgrade Thenrebootandupgradethedistro sudoaptgetydistupgrade
VoIPCookbook:268
OpenBTS Installation
BeforewedoOpenBTSinstallation,weneedtocompileandinstallGNURadio.WithoutGNURadio installed,OpenBTSmaynotbeinstalled.Weneedtoinstalladditionallibrary aptgetinstalllibosip24libosip2devlibortp8libortpdev Downloadthesourcecodefrom http://www.openbts.org http://sourceforge.net/projects/openbts/ Thendothefollowings cpopenbts2.6.0Mamou.tar.gz/usr/local/src/ cd/usr/local/src/ tarzxvfopenbts2.6.0Mamou.tar.gz cd/usr/local/src/openbts2.6.0Mamou/ ./configure make makeall makeinstall OpenBTSiscompiledandinstalled.ToenableSMSfacilityinOpenBTS,weneedtocompilethe smqueueseparately.Forstrangereason,weneedtoinstallg++4.3tocompilesmqueue aptgetinstallg++4.3 EditMakefile.standalonefileofsmqueue vi/usr/local/src/openbts2.6.0Mamou/smqueue/Makefile.standalone Replacetheg++ g++osmqueue$(CPPFLAGS)$(INCLUDES)smqueue.cppsmnet.cppsmcommands.cpp ../HLR/HLR.cpp$(LIBS) to VoIPCookbook:269
5063smqueueSIPinterface 5700rangeOpenBTStransceiverinterface Theseportscansetviaconfigurationfileapps/OpenBTS.config.ForthosewhodoOpenBTSinstalltion forthefirsttime,needtocopyOpenBTS.configfile cd/usr/local/src/openbts2.6.0Mamou/apps cpOpenBTS.config.exampleOpenBTS.config Ifneeded,wecanedittheconfigurationfile vi/usr/local/src/openbts2.6.0Mamou/apps/OpenBTS.config Mostofthedefaultparametermaybeusedasitis.Sometimes,weneedtochangethenetwork informationsuchas #Networkandcellidentity. #NetworkColorCode,07 #AlsosetGSM.NCCsPermittedlaterinthisfile. GSM.NCC0 #BasesationColorCode,07 GSM.BCC2 #MobileCountryCode,3digits. #MCCMUSTBE3DIGITS.Prefixwith0sifneeded. #Testcodeis001. GSM.MCC001 #MobileNetworkCode,2or3digits. #Testcodeis01. GSM.MNC01 #LocationAreaCode,065535 GSM.LAC1000 #CellID,065535 GSM.CI10
VoIPCookbook:271
smqueue Configuration
DisableIPv6byediting/etc/default/grubchange GRUB_CMDLINE_LINUX_DEFAULT=quietsplash into GRUB_CMDLINE_LINUX_DEFAULT=ipv6.disable=1quietsplash Aftersaveandexit,updategrubusing sudoupdategrub Editsmqueueconfiguration,copysmqueue.config.exampletosmqueue.config cd/usr/local/src/openbts2.6.0Mamou/smqueue/ cpsmqueue.config.examplesmqueue.config smqueueconfigfileisin./smqueue/smqueue.config. vi/usr/local/src/openbts2.6.0Mamou/smqueue/smqueue.config addtotheconfigfilethefollowingcommandtolimitalarmforSMSregistration Log.Alarms.Max10 createsavedqueue.txtin./smqueuedirectory touch/usr/local/src/openbts2.6.0Mamou/smqueue/savedqueue.txt Runsmqueue sudosu cd/usr/local/src/openbts2.6.0Mamou/smqueue/ ./smqueue& Ifitrunscorrectly,wewillseesomethinglike VoIPCookbook:272
OpenBTS. 2. Editsip.confandextensions.conftosupportthenewSIPuser. Thus,inprincipal,thereisnotmuchtoconfigureAsterisktobeabletotalktoOpenBTS.Weneedto edit /etc/asterisk/sip.conf /etc/asterisk/extensions.conf ExampleofAsteriskConfigurationcanbefoundin /usr/local/src/openbts2.6.0Mamou/AsteriskConfig Exampleof/etc/asterisk/sip.confisasfollows [IMSI510110301694405] callerid=2101 canreinvite=no type=friend callerid=2101 ;context=sipexternal allow=gsm host=dynamic [IMSI520010104743577] callerid=21011 canreinvite=no type=friend allow=gsm context=sipexternal host=dynamic Exampleof/etc/asterisk/extensions.confisasfollows exten=>2101,1,Dial(SIP/IMSI510110301694405,60,rt) exten=>2102,1,Dial(SIP/IMSI238209700014858,60,rt) exten=>2103,1,Dial(SIP/IMSI310260254136340,60,rt)
VoIPCookbook:274
IMSI520154100006647isobtainedfromtheSMSreceivedbytheOpenBTSuser.
AutomaticSIMRegistration
Asmentionathttp://gnuradio.org/redmine/wiki/gnuradio/OpenBTSThe_use_of_autocreatepeer=yeswe mayaddsomeparametersin/etc/asterisk/sip.conftoenableautomaticSIMregistration [general] allowoverlap=no;Disableoverlapdialingsupport.(Defaultisyes) bindport=5060;UDPPorttobindto(SIPstandardportis5060) bindaddr=0.0.0.0;IPaddresstobindto(0.0.0.0bindstoall) srvlookup=yes;EnableDNSSRVlookupsonoutboundcalls ;lineuntukautomaticsimregistration autocreatepeer=yes canreinvite=no calllimit=1 type=friend allow=gsm context=sipinternal host=127.0.0.1;assumingOpenBtsandAsteriskrunonthesamemachine Wecanexpandthecapabilityofasterisktorecognizenumbersusingcountrycodelike+62XXXusing ENUM.
OpenBTS Operation
TooperateOpenBTSwecanfollowthefollowingsteps. ChektheconnectionbetweenOpenBTSandUSRP.ThiscanbedoneusingUSRPpingasfollows cd/usr/local/src/openbts2.6.0Mamou/Transceiver ./USRPping AssumingAsteriskiscorrectlyconfigure,wecanrunitvia
VoIPCookbook:275
asterisk or /etc/init.d/asteriskrestart
Runsmqueue sudosu cd/usr/local/src/openbts2.6.0Mamou/smqueue/ ./smqueue& RunOpenBTS cd/usr/local/src/openbts2.6.0Mamou/apps ./OpenBTS WeneedtocopyOpenBTS.config.exampletoOpenBTS.configifwerunitforthefirsttimebeforerun OpenBTS. cd/usr/local/src/openbts2.6.0Mamou/apps cpOpenBTS.config.exampleOpenBTS.config ./OpenBTS Usingalldefaultvalues,withnomodification,wecanoperateOpenBTS.
VoIPCookbook:276
VoIPCookbook:277
Figure 18.1: Through SIPbroker.com you can find a number of SIP providers with their respective proxy. The site also indicates which provider is active and is not active
VoIPCookbook:278
VoIPCookbook:279
Figure 18.2: Through SIPbroker.com you can find a number of SIP providers with their respective proxy. The site also indicates which provider is active and is not
VoIPCookbook:280
VoIPCookbook:281
LPC10 DoDCELF
2.5Kbps 4.8Kbps
Thenextquestionwouldbewhichcodecisthemostsuitableforaprovider?Theanswerdependsonthe amountofbandwidthyouhave.Ifyouhaveamaximumbandwidthof32Kbpsbothupanddownfora VoIPtraffic,itisrecommendedthatyouuseGSMoriLBCasyourcodec.Ontheotherhand,ifthe amountofbandwidthishigher,say,higherthan128Kbps,youcanuseG711u(PCMU),whichwill increasethevoicequalityinacommunicationsession,withclearervoiceandlowerdelay.Othercodec thatcouldproduceoptimalresultistheG.729Codec.Unfortunately,itisaproprietarycodecwhichis notfavourableforthosewhouseopensourceplatform. ThemostcommonlyusedcodecsaretheG.729,GSM,andG.711.Ofthese,theG.711isfavorableasit deliversgoodqualityinLANnetwork,GSMispreferredbyopensourceusersasGSMisnot copyrighted,whilemanyVoIPdevicesuseG.729fortheircodec,theonewhichiscopyrighted.
MOS Score and R Factor are measured based on users' experience on a communication session
VoIPCookbook:282
Enteringothertypesofcodecandvaluespertainingtoourbandwidthforeverycodec,weobtainedthe followingMOSandRFactorcalculation: Codec G.711 G.723 5kbps G.723 6kbps G.729 Frame 20ms 20ms 20ms 20ms Packet Loss 0% 0% 0% 0% MOS 4.4 3.8 4.0 4.1 RFactor 93 74 78 83 Kbps 80.8 16.5 17.5 24.8
VoIPCookbook:283
Typically,theframesizeusedformeasurementis20ms,withthebandwidtharound25Kbps.The longerthelengthofpayloadorvoiceframesize,thelessbandwidthisneededbecausetheoverhead protocolissmaller. Codec G.729 G.729 G.729 G.729 G.729 Frame 2.5ms 5ms 10ms 20ms 30ms Packet Loss 0% 0% 0% 0% 0% MOS 4.1 4.1 4.1 4.1 4.1 RFactor 83 83 83 83 83 Kbps 41.6 41.6 41.6 24.8 19.2
VoIPCookbook:284
VoIPCookbook:285
AnexampleofcalculatedrequiredbandwidthforGSMandG.729Codecisshowninthefollowing table Numberof calls 1 2 3 4 5 6 GSM Incoming (Kbps) 28.63 57.25 85.88 114.50 143.13 171.75 Outgoing (Kbps) 28.63 57.25 85.88 114.50 143.13 171.75 G.729 Incoming (Kbps) 23.63 47.25 70.88 94.50 118.13 141.75 Outgoing(Kbps) 23.63 47.25 70.88 94.50 118.13 141.75
VoIPCookbook:286
VoIPCookbook:287
needtoenterthenumberofcallscominginanhour.Basedonthevaluesweentered,wewillobtain simulationresultshowinghowmanyagentsandlinesareneededtorespondtothecalls. Thenextstepistoestimatehowmuchbandwidthisneededforaspecificnumberoflinesoranumber ofminutes,inagivenpercentageofcallsthatwillbeblockedandreceivingbusytone.Thisisoften measuredusingErlangTrafficModelintermsofErlangs,theunitrepresentingusageofavoice channel.ErlangsTrafficModelmeasurementisveryimportanttohelpyoubeingatelecommunication networkengineertounderstandthetrafficpatternandnetworktopologynecessarytodeterminethesize oftrunkgroup.Inaddition,themeasurementcanalsobeusedtodeterminethenumberoflinesneeded betweenatelephonenetworkorsystemandtelephonecenter,orbetweennetworklocations. InpracticeErlangscanbeusedtogiveanoverallpictureoftrafficvolumeinanhour.Forexample,a usergroupmakes30callsinanhour,andeverycallhasanaveragetalkingdurationof5minutes,then theErlangsresultingfromthetrafficthattakesplaceis: Trafficminutesinagivenhour Trafficminutesinagivenhour Trafficminutesinagivenhour Traffichoursinagiventime Traffichoursinagiventime Trafficsize = Numberofcallxduration = 30x5 = 150 = 150/60 = 2.5 = 2.5Erlangs
ThesizeoftrafficisalsocalledBusyHourTraffic(BHT).TheBusyHourFactorparameterisa percentageofdailyminutesofcallsmadeduringthemostbusyhourinagivenday. InadditiontoErlangs,thereisalsoblocking.Blockingrepresentsunsuccessfulcallsbecauseof insufficientnumberoflines.Inotherwords,thecallerwillreceiveabusytonefromthecenterasall lines/trunksarebeingused.0.01blockingimpliesthat1%ofcallsmadewillbeblocked.Thisdecimal numberisusuallyusedintraffictelecommunicationengineering.Inanumberofapplications,blocking upto0.03(3%)isstilltolerable.Sothisnumbershouldideallybeassmallaspossible. Itappearsthatthemorewetoleratethenumberofblockedcalls,themoreminutesperdaywewill have.However,themorecallstakeplaceduringpeakhoursorwhenbusyhourfactorincreases,theless numberofminutesperdaywewillhave. NowthatyouknowwhatErlangTrafficModelmeasurementis,youcanplanyourconnectivity capacityforyourcallcenter,usinganumberofmeasurementtoolsavailableat VoIPCookbook:289
http://www.voipcalculator.com/calculator/.
Figure19.5:ErlangsandLinesCalculator. ByusingErlangsandLinesCalculator,youcanobtainthenumberofBusyHourTraffic(BHT)ofa numberoflines.Inourexample,wesimulate2,4and8voicepathsfacilitatedby64Kbpsconnectivity withsomeBlockingvalues.Thecalculationresultcanbeseenatthefollowingtable: VoicePath Blockin g 2 0.01 BHT (Erlangs) 0.15 VoIPCookbook:290
2 2 4 8
Figure19.6:ErlangsandBandwidthCalculator. Thiscalculatorcanbeusedtoestimatetheamountofbandwidthrequiredtodeliverthetraffic,when theBusyHourTrafficisknown.ByusingErlangsandbandwidthcalculator,wecanobtainthenumber ofBusyHourTraffic(BHT)ofagivenCodec.Supposewerunthesimulationusingavarietyof bandwidthvaluesandG.729Codec;wewillobtainthefollowingresult: Bandwidth Blocking VoicePath BHT VoIPCookbook:291
2 2 2 5 10 21
hourinagivenday.Thedefaultvalue17%isanacceptablepercentageforanofficeoperating8hours perday.Thepercentageisnormallyhigherforanofficeoperatinginlessnumberofhours,oranoffice thatoftenplacescallsinadifferenttimezone. ThefollowingistheresultofcalculationforaADSLchannelcapableoffacilitatingonlytwochannels: Voice Channel 2 2 2 2 2 2 Blockin g 0.01 0.03 0.10 0.03 0.03 0.03 BusyHour Factor 17% 17% 17% 20% 30% 40% Minutes/Day 52 88 194 45 30 22
VoIPCookbook:293
VQManagerSoftware SIPp
Willbeused.
VoIPCookbook:294
SomeoftheImportantScriptsofVQManager
TostartVQManager sudosu cd/root/ManageEngine/VQManager/bin/ /root/ManageEngine/VQManager/bin/run.sh Tostartasbackgroundprocess, sudosu cd/root/ManageEngine/VQManager/bin/ /root/ManageEngine/VQManager/bin/run.sh& TostopVQManager sudosu cd/root/ManageEngine/VQManager/bin/ /root/ManageEngine/VQManager/bin/shutdown.sh ToreinitializedtheDatabaseincasewehaveacorruptdata, sudosu cd/root/ManageEngine/VQManager/bin/ /root/ManageEngine/VQManager/bin/reinitializeDB.sh
VoIPCookbook:295
ActivateVQManagerWebService
WhenwerunVQManagerWebServiceforthefirsttime,weneedtoactivatetheWebService.Firstly, weneedtostartVQManagerasbackgroundprocess,suchas, sudosu cd/root/ManageEngine/VQManager/bin/ /root/ManageEngine/VQManager/bin/run.sh& AccessviaWebtohttp://localhost:8647withdefaultusername&passwordadmin&admin.
Figure20.1LoginMenuinVQManager.
VoIPCookbook:296
Figure20.2.WelcomeMessageofVQManager. AsweaccesstheVQManagerWebforthefirsttime,itwilltellusthatwecanchoosewhether,
Clicknexttocontinue.
VoIPCookbook:297
VoIPCookbook:298
VoIPCookbook:299
Figure20.5SelecttheInterfacetobemonitored. Thisistheimportantpart.Weneedtoselect,theinterfacetobesniffed.
VoIPCookbook:300
Figure20.6InterfaceSelected.
Intheabovefigure,wechooseinterfaceeth0tobesniffed. ClickNexttocontinue.
VoIPCookbook:301
VoIPCookbook:302
VoIPCookbook:303
ChangingtheMonitoredInterface
Insomecases,weneedtomonitordifferentinterface.Inthiscase,weneedtologintothewebat http://localhost:8647 usernameadmin passwordadmin Clickonthefollowingsequence Admin>Sniffer>ProtocolSettings>Next>"selectinterface">Next>Save Ifweneedtochangethemonitoredinterface,weneedtoclickonthefollowingsequence. Admin>Sniffer>Reconfigure>ProtocolSettings>Next>"interfacenya">Next> Save
InsertingnewInterface
Insomecases,wehaveinsertedanewinterfaceintotheserverandneedtomonitorthisparticularnew interface.Todoso,weneedtoresetthedatabase, sudosu /root/ManageEngine/VQManager/bin/reinitializeDB.sh thenactivatetheinterfacethroughVQManagerWebagain
VoIPCookbook:304
MonitorVoIPPerformance
VoIPCookbook:305
VoIPCookbook:306
VoIPCookbook:307
VoIPCookbook:308
Figure20.13EndpointDetailedCalls. Atthebottomofendpointmenu,wecanseedetailedcallsperformedbytheparticularendpoint.
VoIPCookbook:309
VoIPCookbook:310
VoIPCookbook:311
VoIPCookbook:312
VoIPCookbook:313
InstallationofSIPpWebfrontend
DownloadSIPpWebfrontendfrom http://sourceforge.net/projects/sipp/files/sipp/3.1/ Copy&Extract mkdir/var/www/sipp cpsipp_webfrontend_v1.2.tgz/var/www/sipp/ cd/var/www/sipp/ tarzxvfsipp_webfrontend_v1.2.tgz mv/var/www/sipp/src/*/var/www/sipp/ Createdatabase mysqlurootp password: CREATEDATABASESIPpDB; USESIPpDB; \./var/www/sipp/tables.sql quit Editconfig.ini.php vi/var/www/sipp/config.ini.php Suchthat VoIPCookbook:314
[EXECUTABLES] 3.0="/usr/bin/sipp" [CONFIG] db_host="localhost" db_user="root" db_pwd="123456" db_name="SIPpDB" admin_pwd="" Tomakeiteasierforaccessingtheweb,emptytheadmin_pwdfield.SIPpWebfrontendcanbe accessedvia http://localhost/sipp using usernameadmin password<nopassword>
TransactionOrientedTestusingSIPp
Inthisexample,weassumetheIPaddressofthesoftswitchis192.168.0.3. Firstly,weneedtosetuptheconfigurationfile/usr/local/etc/opensips/cfgtestuas.cfgattheserverside. Thelistofcfgtestuas.cfgisintheAppendix.Testtheopensipsconfigurationfile,itcanbedonevia, #opensipscf/usr/local/etc/opensips/cfgtestuas.cfg Ifnoerror,wecanruntheserverusing #opensipsf/usr/local/etc/opensips/cfgtestuas.cfg RunSIPpattheclientside,using $sippsnuac192.168.0.3
VoIPCookbook:315
Figure20.18SIPpStressTestwith1000callpersecondand10000concurrentcall
VoIPCookbook:316
VoIPCookbook:317
AccesstotheSIPpWebfrontend
SIPpWebfrontendcanbeaccessedvia http://localhost/sipp usernameadmin password<nopassword>
VoIPCookbook:318
VoIPCookbook:319
VoIPCookbook:320
VoIPCookbook:321
concurrentcall.Titlecanbeanything,aslongasitisinformative.
Figure20.25CreateNewTest
VoIPCookbook:323
Wecanthencompletetheformbyputtingsomeinfointhedescription.
Figure20.26CreateNewTest
VoIPCookbook:324
Belowthe"Savetest"buttonwillappearmenutoconfigurethetestinamoredetail.Itisinterestingto notethatwecansimultaneouslyconfiguretwo(2)devices,namely,PartyAandPartyB.
Figure20.27FirstSectionoftheAddCallinCreateNewTest VoIPCookbook:325
VoIPCookbook:326
Attheendofconfigurationcallmenu,wecansetcallrateandextendedparameter.PressSavecall buttonafterwecompletetheconfiguration.
VoIPCookbook:327
VoIPCookbook:328
VoIPCookbook:329
Use100MbpsLANswitchhubwithdedicatedsegment. UseGigabitEthernettoswitch/routerthatconnectedtotheserver. UseagoodIPPhone,itmaybebeneficialtouseaswitchthatcanprioritizedvoicetraffic. TalktoyourISP,makesurewereceiveenoughbandwidth.ItwouldbebeneficialiftheISPcan prioritizeRealTimeProtocol(RTP)traffic. MakesuretheroutermayprioritizeRTPtraffic. MakesurethefirewallisconfiguretopassVoIPtraffic. Designamanagementandmonitoringinfrastructuretohelpquickproblemdetectionand solving. Dotestpriortosystemoperation.
VoIPCookbook:331
References
VoIP Hardware
VoIP Softswitch
Testing Software
http://www.manageengine.com/products/vqmanager/
VoIPCookbook:333
;username2012345passwordabcdef ;username2055555passwd123456
;WeneedtoestablishaSIPaccountinourplaceinordertoreceivecallsfrom ;voiprakyatthroughourPABX ; [fwd1] type=friend secret=secret username=2055555 fromuser=2055555 fromdomain=voiprakyat.or.id host=voiprakyat.or.id dtmfmode=inband nat=yes canreinvite=no
VoIPCookbook:334
[fwd2] type=friend secret=secret username=2012345 fromuser=2012345 fromdomain=voiprakyat.or.id host=voiprakyat.or.id dtmfmode=inband nat=yes canreinvite=no ;ThefollowingisaSIPaccountforIPphoneinhouse/office ; [phone17] disallow=all allow=ulaw type=friend host=dynamic defaultip=192.168.0.17 dtmfmode=inband secret=voip17 mailbox=2206 context=home callerid="BillMandra"<2206> nat=no [phone18] disallow=all allow=ulaw type=friend host=dynamic defaultip=192.168.0.18 dtmfmode=inband secret=voip18 mailbox=2204 context=home callerid="Kitchen"<2204> VoIPCookbook:335
nat=no extensions.conf ; ;Staticextensionfileconfigurationusedbypbx_configmodule ;InthismoduleweconfigureallincomingcallsandoutgoingcallsinAsterisk ; [general] static=yes writeprotect=no [globals] DIALOUTANALOG=Zap/1 MAINPHONE=Zap/2 JESSICA=Zap/3 CHRISTOPHER=Zap/4 PORCH=Zap/5 KITCHEN=SIP/phone18 BILL=SIP/phone17 ; ;ForthisexamplethecardusedisZAPTEL ;WecanreplaceZap/1,Zap/2,Zap/3s/dZap/5 ;withSIPaccountinAsteriskforIPPhoneorWiFiPhone ;forexampleSIP/2000toIPPhonewithextension2000etc. FWDUSERID1=2012345 FWD1USERNAME=WilliamMandra FWDUSERID2=2055555 FWD2USERNAME=BujubunengMandra FWDPREFIX=* HOMENUMBER=4208888 BILLCELLPHONE=0811888888 MOMCELLPHONE=0811999999 JESSCELLPHONE=0813222222 ; ;MacroforAsteriskExtension VoIPCookbook:336
; [macrofastbusy] exten=>s,1,Answer exten=>s,2,Wait,1 exten=>s,3,Playback(ssnoservice) exten=>s,4,Wait(30) exten=>s,5,Hangup [macrodialoutsip] exten=>s,1,SetCallerID(${FWDUSERID2}) exten=>s,2,SetCIDName(${FWD2USERNAME}) exten=>s,3,Dial(SIP/${FWDPREFIX}${ARG1}@fwd1,70) exten=>s,4,Macro(fastbusy) exten=>s,5,Hangup exten=>s,104,Macro(fastbusy) exten=>s,105,Wait,3 exten=>s,106,Playtones(congestion) exten=>s,107,Wait,30 exten=>s,108,Hangup [macrobillcellfwdoutsip2] exten=>s,1,SetCallerID(${ARG2}) exten=>s,2,Dial(SIP/${FWDPREFIX}${ARG1}@fwd2,20) exten=>s,3,Goto(local,2206,4) exten=>s,102,Goto(local,2206,4) ; ;Outbound ; ; [operator] exten=>0,1,Dial(${DIALOUTANALOG}/${EXTEN},70) exten=>0,2,Macro(fastbusy) exten=>0,102,Playback(ssnoservice) exten=>0,103,Macro(fastbusy) [e911] exten=>911,1,Dial(${DIALOUTANALOG}/${EXTEN}) exten=>911,2,Macro(fastbusy) VoIPCookbook:337
exten=>911,102,Playback(ssnoservice) exten=>911,103,Macro(fastbusy) [forcedanalog] exten=>_9.,1,Dial(${DIALOUTANALOG}/${EXTEN:1},70) exten=>_9.,2,Macro(fastbusy) exten=>_9.,102,Macro(fastbusy) [fwd1out] exten=>_8.,1,SetCallerID(${FWDUSERID2}) exten=>_8.,2,SetCIDName(${FWD2USERNAME}) exten=>_8.,3,Dial(SIP/${EXTEN:1}@fwd1,70) exten=>_8.,4,Macro(fastbusy) exten=>_8.,5,Hangup [fwd2outpvt] exten=>_7.,1,SetCallerID(${FWDUSERID1}) exten=>_7.,2,SetCIDName(${FWD1USERNAME}) exten=>_7.,3,Dial(SIP/${EXTEN:1}@fwd2,70) exten=>_7.,4,Macro(fastbusy) exten=>_7.,5,Hangup [information] exten=>108,1,Dial(${DIALOUTANALOG}/${EXTEN},70) exten=>108,2,Macro(fastbusy) exten=>108,102,Playback(ssnoservice) exten=>108,103,Macro(fastbusy) ;LocalPSTN ; [pstnlocal] exten=>_021.,1,Dial(${DIALOUTANALOG}/${EXTEN:3}) exten=>_021.,2,Macro(fastbusy) exten=>_021.,102,Macro(dialoutsip,${EXTEN}) [tollfree] exten=>_0800.,1,Dial(${DIALOUTANALOG}/${EXTEN}) exten=>_0800.,2,Macro(fastbusy) exten=>_0800.,102,Macro(dialoutsip,${EXTEN}) VoIPCookbook:338
[longdistance] exten=>_0XXXXXXXXXX,1,Macro(dialoutsip,${EXTEN}) exten=>_0XXXXXXXXXX,2,Macro(fastbusy) exten=>_0XXXXXXXXXX,102,Dial(${DIALOUTANALOG}/${EXTEN}) exten=>_0XXXXXXXXXX,103,Macro(fastbusy) [home] include=>operator include=>e911 include=>forcedanalog include=>fwd1out include=>fwd2outpvt include=>information include=>local include=>pstnlocal include=>tollfree include=>longdistance ; ;Inbound ;analogline [nighttimeanalog] exten=>s,1,Wait(2) exten=>s,2,Background(nighttime) exten=>1,1,Goto(daytimeanalog,s,1) exten=>2,1,Voicemail(u2201) exten=>3,1,Voicemail(u2206) exten=>4,1,Voicemail(u2202) exten=>9,1,Playback(transfer) exten=>9,2,Ringing(1) exten=>9,3,Goto(local,2206,1) [daytimeanalog] exten=>s,1,Zapateller(answer|nocallerid) exten=>s,2,PrivacyManager exten=>s,3,Ringing(1) exten=>s,4,Dial(${MAINPHONE}&${KITCHEN},15) VoIPCookbook:339
exten=>s,5,Dial(${JESSICA},6) exten=>s,6,Dial(${BILL},6) exten=>s,7,Voicemail(u2201) exten=>s,8,Hangup [inboundanalog] include=>daytimeanalog|9:0021:00|*|* include=>nighttimeanalog|21:0009:00|*|* ;siplines ; [nighttimefwd1] exten=>s,1,Wait(2) exten=>s,2,Background(nighttime) exten=>1,1,Goto(daytimesip1,s,1) exten=>2,1,Voicemail(u2201) exten=>3,1,Voicemail(u2206) exten=>4,1,Voicemail(u2202) exten=>9,1,Playback(transfer) exten=>9,2,Goto(local,2206,1) [daytimefwd1] exten=>s,1,Dial(${MAINPHONE}&${KITCHEN},15) exten=>s,2,Dial(${JESSICA},6) exten=>s,3,Dial(${BILL},6) exten=>s,4,Voicemail(u2201) exten=>s,5,Hangup [inboundfwd1] include=>daytimefwd1|9:0021:00|*|* include=>nighttimefwd1|21:009:00|*|* [inboundsip] exten=>2055555,1,Goto(inboundfwd1,s,1) exten=>2012345,1,Goto(local,2206,1) ; ;InternalExtension VoIPCookbook:340
; [local] exten=>2201,1,Dial(${MAINPHONE},20,Tt) exten=>2201,2,Voicemail(u2201) exten=>2201,3,Hangup exten=>2201,102,Voicemail(b2201) exten=>2201,103,Hangup exten=>2202,1,Dial(${JESSICA},20,Tt) exten=>2202,2,Voicemail(u2202) exten=>2202,3,Hangup exten=>2202,102,Voicemail(b2202) exten=>2202,103,Hangup exten=>2203,1,Dial(${CHRISTOPHER},20,Tt) exten=>2203,2,Playback(vmnobodyavail) exten=>2203,3,Hangup exten=>2204,1,Dial(${KITCHEN},20,Tt) exten=>2204,2,Playback(vmnobodyavail) exten=>2204,3,Hangup exten=>2205,1,Dial(${PORCH},20,Tt) exten=>2205,2,Playback(vmnobodyavail) exten=>2205,3,Hangup exten=>2206,1,Dial(${BILL},20,Tt) exten=>2206,2,Playback(transfer) exten=>2206,3,Macro(billcellfwdoutsip2,${BILLCELLPHONE},${CALLERIDNUM}) exten=>2206,4,Voicemail(u2206) exten=>2206,5,Hangup exten=>2206,102,Voicemail(b2206) exten=>2206,103,Hangup exten=>2500,1,Wait,2 exten=>2500,2,VoicemailMain exten=>2500,3,Hangup ; ;Avarietyoffacilitiesthatcanbeusedfortesting VoIPCookbook:341
; exten=>2001,1,Answer exten=>2001,2,Playback(demoechotest) exten=>2001,3,Echo exten=>2001,4,Playback(demoechodone) exten=>2001,5,Hangup exten=>2002,1,Answer exten=>2002,2,WaitMusicOnHold(30) exten=>2002,3,Hangup exten=>2003,1,Answer exten=>2003,2,Wait(1) exten=>2003,3,SayUnixTime(||k) exten=>2003,4,SayUnixTime(||M) exten=>2003,5,Playback(vmand) exten=>2003,6,SayUnixTime(||S) exten=>2003,7,Wait(2) exten=>2003,8,Hangup exten=>2004,1,Answer exten=>2004,2,Wait(1) exten=>2004,3,Playback(vmextension) exten=>2004,4,SayDigits(${CALLERIDNUM}) exten=>2004,5,Wait(2) exten=>2004,6,Hangup exten=>2005,1,Goto(nighttimeanalog,s,1) ;exten=>2005,2,Playback(ssnoservice) ;exten=>2005,3,Playback(vmnobodyavail) ;exten=>2005,4,Playback(agentincorrect) ;exten=>2005,5,Playback(agentuser) ;exten=>2005,6,Playback(pbxinvalid) ;exten=>2005,7,Playback(ttsomethingwrong) ;exten=>2005,8,Playback(vmextension) ;exten=>2005,9,Playback(vmisunavail) ;exten=>2005,10,Playback(vmisonphone) ;exten=>2005,11,Playback(vmsorry) VoIPCookbook:342
exten=>2005,2,Hangup
VoIPCookbook:343
f fd i
:Setthestatisticsreportfrequencyonscreen.Defaultis1anddefaultunitisseconds. :Setthestatisticsdumplogreportfrequency.Defaultis60anddefaultunitisseconds. :SetthelocalIPaddressfor'Contact:','Via:',and'From:'headers. DefaultisprimaryhostIPaddress. inf :InjectvaluesfromanexternalCSVfileduringcallsintothescenarios. Firstlineofthisfilesaywhetherthedataistobereadinsequence(SEQUENTIAL), random(RANDOM),oruser(USER)order. Eachlinecorrespondstoonecallandhasoneormore';'delimiteddatafields. Thosefieldscanbereferredas[field0],[field1],...inthexmlscenariofile. SeveralCSVfilescanbeusedsimultaneously(syntax:inff1.csvinff2.csv...) infindex :filefield Createanindexoffileusingfield.Forexampleinfusers.csvinfindexusers.csv0 createsanindexonthefirstkey. ip_field :SetwhichfieldfromtheinjectionfilecontainstheIPaddressfromwhichtheclient willsenditsmessages.Ifthisoptionisomittedandthe'tui'optionispresent, thenfield0isassumed.Usethisoptiontogetherwith'tui' l :Setthemaximumnumberofsimultaneouscalls.Oncethislimitisreached, trafficisdecreaseduntilthenumberofopencallsgoesdown. Default:(3*call_duration(s)*rate). log_file :Setthenameofthelogactionslogfile. log_overwrite:Overwritethelogactionslogfile(defaulttrue). lost :Setthenumberofpacketstolosebydefault (scenariospecificationsoverridethisvalue). rtcheck :Selecttheretransmisisondetectionmethod:full(default)orloose. m :Stopthetestandexitwhen'calls'callsareprocessed mi :SetthelocalmediaIPaddress(default:localprimaryhostIPaddress) master :3pccextendedmode:indicatesthemasternumber max_recv_loops:Setthemaximumnumberofmessagesreceivedreadpercycle. Increasethisvalueforhightrafficlevel.Thedefaultvalueis1000. max_sched_loops:Setthemaximumnumberofcalslrunpereventloop. Increasethisvalueforhightrafficlevel.Thedefaultvalueis1000. max_reconnect:Setthethemaximumnumberofreconnection. max_retrans :MaximumnumberofUDPretransmissionsbeforecallendsontimeout. Defaultis5forINVITEtransactionsand7forothers. max_invite_retrans:MaximumnumberofUDPretransmissionsforinvitetransactions beforecallendsontimeout. max_non_invite_retrans:MaximumnumberofUDPretransmissionsfornoninvitetransactions beforecallendsontimeout. VoIPCookbook:345
max_log_size:Whatisthelimitforerrorandmessagelogfilesizes. max_socket :Setthemaxnumberofsocketstoopensimultaneously.Thisoptionissignificant ifyouuseonesocketpercall.Oncethislimitisreached, trafficisdistributedoverthesocketsalreadyopened.Defaultvalueis50000 mb :SettheRTPechobuffersize(default:2048). message_file:Setthenameofthemessagelogfile. message_overwrite:Overwritethemessagelogfile(defaulttrue). mp :SetthelocalRTPechoportnumber.Defaultis6000. nd :NoDefault.DisablealldefaultbehaviorofSIPpwhicharethefollowing: OnUDPretransmissiontimeout,abortthecallbysendingaBYEoraCANCEL Onreceivetimeoutwithnoontimeoutattribute,abortthecallbysendingaBYE oraCANCEL OnunexpectedBYEsenda200OKandclosethecall OnunexpectedCANCELsenda200OKandclosethecall OnunexpectedPINGsenda200OKandcontinuethecall Onanyotherunexpectedmessage,abortthecallbysendingaBYEora CANCEL nr :DisableretransmissioninUDPmode. nostdin :Disablestdin. p :Setthelocalportnumber.Defaultisarandomfreeportchosenbythesystem. pause_msg_ign:Ignorethemessagesreceivedduringapausedefinedinthescenario periodic_rtd :Resetresponsetimepartitioncounterseachlogginginterval. plugin :Loadaplugin. r :Setthecallrate(incallsperseconds).Thisvaluecanbechangedduringtest bypressing'+','_','*'or'/'.Defaultis10. pressing'+'keytoincreasecallrateby1*rate_scale, pressing''keytodecreasecallrateby1*rate_scale, pressing'*'keytoincreasecallrateby10*rate_scale, pressing'/'keytodecreasecallrateby10*rate_scale. Iftherpoptionisused,thecallrateiscalculatedwiththeperiodinms givenbytheuser. rp :Specifytherateperiodforthecallrate.Defaultis1secondanddefaultunit ismilliseconds.Thisallowsyoutohavencallseverymmilliseconds (byusingrnrpm). Example: r7rp2000==>7callsevery2seconds. r10rp5s=>10callsevery5seconds. rate_scale :Controltheunitsforthe'+','','*',and'/'keys. rate_increase:Specifytherateincreaseeveryfdunits(defaultisseconds). Thisallowsyoutoincreasetheloadforeachindependentloggingperiod. VoIPCookbook:346
Example:rate_increase10fd10s==>increasecallsby10every10seconds. rate_max :Ifrate_increaseisset,thenquitaftertheratereachesthisvalue. Example:rate_increase10rate_max100==>increasecallsby10until100cpsishit. no_rate_quit:Ifrate_increaseisset,donotquitaftertheratereachesrate_max. recv_timeout:Globalreceivetimeout.Defaultunitismilliseconds.Iftheexpectedmessageisnot received,thecalltimesoutandisaborted. send_timeout:Globalsendtimeout.Defaultunitismilliseconds.Ifamessageisnotsent (duetocongestion),thecalltimesoutandisaborted. sleep :Howlongtosleepforatstartup.Defaultunitisseconds. reconnect_close:Shouldcallsbeclosedonreconnect? reconnect_sleep:Howlong(inmilliseconds)tosleepbetweenthecloseandreconnect? ringbuffer_files:Howmanyerror/messagefilesshouldbekeptafterrotation? ringbuffer_size:Howlargeshoulderror/messagefilesbebeforetheygetrotated? rsa :Settheremotesendingaddresstohost:portforsendingthemessages. rtp_echo :EnableRTPecho.RTP/UDPpacketsreceivedonportdefined bympareechoedtotheirsender.RTP/UDPpacketscomingon thisport+2arealsoechoedtotheirsender(usedforsoundandvideoecho). rtt_freq :freqismandatory.Dumpresponsetimeseveryfreqcallsinthelogfiledefined bytrace_rtt.Defaultvalueis200. s :SettheusernamepartoftheresquestURI.Defaultis'service'. sd :Dumpsadefaultscenario(embededinthesippexecutable) sf :Loadsanalternatexmlscenariofile.TolearnmoreaboutXMLscenariosyntax, usethesdoptiontodumpembeddedscenarios.Theycontainallthenecessaryhelp. shortmessage_file:Setthenameoftheshortmessagelogfile. shortmessage_overwrite:Overwritetheshortmessagelogfile(defaulttrue). oocsf :Loadoutofcallscenario. oocsn :Loadoutofcallscenario. skip_rlimit :Donotperformrlimittuningoffiledescriptorlimits. Default:false. slave :3pccextendedmode:indicatestheslavenumber slave_cfg :3pccextendedmode:indicatesthefilewherethemasterandslaveaddressesarestored sn :Useadefaultscenario(embeddedinthesippexecutable). Ifthisoptionisomitted,theStandardSipStoneUACscenarioisloaded. Availablevaluesinthisversion: 'uac':StandardSipStoneUAC(default). 'uas':SimpleUASresponder. 'regexp':StandardSipStoneUACwithregexpandvariables. 'branchc':Branchingandconditionalbranchinginscenariosclient. 'branchs':Branchingandconditionalbranchinginscenariosserver. VoIPCookbook:347
Default3pccscenarios(see3pccoption): '3pccCA':ControllerAside(mustbestartedafterallother3pccscenarios) '3pccCB':ControllerBside. '3pccA':Aside. '3pccB':Bside. stat_delimiter:Setthedelimiterforthestatisticsfile stf :Setthefilenametousetodumpstatistics t :Setthetransportmode: u1:UDPwithonesocket(default), un:UDPwithonesocketpercall, ui:UDPwithonesocketperIPaddress. TheIPaddressesmustbedefinedintheinjectionfile. t1:TCPwithonesocket, tn:TCPwithonesocketpercall, l1:TLSwithonesocket, ln:TLSwithonesocketpercall, c1:u1+compression(onlyifcompressionpluginloaded), cn:un+compression(onlyifcompressionpluginloaded). Thispluginisnotprovidedwithsipp. timeout :Globaltimeout.Defaultunitisseconds.Ifthisoptionisset,SIPpquitsafter nbunits(timeout20squitsafter20seconds). timeout_error:SIPpfailsiftheglobaltimeoutisreachedisset(timeoutoptionrequired). timer_resol:Setthetimerresolution.Defaultunitismilliseconds.Thisoptionhasanimpact ontimersprecision.SmallvaluesallowmorepreciseschedulingbutimpactsCPU usage.Ifthecompressionison,thevalueissetto50ms.Thedefaultvalueis10ms. sendbuffer_warn:ProducewarningsinsteadoferrorsonSendBufferfailures. trace_msg :DisplayssentandreceivedSIPmessagesin<scenariofilename>_<pid>_messages.log trace_shortmsg:DisplayssentandreceivedSIPmessagesasCSV in<scenariofilename>_<pid>_shortmessages.log trace_screen:Dumpstatisticscreensinthe<scenario_name>_<pid>_cenaris.logfile whenquittingSIPp.Usefultogetafinalstatusreportinbackgroundmode(bgoption). trace_err :Traceallunexpectedmessagesin<scenariofilename>_<pid>_errors.log. trace_calldebug:Dumpsdebugginginformationaboutabortedcallsto <scenario_name>_<pid>_calldebug.logfile. trace_stat :Dumpsallstatisticsin<scenario_name>_<pid>.csvfile. Usethe'hstat'optionforadetaileddescriptionofthestatisticsfilecontent. trace_counts:DumpsindividualmessagecountsinaCSVfile. trace_rtt :Allowtracingofallresponsetimesin<scenariofilename>_<pid>_rtt.csv. trace_logs :Allowtracingof<log>actionsin<scenariofilename>_<pid>_logs.log. VoIPCookbook:348
users
:Insteadofstartingcallsatafixedrate,begin'users'callsatstartup,and keepthenumberofcallsconstant. watchdog_interval:Setgapbetweenwatchdogtimerfirings.Defaultis400. watchdog_reset:Ifthewatchdogtimerhasnotfiredinmorethanthistimeperiod, thenresetthemaxtriggerscounters.Defaultis10minutes. watchdog_minor_threshold:Ifithasbeenlongerthanthisperiodbetweenwatchdog executionscountaminortrip.Defaultis500. watchdog_major_threshold:Ifithasbeenlongerthanthisperiodbetweenwatchdog executionscountamajortrip.Defaultis3000. watchdog_major_maxtriggers:Howmanytimesthemajorwatchdogtimercanbetripped beforethetestisterminated.Defaultis10. watchdog_minor_maxtriggers:Howmanytimestheminorwatchdogtimercanbetripped beforethetestisterminated.Defaultis120. ap :Setthepasswordforauthenticationchallenges.Defaultis'password tls_cert :SetthenameforTLSCertificatefile.Defaultis'cacert.pem tls_key:SetthenameforTLSPrivateKeyfile.Defaultis'cakey.pem' tls_crl :SetthenameforCertificateRevocationListfile. Ifnotspecified,X509CRLisnotactivated. 3pcc :Launchthetoolin3pccmode("ThirdPartycallcontrol"). Thepassedipaddressisdependingonthe3PCCrole. Whenthefirsttwincommandis'sendCmd'thenthisis theaddressoftheremotetwinsocket.SIPpwilltryto connecttothisaddress:porttosendthetwincommand (Thisinstancemustbestartedafterallother3PCCscenario). Example:3PCCCAscenario. Whenthefirsttwincommandis'recvCmd'thenthisis theaddressofthelocaltwinsocket.SIPpwillopen thisaddress:porttolistenfortwincommand. Example:3PCCCBscenario. tdmmap :GenerateandhandleatableofTDMcircuits. Acircuitmustbeavailableforthecalltobeplaced. Format:tdmmap{03}{99}{58}{131} key :keywordvalue Setthegenericparameternamed"keyword"to"value". set :variablevalue Settheglobalvariableparameternamed"variable"to"value". dynamicStart:variablevalue Setthestartoffsetofdynamic_idvaraiable dynamicMax:variablevalue.Setthemaximumofdynamic_idvariable VoIPCookbook:349
dynamicStep:variablevalue.Settheincrementofdynamic_idvariable Signalhandling: SIPpcanbecontrolledusingposixsignals.Thefollowingsignalsarehandled: USR1:Similartopress'q'keyboardkey.IttriggersasoftexitofSIPp. NomorenewcallsareplacedandallongoingcallsarefinishedbeforeSIPpexits. Example:killSIGUSR1732 USR2:Triggersadumpofallstatisticsscreensin<scenario_name>_<pid>_screens.logfile. Especiallyusefulinbackgroundmodetoknowwhatthecurrentstatusis. Example:killSIGUSR2732 Exitcode: Uponexit(onfatalerrororwhenthenumberofaskedcalls(moption)isreached, sippexitswithoneofthefollowingexitcode: 0:Allcallsweresuccessful 1:Atleastonecallfailed 97:exitoninternalcommand.Callsmayhavebeenprocessed 99:Normalexitwithoutcallsprocessed 1:Fatalerror Example: Runsippwithembeddedserver(uas)scenario: ./sippsnuas Onthesamehost,runsippwithembeddedclient(uac)scenario ./sippsnuac127.0.0.1
VoIPCookbook:350
VoIPCookbook:351