-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[0.x] SIP events mixed in event handling #3031
Comments
No, to my knowledge that's the only way we can intercept outgoing and incoming messages using the NUA stack. I don't remember mixed messages ever being an issue, if not initially before we added locking to the logger function. Not sure if anything changed in Sofia SIP that can cause the problem now, but to be honest I wouldn't know how to fix that, since we're working with raw buffers to reconstruct messages. |
Thinking about it, the logger is shared among all sessions, but we have global properties (e.g., Since you're using 0.x, can you check if the diff below helps? It uses diff
|
@oriol-c ping 🙂 |
I can give it a try. I'll come back with the result. But it turns out that in Sofia-SIP 1.13.2 the logging mechanism changed and the callback is not called for each line but once per message. Therefore if using Sofia-SIP higher than 1.13.2 the sofia_log variable can be a local variable inside janus_sip_sofia_logger avoiding the possibility of having mixed messages. I have a modified version of janus_sip.c that works for the new Sofia-SIP version, but honestly, I'm not that good enough programmer to have a janus_sip.c version that works for both mechanisms and that is a nice piece of code... This is the a patch to be applied in 0.12.4. Patch
|
If you can submit your proposed change as a pull request, that would be better, as a diff shared like that is unfortunately not very readable. |
@oriol-c any update on testing my patch, and on making yours available as a PR? |
I have just created #3063 . I haven't had the chance to test your patch. |
Closed in #3386. |
What version of Janus is this happening on?
0.11.7
Have you tested a more recent version of Janus too?
No, code in relation to janus_sip_sofia_logger has not been changed.
Additional context
When sending about 20cps via SIP, some of the sip-out events sent using the events handlers contain mixed SIP messages (https://pastebin.com/RYx4aW7e) . As you can see, the body starts with an ACK message but is then mixed with the next INVITE message, it actually goes one line (sofia log line) of the ACK and one line of the INVITE.
I could see that the sip plugin redirects the sofia log to this function janus_sip_sofia_logger, but I'm not sure if something can be done in janus to prevent the logs coming from sofia from being mixed.
The text was updated successfully, but these errors were encountered: