How to …

… automate CDR upload to xDR mediator?

Create a User for File Transfer

Configure the FTP Server for the CDR Extraction Instance

… import CDRs with charged amounts?

Configure xDR Mediator Instances on the Configuration Server

Enable the Import Charge on the Configuration Server

Declare Rules for Data Transformation

Configure Services in PortaBilling®

Test the xDR Import

… merge several CDRs into a single xDR record?

… import CDRs in TAP3 format?

Add the CDR Extraction Instance

Add the CDR Rating Instance

Add the Interim Data Storage

Configure Services in PortaBilling®

… automate CDR upload to xDR mediator?

To automate the CDR delivery from your vendor to the xDR mediator, create the entry point to the xDR mediator for file transfer via the FTP /SFTP protocol.

 

To make this happen, perform the following steps:

Create a User for File Transfer

For your vendor to upload source CDR files, create a special user for file transfer. Your vendor uses this user’s credentials to access the xDR mediator and upload the CDR source files to the specified folder.

 

1.     On the Configuration server web interface, click the Users tab.

2.     Click Create.

 

User for file upload

 

3.     Fill in the user details:

·       Login – Specify the login for the user.

·       Email – Specify the user’s email address.

·       Password – Specify the password for the user.

·       Define the time when this user is active using the Activation / Expiration Date calendars.

·       Role – Select the FileTransfer role from the list.

4.     Click Save.

Configure the FTP Server for the CDR Extraction Instance

1.     Go to the Configurations tab on the Configuration server.

2.     Clone the existing configuration.

3.     From the Configuration tree, select Auxiliaries ->CDR Mediation -> CDR Extraction -> <cdr-extraction_instance>.

 

FTP server configuration

 

4.     In the CDRSourceFTPServer group, specify the following:

·       enable – Select Yes.

·       login – Select the user you just created for the file transfer.

·       upload_directory – Specify to which directory the source CDR files will be uploaded. You can leave the default $ (name), value or additionally, define an upload directory for it (e.g. $(name)/upload).

5.     Click Save to save the configuration.

6.     Click Verify.

7.     Click Check / Apply to apply this configuration.

… import CDRs with charged amounts?

Though more often than not you will calculate and apply charges to your PortaBilling® customers, it is possible that some vendors might send you CDRs that already contain charged amounts.

 

For example, a source CDR file might look like this:

 

 

In this case, you need to pass these charges over to PortaBilling® and to also reproduce the xDR records on your customer invoices correctly (i.e. differentiate them per services used, match xDRs against individual destinations, etc.) and also on your statistics reports.

 

PortaBilling® grants you additional flexibility in handling the CDRs that have charged amounts: you can treat the price provided as final and import it as is or apply an additional surcharge on top of it according to the tariff rates.

 

Please refer to the xDR Import Configuration handbook for the basic configuration of the xDR Mediation utility.

 

To import CDRs with charged amounts, perform the following steps:

Configure xDR Mediator Instances on the Configuration Server

1.     Add and configure the CDR Extraction instance as described in the xDR Import Configuration handbook.

2.     In the CDRSource group, add the following columns to the column_list option:

 

Attribute Name

Type

Description

Override-Rate-Price

int (1 or 0)

·       1 means that the total charge should be exactly equal to the provided amount.

·       0 (default) means that the rate charge will be calculated according to the applicable tariff and then this calculated amount and the one provided via the Amount parameter will be added up.

Amount

Decimal

Amount to be charged to the end-user.

VendorAmount

Decimal

Amount to be applied to the vendor. It is defined if vendor charges are provided.

ResellerAmount

Decimal

Amount to be charged to the reseller. It is defined if vendor charges are provided in the source file.

 

 Since the Override-Rate-Price attribute reflects your decision about how to charge customers, it is optional in the column_list. Hardcode this attribute and its value for the CDR Extraction instance configuration. Please refer to the Declare Rules for Data Transformation section for details.

 

CDR Extraction instance

 

Thus, for example, your column list for voice call CDRs might look like this:

 

 User-Name,Calling-Station-Id,Called-Station-Id,Acct-Session-Time,h323-connect-time,h323-disconnect-time,PortaOne-Service-Type,h323-remote-address,Amount

 

3.     Perform the Add the CDR Rating Instance and the Add the Interim Data Storage steps from the xDR Import Configuration handbook to complete the xDR mediation utility configuration.

4.     Click Save to save the configuration.

Enable the Import Charge on the Configuration Server

1.     From the Configuration tree, select BillingEngine->FeatureModules-> ImportCharge_Enabled option and set its value as Yes.

 

 

2.     Click the Save button and then the check_apply Verify button.

3.     Verify the new configuration and click the check_apply Check / Apply button.

Declare Rules for Data Transformation

To instruct PortaBilling® on how to deal with charged amounts in source CDRs, utilize the data transformation tool – the built-in function on the xDR Mediation utility. It enables you to define the additional fields and their values that are not present in source files and then modify the original .csv data.

 

We recommend that you use custom modules for the data transformation rules declaration. However, in case you only make slight modifications, you can create a local configuration file and declare the data transformation rules within it. Please refer to the Virtual Fields for xDR Import handbook for additional information.

 

At this step, declare the following rules:

8.     add the value for the “Overwrite-Rate-Price” field;

9.     modify the “Amount” field values (e.g. if your vendor provides you with the charges in cents).

 

1.     Log in to the server with the xDR mediator configured (e.g. the web server) using ssh.

2.     Create a local configuration file in one of the available text editors (e.g. Vim):

 

sudo vim /home/porta-cdrmediator/etc/cdr_export.<cdr-extraction_instance_name>.local.conf

 

where the <cdr-extraction_instance_name> is the name of the corresponding cdr-extraction instance.

 

3.     Define the data transformation rules within.

 Important! Make sure it has the [DataTransformation] section header before the rules definition. So then, your configuration file might look like this:

 

[DataTransformation]

Init=<<PERL

use Porta::CDR_Import::Utils;

use Porta::CDR_Import::CUCM;

 

PERL

Amount=$data{'Amount'} ? ($data{'Amount'}/100.) : 0

Overrite-Rate-Price= return '1'

4.     Save the configuration file.

 

  After you have defined the data transformation rules in the file, you need to add the file to Deposit Files via the configuration server web interface in order to maintain it throughout future system upgrades.

 

5.     Restart the CDR-extraction service in order to apply changes. Use the following command:

 

sudo systemctl restart cdr-extd@<cdr-extraction_instance_name>

 

 Consider restarting the service during an off-peak time or after all the files in the queue have been processed.

Configure Services in PortaBilling®

Configure services in PortaBilling® as described in the xDR Import Configuration handbook. If you do not apply additional charges on top of the ones from the source file, define a zero price for rates in the customer tariff.

Test the xDR Import

1.     Upload the source CDR file as described in the xDR Import Configuration handbook.

2.     From the Statistics Statistics section of the Admin-index, select CDR Mediation.

 

 

 

3.     Search for the processed CDR collection and click the xDRs XDRs icon to view detailed information about the imported CDRs.

4.     Click the Details Details icon to see detailed information about an individual xDR.

5.     Click the Log BE Log icon to check log files for a particular xDR record with the BE Log Viewer.

… merge several CDRs into a single xDR record?

Sometimes a vendor may provide several CDRs that apply to the same session (e.g. if a call passes several gateways before being delivered to the callee and each gateway creates its own CDR). Or, you may wish to aggregate multiple records for the same service (e.g. charges for DID usage from some third-party) into a single record and subtract a single charge from a customer’s balance.

 

To differentiate CDRs that apply to the same session from others, they have the same identification parameter – the so-called aggregation key. Using this key, PortaBilling® identifies CDRs and merges them into a single xDR record.

 

Let’s say you receive CDRs marked with an aggregation key. To import them into PortaBilling®, do the following:

 

1.     Add the “aggregation_key” column header to the column_list option for the CDR Extraction instance.

 

 

2.     Configure the xDR import service as described in the xDR Import Configuration handbook.

3.     Upload the source file to PortaBilling®.

4.     Verify the import results:

 

… import CDRs in TAP3 format?

When a mobile subscriber travels abroad, they use your services from a foreign network. In order to bill the subscriber correctly, the information on service usage must be passed to the home network.

 

Transferred Account Procedure (TAP) is the mechanism by which wireless operators exchange roaming billing information. It is also the standard, and defines which information on roaming usage must be passed among operators. TAP3 is the latest version of this standard.

 

PortaBilling® has a built-in set of demo modules for TAP3 file transformation and processing for voice calls and data transfer services. Thus, if you operate as an MVNO, you receive the source CDR files in TAP3 format and must import them into PortaBilling® to bill your mobile subscribers.

 

This section describes a sample configuration of the TAP3 CDR import using demo modules. For a more sophisticated configuration that implies custom-tailored module development, please contact the PortaOne Support team. Please note that implementing the xDR mediator module requires specialized programming and testing skills. Such assistance is not included in PortaCare and is billed separately.

Add the CDR Extraction Instance

1.     Go to the Configurations tab on the Configuration server.

2.     Clone the existing configuration.

3.     From the Configuration tree, select Auxiliaries ->CDR Mediation -> CDR Extraction and click the Wor1F12 Instance Create icon.

4.     Fill in the Instance create form:

5.     Server – Select one of your servers. The one recommended is the web server;

6.     Service IP – Select one of the web server’s IP addresses. You may utilize a private IP address for better security (e.g. to avoid possible brute force attacks). Please note that the CDR Extraction instance cannot have the same IP address as the RADIUS instance.

7.     Click Save.

8.     In the CDRSource group specify the following parameters:

·       type – Select the TAP3 CDR source file type from the list.

·       file_pattern – Specify the file name pattern. It may contain the wildcard (e.g. abc*.tap). The xDR mediator will import only those files with names that fit this pattern.

·       files_input_directory – Specify the path to the folder from which the xDR mediator will extract the source files (e.g. /porta_var/upload).

·       time_zone – Select the time zone in which the xDRs will be imported. However, if a particular time zone is specified in the source file, it will override the selected time zone.

 

TAP3 CDR import

 

1.     In the Data Transformation group specify the following parameters:

·       lib – Specify the path to the TAP3 data transformation module. Type in the following string: /home/porta-cdrmediator/test/site_lib/

·       module – Specify the name of the data transformation module. Type in TestHelper::TAP3 here.

2.     In the Global group specify how many parallel processes will convert source CDRs and send CDR collections to interim data storage. Leave the default value here for now.

3.     In the Output group specify the following:

·       min_freq – The time interval during which the data is exported from the input folder if processing a large data source. Default value is 3600 sec.

·       separate_collections – Defines how the output CDR collections are separated.

4.     Click Save.

Add the CDR Rating Instance

Refer to the xDR Import Configuration handbook for guidelines on how to add the CDR Rating instance.

Add the Interim Data Storage

1.     From the Configuration tree select DB->Elasticsearch-><elasticsearch_instance>

2.     Click Add and select the interim-data value for the with_indices option.

 

 

3.     Click the Save button and then the check_apply Verify button.

4.     Verify the new configuration and click the check_apply Check / Apply button.

Configure Services in PortaBilling®

Configure services in PortaBilling® as described in the xDR Import Configuration handbook.