packet-sniffer can't sniff SIP(voip) packet
<p>I want to build "SIP sniffer" for my project to alert incoming call from VoIP communication.I try to call from my smartphone to my notebook and check incoming packet by wireshark. I see all SIP-message ( INVITE , BYE , TRYING ). I know basic of SIP ,it use UDP port 5060.</p>

<p>Next, I use this code from <a href="http://www.binarytides.com/python-packet-sniffer-code-linux/" rel="nofollow">http://www.binarytides.com/python-packet-sniffer-code-linux/</a> &lt;&lt;--- last code , longest code ( I try to paste but I can't paste code in box ) run with Raspberry PI connect to notebook by LAN cable.</p>

<p>This program can sniff UDP packet, I check in wireshark it correct 90% ( IP address and IP destination not correct ) port and payload are correct.  I checking header from ethernet header ===> ip header ===> udp header
it not different from SIP-INVITE , they different only payload  ( check by wireshark ).</p>

<p>but i try to VoIP call to my notebook, It's not work , it never sniff 5060 or SIP packet ( one time i see outgoing call data : "sip:xxxx@linphone.org" )</p>

<p>Why i can sniff other but VoIP can't.</p>

<p>Sorry for my poor english.
thank you for your advice.</p>

<p>From the quick look , I see that your packets are UDP. 
But the python code only sniffs for TCP.</p>

<p><code>#create an INET, raw socket s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP)</code> </p>

<p>change socket.IPPROTO_TCP   to   socket.IPPROTO_UDP</p>

python linux sockets udp packet-sniffers