Kamailio (formerly OpenSER) is one of the world's leading open-source SIP servers, trusted by carriers and large enterprises to handle billions of calls daily. Its dispatcher and load-balancing modules mean a failure doesn't just drop calls — it can cause cascading failures across your entire VoIP infrastructure. Vigilmon gives you external visibility into Kamailio's management interfaces, SIP port availability, dispatcher health, and TLS certificate status so you catch problems before your users do.
What You'll Set Up
- HTTP health check on the Kamailio JSONRPC-S endpoint (
/RPC) - TCP port monitor for the XMLRPC management interface (port 8000)
- TCP port monitor for SIP signaling (5060)
- TCP port monitor for SIP TLS (5061)
- Heartbeat monitor for Kamailio dispatcher/load balancer availability
- SSL certificate expiry alerts
Prerequisites
- Kamailio 5.x or 6.x running with the
xhttp,jsonrpcs, and optionallyxmlrpcmodules enabled - Kamailio accessible on a public hostname or IP
- A free Vigilmon account
Step 1: Enable the Kamailio JSONRPC-S HTTP Endpoint
Kamailio's jsonrpcs module exposes a JSON-RPC management API over HTTP via the xhttp module. This is the recommended management interface for Kamailio 5.x+.
Add to your kamailio.cfg:
# kamailio.cfg
loadmodule "xhttp.so"
loadmodule "jsonrpcs.so"
modparam("jsonrpcs", "pretty_format", 1)
# Handle JSONRPC HTTP requests
event_route[xhttp:request] {
if (path_starts_with("/RPC")) {
jsonrpcs_dispatch();
exit;
}
xhttp_reply("404", "Not Found", "", "");
}
Verify the endpoint is responding:
curl -X POST http://localhost:5060/RPC \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"core.uptime","id":1}'
Expected response:
{
"jsonrpc": "2.0",
"result": {
"now": "Sat Jul 12 10:00:00 2026",
"up_since": "Sat Jul 12 09:00:00 2026",
"uptime": 3600
},
"id": 1
}
Step 2: Monitor the JSONRPC-S Endpoint
- Log in to vigilmon.online and click Add Monitor.
- Set Type to
HTTP / HTTPS. - Enter the URL:
http://kamailio.yourdomain.com:5060/RPC - Set Method to
POST. - Set Request body:
{"jsonrpc":"2.0","method":"core.uptime","id":1} - Add header:
Content-Type: application/json - Set Check interval to
1 minute. - Add a keyword check: must contain
uptime. - Click Save.
The keyword check confirms the Kamailio core responded — not just that the HTTP port is open. A dead jsonrpcs module returns an error or empty body while the xhttp layer stays alive.
Step 3: Monitor the XMLRPC Management Interface (Port 8000)
If you use the xmlrpc module for legacy management tooling, it typically runs on port 8000. Monitor TCP connectivity to this port separately:
First ensure the xmlrpc module is running:
# kamailio.cfg
loadmodule "xmlrpc.so"
modparam("xmlrpc", "route", "RPC_XMLRPC")
modparam("xmlrpc", "url_match", "^/RPC")
Then add a TCP monitor in Vigilmon:
- Click Add Monitor → TCP Port.
- Host:
kamailio.yourdomain.com, Port:8000. - Set Check interval to
2 minutes. - Click Save.
A TCP failure on port 8000 while SIP port 5060 is healthy indicates a management module issue rather than a full Kamailio crash — useful for distinguishing between "SIP is fine but we lost management access" and "everything is down."
Step 4: Monitor the SIP Port (TCP 5060)
Kamailio's primary SIP proxy port 5060 accepts both TCP and UDP. A TCP check verifies the SIP listener is bound:
- Click Add Monitor → TCP Port.
- Host:
kamailio.yourdomain.com, Port:5060. - Set Check interval to
1 minute. - Click Save.
This catches Kamailio process crashes, listener binding failures after a config reload, and network-level port blocks that would silently drop SIP registrations and call attempts.
Step 5: Monitor SIP TLS (TCP 5061)
Kamailio SIP TLS on port 5061 handles encrypted signaling for carriers, WebRTC gateways, and enterprise PBX systems. Add a dedicated monitor:
- Click Add Monitor → TCP Port.
- Host:
kamailio.yourdomain.com, Port:5061. - Set Check interval to
1 minute. - Click Save.
Kamailio TLS requires the tls module loaded with a valid certificate. A port 5061 failure while port 5060 is healthy points specifically to a TLS configuration or certificate issue.
Step 6: SSL Certificate Expiry Alerts
Kamailio's SIP TLS certificates must remain valid. An expired certificate causes all TLS-capable SIP clients and carriers to fail the handshake immediately.
- Click Add Monitor → SSL Certificate.
- Enter hostname:
kamailio.yourdomain.com. - Set port to
5061. - Set Alert threshold to
14 days before expiry. - Click Save.
Vigilmon performs a TLS handshake on port 5061 and inspects the certificate chain directly, independent of any HTTP monitoring.
Step 7: Heartbeat Monitor for Dispatcher Availability
Kamailio's dispatcher module load-balances SIP traffic across gateway pools. If the dispatcher's health check mechanism stops working — due to a failed ds_ping_from configuration or a broken timer — calls may route to dead gateways without alerting you.
Create the heartbeat monitor
- In Vigilmon, click Add Monitor → Heartbeat.
- Name it
Kamailio Dispatcher Health. - Set Expected interval to
5 minutes. - Copy the heartbeat URL:
https://vigilmon.online/api/heartbeat/YOUR_TOKEN
Send the heartbeat from Kamailio
Use the htable and cfgutils modules with a timer route to send periodic pings:
# kamailio.cfg
loadmodule "http_async_client.so"
loadmodule "cfgutils.so"
# Timer fires every 300 seconds (5 minutes)
timer_route[dispatcher_hb, 300] {
http_async_query(
"https://vigilmon.online/api/heartbeat/YOUR_TOKEN",
"DISPATCHER_HB_ROUTE"
);
}
route[DISPATCHER_HB_ROUTE] {
if ($http_reply_code != 200) {
xlog("L_WARN", "Vigilmon dispatcher heartbeat failed: $http_reply_code\n");
}
}
Replace YOUR_TOKEN with your Vigilmon heartbeat token. If Kamailio's timer infrastructure stops firing — due to a stuck worker, memory exhaustion, or a config reload error — Vigilmon triggers an alert after the expected interval passes with no ping.
Summary
Your Kamailio deployment now has six layers of monitoring:
- JSONRPC-S
/RPC— confirms the management interface is responding with valid JSON. - TCP port 8000 — verifies XMLRPC management access is available.
- TCP port 5060 — verifies the SIP proxy stack is bound and accepting connections.
- TCP port 5061 — verifies SIP TLS is available for encrypted signaling.
- SSL certificate — alerts you 14 days before the SIP TLS certificate expires.
- Heartbeat — dispatcher health check; Vigilmon alerts if Kamailio's timer routes stop executing.
Vigilmon handles check scheduling, multi-region polling, alert routing, and uptime history. You get notified within 60 seconds of any failure — whether it's a crashed Kamailio process, a broken dispatcher, or a certificate that expires at midnight.
Monitor your Kamailio infrastructure free at vigilmon.online
#kamailio #sip #voip #monitoring #telecom