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

Fix broken EchoTest demo for Firefox if datachannels are not supported #2281

Merged
merged 2 commits into from
Jul 15, 2020

Conversation

lminiero
Copy link
Member

I was recently made aware that if you try to open the EchoTest demo with Firefox on a Janus that has been build without support for datachannels, the PeerConnection setup fails. I'm just mentioning the EchoTest here and in the commit/title for the sake of simplicity, but this actually is true for all PeerConnections where Firefox offers data channels and Janus doesn't support them (e.g., VideoRoom publishers sending data too). The cause is how we create the m-line to reject the media:

m=application 0 UDP/DTLS/SCTP 0

which causes this error to appear on the Firefox JS console:

WebRTC error: DOMException: SIPCC Failed to parse SDP: SDP Parse Error on line 53:  No webrtc-datachannel token in m= media line, parse failed.

It all works as expected in Chrome instead (haven't tried Safari, Edge, or mobile browsers).

This patch tries to address that, by ensuring that we always add the webrtc-datachannel format to the m-line even when we're rejecting the SDP, i.e.:

m=application 0 UDP/DTLS/SCTP webrtc-datachannel

This seems to fix the broken PeerConnection in Firefox, and still works in Chrome, so I consider the issue fixed. I decided to push this as a pull request just in case you can find cases where this actually breaks something it shouldn't (as I mentioned, I didn't test extensively, also because I don't have access to some browsers at all). I plan to merge soon, though, so please notice I won't wait forever.

sdp-utils.c Outdated
char *fmt_str = (char *)fmt->data;
if(fmt_str)
am->fmts = g_list_append(am->fmts, g_strdup(fmt_str));
JANUS_LOG(LOG_FATAL, "[answer] %p, %p\n", am, am->fmts);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the log statement a debugging leftover? I'm not sure the pointers need to be logged as fatal message...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh, good catch, I thought I had gotten rid of them all... It was just lazy debugging on my end 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed 👍

@lminiero
Copy link
Member Author

Merging.

@lminiero lminiero merged commit 8526226 into master Jul 15, 2020
@lminiero lminiero deleted the nodatachan branch July 15, 2020 10:02
bartbalaz pushed a commit to bartbalaz/janus-gateway that referenced this pull request Jul 21, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants