@koi-design/callkit 2.3.0-beta.2 → 2.3.0-beta.4

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.2",
700
+ version: "2.3.0-beta.4",
701
701
  description: "callkit",
702
702
  author: "koi",
703
703
  license: "ISC",
@@ -842,6 +842,8 @@ var Config = class {
842
842
  return true;
843
843
  };
844
844
  isLogin = () => this.validate();
845
+ /** 判断当前坐席类型是否为 SIP */
846
+ isPhoneTypeSIP = () => this.config.userInfo.phoneType === PhoneTypeEnum.SIP;
845
847
  check() {
846
848
  if (!this.isLogin()) {
847
849
  this.callKit.logger.warn("User not logged in", {
@@ -17358,7 +17360,9 @@ var CallKit = class {
17358
17360
  caller: "CallKit.register",
17359
17361
  content: {}
17360
17362
  });
17361
- this.connect.register();
17363
+ if (!this.config.isPhoneTypeSIP()) {
17364
+ this.connect.register();
17365
+ }
17362
17366
  }
17363
17367
  async unregister() {
17364
17368
  if (!this.config.check())
@@ -17446,13 +17450,12 @@ var CallKit = class {
17446
17450
  agentId
17447
17451
  }
17448
17452
  });
17449
- const res = await this.api.updateUserStatus({
17453
+ await this.api.updateUserStatus({
17450
17454
  agentId,
17451
17455
  userStatus: status,
17452
17456
  timestamp: Date.now(),
17453
17457
  ...extra
17454
17458
  });
17455
- return res;
17456
17459
  }
17457
17460
  /**
17458
17461
  * reset callkit
@@ -17469,10 +17472,12 @@ var CallKit = class {
17469
17472
  force
17470
17473
  }
17471
17474
  });
17472
- if (this.connect.isCalling()) {
17473
- await this.hangup();
17475
+ if (this.config.isPhoneTypeSIP()) {
17476
+ if (this.connect.isCalling()) {
17477
+ await this.hangup();
17478
+ }
17479
+ await this.connect.reset({ force });
17474
17480
  }
17475
- await this.connect.reset({ force });
17476
17481
  if (this.config.isLogin()) {
17477
17482
  await this.logout({ isReset: false });
17478
17483
  } else {