Recalculate CDRs after a rate correction
If calls were billed with a wrong price, for example after a mistake in a rate upload, you can reprice them. You create a rerate task for an account, a reseller or vendor connections and a period, upload the correct rates to the task, and the switch recalculates the CDRs and corrects the balances. This tutorial corrects the price of one destination for one account. Allow 20 minutes, plus the processing time.
The example: account example-telecom was billed 0.0500 per minute instead of 0.0150 for prefix 4420 between 3 and 13 May.
Before you start
Section titled “Before you start”- You are logged in as the root customer with Administrator access. Rerate CDRs is available to the root customer only.
- You know whose calls to recalculate: one account, the accounts of all customers, one reseller or all resellers, or one or more connections of a vendor.
- You know the period and the correct Prefix, Interval 1, Interval N, Price 1 and Price N.
- You have downloaded the affected CDRs, so that you can compare before and after. A rerate cannot be undone.
Step 1: Fix the rate for future calls
Section titled “Step 1: Fix the rate for future calls”A rerate task uses only the rates you upload to it, not the tariff. Correct the rate in the tariff (for a vendor, in the termination route) first, so that new calls are billed correctly. See Rates.
Step 2: Create the rerate task
Section titled “Step 2: Create the rerate task”- Open Tools & Debugs → Rerate CDRs.
- Select what to recalculate. Choosing one of them clears the others:
- Account: one account, or All for every account. Recalculates the account CDRs and the account balances.
- Reseller: one reseller, or All for every reseller. Recalculates what the reseller pays you and the reseller balance.
- Vendor, then one or more entries in Vendor Connection: recalculates the vendor CDRs of those connections and the vendor balance.
- For the example, enter
example-telecomin Account. - Enter Period From
2026-05-03 00:00and Period To2026-05-14 00:00. Times are in the time zone of your web user. - Set Recalculate Time to an off-peak time if the period has many calls.
nowstarts as soon as rates are uploaded. - Enter a note in Notepad, for example
Fix 4420 upload of 3 May. - Enter Notification Email List, a comma-separated list of addresses that get an e-mail when the task starts and when it finishes.
- Click Add.
Result: the task appears in the list with a red status: Pending, no rates uploaded. A task never runs without rates.
Step 3: Upload the correct rates
Section titled “Step 3: Upload the correct rates”-
Click Get Template in the row of the task. You get an empty
Recalculate_Ratesfile with the columnsAction [A|D|U|S|SA],Id,Prefix,Country,Interval 1,Interval N,Price 1andPrice N. -
Add one row per prefix with
Ain the action column. For the example:Action [A|D|U|S|SA] Id Prefix Country Interval 1 Interval N Price 1 Price N A442060600.01500.0150 -
Click Upload Rates in the row of the task and choose the file.
-
Check the message:
Upload has completed successfullywith the number of rows processed, recognized and added. Rows that fail come back as aRecalculate Rates errorsfile with an error message per row.
Result: the status changes to Pending. Upload Rates is now disabled and Get Rates downloads the rates of the task. To change them, delete the task and create a new one.
Step 4: Wait for the recalculation
Section titled “Step 4: Wait for the recalculation”The switch checks for due tasks every 10 minutes and runs one task at a time. For each matching CDR with a duration above zero it replaces the prefix, intervals and prices, recalculates the cost with the CDR’s own connect fee, free seconds, grace period and post-call surcharge, and adds the difference to the balance. Commissions of the account’s calls are recalculated too.
While the task runs, its status is In Progress. When it finishes, the status is Completed and Message shows a summary: how many accounts (or customers, or connections) were recalculated, the total change, the minutes and the number of calls.
Step 5: Test it
Section titled “Step 5: Test it”- Open Reports → Call Records (CDRs) for
example-telecomand the period. - Check that the calls to
4420…show the new price and cost. - Open the account and check that the balance changed by the total in Message.
What’s next
Section titled “What’s next”- Call records (CDRs): find and export the affected calls.
- Rates: correct the rates of a tariff.
- Rating and billing: how the cost of a call is calculated.