优化使用tcp连接时的超时时间

This commit is contained in:
648540858 2022-08-11 16:37:55 +08:00
parent dcd772cb4d
commit 35d6d44138
2 changed files with 58 additions and 8 deletions

View File

@ -53,10 +53,15 @@ public class SipLayer{
* gov/nist/javax/sip/SipStackImpl.class * gov/nist/javax/sip/SipStackImpl.class
*/ */
properties.setProperty("gov.nist.javax.sip.LOG_MESSAGE_CONTENT", "true"); properties.setProperty("gov.nist.javax.sip.LOG_MESSAGE_CONTENT", "true");
properties.setProperty("gov.nist.javax.sip.DELIVER_UNSOLICITED_NOTIFY", "true"); // 接收所有notify请求即使没有订阅 // 接收所有notify请求即使没有订阅
properties.setProperty("gov.nist.javax.sip.DELIVER_TERMINATED_EVENT_FOR_NULL_DIALOG", "true"); // 为_NULL _对话框传递_终止的_事件 properties.setProperty("gov.nist.javax.sip.DELIVER_UNSOLICITED_NOTIFY", "true");
properties.setProperty("gov.nist.javax.sip.RELEASE_REFERENCES_STRATEGY", "Normal"); // 会话清理策略 // 为_NULL _对话框传递_终止的_事件
properties.setProperty("gov.nist.javax.sip.RELIABLE_CONNECTION_KEEP_ALIVE_TIMEOUT", "10"); properties.setProperty("gov.nist.javax.sip.DELIVER_TERMINATED_EVENT_FOR_NULL_DIALOG", "true");
// 会话清理策略
properties.setProperty("gov.nist.javax.sip.RELEASE_REFERENCES_STRATEGY", "Normal");
// 处理由该服务器处理的基于底层TCP的保持生存超时
properties.setProperty("gov.nist.javax.sip.RELIABLE_CONNECTION_KEEP_ALIVE_TIMEOUT", "60");
/** /**
* sip_server_log.log sip_debug_log.log public static final int TRACE_NONE = * sip_server_log.log sip_debug_log.log public static final int TRACE_NONE =
* 0; public static final int TRACE_MESSAGES = 16; public static final int * 0; public static final int TRACE_MESSAGES = 16; public static final int

View File

@ -2,9 +2,7 @@ package com.genersoft.iot.vmp.service.impl;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.List; import java.util.*;
import java.util.Objects;
import java.util.UUID;
import javax.sip.ResponseEvent; import javax.sip.ResponseEvent;
@ -659,6 +657,53 @@ public class PlayServiceImpl implements IPlayService {
@Override @Override
public void zlmServerOnline(String mediaServerId) { public void zlmServerOnline(String mediaServerId) {
// 似乎没啥需要做的 // TODO 查找之前的点播流如果不存在则给下级发送bye
// MediaServerItem mediaServerItem = mediaServerService.getOne(mediaServerId);
// zlmresTfulUtils.getMediaList(mediaServerItem, (mediaList ->{
// Integer code = mediaList.getInteger("code");
// if (code == 0) {
// JSONArray data = mediaList.getJSONArray("data");
// if (data == null || data.size() == 0) {
// zlmServerOffline(mediaServerId);
// }else {
// Map<String, JSONObject> mediaListMap = new HashMap<>();
// for (int i = 0; i < data.size(); i++) {
// JSONObject json = data.getJSONObject(i);
// String app = json.getString("app");
// if ("rtp".equals(app)) {
// String stream = json.getString("stream");
// if (mediaListMap.get(stream) != null) {
// continue;
// }
// mediaListMap.put(stream, json);
// // 处理正在观看的国标设备
// List<SsrcTransaction> ssrcTransactions = streamSession.getSsrcTransactionForAll(null, null, null, stream);
// if (ssrcTransactions.size() > 0) {
// for (SsrcTransaction ssrcTransaction : ssrcTransactions) {
// if(ssrcTransaction.getMediaServerId().equals(mediaServerId)) {
// cmder.streamByeCmd(ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId(),
// ssrcTransaction.getStream(), null);
// }
// }
// }
// }
// }
// if (mediaListMap.size() > 0 ) {
// // 处理正在向上推流的上级平台
// List<SendRtpItem> sendRtpItems = redisCatchStorage.querySendRTPServer(null);
// if (sendRtpItems.size() > 0) {
// for (SendRtpItem sendRtpItem : sendRtpItems) {
// if (sendRtpItem.getMediaServerId().equals(mediaServerId)) {
// if (mediaListMap.get(sendRtpItem.getStreamId()) == null) {
// ParentPlatform platform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId());
// sipCommanderFroPlatform.streamByeCmd(platform, sendRtpItem.getCallId());
// }
// }
// }
// }
// }
// }
// }
// }));
} }
} }