Difference between revisions of "Make Retail Tariff from Wholesale Tariff explained"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 1: Line 1:
Retail Tariff from Wholesale Tariff is done by following algorithm:
Retail Tariff from Wholesale Tariff is done by following algorithm:


  1. Highest Rate in Wholesale Tariff for Destinations in Destination Group (DG) is selected
  1. The highest Rate in Wholesale Tariff for Destinations in Destination Group (DG) is selected.
  2. This rate is modified by adding some value or percent to it
  2. This rate is modified by adding a value or percentage to it.


==== Example ====
==== Example ====


Imagine we have Wholesale Tariff with such rates for USA:
Imagine we have a Wholesale Tariff with the following rates for the USA:


* Prefix 1, rate 0.01
* Prefix 1, rate 0.01.
* Prefix 12, rate 0.02
* Prefix 12, rate 0.02.
* Prefix 123, rate 0.03
* Prefix 123, rate 0.03.


And we have Destination Group USA with such Destinations in this Destination Group (1;12;123)
And we have Destination Group USA with Destinations (1;12;123) in it.


Now if we want to create Retail Tariff adding 0.005 to Wholesale tariff, we will have price for USA Destination Group = 0.035
Now, if we want to create a Retail Tariff by adding 0.005 to the Wholesale tariff, we will have a price for USA Destination Group = 0.035.


E.g. highest rate from Destinations is selected and modified.
For example, the highest rate from Destinations is selected and modified.


<br><br>
<br><br>
= Inner mechanics =
= Inner mechanics =


Wholesale tariff line will have such values:
The wholesale tariff line will have these values:


* connection_fee
* connection_fee
Line 27: Line 27:
* increment_s
* increment_s


When transforming to Retail such '''[[Advanced Rates]]''' are created:
When transforming to Retail, these '''[[Advanced Rates]]''' are created:


{| border="1" cellpadding="5" cellspacing="0"  
{| border="1" cellpadding="5" cellspacing="0"  
| '''Based on which variable''' || '''FROM''' || '''DURATION''' || '''TYPE''' || '''ROUND BY''' || '''RATE''' || '''Comments'''
| '''Based on which variable''' || '''FROM''' || '''DURATION''' || '''TYPE''' || '''ROUND BY''' || '''RATE''' || '''Comments'''
|-  
|-  
| connection_fee || 1 ||  || event || || connection_fee || This record only created when connection_fee > 0
| connection_fee || 1 ||  || event || || connection_fee || This record is only created when connection_fee > 0.
|-
|-
| min_time || 1 || min_time || minute || min_time || rate || This record only created when min_time > 0  
| min_time || 1 || min_time || minute || min_time || rate || This record is only created when min_time > 0.
|-
|-
| increment_s || min_time + 1 || -1 (means 'infinity') || minute || increment_s || rate || This record is always created
| increment_s || min_time + 1 || -1 (means 'infinity') || minute || increment_s || rate || This record is always created.
|-
|-
|}
|}

Revision as of 12:08, 7 May 2010

Retail Tariff from Wholesale Tariff is done by following algorithm:

1. The highest Rate in Wholesale Tariff for Destinations in Destination Group (DG) is selected.
2. This rate is modified by adding a value or percentage to it.

Example

Imagine we have a Wholesale Tariff with the following rates for the USA:

  • Prefix 1, rate 0.01.
  • Prefix 12, rate 0.02.
  • Prefix 123, rate 0.03.

And we have Destination Group USA with Destinations (1;12;123) in it.

Now, if we want to create a Retail Tariff by adding 0.005 to the Wholesale tariff, we will have a price for USA Destination Group = 0.035.

For example, the highest rate from Destinations is selected and modified.



Inner mechanics

The wholesale tariff line will have these values:

  • connection_fee
  • min_time
  • increment_s

When transforming to Retail, these Advanced Rates are created:

Based on which variable FROM DURATION TYPE ROUND BY RATE Comments
connection_fee 1 event connection_fee This record is only created when connection_fee > 0.
min_time 1 min_time minute min_time rate This record is only created when min_time > 0.
increment_s min_time + 1 -1 (means 'infinity') minute increment_s rate This record is always created.