From fb5c6d587a4e67596c0baa3747e8f46dc57dab15 Mon Sep 17 00:00:00 2001 From: negbie Date: Wed, 30 May 2018 10:28:55 +0200 Subject: [PATCH] Check for valid SIP response --- decoder.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/decoder.go b/decoder.go index 520fe483..c7727a27 100644 --- a/decoder.go +++ b/decoder.go @@ -180,6 +180,9 @@ func (h *HEP) parseSIP() error { if h.SIP.StartLine.Method == "" { h.SIP.StartLine.Method = h.SIP.StartLine.Resp } + if h.SIP.StartLine.Method != h.SIP.CseqMethod && len(h.SIP.StartLine.Method) != 3 { + h.SIP.StartLine.Method = "UNKNOWN" + } if h.SIP.Error != nil { return h.SIP.Error