TNG - Simple Custom Rate

We have build a new more simplified custom rate facility.
You need verison of TNG to use this new rate file.
Version 2013.06.14.12

Download and unrar - the password is ‘datatex’:

  • Windows version:

    For latest version: Windows dll
    all_custom_simple.rar (82.1 KB)

    You save the DLL file in the TNG Rates folder and edit the INI file.
    32bit Windows location:
    C:\Program Files\Datatex\TNG\Rates

    64Bit Windows Location:

    C:\Program Files (x86)\Datatex\TNG\Rates

  • Linux Version now also available
    all_custom_simple_linux.rar (100.5 KB)

    For latest version: Linux .so file

    You save the so file in the TNG Rates folder and edit the INI file.
    Linux location:

Create an ini file with the same name as your ratebook (dll or so file).

Add your rates in the INI file in the format described below.

The first line in the file is the overflow rate. This is the rate file that will be used to do a lookup for the cost, if your custom rate doesn’t cover the dialcode requested. If you do not add a rate, all entries not found, will have a 0 cost.
Thereafter follows all the custom rates you would like to define.

The format of the file is as follows:

DAILCODE=Rate Unit, Cost per Unit, Minimum Cost, Rate Type, Rate Description

Example file

2721=S, 0.001, 0.10, N, CapeTown
2711=M, 0.10, 0.50 ,N ,Johannesburg
2781=S, 0.04, 0.20, M, Mobile,
267= S, 0.12, 0.50, I, Botswana
2710=S, 0.02, 0.05, O,

This is the rates DLL that will be queried for a cost if this custom rate fails to find it in the INI file.
Only the last RATE entry will be loaded if multiple entries have been added.
Only DLL files from your current rates folder can be specified here.

The format of each field:
Countrycode+dialcode digits. A south African number for Cape Town number would be 2721 or 2721592 (if you want to be more specific), a South African Mobile Vodacom number would be 2782.
You can add more digits if you need to have a very specific match.
A botswana Landline number would be 2673

Rate Unit:
M = Per minute Rate
S = Per Second Rate
NOTE: Rate Unit is case sensitive, use capitals.

Cost Per Unit:
This is the value used for the cost calculations
This is a numeric value in the format Rands and Cents. E.g. “1.20” or “0.0003” (without the quotes)

Minimum Cost:
Same format as the Cost Per Unit. This value is used as the cost if the calculated cost is lower than this value.

Rate Type:
O=Other (none of the above) This is also the default value, if you do not specify a type
NOTE: Rate Type is case sensitive, use capitals.

Rate Description:
A description for this rate. TNG can not use this description for reporting.

Reloading your Rates
You can edit the INI file at anytime. You can then restart TNG and the rates will be reloaded.

If you want to reload the rate without restarting TNG, create another file with the same name as your rate, but give the extension “.reload”. If I use “MyCustomRate1.Dll”, the new file would be called “MyCustomRate1.reload”. The next time a rate look-up is done, the INI file will be reloaded first and the reload file deleted.

Creating multiple Custom rates
You can copy the DLL and INI file to another name if you need to have multiple custom rates for different trunks.
The default name is “all_custom_simple.dll” and “all_custom_simple.ini”. You can copy both files and as long as you keep the file name portion of the same. E.g.
“MyCustomRate1.dll” and “MyCustomRate1.ini”