MySQL Configuration
Configure connection to your PBX CDR database
Astervis connects to your PBX's MySQL database to sync CDR (Call Detail Records) in real-time.
Auto-Detection
The installer automatically detects MySQL credentials for supported PBX systems:
| PBX | Config File |
|---|---|
| FreePBX | /etc/freepbx.conf |
| Sangoma PBXact | /etc/freepbx.conf |
| Issabel | /etc/issabel.conf |
| VitalPBX | /etc/vitalpbx/vitalpbx.conf |
If auto-detection fails or you're using generic Asterisk, configure manually.
Manual Configuration
Edit /opt/astervis/.env:
Host Options
| Value | When to Use |
|---|---|
host.docker.internal | MySQL runs on the same server (default) |
192.168.1.100 | MySQL on a different server |
localhost | Won't work from Docker containers |
Don't use localhost — Docker containers can't reach it. Use host.docker.internal for local MySQL.
Binary Logging (Required)
Real-time sync requires MySQL binary logging enabled. Check if it's enabled:
If OFF, enable it:
FreePBX / Sangoma
Add under [mysqld]:
Restart MySQL:
Ubuntu / Debian
Add under [mysqld]:
Restart MySQL:
Database User Permissions
The MySQL user needs these permissions:
The installer creates these permissions automatically if you provide root credentials.
CDR Table Structure
Astervis expects the standard Asterisk CDR table:
Testing Connection
After configuration, test the connection:
Troubleshooting
Connection Refused
Solutions:
- Check MySQL is running:
systemctl status mysql - Verify host is
host.docker.internalnotlocalhost - Check firewall allows port 3306
Access Denied
Solutions:
- Verify credentials in
.env - Check user has required permissions
- Try connecting manually:
mysql -h 127.0.0.1 -u user -p
Binary Log Not Enabled
Solution: Enable binary logging (see above).
Wrong Timezone
Calls appear with wrong times.
Solution: Set MYSQL_TIMEZONE to match your PBX server timezone. See Timezone Configuration.