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

[1.x] SIP plugin: possibility of inconsistent session mapping in 'callids' hash table #3404

Closed
ycherniavskyi opened this issue Jul 10, 2024 · 1 comment
Labels
multistream Related to Janus 1.x pr-exists

Comments

@ycherniavskyi
Copy link
Contributor

What version of Janus is this happening on?
1.2.4 (195bac0)

Have you tested a more recent version of Janus too?
Yes. I am testing with latest master branch.

Was this working before?
No.

Is there a gdb or libasan trace of the issue?

Additional context
In case of call between two SIP handlers registered within one Janus (so when outgoing and incoming legs of one call going via the same Janus) the callids hash table will hold reference to latter initiated SIP call session of such call (incoming one, because it is follow outgoing one). This occurs because callids uses the callid as a key, which remains the same for both legs of the call.

This issue leads to incorrect functionality during attended transfers of such call, specifically in composing the Refer-To header (incorrect order of from-tag and to-tag), as it uses the incoming leg instead of the outgoing one. (And yes if SIP handlers registered within different Janus all transfers functionality works as expected.)

Upon reviewing the usage of the callids hash table, it appears that the Sofia-SIP logger functionality also behaves incorrectly in scenarios where both legs of the same call traverse a single Janus instance, because all SIP out events will be associate with an incoming leg of such call.

@ycherniavskyi ycherniavskyi added the multistream Related to Janus 1.x label Jul 10, 2024
@lminiero
Copy link
Member

That's a good catch, and one I hadn't thought about. I'm not exactly sure how to address this, though, as I'm not that familiar with SIP: not sure if there's another header that may be better suited for the job, or if we should use a combination of call-ID with something else (which could make lookups problematic, though, depending on whether or not whatever we use for that combo is always available). Suggestions are welcome!

lminiero added a commit that referenced this issue Oct 24, 2024
adnan-mujagic pushed a commit to adnan-mujagic/janus-gateway that referenced this issue Oct 25, 2024
natikaltura pushed a commit to natikaltura/janus-gateway that referenced this issue Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multistream Related to Janus 1.x pr-exists
Projects
None yet
Development

No branches or pull requests

2 participants