diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index fcafa970..aeba93fc 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -32,10 +32,10 @@ jobs: run: | git config user.name TelnyxIntegrations git config user.email integrations@telnyx.com - - name: Use Node.js 16.x + - name: Use Node.js 18.x uses: actions/setup-node@v4 with: - node-version: "16" + node-version: "18" cache: "yarn" registry-url: https://registry.npmjs.org/ - name: Install shared dependencies diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index aa9513a9..f3326461 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -35,10 +35,10 @@ jobs: run: | git config user.name TelnyxIntegrations git config user.email integrations@telnyx.com - - name: Use Node.js 16.x + - name: Use Node.js 18.x uses: actions/setup-node@v4 with: - node-version: "16.x" + node-version: "18.x" cache: "yarn" registry-url: https://registry.npmjs.org/ - name: Install shared dependencies @@ -106,10 +106,10 @@ jobs: run: | git config user.name TelnyxIntegrations git config user.email integrations@telnyx.com - - name: Use Node.js 16.x + - name: Use Node.js 18.x uses: actions/setup-node@v4 with: - node-version: "16.x" + node-version: "18.x" cache: "yarn" registry-url: https://registry.npmjs.org/ - name: Install shared dependencies @@ -144,10 +144,10 @@ jobs: run: | git config user.name TelnyxIntegrations git config user.email integrations@telnyx.com - - name: Use Node.js 16.x + - name: Use Node.js 18.x uses: actions/setup-node@v4 with: - node-version: "16.x" + node-version: "18.x" cache: "yarn" registry-url: https://registry.npmjs.org/ - name: Install shared dependencies diff --git a/.github/workflows/webrtc-cdn-deploy.yml b/.github/workflows/webrtc-cdn-deploy.yml index de9b962b..6ed43cc3 100644 --- a/.github/workflows/webrtc-cdn-deploy.yml +++ b/.github/workflows/webrtc-cdn-deploy.yml @@ -31,10 +31,10 @@ jobs: run: | git config user.name TelnyxIntegrations git config user.email integrations@telnyx.com - - name: Use Node.js 16.x + - name: Use Node.js 18.x uses: actions/setup-node@v4 with: - node-version: "16.x" + node-version: "18.x" cache: "yarn" registry-url: https://registry.npmjs.org/ - name: Install shared dependencies diff --git a/.github/workflows/webrtc-test-release.yml b/.github/workflows/webrtc-test-release.yml index 451b3a8e..125783fe 100644 --- a/.github/workflows/webrtc-test-release.yml +++ b/.github/workflows/webrtc-test-release.yml @@ -19,10 +19,10 @@ jobs: ref: ${{ github.ref }} fetch-depth: 0 - - name: Use Node.js 16.x + - name: Use Node.js 18.x uses: actions/setup-node@v4 with: - node-version: "16.x" + node-version: "18.x" cache: "yarn" registry-url: https://registry.npmjs.org/ - name: Install shared dependencies @@ -48,10 +48,10 @@ jobs: ref: "main" # https://github.com/release-it/release-it/issues/657#issuecomment-647848200 fetch-depth: 0 - - name: Use Node.js 16.x + - name: Use Node.js 18.x uses: actions/setup-node@v4 with: - node-version: "16.x" + node-version: "18.x" cache: "yarn" registry-url: https://registry.npmjs.org/ - name: Install shared dependencies diff --git a/.nvmrc b/.nvmrc index 6f7f377b..3f430af8 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v16 +v18 diff --git a/packages/js/src/Modules/Verto/services/Connection.ts b/packages/js/src/Modules/Verto/services/Connection.ts index 32b1934b..b64d7291 100644 --- a/packages/js/src/Modules/Verto/services/Connection.ts +++ b/packages/js/src/Modules/Verto/services/Connection.ts @@ -11,6 +11,7 @@ import { import { registerOnce, trigger } from './Handler'; import { GatewayStateType } from '../webrtc/constants'; import { getReconnectToken, setReconnectToken } from '../util/reconnect'; +import { attachMediaStream } from '../util/webrtc'; let WebSocketClass: any = typeof WebSocket !== 'undefined' ? WebSocket : null; export const setWebSocket = (websocket: any): void => { @@ -71,12 +72,14 @@ export default class Connection { } connect() { + const websocketUrl = new URL(this._host); const reconnectToken = getReconnectToken(); + if (reconnectToken) { - this._host += `?voice_sdk_id=${reconnectToken}`; + websocketUrl.searchParams.set('voice_sdk_id', reconnectToken); } - this._wsClient = new WebSocketClass(this._host); + this._wsClient = new WebSocketClass(websocketUrl.toString()); this._wsClient.onopen = (event): boolean => trigger(SwEvent.SocketOpen, event, this.session.uuid); this._wsClient.onclose = (event): boolean =>