@@ -502,25 +502,17 @@ static inline size_t map_ice_servers(
502502
503503static bool establish_peer_connections (engine_t * eng , livekit_pb_join_response_t * join )
504504{
505- esp_peer_ice_server_cfg_t server_list [] = {
506- { .stun_url = "stun:stun.l.google.com:19302" },
507- { .stun_url = "stun:stun1.l.google.com:19302" },
508- { .stun_url = "stun:stun2.l.google.com:19302" }
509- };
510- int server_count = sizeof (server_list ) / sizeof (server_list [0 ]);
511-
512- // TODO: Replace the above with the following to set the ICE servers dynamically:
513- // esp_peer_ice_server_cfg_t server_list[CONFIG_LK_MAX_ICE_SERVERS];
514- // int server_count = map_ice_servers(
515- // join->ice_servers,
516- // join->ice_servers_count,
517- // server_list,
518- // sizeof(server_list) / sizeof(server_list[0])
519- // );
520- // if (server_count < 1) {
521- // ESP_LOGW(TAG, "No ICE servers available");
522- // return false;
523- // }
505+ esp_peer_ice_server_cfg_t server_list [CONFIG_LK_MAX_ICE_SERVERS ];
506+ int server_count = map_ice_servers (
507+ join -> ice_servers ,
508+ join -> ice_servers_count ,
509+ server_list ,
510+ sizeof (server_list ) / sizeof (server_list [0 ])
511+ );
512+ if (server_count < 1 ) {
513+ ESP_LOGW (TAG , "No ICE servers available" );
514+ return false;
515+ }
524516
525517 peer_options_t options = {
526518 .force_relay = join -> client_configuration .force_relay
0 commit comments