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

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
@@ -13962,6 +13962,7 @@ var WebRTCVertoManager = class extends VertoManager {
13962
13962
  initSubscriptions() {
13963
13963
  this.subscribeTo(this.vertoMedia$, (event) => {
13964
13964
  logger$10.debug("[WebRTCManager] Received Verto media event (early media SDP):", event);
13965
+ this._signalingStatus$.next("ringing");
13965
13966
  const { sdp, callID } = event;
13966
13967
  this._rtcPeerConnectionsMap.get(callID)?.updateAnswerStatus({
13967
13968
  status: "received",
@@ -13970,8 +13971,8 @@ var WebRTCVertoManager = class extends VertoManager {
13970
13971
  });
13971
13972
  this.subscribeTo(this.vertoAnswer$, (event) => {
13972
13973
  logger$10.debug("[WebRTCManager] Received Verto answer event:", event);
13973
- const { sdp } = event;
13974
- this._rtcPeerConnectionsMap.get(event.callID)?.updateAnswerStatus({
13974
+ const { sdp, callID } = event;
13975
+ this._rtcPeerConnectionsMap.get(callID)?.updateAnswerStatus({
13975
13976
  status: "received",
13976
13977
  sdp
13977
13978
  });
@@ -14098,7 +14099,6 @@ var WebRTCVertoManager = class extends VertoManager {
14098
14099
  this._selfId$.next(memberId);
14099
14100
  rtcPeerConnController.setMemberId(memberId);
14100
14101
  if (callId) this.webRtcCallSession.addCallId(callId);
14101
- this._signalingStatus$.next("ringing");
14102
14102
  this.attachManager.attach(this.webRtcCallSession);
14103
14103
  logger$10.info("[WebRTCManager] Verto invite successful");
14104
14104
  logger$10.debug(`[WebRTCManager] nodeid: ${this._nodeId$.value}, selfId: ${this._selfId$.value}`);
@@ -14221,7 +14221,12 @@ var WebRTCVertoManager = class extends VertoManager {
14221
14221
  this.callSession?.destroy();
14222
14222
  } else if (!vertoByeOrAccepted) {
14223
14223
  logger$10.info("[WebRTCManager] Call was not accepted, sending verto.bye.");
14224
- await this.bye("USER_BUSY");
14224
+ try {
14225
+ await this.bye("USER_BUSY");
14226
+ } finally {
14227
+ this._signalingStatus$.next("disconnected");
14228
+ this.callSession?.destroy();
14229
+ }
14225
14230
  } else {
14226
14231
  logger$10.debug("[WebRTCManager] Call accepted, sending answer");
14227
14232
  try {
@@ -14829,7 +14834,6 @@ var WebRTCCall = class extends Destroyable {
14829
14834
  try {
14830
14835
  await this.vertoManager.bye();
14831
14836
  } finally {
14832
- this._status$.next("destroyed");
14833
14837
  this.destroy();
14834
14838
  }
14835
14839
  }
@@ -14868,6 +14872,7 @@ var WebRTCCall = class extends Destroyable {
14868
14872
  }
14869
14873
  /** Destroys the call, releasing all resources and subscriptions. */
14870
14874
  destroy() {
14875
+ this._status$.next("destroyed");
14871
14876
  this.vertoManager.destroy();
14872
14877
  this.callEventsManager.destroy();
14873
14878
  this.participantsMap.clear();
@@ -14955,7 +14960,6 @@ var EntityCollection = class extends Destroyable {
14955
14960
  this.onError = onError;
14956
14961
  this.loading$ = this.createBehaviorSubject(false);
14957
14962
  this.values$ = this.createReplaySubject(1);
14958
- this._hasMore$ = this.createBehaviorSubject(true);
14959
14963
  this.collectionData = /* @__PURE__ */ new Map();
14960
14964
  this.observablesRegistry = /* @__PURE__ */ new Map();
14961
14965
  this.upsertData = (data) => {
@@ -14968,6 +14972,7 @@ var EntityCollection = class extends Destroyable {
14968
14972
  this.observablesRegistry.get(data.id)?.next(updated);
14969
14973
  this.values$.next(Array.from(this.collectionData.values()));
14970
14974
  };
14975
+ this._hasMore$ = this.createBehaviorSubject(true);
14971
14976
  this._destroy$ = new import_cjs$8.Subject();
14972
14977
  this.updateSubscription = this.update$.subscribe(this.upsertData);
14973
14978
  this.loading$.next(false);