|
|
@@ -71,12 +71,12 @@ public class SipCmdImpl implements ISipCmd {
|
|
|
log.error("playStreamCmd mediaInfo is null");
|
|
|
return null;
|
|
|
}
|
|
|
- VideoSessionInfo info = VideoSessionInfo.builder()
|
|
|
- .mediaServerId(mediaInfo.getServerId())
|
|
|
- .deviceId(device.getDeviceSipId())
|
|
|
- .channelId(channelId)
|
|
|
- .streamMode(device.getStreamMode().toUpperCase())
|
|
|
- .build();
|
|
|
+ VideoSessionInfo info = new VideoSessionInfo();
|
|
|
+ info.setMediaServerId(mediaInfo.getServerId());
|
|
|
+ info.setDeviceId(device.getDeviceSipId());
|
|
|
+ info.setChannelId(channelId);
|
|
|
+ info.setStreamMode(device.getStreamMode().toUpperCase());
|
|
|
+
|
|
|
String fromTag;
|
|
|
if (record) {
|
|
|
info.setType(SessionType.playrecord);
|
|
|
@@ -93,11 +93,11 @@ public class SipCmdImpl implements ISipCmd {
|
|
|
//发送消息
|
|
|
ClientTransaction transaction = transmitRequest(request);
|
|
|
log.info("playStreamCmd streamSession: {}", info);
|
|
|
- InviteInfo invite = InviteInfo.builder()
|
|
|
- .ssrc(info.getSsrc())
|
|
|
- .fromTag(fromTag)
|
|
|
- .callId(transaction.getDialog().getCallId().getCallId())
|
|
|
- .port(info.getPort()).build();
|
|
|
+ InviteInfo invite = new InviteInfo();
|
|
|
+ invite.setSsrc(info.getSsrc());
|
|
|
+ invite.setFromTag(fromTag);
|
|
|
+ invite.setCallId(transaction.getDialog().getCallId().getCallId());
|
|
|
+ invite.setPort(info.getPort());
|
|
|
log.warn("playStreamCmd invite: {}", invite);
|
|
|
inviteService.updateInviteInfo(info, invite);
|
|
|
streamSession.put(info, transaction);
|
|
|
@@ -121,15 +121,15 @@ public class SipCmdImpl implements ISipCmd {
|
|
|
log.error("playbackStreamCmd mediaInfo is null");
|
|
|
return null;
|
|
|
}
|
|
|
- VideoSessionInfo info = VideoSessionInfo.builder()
|
|
|
- .mediaServerId(mediaInfo.getServerId())
|
|
|
- .deviceId(device.getDeviceSipId())
|
|
|
- .channelId(channelId)
|
|
|
- .streamMode(device.getStreamMode().toUpperCase())
|
|
|
- .type(SessionType.playback)
|
|
|
- .startTime(startTime)
|
|
|
- .endTime(endTime)
|
|
|
- .build();
|
|
|
+ VideoSessionInfo info = new VideoSessionInfo();
|
|
|
+
|
|
|
+ info.setMediaServerId(mediaInfo.getServerId());
|
|
|
+ info.setDeviceId(device.getDeviceSipId());
|
|
|
+ info.setChannelId(channelId);
|
|
|
+ info.setStreamMode(device.getStreamMode().toUpperCase());
|
|
|
+ info.setType(SessionType.playback);
|
|
|
+ info.setStartTime(startTime);
|
|
|
+ info.setEndTime(endTime);
|
|
|
//创建rtp服务器
|
|
|
info = mediaServerService.createRTPServer(sipConfig, mediaInfo, device, info);
|
|
|
//创建Invite会话
|
|
|
@@ -140,12 +140,18 @@ public class SipCmdImpl implements ISipCmd {
|
|
|
//发送消息
|
|
|
ClientTransaction transaction = transmitRequest(request);
|
|
|
log.info("playbackStreamCmd streamSession: {}", info);
|
|
|
- InviteInfo invite = InviteInfo.builder()
|
|
|
- .ssrc(info.getSsrc())
|
|
|
- .fromTag(fromTag)
|
|
|
- .viaTag(viaTag)
|
|
|
- .callId(transaction.getDialog().getCallId().getCallId())
|
|
|
- .port(info.getPort()).build();
|
|
|
+// InviteInfo invite = InviteInfo.builder()
|
|
|
+// .ssrc(info.getSsrc())
|
|
|
+// .fromTag(fromTag)
|
|
|
+// .viaTag(viaTag)
|
|
|
+// .callId(transaction.getDialog().getCallId().getCallId())
|
|
|
+// .port(info.getPort()).build();
|
|
|
+ InviteInfo invite = new InviteInfo();
|
|
|
+ invite.setSsrc(info.getSsrc());
|
|
|
+ invite.setFromTag(fromTag);
|
|
|
+ invite.setViaTag(viaTag);
|
|
|
+ invite.setCallId(transaction.getDialog().getCallId().getCallId());
|
|
|
+ invite.setPort(info.getPort());
|
|
|
log.warn("playbackStreamCmd invite: {}", invite);
|
|
|
inviteService.updateInviteInfo(info, invite);
|
|
|
streamSession.put(info, transaction);
|
|
|
@@ -170,17 +176,28 @@ public class SipCmdImpl implements ISipCmd {
|
|
|
log.error("downloadStreamCmd mediaInfo is null");
|
|
|
return null;
|
|
|
}
|
|
|
- VideoSessionInfo info = VideoSessionInfo.builder()
|
|
|
- .mediaServerId(mediaInfo.getServerId())
|
|
|
- .deviceId(device.getDeviceSipId())
|
|
|
- .channelId(channelId)
|
|
|
- .streamMode(device.getStreamMode().toUpperCase())
|
|
|
- .type(SessionType.download)
|
|
|
- .startTime(startTime)
|
|
|
- .endTime(endTime)
|
|
|
- .downloadSpeed(downloadSpeed)
|
|
|
- .build();
|
|
|
- ;
|
|
|
+// VideoSessionInfo info = VideoSessionInfo.builder()
|
|
|
+// .mediaServerId(mediaInfo.getServerId())
|
|
|
+// .deviceId(device.getDeviceSipId())
|
|
|
+// .channelId(channelId)
|
|
|
+// .streamMode(device.getStreamMode().toUpperCase())
|
|
|
+// .type(SessionType.download)
|
|
|
+// .startTime(startTime)
|
|
|
+// .endTime(endTime)
|
|
|
+// .downloadSpeed(downloadSpeed)
|
|
|
+// .build();
|
|
|
+// ;
|
|
|
+
|
|
|
+ VideoSessionInfo info = new VideoSessionInfo();
|
|
|
+
|
|
|
+ info.setMediaServerId(mediaInfo.getServerId());
|
|
|
+ info.setDeviceId(device.getDeviceSipId());
|
|
|
+ info.setChannelId(channelId);
|
|
|
+ info.setStreamMode(device.getStreamMode().toUpperCase());
|
|
|
+ info.setType(SessionType.playback);
|
|
|
+ info.setStartTime(startTime);
|
|
|
+ info.setEndTime(endTime);
|
|
|
+ info.setDownloadSpeed(downloadSpeed);
|
|
|
//创建rtp服务器
|
|
|
info = mediaServerService.createRTPServer(sipConfig, mediaInfo, device, info);
|
|
|
//创建Invite会话
|
|
|
@@ -191,12 +208,18 @@ public class SipCmdImpl implements ISipCmd {
|
|
|
//发送消息
|
|
|
ClientTransaction transaction = transmitRequest(request);
|
|
|
log.info("downloadStreamCmd streamSession: {}", info);
|
|
|
- InviteInfo invite = InviteInfo.builder()
|
|
|
- .ssrc(info.getSsrc())
|
|
|
- .fromTag(fromTag)
|
|
|
- .viaTag(viaTag)
|
|
|
- .callId(transaction.getDialog().getCallId().getCallId())
|
|
|
- .port(info.getPort()).build();
|
|
|
+// InviteInfo invite = InviteInfo.builder()
|
|
|
+// .ssrc(info.getSsrc())
|
|
|
+// .fromTag(fromTag)
|
|
|
+// .viaTag(viaTag)
|
|
|
+// .callId(transaction.getDialog().getCallId().getCallId())
|
|
|
+// .port(info.getPort()).build();
|
|
|
+ InviteInfo invite = new InviteInfo();
|
|
|
+ invite.setSsrc(info.getSsrc());
|
|
|
+ invite.setFromTag(fromTag);
|
|
|
+ invite.setViaTag(viaTag);
|
|
|
+ invite.setCallId(transaction.getDialog().getCallId().getCallId());
|
|
|
+ invite.setPort(info.getPort());
|
|
|
log.warn("downloadStreamCmd invite: {}", invite);
|
|
|
inviteService.updateInviteInfo(info, invite);
|
|
|
streamSession.put(info, transaction);
|