fix: Robust parsing of SIP messages from tcpdump output containing raw header artifacts
This commit is contained in:
@@ -139,8 +139,11 @@ func (c *LocalCapturer) processStream(r io.Reader) {
|
||||
// logger.Debug("Stdout: %s", line) // Commented out to reduce noise, enable if needed
|
||||
|
||||
// Detect start of SIP message
|
||||
if isSIPStart(line) {
|
||||
if idx := findSIPStart(line); idx != -1 {
|
||||
logger.Debug("SIP Start detected: %s", line)
|
||||
// Clean the line (remove prefix garbage)
|
||||
line = line[idx:]
|
||||
|
||||
// If we were building a message, parse it
|
||||
if buffer.Len() > 0 {
|
||||
c.parseAndEmit(buffer.String())
|
||||
|
||||
Reference in New Issue
Block a user