Intermittent WebRTC Data Channel problem on EC2

Pablo Odorico via gstreamer-devel <[email protected]> Mon, 23 Oct 2023 20:35:58 +0200
Newsgroups gmane.comp.video.gstreamer.devel
Message-ID <CAFuUJFiiuM_y6ECK3VQx=ywpQPL4QyBsomY_B_gh+Qr-=HRUgQ@mail.gmail.com>
Hello,

I'm using GStreamer 1.20.3 to implement a streaming solution using
webrtcbin. Before A/V streaming starts the Data Channel is opened to
do some negotiation.
This works quite well in many configurations, but when the "server" is
running on an EC2 instance streaming fails about half the time and the
Data Channel can't be opened. Both client and server are using
GStreamer.

The main difference I see in the working vs broken logs (attached) is
that when it doesn't work this message is never shown:
gstwebrtcbin.c:2471:_on_sctp_notify_dtls_state:<webrtcbin> Data
channel DTLS state changed to 0

Instead the ICE/DTLS and peer connection state is shown as failed:
gstwebrtcbin.c:1280:_collate_peer_connection_states:<webrtcbin> ICE
connection state: 0x10. DTLS connection state: 0x1
gstwebrtcbin.c:1290:_collate_peer_connection_states:<webrtcbin> returning failed
gstwebrtcbin.c:1448:_update_peer_connection_state_task:<webrtcbin>
Peer connection state change from connecting(1) to failed(4)

Any ideas what could be causing this or how can I debug it further?
Any specific elements that I can increase the log level to? I'm using
webrtcbin:7,nicesrc:7

Thanks!
Pablo
working.txt (text/plain, 146 KB) - not displayed
broken.txt (text/plain, 130.5 KB) - not displayed