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
+33                     0.15TWD
+61                     0.50TWD
+1                       0.40TWD
Other                  0.20TWD

(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

Capture

Choose the CIP [T01] Mobile Telephony. Click Add Selected then Create.

Capture

Fill in the details as shown below. It’s quite similar to the previous tutorial really.

Capture

Add a Persistent Counter called ‘Minutes used’ with an Initial Value of 0.

Capture

Capture

Select the node which has no label and, as a Name, enter ‘Price Plan’.

Capture

In the price plan, add a new Usage Rate component called ‘Call Usage Rate’ for
the ‘[T01] Call’ Chargeable Item Class.

Capture

Capture

Add a Prefix Switching component called ‘Destination check’. As a Property
Name, choose ‘Number dialed’ and add in 3 prefixes: +33, +61, +1.

Capture

Some of the Property in the DDL comes from the CIC.

Capture

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.

Capture

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)

Capture

Capture

Capture

Add a Counter Update component called ‘Increment counter’ and increment the ‘Minutes used’ counter by the ‘Duration’ value.

Capture

Capture

Note that the Minutes Used counter belongs to the Persistent Counter defined at the Charge object. While the Duration Property comes from the CIC.

Capture

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

Capture

Add the Internal Reference to the Charging Plan as ‘Default’.

Capture

Capture

To test the Charge logic, choose Action->Trial Run Price Plan

Capture

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!

Capture

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.

Capture

Capture

Now let’s retry the Trial Run Price Plan.

Capture

Capture

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.

Capture

Save the Charge in the database.

The diagram below summarises the objects that are created in this tutorial

chargingplan3

 

Average Rating
0 out of 5 stars. 0 votes.
My Rating:
Categories:

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *