heplify icon indicating copy to clipboard operation
heplify copied to clipboard

HEP Collector mode with discard methods

Open lazedo opened this issue 2 years ago • 2 comments

When using HEP Collector Mode , discard methods (dim option) are not discarded

using freeswitch sofia capture to send to heplify (HEP Collector mode) which sends to heplify-server, heplify configured with -dim OPTIONS but heplify still sends OPTIONS

lazedo avatar Aug 12 '22 15:08 lazedo

changed decoder ProcessHEPPacket to this, seems to be working.

func (d *Decoder) ProcessHEPPacket(data []byte) {

	if config.Cfg.DiscardMethod != "" {
		h, err := DecodeHEP(data)
		if err == nil {
			c := internal.ParseCSeq([]byte(h.Payload))
			if c != nil {
				for _, v := range d.filter {
					if string(c) == v {
						return
					}
				}
			}
		}
	}

	pkt := &Packet{
		Version: 100,
		Payload: data,
	}
	atomic.AddUint64(&d.hepCount, 1)

	PacketQueue <- pkt
}

lazedo avatar Aug 12 '22 16:08 lazedo

Thanks @lazedo for the report + potential fix. feel free to push a PR if it passes your tests - much appreciated!

lmangani avatar Aug 12 '22 16:08 lmangani

Hi @lazedo It's implemented here https://github.com/sipcapture/heplify/commit/acb7e54e991e52cf1c4671edd881cc2f46b16320

kYroL01 avatar Oct 11 '22 08:10 kYroL01