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

Ack getting dropped during glare. #56

Open
aravinty opened this issue Feb 19, 2020 · 3 comments
Open

Ack getting dropped during glare. #56

aravinty opened this issue Feb 19, 2020 · 3 comments
Assignees

Comments

@aravinty
Copy link

aravinty commented Feb 19, 2020

A -> B : 102 re-invite
B -> A : 2 re-invite
B -> A : 102 491 request pending
A -> B : 2 491 request pending
A -> B : 2 ACK
B -> A : 102 ACK

The ack B -> A : 102 ACK, gets dropped by the stack ( for A).

After looking the code in Dialog.java , It looks like the lastInviteResponseCSeqNumber is intended to be used for matching the incoming ACK cSeq. However, lastInviteResponseCSeqNumber gets updated even for incoming response. So, When the ACK comes in for the outgoing response, it fails to match the lastInviteResponseCSeqNumber and it gets dropped.

@vladimirralev
Copy link
Collaborator

I think this is a known semi-issue, need to check. It doesn't really care about the response per se but in terms of transaction 491 has a weird effect depending on the use case (proxy being of particular interest). I think you should be able to get around this by disabling the cseq validation and handling the 491 yourself (if at all). May be try this first to confirm. Here is an example:

https://github.com/usnistgov/jsip/blob/master/src/test/unit/gov/nist/javax/sip/stack/LooseDialogValidationTest.java#L185

@vladimirralev vladimirralev self-assigned this Feb 19, 2020
@aravinty
Copy link
Author

hmm.. the use case I actually see is slightly different from the actual description.

A -> B : 102 re-invite
B -> A : 102 200 OK
B -> A : 2 re-invite
A -> B : 2 491 request pending
B -> A : 102 ACK
A -> B : 2 ACK

B sends a 200OK before sending Invite 2. When B receives the ACK A -> B : 2 ACK, the stack drops it.

Probably, it can be fixed by, updating the condition in SIPDialog setLastResponse method

from

if(Request.INVITE.equals(cseqMethod)) {

to

if(Request.INVITE.equals(cseqMethod) && transaction != null && transaction
                        .isServerTransaction()) {

Naming of the variable could also be changed to lastServerTransactionInviteResponseCSeq

@vladimirralev
Copy link
Collaborator

I will review this and will think a bit. Meanwhile I wonder if disabling the cseq validation works for you. I think almost everybody has to disable it at some point to handle 491 and race conditions in particular for app-specific case.

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

2 participants