From 2e5d94181a3c02c819f2fec4c5d88378bf2b5848 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Fri, 31 Mar 2023 08:56:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=BF=AE=E6=94=B9=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=B1=95=E7=A4=BA=E7=9A=84sip=20ip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/genersoft/iot/vmp/conf/SipConfig.java | 14 ++++++++++---- src/main/resources/all-application.yml | 4 ++-- web_src/src/components/dialog/configInfo.vue | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/SipConfig.java b/src/main/java/com/genersoft/iot/vmp/conf/SipConfig.java index d4c7b83a..600b9e8d 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/SipConfig.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/SipConfig.java @@ -4,7 +4,6 @@ package com.genersoft.iot.vmp.conf; import org.junit.jupiter.api.Order; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; -import org.springframework.util.ObjectUtils; @Component @ConfigurationProperties(prefix = "sip", ignoreInvalidFields = true) @@ -13,6 +12,8 @@ public class SipConfig { private String ip; + private String showIp; + private Integer port; private String domain; @@ -96,9 +97,14 @@ public class SipConfig { this.alarm = alarm; } - public void getLocalIp(String deviceLocalIp) { - if (ObjectUtils.isEmpty(deviceLocalIp)) { - + public String getShowIp() { + if (this.showIp == null) { + return this.ip; } + return showIp; + } + + public void setShowIp(String showIp) { + this.showIp = showIp; } } diff --git a/src/main/resources/all-application.yml b/src/main/resources/all-application.yml index bfa4bcf6..d0a82895 100644 --- a/src/main/resources/all-application.yml +++ b/src/main/resources/all-application.yml @@ -65,10 +65,10 @@ server: # 作为28181服务器的配置 sip: - # [必须修改] 本机的IP, 必须是网卡上的IP,用于sip下协议栈监听ip,如果监听所有设置为0.0.0.0 - monitor-ip: 0.0.0.0 # [必须修改] 本机的IP ip: 192.168.0.100 + # [可选] 没有任何业务需求,仅仅是在前端展示的时候用 + show-ip: 192.168.0.100 # [可选] 28181服务监听的端口 port: 5060 # 根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007) diff --git a/web_src/src/components/dialog/configInfo.vue b/web_src/src/components/dialog/configInfo.vue index 83d9f38a..4ac90cc1 100644 --- a/web_src/src/components/dialog/configInfo.vue +++ b/web_src/src/components/dialog/configInfo.vue @@ -13,7 +13,7 @@ {{configInfoData.sip.id}} {{configInfoData.sip.domain}} - {{configInfoData.sip.ip}} + {{configInfoData.sip.showIp}} {{configInfoData.sip.port}} {{configInfoData.sip.password}}