From ffa22cc18c75c0a73a3fd987e2b62fbf55316db2 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期四, 25 六月 2026 15:22:46 +0800
Subject: [PATCH] 测试完成

---
 src/utils/sipService.js |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/src/utils/sipService.js b/src/utils/sipService.js
index 0f62840..7d952c6 100644
--- a/src/utils/sipService.js
+++ b/src/utils/sipService.js
@@ -1,6 +1,7 @@
 import JsSIP from "jssip";
 import { Notification, MessageBox, Message, Loading } from "element-ui";
 // 鍖婚櫌鏈烘瀯涓嶴IP鏈嶅姟鍣ㄦ槧灏勯厤缃�
+// 鍏徃鏈嶅姟鍣�192.168.100.6
 const HOSPITAL_CONFIG = {
   涓芥按甯備腑鍖婚櫌: {
     wsUrl: "wss://192.168.10.124:7443",
@@ -10,11 +11,11 @@
     wsUrl: "wss://10.10.0.220:7443",
     domain: "10.10.0.220",
   },
-   鏉窞甯傜涓�浜烘皯鍖婚櫌婀栨花闄㈠尯: {
+  绗竴浜烘皯鍖婚櫌婀栨花闄㈠尯: {
     wsUrl: "wss://192.169.129.198:7443",
     domain: "192.169.129.198",
   },
-  鏉窞甯傜涓�浜烘皯鍖婚櫌鍚村北闄㈠尯: {
+  绗竴浜烘皯鍖婚櫌鍚村北闄㈠尯: {
     wsUrl: "wss://192.169.129.198:7443",
     domain: "192.169.129.198",
   },
@@ -34,6 +35,7 @@
     this.isRegistered = false; // 鏂板娉ㄥ唽鐘舵�佹爣蹇�
     this.registrationTime = null; // 鏂板娉ㄥ唽鎴愬姛鏃堕棿鎴�
     this.currentConfig = null; // 瀛樺偍褰撳墠閰嶇疆
+    this.isManualEnd = false;
   }
   // 鑾峰彇鍖婚櫌閰嶇疆鏂规硶
   getHospitalConfig() {
@@ -135,7 +137,7 @@
   makeCall(targetNumber) {
     const { canCall, reason } = this.canMakeCall();
     if (!canCall) {
-      Message.error(reason);
+      Message.info(reason);
       return Promise.reject(new Error(reason));
     }
     return new Promise((resolve, reject) => {
@@ -161,6 +163,10 @@
           eventHandlers: {
             progress: () => this.updateCallStatus("calling", "鍛煎彨涓�..."),
             failed: (e) => {
+              if (this.isManualEnd) {
+                console.log("涓诲姩鎸傛柇锛屽拷鐣ュけ璐ヤ簨浠�");
+                return;
+              }
               this.handleCallFailure(e, reject);
             },
             ended: () => this.updateCallStatus("ended", "閫氳瘽缁撴潫"),
@@ -416,13 +422,16 @@
     });
   }
 
-  endCall() {
-    if (this.currentSession) {
-      this.currentSession.terminate();
-      this.updateCallStatus("ended", "閫氳瘽宸茬粨鏉�");
-      this.currentSession = null;
-    }
+endCall() {
+  if (this.currentSession) {
+    this.isManualEnd = true;
+    this.currentSession.terminate();
+    this.updateCallStatus('ended', '閫氳瘽宸茬粨鏉�');
+    this.currentSession = null;
+    // 寤惰繜閲嶇疆鏍囧織锛岄伩鍏嶅奖鍝嶅悗缁簨浠�
+    setTimeout(() => { this.isManualEnd = false; }, 100);
   }
+}
 
   updateStatus(type, text) {
     console.log(`SIP鐘舵�佹洿鏂�: ${type} - ${text}`);

--
Gitblit v1.9.3