TNG - Simple Custom Rate

Web based, multi-user, Telephone Management System with budget management and barring control

Moderators: Leon van Heerden, Luanda_Junzi, Belinda Frick, Lee Hendricks

TNG - Simple Custom Rate

Postby Leon van Heerden » Sat Jun 15, 2013 11:27 pm

We have build a new more simplified custom rate facility.
You need verison 1.1.1.11 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

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

    64Bit Windows Location:
    Code: Select all
    C:\Program Files (x86)\Datatex\TNG\Rates

  • Linux Version now also available

    For latest version: Linux .so file

    You save the so file in the TNG Rates folder and edit the INI file.
    Linux location:
    Code: Select all
    /opt/Datatex/TNG/Rates

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:
Code: Select all
RATE=za_telkom.dll
DAILCODE=Rate Unit, Cost per Unit, Minimum Cost, Rate Type, Rate Description


Example file
Code: Select all
RATE=za_telkom.dll
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,


RATE
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:
DIALCODE:
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:
L=Local
N=National
M=Mobile
I=International
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"
You do not have the required permissions to view the files attached to this post.
----
Leon van Heerden
http://www.datatex.co.za
Leon van Heerden
 
Posts: 332
Joined: Fri Oct 29, 2010 11:21 am
Location: Cape Town

Re: TNG - Simple Custom Rate

Postby Belinda Frick » Wed May 21, 2014 12:56 pm

For an example of how to add your own Simple Custom Rate,
refer to forum post: Re: TNG not costing

NOTE: You must replace the values in this post with your configuration (area information) and costing requirements as per service provider.
Belinda Frick
 
Posts: 3808
Joined: Fri Nov 12, 2010 4:25 pm

Re: TNG - Simple Custom Rate

Postby Andrew.Engelbrecht » Fri Jan 22, 2016 2:45 pm

I followed the instructions to setup a Simple Custom Ratebook, but no calls are costed; all R0.

Date Time ExtNumber Destination Account Outcome Ring Time Duration Cost
2016-01-20 07:46:11 7001276 27789928111 ADDITIONAL MTN CODE - (ZA) O_ANSWERED 00:17 00:00:03 R0.00
2016-01-20 07:46:45 7001276 27789928111 ADDITIONAL MTN CODE - (ZA) O_ANSWERED 00:16 00:00:03 R0.00
2016-01-20 08:40:47 7001286 27789928111 ADDITIONAL MTN CODE - (ZA) O_ANSWERED 00:02 00:00:03 R0.00
2016-01-20 08:41:07 7001286 27789928111 ADDITIONAL MTN CODE - (ZA) O_ANSWERED 00:03 00:00:17 R0.00
2016-01-20 09:01:49 7001226 27284251420 BREDASDORP - (ZA) O_ANSWERED 00:07 00:00:49 R0.00
2016-01-20 09:03:45 7001226 27789928111 ADDITIONAL MTN CODE - (ZA) O_ANSWERED 00:02 00:00:04 R0.00
2016-01-20 09:24:15 7001226 27285141182 SWELLENDAM - (ZA) O_ANSWERED 00:09 00:00:16 R0.00
2016-01-20 09:24:58 7001226 27824962277 GSM VODACOM EXPANSIO - (ZA) O_ANSWERED 00:06 00:00:30 R0.00
2016-01-20 09:25:42 7001226 27824962277 GSM VODACOM EXPANSIO - (ZA) O_ANSWERED 00:16 00:00:22 R0.00
2016-01-20 09:26:35 7001226 27789928111 ADDITIONAL MTN CODE - (ZA) O_ANSWERED 00:03 00:00:02 R0.00
2016-01-20 09:27:42 7001226 27284251132 BREDASDORP - (ZA) O_ANSWERED 00:09 00:01:34 R0.00
2016-01-20 10:05:53 7001226 27824962277 GSM VODACOM EXPANSIO - (ZA) O_ANSWERED 00:29 00:00:22 R0.00
2016-01-20 12:08:52 7001226 27835851292 GSM MTN - (ZA) O_ANSWERED 00:19 00:02:57 R0.00
2016-01-20 12:12:32 7001226 27285141182 SWELLENDAM - (ZA) O_ANSWERED 00:07 00:01:14 R0.00
2016-01-20 13:13:25 7001200 27789928111 ADDITIONAL MTN CODE - (ZA) O_ANSWERED 00:18 00:00:03 R0.00
2016-01-20 13:14:10 7001200 27789928111 ADDITIONAL MTN CODE - (ZA) O_ANSWERED 00:22 00:00:02 R0.00
2016-01-20 13:14:41 7001200 27789928111 ADDITIONAL MTN CODE - (ZA) O_ANSWERED 00:09 00:00:34 R0.00
2016-01-20 14:40:35 7001232 27284242422 BREDASDORP - (ZA) O_ANSWERED 00:07 00:02:52 R0.00
2016-01-20 14:52:58 7001232 27284241220 BREDASDORP - (ZA) O_ANSWERED 00:24 00:02:08 R0.00

I run TNG4* 1.1.1.13 with the all_custom_simple.so file dated 2013-11-08; renamed to za_twk_ecn.so with rwxr__r__ rights.

My ini (za_twk_ecn.ini) file comprises of the following entries.

RATE=za_telkom.dll
271=S, 0.032, 0, N, TELKOM
272=S, 0.032, 0, N, TELKOM
2721=S, 0.006, 0, N, TELKOM
2728=S, 0.006, 0, N, TELKOM
273=S, 0.032, 0, N, TELKOM
274=S, 0.032, 0, N, TELKOM
275=S, 0.032, 0, N, TELKOM
276=S, 0.032, 0, N, TELKOM
27710=S, 0.012, 0.0, M, MTN
27711=S, 0.012, 0.0, M, Vodacom
27712=S, 0.012, 0.0, M, Vodacom
27713=S, 0.012, 0.0, M, Vodacom
27714=S, 0.012, 0.0, M, Vodacom
27715=S, 0.012, 0.0, M, Vodacom
27716=S, 0.012, 0.0, M, Vodacom
27717=S, 0.012, 0.0, M, MTN
27718=S, 0.012, 0.0, M, MTN
27719=S, 0.012, 0.0, M, MTN
2772=S, 0.012, 0.0, M, VODACOM
2773=S, 0.012, 0.0, M, MTN
27741=S, 0.012, 0.0, M, Virgin Mobile
2774=S, 0.0132, 0.0, M, CELLC
27761=S, 0.012, 0.0, M, VODACOM
27762=S, 0.012, 0.0, M, VODACOM
27763=S, 0.012, 0.0, M, VODACOM
27764=S, 0.012, 0.0, M, VODACOM
27765=S, 0.012, 0.0, M, VODACOM
27766=S, 0.012, 0.0, M, VODACOM
27767=S, 0.012, 0.0, M, MTN
27768=S, 0.012, 0.0, M, MTN
27769=S, 0.012, 0.0, M, MTN
2776=S, 0.012, 0.0, M, VODACOM
2778=S, 0.012, 0.0, M, MTN
2779=S, 0.012, 0.0, M, Vodacom
27810=S, 0.012, 0.0, M, MTN
27811=S, 0.0132, 0.0, M, 8TA
27812=S, 0.0132, 0.0, M, 8TA
27813=S, 0.0132, 0.0, M, 8TA
27814=S, 0.0132, 0.0, M, 8TA
27815=S, 0.012, 0.0, M, 8TA
27816:=S, 0.0132, 0.0, M, WBS Mobile
27817=S, 0.0132, 0.0, M, 8TA
27818=S, 0.012, 0.0, M, Vodacom
2781=S, 0.0132, 0.0, M, 8TA
2782=S, 0.012, 0.0, M, VODACOM
2783=S, 0.012, 0.0, M, MTN
2784=S, 0.0132, 0.0, M, CELLC
2786=S, 0.032, 0.0, N, TELKOM
279=S, 0.032, 0.0, N, TELKOM
2787=S, 0.0083, 0.0, O,

It was suggested that i try and use a preloaded rate sheet that may have call costs similar to mine, but when using the Call Cost Calculator only 6 of the 32 Ratebooks loaded indicate a call cost,

Please advise if I am following the correct procedure, or if there is a problem with the ini file structure.

Andrew
Andrew.Engelbrecht
 
Posts: 27
Joined: Mon Oct 15, 2012 8:47 am

Re: TNG - Simple Custom Rate

Postby Luanda_Junzi » Fri Jan 22, 2016 2:51 pm

Dear Andrew

Please check your ini file

Code: Select all
RATE=za_telkom.dll
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,


Rate should be = to your default ratebook.

Attach your customrate.ini file

For future reference Please create a new post for a query.

Kind Regards

Luanda
Luanda_Junzi
 
Posts: 142
Joined: Wed Feb 25, 2015 2:30 pm

Re: TNG - Simple Custom Rate

Postby Andrew.Engelbrecht » Fri Jan 22, 2016 3:28 pm

Hi Luanda

Attached is the custom rate ini file as requested.

Regards
Andrew
You do not have the required permissions to view the files attached to this post.
Andrew.Engelbrecht
 
Posts: 27
Joined: Mon Oct 15, 2012 8:47 am

Re: TNG - Simple Custom Rate

Postby Luanda_Junzi » Mon Jan 25, 2016 11:50 am

Issue Resolved.

Solution

Killall tng

rm exchange.dat file.

run LANG=C

./tnglive -D

Rebuild the exchange file now its costing.

Thank You Andrew
Luanda_Junzi
 
Posts: 142
Joined: Wed Feb 25, 2015 2:30 pm

Re: TNG - Simple Custom Rate

Postby Belinda Frick » Fri Nov 09, 2018 11:57 am

Latest version of Simple Custom dll:
all_custom_simple.rar


Download and unrar - the password is 'datatex':

  • Windows version:

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

    64Bit Windows Location:
    Code: Select all
    C:\Program Files (x86)\Datatex\TNG\Rates

    NOTE: Stop the TNG service before saving the file. When saving it, it will ask to replace the existing one.
You do not have the required permissions to view the files attached to this post.
Belinda Frick
 
Posts: 3808
Joined: Fri Nov 12, 2010 4:25 pm

Re: TNG - Simple Custom Rate

Postby Odette Danster » Fri Jan 04, 2019 11:45 am

Latest Linux version of Simple Custom rates:
all_custom_simple_linux.rar

Download the rar-attachment and once prompted, please enter 'datatex' as the password.

Once extracted, you need to save the "all_custom_simple.so" file in the "Rates" folder and edit the INI file. This is located in "/opt/datatex/tng/rates"

NOTE: Create an ini file with the same name as your ratebook.
You do not have the required permissions to view the files attached to this post.
Odette Danster
 
Posts: 126
Joined: Thu Nov 18, 2010 12:01 pm


Return to TNG

Who is online

Users browsing this forum: No registered users and 1 guest

cron