Rating turns a finished call into money. Every answered call is rated at least twice: once for what the customer pays and once for what the vendor charges. The difference is the margin on that call, available as soon as the call is rated rather than at the end of a month.
From record to charge
When the SBC posts a call detail record, YepBoss stores it, then rates it in the background. A record that stays pending for a while is picked up by a sweep, so a lost notification does not leave a call unrated.
- Statistics. On the first pass only, the attempts of the record are added to hourly statistics per egress and destination, and per ingress connection. A re-rate never counts a record twice.
- Unbillable calls. A call whose disposition is not answered is marked unbillable and nothing is posted. A disposition outside the documented vocabulary, or an answered duration beyond a sanity limit, is marked as an error with the reason, nothing is posted, and an alert is raised.
- Sell charge. Ingress connection, then account, then the sell deck version in force at the answer time, then the longest matching prefix, using the fallback deck if the primary has no row.
- Buy charge. The egress peer that carried the call, then its vendor account, then its buy deck version, then the longest matching prefix.
- Inbound charge. When the call was delivered to a number you hold that was assigned or active at the answer time, and the delivery peer has an inbound deck, the number's holder is charged from that deck.
- One transaction. The charges, their ledger entries and the balance update are written together. A customer's receivable falls by the sell charge and a vendor's payable rises by the buy charge.
If the buy side cannot be priced, the sell side is still rated and the record notes the gap, so revenue is not delayed by a missing vendor price. The record is flagged and an alert is raised.
The arithmetic
Each connection carries a duration rounding mode that matches the agreement with that carrier: up counts 1.1 seconds as 2, down counts 1.9 seconds as 1. The ingress connection's mode applies to the sell charge. The egress peer's mode applies to the buy and inbound charges. Rounding to whole seconds comes first, then grace, minimum and increments.
duration = ceil(seconds) (floor when rounding is "down")
if duration <= grace -> billable = 0, amount = 0
billable = max(duration, minimum)
if billable <= initial -> units = initial
else units = initial + ceil((billable - initial) / increment) * increment
amount = connect_fee + rate * units / 60
The amount is rounded half-up at the deck's rate precision, which defaults to six decimals. Invoices round at two decimals.
Worked example
An answered call lasts 62.3 seconds. All figures are in EUR per minute.
| Side | Rate | Increments | Duration | Billed units | Amount |
|---|---|---|---|---|---|
| Sell, rounding up | 0.0120 | 6/6 | 63 s | 66 s | 0.013200 |
| Buy, rounding up | 0.0085 | 1/1 | 63 s | 63 s | 0.008925 |
The margin is 0.013200 minus 0.008925, which is 0.004275 EUR for the call.
If sell and buy decks are in different currencies, the ledger entries are written in each account's currency using the exchange rate of the day the call was answered, while the charge record keeps the deck currency. See Multi-currency.
Time bands
A rate row can apply to peak, off-peak, weekend or all times. The deck defines peak hours and days in its own time zone, and a band-specific row beats an any row. Rating uses the band of the answer time.
Margin
Margin is the sell charge plus the inbound charge, minus the buy charge. Reports show revenue, cost and margin per customer, per vendor and per destination, and the report builder can group them in other ways. All of these use the current charges of each call.
Routing protects margin before the call is placed: a candidate egress that would leave less than the profile's minimum margin is dropped. See Routing.
Entities and retail charges
For a retail product billed through a parent account, a call carries two further charge kinds: a retail charge priced from the retail account's own deck, and a retail origination charge for calls delivered to a number given to the retail account. They are rated from the same record as the carrier's own sell charge. The entity's margin is its retail and retail origination charges minus the sell and inbound charges it pays the carrier. See Core concepts.
Test calls
Staff can place a test call to one egress peer through the SBC. It arrives on a dedicated ingress connection and is rated on its buy charge alone: the vendor's cost is recorded and payable, and nothing is sold or invoiced.
Re-rating
When a deck is corrected, staff can re-rate a range of calls, optionally for one ingress connection or one egress peer. The new charges replace the old with a version number, the previous charges are marked not current, and reversing ledger entries equal to what was actually posted are written. The reversal copies the posted amounts instead of recalculating them, so a later exchange rate edit cannot make a reversal wrong.
A call whose charge is already on an invoice that is not void is never re-rated. Correct billed calls with a credit note, or void the invoice, which releases its charges for re-rating.
Imported legacy calls
Call detail records from a previous TelcoBridges ProSBC can be imported as a legacy source. They are rated for statistics and margin, and booked to the ledger per account and month only on an explicit settlement step, so history billed elsewhere is not billed twice. Importers for other switch formats are added on request.
In the back office
A call's page shows its attempts, its decision, the kept SIP trace and both charges with the rate, increments, billable seconds and amount. Staff filter by rating status to find pending, unbillable and error records.