tutorial

Monitoring OpenSIPS with Vigilmon

OpenSIPS routes millions of SIP calls in carrier-grade deployments — a silent failure takes down the entire VoIP stack. Here's how to monitor OpenSIPS's management interface, SIP ports, SIP TLS, and dialplan health with Vigilmon.

OpenSIPS is a high-performance open-source SIP server used for carrier-grade VoIP routing, load balancing, and proxy services. It sits at the heart of telephony infrastructure — when OpenSIPS goes down, every call it routes fails silently. Vigilmon gives you external visibility into OpenSIPS's management interface, SIP port availability, TLS signaling, and overall routing health so you catch failures before your users report dead phones.

What You'll Set Up

  • HTTP health check on the OpenSIPS Management Interface (MI) uptime endpoint
  • TCP port monitor for SIP signaling (5060)
  • TCP port monitor for SIP TLS (5061)
  • Heartbeat monitor for OpenSIPS dialplan/routing health
  • SSL certificate expiry alerts for SIP TLS endpoints

Prerequisites

  • OpenSIPS 3.x running with the httpd and mi_http modules enabled
  • OpenSIPS accessible on a public hostname or IP
  • A free Vigilmon account

Step 1: Enable the OpenSIPS MI HTTP Endpoint

OpenSIPS exposes its Management Interface (MI) over HTTP when the httpd and mi_http modules are loaded. The /mi/uptime endpoint returns the server uptime and confirms the MI is responding.

Add the following to your opensips.cfg:

# opensips.cfg
loadmodule "httpd.so"
loadmodule "mi_http.so"

modparam("httpd", "port", 8888)
modparam("httpd", "ip", "0.0.0.0")
modparam("mi_http", "mi_http_root", "mi")

Restart OpenSIPS and verify the endpoint:

curl http://localhost:8888/mi/uptime

Expected response:

{
  "Now": "Sat Jul 12 10:00:00 2026",
  "Up since": "Sat Jul 12 09:00:00 2026",
  "Up time": 3600
}

If you see a JSON body with Up time, the MI HTTP interface is healthy. A timeout or non-200 response means the httpd module is not loaded or the port is blocked.


Step 2: Monitor the MI HTTP Uptime Endpoint

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter the URL: http://opensips.yourdomain.com:8888/mi/uptime
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200.
  6. Add a keyword check: must contain Up time.
  7. Click Save.

The keyword check distinguishes a healthy OpenSIPS MI response from an error page returned by a load balancer or proxy sitting in front. If the mi_http module crashes but the HTTP server stays up, the keyword check catches it.


Step 3: Monitor the SIP Port (TCP 5060)

OpenSIPS listens for SIP signaling on port 5060 over both TCP and UDP. A TCP port check confirms the SIP stack is bound and accepting connections — UDP monitoring requires SIP-specific probing, but a TCP check on the same port catches most process failures and firewall changes.

  1. Click Add MonitorTCP Port.
  2. Host: opensips.yourdomain.com, Port: 5060.
  3. Set Check interval to 1 minute.
  4. Click Save.

A TCP failure on port 5060 typically means OpenSIPS has crashed, the listener binding was lost after a reload, or a firewall rule has been tightened. Carriers and PBX systems connecting via SIP TCP will also start failing at this point.


Step 4: Monitor SIP TLS (TCP 5061)

SIP TLS runs on port 5061 and is required for encrypted signaling between OpenSIPS and TLS-capable SIP clients, gateways, or interconnect carriers. Add a dedicated TCP monitor for this port:

  1. Click Add MonitorTCP Port.
  2. Host: opensips.yourdomain.com, Port: 5061.
  3. Set Check interval to 1 minute.
  4. Click Save.

OpenSIPS requires the tls_mgm and proto_tls modules to be loaded for SIP TLS. A failure on port 5061 while port 5060 is healthy points to a TLS module issue or certificate problem rather than a full OpenSIPS crash.


Step 5: SSL Certificate Expiry Alerts

OpenSIPS SIP TLS relies on certificates configured in tls_mgm. If those certificates expire, TLS-capable SIP clients receive a handshake failure and calls drop. Vigilmon can monitor the certificates presented on port 5061 directly.

  1. Click Add MonitorSSL Certificate.
  2. Enter the hostname: opensips.yourdomain.com.
  3. Set the port to 5061 (Vigilmon will perform a TLS handshake and inspect the certificate).
  4. Set Alert threshold to 14 days before expiry.
  5. Click Save.

Also add an SSL monitor for any HTTPS domain pointing at the OpenSIPS MI endpoint if you have TLS termination in front of port 8888.


Step 6: Heartbeat Monitor for Dialplan/Routing Health

OpenSIPS is healthy at the process level but may have a broken dialplan, missing routes, or a failed database connection that prevents actual call routing. Use a Vigilmon heartbeat monitor to verify end-to-end routing by having OpenSIPS ping Vigilmon from within your dialplan.

Create the heartbeat monitor

  1. In Vigilmon, click Add MonitorHeartbeat.
  2. Name it OpenSIPS Dialplan Health.
  3. Set Expected interval to 5 minutes.
  4. Copy the unique heartbeat URL (format: https://vigilmon.online/api/heartbeat/YOUR_TOKEN).

Send the heartbeat from OpenSIPS

Add a cron-style route in your OpenSIPS dialplan that fires a periodic HTTP request to the heartbeat URL. Use the rest_client module:

# opensips.cfg
loadmodule "rest_client.so"

# Timer route fires every 5 minutes (300 seconds)
timer_route[hb_check, 300] {
  $var(response_body) = "";
  $var(http_code) = 0;

  rest_get(
    "https://vigilmon.online/api/heartbeat/YOUR_TOKEN",
    $var(response_body),
    $var(http_code)
  );

  if ($var(http_code) != 200) {
    xlog("L_WARN", "Vigilmon heartbeat returned $var(http_code)\n");
  }
}

Replace YOUR_TOKEN with the token from your Vigilmon heartbeat monitor. If OpenSIPS stops executing this route — due to a config reload failure, a stuck worker, or a crashed timer process — Vigilmon alerts you after the expected interval passes with no ping.


Summary

Your OpenSIPS deployment now has five layers of monitoring:

  1. MI HTTP /mi/uptime — confirms the OpenSIPS management interface is responding, polled every 60 seconds.
  2. TCP port 5060 — verifies the SIP signaling stack is bound and accepting connections.
  3. TCP port 5061 — verifies SIP TLS is available for encrypted carrier interconnects.
  4. SSL certificate — alerts you 14 days before the SIP TLS certificate expires.
  5. Heartbeat — end-to-end dialplan health check; Vigilmon alerts if the routing engine stops executing timer routes.

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 OpenSIPS process, a dropped SIP port binding, or a certificate that quietly expired overnight.


Monitor your OpenSIPS infrastructure free at vigilmon.online

#opensips #sip #voip #monitoring #telecom

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →