Skip to content

Conversation

@sipsorcery
Copy link
Member

@sipsorcery sipsorcery commented Sep 17, 2025

Add a new TURN client for allocating relay endpoints on TURN servers.

The TURN client has been wired up to work with the SIP media sessions. Wiring up for WebRTC is a TODO.

@sipsorcery sipsorcery marked this pull request as draft September 17, 2025 20:10
@sipsorcery sipsorcery marked this pull request as ready for review September 20, 2025 21:07
@sipsorcery sipsorcery requested a review from Copilot September 21, 2025 12:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces TURN client functionality to enable relay endpoints on TURN servers for SIP media sessions. The implementation provides a comprehensive TURN client that handles allocation requests, permission creation, and automatic refresh operations to maintain relay connections.

Key changes:

  • Added a complete TURN client implementation with automatic allocation and renewal
  • Integrated TURN support into SIP media sessions with relay endpoint management
  • Refactored RTP channel architecture to support STUN/TURN message handling

Reviewed Changes

Copilot reviewed 28 out of 33 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/net/TURN/TurnClient.cs Complete TURN client implementation handling allocate, refresh, and permission requests
src/net/TURN/TurnClientExtensions.cs Extension methods for MediaStream to enable TURN relay functionality
src/net/TURN/TurnRelayEndPoint.cs Data structure representing TURN relay endpoint information
src/net/RTP/RTPChannel.cs Enhanced RTP channel with STUN message detection and relay sending capabilities
src/net/RTP/Streams/MediaStream.cs Added TURN relay endpoint support and relay-aware RTP packet sending
src/net/RTP/UdpReceiver.cs Extracted UDP receiver functionality from RTPChannel for better modularity
examples/sipcmdline/Program.cs Updated command-line example to demonstrate TURN functionality
src/net/WebRTC/IRTCPeerConnection.cs Added RTCIceServer parsing utility method
src/net/ICE/IceServer.cs Enhanced IceServer with parsing capabilities and URI property

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

sipsorcery and others added 5 commits September 21, 2025 13:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
sipsorcery and others added 4 commits September 21, 2025 13:52
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sipsorcery sipsorcery merged commit 27b3389 into master Sep 21, 2025
@sipsorcery sipsorcery deleted the turnclient branch September 21, 2025 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants