To create a charge for the pricing of usage events related
to the Call service. The price depends on the called number prefix and is defined as follows:
Number Prefix Rate per Minute
(Number Prefix can be equivalent to the country code)
For this we will use one of the Price Plan Components Prefix Switching (comparators).
Create a new Charge object. File->New->Charge
Choose the CIP [T01] Mobile Telephony. Click Add Selected then Create.
Fill in the details as shown below. It’s quite similar to the previous tutorial really.
Add a Persistent Counter called ‘Minutes used’ with an Initial Value of 0.
Select the node which has no label and, as a Name, enter ‘Price Plan’.
In the price plan, add a new Usage Rate component called ‘Call Usage Rate’ for
the ‘[T01] Call’ Chargeable Item Class.
Add a Prefix Switching component called ‘Destination check’. As a Property
Name, choose ‘Number dialed’ and add in 3 prefixes: +33, +61, +1.
Some of the Property in the DDL comes from the CIC.
For this tutorial, I have obliviously added an empty line above the +33 prefix. Later on you will see an error when we try to verify the Charge.
Underneath the +33 branch, add a Linear function component called ‘0.15 TWD per minute’ and:
- Set the Property Name to ‘Duration’
- Set the Scaled Amount to ‘0.15’
- Set the Fixed Amount to ‘0’ (i.e. there is no base fee)
Add a Counter Update component called ‘Increment counter’ and increment the ‘Minutes used’ counter by the ‘Duration’ value.
Note that the Minutes Used counter belongs to the Persistent Counter defined at the Charge object. While the Duration Property comes from the CIC.
Repeat steps above for the other branches with Scaled Amounts of 0.50, 0.40 and 0.20 respectively.
To save the Charge, specify the Charging Reference Name at the Internal Reference Directory of the Charge. Add ‘Default’ and Type Postpaid
Add the Internal Reference to the Charging Plan as ‘Default’.
To test the Charge logic, choose Action->Trial Run Price Plan
The system prompts me an error. Why? If you remembered, I have mentioned in the previous chapters that the Tree should always always always ends with a Functions component. But here, this error is not the case. A Prefix Switching just cannot accept an empty value!
There is only one way to solve this error which is to delete the empty line above the prefix +33 at the Prefix Switching comparator.
Now let’s retry the Trial Run Price Plan.
The Trial Run Price Plan option allows you to test your pricing logic before
releasing it. In the Input Properties, enter the value shown below. Then click on the start button (play symbol) at the top left corner.
The result is shown at the Line Items view.
Let’s verify the result using manual calculation. We have specified the Duration value as 100 minutes. The Number Dialed starts with the prefix +4. In the Prefix Switching the calculation for this combination will fall under the ‘Number Dialed Does not start with any of the prefixes’ node. The calculation will use the Linear functions component. 100 Minutes * 0.20TWD = 20TWD. The value at the Line Item view displays the correct rate.
Save the Charge in the database.
The diagram below summarises the objects that are created in this tutorial