Skip to content

How to Use sngrep to Troubleshoot SIP Calls (2027 Guide)

Use sngrep to troubleshoot SIP calls: capture live or from a pcap, filter to one call, read the call flow and save a pcap for Wireshark.

By · Updated · Published

Laptop screen displaying colorful code
Photo by Mohammad Rahmani · Unsplash License · via Unsplash

What is sngrep and when should you reach for it?

sngrep is a terminal tool for displaying SIP call message flows, from live capture or from a saved pcap file (sngrep on GitHub). It groups SIP messages into calls and draws each call as a ladder diagram.

Reach for it when a call fails, drops or sounds wrong and you need to see each SIP message in order. sngrep recognizes SIP over UDP and TCP, and TLS only partially (sngrep man page).

Which sngrep key or option does each troubleshooting task need?

We compiled this table on November 14, 2026 from sngrep's own documentation: the GitHub README, the release page, the sngrep wiki and the sngrep 1.9.0 man page.

Nothing was run or tested for this table. It maps each job to its command-line option or its key in the UI.

TaskCommand lineKey in the UI
Live capture on one interfacesngrep -d eth0-
Open an existing capturesngrep -I file.pcap-
Limit packets parsed (BPF filter)sngrep -d eth0 port 5060 and udp-
Match text in SIP payloadssngrep with a match expression; -i ignores case, -v inverts-
Show only calls-c-
Filter the call list by text-F3, / or Tab
Filter by method, Call-ID or call state-F7 or f
Select calls-Space
Open the call flow (ladder diagram)-Enter
Show a call plus its related dialog-F4 or x
Show raw SIP messages-F6 or r
Show only messages with SDP-D (call flow)
Show SDP info on arrows-F2 or d (call flow)
Compare two messages-Space on two messages
Save selected or all calls to pcap-O save.pcap (all packets)F2 or s
Capture RTP payload-r-
Decrypt TLS-k keyfile (RSA private key)-
Headless capture-N (no UI)-
Clear the list or pause-F5 or p

How do you start sngrep on a live interface or a saved capture?

  1. For live capture, run sngrep -d eth0. The -d option picks the capture device, and the default 'any' captures on all interfaces (sngrep man page).
  2. To open a saved capture, run sngrep -I file.pcap. The -I option reads packets from a pcap file instead of a network device.
  3. To limit what is parsed, add a BPF filter such as port 5060. The BPF filter uses the same logic as tcpdump and ngrep. Add -c to show only dialogs that start with an INVITE request.

How do you filter sngrep down to one call?

Photo of philatelist, stamp collection, stamp
Photo by qimono · Pixabay Content License · via Pixabay

The command line has two kinds of filter, and they do different jobs. A BPF filter selects which packets sngrep parses. A match expression matches text in SIP message payloads.

Inside the call list, press F3, / or Tab to enter a display filter (CallList wiki page). Press F7 or f to open the advanced filters dialog. sngrep 1.9.0 added Call-ID and call state to that dialog, so you can narrow the list to one call by its Call-ID (sngrep releases).

How do you read the call flow and raw SIP messages?

Press Enter on a call to open its call flow. Press Enter on a message in the flow to see it raw, or press F6 or r to show raw SIP messages.

In the call flow, press D to show only messages that carry SDP content (CallFlow wiki page). Press F2 or d to show SDP info on the arrows. To compare two messages, select them with Space to open the Message Diff window.

How do you save a call for Wireshark?

A laptop with a blank screen, glasses, and a small case on a wooden desk
Photo by SPurno Animation Studio · Unsplash License · via Unsplash

Select calls with Space, then press F2 or s. The wiki describes this as saving the selected or all dialogs to a PCAP file (CallList wiki page).

To save every captured packet, start sngrep with -O save.pcap. The man page says -O saves all captured packets to a pcap file (sngrep man page). Add -r if you also need the RTP payload.

Why does sngrep stop adding new calls?

sngrep keeps a limited number of dialogs. The -l option sets that limit, and the default capture.limit in the configuration is 20000 dialogs (sngrep wiki configuration). The limit cannot be disabled, so a long capture can reach it.

If new calls stop appearing, check this limit first. The -R option rotates calls when the limit is hit.

More guides in Open-Source PBX and SIP Servers.

Frequently asked questions

Can sngrep capture RTP audio and see TLS-encrypted SIP?
sngrep can capture RTP packet payload when you start it with -r. It recognizes TLS SIP only partially; to decrypt captured packets, pass an RSA private key file with the -k option.
Why does sngrep show no calls?
Check the BPF filter on the command line first, because it decides which packets sngrep parses at all. If you started sngrep with -c, it shows only dialogs that start with an INVITE request, so registrations and other dialogs are hidden.

Sources

  1. sngrep is a terminal tool that displays SIP call message flows. (github.com)
  2. sngrep recognizes SIP over UDP and TCP, and TLS only partially. (manpages.debian.org)
  3. sngrep 1.9.0 added Call-ID and Call State filtering to the filter dialog. (github.com)
  4. In the Call List, F7 (or f) opens the advanced filters dialog. (github.com)
  5. In the Call Flow screen, D shows only messages that carry SDP content. (github.com)
  6. The default capture.limit setting in sngrep's configuration is 20000 dialogs. (github.com)