‎Destinations, rates and tariffs

Link copied to clipboard

Destinations, rates, and tariffs are the essential parameters that define how a certain event must be billed. It is very important to find a correct set of billing parameters and rules (rates) for each event, and this is done by matching a service identifier with the rates available in the rate plan (tariff). The service identifier specifies exactly how the service is used. For example, the service identifier for voice calls would be the destination number (Called-Station-Id, or CLD, or DNIS). For SMS messages, it would be a combination of a mobile country code (MCC) and a mobile network code (MNC), while for services such as a pay-per-view movie it could be the movie category (“New Release,” “International” or “Classic”). Since rating telephony numbers is the most complex case, that will be the primary focus of this chapter.

Destinations

Link copied to clipboard

Destinations are a list of all possible phone number prefixes to be used in your system. You generally need a new phone prefix when you have a new service area for calls that are to be treated differently than others.

For example, if you start providing calls to the Czech Republic, you should add destination 420 and specify it as the Czech Republic. Later, if you plan to charge calls to Prague differently than calls to the rest of the Czech Republic, you might need to add another destination with the phone number prefix 4202. All such destinations must be entered into the system before you can use these prefixes. This prevents errors and helps improve data quality. It is recommended that all of your phone number prefixes be defined in the E.164 format (i.e. <country code><area code><user’s local number> without the ‘+’ prefix).

For SMS delivery, however, you operate with mobile country codes (MCC) and mobile network codes (MNC) for phone numbers. Therefore, to charge users for an SMS to the Czech Republic via Vodafone, you would define the phone number prefix 42077 as the 230-03 code pair and add destination E.212-230-03 for the Czech Republic – Vodafone network in PortaBilling. The format that defines phone numbers as a combination of MCC/MNC codes is called E.212 format.

It is virtually impossible to have an “ultimate” destination list that would contain all the prefixes for the whole world. First of all, it would be quite difficult to gather and maintain such information, and second, and more importantly, having “all possible” prefixes would not offer any real benefits, and would only make rate maintenance more difficult.

For instance, if vendor A provides you with a rate of 0.10/min for calls to 420 (Czech Republic) and a 0.18 rate for calls to 420602 and 420603, you must create three prefixes: 420, 420602, and 420603. If you also create the prefix 4205 (Czech Republic, Brno) it will only take up space in the database since it will never actually be used.

Therefore, we recommend that you follow a “required minimum” approach: only create those destinations for which you need specific rates for your carriers or customers.

For service types other than those based on phone numbers, you may create symbolic destinations such as WIFI, NETACCESS, or MOVIE-BLOCKBUSTER.

Destination groups

Link copied to clipboard

Sometimes you will have several prefixes for the same target destination, e.g., 420601, 420602, and 420603 for mobile numbers in the Czech Republic. All of these prefixes can be defined as the single destination group “CZ Mobile”, so when you enter the new rate for this destination group it will, in effect, create rates for each individual prefix.

Destination group sets

Link copied to clipboard

It happens quite often that different partners will assign a different meaning to the same destination groups. For instance, your partner A says that “CZ Mobile” is 420601, 420602, and 420604, but your partner B also considers prefix 420603 to be part of “CZ Mobile”. So you will need to have two versions of “CZ Mobile” – one for partner A and one for partner B. In this situation, you will create two separate destination group sets (“A” and “B”), as well as different destination groups inside those sets.

Destination group sets

You can imagine each destination group set as a binder, with every page in that binder describing a certain destination group.

Destination group sets can be of two types:

  • Regular destination group set (default type) – includes only the destination groups created by the administrator and destinations added to these destination groups. The administrator picks destinations from the general destination list and assigns them to one or more destination groups within the destination group set. The “regular” type is used for configuring tariffs, bundle promotions, and volume discount plans.
  • Complete destination group set – comes with a Default destination group that includes all PortaBilling destinations (if a new destination is added to PortaBilling, it appears in the Default group automatically). The administrator creates the destination groups they need, picks destinations from the Default group, and moves them to one of the created destination groups. The destinations that were not picked by the administrator still belong to the Default group. Thus, a complete destination group set always includes all the destinations. The “complete” type is used for configuring fraud traffic profiles, service pools, and volume discount plans.

Complete destination group sets

Link copied to clipboard

A complete destination group set includes all destinations available in PortaBilling: every destination belongs either to the Default group or to a destination group created by the administrator. Complete destination group sets are useful to make sure that all destinations available in PortaBilling are covered, e.g., to monitor international traffic and detect fraud calls.

Let’s consider an example when a complete destination group set is used to configure a fraud traffic profile. A service provider sells VoIP services to customers in the US and Canada and allows them to make calls to the US, Canada, and Europe. The service provider wants to prevent potential fraud traffic to other destinations. To receive alerts when “unusual” traffic is detected, the administrator configures a fraud traffic profile:

  1. Creates a complete destination group set “World”, and destination groups “US&Canada” and “Europe” within this destination group set. The destinations that are usually not used are left in the “Default” destination group. complete destination group set
  2. Creates the “Business customers” fraud traffic profile and configures service usage monitoring for the “Default” destination group. The administrator sets the expected total volume of voice traffic, to be sent by the customers to destinations other than US/Canada/Europe, to 5 minutes per hour. fraud traffic profile
  3. Assigns the fraud traffic profile to the customer class.

If the total volume of traffic to destinations from “Default” destination group exceeds the 5 minutes threshold, it could be a potential fraud. In this case, the administrator receives an alert notification and takes the necessary measures to minimize potential losses.

Complete destination group sets also allow creating destination groups with subgroups (except Default group).

Complete destination group sets are used for configuring fraud traffic profiles, service pools, and volume discount plans.

Rates

Link copied to clipboard

A rate is a combination of billing parameters for a specific destination. For example, you can specify that calls to 420 are charged $0.09/min during peak time and $0.07/min during an off-peak time, while calls to 420609 should not be allowed at all.

To easily manage the process of routine rate changes, each rate in PortaBilling is assigned an exact time when it comes into effect (the Effective From attribute). This allows making an automated rate change in the future, so that a new rate can be entered today, but used only after midnight on January 1st. When an existing rate is edited, this does not replace the actual rate, but simply creates a new rate effective from this moment, so that the PortaBilling administrator can always browse the history of rate modifications.

Discontinuation of rates

Link copied to clipboard

Since it is important to have a clear overview of the history of rate changes, when a rate is not required anymore it cannot just be deleted from the system. For instance, you used to provide a special rate for the destination 442 London, UK, but as of March 1st, there is just one rate for all of the United Kingdom. If a customer calls with a question about his bill for February, you should still be able to see why calls to London were rated in a particular way.

Therefore, rates that are no longer used are not “deleted”, but rather marked as “discontinued”. This has the same effect on call rating as if the rate was not there anymore. However, the administrator can still see all the history on the web interface, including the date when the rate became discontinued.

Tariffs

Link copied to clipboard

A tariff is a complete set of rates for a specific account, customer, or vendor. Thus, it should include every possible destination allowed by their service plan (e.g., in the case of a telephony service, every destination to which you want to let them call).

It may be that the tariff will contain some prefixes that are part of more generic ones (for example, you will have a rate for the 420 prefix and for the 4202 prefix). In this case, the longest prefix match takes priority.

What happens if a destination is not included in the tariff, and the customer tries to call there? There are two possibilities:

  • If outgoing calls are authorized via PortaBilling (for example, by a Switching Server or by the prepaid card’s IVR) the customer will not be authorized to call this destination.
  • If the gateway or switch which processes the call does not perform authorization in PortaBilling before allowing the call to pass through, the customer will actually be able to make the call, but PortaBilling will not be able to bill it properly, since the required information is missing. An email alert will be sent and a special CDR will be written into the database, so you will still have an overview of this call. It is highly recommended that you always use authorization of calls via PortaBilling.

Rounding

Link copied to clipboard

The charged amount for service usage always rounds upward in an individual xDR. For example, if we configure to round up the charged amount to two decimals, then 1.204, 1.205, and 1.206 all round up to 1.21.

You can choose the number of decimals to round up the charged amount in the Rounding precision option on the General info panel.

Wildcard destination

Link copied to clipboard

There is one special destination: | (pipe). When a rate for this destination is present in the tariff, it will match any dialed phone number. But this will only happen, of course, if there is no other, better match by the actual phone prefix. Such a rate should probably not be used in the customer’s tariff, since it effectively authorizes him to call any phone number in the world. It is very useful, however, in tariffs for internal purposes. For instance, we can use it in the tariff used to produce CDRs for SIP-to-SIP on-net calls, since there the cost is zero regardless of which number is actually dialed. Otherwise, that tariff would have to include all phone prefixes for all possible phone numbers assigned to IP phones.

Also, for some services or billing features, you may need to create other destinations. For example, in order to charge calls between extensions in the same PBX environment according to a pre-defined rate, you will need the destination VOICEONNETRX. Consult the reference manual for a particular feature to find out which additional destinations it may require.

Relationship between destinations, rates, and tariffs

Link copied to clipboard

Let’s move from VoIP to a simpler scenario. Imagine you are the owner of an office supply store. You have to manage your inventory and price lists for customers and resellers.

  • First of all, you must create a catalog of all the items you intend to sell. This is your internal document containing entries such as “20001 – ball-point pen, blue; 20002 – ball-point pen; black; 50345 – stapler;” and so on. Note that this is just a description of the items, without prices, since the price will depend on the specific vendor/customer.
  • You will rec