Skip to main content

Command line SIP dialog matching and searching through offline PCAPs.

pypi_version

Installing

$ sudo apt-get install python-libpcap  # or yum install..
$ sudo pip install sipzamine

Example

A basic example, finding all dialogs that last shorter than 1.5 seconds:

$ sipzamine -m ^BYE -H ^BYE --maxdur 1.5 --pcap 'host 22.22.22.22' stored.pcap
[ 179978155f707e3622c0886752336210@22.22.22.22 ]
2011-11-23 22:27:20.746782 22.22.22.22:5060 > 123.123.123.123:5060 102 INVITE
2011-11-23 22:27:20.747508 123.123.123.123:5060 > 22.22.22.22:5060 102 INVITE(100)
2011-11-23 22:27:20.783424 123.123.123.123:5060 > 22.22.22.22:5060 102 INVITE(200)
2011-11-23 22:27:20.783956 22.22.22.22:5060 > 123.123.123.123:5060 102 ACK
2011-11-23 22:27:21.665581 22.22.22.22:5060 > 123.123.123.123:5060 103 BYE <--
2011-11-23 22:27:21.665721 123.123.123.123:5060 > 22.22.22.22:5060 103 BYE(200)

Command options

Normally you use -m to match a dialog by regular expression. And -p to filter by IP.

To highlight a particular text string in the concise output, use -H.

Basic matching options:

--pcap filter, -p filter
    pcap filter expression
--pmatch regex, -m regex
    any packet in dialog must match regex (can be used
    multiple times), e.g. ^INVITE to match calls
--amatch regex, -M regex
    all packets in dialog must match regex (can be used
    multiple times), e.g. ^(SIP/2.0|INVITE|BYE) to match
    calls without an ACK

Output options:

--contents
    show complete packet contents
--dateskew seconds
    offset added to all dates, can be negative (use when
    pcap clock was off)
--highlight regex, -H regex
    highlight first matchgroup in packets (multiple
    highlights are identified by letters a..z)

Special dialog/packet matching options:

--mindate date
    packets must be younger than specified date
--maxdate date
    packets must be older than specified date
--mindur seconds
    dialogs/transactions must be shorter than duration
--maxdur seconds
    dialogs/transactions must be longer than duration
--retransmits count
    at least count retransmits must be involved

TODO

  • Add tests: begin with a smallish pcap.

  • Add the ability to write pcaps from the filter. Combine capability with sipscrub?

  • Compare this to sipgrep (and other tools?). And homer?

Q & A

How do I get pcap files?

You’re encouraged to always write SIP pcaps on your VoIP machine. tcpdump allows you easy rotation of pcaps so you won’t run out of disk space. You can use the tcpdump247 init script if you like.

Metadata

Release files for sipzamine 0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sipzamine 0.7
File Size Uploaded
sipzamine-0.7.tar.gz 45.1 kB Details

Release files / sipzamine-0.7.tar.gz

Download URL sipzamine-0.7.tar.gz
Size 45.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f6d860fe71d486e5bd985a25f25c58af8c679383306edc93cd70203e579e424b
BLAKE2b-256 checksum
How to use checksums
4575ae53b7652fc30cb5d074285ef0cea74017ba8dbd67fdf47ba0986fe5346e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.7 This release

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.1.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page