Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct syntax for docker-compose.yml DiscardMethod #107

Open
lukeescude opened this issue Oct 2, 2021 · 20 comments
Open

Correct syntax for docker-compose.yml DiscardMethod #107

lukeescude opened this issue Oct 2, 2021 · 20 comments

Comments

@lukeescude
Copy link

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!

@lmangani
Copy link
Member

lmangani commented Oct 2, 2021

According to the docs that should be correct indeed:

DiscardMethod = ["OPTIONS","NOTIFY"]

@lukeescude
Copy link
Author

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

@lmangani
Copy link
Member

lmangani commented Oct 2, 2021

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

@lukeescude
Copy link
Author

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

@lukeescude
Copy link
Author

lukeescude commented Oct 2, 2021

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

@lmangani
Copy link
Member

lmangani commented Oct 2, 2021

Ok, will try reproduce.

@adubovikov
Copy link
Member

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

@lukeescude
Copy link
Author

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

@lukeescude
Copy link
Author

I have learned more:

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

@lmangani
Copy link
Member

lmangani commented Oct 4, 2021

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

@lukeescude
Copy link
Author

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

@adubovikov
Copy link
Member

let me check it

@adubovikov
Copy link
Member

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 ?

@lukeescude
Copy link
Author

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

@adubovikov
Copy link
Member

adubovikov commented Oct 4, 2021

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

why ?

@lukeescude
Copy link
Author

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)

@adubovikov
Copy link
Member

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

@lukeescude
Copy link
Author

Okay the order is the problem.

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

@adubovikov
Copy link
Member

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

@lukeescude
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants