Skip to content
Kaian edited this page Apr 14, 2015 · 24 revisions

sngrep configuration is done using sngreprc file. This file contains one line directives that can change default sngrep behaviour. Configuration files are readed in this order

  • System-wide configuration: Usually /etc/sngreprc or /usr/local/etc/sngreprc
  • User configuration: $HOME/.sngreprc

Options

Options are configured using set directive to modify its default value. This are the available options configurable via set directive:

Format: set <option> <value>

option format default description
background black | transparent black Changes background printing.
syntax on | off on Enable/Disable SIP Payload syntax highlighting.
syntax.tag on | off off Enable/Disable tag syntax highlighting.
syntax.branch on | off off Enable/Disable branch syntax highlighting.
hintkeyalt on | off off Display alternative keybinding hint in bottom bar.
capture.limit int > 0 50000 Set max number of captured dialogs (-l argument).
capture.lookup on | off off Enable/Disable DNS resolution of captured packets IP addresses.
capture.device any | <interface> any Set default capture interface (-d argument).
capture.outfile <filename> Set default capture dump file (-O argument).
capture.keyfile <filename> Default capture keyfile for TLS transport (-k argument).
sip.ignoreicomplete on | off on Ingore dialogs not starting with some Request Methods.
sip.calls on | off off Ingore dialogs not starting with INVITE Method.
sngrep.savepath <path> $HOME Default path in save dialog
sngrep.displayhost on | off off Show resolved hostnames instead of IPs (requires capture.lookup).
cl.filter <text> Set default display filter on startup
cl.noexitprompt on | off off Disable exit confirmation prompt.
cl.scrollstep int 10 Change default scrolling steps in Call List.
cf.forceraw on | off on Display Payload preview in Call Flow.
cf.rawminwidth int 40 Minimun number of columns Payload preview will use.
cf.splitcallid on | off off One Column = One address in Call Flow.
cf.highlight bold | reverse bold Change current message arrow highlight mode.
cf.scrollstep int 4 Change default scrolling steps in Call List.
cr.scrollstep int 10 Change default scrolling steps in Call Raw.
filter.enable on | off off Start with filters enabled.
filter.<method> on | off on Default value for checkbox in filter screen.

Call List Columns

Column configuration is also done using set directive. You can easily configure your columns during runtime and save displayed layout or configure them manually.

set cl.column<index> <attribute> (For example: set cl.column7 time)

You can also change default display width using:

set cl.column<index>.width <value> (For example: set cl.column3.width 100)

Here's a list of Call attributes:

name width description
index 4 Dialog capture index for unique identification of dialog.
sipfrom 30 From header sip uri.
sipfromuser 20 Username in From header.
sipto 30 To header sip uri.
siptouser 20 Username in To header.
src 22 Source IP:Port of packet.
srchost 16 Source IP of packet.
dst 22 Destination IP:Port of packet.
dsthost 16 Destination IP of packet.
callid 50 Call-id SIP header value.
xcallid 50 X-Call-id SIP header value.
date 10 Date in YYYY/MM/DD format.
time 8 Time in HH:MM:SS format.
method 15 Request Method or Response code of SIP message.
sdpaddress 22 First SDP address if message has sdp content.
sdpport 5 First SDP port if message has sdp content.
transport 3 SIP transport (UDP|TCP|TLS|..)
msgcnt 5 Number of messages in the dialog.
state 19 Call State (if dialog is a call)
convdur 7 Conversation duration (since first 200 OK to BYE)
totaldur 8 Total call duration (since INVITE to last message)