@koi-design/callkit 1.0.24-beta.21 → 1.0.24-beta.23

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.
@@ -18487,7 +18487,7 @@ var WebCall = (() => {
18487
18487
  that.reconnect();
18488
18488
  } else {
18489
18489
  const data = {
18490
- kitEvent: ConnectEvent.SIP_CONNECT_ERROR,
18490
+ event: ConnectEvent.SIP_CONNECT_ERROR,
18491
18491
  err: error
18492
18492
  };
18493
18493
  that.callKit.logger.debug("SIP WebSocket closed with error", data);
@@ -18506,7 +18506,7 @@ var WebCall = (() => {
18506
18506
  const diff = now - that.lastOptionsUpdateTime;
18507
18507
  if (diff > 6e4) {
18508
18508
  const data = {
18509
- kitEvent: ConnectEvent.OPTIONS_HEARTBEAT_EXPIRED,
18509
+ event: ConnectEvent.OPTIONS_HEARTBEAT_EXPIRED,
18510
18510
  lastOptionsUpdateTime: that.lastOptionsUpdateTime,
18511
18511
  now
18512
18512
  };
@@ -18980,16 +18980,16 @@ var WebCall = (() => {
18980
18980
  this.isConnected = true;
18981
18981
  this.lastPingTime = Date.now();
18982
18982
  this.checkPing();
18983
- if (this.reconnectTimer) {
18984
- clearTimeout(this.reconnectTimer);
18985
- this.reconnectTimer = void 0;
18986
- }
18987
18983
  if (this.isReconnecting) {
18988
18984
  this.callKit.logger.debug(ConnectEvent.INCALL_RECONNECT_SUCCESS);
18989
18985
  this.callKit.trigger(KitEvent.CONNECT_EVENT, {
18990
18986
  event: ConnectEvent.INCALL_RECONNECT_SUCCESS
18991
18987
  });
18992
18988
  this.isReconnecting = false;
18989
+ if (this.reconnectTimer) {
18990
+ clearTimeout(this.reconnectTimer);
18991
+ this.reconnectTimer = void 0;
18992
+ }
18993
18993
  }
18994
18994
  this.reconnectAttempts = 0;
18995
18995
  }
@@ -19017,6 +19017,9 @@ var WebCall = (() => {
19017
19017
  errCode: ErrorCode.SOCKET_CONNECT_ERROR,
19018
19018
  data: ev
19019
19019
  });
19020
+ if (this.isReconnecting) {
19021
+ this.attemptReconnect();
19022
+ }
19020
19023
  }
19021
19024
  onMessage(ev) {
19022
19025
  const data = JSON.parse(ev.data);
@@ -19217,7 +19220,12 @@ var WebCall = (() => {
19217
19220
  }
19218
19221
  }
19219
19222
  attemptReconnect() {
19220
- if (this.isReconnecting || this.reconnectAttempts >= this.socketConfig.maxAttempts) {
19223
+ if (this.isReconnecting && this.reconnectAttempts >= this.socketConfig.maxAttempts) {
19224
+ this.callKit.trigger(KitEvent.CONNECT_EVENT, {
19225
+ event: ConnectEvent.INCALL_RECONNECT_ERROR
19226
+ });
19227
+ this.isReconnecting = false;
19228
+ this.reset();
19221
19229
  return;
19222
19230
  }
19223
19231
  this.isReconnecting = true;