Add Stun server with port 3478 (#129501)

This commit is contained in:
Krisjanis Lejejs 2024-10-30 16:40:23 +02:00 committed by GitHub
parent 568bdef61f
commit bf40e77d65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -420,7 +420,10 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
def get_ice_servers() -> list[RTCIceServer]:
if hass.config.webrtc.ice_servers:
return hass.config.webrtc.ice_servers
return [RTCIceServer(urls="stun:stun.home-assistant.io:80")]
return [
RTCIceServer(urls="stun:stun.home-assistant.io:80"),
RTCIceServer(urls="stun:stun.home-assistant.io:3478"),
]
async_register_ice_servers(hass, get_ice_servers)
return True

View File

@ -347,7 +347,10 @@ async def test_ws_get_client_config(
assert msg["success"]
assert msg["result"] == {
"configuration": {
"iceServers": [{"urls": "stun:stun.home-assistant.io:80"}],
"iceServers": [
{"urls": "stun:stun.home-assistant.io:80"},
{"urls": "stun:stun.home-assistant.io:3478"},
],
},
"getCandidatesUpfront": False,
}
@ -376,6 +379,7 @@ async def test_ws_get_client_config(
"configuration": {
"iceServers": [
{"urls": "stun:stun.home-assistant.io:80"},
{"urls": "stun:stun.home-assistant.io:3478"},
{
"urls": ["stun:example2.com", "turn:example2.com"],
"username": "user",