sinake
2025-09-23 e25dd495456b97b9ec9899fe27be6a2eb2d87a20
src/components/CallButton/index.vue
@@ -47,9 +47,9 @@
      sipStatus: "未连接",
      sipStatusClass: "status-disconnected",
      sipConfig: {
        wsUrl: "wss://192.168.100.6:7443",
        wsUrl: "wss://192.169.129.198:7443",
        sipUri: "",
        password: "Smartor@2023",
        password: "heskj@1234",
        displayName: "Web 小龙",
        // realm: "9.208.5.18:8090",
      },
@@ -127,13 +127,13 @@
        this.isCalling = true;
        console.log("开始呼叫:", sipService);
        await sipService.makeCall("0" + this.phoneNumber);
        await sipService.makeCall(this.phoneNumber);
      } catch (error) {
        let registrationTime = Date.now(); // 记录注销成功时间
        console.log(registrationTime, "呼叫失败时间");
        console.error("呼叫失败1:", error);
        // this.callStatus = "ended";
        // this.isCalling = false;
         this.callStatus = "ended";
         this.isCalling = false;
        //this.$message.error(`呼叫失败: ${error.message}`);
        try {
          // 先检查是否可以呼叫
@@ -145,7 +145,7 @@
          this.isCalling = true;
          console.log("开始呼叫:", sipService);
          await sipService.makeCall("0" + this.phoneNumber);
          await sipService.makeCall(this.phoneNumber);
        } catch (error) {
          this.callStatus = "ended";
          this.isCalling = false;
@@ -159,7 +159,7 @@
        this.randomNum = res.data[0].tel;
        this.randomID = res.data[0].id;
        // 正确设置 sipUri
        this.sipConfig.sipUri = `${this.randomNum}@192.168.100.6`;
        this.sipConfig.sipUri = `${this.randomNum}@192.169.129.198`;
        this.startCallsetState();
      } catch (error) {
        console.error("获取分机号失败:", error);