Reputation: 1175
I have multiple turn servers in my WebRTC config:
iceServers: [
{
urls: 'turn:turn.example.com',
username: 'username',
credential: 'pass'
},
{
urls: 'turn:turn2.example.com',
username: 'username',
credential: 'pass'
}
]
When I start WebRTC call and then bring down turn.example.com
the communication freezes. WebRTC does not seem to automatically pick up new ICE candidate and resume the call.
Is there a way to resume/reestablish communication using second ICE server?
Upvotes: 4
Views: 780
Reputation: 3623
You should be able to use an ICE restart to gather fresh TURN candidates. To do an ICE restart, you need to perform another offer/answer exchange that changes the ICE username fragments and passwords. To trigger this, you can simply call:
pc.createOffer({iceRestart: true})
Upvotes: 4