Release

Search

How to…

Link copied to clipboard

… automate CDR upload to xDR mediator?

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
  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?

Link copied to clipboard

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:

image006

In this case, you need to pass these charges over to PortaBilling and to also reproduce the xDR records on your customer invoices correctly (e.g., 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

Link copied to clipboard
  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.

    timesaver 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 step 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

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

    Enable the import charge on the Configuration server

  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

Link copied to clipboard

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:

  1. Add the value for the “Overwrite-Rate-Price” field;
  2. Modify the “Amount” field values (e.g., if your vendor provides you with the charges in cents).
  3. Log in to the server with the xDR mediator configured (e.g., the web server) using ssh.
  4. 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.

  5. Define the data transformation rules within.
    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'
  6. Save the configuration file.

    timesaver 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.

  7. 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

Link copied to clipboard

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

Link copied to clipboard
  1. Upload the source CDR file as described in the xDR import configuration handbook.
  2. Select xDR Mediation on the Dashboard.

    image014

  3. Search for the processed xDR collection and click the collection name to view detailed information about the imported xDRs.
  4. Click the det Details icon to see detailed information about an individual xDR.
  5. Click the image018 Log icon to check log files for a particular xDR record with the Log Viewer.

… merge several CDRs into a single xDR record?

Link copied to clipboard

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.

    Add the “aggregation_key” column header

  2. Configure the xDR import service as described in the xDR import configuration handbook.
  3. Upload the source file to PortaBilling.
  4. Click the det Details icon to verify the import results.

… import CDRs in TAP3 format?

Link copied to clipboard

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.

If you need PortaOne Demo modules for TAP3 file transformation, please contact PortaOne Support team. After you receive the modules, you should put them to /home/porta-cdrmediator on the same server where the xDR mediator instance is created.

 

The xDR import configuration, e.g., when you need to import source files of a new type, add custom data transformation rules, implement a custom xDR Mediator module, and so on; must be done by an experienced engineer with advanced knowledge of PortaBilling. Contact our sales team if you want the configuration to be done by the PortaOne engineers. Such assistance is not included in PortaCare and is billed separately.

This section describes a sample configuration of the TAP3 CDR import using demo modules.

Add the CDR extraction instance

Link copied to clipboard
  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:
    • Server – select one of your servers. The one recommended is the web server;
    • 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.
  5. Click Save.
  6. 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

  7. 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
    • module – specify the name of the data transformation module. Type in CDR_Convertor::Demo::TAP3 here.

      image024

  8. 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.
  9. 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.
  10. Click Save.

Add the CDR rating instance

Link copied to clipboard

Refer to the xDR import configuration handbook for guidelines on how to add the CDR Rating instance.

Configure services in PortaBilling

Link copied to clipboard

Configure services in PortaBilling as described in the xDR import configuration handbook.

… import CDRs in chronological order

Link copied to clipboard

Import in chronological order requires the use of one Extraction instance and one Rating instance. The number of simultaneous flows depends on the productivity of your system.

To configure an xDR import in chronological order, perform the following configuration on the Configuration server:

  1. Configure the CDR Extraction instance as described in the Add the CDR extraction instance section in the xDR Import Configuration handbook.
  2. Configure the CDR Rating instance as described in the Add the CDR rating instance section in the xDR Import Configuration handbook.
  3. In the Global group:
    • enable the import in chronological order (chronological import = Yes). The Rating instance then chronologically sorts CDRs within a collection, based on their time stamp (e.g., the connect time for a voice call) before importing them sequentially.

      Import in chronological order

    • enable CDR distribution among simultaneous flows (force_same_worker_for_username = Yes). The Rating instance then splits the CDRs based on their username amongst the workers. This ensures that CDRs for each specific username are imported sequentially in chronological order.
    • set the number of simultaneous flows (parallel process = 2). Each worker will then import CDRs for a specific username.

For example, if your source file has CDRs for only two usernames (e.g., 16045550101, 16045550202), set 2 parallel processes. The rating instance then simultaneously imports the CDRs for both users.

When processing a source file with CDRs for multiple usernames, the rating instance processes the CDRs sequentially in chronological order and splits the CDRs among available workers (2 by default). The rating instance ensures that each worker processes CDRs with the same username.

On this page

Release
What's new
Admin manuals
Handbooks
API
UI help
Search