werift-webrtc: "invalid remote port" when data starts flowing
The following offer:
v=0
o=- 25373548 0 IN IP4 0.0.0.0
s=-
t=0 0
a=group:BUNDLE 0 1 2
a=extmap-allow-mixed
a=msid-semantic:WMS *
m=audio 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 0.0.0.0
a=ice-ufrag:e1e6
a=ice-pwd:3de05c27f761027baaeda2
a=ice-options:trickle
a=fingerprint:sha-256 02:35:32:AF:E1:44:8A:91:D3:54:BB:14:8C:40:2A:73:0A:81:57:14:E8:1D:4B:0E:C4:A2:D6:68:D4:5D:1E:6A
a=setup:actpass
a=recvonly
a=mid:0
a=msid:3a3e0c15-b3e6-4f46-bf38-bd904b44b782 c5af7974-995a-4a06-af72-84d0e2a69295
a=rtcp:9 IN IP4 0.0.0.0
a=rtcp-mux
a=ssrc:2112560515 cname:58cdd469-29cc-4620-bbfa-1e44461d2c76
a=rtpmap:96 opus/48000/2
m=video 9 UDP/TLS/RTP/SAVPF 97
c=IN IP4 0.0.0.0
a=ice-ufrag:e1e6
a=ice-pwd:3de05c27f761027baaeda2
a=ice-options:trickle
a=fingerprint:sha-256 02:35:32:AF:E1:44:8A:91:D3:54:BB:14:8C:40:2A:73:0A:81:57:14:E8:1D:4B:0E:C4:A2:D6:68:D4:5D:1E:6A
a=setup:actpass
a=recvonly
a=mid:1
a=msid:92de723a-910d-47b8-a694-ba16846c2155 7b970e2e-6610-42c4-9c0a-973953222f42
a=rtcp:9 IN IP4 0.0.0.0
a=rtcp-mux
a=ssrc:321650976 cname:58cdd469-29cc-4620-bbfa-1e44461d2c76
a=rtpmap:97 VP8/90000
a=rtcp-fb:97 ccm fir
a=rtcp-fb:97 nack
a=rtcp-fb:97 nack pli
a=rtcp-fb:97 goog-remb
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 0.0.0.0
a=ice-ufrag:e1e6
a=ice-pwd:3de05c27f761027baaeda2
a=ice-options:trickle
a=fingerprint:sha-256 02:35:32:AF:E1:44:8A:91:D3:54:BB:14:8C:40:2A:73:0A:81:57:14:E8:1D:4B:0E:C4:A2:D6:68:D4:5D:1E:6A
a=setup:actpass
a=mid:2
a=sctp-port:5000
a=max-message-size:65536
and answer:
v=0
o=- 0 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 2 1
a=msid-semantic: WMS 13945094204333313074/3212739396 virtual-6666
a=ice-lite
m=audio 19305 UDP/TLS/RTP/SAVPF 96
c=IN IP4 <redacted>
a=rtcp:9 IN IP4 0.0.0.0
a=candidate: 1 udp 2113939711 2607:f8b0:400e:c03::7f 19305 typ host generation 0
a=candidate: 1 tcp 2113939710 2607:f8b0:400e:c03::7f 19305 typ host tcptype passive generation 0
a=candidate: 1 ssltcp 2113939709 2607:f8b0:400e:c03::7f 443 typ host generation 0
a=candidate: 1 udp 2113932031 74.125.197.127 19305 typ host generation 0
a=candidate: 1 tcp 2113932030 74.125.197.127 19305 typ host tcptype passive generation 0
a=candidate: 1 ssltcp 2113932029 74.125.197.127 443 typ host generation 0
a=ice-ufrag:KFPTBCP4YKPZTY1Q
a=ice-pwd:VA0L9MQMWS8IYO9NJF+ITE++
a=fingerprint:sha-256 92:D6:06:D6:CB:64:B4:EF:47:76:00:F7:48:E0:ED:DD:9F:3E:DA:16:41:49:47:43:E0:77:DD:C6:D7:83:7E:19
a=setup:passive
a=mid:0
a=sendrecv
a=msid:virtual-6666 virtual-6666
a=rtcp-mux
a=rtpmap:96 opus/48000/2
a=fmtp:96 minptime=10;useinbandfec=1
a=ssrc:6666 cname:6666
m=video 9 UDP/TLS/RTP/SAVPF 97
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:KFPTBCP4YKPZTY1Q
a=ice-pwd:VA0L9MQMWS8IYO9NJF+ITE++
a=fingerprint:sha-256 92:D6:06:D6:CB:64:B4:EF:47:76:00:F7:48:E0:ED:DD:9F:3E:DA:16:41:49:47:43:E0:77:DD:C6:D7:83:7E:19
a=setup:passive
a=mid:1
a=sendrecv
a=msid:13945094204333313074/3212739396 13945094204333313074/3212739396
a=rtcp-mux
a=rtpmap:97 VP8/90000
a=rtcp-fb:97 ccm fir
a=rtcp-fb:97 nack
a=rtcp-fb:97 nack pli
a=rtcp-fb:97 goog-remb
a=ssrc:3212739396 cname:3212739396
m=application 9 DTLS/SCTP 5000
c=IN IP4 0.0.0.0
a=ice-ufrag:KFPTBCP4YKPZTY1Q
a=ice-pwd:VA0L9MQMWS8IYO9NJF+ITE++
a=fingerprint:sha-256 92:D6:06:D6:CB:64:B4:EF:47:76:00:F7:48:E0:ED:DD:9F:3E:DA:16:41:49:47:43:E0:77:DD:C6:D7:83:7E:19
a=setup:passive
a=mid:2
a=sctpmap:5000 webrtc-datachannel 1024
At the start of data flow an ack will try to be sent and the remote port of the server will be undefined here: https://github.com/shinyoshiaki/werift-webrtc/blob/develop/packages/sctp/src/sctp.ts#L1111
Probably related to: https://github.com/shinyoshiaki/werift-webrtc/issues/141, to make this work I had to “hack” the answer sdp to change “sctpmap” to “sctpMap”.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (7 by maintainers)
Hi @shinyoshiaki, I don’t know what my version of npm was doing but after deleting node_modules several times, clearing cache, modifying package.json several times etc. it seems I finally got it working.
Both issues seem to be resolved. Thank you so much, apologies again for my NPM inexperience.