Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Decode SIP messages with Python

I need python script that can sniff and decode SIP messages in order to check their correctness. As a base for this script I use python-libpcap library for packets sniffing. I can catch UDP packet and extract SIP payload from it, but I don't know how to decode it. Does python has any libraries for packets decoding? I've found only dpkt, but as I understood it can't decode SIP. If there are no such libraries how can I do this stuff by hands?

Thank you in advance!

like image 383
Dieselist Avatar asked Sep 12 '25 04:09

Dieselist


1 Answers

Finally I did this with help of pyshark from the sharktools (http://www.mit.edu/~armenb/sharktools/). In order to sniff IP packages I used scapy instead of libpcap.

like image 62
Dieselist Avatar answered Sep 13 '25 18:09

Dieselist