ICE Failed with Janus WHIP

I’m currently running Janus in an EC2 instance and I have the demo for videoroom running. I also have simple-whip-server running on that same EC2. I’ve setup nat properly. I’ve also setup ssl. When I run the whip client in docker I’m getting the following output

docker run -it --rm -e "URL=https://janus.mydomain.tools:7080/whip/endpoint/test" simple-whip-client

--------------------
Simple WHIP client
------------------

WHIP endpoint:  https://janus.mydomain.com:7080/whip/endpoint/test
Bearer Token:   (none)
Trickle ICE:    yes (HTTP PATCH)
Auto STUN/TURN: no
STUN server:    stun://stun.l.google.com:19302
TURN server:    (none)
Audio pipeline: audiotestsrc is-live=true wave=red-noise ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay pt=100 ssrc=1 ! queue ! application/x-rtp,media=audio,encoding-name=OPUS,payload=100
Video pipeline: videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! vp8enc deadline=1 ! rtpvp8pay pt=96 ssrc=2 ! queue ! application/x-rtp,media=video,encoding-name=VP8,payload=96

[WHIP] Initializing the GStreamer pipeline:
webrtcbin name=sendonly bundle-policy=3  stun-server=stun://stun.l.google.com:19302  videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! vp8enc deadline=1 ! rtpvp8pay pt=96 ssrc=2 ! queue ! application/x-rtp,media=video,encoding-name=VP8,payload=96 ! sendonly. audiotestsrc is-live=true wave=red-noise ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay pt=100 ssrc=1 ! queue ! application/x-rtp,media=audio,encoding-name=OPUS,payload=100 ! sendonly.
[WHIP] Configured jitter-buffer size (latency) for PeerConnection to 200ms
[WHIP] Starting the GStreamer pipeline
[WHIP] Creating offer
[WHIP] Offer created
[WHIP] Setting local description
[WHIP] Sending SDP offer (1167 bytes)
[WHIP] Resource URL: https://janus.mydomain.com:7080/whip/resource/CTz8kBP22jb57DJT
[WHIP] Received SDP answer (1102 bytes)
[WHIP] Setting remote description
[WHIP] ICE gathering started...
[WHIP] ICE connecting...
[WHIP] PeerConnection connecting...
[WHIP] ICE gathering completed
[WHIP] [ERR] [src/whip-client.c:whip_ice_connection_state:629] ICE failed
[WHIP] Disconnecting from server (ICE failed)
[WHIP] [ERR] [src/whip-client.c:whip_connection_state:575] PeerConnection failed
[WHIP] DTLS connection closed
[WHIP] GStreamer pipeline stopped

Bye!

I’m getting ICE failed, and here’s what Janus is logging out for me.

Handling publisher: turned this into an 'answer':
v=0
o=- 3911461755 3911461755 IN IP4 1.1.1.1
s=VideoRoom 1234
t=0 0
c=IN IP4 127.0.0.1
m=audio 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 127.0.0.1
a=recvonly
a=rtpmap:96 opus/48000/2
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:2 urn:ietf:params:rtp-hdrext:ssrc-audio-level
m=video 9 UDP/TLS/RTP/SAVPF 97
c=IN IP4 127.0.0.1
a=recvonly
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=rtcp-fb:97 transport-cc
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid

[4708645529502497] There are 1 audio, 1 video and 0 data m-lines
 -------------------------------------------
  >> Anonymized
 -------------------------------------------
[4708645529502497] We have 1 candidates for Stream #1, Component #1
[4708645529502497]   Address:    10.xxx.2.xxx:44394
[4708645529502497]   Priority:   2015363327
[4708645529502497]   Foundation: 1
[4708645529502497]     1 1 udp 2015363327 10.xxx.2.xxx 44394 typ host
[4708645529502497] We have 1 candidates for Stream #1, Component #1
[4708645529502497]   Address:    10.xxx.2.xxx:44394
[4708645529502497]   Priority:   2015363327
[4708645529502497]   Foundation: 1
[4708645529502497]     1 1 udp 2015363327 10.xxx.2.xxx 44394 typ host
 -------------------------------------------
  >> Merged (1269 bytes)
 -------------------------------------------
v=0
o=- 3911461755 3911461755 IN IP4 10.xxx.2.xxx
s=VideoRoom 1234
t=0 0
a=group:BUNDLE 0 1
a=ice-options:trickle
a=fingerprint:sha-256 E6:81:12:DF:85:B2:81:F0:7C:FE:0A:55:7D:D6:07:1F:D9:86:6A:19:ED:7D:ED:6B:51:D3:3D:1E:6B:FD:8E:58
a=extmap-allow-mixed
a=msid-semantic: WMS *
m=audio 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 10.xxx.2.xxx
a=recvonly
a=mid:0
a=rtcp-mux
a=ice-ufrag:5Epw
a=ice-pwd:CA6gfVvMLVdFnKnEyKINS3
a=ice-options:trickle
a=setup:active
a=rtpmap:96 opus/48000/2
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:2 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=msid:janus janus0
a=ssrc:1879567574 cname:janus
a=candidate:1 1 udp 2015363327 10.xxx.2.xxx 44394 typ host
a=end-of-candidates
m=video 9 UDP/TLS/RTP/SAVPF 97 98
c=IN IP4 10.xxx.2.xxx
a=recvonly
a=mid:1
a=rtcp-mux
a=ice-ufrag:5Epw
a=ice-pwd:CA6gfVvMLVdFnKnEyKINS3
a=ice-options:trickle
a=setup:active
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=rtcp-fb:97 transport-cc
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=rtpmap:98 rtx/90000
a=fmtp:98 apt=97
a=msid:janus janus1
a=ssrc:1126230015 cname:janus
a=candidate:1 1 udp 2015363327 10.xxx.2.xxx 44394 typ host
a=end-of-candidates

[4708645529502497] Sending answer, ready to setup remote candidates and send connectivity checks...
[4708645529502497]   -- ICE Trickling is supported by the browser, waiting for remote candidates...
[4708645529502497] Sending event to transport...
  >> Pushing event: 0 (took 194 us)
Got a Janus API request from janus.transport.websockets (0x7f8bfc0041b0)
Got a keep-alive on session 1448726008781449
Sending REMB (james, 128000)
[(null)] Returning error 450 (Unsupported method )
Sending REMB (james, 128000)
Regular keyframe request sending PLI to 4170340419791800 (#1, james)

I’ve also added this under my janus.jcfg nat config

       stun_server = stun.l.google.com
       stun_port = 19302

What am I missing? Thanks!

Why? Janus shouldn’t need a STUN server if it’s publicly reachable: on AWS in particular, STUN is not what you use. STUN/TURN are usually only needed by users, not Janus.

Resolved it. Turns out sending to simple-whip-server while connected to a VPN was causing the issue. This was causing the ICE Failure.

1 Like