WXL (wul)
2025-08-27 f4609c62152cab3bd9b7f8efd3f967f82650ee40
src/components/CallButton/index.vue
@@ -37,7 +37,7 @@
    },
  },
  data() {
    const randomNum = Math.floor(Math.random() * 11) + 1000; // 内部定义
    const randomNum = Math.floor(Math.random() * 20) + 1000; // 内部定义
    return {
      isCalling: false,
      callStatus: "idle", // idle, calling, connected, ended
@@ -48,6 +48,7 @@
        sipUri: `${randomNum}` + "@192.168.10.124",
        password: "Smartor@2023",
        displayName: "Web 小龙",
        // realm: "9.208.5.18:8090",
      },
    };
  },
@@ -69,6 +70,14 @@
    },
  },
  mounted() {
    // 测试
    const ws = new WebSocket("wss://9.208.5.18:7443");
    ws.onopen = () => console.log("WebSocket 连接成功");
    ws.onerror = (e) => console.error("WebSocket 错误:", e);
    // 初始化SIP连接
    sipService.init(this.sipConfig);
    sipService.onStatusChange = (status) => {
      this.sipStatus = status.text;