@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.d.ts CHANGED
@@ -4907,8 +4907,6 @@ declare class Config {
4907
4907
  reset: (form: string) => Promise<void>;
4908
4908
  validate: () => boolean;
4909
4909
  isLogin: () => boolean;
4910
- /** 判断当前坐席类型是否为 SIP */
4911
- isPhoneTypeSIP: () => boolean;
4912
4910
  check(): boolean;
4913
4911
  getTrackLogsConfig(): {
4914
4912
  enabled: boolean;
@@ -3889,7 +3889,7 @@ var WebCall = (() => {
3889
3889
  // package.json
3890
3890
  var package_default = {
3891
3891
  name: "@koi-design/callkit",
3892
- version: "2.3.0-beta.5",
3892
+ version: "2.3.0-beta.7",
3893
3893
  description: "callkit",
3894
3894
  author: "koi",
3895
3895
  license: "ISC",
@@ -4034,8 +4034,6 @@ var WebCall = (() => {
4034
4034
  return true;
4035
4035
  };
4036
4036
  isLogin = () => this.validate();
4037
- /** 判断当前坐席类型是否为 SIP */
4038
- isPhoneTypeSIP = () => this.config.userInfo.phoneType === PhoneTypeEnum.SIP;
4039
4037
  check() {
4040
4038
  if (!this.isLogin()) {
4041
4039
  this.callKit.logger.warn("User not logged in", {
@@ -20212,7 +20210,7 @@ ${log}` : log;
20212
20210
  return;
20213
20211
  }
20214
20212
  const { userInfo, version } = this.callKit.config.getConfig();
20215
- const { sessionId, extno, agentId, phoneType } = userInfo;
20213
+ const { sessionId, extno, agentId } = userInfo;
20216
20214
  if (!sessionId) {
20217
20215
  this.callKit.logger.error("sessionId is empty", {
20218
20216
  caller: "Socket.send",
@@ -20232,7 +20230,6 @@ ${log}` : log;
20232
20230
  if (SocketSendEvent.CALL === event) {
20233
20231
  msg.phoneNum = extno;
20234
20232
  msg.agentId = agentId;
20235
- msg.phoneType = phoneType;
20236
20233
  if (message?.sourceType === CallSourceType.phoneNum) {
20237
20234
  delete msg.workOrderId;
20238
20235
  } else if (message?.sourceType === CallSourceType.workOrderId) {
@@ -20552,7 +20549,8 @@ ${log}` : log;
20552
20549
  caller: "CallKit.register",
20553
20550
  content: {}
20554
20551
  });
20555
- if (!this.config.isPhoneTypeSIP()) {
20552
+ const { userInfo } = this.config.getConfig();
20553
+ if (userInfo.phoneType === PhoneTypeEnum.SIP) {
20556
20554
  this.connect.register();
20557
20555
  }
20558
20556
  }
@@ -20664,12 +20662,13 @@ ${log}` : log;
20664
20662
  force
20665
20663
  }
20666
20664
  });
20667
- if (this.config.isPhoneTypeSIP()) {
20665
+ const { userInfo } = this.config.getConfig();
20666
+ if (userInfo.phoneType === PhoneTypeEnum.SIP) {
20668
20667
  if (this.connect.isCalling()) {
20669
20668
  await this.hangup();
20670
20669
  }
20670
+ await this.connect.reset({ force });
20671
20671
  }
20672
- await this.connect.reset({ force });
20673
20672
  if (this.config.isLogin()) {
20674
20673
  await this.logout({ isReset: false });
20675
20674
  } else {