WXL (wul)
7 天以前 aa17f161f4337a82bf9dc9b70dd40bd33d3c0fe4
src/utils/sipService.js
@@ -30,10 +30,11 @@
      this.ua.start();
      // 事件监听
     // 事件监听
      this.ua.on("registered", () => {
        this.isRegistered = true;
        this.registrationTime = Date.now(); // 记录注册成功时间
        console.log(this.registrationTime, "注册时间");
        this.updateStatus("registered", "已注册");
      });
@@ -44,6 +45,8 @@
      this.ua.on("unregistered", () => {
        this.isRegistered = false;
        let registrationTime = Date.now(); // 记录注销成功时间
        console.log(registrationTime, "注销时间");
        this.updateStatus("disconnected", "已注销");
      });
      this.ua.on("disconnected", () =>
@@ -74,7 +77,7 @@
      const remaining = minDelay - timeSinceRegistration;
      return {
        canCall: false,
        reason: `注册成功,请等待 ${Math.ceil(remaining / 1000)} 秒后再呼叫`
        reason: `注册成功,请等待 ${Math.ceil(remaining / 1000)} 秒后再呼叫`,
      };
    }
@@ -199,7 +202,7 @@
        errorMessage = "会话参数不满足服务器要求";
        break;
      default:
        errorMessage = `呼叫失败: ${e.cause || e.message}`;
        errorMessage = `呼叫失败3: ${e.cause || e.message}`;
    }
    this.updateCallStatus("failed55", errorMessage);