sipsorcery-org / sipsorcery

A WebRTC, SIP and VoIP library for C# and .NET. Designed for real-time communications apps.
https://sipsorcery-org.github.io/sipsorcery
Other
1.42k stars 432 forks source link

How to know which STUN.TURN server is used in PeerConnection #1160

Open mail2mhossain opened 1 month ago

mail2mhossain commented 1 month ago

We are providing a list of STUN and TURN servers url. Now we want to know which one is used in a PeerConnection.

ha-ves commented 4 weeks ago

In case of relay server. You can subscribe to the onicecandidate event and get the DestinationEndPoint.

pc.onicecandidate += (ice) =>
{
    if(ice.type == RTCIceCandidateType.relay)
        _relayServer = ice.DestinationEndPoint;
}