修复录像下载
parent
9b9a13ab36
commit
88878940af
|
@ -1,8 +1,5 @@
|
||||||
package com.genersoft.iot.vmp.gb28181.session;
|
package com.genersoft.iot.vmp.gb28181.session;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.common.VideoManagerConstants;
|
import com.genersoft.iot.vmp.common.VideoManagerConstants;
|
||||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.SipTransactionInfo;
|
import com.genersoft.iot.vmp.gb28181.bean.SipTransactionInfo;
|
||||||
|
@ -13,6 +10,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description:视频流session管理器,管理视频预览、预览回放的通信句柄
|
* @description:视频流session管理器,管理视频预览、预览回放的通信句柄
|
||||||
* @author: swwheihei
|
* @author: swwheihei
|
||||||
|
@ -53,8 +53,6 @@ public class VideoStreamSessionManager {
|
||||||
|
|
||||||
RedisUtil.set(VideoManagerConstants.MEDIA_TRANSACTION_USED_PREFIX + userSetting.getServerId()
|
RedisUtil.set(VideoManagerConstants.MEDIA_TRANSACTION_USED_PREFIX + userSetting.getServerId()
|
||||||
+ "_" + deviceId + "_" + channelId + "_" + callId + "_" + stream, ssrcTransaction);
|
+ "_" + deviceId + "_" + channelId + "_" + callId + "_" + stream, ssrcTransaction);
|
||||||
RedisUtil.set(VideoManagerConstants.MEDIA_TRANSACTION_USED_PREFIX + userSetting.getServerId()
|
|
||||||
+ "_" + deviceId + "_" + channelId + "_" + callId + "_" + stream, ssrcTransaction);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SsrcTransaction getSsrcTransaction(String deviceId, String channelId, String callId, String stream){
|
public SsrcTransaction getSsrcTransaction(String deviceId, String channelId, String callId, String stream){
|
||||||
|
|
|
@ -565,10 +565,11 @@ public class SIPCommander implements ISIPCommander {
|
||||||
if (inviteStreamCallback != null) {
|
if (inviteStreamCallback != null) {
|
||||||
inviteStreamCallback.call(new InviteStreamInfo(mediaServerItem, null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport()).getCallId(), "rtp", ssrcInfo.getStream()));
|
inviteStreamCallback.call(new InviteStreamInfo(mediaServerItem, null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport()).getCallId(), "rtp", ssrcInfo.getStream()));
|
||||||
}
|
}
|
||||||
|
|
||||||
sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent, okEvent -> {
|
sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent, okEvent -> {
|
||||||
ResponseEvent responseEvent = (ResponseEvent) okEvent.event;
|
ResponseEvent responseEvent = (ResponseEvent) okEvent.event;
|
||||||
SIPResponse response = (SIPResponse) responseEvent.getResponse();
|
SIPResponse response = (SIPResponse) responseEvent.getResponse();
|
||||||
streamSession.put(device.getDeviceId(), channelId,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport()).getCallId(), ssrcInfo.getStream(), ssrcInfo.getSsrc(), mediaServerItem.getId(), response, VideoStreamSessionManager.SessionType.download);
|
streamSession.put(device.getDeviceId(), channelId, response.getCallIdHeader().getCallId(), ssrcInfo.getStream(), ssrcInfo.getSsrc(), mediaServerItem.getId(), response, VideoStreamSessionManager.SessionType.download);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,7 @@ public class MessageRequestProcessor extends SIPRequestProcessorParent implement
|
||||||
@Override
|
@Override
|
||||||
public void process(RequestEvent evt) {
|
public void process(RequestEvent evt) {
|
||||||
SIPRequest sipRequest = (SIPRequest)evt.getRequest();
|
SIPRequest sipRequest = (SIPRequest)evt.getRequest();
|
||||||
|
logger.info("接收到消息:" + evt.getRequest());
|
||||||
logger.debug("接收到消息:" + evt.getRequest());
|
logger.debug("接收到消息:" + evt.getRequest());
|
||||||
String deviceId = SipUtils.getUserIdFromFromHeader(evt.getRequest());
|
String deviceId = SipUtils.getUserIdFromFromHeader(evt.getRequest());
|
||||||
CallIdHeader callIdHeader = sipRequest.getCallIdHeader();
|
CallIdHeader callIdHeader = sipRequest.getCallIdHeader();
|
||||||
|
@ -94,7 +95,7 @@ public class MessageRequestProcessor extends SIPRequestProcessorParent implement
|
||||||
if (device == null && parentPlatform == null) {
|
if (device == null && parentPlatform == null) {
|
||||||
// 不存在则回复404
|
// 不存在则回复404
|
||||||
responseAck(request, Response.NOT_FOUND, "device "+ deviceId +" not found");
|
responseAck(request, Response.NOT_FOUND, "device "+ deviceId +" not found");
|
||||||
logger.warn("[设备未找到 ]: {}", deviceId);
|
logger.warn("[设备未找到 ]deviceId: {}, callId: {}", deviceId, callIdHeader.getCallId());
|
||||||
if (sipSubscribe.getErrorSubscribe(callIdHeader.getCallId()) != null){
|
if (sipSubscribe.getErrorSubscribe(callIdHeader.getCallId()) != null){
|
||||||
DeviceNotFoundEvent deviceNotFoundEvent = new DeviceNotFoundEvent(evt.getDialog());
|
DeviceNotFoundEvent deviceNotFoundEvent = new DeviceNotFoundEvent(evt.getDialog());
|
||||||
deviceNotFoundEvent.setCallId(callIdHeader.getCallId());
|
deviceNotFoundEvent.setCallId(callIdHeader.getCallId());
|
||||||
|
|
Loading…
Reference in New Issue