Skip to content

Commit

Permalink
remove channel param from the verto.invite (#1127)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsantosbh authored Oct 7, 2024
1 parent 30fae88 commit ab0ecd0
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions packages/js/src/fabric/WSClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,11 @@ export class WSClient {
let video = params.video ?? true
let negotiateVideo = true

if (to) {
const channelRegex = /\?channel\=(?<channel>(audio|video))/
const result = channelRegex.exec(to)
const toURL = new URL(`address:${to}`)

if (result && result.groups?.channel === 'audio') {
video = false
negotiateVideo = false
}
if (to && toURL.searchParams.get('channel') === 'audio') {
video = false
negotiateVideo = false
}

const call = this.wsClient.makeCallFabricObject({
Expand All @@ -106,7 +103,7 @@ export class WSClient {
applyLocalVideoOverlay: true,
stopCameraWhileMuted: true,
stopMicrophoneWhileMuted: true,
destinationNumber: params.to,
destinationNumber: toURL.pathname,
watchMediaPackets: false,
remoteSdp: sdp,
prevCallId: callID,
Expand Down

0 comments on commit ab0ecd0

Please sign in to comment.