sipcapture / sipgrep

SIPGREP: Display and Troubleshoot SIP signaling over IP networks in console
http://www.sipcapture.org
GNU General Public License v3.0
165 stars 46 forks source link

Parsing Fails #13

Closed joshelson closed 9 years ago

joshelson commented 9 years ago

When parsing with a TCP peer with a dash in the name, sipgrep fails to parse properly and bails out with an "Unknown METHOD" error. Output and SIP message attached:

$: sipgrep -x -f '2000' interface: eth0 (23.253.81.0/255.255.255.0) filter: (ip) and ( portrange 5060-5061) or (udp and ip[6:2] & 0x3fff != 0) match: (From:|f:) (.)2000(.) Unknown METHOD: phone-4-tcp.cloud.com>;ta Unknown METHOD: T26P BAD M:[T26P 6.72.0.75 Expires: 300 Event: dialog Content-Length: 0

SUBSCRIBE sip:707@23.253.x.y:5060;transport=TCP SIP/2.0 Via: SIP/2.0/TCP 10.10.10.116:5062;branch=z9hG4bK1167800421 From: "109" sip:109-Client@phone-4-tcp.cloud.com;tag=746141305 To: sip:707@phone-4-tcp.cloud.com;tag=as20c03b17 Call-ID: 1028733816@10.10.10.116 CSeq: 335 SUBSCRIBE Contact: sip:109-Client@10.10.10.116:5062;transport=TCP Authorization: Digest username="109-Client", realm="phone-4", nonce="71a53076", uri="sip:707@23.253.81.252:5060;transport=TCP", response="d9cffb89f1f86425f06a03517164f2ea", algorithm=MD5 Accept: application/dialog-info+xml Max-Forwards: 70 User-Agent: Yealink SIP-T26P 6.72.0.75 Expires: 300 Event: dialog Content-Length: 0

adubovikov commented 9 years ago

this can happen if you didn't receive all fragments or one fragment was corrupted. (bad length) will be nice to have a pcap to reproduce the issue.

adubovikov commented 9 years ago

https://github.com/sipcapture/sipgrep/commit/82aed2eb2f48e55312b6aa1399ffcdce6166fbde

please check.

adubovikov commented 9 years ago

fixed