Skip to content

Loss protection and margin-based routing

Loss protection compares what a call earns with what it costs before the call is connected. Routes that would lose money are skipped, and a call that only loses money is rejected. Without it, a vendor price increase or a typo in an uploaded price list can send traffic below cost for days, and you see it only on the vendor’s invoice.

Screenshot "concepts/tariff-advanced-parameters" has not been generated yet — see scripts/screenshots/screens.yml.

The switch cannot know in advance how long a call will last, so it prices a typical call: one that lasts Avg. Call Duration, sec of the tariff, 200 by default. The estimate uses the full rating rules of the rate and the tariff, including connect fee, intervals, free seconds and surcharge. See Rating and billing.

  1. Revenue from the account. For the dialled number the switch prices the typical call with the account’s tariff. If that tariff has Enable Loss Protection checked, the highest acceptable cost is this revenue plus Max Loss, %. With 0 the cost may not exceed the revenue; with 10 it may exceed it by 10%.
  2. Each reseller above the account. The switch prices the same call with the tariff of the customer who owns the account, which is what that customer pays upstream. If this cost is above the limit from step 1, the call is rejected with Loss Protection. If the customer’s own tariff has loss protection enabled, it sets a new limit for the next level up in the same way. A level without loss protection sets no limit for the level above it.
  3. Vendor routes. For each route the routing group selects, the switch prices the typical call with the vendor’s prices. Routes above the last limit are left out of the hunting list. If loss protection removes every route, the call fails with Loss Protection.

All amounts are converted to a common currency with the exchange rates before they are compared.

Loss protection works per call and per route, so a single destination with a negative margin does not stop the rest of the traffic. Routes that remain are tried in the order of the routing policy as usual. This is margin-based routing: with Max Loss, % 0 a call is only ever sent to vendors that cost no more than you charge.

  • Tariff — a named set of rates that defines how calls are priced for a customer (customer tariff) or a vendor (vendor tariff).
  • Route — one candidate path for a call: a vendor connection with its priority and cost.
  • LCR — least cost routing: choosing vendor routes in ascending order of price.
  • ACD — average call duration of answered calls.
  • Reseller — a customer that resells services to its own customers using its own tariffs and branding.

A destination suddenly fails with Loss Protection

Section titled “A destination suddenly fails with Loss Protection”

The vendor raised its price above your rate, or a new price list was uploaded with an error. Open the CDR: the result is -23 Loss Protection. Compare the rate of the prefix in the customer’s tariff with the routes of the termination routes in the routing group, and either raise your rate or remove the expensive route. See SIP response codes.

Calls are rejected although every vendor is cheaper per minute

Section titled “Calls are rejected although every vendor is cheaper per minute”

The estimate covers the whole typical call, not the per-minute price. A vendor with a connect fee or a longer first interval can be more expensive for a 200-second call than a vendor with a higher per-minute price. Set Avg. Call Duration, sec to the real ACD of the traffic, which you find in the ASR/ACD reports.

The reseller’s account tariff earns less than the reseller’s own tariff costs. With loss protection on the account’s tariff the call is rejected at step 2, so the reseller cannot lose money on your network. Without it the call goes through and the reseller’s balance pays the difference.