From 66cc734e81fe0497d88e0951b6aee9c9c8342f2c Mon Sep 17 00:00:00 2001 From: WXL (wul) <wl_5969728@163.com> Date: 星期三, 17 九月 2025 11:43:07 +0800 Subject: [PATCH] 电话更新 --- src/components/CallButton/index.vue | 37 +++++++++++++++++++++++++++---------- 1 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/components/CallButton/index.vue b/src/components/CallButton/index.vue index 548ad87..78ea734 100644 --- a/src/components/CallButton/index.vue +++ b/src/components/CallButton/index.vue @@ -44,10 +44,11 @@ sipStatus: "鏈繛鎺�", sipStatusClass: "status-disconnected", sipConfig: { - wsUrl: "wss://192.169.129.198:7443", - sipUri: `${randomNum}` + "@192.169.129.198", - password: "heskj@1234", + wsUrl: "wss://1192.170.66.107:7443", + sipUri: `${randomNum}` + "@1192.170.66.107", + password: "Smartor@2023", displayName: "Web 灏忛緳", + // realm: "9.208.5.18:8090", }, }; }, @@ -78,7 +79,7 @@ }, }, mounted() { - console.log("褰撳墠鍒嗘満鍙�", this.sipConfig); + console.log('褰撳墠鍒嗘満鍙�',this.sipConfig); sipService.init(this.sipConfig); sipService.onStatusChange = (status) => { @@ -106,21 +107,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); - await sipService.makeCall(this.phoneNumber); + await sipService.makeCall("0"+this.phoneNumber); } catch (error) { let registrationTime = Date.now(); // 璁板綍娉ㄩ攢鎴愬姛鏃堕棿 console.log(registrationTime, "鍛煎彨澶辫触鏃堕棿"); console.error("鍛煎彨澶辫触1:", error); - this.callStatus = "ended"; - this.isCalling = false; - this.$message.error(`鍛煎彨澶辫触: ${error.message}`); + // 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