Re: [OpenSIPStack] By Looking at the UDP packet, How to find out if Packet is SIP/RTP
Brought to you by:
joegenbaclor
|
From: Joegen E. B. <joe...@gm...> - 2007-12-17 23:14:36
|
A simple approach would be to search for the pattern "via:" until the last occurrence of CR/LF. If the search algo finds the string, then it's a SIP message. This is based on the assumption that all SIP messages will have a via header. If it's not a SIP message, you may get the version bit of the RTP packet from the first byte (((packet[0]>>6)&3) == 2) . If the version is 2, then it might be an RTP packet. You can then proceed in parsing the entire RTP header and see if it is indeed an RTP packet. A much better approach is to dig into the ethereal/wireshark code and see how it determines which protocol a packet belongs to. HTH Ashish Khare wrote: > Hi Joegen, > > I ahve one query. > By Looking at the UDP packet, how to find out if the packet is SIP or RTP. > We cannot use the destination port information as the there are no standard > fixed port for SIP/RTP. Although the Default port for SIP is 5060, but still > some servers may use different ports. > What information you use while parsing to identify if the packet is SIP or > RTP. > > Please reply. > > regards > Ashish > ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services > for just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > opensipstack-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel > > > > |