Skip to content

Use Call Accounting

Call Accounting summarizes call volume and (optionally) cost over a date range, grouped by extension, route, trunk, or department. Useful for billing back departments or understanding outbound spend.

Before You Start

  • Calls have been logged in CDR for the period you want to analyze.
  • For cost calculations: rate plans must be configured (per-route or per-prefix rates).

Steps

  1. Go to Reports → Call Accounting.
  2. Pick a report type:
    • Calls by Extension — total inbound/outbound/internal call counts and duration per extension.
    • Calls by Trunk — usage per trunk (good for chasing per-trunk billing).
    • Calls by Route — outbound spend by route.
    • Calls by Destination — usage by area code or country.
    • Top Talkers / Top Destinations — leaderboards.
  3. Set date range.
  4. Click Generate.
  5. Export to CSV/PDF for sharing with finance.

Configure rates (for cost reports)

  1. Reports → Call Accounting → Rates tab.
  2. Add rate plans:
    • Description — e.g. International Mexico.
    • Pattern — dial pattern, e.g. 01152..
    • Rate per minute — e.g. 0.05.
    • Connect fee — flat fee per call, e.g. 0.01.
  3. Submit.
  4. Future reports include cost columns based on these rates.

Direct DB Query

For ad-hoc analysis:

-- Top 10 extensions by outbound call duration this month:
SELECT src AS extension,
       COUNT(*) AS call_count,
       SUM(billsec) AS total_seconds
FROM cdr
WHERE calldate >= DATE_FORMAT(NOW(), '%Y-%m-01')
  AND dstchannel LIKE 'PJSIP/<trunk>%'
GROUP BY src
ORDER BY total_seconds DESC LIMIT 10;

Common Issues

  • Costs all zero. No rates configured, or pattern doesn't match. Test with one route + one rate, verify on a known call.
  • Numbers don't match the carrier bill. UnifiedBX counts billsec (talk time after answer); some carriers bill ring time too. Reconcile carefully.
  • Internal calls show as outbound. Calls hit an outbound route due to dialplan misconfiguration. Audit the route patterns.
  • Report empty. Date range outside CDR retention; or filter too narrow.