Apparently, when preparing the SDP offer for a datachannel-only PeerConnection, the c-line of the m-line is sometimes missing the carriage return character ('\r') and only has the line feed ('\n'). We discovered this because parsing the offer would fail in our server implementation (Janus) because of a missing 'ice-ufrag': the ICE ufrag is actually there, but line splitting fails because it expects '\r\n'.
There are some more details on an issue on our Github: https://github.com/meetecho/janus-gateway/issues/1818
Specifically, this is the offer we receive from Safari:
v=0\r\no=- 5579826872295925204 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=msid-semantic: WMS\r\nm=application 9 DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\na=ice-ufrag:NRdu\r\na=ice-pwd:FLroZ+qxtf13ODODXHRjA/H4\r\na=ice-options:trickle\r\na=fingerprint:sha-256 1B:40:00:74:A7:C7:13:2D:55:D6:ED:5D:B4:67:DB:2D:D7:DD:68:0A:33:B1:13:CF:96:FC:30:C5:22:22:E8:52\r\na=setup:actpass\r\na=mid:0\r\na=sctpmap:5000 webrtc-datachannel 1024\r\n
You can see the problem in the c-line:
c=IN IP4 0.0.0.0\na=ice-ufrag:NRdu\r\n
This seems to be happening on Safari 13, both desktop and iOS, according to the reporter. It doesn't happen consistently: it seems to always happen at the first PeerConnection attempt on the page, while it seems to work after that.
Please let me know if there's anything I can do to help find the root cause of the issue.
Thanks Lorenzo, I'll fix this soon.
Created attachment 381514 [details]
Comment on attachment 381514 [details]
Clearing flags on attachment: 381514
Committed r251442: <https://trac.webkit.org/changeset/251442>
All reviewed patches have been landed. Closing bug.