mvts manual v2

12
VoiceMaster MVTS billing module manual Voicemaster (VM2000) MVTS BILLING MODULE Module description 1

Upload: evamarie-david

Post on 29-Nov-2014

275 views

Category:

Documents


9 download

TRANSCRIPT

Page 1: MVTS Manual v2

VoiceMaster MVTS billing module manual

Voicemaster (VM2000) MVTS BILLING MODULE

Module description

1

Page 2: MVTS Manual v2

VoiceMaster MVTS billing module manual

Nov 2008

2

Page 3: MVTS Manual v2

VoiceMaster MVTS billing module manual

Contents

Intro                                                                                                                                                                 ...........................................................................................................................................................   3  

Module description                                                                                                                                         ...................................................................................................................................   3  

Installation                                                                                                                                                      ................................................................................................................................................   5  

Configuration                                                                                                                                                  ............................................................................................................................................   5  File downloading procedure                                                                                                                         ...................................................................................................................   5  Preparing VM billing system to collect and bill MVTS CDRs                                                                   .............................................................   7  

3

Page 4: MVTS Manual v2

VoiceMaster MVTS billing module manual

Intro

MVTS system known as well designed system for wholesale traffic.  Billing sub­system is only available   in  latest  professional version releases of MVTS (known as MVTS II).    Other (older) versions of MVTS are capable for RADIUS and offline CDR billing by third­party billing systems. There are a number of external billing systems on the market     which can work with MVTS – Billbery, MeraBilling, Alepo, CDR analyzer. Every billing system is unique.   VM2000 VOIP platform from sysmaster (www.sysmaster.com) has unique and very flexible billing system, it has almost all possible custom billing features  like route/rate switching depending from ANI/DN/DNIS prefix, calling plan minutes for a range of destination and lots of more.  But due to a big flexibility and huge number of functions   ­ this billing is very resource consuming (mainly DB billing procedures). 

VM2000 can be configured to work as billing system for MVTS via radius without any custom modules and patches. Just need to be sure that MVTS sends the origination IP address as a PIN, and VM can   recognize   it   and  do   IP  authentication  based  on   it.  However,   to   for  multiple   auth   IP addresses per  account  ­ you need custom patch, but this is not the theme of this manual. 

VoiceMaster Radius billing   works great    when response time from the billing engine (DB billing procedures)  suitable for radius server timeout ( < 5 sec) . However, when billing subsystem is full of data (rate/route tables keeps more then 100 000 rows, CDR table over 10 000 000 rows etc..) – radius is not stable (message ”ERROR: error reading from socket” is on VM radius log /home/manager/debug/radius/radius_calls.log). This is not a bug, just billing system overloaded, and need to add resources or do rate/route table optimization, upload CDR to files etc.

NOTE!:  Module   development   is   done   by   third   party   company,   which   is   not   related   to sysmaster. All modification, which made in the system while module installation   done without having root access, but connection to the DB is used under “System Administrator” role. In case your Vm server is on support – you have to inform sysmaster support team about it. At any time, you can ask this module suppliers to recover VM server into original  state.

Module description

This  module  was created as  alternative   to  VM RADIUS billing for  MVTS system.  Idea  is simple: 

­ automatically download new CDR files from MVTS  using rsync (over ssh);­ every minute run file collector  script,  which find new files and register   them to Billing 

system, placing them in queue for billing­ every 5 minute ­ run MVTS billing module , which takes new files, load them to the Billing 

system, take each CDR line and emulate the call in VM billing system.Files: collector.sh;  mvts_billing.pl Stored procedures: sp_cdr_import_stage (and 5 more)This   module,   by   other   words,   generates   traffic   based   on   CDR.   Every   CDR   passed   thru 

traditional VM billing system exactly like a regular call, and processed by the same auth/rating/rouing procedures. This call emulation results billing call history  per every account, statements for providers and clients. 

Technically, for advanced users, I can explain shortly in steps, what is done:After   file   upload   to   the   certain   folder   (for   each  MVTS     there   is   a   separate   folder   –   see 

configuration part of this manual), the perl script mvts_bill.pl  parses the  MVTS CDR file, extract the required   fields,   and   generate   the   BCP   file,   which   is   uploaded   to   Sybase   DB   temporary   table   – 

4

Page 5: MVTS Manual v2

VoiceMaster MVTS billing module manual

cdr_import_stage. Next – the procedure  sp_cdr_import_stage  is executed in DB, which analize the uploaded   data,   removes   duplications,   corrects   datetime   formats,   remove   zero   calls   and   sarts sp_call_finish procedure with call detailes. Procedure sp_call_fiish tries to finish the call with given session_id, but fails  to find it in current calls (callers) and emulate the call start (this is where we need option “Enable exception billing” to be set). Once call start is amulated – sp_call_finish   starts from beginning, finds the call and finishs/stops/bills it. After this – call appears in call history. In case call failed to start for some reason (route not found, rate not found, account not found) – CDR is ignored, counter   “Account not found” is increased, and report shows this counter per every uploaded MVTS cdr file (see last section of this manual).

5

Standard mvts procedures:

- Call routing procedures - Call signaling - Call proxy - Codec conversion - Protocol conversion

Writing CDRs locally to files:

/usr/local/mvts/billing/*

Incoming H323/SIP calls from clients

H323/SIP calls to termination providers

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,

CDR  files downloading proccess

rsync request

Picture 1. MVTS CDR billing schema

Page 6: MVTS Manual v2

VoiceMaster MVTS billing module manual

InstallationUsually, module installation and configuration is done by me (the creator), it saves your time, and, 

at least, you have guarantee, that it works like described. However, you may want to know the process. Here it is:

­ put files collector.sh and mvts_bill.pl to /home/manager/scripts/, ­ do DB modification of stored procedures (6 procedures)­ setup cron job to  run the /home/manager/scripts/collector.sh every minute,­ configure communication with MVTS using ssk key, like described in this manual, later and 

configure the Billing system (add MVTS as a gateway, add rates/routes/accounts)

Configuration

File downloading procedure

Communication  between VM and MVTS based on rsync  linux  tool.  This  command makes synchronization of files and folders, instead of copy them. Every time this command executed – only new parts of data (the difference) is downloaded.        In our case, the best and simple way to run rsync using ssh secure channel. MVTS should allow ssh   connection   from VM    for   user  manager  without  password.   Instead  –   the  PUB/PRIVATE authentication key pairs are used (this is default auth procedure of ssh). 

   Configuration steps of creating user and RSA auth keys:  1)  Create manager account at MVTS;

root@mvts#:   useradd  manager

1) Generate pub/private key for user manager at VM (passphrase is empty, just press enter  for all the questions)

manager@voicemaster:~> ssh­keygen ­t rsaGenerating public/private rsa key pair.Enter file in which to save the key (/home/manager/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/manager/.ssh/id_rsa.Your public key has been saved in /home/manager/.ssh/id_rsa.pub.The key fingerprint is:51:21:15:c5:4a:c1:8e:13:f9:c1:78:45:c9:3e:fc:21   manager@voicemaster manager@voicemaster:~> 

2) At MVTS create directory /home/manaer/.ssh and change owner to manager

mkdir /home/manaer/.ssh && chown manager.manager /home/manaer/.ssh

6

Page 7: MVTS Manual v2

VoiceMaster MVTS billing module manual

3) Insert public rsa key of user manager  at VM  /home/manager/.ssh/id_rsa.pub  to the MVTS, in file /home/manager/.ssh/authorized_keys2

cat /home/manager/.ssh/id_rsa.pub            (do it at VM, and copy the key)vi   /home/manager/.ssh/authorized_keys2    (do   it   at   MVTS,   press   I,   paste   the   key,   and  save&exit  ­ :wq )

In case everything is correct, you shold be able to login from VM to MVTS as manager without password. Try to connect here, in order to store the RSA key finger point (type YES when it asks):

manager@voicemaster:~> ssh mvtsThe authenticity of host 'mvts (192.168.1.111)' can't be established.RSA key fingerprint is 34:9d:71:0b:08:be:eb:b4:ac:39:8f:cc:db:a9:92:eb.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'mvts' (RSA) to the list of known hosts.manager@   mvts   :~   > 

Final step – is to give read permission for user manager to the files in MVTS CDR folder, by default is /usr/local/mvts/billing/*  

As alternative, for security reasons, you can setup automatic file uploading from MVTS to VM. For that, you need to repeat the procedure with creating users and auth key pairs, but generate key pair (priv/pub)   at   MVTS   server,   and   put   PUB   key   to   VM   manager   profile: /home/manager/.ssh/authorized_keys2. Then, run periodically CDR files synchronization using rsync (most optimal tool) every minute, 10 minutes, or every hour.  Add this line at the MVTS server crontab (correct the path, address, ports according to your locations):

crontab –e

 */5 * * * *   /usr/bin/rsync ­a ­e 'ssh ­p 22' /usr/local/mvts/billing/* manager@VM_SERVER _IP  /home/manager/upload/cdr/Mera  >/dev/null 2>&1

­ where folder /home/manager/upload/cdr/Mera  is predefined, the format is:

     /home/manager/upload/cdr    + GW_ID      GW_ID – it is gw_id for MVTS gateway, which is added to gateway list:   Route­>gateway in 

VM admin console.  (See next configuration step).

7

Page 8: MVTS Manual v2

VoiceMaster MVTS billing module manual

Preparing VM billing system to collect and bill MVTS CDRs

Voicemaster MVTS billing module can work with multiple MVTS gateways. Every GW should be present in VM gateway list, and have correct IP address.  This IP address used for file downloading and management purposes. Client IP address and termination GW should also be correctly set in vm billing system like for regular call traffic. 

 Configuration steps:

Add customer account with IP address authentication

Picture 1. Creating customer account with IP authentication

8

Page 9: MVTS Manual v2

VoiceMaster MVTS billing module manual

It is supposed, that routing/rate table “System[0]”,”System Route[0]”, keeps the correct prefixes and rates to bill the CDR. Other wise – calls won’t be billed  due to error “No route to destination” or “No billing rate found for …”.  

add MVTS to the VM gateway list, putting the IP address and GW_ID, name to the form. 

Picture 2. Adding new MVTS gateway to VM.

NOTE: the GW_ID is used as a folder name to keep the CDR files for this GW, it is automatically created   in  VM system  ­   /home/manager/upload/cdr/GW_ID.  Each  MVTS GW will  have   it’s  own folder,   you   can   add   unlimited   gateways   to   the   system,  keeping   GW_ID   unique   for   each   MVTS gateway. 

add this GW to the “MVTS CDR Billing” list. This step is important, it tells system to run MVTS billing for this GW, i.e. connect to it via ssh, download files and bill them. 

9

Page 10: MVTS Manual v2

VoiceMaster MVTS billing module manual

Picture 3. Adding MVTS GW for billing

If you did everything correct, within a minute MVTS cdr files should be appeared in the GW list. You have to reload tree to see the MVTS gateway files.

Picture 4. Refreshing the menu tree

10

Page 11: MVTS Manual v2

VoiceMaster MVTS billing module manual

Once it is done, you have to see the list of CDRs, which are downloaded from MVTS server.  There is a possibility, that there are too much of files; it is requires some time to download them (depends from connection speed between VM and MVTS). Billing is executed at once after download process finished. 

Picture 5. Downloaded CDR files. 

From this  moment,   the billing is  started.  It   is  executing download and billing procedure every minute. In case when new cdr files found – they are loaded and billed automatically.

Fields “Billed %”, “Total Calls”, “Billed calls”, “Auth failed”  reflect the billing results.­ Billed %  ­ reflects dynamically the billing process percent;­ Total calls – total call count in uploaded CDR file;­ Zero calls  ­ count of calls in CDR with duration = 0. This  could ne rejected calls by MVTS 

due to some errors;­ Billed calls – important field, reflect  the count of calls which were authenticated (account 

found) and billed by the system rates. These CDRs are processed by the VM billing system, and you can see calls in account CDR history

­ Auth   failed   –reflects   count   of   calls,   which   was   not     authenticated   and   not   processed. “Account not found” error is generated  by the  system. Most probably you do not have such IP, prefix in your VM system.

11

Page 12: MVTS Manual v2

VoiceMaster MVTS billing module manual

Picture 4. Billed calls.

VM system billing is very flexible, it has almost all common features for billing the calls and services.   In  our  example,  MVTS files  with  total   file  count  65000  rows was billed  for  6  minutes. Mostly, time is spent for file uploading and validation. Billing itself  took about 1 minute. 

12