A collection of Linux operations scripts for running telecom infrastructure (FreeSWITCH/Kamailio/PostgreSQL) — the unglamorous-but-essential tooling that keeps a voice platform observable and recoverable.
| Script | What it does |
|---|---|
check-sip-trunk-health.sh |
Sends a SIP OPTIONS ping to each configured trunk/gateway via sipsak, logs latency or failure. Built for cron/systemd timers feeding into alerting. |
pcap-capture-sip.sh |
tcpdump wrapper for always-on SIP+RTP capture with automatic rotation (hourly files, rolling 24h retention) — so a reported call issue already has packets waiting instead of needing to be reproduced live. |
system-health-report.sh |
One-shot health snapshot: CPU/mem/disk, service status for FreeSWITCH/Kamailio/PostgreSQL/nginx/fail2ban, plus active SIP registration counts from both FreeSWITCH and Kamailio. |
backup-postgres-cdr.sh |
Gzipped daily pg_dump of the CDR database with retention cleanup, meant for cron. |
These come out of the same day-to-day reality as the other repos here — running a multi-tenant voice platform means you spend as much time on operational visibility as you do on signaling logic. A trunk health check and a rotating packet capture both turn "customer says calls are failing" into "here's exactly what happened and when," instead of trying to reconstruct it after the fact.
# Trunk health, run from cron every minute
echo "carrier-a 203.0.113.10 5060" > trunks.conf
echo "carrier-b 203.0.113.20 5060" >> trunks.conf
./check-sip-trunk-health.sh trunks.conf
# Always-on SIP capture (run as a systemd service, not just manually)
sudo ./pcap-capture-sip.sh eth0 /var/log/sip-pcaps 5060
# Health snapshot
./system-health-report.sh
# Nightly CDR backup
DB_NAME=freeswitch_cdr DB_USER=postgres ./backup-postgres-cdr.shsipsak, tcpdump, fs_cli (FreeSWITCH), kamcmd (Kamailio),
postgresql-client — install whichever subset matches the scripts you're
actually using; none of them require all of these at once.