@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.js CHANGED
@@ -724,7 +724,7 @@ var Call = class {
724
724
  // package.json
725
725
  var package_default = {
726
726
  name: "@koi-design/callkit",
727
- version: "2.3.0-beta.5",
727
+ version: "2.3.0-beta.7",
728
728
  description: "callkit",
729
729
  author: "koi",
730
730
  license: "ISC",
@@ -869,8 +869,6 @@ var Config = class {
869
869
  return true;
870
870
  };
871
871
  isLogin = () => this.validate();
872
- /** 判断当前坐席类型是否为 SIP */
873
- isPhoneTypeSIP = () => this.config.userInfo.phoneType === PhoneTypeEnum.SIP;
874
872
  check() {
875
873
  if (!this.isLogin()) {
876
874
  this.callKit.logger.warn("User not logged in", {
@@ -17047,7 +17045,7 @@ var Socket = class {
17047
17045
  return;
17048
17046
  }
17049
17047
  const { userInfo, version } = this.callKit.config.getConfig();
17050
- const { sessionId, extno, agentId, phoneType } = userInfo;
17048
+ const { sessionId, extno, agentId } = userInfo;
17051
17049
  if (!sessionId) {
17052
17050
  this.callKit.logger.error("sessionId is empty", {
17053
17051
  caller: "Socket.send",
@@ -17067,7 +17065,6 @@ var Socket = class {
17067
17065
  if (SocketSendEvent.CALL === event) {
17068
17066
  msg.phoneNum = extno;
17069
17067
  msg.agentId = agentId;
17070
- msg.phoneType = phoneType;
17071
17068
  if (message?.sourceType === CallSourceType.phoneNum) {
17072
17069
  delete msg.workOrderId;
17073
17070
  } else if (message?.sourceType === CallSourceType.workOrderId) {
@@ -17387,7 +17384,8 @@ var CallKit = class {
17387
17384
  caller: "CallKit.register",
17388
17385
  content: {}
17389
17386
  });
17390
- if (!this.config.isPhoneTypeSIP()) {
17387
+ const { userInfo } = this.config.getConfig();
17388
+ if (userInfo.phoneType === PhoneTypeEnum.SIP) {
17391
17389
  this.connect.register();
17392
17390
  }
17393
17391
  }
@@ -17499,12 +17497,13 @@ var CallKit = class {
17499
17497
  force
17500
17498
  }
17501
17499
  });
17502
- if (this.config.isPhoneTypeSIP()) {
17500
+ const { userInfo } = this.config.getConfig();
17501
+ if (userInfo.phoneType === PhoneTypeEnum.SIP) {
17503
17502
  if (this.connect.isCalling()) {
17504
17503
  await this.hangup();
17505
17504
  }
17505
+ await this.connect.reset({ force });
17506
17506
  }
17507
- await this.connect.reset({ force });
17508
17507
  if (this.config.isLogin()) {
17509
17508
  await this.logout({ isReset: false });
17510
17509
  } else {