Repository: meetecho/janus-gateway

Issue #1575: Wrong extension id for encrypted headers
Created: 2019-04-09T08:46:58Z
In some cases, Janus is sending an answer with a wrong extension id if encrypted extension headers are used. You can test this by enabling the flag "Negotiation with encrypted header extensions for SRTP in WebRTC" in chrome://flags.
Offer from Chrome:
...
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 122 127 121 125 107 108 109 124 120 123
...
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:10 http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07
a=extmap:12 http://www.webrtc.org/experiments/rtp-hdrext/color-space
a=extmap:13 urn:ietf:params:rtp-hdrext:encrypt urn:ietf:params:rtp-hdrext:toffset
a=extmap:11 urn:ietf:params:rtp-hdrext:encrypt urn:3gpp:video-orientation
a=extmap:9 urn:ietf:params:rtp-hdrext:encrypt http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:0 urn:ietf:params:rtp-hdrext:encrypt http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:0 urn:ietf:params:rtp-hdrext:encrypt http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
...

Answer from Janus:
...
m=video 9 UDP/TLS/RTP/SAVPF 96
...
a=extmap:11 urn:3gpp:video-orientation
a=extmap:0 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
...

Note that the extensions got mapped to the id of the encrypted version from the offer (that has the urn:ietf:params:rtp-hdrext:encrypt as prefix before the actual extension.
The problem is caused by the code that checks if the extension name is part of the m-line attribute in 
  
    
      janus-gateway/plugins/janus_videoroom.c
    
    
         Line 5893
      in
      ce8255e
    
  
  
    

        
          
           } else if(videoroom->videoorient_ext && m->type == JANUS_SDP_VIDEO && strstr(a->value, JANUS_RTP_EXTMAP_VIDEO_ORIENTATION)) { 
        
    
  


In this case this matches both the unencrypted and the encrypted extension and the last matching id (here the encrypted) is used.
(On a side note, the id 0 means that an unused number should be assigned in the answer, so replying with extmap:0 is invalid, too).
When setting the answer, Chrome fails with "Failed to set remote answer sdp: Failed to set remote video description send parameters.".

Duplicate issue #1576: [ERROR] Failed to set remote audio description send parameters
Created: 2019-04-10T09:34:04Z
Hi there.
Referring to https://groups.google.com/forum/#!topic/meetecho-janus/zi1ECKDDALY where I posted that I have a problem with audio description parameters in videoroom plugin using Chrome 73.0.3683.90 for Android, I tried to test janus in your demo page https://janus.conf.meetecho.com/videoroomtest.html and the same error is thrown with your demo server.
janus.js:2987 WebRTC error: DOMException: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote answer sdp: Failed to set remote audio description send parameters.

I already updated gateway and libs in server, but it keeps throwing the error, like in your demo.
The (summarized) trace:
1 - videoroomtest.js#257
2 - janus.js#1111
3 - janus.js#2322
4 - janus.js#2341 <- Promise callback error is called
5 - janus.js#2987 <- Error handled
Versions used:
Google Nexus 6P
Android 8.1.0
Chrome 73.0.3683.90
Janus v0.6.3
Libsrtp 2.2.0
Libnice 0.1.15
I hope this helps to find the problem.
Br,
D.
EDIT: Here is the SDP -> https://pastebin.com/jnyEn9xx

Closing comment (2019-04-11T18:27:25Z): From the SDP you shared on the group, the one with extmap:0, it might be related to #1575. Do you have the encrypted RTP extension flag enabled? If so, we don't support them yet.