Skip to content

Conversation

@ai-swe-agent
Copy link

@ai-swe-agent ai-swe-agent commented Sep 11, 2025

Summary

This PR implements Ice Trickle Support for the Flutter SDK as requested in WEBRTC-2963.

Changes Made

Core Configuration

  • Added useTrickleIce parameter to newInvite and 'acceptCall' within TelnyxClient
  • Added getUseTrickleIce() method to TelnyxClient for accessing the configuration

Socket Communication

  • Added new socket methods: candidate and endOfCandidates to SocketMethod constants
  • Created CandidateMessage and EndOfCandidatesMessage classes for JSON-RPC communication with proper message structure

Peer Implementation

  • Updated Peer constructor to accept useTrickleIce parameter
  • Modified onIceCandidate handler to support both traditional ICE gathering and trickle ICE
  • Implemented _sendTrickleCandidate method to send individual ICE candidates as they are discovered
  • Implemented _sendEndOfCandidates method to signal completion of ICE candidate gathering
  • Updated TelnyxClient.newInvite and TelnyxClient.acceptCall methods to pass useTrickleIce parameter

Demo App Integration

  • Added "Enable/Disable Trickle ICE" toggle to the overflow menu in the home screen
  • Updated TelnyxClientViewModel to save and clear useTrickleIce configuration

Technical Details

ICE Candidate Handling

When useTrickleIce is enabled:

  • ICE candidates are sent immediately as they are discovered via telnyx_rtc.candidate messages
  • An telnyx_rtc.endOfCandidates message is sent when ICE gathering is complete

When useTrickleIce is disabled (default):

  • Traditional ICE gathering behavior is maintained for backward compatibility

Testing

The implementation maintains backward compatibility with existing functionality while adding the new trickle ICE capability. The default behavior remains unchanged (useTrickleIce: false).

Related

openhands-agent and others added 13 commits September 11, 2025 09:38
- Add useTrickleIce parameter to Config base class and implementations
- Add new socket methods for telnyx_rtc.candidate and telnyx_rtc.endOfCandidates
- Create CandidateMessage and EndOfCandidatesMessage classes for JSON-RPC communication
- Add getUseTrickleIce() method to TelnyxClient
- Update Peer constructor to accept useTrickleIce parameter and implement trickle ICE logic
- Modify TelnyxClient newInvite and acceptCall methods to pass useTrickleIce
- Implement _sendTrickleCandidate and _sendEndOfCandidates methods in Peer class
- Update Profile model to include useTrickleIce field with toJson and copyWith support
- Add trickle ICE toggle to demo app overflow menu
- Update ProfileProvider with toggleTrickleIce method
- Update ConfigHelper to persist useTrickleIce setting in SharedPreferences
- Update TelnyxClientViewModel to save/clear useTrickleIce configuration
… config

- Remove useTrickleIce from Config classes (base Config, CredentialConfig, TokenConfig)
- Remove getUseTrickleIce() method from TelnyxClient
- Add useTrickleIce parameter to newInvite() and acceptCall() methods
- Update Peer constructor calls to pass useTrickleIce directly
- Update demo app to pass useTrickleIce from profile when calling methods
- Keep existing socket methods and SDP modifications for trickle ICE support
…se timer for endOfCandidate message incase signalling does not complete
… move sdp handling methods to SDP Utils class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants