Skip to content

Commit

Permalink
fetch turn creds
Browse files Browse the repository at this point in the history
  • Loading branch information
balazskreith committed Oct 28, 2024
1 parent 09ff645 commit fd2229e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function createCreateTransportRequestListener(listenerContext: CreateTran
else if (role === 'consuming') client.rcvTransport = transport;

logger.debug(`Transport ${transport.id} iceCandidates: %s`, JSON.stringify(transport.iceCandidates, null, 2))

response = {
dtlsParameters: transport.dtlsParameters,
iceCandidates: transport.iceCandidates,
Expand Down
6 changes: 6 additions & 0 deletions media-server/src/client-listeners/JoinCallRequestListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ export function createJoinCallRequestListener(listenerContext: JoinCallRequestLi

client.routerId = router.id;

const turnResponse = (await fetch(`http://stunner-auth.stunner-system:8088?service=turn`)).json();

logger.info(`Turn response: %o`, turnResponse);

// http://stunner-auth.stunner-system:8088?service=turn

response = {
callId: router.id,
rtpCapabilities: router.rtpCapabilities,
Expand Down
7 changes: 4 additions & 3 deletions media-server/src/protocols/MessageProtocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ export type JoinCallResponsePayload = {
callId: string,
readonly rtpCapabilities: mediasoup.types.RtpCapabilities,
iceServers: {
urls: string
credential?: string
username?: string
credential: string;
credentialType: 'password';
urls: string | string[];
username: string;
}[],
}

Expand Down
8 changes: 5 additions & 3 deletions webapp/src/utils/MessageProtocol.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as mediasoup from 'mediasoup-client';


/* eslint-disable no-unused-vars */
type UnionizeEvent<T extends object> = {
[k in keyof T]: {
Expand Down Expand Up @@ -61,9 +62,10 @@ export type JoinCallResponsePayload = {
callId: string,
readonly rtpCapabilities: mediasoup.types.RtpCapabilities,
iceServers: {
urls: string
credential?: string
username?: string
credential: string;
credentialType: 'password';
urls: string | string[];
username: string;
}[],
}

Expand Down

0 comments on commit fd2229e

Please sign in to comment.