Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Dino does not refresh expired TURN\STUN server credentials #61

Merged
merged 3 commits into from
Apr 24, 2024

Conversation

VadimNk
Copy link

@VadimNk VadimNk commented Apr 18, 2024

Add a field in Xmpp.Xep.ExternalServiceDiscovery to keep track of the expires TURN service value and use it (divided by 2) to restart periodically the external services discovery.

Without this patch, calls (actually ICE) fail to initiate after 24h of Dino uptime because of the expiry of the TURN credentials.

This happened on my setup using prosody (using the default credentials' TTL of 86400) and coturn.

@giantplaceholder giantplaceholder changed the title Xep 0215 expires Dino does not refresh TURN credentials after 24 hrs of runtime (XEP-0215) Apr 18, 2024
@giantplaceholder giantplaceholder changed the title Dino does not refresh TURN credentials after 24 hrs of runtime (XEP-0215) [Fix] Dino does not refresh expired TURN\STUN server credentials Apr 18, 2024
Add a field in `Xmpp.Xep.ExternalServiceDiscovery` to keep track
of the `expires` TURN service value and use it (divided by 2) to
restart periodically the external services discovery.
Fix following comment and recommandations:

- Use DateTime? type instead of int64?
- check the computed delay value against sane values
- use a HashMap to keep track of timers and cancel them on connection
  closed
- add equals and hash funcs to XmppStream to use with the HashMap
- rename the callback to reflect its meaning
- test the TURN server conf before STUN default server
@VadimNk
Copy link
Author

VadimNk commented Apr 24, 2024

After a 24-hour test, audio dialing is successful and the sound goes in both directions. In the original PR, after a network reconnection there was no sound from the 24 hour client.

@mxlgv mxlgv marked this pull request as ready for review April 24, 2024 14:28
@mxlgv mxlgv changed the title [Fix] Dino does not refresh expired TURN\STUN server credentials Fix Dino does not refresh expired TURN\STUN server credentials Apr 24, 2024
@mxlgv mxlgv merged commit c00d3a1 into mxlgv:master Apr 24, 2024
4 checks passed
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.

4 participants