MVTS Manual v2
MVTS Manual v2
VoiceMasterMVTSbillingmodulemanual
Nov2008
VoiceMasterMVTSbillingmodulemanual
Contents Intro ........................................................................................................................................................... 3 Moduledescription ................................................................................................................................... 3 Installation ................................................................................................................................................ 5 Configuration ............................................................................................................................................ 5 Filedownloadingprocedure ................................................................................................................... 5 PreparingVMbillingsystemtocollectandbillMVTSCDRs ............................................................. 7
VoiceMasterMVTSbillingmodulemanual
Intro
MVTSsystemknownaswelldesignedsystemforwholesaletraffic.Billingsubsystemisonly availableinlatestprofessionalversionreleasesofMVTS(knownasMVTSII). Other(older) versionsofMVTSarecapableforRADIUSandofflineCDRbillingbythirdpartybillingsystems. Thereareanumberofexternalbillingsystemsonthemarket whichcanworkwithMVTS Billbery,MeraBilling,Alepo,CDRanalyzer.Everybillingsystemisunique. VM2000VOIPplatformfromsysmaster(www.sysmaster.com)hasuniqueandveryflexible billingsystem,ithasalmostallpossiblecustombillingfeatureslikeroute/rateswitchingdepending fromANI/DN/DNISprefix,callingplanminutesforarangeofdestinationandlotsofmore.But duetoabigflexibilityandhugenumberoffunctions thisbillingisveryresourceconsuming (mainlyDBbillingprocedures). VM2000canbeconfiguredtoworkasbillingsystemforMVTSviaradiuswithoutanycustom modulesandpatches.JustneedtobesurethatMVTSsendstheoriginationIPaddressasaPIN,and VM can recognize it and do IP authentication based on it. However, to for multiple auth IP addressesperaccountyouneedcustompatch,butthisisnotthethemeofthismanual. VoiceMasterRadiusbilling worksgreat whenresponsetimefromthebillingengine(DB billingprocedures)suitableforradiusservertimeout(<5sec).However,whenbillingsubsystem isfullofdata(rate/routetableskeepsmorethen100000rows,CDRtableover10000000rows etc..)radiusisnotstable(messageERROR:errorreadingfromsocketisonVMradiuslog /home/manager/debug/radius/radius_calls.log).Thisisnotabug,justbillingsystemoverloaded, andneedtoaddresourcesordorate/routetableoptimization,uploadCDRtofilesetc. NOTE!: Module development is done by third party company, which is not related to sysmaster.Allmodification,whichmadeinthesystemwhilemoduleinstallation donewithout havingrootaccess,butconnectiontotheDBisusedunderSystemAdministratorrole.Incase yourVmserverisonsupportyouhavetoinformsysmastersupportteamaboutit.Atanytime, youcanaskthismodulesupplierstorecoverVMserverintooriginalstate.
Moduledescription
This module was createdas alternative toVMRADIUS billingforMVTS system. Idea is simple: automaticallydownloadnewCDRfilesfromMVTSusingrsync(overssh); everyminuterunfilecollectorscript,whichfindnewfilesandregisterthemtoBilling system,placingtheminqueueforbilling every5minuterunMVTSbillingmodule,whichtakesnewfiles,loadthemtotheBilling system,takeeachCDRlineandemulatethecallinVMbillingsystem. Files:collector.sh;mvts_billing.pl Storedprocedures:sp_cdr_import_stage(and5more) This module, by other words, generates traffic based on CDR. Every CDR passed thru traditionalVMbillingsystemexactlylikearegularcall,andprocessedbythesameauth/rating/rouing procedures.Thiscallemulationresultsbillingcallhistorypereveryaccount,statementsforproviders andclients. Technically,foradvancedusers,Icanexplainshortlyinsteps,whatisdone: After file upload to the certain folder (for each MVTS there is a separate folder see configurationpartofthismanual),theperlscriptmvts_bill.plparsestheMVTSCDRfile,extractthe required fields, and generate the BCP file, which is uploaded to Sybase DB temporary table 4
VoiceMasterMVTSbillingmodulemanual
cdr_import_stage.Nexttheprocedure sp_cdr_import_stage isexecutedinDB,whichanalizethe uploaded data, removes duplications, corrects datetime formats, remove zero calls and sarts sp_call_finishprocedurewithcalldetailes.Proceduresp_call_fiishtriestofinishthecallwithgiven session_id,butfailstofinditincurrentcalls(callers)andemulatethecallstart(thisiswhereweneed H323/SIPcallstotermination optionEnableexceptionbillingtobeset).Oncecallstartisamulatedsp_call_finishstartsfrom providers beginning,findsthecallandfinishs/stops/billsit.Afterthiscallappearsincallhistory.Incasecall Picture1.MVTSCDRbillingschema failedtostartforsomereason(routenotfound,ratenotfound,accountnotfound)CDRisignored, counter Accountnotfoundisincreased,andreportshowsthiscounterpereveryuploadedMVTS cdrfile(seelastsectionofthismanual).
- Call routing procedures - Call signaling - Call proxy - Codec conversion - Protocol conversion
rsyncrequest
every minute check for new cdrs at MVTS using rsync over ssh, do auth over ssh using user & pub DSA(RSA) key parse cdr files and upload them in VM database system Emulating calls from CDR, executing call start per every call and place it in callers table Billing calls using traditional VM billing system procedures Generate statements,
IncomingH323/SIPcalls fromclients
VoiceMasterMVTSbillingmodulemanual
Installation
Usually,moduleinstallationandconfigurationisdonebyme(thecreator),itsavesyourtime,and, atleast,youhaveguarantee,thatitworkslikedescribed.However,youmaywanttoknowtheprocess. Hereitis: putfilescollector.shandmvts_bill.plto/home/manager/scripts/, doDBmodificationofstoredprocedures(6procedures) setupcronjobtorunthe/home/manager/scripts/collector.sheveryminute, configurecommunicationwithMVTSusingsskkey,likedescribedinthismanual,laterand configuretheBillingsystem(addMVTSasagateway,addrates/routes/accounts)
Configuration
Filedownloadingprocedure
Communication between VM andMVTS basedonrsynclinux tool. This command makes synchronizationoffilesandfolders,insteadofcopythem.Everytimethiscommandexecuted onlynewpartsofdata(thedifference)isdownloaded. Inourcase,thebestandsimplewaytorunrsyncusingsshsecurechannel.MVTSshouldallow ssh connection from VM for user manager without password. Instead the PUB/PRIVATE authenticationkeypairsareused(thisisdefaultauthprocedureofssh).
ConfigurationstepsofcreatinguserandRSAauthkeys:
1)CreatemanageraccountatMVTS; root@mvts#:useraddmanager 1) Generatepub/privatekeyforusermanageratVM(passphraseisempty,justpressenterforall thequestions) manager@voicemaster:~>sshkeygentrsa Generatingpublic/privatersakeypair. Enterfileinwhichtosavethekey(/home/manager/.ssh/id_rsa): Enterpassphrase(emptyfornopassphrase): Entersamepassphraseagain: Youridentificationhasbeensavedin/home/manager/.ssh/id_rsa. Yourpublickeyhasbeensavedin/home/manager/.ssh/id_rsa.pub. Thekeyfingerprintis: 51:21:15:c5:4a:c1:8e:13:f9:c1:78:45:c9:3e:fc:21 manager@voicemaster:~>
manager@voicemaster
2) AtMVTScreatedirectory/home/manaer/.sshandchangeownertomanager mkdir/home/manaer/.ssh&&chownmanager.manager/home/manaer/.ssh 6
VoiceMasterMVTSbillingmodulemanual
3) InsertpublicrsakeyofusermanageratVM/home/manager/.ssh/id_rsa.pubtotheMVTS,in file/home/manager/.ssh/authorized_keys2 cat/home/manager/.ssh/id_rsa.pub(doitatVM,andcopythekey) vi /home/manager/.ssh/authorized_keys2 (do it at MVTS, press I, paste the key, and save&exit:wq) Incaseeverythingiscorrect,yousholdbeabletologinfromVMtoMVTSasmanagerwithout password.Trytoconnecthere,inordertostoretheRSAkeyfingerpoint(typeYESwhenitasks): manager@voicemaster:~>sshmvts Theauthenticityofhost'mvts(192.168.1.111)'can'tbeestablished. RSAkeyfingerprintis34:9d:71:0b:08:be:eb:b4:ac:39:8f:cc:db:a9:92:eb. Areyousureyouwanttocontinueconnecting(yes/no)?yes Warning:Permanentlyadded'mvts'(RSA)tothelistofknownhosts. manager@ :~ mvts >
FinalstepistogivereadpermissionforusermanagertothefilesinMVTSCDRfolder,by defaultis/usr/local/mvts/billing/* Asalternative,forsecurityreasons,youcansetupautomaticfileuploadingfromMVTStoVM. Forthat,youneedtorepeattheprocedurewithcreatingusersandauthkeypairs,butgeneratekeypair (priv/pub) at MVTS server, and put PUB key to VM manager profile: /home/manager/.ssh/authorized_keys2.Then,runperiodicallyCDRfilessynchronizationusingrsync (mostoptimaltool)everyminute,10minutes,oreveryhour.AddthislineattheMVTSservercrontab (correctthepath,address,portsaccordingtoyourlocations): crontabe */5**** /usr/bin/rsyncae'sshp22'/usr/local/mvts/billing/*manager@VM_SERVER_IP /home/manager/upload/cdr/Mera>/dev/null2>&1 wherefolder/home/manager/upload/cdr/Meraispredefined,theformatis:
VoiceMasterMVTSbillingmodulemanual
PreparingVMbillingsystemtocollectandbillMVTSCDRs
VoicemasterMVTSbillingmodulecanworkwithmultipleMVTSgateways.EveryGWshouldbe presentinVMgatewaylist,andhavecorrectIPaddress.ThisIPaddressusedforfiledownloadingand managementpurposes.ClientIPaddressandterminationGWshouldalsobecorrectlysetinvmbilling systemlikeforregularcalltraffic. Configurationsteps: AddcustomeraccountwithIPaddressauthentication
Picture1.CreatingcustomeraccountwithIPauthentication
VoiceMasterMVTSbillingmodulemanual
Picture2.AddingnewMVTSgatewaytoVM. NOTE:theGW_IDisusedasafoldernametokeeptheCDRfilesforthisGW,itisautomatically created in VM system /home/manager/upload/cdr/GW_ID. Each MVTS GW will have its own folder, you can add unlimited gateways to the system, keeping GW_ID unique for each MVTS gateway. addthisGWtotheMVTSCDRBillinglist.Thisstepisimportant,ittellssystemtorun MVTSbillingforthisGW,i.e.connecttoitviassh,downloadfilesandbillthem.
VoiceMasterMVTSbillingmodulemanual
Picture4.Refreshingthemenutree
10
VoiceMasterMVTSbillingmodulemanual
Picture5.DownloadedCDRfiles. From this moment,thebillingisstarted.Itisexecutingdownloadandbillingprocedureevery minute.Incasewhennewcdrfilesfoundtheyareloadedandbilledautomatically. FieldsBilled%,TotalCalls,Billedcalls,Authfailedreflectthebillingresults. Billed%reflectsdynamicallythebillingprocesspercent; TotalcallstotalcallcountinuploadedCDRfile; ZerocallscountofcallsinCDRwithduration=0.ThiscouldnerejectedcallsbyMVTS duetosomeerrors; Billedcallsimportantfield,reflectthecountofcallswhichwereauthenticated(account found)andbilledbythesystemrates.TheseCDRsareprocessedbytheVMbillingsystem, andyoucanseecallsinaccountCDRhistory Auth failed reflects count of calls, which was not authenticated and not processed. Accountnotfounderrorisgeneratedbythesystem.Mostprobablyyoudonothavesuch IP,prefixinyourVMsystem.
11
VoiceMasterMVTSbillingmodulemanual
Picture4.Billedcalls. VMsystembillingisveryflexible,ithasalmostallcommonfeaturesforbillingthecallsand services. In ourexample, MVTS files with total file count 65000 rows was billed for 6minutes. Mostly,timeisspentforfileuploadingandvalidation.Billingitselftookabout1minute.
12