@signalwire/js 4.0.0-dev-20260225173418 → 4.0.0-dev-20260226173058

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.mjs CHANGED
@@ -12188,7 +12188,7 @@ function isJSONRPCRequest(value) {
12188
12188
  return isObject(value) && hasProperty(value, "jsonrpc") && value.jsonrpc === "2.0" && hasProperty(value, "id") && typeof value.id === "string" && hasProperty(value, "method") && typeof value.method === "string";
12189
12189
  }
12190
12190
  function isJSONRPCResponse(value) {
12191
- return isObject(value) && hasProperty(value, "jsonrpc") && value.jsonrpc === "2.0" && hasProperty(value, "id") && typeof value.id === "string" && hasProperty(value, "result");
12191
+ return isObject(value) && hasProperty(value, "jsonrpc") && value.jsonrpc === "2.0" && hasProperty(value, "id") && typeof value.id === "string" && (hasProperty(value, "result") || hasProperty(value, "error"));
12192
12192
  }
12193
12193
 
12194
12194
  //#endregion
@@ -14023,7 +14023,7 @@ var WebRTCVertoManager = class extends VertoManager {
14023
14023
  }
14024
14024
  async sendLocalDescription(message, rtcPeerConnController) {
14025
14025
  const vertoMethod = message.method;
14026
- const optionalsParams = this.getSendLocalSDPOptionalParams(rtcPeerConnController);
14026
+ const optionalsParams = this.getSendLocalSDPOptionalParams(rtcPeerConnController, vertoMethod);
14027
14027
  try {
14028
14028
  const response = await this.executeVerto(message, optionalsParams);
14029
14029
  switch (vertoMethod) {
@@ -14166,18 +14166,18 @@ var WebRTCVertoManager = class extends VertoManager {
14166
14166
  this.callSession?.destroy();
14167
14167
  });
14168
14168
  }
14169
- getSendLocalSDPOptionalParams(rtcPeerConnController) {
14169
+ getSendLocalSDPOptionalParams(rtcPeerConnController, vertoMethod) {
14170
14170
  let subscribe = void 0;
14171
- const initial = !rtcPeerConnController.firstSDPExchangeCompleted;
14172
- if (initial) {
14171
+ if (!rtcPeerConnController.firstSDPExchangeCompleted) {
14173
14172
  subscribe = [];
14174
14173
  if (rtcPeerConnController.isMainDevice) subscribe.push(...PreferencesContainer.instance.inviteSubscribeMainDevice);
14175
14174
  else if (rtcPeerConnController.isAdditionalDevice) subscribe.push(...PreferencesContainer.instance.inviteSubscribeAdditionalDevice);
14176
14175
  else if (rtcPeerConnController.isScreenShare) subscribe.push(...PreferencesContainer.instance.inviteSubscribeScreenshare);
14177
14176
  }
14177
+ const isInvite = vertoMethod === "verto.invite";
14178
14178
  return {
14179
14179
  callID: rtcPeerConnController.id,
14180
- node_id: initial ? "" : this._nodeId$.value ?? "",
14180
+ node_id: isInvite ? "" : this._nodeId$.value ?? "",
14181
14181
  subscribe
14182
14182
  };
14183
14183
  }