优化点播结束后关闭RTPServer
This commit is contained in:
@@ -694,7 +694,7 @@ public class SIPCommander implements ISIPCommander {
|
||||
dialog = streamSession.getDialogByStream(ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId(), ssrcTransaction.getStream());
|
||||
}
|
||||
mediaServerService.releaseSsrc(ssrcTransaction.getMediaServerId(), ssrcTransaction.getSsrc());
|
||||
mediaServerService.closeRTPServer(ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId(), ssrcTransaction.getStream());
|
||||
mediaServerService.closeRTPServer(ssrcTransaction.getMediaServerId(), ssrcTransaction.getStream());
|
||||
streamSession.remove(ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId(), ssrcTransaction.getStream());
|
||||
|
||||
if (dialog == null) {
|
||||
|
||||
@@ -121,7 +121,7 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In
|
||||
StreamInfo streamInfo = redisCatchStorage.queryPlayByDevice(device.getDeviceId(), channelId);
|
||||
if (streamInfo != null) {
|
||||
redisCatchStorage.stopPlay(streamInfo);
|
||||
mediaServerService.closeRTPServer(device.getDeviceId(), channelId, streamInfo.getStream());
|
||||
mediaServerService.closeRTPServer(streamInfo.getMediaServerId(), streamInfo.getStream());
|
||||
}
|
||||
SsrcTransaction ssrcTransactionForPlay = streamSession.getSsrcTransaction(device.getDeviceId(), channelId, "play", null);
|
||||
if (ssrcTransactionForPlay != null){
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.genersoft.iot.vmp.service.IStreamPushService;
|
||||
import com.genersoft.iot.vmp.service.bean.MessageForPushChannel;
|
||||
import com.genersoft.iot.vmp.service.bean.SSRCInfo;
|
||||
import com.genersoft.iot.vmp.service.impl.RedisGbPlayMsgListener;
|
||||
import com.genersoft.iot.vmp.service.impl.RedisPushStreamResponseListener;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||
@@ -74,7 +75,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||
private DynamicTask dynamicTask;
|
||||
|
||||
@Autowired
|
||||
private SIPCommander cmder;
|
||||
private RedisPushStreamResponseListener redisPushStreamResponseListener;
|
||||
|
||||
@Autowired
|
||||
private IPlayService playService;
|
||||
@@ -556,7 +557,6 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||
otherWvpPushStream(evt, gbStream, streamPushItem, platform, callIdHeader, mediaServerItem, port, tcpActive,
|
||||
mediaTransmissionTCP, channelId, addressStr, ssrc, requesterId);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 通知流上线
|
||||
@@ -639,6 +639,23 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||
mediaTransmissionTCP, channelId, addressStr, ssrc, requesterId);
|
||||
}
|
||||
});
|
||||
|
||||
// 添加回复的拒绝或者错误的通知
|
||||
redisPushStreamResponseListener.addEvent(gbStream.getApp(), gbStream.getStream(), response -> {
|
||||
if (response.getCode() != 0) {
|
||||
dynamicTask.stop(callIdHeader.getCallId());
|
||||
mediaListManager.removedChannelOnlineEventLister(gbStream.getApp(), gbStream.getStream());
|
||||
try {
|
||||
responseAck(evt, Response.TEMPORARILY_UNAVAILABLE, response.getMsg());
|
||||
} catch (SipException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (InvalidArgumentException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,8 +79,8 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem
|
||||
List<DeviceChannel> allChannels = new ArrayList<>();
|
||||
|
||||
// 回复平台
|
||||
DeviceChannel deviceChannel = getChannelForPlatform(parentPlatform);
|
||||
allChannels.add(deviceChannel);
|
||||
// DeviceChannel deviceChannel = getChannelForPlatform(parentPlatform);
|
||||
// allChannels.add(deviceChannel);
|
||||
|
||||
// 回复目录
|
||||
if (catalogs.size() > 0) {
|
||||
|
||||
Reference in New Issue
Block a user