@signalwire/js 4.0.0-dev-20260303152249 → 4.0.0-dev-20260304162726

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.
@@ -12519,7 +12519,7 @@ var CallEventsManager = class extends Destroyable {
12519
12519
  });
12520
12520
  this.updateParticipants(sessionState.members);
12521
12521
  this._self$.value?.capabilities.updateFromRaw(capabilities);
12522
- this.updateLayouts();
12522
+ if (this._self$.value?.capabilities.setLayout) this.updateLayouts();
12523
12523
  });
12524
12524
  this.subscribeTo(this.memberUpdates$, (member) => {
12525
12525
  logger$15.debug("[CallEventsManager] Handling member update event for member ID:", member);
@@ -13851,7 +13851,10 @@ function isVertoAttachMessage(value) {
13851
13851
  return value.method === "verto.attach";
13852
13852
  }
13853
13853
  function isVertoAnswerInnerParams(value) {
13854
- return isObject(value) && hasProperty(value, "jsonrpc") && value.jsonrpc === "2.0" && hasProperty(value, "method") && value.method === "verto.answer" && isObject(value.params) && hasProperty(value.params, "callID") && hasProperty(value.params, "sdp");
13854
+ return isObject(value) && hasProperty(value, "jsonrpc") && value.jsonrpc === "2.0" && hasProperty(value, "method") && value.method === "verto.answer" && isObject(value.params) && hasProperty(value.params, "callID");
13855
+ }
13856
+ function isVertoMediaInnerParams(value) {
13857
+ return isObject(value) && hasProperty(value, "jsonrpc") && value.jsonrpc === "2.0" && hasProperty(value, "method") && value.method === "verto.media" && isObject(value.params) && hasProperty(value.params, "callID") && hasProperty(value.params, "sdp");
13855
13858
  }
13856
13859
  function isVertoMediaParamsInnerParams(value) {
13857
13860
  return isObject(value) && hasProperty(value, "jsonrpc") && value.jsonrpc === "2.0" && hasProperty(value, "method") && value.method === "verto.mediaParams" && isObject(value.params) && hasProperty(value.params, "mediaParams");
@@ -13961,6 +13964,14 @@ var WebRTCVertoManager = class extends VertoManager {
13961
13964
  ].includes(connectionState)))));
13962
13965
  }
13963
13966
  initSubscriptions() {
13967
+ this.subscribeTo(this.vertoMedia$, (event) => {
13968
+ logger$10.debug("[WebRTCManager] Received Verto media event (early media SDP):", event);
13969
+ const { sdp, callID } = event;
13970
+ this._rtcPeerConnectionsMap.get(callID)?.updateAnswerStatus({
13971
+ status: "received",
13972
+ sdp
13973
+ });
13974
+ });
13964
13975
  this.subscribeTo(this.vertoAnswer$, (event) => {
13965
13976
  logger$10.debug("[WebRTCManager] Received Verto answer event:", event);
13966
13977
  const { sdp } = event;
@@ -14005,6 +14016,9 @@ var WebRTCVertoManager = class extends VertoManager {
14005
14016
  get selfId() {
14006
14017
  return this._selfId$.value;
14007
14018
  }
14019
+ get vertoMedia$() {
14020
+ return this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoMediaInnerParams, "params"), (0, import_cjs$10.takeUntil)(this.destroyed$));
14021
+ }
14008
14022
  get vertoAnswer$() {
14009
14023
  return this.cachedObservable("vertoAnswer$", () => this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoAnswerInnerParams, "params"), (0, import_cjs$10.takeUntil)(this.destroyed$)));
14010
14024
  }
@@ -14183,6 +14197,7 @@ var WebRTCVertoManager = class extends VertoManager {
14183
14197
  }
14184
14198
  setupVertoByeHandler() {
14185
14199
  this.subscribeTo(this.vertoBye$, () => {
14200
+ this._signalingStatus$.next("disconnected");
14186
14201
  this.attachManager.detach(this.webRtcCallSession);
14187
14202
  this.callSession?.destroy();
14188
14203
  });
@@ -15594,12 +15609,14 @@ var ClientSessionManager = class extends Destroyable {
15594
15609
  try {
15595
15610
  const addressURI = getAddressSearchURI(options);
15596
15611
  let address;
15597
- if (!addressURI.startsWith("+")) {
15612
+ try {
15598
15613
  if (!this._directory) throw new DependencyError("Directory not initialized");
15599
15614
  const addressId = await this._directory.findAddressIdByURI(addressURI);
15600
15615
  if (!addressId) throw new DependencyError(`Address name: ${addressURI} not found`);
15601
15616
  address = this._directory.get(addressId);
15602
15617
  if (!address) throw new DependencyError(`Address ID: ${addressId} not found`);
15618
+ } catch (error) {
15619
+ logger$6.warn(`[Session] Directory lookup failed for ${addressURI}, proceeding with raw URI`);
15603
15620
  }
15604
15621
  const callSession = this.callFactory.createCall(address, { ...options });
15605
15622
  callSession.status$.pipe((0, import_cjs$5.filter)((status) => status === "destroyed"), (0, import_cjs$5.take)(1)).subscribe(() => {