sipcapture/homer7-docker

Correct syntax for docker-compose.yml DiscardMethod

lukeescude opened this issue · 20 comments

Hello, what is the correct syntax to supply HeplifyServer with DiscardMethod?

I am using the following, and I don't believe it works (I can still look at OPTIONS packets inside Homer):

  • "HEPLIFYSERVER_DISCARDMETHOD=['OPTIONS','NOTIFY','SUBSCRIBE']"

Thanks!

According to the docs that should be correct indeed:

DiscardMethod = ["OPTIONS","NOTIFY"]

That makes sense for normal heplify server, but for docker compose file I’m not sure how it wants an array of strings?

There is no translation, heplify-server looks for the same settings in ENV so they are equivalent/transparent (escaping excluded which might perhaps be the issue here) the compose file just passes everything forward

Okay I will play around with escaping and let you know!

Yes unfortunately it seems the docker image is not paying attention to DiscardMethod... OPTIONS, NOTIFY, and SUBSCRIBE packets are still being logged in homer-app

Ok, will try reproduce.

for docker you should not escape it
DiscardMethod = [OPTIONS,NOTIFY]

I have tried that as well, still OPTIONS packets are logged in Homer.

I have learned more:

DiscardMethod works for NOTIFY packets, but it is not working for SUBSCRIBE or OPTIONS it seems.

Are those inband OPTIONS (within a call-flow) or out-of-band in the generic partition?

I believe out-of-band, used just for devices to qualify or "ping" the server. (and for the server to qualify or "ping" devices)

let me check it

nop, it should discard it - look at the code

https://github.com/sipcapture/heplify-server/blob/master/decoder/decoder.go#L143-L148


if len(config.Setting.DiscardMethod) > 0 {
			for k := range config.Setting.DiscardMethod {
				if config.Setting.DiscardMethod[k] == h.SIP.CseqMethod {
					h.ProtoType = 0
					return nil
				}
			}
		}

what if you add switch positions OPTIONS and NOTIFY in the DiscardMethod ? Will it change something ?

Out of curiosity, would it be a good idea to use both CseqMethod and FirstMethod for discarding?

I will try reordering and let you know

Out of curiosity, would it be a good idea to use both CseqMethod and FirstMethod for discarding?

why ?

It looks like they should both work, but maybe the issue is that CseqMethod is not populating for OPTIONS packets because they are out-of-band (stateless)

no, because CSeq always includes the method to build a transaction flow and doesn't matter if it stateless or state full

Okay the order is the problem.

Switched OPTIONS and NOTIFY, now OPTIONS are being discarded but NOTIFY is back.

aha, so, lets add it twice as a workaround and i will recheck why it happens during next days...

Do you have an update on this? The discard methods not being read properly (order)