Invalid SDP answer from OpenVidu EE server

Hi,
I work in an android app where we use OpenVidu CE.
We implemented the OpenVidu RPC ourselves and it works fine.

Now we are trying to switch to OpenVidu EE + mediasoup, but the same client code on our side doesn’t work any more. Basically we get an invalid/empty SDP answer from OpenVidu.

Example, this is the SDP offer I generate, sent through a publishVideo RPC message ( OpenVidu Docs ):

v=0
o=- 2600538386293608434 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio
a=extmap-allow-mixed
a=msid-semantic: WMS ARDAMS
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 102 0 8 106 105 13 110 112 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:rH/D
a=ice-pwd:/F+k2ShsnZJpPLWk4tmwa1JC
a=ice-options:trickle renomination
a=fingerprint:sha-256 22:52:15:87:47:5F:A8:4D:13:C5:CF:B5:9A:A2:50:75:75:D3:C6:E7:3C:A2:76:B8:2D:CE:D9:C3:DF:C9:B2:86
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=sendrecv
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:102 ILBC/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:2172223321 cname:JInLmYIDM6Av/b0N
a=ssrc:2172223321 msid:ARDAMS ARDAMSa0
a=ssrc:2172223321 mslabel:ARDAMS
a=ssrc:2172223321 label:ARDAMSa0

The SDP answer I get back is this:

v=0
o=mediasoup-client 10000 1 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-lite
a=fingerprint:sha-512 DC:8C:C9:FD:F8:FB:D1:D3:88:B5:6C:8C:06:43:BB:A3:42:EE:83:3E:FE:53:D4:D2:AD:C1:6E:38:C7:A0:3D:83:77:2E:FF:A7:84:A9:EC:AD:83:71:72:6B:CE:93:29:D2:30:3E:6F:03:A2:34:7A:1E:E6:74:CF:DC:54:96:CA:06
a=msid-semantic: WMS *
a=group:BUNDLE 

And since it’s basically empty I fail when applying it locally to libwebrtc:
Peerconnection error: setSDP error: Failed to set remote answer sdp: The order of m-lines in answer doesn't match order in offer. Rejecting answer

Any clue on why I get this SDP and how to fix?

P.S. I noticed that configuring my webrtc PeerConnection as sendonly instead of sendrecv I get a valid SDP response. But I’m not able to try the functionality much further because our current code relies on sendrecv

Hi,

Unfortunately when using mediasoup as Media Server in OpenVidu Enterprise, WebRTC connections can only be sendonly or recvonly.
If you look into our official Android tutorial, you’ll see that any RtpTransceiver.RtpTransceiverDirection in the code is of type SEND_ONLY or RECV_ONLY: openvidu-tutorials/Session.java at master · OpenVidu/openvidu-tutorials · GitHub

Thank you. I implemented SEND_ONLY and RECV_ONLY clients and it worked