Reference Guide

FusionPBX CRON Reference

Complete guide for configuring scheduled tasks for the FusionPBX server module.

ictVoIP Billing CRON Reference

Note: Timezone, replace with your actual timezone TZ=America/Toronto
Note: replace yourwhmcs.com with your actual WHMCS domain.

FusionPBX Server Module CRONs

Autobill (Standard Billing)

Processes CDRs and generates invoices for services with realtimebilling=0.

Important: This must run before the daily WHMCS cron so invoices are created before WHMCS processes them.
Timezone Configuration: The TZ= parameter is required on AlmaLinux 9 / systemd-based systems to ensure cron jobs run in the correct timezone, not UTC.

Replace America/Toronto with your timezone: Use your server's timezone identifier, such as America/New_York, Europe/London, or Asia/Tokyo. You can find your timezone by running timedatectl on your server or checking the PHP timezone list.
# FusionPBX Autobill v2 (separate invoices per service)
55 00 * * * TZ=America/Toronto GET https://yourwhmcs.com/modules/servers/fusionpbx/autobill_v2.php?runfrom=cron

# FusionPBX Autobill v3 (consolidated invoices - Recommended)
55 00 * * * TZ=America/Toronto GET https://yourwhmcs.com/modules/servers/fusionpbx/autobill_v3.php?runfrom=cron

# Alternative: More time before WHMCS daily cron
45 00 * * * TZ=America/Toronto GET https://yourwhmcs.com/modules/servers/fusionpbx/autobill_v3.php?runfrom=cron

# PHP CLI format (alternative)
55 00 * * * TZ=America/Toronto /usr/bin/php -q /path/to/whmcs/modules/servers/fusionpbx/autobill_v3.php runfrom=cron

Real-Time Billing

Processes CDRs in near real-time for services with realtimebilling=1. Deducts usage from client credit balance.

*/15 * * * * TZ=America/Toronto GET https://yourwhmcs.com/modules/servers/fusionpbx/realtimebilling.php?runfrom=cron

Auto Suspend/Unsuspend

Monitors client credit balance and automatically suspends or unsuspends FusionPBX tenant gateways.

*/5 * * * * TZ=America/Toronto GET https://yourwhmcs.com/modules/servers/fusionpbx/autosuspend.php?runfrom=cron

Summary Table

Script Frequency Purpose
autobill_v2.php Daily 12:45 AM Standard CDR billing (before WHMCS cron)
autobill_v3.php Daily 12:45 AM Consolidated CDR billing (before WHMCS cron)
realtimebilling.php Every 15 minutes Real-time CDR billing and credit deduction
autosuspend.php Every 5 minutes Credit-based gateway suspend/unsuspend

Requirements

  • All scripts require the ?runfrom=cron parameter to execute in cron mode.
  • Scripts must be accessible via HTTPS from the cron server.
  • FusionPBX provider must be configured in the ictVoIP Billing addon.
  • CDR import must be functioning (via FusionPBX database connection).

Maintenance CRONs (Optional)

Log Cleanup

Remove old log files to prevent disk space issues.

# Delete ictvoipbilling logs older than 30 days (daily at 3:00 AM)
0 3 * * * TZ=America/Toronto find /path/to/whmcs/modules/addons/ictvoipbilling/storage/logs -name "*.log" -mtime +30 -delete >/dev/null 2>&1

Troubleshooting

Browser Testing

  • Remove >/dev/null 2>&1 to see output.
  • Access scripts directly in browser without ?runfrom=cron for debug mode.

CLI Debug Commands

# Autobill - Run manually with output
TZ=America/Toronto php /path/to/whmcs/modules/servers/fusionpbx/autobill_v2.php runfrom=cron

# Real-Time Billing - Run manually with output
TZ=America/Toronto php /path/to/whmcs/modules/servers/fusionpbx/realtimebilling.php runfrom=cron

# Auto Suspend - Run manually with output
TZ=America/Toronto php /path/to/whmcs/modules/servers/fusionpbx/autosuspend.php runfrom=cron

Curl Debug Commands

# Autobill - Test via curl with output
TZ=America/Toronto curl "https://yourwhmcs.com/modules/servers/fusionpbx/autobill_v2.php?runfrom=cron"

# Real-Time Billing - Test via curl with output
TZ=America/Toronto curl "https://yourwhmcs.com/modules/servers/fusionpbx/realtimebilling.php?runfrom=cron"

# Auto Suspend - Test via curl with output
TZ=America/Toronto curl "https://yourwhmcs.com/modules/servers/fusionpbx/autosuspend.php?runfrom=cron"

Logs

  • Check WHMCS Activity Log and admin emails for billing entries.
  • For realtime entries, check the mod_ictvoipbilling_fusionpbx_cdrs table for CDR status.

Document Last Updated: February 20, 2026

Module Version: 1.4.0