Urgent.News

What's breaking now, across thousands of outlets.

Tech

Why average call duration misleads your VoIP billing (with a 10-line JavaScript function)

If you have ever sized a VoIP termination deal with a sentence like "our calls average 30 seconds", there is a good chance the invoice surprised you. The reason is simple: carriers round each call , not the average. This post shows the rounding as code, with two sets of calls that have the same average and very different bills. How a billing rule works Wholesale voice rates are quoted per minute,…

VoIP billing can be misleading when relying on average call duration. Carriers round each call duration, not the average, leading to different invoices despite equal averages. Wholesale voice rates are quoted per minute, but the invoice counts seconds. A call's duration is billed based on a minimum/step rule, which varies per carrier.

For example, a 13-second call on a 6/6 billing rule is billed as 18 seconds, while the same call on a 60/60 rule is billed as 60 seconds. The discrepancy becomes more pronounced when comparing two sets of calls with the same average duration but different billing outcomes. An estimate based on average call duration often underestimates the actual bill, due to the non-linear nature of the Math.ceil function used in billing calculations.

Different billing systems may also handle fractional seconds differently, further contributing to billing inconsistencies.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Saturday 24 October →