@koi-design/callkit 2.3.0-beta.5 → 2.3.0-beta.7

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.mjs CHANGED
@@ -697,7 +697,7 @@ var Call = class {
697
697
  // package.json
698
698
  var package_default = {
699
699
  name: "@koi-design/callkit",
700
- version: "2.3.0-beta.5",
700
+ version: "2.3.0-beta.7",
701
701
  description: "callkit",
702
702
  author: "koi",
703
703
  license: "ISC",
@@ -842,8 +842,6 @@ var Config = class {
842
842
  return true;
843
843
  };
844
844
  isLogin = () => this.validate();
845
- /** 判断当前坐席类型是否为 SIP */
846
- isPhoneTypeSIP = () => this.config.userInfo.phoneType === PhoneTypeEnum.SIP;
847
845
  check() {
848
846
  if (!this.isLogin()) {
849
847
  this.callKit.logger.warn("User not logged in", {
@@ -17020,7 +17018,7 @@ var Socket = class {
17020
17018
  return;
17021
17019
  }
17022
17020
  const { userInfo, version } = this.callKit.config.getConfig();
17023
- const { sessionId, extno, agentId, phoneType } = userInfo;
17021
+ const { sessionId, extno, agentId } = userInfo;
17024
17022
  if (!sessionId) {
17025
17023
  this.callKit.logger.error("sessionId is empty", {
17026
17024
  caller: "Socket.send",
@@ -17040,7 +17038,6 @@ var Socket = class {
17040
17038
  if (SocketSendEvent.CALL === event) {
17041
17039
  msg.phoneNum = extno;
17042
17040
  msg.agentId = agentId;
17043
- msg.phoneType = phoneType;
17044
17041
  if (message?.sourceType === CallSourceType.phoneNum) {
17045
17042
  delete msg.workOrderId;
17046
17043
  } else if (message?.sourceType === CallSourceType.workOrderId) {
@@ -17360,7 +17357,8 @@ var CallKit = class {
17360
17357
  caller: "CallKit.register",
17361
17358
  content: {}
17362
17359
  });
17363
- if (!this.config.isPhoneTypeSIP()) {
17360
+ const { userInfo } = this.config.getConfig();
17361
+ if (userInfo.phoneType === PhoneTypeEnum.SIP) {
17364
17362
  this.connect.register();
17365
17363
  }
17366
17364
  }
@@ -17472,12 +17470,13 @@ var CallKit = class {
17472
17470
  force
17473
17471
  }
17474
17472
  });
17475
- if (this.config.isPhoneTypeSIP()) {
17473
+ const { userInfo } = this.config.getConfig();
17474
+ if (userInfo.phoneType === PhoneTypeEnum.SIP) {
17476
17475
  if (this.connect.isCalling()) {
17477
17476
  await this.hangup();
17478
17477
  }
17478
+ await this.connect.reset({ force });
17479
17479
  }
17480
- await this.connect.reset({ force });
17481
17480
  if (this.config.isLogin()) {
17482
17481
  await this.logout({ isReset: false });
17483
17482
  } else {