Inbound calls consistently died at ~2s with the Meta PC going straight
from connecting → closed (never reaching connected). Root cause: pion
starts the DTLS handshake the moment we SetLocalDescription during
create_session, but Rails only delivers our SDP answer to Meta via
pre_accept_call / accept_call afterwards. During the ~1s gap Meta has
no fingerprint for us and drops our ClientHello. pion's default DTLS
retransmission window lapsed before Meta was ready to respond.
- Bump the DTLS connect context to a 30s timeout so retries keep going
until Meta has our credentials.
- Shorten the retransmission interval to 200ms so a retry lands quickly
once Meta is listening.
- Log DTLS transport state and the stack trace for explicit pc.Close()
so the next regression is easy to diagnose.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>