@koi-design/callkit 1.0.24-beta.22 → 1.0.24-beta.24

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
  };
@@ -18913,7 +18913,7 @@ var WebCall = (() => {
18913
18913
  var RECONNECT_CONFIG = {
18914
18914
  enabled: true,
18915
18915
  maxAttempts: 1,
18916
- delay: 1e3,
18916
+ delay: 500,
18917
18917
  backoffMultiplier: 1.5,
18918
18918
  pingInterval: 3e4,
18919
18919
  pingTimeout: 5e3
@@ -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;