Commit 47e5d2b00b5b13c1004f94a7ccd3f406391698a0
Merge branch '2.6.9' into wvp-28181-2.0
Showing
3 changed files
with
21 additions
and
14 deletions
src/main/java/com/genersoft/iot/vmp/service/impl/CloudRecordServiceImpl.java
| ... | ... | @@ -164,8 +164,8 @@ public class CloudRecordServiceImpl implements ICloudRecordService { |
| 164 | 164 | throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到可用的流媒体"); |
| 165 | 165 | } |
| 166 | 166 | JSONObject result = assistRESTfulUtils.queryTaskList(mediaServerItem, app, stream, callId, taskId, isEnd); |
| 167 | - if (result.getInteger("code") != 0) { | |
| 168 | - throw new ControllerException(result.getInteger("code"), result.getString("msg")); | |
| 167 | + if (result == null || result.getInteger("code") != 0) { | |
| 168 | + throw new ControllerException(ErrorCode.ERROR100.getCode(), result.getString("msg")); | |
| 169 | 169 | } |
| 170 | 170 | return result.getJSONArray("data"); |
| 171 | 171 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGbPlayMsgListener.java
| ... | ... | @@ -13,6 +13,7 @@ import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange; |
| 13 | 13 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| 14 | 14 | import com.genersoft.iot.vmp.service.IMediaServerService; |
| 15 | 15 | import com.genersoft.iot.vmp.service.bean.*; |
| 16 | +import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | |
| 16 | 17 | import com.genersoft.iot.vmp.utils.redis.RedisUtil; |
| 17 | 18 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| 18 | 19 | import org.slf4j.Logger; |
| ... | ... | @@ -77,6 +78,9 @@ public class RedisGbPlayMsgListener implements MessageListener { |
| 77 | 78 | @Autowired |
| 78 | 79 | private IMediaServerService mediaServerService; |
| 79 | 80 | |
| 81 | + @Autowired | |
| 82 | + private IRedisCatchStorage redisCatchStorage; | |
| 83 | + | |
| 80 | 84 | |
| 81 | 85 | @Autowired |
| 82 | 86 | private DynamicTask dynamicTask; |
| ... | ... | @@ -322,6 +326,7 @@ public class RedisGbPlayMsgListener implements MessageListener { |
| 322 | 326 | responseSendItemMsg.setSendRtpItem(sendRtpItem); |
| 323 | 327 | responseSendItemMsg.setMediaServerItem(mediaServerItem); |
| 324 | 328 | result.setData(responseSendItemMsg); |
| 329 | + redisCatchStorage.updateSendRTPSever(sendRtpItem); | |
| 325 | 330 | |
| 326 | 331 | WvpRedisMsg response = WvpRedisMsg.getResponseInstance( |
| 327 | 332 | userSetting.getServerId(), toId, WvpRedisMsgCmd.GET_SEND_ITEM, serial, JSON.toJSONString(result) | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamCloseResponseListener.java
| ... | ... | @@ -73,12 +73,20 @@ public class RedisPushStreamCloseResponseListener implements MessageListener { |
| 73 | 73 | MessageForPushChannel pushChannel = JSON.parseObject(message.getBody(), MessageForPushChannel.class); |
| 74 | 74 | StreamPushItem push = streamPushService.getPush(pushChannel.getApp(), pushChannel.getStream()); |
| 75 | 75 | if (push != null) { |
| 76 | - if (redisCatchStorage.isChannelSendingRTP(push.getGbId())) { | |
| 77 | - List<SendRtpItem> sendRtpItems = redisCatchStorage.querySendRTPServerByChnnelId( | |
| 78 | - push.getGbId()); | |
| 79 | - if (sendRtpItems.size() > 0) { | |
| 80 | - for (SendRtpItem sendRtpItem : sendRtpItems) { | |
| 81 | - ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId()); | |
| 76 | + List<SendRtpItem> sendRtpItems = redisCatchStorage.querySendRTPServerByChnnelId( | |
| 77 | + push.getGbId()); | |
| 78 | + if (!sendRtpItems.isEmpty()) { | |
| 79 | + for (SendRtpItem sendRtpItem : sendRtpItems) { | |
| 80 | + ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId()); | |
| 81 | + if (parentPlatform != null) { | |
| 82 | + redisCatchStorage.deleteSendRTPServer(sendRtpItem.getPlatformId(), sendRtpItem.getChannelId(), sendRtpItem.getCallId(), sendRtpItem.getStreamId()); | |
| 83 | + try { | |
| 84 | + commanderFroPlatform.streamByeCmd(parentPlatform, sendRtpItem); | |
| 85 | + } catch (SipException | InvalidArgumentException | ParseException e) { | |
| 86 | + logger.error("[命令发送失败] 国标级联 发送BYE: {}", e.getMessage()); | |
| 87 | + } | |
| 88 | + } | |
| 89 | + if (push.isSelf()) { | |
| 82 | 90 | // 停止向上级推流 |
| 83 | 91 | String streamId = sendRtpItem.getStreamId(); |
| 84 | 92 | Map<String, Object> param = new HashMap<>(); |
| ... | ... | @@ -90,12 +98,6 @@ public class RedisPushStreamCloseResponseListener implements MessageListener { |
| 90 | 98 | MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId()); |
| 91 | 99 | redisCatchStorage.deleteSendRTPServer(sendRtpItem.getPlatformId(), sendRtpItem.getChannelId(), sendRtpItem.getCallId(), sendRtpItem.getStreamId()); |
| 92 | 100 | zlmServerFactory.stopSendRtpStream(mediaInfo, param); |
| 93 | - | |
| 94 | - try { | |
| 95 | - commanderFroPlatform.streamByeCmd(parentPlatform, sendRtpItem); | |
| 96 | - } catch (SipException | InvalidArgumentException | ParseException e) { | |
| 97 | - logger.error("[命令发送失败] 国标级联 发送BYE: {}", e.getMessage()); | |
| 98 | - } | |
| 99 | 101 | if (InviteStreamType.PUSH == sendRtpItem.getPlayType()) { |
| 100 | 102 | MessageForPushChannel messageForPushChannel = MessageForPushChannel.getInstance(0, |
| 101 | 103 | sendRtpItem.getApp(), sendRtpItem.getStreamId(), sendRtpItem.getChannelId(), | ... | ... |