FEATUREDLatestOpenSIPSTOP STORIESVOIP

sngrep: The Open-Source SIP Debugging Tool

When a SIP call fails, the answer is almost always in the SIP messages. sngrep is a free, open-source tool from Irontec that captures those messages and shows them as call flows in a terminal. It is one of the first tools we install on any Asterisk, FreeSWITCH or Kamailio server. Version 1.9.0 was released in October 2026.

What sngrep does

  • Lists SIP dialogs as they happen: calls, registrations and other requests, with their state.
  • Draws call flows: select a call and sngrep shows each SIP message as an arrow between the hosts involved, in time order.
  • Shows the full message, including the SDP that describes the media, so you can see which addresses, ports and codecs each side offered.
  • Reads and writes pcap files, so a capture can be taken on a server and examined later or on another machine.

Installing and running it

sngrep is packaged in Debian and Ubuntu, and is available through Homebrew on macOS:

sudo apt install sngrep      # Debian / Ubuntu
brew install sngrep          # macOS

For other systems, build from the source in the GitHub repository. It needs permission to capture packets, so run it as root or with the appropriate capabilities:

sudo sngrep                          # capture SIP on all interfaces
sudo sngrep port 5060                # pcap filter: only port 5060
sudo sngrep -d eth0 -O capture.pcap  # capture on eth0 and save to a file
sngrep -I capture.pcap               # open a saved capture
sudo sngrep -c                       # only show dialogs that start with INVITE
sudo sngrep -r                       # also capture RTP packets

Filters use standard pcap filter syntax. Inside sngrep, press F1 for the list of keys.

What to look for

  • Failed calls: find the final response, such as 403 Forbidden, 404 Not Found or 488 Not Acceptable Here, and the host that sent it. The full list of codes is in the IANA SIP parameters registry.
  • One-way audio: compare the IP addresses in the SDP c= and m= lines with the addresses the devices really use. A private address in the SDP of a call that crosses the internet is the classic cause.
  • Registration problems: repeated REGISTER requests answered with 401 and never with 200 usually mean wrong credentials.
  • Attacks: floods of REGISTER or INVITE requests from unknown addresses are a sign that someone is scanning for weak passwords.

Limits

sngrep sees what crosses the network interface. SIP sent over TLS or a secure WebSocket (WSS), which includes every WebRTC browser phone, is encrypted, so sngrep cannot read it without the keys. For those calls, the PBX’s own SIP logging (for example pjsip set logger on in Asterisk) is usually the easier source.

Related tools

  • Wireshark for detailed packet analysis, including RTP streams.
  • SIPp for generating test calls and load.
  • HOMER for capturing and storing SIP across many servers over time.

If you use the Siperb service, its built-in trace viewer covers similar ground; the Siperb knowledge base (published by the team behind SoftPage) explains viewing SIP trace logs. For background on what you will see in sngrep, see our articles on Asterisk WebRTC troubleshooting and fixing one-way audio.

Related: the difference between a SIP dialog and a transaction.

Related: when sngrep shows a failing call, look up the response code in our SIP response codes lookup.


Corrected 18 November 2026: the earlier version gave an invented expansion of the name (“SIP Message Generator and Responder”), listed keyboard shortcuts and command options that do not match sngrep, claimed WebSocket support we could not confirm, linked a defunct security association and an unrelated market report, and placed links to Siperb on the words “VoIP” and “SIP”. The description now follows the project’s repository.

Leave a Reply

Your email address will not be published. Required fields are marked *