From aa17f161f4337a82bf9dc9b70dd40bd33d3c0fe4 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期四, 11 九月 2025 13:54:36 +0800
Subject: [PATCH] 测试完成

---
 src/components/CallButton/index.vue |   28 +++++++++++++++++++++++-----
 1 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/src/components/CallButton/index.vue b/src/components/CallButton/index.vue
index 40d3705..548ad87 100644
--- a/src/components/CallButton/index.vue
+++ b/src/components/CallButton/index.vue
@@ -44,9 +44,9 @@
       sipStatus: "鏈繛鎺�",
       sipStatusClass: "status-disconnected",
       sipConfig: {
-        wsUrl: "wss://1192.170.66.107:7443",
-        sipUri: `${randomNum}` + "@1192.170.66.107",
-        password: "Smartor@2023",
+        wsUrl: "wss://192.169.129.198:7443",
+        sipUri: `${randomNum}` + "@192.169.129.198",
+        password: "heskj@1234",
         displayName: "Web 灏忛緳",
       },
     };
@@ -61,6 +61,15 @@
       };
       return statusMap[this.callStatus];
     },
+    countdownText() {
+      if (this.sipStatus !== "宸叉敞鍐�") return "";
+
+      const { canCall, reason } = sipService.canMakeCall();
+      if (!canCall && reason.includes("绛夊緟")) {
+        return reason;
+      }
+      return "";
+    },
     callStatusClass() {
       return `status-${this.callStatus}`;
     },
@@ -69,7 +78,7 @@
     },
   },
   mounted() {
-    console.log('褰撳墠鍒嗘満鍙�',this.sipConfig);
+    console.log("褰撳墠鍒嗘満鍙�", this.sipConfig);
 
     sipService.init(this.sipConfig);
     sipService.onStatusChange = (status) => {
@@ -94,12 +103,21 @@
       }
 
       try {
+        // 鍏堟鏌ユ槸鍚﹀彲浠ュ懠鍙�
+        const { canCall, reason } = sipService.canMakeCall();
+        if (!canCall) {
+          this.$message.warning(reason);
+          return;
+        }
         this.callStatus = "calling";
         this.isCalling = true;
+        console.log("寮�濮嬪懠鍙細", sipService);
 
         await sipService.makeCall(this.phoneNumber);
       } catch (error) {
-        console.error("鍛煎彨澶辫触:", error);
+        let registrationTime = Date.now(); // 璁板綍娉ㄩ攢鎴愬姛鏃堕棿
+        console.log(registrationTime, "鍛煎彨澶辫触鏃堕棿");
+        console.error("鍛煎彨澶辫触1:", error);
         this.callStatus = "ended";
         this.isCalling = false;
         this.$message.error(`鍛煎彨澶辫触: ${error.message}`);

--
Gitblit v1.9.3