diff --git a/packages/js/src/Modules/Verto/webrtc/BaseCall.ts b/packages/js/src/Modules/Verto/webrtc/BaseCall.ts index 0a074fb8..b361ca6d 100644 --- a/packages/js/src/Modules/Verto/webrtc/BaseCall.ts +++ b/packages/js/src/Modules/Verto/webrtc/BaseCall.ts @@ -266,14 +266,12 @@ export default abstract class BaseCall implements IWebRTCCall { this.direction = Direction.Inbound; - this.options = { - ...this.options, - customHeaders: [ - ...(params.customHeaders - ? params.customHeaders - : this.options.customHeaders), - ], - }; + if(params?.customHeaders?.length > 0) { + this.options = { + ...this.options, + customHeaders: params.customHeaders + }; + } this.peer = new Peer(PeerType.Answer, this.options); this._registerPeerEvents();