最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remo

programmeradmin2浏览0评论

I have implemented WebRTC for video-audio call through browser. I am using the latest adapter.js. I also implemented WebRTC for native android app too. My signaling server is based on php WebSocket(Ratchet websocket). When I'm testing my implementation within two browsers(chrome-chrome, or chrome-firefox bination) I see the protocol is working fine. I mean video-audio call goes properly. When I test my android app I can see it's also working for app to app munication.

But the problem is when I'm trying to give call from my android app to web app I see the setRemoteDescription is not working rather it's generating the following error:

Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote answer sdp: Media section has more than one track specified with a=ssrc lines which is not supported with Unified Plan.

In my gradle(app) script I implemented the WebRTC library as follows:

implementation 'org.webrtc:google-webrtc:1.0.+'

That's why I think the latest adapter.js(for web part) and android library should be patible and there are no issue related with version inpatibility between the web implementation and android implementation.

For better understanding I am sharing here the SDP message which is found when generating offer.

v=0
o=- 7452034467634633423 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS 90 BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 9 0 8 105 13 110 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:KwHG
a=ice-pwd:YhH0S06F5dJrCns9jFbscFMA
a=ice-options:trickle renomination
a=fingerprint:sha-256 B1:75:DB:D5:20:8C:86:F1:CC:54:4A:1C:C6:C9:AD:D3:79:C4:1E:45:57:CD:9B:FC:CC:1D:01:C5:C1:C5:BF:93
a=setup:active
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
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:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:2787512374 cname:dF4uE3SebLpSsKGh
a=ssrc:2787512374 msid:90 101
a=ssrc:2787512374 mslabel:90
a=ssrc:2787512374 label:101
a=ssrc:4286803808 cname:dF4uE3SebLpSsKGh
a=ssrc:4286803808 msid:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP cf5d6c28-239b-4c64-8051-33dbbb81edf4
a=ssrc:4286803808 mslabel:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP
a=ssrc:4286803808 label:cf5d6c28-239b-4c64-8051-33dbbb81edf4
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 108 109 124
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:KwHG
a=ice-pwd:YhH0S06F5dJrCns9jFbscFMA
a=ice-options:trickle renomination
a=fingerprint:sha-256 B1:75:DB:D5:20:8C:86:F1:CC:54:4A:1C:C6:C9:AD:D3:79:C4:1E:45:57:CD:9B:FC:CC:1D:01:C5:C1:C5:BF:93
a=setup:active
a=mid:1
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 
a=extmap:4 urn:3gpp:video-orientation
a=extmap:5 
a=extmap:6 
a=extmap:7 
a=extmap:8 
a=extmap:10 
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=rtpmap:98 VP9/90000
a=rtcp-fb:98 goog-remb
a=rtcp-fb:98 transport-cc
a=rtcp-fb:98 ccm fir
a=rtcp-fb:98 nack
a=rtcp-fb:98 nack pli
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=98
a=rtpmap:108 red/90000
a=rtpmap:109 rtx/90000
a=fmtp:109 apt=108
a=rtpmap:124 ulpfec/90000
a=ssrc-group:FID 1166964128 3959308542
a=ssrc:1166964128 cname:dF4uE3SebLpSsKGh
a=ssrc:1166964128 msid:90 100
a=ssrc:1166964128 mslabel:90
a=ssrc:1166964128 label:100
a=ssrc:3959308542 cname:dF4uE3SebLpSsKGh
a=ssrc:3959308542 msid:90 100
a=ssrc:3959308542 mslabel:90
a=ssrc:3959308542 label:100
a=ssrc-group:FID 1617372799 1848430645
a=ssrc:1617372799 cname:dF4uE3SebLpSsKGh
a=ssrc:1617372799 msid:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP b4a261f3-065b-47bd-a759-207401cb9a6e
a=ssrc:1617372799 mslabel:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP
a=ssrc:1617372799 label:b4a261f3-065b-47bd-a759-207401cb9a6e
a=ssrc:1848430645 cname:dF4uE3SebLpSsKGh
a=ssrc:1848430645 msid:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP b4a261f3-065b-47bd-a759-207401cb9a6e
a=ssrc:1848430645 mslabel:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP
a=ssrc:1848430645 label:b4a261f3-065b-47bd-a759-207401cb9a6e

I have implemented WebRTC for video-audio call through browser. I am using the latest adapter.js. I also implemented WebRTC for native android app too. My signaling server is based on php WebSocket(Ratchet websocket). When I'm testing my implementation within two browsers(chrome-chrome, or chrome-firefox bination) I see the protocol is working fine. I mean video-audio call goes properly. When I test my android app I can see it's also working for app to app munication.

But the problem is when I'm trying to give call from my android app to web app I see the setRemoteDescription is not working rather it's generating the following error:

Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote answer sdp: Media section has more than one track specified with a=ssrc lines which is not supported with Unified Plan.

In my gradle(app) script I implemented the WebRTC library as follows:

implementation 'org.webrtc:google-webrtc:1.0.+'

That's why I think the latest adapter.js(for web part) and android library should be patible and there are no issue related with version inpatibility between the web implementation and android implementation.

For better understanding I am sharing here the SDP message which is found when generating offer.

v=0
o=- 7452034467634633423 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS 90 BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 9 0 8 105 13 110 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:KwHG
a=ice-pwd:YhH0S06F5dJrCns9jFbscFMA
a=ice-options:trickle renomination
a=fingerprint:sha-256 B1:75:DB:D5:20:8C:86:F1:CC:54:4A:1C:C6:C9:AD:D3:79:C4:1E:45:57:CD:9B:FC:CC:1D:01:C5:C1:C5:BF:93
a=setup:active
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
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:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:2787512374 cname:dF4uE3SebLpSsKGh
a=ssrc:2787512374 msid:90 101
a=ssrc:2787512374 mslabel:90
a=ssrc:2787512374 label:101
a=ssrc:4286803808 cname:dF4uE3SebLpSsKGh
a=ssrc:4286803808 msid:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP cf5d6c28-239b-4c64-8051-33dbbb81edf4
a=ssrc:4286803808 mslabel:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP
a=ssrc:4286803808 label:cf5d6c28-239b-4c64-8051-33dbbb81edf4
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 108 109 124
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:KwHG
a=ice-pwd:YhH0S06F5dJrCns9jFbscFMA
a=ice-options:trickle renomination
a=fingerprint:sha-256 B1:75:DB:D5:20:8C:86:F1:CC:54:4A:1C:C6:C9:AD:D3:79:C4:1E:45:57:CD:9B:FC:CC:1D:01:C5:C1:C5:BF:93
a=setup:active
a=mid:1
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=extmap:5 http://www.ietf/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:6 http://www.webrtc/experiments/rtp-hdrext/playout-delay
a=extmap:7 http://www.webrtc/experiments/rtp-hdrext/video-content-type
a=extmap:8 http://www.webrtc/experiments/rtp-hdrext/video-timing
a=extmap:10 http://tools.ietf/html/draft-ietf-avtext-framemarking-07
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=rtpmap:98 VP9/90000
a=rtcp-fb:98 goog-remb
a=rtcp-fb:98 transport-cc
a=rtcp-fb:98 ccm fir
a=rtcp-fb:98 nack
a=rtcp-fb:98 nack pli
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=98
a=rtpmap:108 red/90000
a=rtpmap:109 rtx/90000
a=fmtp:109 apt=108
a=rtpmap:124 ulpfec/90000
a=ssrc-group:FID 1166964128 3959308542
a=ssrc:1166964128 cname:dF4uE3SebLpSsKGh
a=ssrc:1166964128 msid:90 100
a=ssrc:1166964128 mslabel:90
a=ssrc:1166964128 label:100
a=ssrc:3959308542 cname:dF4uE3SebLpSsKGh
a=ssrc:3959308542 msid:90 100
a=ssrc:3959308542 mslabel:90
a=ssrc:3959308542 label:100
a=ssrc-group:FID 1617372799 1848430645
a=ssrc:1617372799 cname:dF4uE3SebLpSsKGh
a=ssrc:1617372799 msid:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP b4a261f3-065b-47bd-a759-207401cb9a6e
a=ssrc:1617372799 mslabel:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP
a=ssrc:1617372799 label:b4a261f3-065b-47bd-a759-207401cb9a6e
a=ssrc:1848430645 cname:dF4uE3SebLpSsKGh
a=ssrc:1848430645 msid:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP b4a261f3-065b-47bd-a759-207401cb9a6e
a=ssrc:1848430645 mslabel:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP
a=ssrc:1848430645 label:b4a261f3-065b-47bd-a759-207401cb9a6e
Share Improve this question edited Mar 27, 2019 at 14:03 Mushfiqur Rahman asked Mar 27, 2019 at 13:56 Mushfiqur RahmanMushfiqur Rahman 3064 silver badges18 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 1

You could try:

rtcConfiguration.sdpSemantics = PeerConnection.SdpSemantics.PLAN_B;

From the error: "Media section has more than one track specified with a=ssrc lines which is not supported with Unified Plan."

Fwiw Unified plan is the default (I believe) and is set with

rtcConfiguration.sdpSemantics = PeerConnection.SdpSemantics.UNIFIED_PLAN;

thanks. it works

if(getChromeVersion()>=72){ configuration.sdpSemantics = "unified-plan";} else { configuration.sdpSemantics = "plan-b";}

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论