临时提交
parent
cc302be2f2
commit
3fafe83e88
|
@ -51,7 +51,7 @@ public interface IPlayService {
|
||||||
|
|
||||||
void resumeRtp(String streamId) throws ServiceException, InvalidArgumentException, ParseException, SipException;
|
void resumeRtp(String streamId) throws ServiceException, InvalidArgumentException, ParseException, SipException;
|
||||||
|
|
||||||
void startPushStream(SendRtpInfo sendRtpItem, SIPResponse sipResponse, Platform platform, CallIdHeader callIdHeader);
|
void startPushStream(SendRtpInfo sendRtpItem, DeviceChannel channel, SIPResponse sipResponse, Platform platform, CallIdHeader callIdHeader);
|
||||||
|
|
||||||
void startSendRtpStreamFailHand(SendRtpInfo sendRtpItem, Platform platform, CallIdHeader callIdHeader);
|
void startSendRtpStreamFailHand(SendRtpInfo sendRtpItem, Platform platform, CallIdHeader callIdHeader);
|
||||||
|
|
||||||
|
|
|
@ -1414,7 +1414,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startPushStream(SendRtpInfo sendRtpItem, SIPResponse sipResponse, Platform platform, CallIdHeader callIdHeader) {
|
public void startPushStream(SendRtpInfo sendRtpItem, DeviceChannel channel, SIPResponse sipResponse, Platform platform, CallIdHeader callIdHeader) {
|
||||||
// 开始发流
|
// 开始发流
|
||||||
MediaServer mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId());
|
MediaServer mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId());
|
||||||
|
|
||||||
|
@ -1425,7 +1425,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
} else {
|
} else {
|
||||||
mediaServerService.startSendRtp(mediaInfo, sendRtpItem);
|
mediaServerService.startSendRtp(mediaInfo, sendRtpItem);
|
||||||
}
|
}
|
||||||
redisCatchStorage.sendPlatformStartPlayMsg(sendRtpItem, platform);
|
redisCatchStorage.sendPlatformStartPlayMsg(sendRtpItem, channel, platform);
|
||||||
}catch (ControllerException e) {
|
}catch (ControllerException e) {
|
||||||
log.error("RTP推流失败: {}", e.getMessage());
|
log.error("RTP推流失败: {}", e.getMessage());
|
||||||
startSendRtpStreamFailHand(sendRtpItem, platform, callIdHeader);
|
startSendRtpStreamFailHand(sendRtpItem, platform, callIdHeader);
|
||||||
|
|
|
@ -4,8 +4,10 @@ import com.genersoft.iot.vmp.conf.DynamicTask;
|
||||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||||
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.SendRtpInfo;
|
import com.genersoft.iot.vmp.gb28181.bean.SendRtpInfo;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IPlayService;
|
import com.genersoft.iot.vmp.gb28181.service.IPlayService;
|
||||||
|
@ -63,6 +65,9 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In
|
||||||
@Autowired
|
@Autowired
|
||||||
private IDeviceService deviceService;
|
private IDeviceService deviceService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceChannelService deviceChannelService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMediaServerService mediaServerService;
|
private IMediaServerService mediaServerService;
|
||||||
|
|
||||||
|
@ -103,11 +108,13 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In
|
||||||
);
|
);
|
||||||
Platform parentPlatform = platformService.queryPlatformByServerGBId(fromUserId);
|
Platform parentPlatform = platformService.queryPlatformByServerGBId(fromUserId);
|
||||||
|
|
||||||
|
|
||||||
if (parentPlatform != null) {
|
if (parentPlatform != null) {
|
||||||
|
DeviceChannel deviceChannel = deviceChannelService.getOneById(sendRtpItem.getChannelId());
|
||||||
if (!userSetting.getServerId().equals(sendRtpItem.getServerId())) {
|
if (!userSetting.getServerId().equals(sendRtpItem.getServerId())) {
|
||||||
WVPResult wvpResult = redisRpcService.startSendRtp(sendRtpItem.getRedisKey(), sendRtpItem);
|
WVPResult wvpResult = redisRpcService.startSendRtp(sendRtpItem.getRedisKey(), sendRtpItem);
|
||||||
if (wvpResult.getCode() == 0) {
|
if (wvpResult.getCode() == 0) {
|
||||||
redisCatchStorage.sendPlatformStartPlayMsg(sendRtpItem, parentPlatform);
|
redisCatchStorage.sendPlatformStartPlayMsg(sendRtpItem, deviceChannel, parentPlatform);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
@ -116,7 +123,7 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In
|
||||||
} else {
|
} else {
|
||||||
mediaServerService.startSendRtp(mediaInfo, sendRtpItem);
|
mediaServerService.startSendRtp(mediaInfo, sendRtpItem);
|
||||||
}
|
}
|
||||||
redisCatchStorage.sendPlatformStartPlayMsg(sendRtpItem, parentPlatform);
|
redisCatchStorage.sendPlatformStartPlayMsg(sendRtpItem, deviceChannel, parentPlatform);
|
||||||
}catch (ControllerException e) {
|
}catch (ControllerException e) {
|
||||||
log.error("RTP推流失败: {}", e.getMessage());
|
log.error("RTP推流失败: {}", e.getMessage());
|
||||||
playService.startSendRtpStreamFailHand(sendRtpItem, parentPlatform, callIdHeader);
|
playService.startSendRtpStreamFailHand(sendRtpItem, parentPlatform, callIdHeader);
|
||||||
|
|
|
@ -217,7 +217,10 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
MediaServer mediaServer = mediaServerService.getOne(sendRtpItem.getMediaServerId());
|
MediaServer mediaServer = mediaServerService.getOne(sendRtpItem.getMediaServerId());
|
||||||
try {
|
try {
|
||||||
mediaServerService.startSendRtpPassive(mediaServer, sendRtpItem, 5);
|
mediaServerService.startSendRtpPassive(mediaServer, sendRtpItem, 5);
|
||||||
redisCatchStorage.sendPlatformStartPlayMsg(sendRtpItem, platform);
|
DeviceChannel deviceChannel = deviceChannelService.getOneById(sendRtpItem.getChannelId());
|
||||||
|
if (deviceChannel != null) {
|
||||||
|
redisCatchStorage.sendPlatformStartPlayMsg(sendRtpItem, deviceChannel, platform);
|
||||||
|
}
|
||||||
}catch (ControllerException e) {
|
}catch (ControllerException e) {
|
||||||
log.warn("[上级Invite] tcp主动模式 发流失败", e);
|
log.warn("[上级Invite] tcp主动模式 发流失败", e);
|
||||||
sendBye(platform, inviteInfo.getCallId());
|
sendBye(platform, inviteInfo.getCallId());
|
||||||
|
@ -911,7 +914,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
|
|
||||||
Boolean streamReady = mediaServerService.isStreamReady(mediaServerItem, broadcastCatch.getApp(), broadcastCatch.getStream());
|
Boolean streamReady = mediaServerService.isStreamReady(mediaServerItem, broadcastCatch.getApp(), broadcastCatch.getStream());
|
||||||
if (streamReady) {
|
if (streamReady) {
|
||||||
sendOk(device, sendRtpItem, sdp, request, mediaServerItem, mediaTransmissionTCP, gb28181Sdp.getSsrc());
|
sendOk(device, deviceChannel, sendRtpItem, sdp, request, mediaServerItem, mediaTransmissionTCP, gb28181Sdp.getSsrc());
|
||||||
} else {
|
} else {
|
||||||
log.warn("[语音通话], 未发现待推送的流,app={},stream={}", broadcastCatch.getApp(), broadcastCatch.getStream());
|
log.warn("[语音通话], 未发现待推送的流,app={},stream={}", broadcastCatch.getApp(), broadcastCatch.getStream());
|
||||||
try {
|
try {
|
||||||
|
@ -937,7 +940,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SIPResponse sendOk(Device device, SendRtpInfo sendRtpItem, SessionDescription sdp, SIPRequest request, MediaServer mediaServerItem, boolean mediaTransmissionTCP, String ssrc) {
|
SIPResponse sendOk(Device device, DeviceChannel channel, SendRtpInfo sendRtpItem, SessionDescription sdp, SIPRequest request, MediaServer mediaServerItem, boolean mediaTransmissionTCP, String ssrc) {
|
||||||
SIPResponse sipResponse = null;
|
SIPResponse sipResponse = null;
|
||||||
try {
|
try {
|
||||||
sendRtpItem.setStatus(2);
|
sendRtpItem.setStatus(2);
|
||||||
|
@ -986,7 +989,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
// 开启发流,大华在收到200OK后就会开始建立连接
|
// 开启发流,大华在收到200OK后就会开始建立连接
|
||||||
if (!device.isBroadcastPushAfterAck()) {
|
if (!device.isBroadcastPushAfterAck()) {
|
||||||
log.info("[语音喊话] 回复200OK后发现 BroadcastPushAfterAck为False,现在开始推流");
|
log.info("[语音喊话] 回复200OK后发现 BroadcastPushAfterAck为False,现在开始推流");
|
||||||
playService.startPushStream(sendRtpItem, sipResponse, parentPlatform, request.getCallIdHeader());
|
playService.startPushStream(sendRtpItem, channel, sipResponse, parentPlatform, request.getCallIdHeader());
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (SipException | InvalidArgumentException | ParseException | SdpParseException e) {
|
} catch (SipException | InvalidArgumentException | ParseException | SdpParseException e) {
|
||||||
|
|
|
@ -208,7 +208,7 @@ public interface IRedisCatchStorage {
|
||||||
|
|
||||||
void sendChannelAddOrDelete(String deviceId, String channelId, boolean add);
|
void sendChannelAddOrDelete(String deviceId, String channelId, boolean add);
|
||||||
|
|
||||||
void sendPlatformStartPlayMsg(SendRtpInfo sendRtpItem, Platform platform);
|
void sendPlatformStartPlayMsg(SendRtpInfo sendRtpItem, DeviceChannel channel, Platform platform);
|
||||||
|
|
||||||
void sendPlatformStopPlayMsg(SendRtpInfo sendRtpItem, Platform platform, CommonGBChannel channel);
|
void sendPlatformStopPlayMsg(SendRtpInfo sendRtpItem, Platform platform, CommonGBChannel channel);
|
||||||
|
|
||||||
|
|
|
@ -662,10 +662,10 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendPlatformStartPlayMsg(SendRtpInfo sendRtpItem, Platform platform) {
|
public void sendPlatformStartPlayMsg(SendRtpInfo sendRtpItem, DeviceChannel channel, Platform platform) {
|
||||||
if (sendRtpItem.getPlayType() == InviteStreamType.PUSH && platform != null) {
|
if (sendRtpItem.getPlayType() == InviteStreamType.PUSH && platform != null) {
|
||||||
MessageForPushChannel messageForPushChannel = MessageForPushChannel.getInstance(0, sendRtpItem.getApp(), sendRtpItem.getStream(),
|
MessageForPushChannel messageForPushChannel = MessageForPushChannel.getInstance(0, sendRtpItem.getApp(), sendRtpItem.getStream(),
|
||||||
sendRtpItem.getChannelId(), platform.getServerGBId(), platform.getName(), userSetting.getServerId(),
|
channel.getDeviceId(), platform.getServerGBId(), platform.getName(), userSetting.getServerId(),
|
||||||
sendRtpItem.getMediaServerId());
|
sendRtpItem.getMediaServerId());
|
||||||
messageForPushChannel.setPlatFormIndex(platform.getId());
|
messageForPushChannel.setPlatFormIndex(platform.getId());
|
||||||
String key = VideoManagerConstants.VM_MSG_STREAM_START_PLAY_NOTIFY;
|
String key = VideoManagerConstants.VM_MSG_STREAM_START_PLAY_NOTIFY;
|
||||||
|
|
Loading…
Reference in New Issue