diff --git a/ts/services/calling.ts b/ts/services/calling.ts index f64af7190..9003f7091 100644 --- a/ts/services/calling.ts +++ b/ts/services/calling.ts @@ -2613,12 +2613,20 @@ export class CallingClass { const isContactUntrusted = !isInSystemContacts(conversation.attributes); const callSettings = { + // only include hostname with urlsWithIps + // proritize ice servers with IPs to avoid DNS iceServers: [ + { + hostname: iceServer.hostname, + username: iceServer.username, + password: iceServer.password, + urls: (iceServer.urlsWithIps ?? []).slice(), + }, { hostname: '', username: iceServer.username, password: iceServer.password, - urls: iceServer.urls.slice(), + urls: (iceServer.urls ?? []).slice(), }, ], hideIp: shouldRelayCalls || isContactUntrusted, diff --git a/ts/textsecure/WebAPI.ts b/ts/textsecure/WebAPI.ts index 0344ec092..7547c6e8a 100644 --- a/ts/textsecure/WebAPI.ts +++ b/ts/textsecure/WebAPI.ts @@ -503,7 +503,7 @@ const URL_CALLS = { discovery: 'v1/discovery', getGroupAvatarUpload: 'v1/groups/avatar/form', getGroupCredentials: 'v1/certificate/auth/group', - getIceServers: 'v1/accounts/turn', + getIceServers: 'v1/calling/relays', getOnboardingStoryManifest: 'dynamic/desktop/stories/onboarding/manifest.json', getStickerPackUpload: 'v1/sticker/pack/form', @@ -735,6 +735,8 @@ export type GetIceServersResultType = Readonly<{ username: string; password: string; urls: ReadonlyArray; + urlsWithIps: ReadonlyArray; + hostname: string; }>; export type GetDevicesResultType = ReadonlyArray<