feat: ICE/DTLS/RTP improvements for aiortc and Pipecat interop#262
Open
andrewjaykeller wants to merge 3 commits intosepfy:mainfrom
Open
feat: ICE/DTLS/RTP improvements for aiortc and Pipecat interop#262andrewjaykeller wants to merge 3 commits intosepfy:mainfrom
andrewjaykeller wants to merge 3 commits intosepfy:mainfrom
Conversation
Changes developed during Bondu firmware integration (ESP32-S3 IoT toy with full-duplex WebRTC audio via Pipecat/Daily.co). ## ICE/STUN (`agent.c`, `stun.c`, `ice.c`) - Add separate ICE socket to match aiortc's per-component socket model - Fix ICE nomination: accept USE-CANDIDATE on binding requests - Add TURN ChannelData framing support (0x4000 prefix detection) - Add CreatePermission and ChannelBind TURN methods - Fix MESSAGE-INTEGRITY computation for long-term credentials - Add ICE candidate priority calculation per RFC 5245 - Configurable STUN timeouts and retry logic - Verbose ICE state transition logging for debugging ## DTLS-SRTP (`dtls_srtp.c`) - Fix DTLS handshake with aiortc (ECDSA certificate generation) - Add DTLS-SRTP key export for bidirectional media - Handle DTLS retransmission timers properly - Add DTLS state machine logging ## RTP/RTCP (`rtp.c`, `rtcp.c`, `rtp.h`) - Fix RTP header extension parsing (RFC 5285 one-byte) - Add SSRC late-binding for incoming streams - Fix byte order issues on little-endian hosts (macOS emulator) - Add RTP timestamp calculation helpers ## SDP (`sdp.c`, `sdp.h`) - Parse ICE candidates from SDP answer - Handle a=setup:active/passive/actpass roles - Parse DTLS fingerprint from SDP ## Peer Connection (`peer_connection.c`) - Add data channel send/receive support - Add connection state change callbacks - Add audio send API with RTP packetization - Handle DTLS-SRTP negotiation completion - Configurable Opus frame duration (20ms default for aiortc compat) ## Other - `socket.c`: Add socket reuse and non-blocking improvements - `address.c/h`: Add address comparison helpers - `config.h`: Add CONFIG_AUDIO_DURATION, CONFIG_DTLS_USE_ECDSA options
110810e to
a2693de
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes developed during integration with an ESP32-S3 IoT device running full-duplex WebRTC audio via Pipecat/Daily.co (using aiortc as the server-side WebRTC stack).
CONFIG_AUDIO_DURATIONandCONFIG_DTLS_USE_ECDSAbuild optionsContext
These changes were necessary to achieve a working DTLS-SRTP connection with aiortc (Python WebRTC) and Pipecat cloud. The main issues were:
Test plan
🤖 Generated with Claude Code