From d90b45d7e9e38e34c044b772006004f2a4cb8b8e Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期五, 26 六月 2026 13:51:50 +0800
Subject: [PATCH] 测试完成
---
src/utils/sipService.js | 35 ++++++++++++++++++++++-------------
1 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/src/utils/sipService.js b/src/utils/sipService.js
index 7b917f0..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,13 +11,13 @@
wsUrl: "wss://10.10.0.220:7443",
domain: "10.10.0.220",
},
- 鏉窞甯傜涓�浜烘皯鍖婚櫌婀栨花闄㈠尯: {
- wsUrl: "wss://192.169.5.248:5060",
- domain: "192.169.5.248",
+ 绗竴浜烘皯鍖婚櫌婀栨花闄㈠尯: {
+ wsUrl: "wss://192.169.129.198:7443",
+ domain: "192.169.129.198",
},
- 鏉窞甯傜涓�浜烘皯鍖婚櫌鍚村北闄㈠尯: {
- wsUrl: "wss://192.169.5.248:5060",
- domain: "192.169.5.248",
+ 绗竴浜烘皯鍖婚櫌鍚村北闄㈠尯: {
+ wsUrl: "wss://192.169.129.198:7443",
+ domain: "192.169.129.198",
},
// 鍙互缁х画娣诲姞鍏朵粬鍖婚櫌閰嶇疆
default: {
@@ -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