心跳过于频繁 添加判断
This commit is contained in:
parent
5222f89bee
commit
4bfe6fc17d
56
app.sh
Normal file
56
app.sh
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
cd $(dirname $0)
|
||||||
|
exe="java -jar wvp-pro-2.6.9.jar"
|
||||||
|
arg=""
|
||||||
|
|
||||||
|
status(){
|
||||||
|
count=$(ps aux|grep "$exe"|grep -v grep|wc -l)
|
||||||
|
if [ $count -eq 0 ] ; then
|
||||||
|
echo "$exe is stopped"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
echo "$exe is running"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
start(){
|
||||||
|
count=$(ps aux|grep "$exe"|grep -v grep|wc -l)
|
||||||
|
if [ $count -eq 0 ] ; then
|
||||||
|
echo "staring $exe"
|
||||||
|
nohup $exe $arg > nohup.out 2>&1 &
|
||||||
|
sleep 1
|
||||||
|
status
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
status
|
||||||
|
}
|
||||||
|
|
||||||
|
stop(){
|
||||||
|
echo "kill process"
|
||||||
|
nohup pkill -f "$exe" >/dev/null 2>&1 &
|
||||||
|
sleep 1
|
||||||
|
status
|
||||||
|
}
|
||||||
|
|
||||||
|
restart(){
|
||||||
|
stop
|
||||||
|
sleep 5
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
start)
|
||||||
|
start
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
stop
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
restart
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
status;;
|
||||||
|
*)
|
||||||
|
echo "use $0 start|stop|restart|status"
|
||||||
|
esac
|
||||||
|
|
@ -68,7 +68,8 @@ public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent imp
|
|||||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
} catch (SipException | InvalidArgumentException | ParseException e) {
|
||||||
logger.error("[命令发送失败] 心跳回复: {}", e.getMessage());
|
logger.error("[命令发送失败] 心跳回复: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
if (DateUtil.getDifferenceForNow(device.getKeepaliveTime()) <= 3000L){
|
|
||||||
|
if (device.getKeepaliveTime() != null && DateUtil.getDifferenceForNow(device.getKeepaliveTime()) <= 3000L){
|
||||||
logger.info("[收到心跳] 心跳发送过于频繁,已忽略 device: {}, callId: {}", device.getDeviceId(), request.getCallIdHeader().getCallId());
|
logger.info("[收到心跳] 心跳发送过于频繁,已忽略 device: {}, callId: {}", device.getDeviceId(), request.getCallIdHeader().getCallId());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
119
src/test/resources/application-dev241.yml
Normal file
119
src/test/resources/application-dev241.yml
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
spring:
|
||||||
|
# 设置接口超时时间
|
||||||
|
mvc:
|
||||||
|
async:
|
||||||
|
request-timeout: 20000
|
||||||
|
thymeleaf:
|
||||||
|
cache: false
|
||||||
|
# [可选]上传文件大小限制
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 10MB
|
||||||
|
max-request-size: 100MB
|
||||||
|
# REDIS数据库配置
|
||||||
|
redis:
|
||||||
|
# [必须修改] Redis服务器IP, REDIS安装在本机的,使用127.0.0.1
|
||||||
|
host: 192.168.2.4
|
||||||
|
# [必须修改] 端口号
|
||||||
|
port: 6379
|
||||||
|
# [可选] 数据库 DB
|
||||||
|
database: 7
|
||||||
|
# [可选] 访问密码,若你的redis服务器没有设置密码,就不需要用密码去连接
|
||||||
|
password:
|
||||||
|
# [可选] 超时时间
|
||||||
|
timeout: 10000
|
||||||
|
# mysql数据源
|
||||||
|
datasource:
|
||||||
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://192.168.2.3:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true
|
||||||
|
username: root
|
||||||
|
password: 123456a
|
||||||
|
hikari:
|
||||||
|
connection-timeout: 20000 # 是客户端等待连接池连接的最大毫秒数
|
||||||
|
initialSize: 10 # 连接池初始化连接数
|
||||||
|
maximum-pool-size: 200 # 连接池最大连接数
|
||||||
|
minimum-idle: 5 # 连接池最小空闲连接数
|
||||||
|
idle-timeout: 300000 # 允许连接在连接池中空闲的最长时间(以毫秒为单位)
|
||||||
|
max-lifetime: 1200000 # 是池中连接关闭后的最长生命周期(以毫秒为单位)
|
||||||
|
#[可选] WVP监听的HTTP端口, 网页和接口调用都是这个端口
|
||||||
|
server:
|
||||||
|
port: 18978
|
||||||
|
# [可选] HTTPS配置, 默认不开启
|
||||||
|
ssl:
|
||||||
|
# [可选] 是否开启HTTPS访问
|
||||||
|
enabled: false
|
||||||
|
# [可选] 证书文件路径,放置在resource/目录下即可,修改xxx为文件名
|
||||||
|
key-store: classpath:test.monitor.89iot.cn.jks
|
||||||
|
# [可选] 证书密码
|
||||||
|
key-store-password: gpf64qmw
|
||||||
|
# [可选] 证书类型, 默认为jks,根据实际修改
|
||||||
|
key-store-type: JKS
|
||||||
|
|
||||||
|
# 作为28181服务器的配置
|
||||||
|
sip:
|
||||||
|
# [必须修改] 本机的IP,对应你的网卡,监听什么ip就是使用什么网卡,
|
||||||
|
# 如果要监听多张网卡,可以使用逗号分隔多个IP, 例如: 192.168.1.4,10.0.0.4
|
||||||
|
# 如果不明白,就使用0.0.0.0,大部分情况都是可以的
|
||||||
|
# 请不要使用127.0.0.1,任何包括localhost在内的域名都是不可以的。
|
||||||
|
ip: 192.168.1.241
|
||||||
|
# [可选] 28181服务监听的端口
|
||||||
|
port: 5060
|
||||||
|
# 根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007)
|
||||||
|
# 后两位为行业编码,定义参照附录D.3
|
||||||
|
# 3701020049标识山东济南历下区 信息行业接入
|
||||||
|
# [可选]
|
||||||
|
domain: 4405010000
|
||||||
|
# [可选]
|
||||||
|
id: 44050100002000000001
|
||||||
|
# [可选] 默认设备认证密码,后续扩展使用设备单独密码, 移除密码将不进行校验
|
||||||
|
password: 123456
|
||||||
|
# 是否存储alarm信息
|
||||||
|
alarm: true
|
||||||
|
|
||||||
|
#zlm 默认服务器配置
|
||||||
|
media:
|
||||||
|
# id: your_server_id
|
||||||
|
id: amrWMKmbKqoBjRQ9
|
||||||
|
# [必须修改] zlm服务器的内网IP
|
||||||
|
ip: 192.168.3.14
|
||||||
|
# [必须修改] zlm服务器的http.port
|
||||||
|
http-port: 5081
|
||||||
|
# [可选] 返回流地址时的ip,置空使用 media.ip
|
||||||
|
# stream-ip: 192.168.10.241
|
||||||
|
# [可选] wvp在国标信令中使用的ip,此ip为摄像机可以访问到的ip, 置空使用 media.ip
|
||||||
|
# sdp-ip: 192.168.10.241
|
||||||
|
# [可选] zlm服务器的hook所使用的IP, 默认使用sip.ip
|
||||||
|
hook-ip:
|
||||||
|
# [可选] zlm服务器的http.sslport, 置空使用zlm配置文件配置
|
||||||
|
http-ssl-port: 5444
|
||||||
|
# [可选] zlm服务器的hook.admin_params=secret
|
||||||
|
# secret: 035c73f7-bb6b-4889-a715-d9eb2d1925cc
|
||||||
|
secret: 4155cca6-2f9f-11ee-85e6-8de4ce2e7333
|
||||||
|
# 启用多端口模式, 多端口模式使用端口区分每路流,兼容性更好。 单端口使用流的ssrc区分, 点播超时建议使用多端口测试
|
||||||
|
rtp:
|
||||||
|
# [可选] 是否启用多端口模式, 开启后会在portRange范围内选择端口用于媒体流传输
|
||||||
|
enable: true
|
||||||
|
# [可选] 在此范围内选择端口用于媒体流传输, 必须提前在zlm上配置该属性,不然自动配置此属性可能不成功
|
||||||
|
#port-range: 51000,51300 # 端口范围
|
||||||
|
port-range: 62200,62250
|
||||||
|
# [可选] 国标级联在此范围内选择端口发送媒体流,
|
||||||
|
#send-port-range: 51000,51300 # 端口范围
|
||||||
|
send-port-range: 62200,62250
|
||||||
|
# 录像辅助服务, 部署此服务可以实现zlm录像的管理与下载, 0 表示不使用
|
||||||
|
record-assist-port: 18979
|
||||||
|
# [根据业务需求配置]
|
||||||
|
user-settings:
|
||||||
|
# 点播/录像回放 等待超时时间,单位:毫秒
|
||||||
|
play-timeout: 360000
|
||||||
|
# [可选] 自动点播, 使用固定流地址进行播放时,如果未点播则自动进行点播, 需要rtp.enable=true
|
||||||
|
auto-apply-play: true
|
||||||
|
# 设备/通道状态变化时发送消息
|
||||||
|
device-status-notify: true
|
||||||
|
# 跨域配置,配置你访问前端页面的地址即可, 可以配置多个
|
||||||
|
allowed-origins:
|
||||||
|
- http://localhost:8080
|
||||||
|
- http://127.0.0.1:8080
|
||||||
|
# [可选] 日志配置, 一般不需要改
|
||||||
|
logging:
|
||||||
|
config: logback-spring-local.xml
|
Loading…
Reference in New Issue
Block a user