@koi-design/callkit 1.0.24-beta.14 → 1.0.24-beta.15

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/index.d.ts CHANGED
@@ -140,6 +140,7 @@ declare const KitEvent: {
140
140
  * User status change
141
141
  */
142
142
  USER_STATUS_CHANGE: string;
143
+ CONNECT_EVENT: string;
143
144
  };
144
145
  declare const SocketSendEvent: {
145
146
  /**
@@ -3378,7 +3378,8 @@ var WebCall = (() => {
3378
3378
  /**
3379
3379
  * User status change
3380
3380
  */
3381
- USER_STATUS_CHANGE: "userStatusChange"
3381
+ USER_STATUS_CHANGE: "userStatusChange",
3382
+ CONNECT_EVENT: "CONNECT_EVENT"
3382
3383
  };
3383
3384
  var ErrorCode = {
3384
3385
  /**
@@ -18478,7 +18479,8 @@ var WebCall = (() => {
18478
18479
  const now = (/* @__PURE__ */ new Date()).getTime();
18479
18480
  const diff = now - that.lastOptionsUpdateTime;
18480
18481
  if (diff > 6e4) {
18481
- that.callKit.trigger(ConnectEvent.OPTIONS_HEARTBEAT_EXPIRED, {
18482
+ that.callKit.trigger(KitEvent.CONNECT_EVENT, {
18483
+ event: ConnectEvent.OPTIONS_HEARTBEAT_EXPIRED,
18482
18484
  lastOptionsUpdateTime: that.lastOptionsUpdateTime,
18483
18485
  now
18484
18486
  });
@@ -18579,7 +18581,8 @@ var WebCall = (() => {
18579
18581
  if (this.isRegistered() && !(this.sipConnected || this.isRinging() || this.isCalling() || this.isHolding())) {
18580
18582
  this.reconnect();
18581
18583
  } else {
18582
- this.callKit.trigger(ConnectEvent.SIP_CONNECT_ERROR, {
18584
+ this.callKit.trigger(KitEvent.CONNECT_EVENT, {
18585
+ event: ConnectEvent.SIP_CONNECT_ERROR,
18583
18586
  err: error
18584
18587
  });
18585
18588
  this.callKit.callCenter.callEnd();
@@ -18643,7 +18646,9 @@ var WebCall = (() => {
18643
18646
  if (currentRetry < this.reconnectConfig.maxAttempts) {
18644
18647
  await scheduleReconnect();
18645
18648
  } else {
18646
- this.callKit.trigger(ConnectEvent.SIP_RECONNECT_ERROR, {});
18649
+ this.callKit.trigger(KitEvent.CONNECT_EVENT, {
18650
+ event: ConnectEvent.SIP_RECONNECT_ERROR
18651
+ });
18647
18652
  this.callKit.logger.error("No registerer to unregister.");
18648
18653
  }
18649
18654
  }
@@ -18909,7 +18914,8 @@ var WebCall = (() => {
18909
18914
  );
18910
18915
  this.attemptReconnect();
18911
18916
  } else if (this.reconnectAttempts >= this.socketConfig.maxAttempts) {
18912
- this.callKit.trigger(ConnectEvent.INCALL_RECONNECT_ERROR, {
18917
+ this.callKit.trigger(KitEvent.CONNECT_EVENT, {
18918
+ event: ConnectEvent.INCALL_RECONNECT_ERROR,
18913
18919
  err: ev
18914
18920
  });
18915
18921
  this.reset();
@@ -18941,7 +18947,8 @@ var WebCall = (() => {
18941
18947
  onClose(ev) {
18942
18948
  this.callKit.logger.debug("socket onClose", ev);
18943
18949
  if ((ev.code !== 1e3 || !ev.wasClean) && this.callKit.connect.isRegistered()) {
18944
- this.callKit.trigger(ConnectEvent.INCALL_CONNECT_ERROR, {
18950
+ this.callKit.trigger(KitEvent.CONNECT_EVENT, {
18951
+ event: ConnectEvent.INCALL_CONNECT_ERROR,
18945
18952
  err: ev
18946
18953
  });
18947
18954
  this.reconnect(ev);