From ebff666f223d920fb34cc79942fbbd59cc3038cb Mon Sep 17 00:00:00 2001
From: sinake <sinake1@qq.com>
Date: 星期一, 15 九月 2025 11:16:01 +0800
Subject: [PATCH] 拨号失败后二次拨号

---
 src/components/CallButton/index.vue |   36 +++++++++++++++++++++++++++---------
 1 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/src/components/CallButton/index.vue b/src/components/CallButton/index.vue
index b52d1f9..378376d 100644
--- a/src/components/CallButton/index.vue
+++ b/src/components/CallButton/index.vue
@@ -78,7 +78,7 @@
     },
   },
   mounted() {
-    console.log('褰撳墠鍒嗘満鍙�',this.sipConfig);
+    console.log("褰撳墠鍒嗘満鍙�", this.sipConfig);
 
     sipService.init(this.sipConfig);
     sipService.onStatusChange = (status) => {
@@ -106,19 +106,37 @@
         // 鍏堟鏌ユ槸鍚﹀彲浠ュ懠鍙�
         const { canCall, reason } = sipService.canMakeCall();
         if (!canCall) {
-          this.$message.warning(reason);
-          return;
+          const { canCall, reason } = sipService.canMakeCall();
+          //this.$message.warning(reason);
+          //return;
         }
         this.callStatus = "calling";
         this.isCalling = true;
-         console.log('寮�濮嬪懠鍙細',sipService);
+        console.log("寮�濮嬪懠鍙細", sipService);
 
-        await sipService.makeCall(this.phoneNumber);
+        await sipService.makeCall("0"+this.phoneNumber);
       } catch (error) {
-        console.error("鍛煎彨澶辫触:", error);
-        this.callStatus = "ended";
-        this.isCalling = false;
-        this.$message.error(`鍛煎彨澶辫触: ${error.message}`);
+        let registrationTime = Date.now(); // 璁板綍娉ㄩ攢鎴愬姛鏃堕棿
+        console.log(registrationTime, "鍛煎彨澶辫触鏃堕棿");
+        console.error("鍛煎彨澶辫触1:", error);
+        // this.callStatus = "ended";
+        // this.isCalling = false;
+        //this.$message.error(`鍛煎彨澶辫触: ${error.message}`);
+          try {
+          // 鍏堟鏌ユ槸鍚﹀彲浠ュ懠鍙�
+          const { canCall, reason } = sipService.canMakeCall();
+          if (!canCall) {
+            const { canCall, reason } = sipService.canMakeCall();
+          }
+          this.callStatus = "calling";
+          this.isCalling = true;
+          console.log("寮�濮嬪懠鍙細", sipService);
+
+          await sipService.makeCall("0"+this.phoneNumber);
+        } catch (error) {
+           this.callStatus = "ended";
+           this.isCalling = false;
+        }
       }
     },
 

--
Gitblit v1.9.3