Compare commits

...

3 Commits

Author SHA1 Message Date
田朝盛
1590a1dd5d
Pre Merge pull request !39 from 田朝盛/N/A 2026-04-10 09:25:16 +00:00
lin
80d35b3231 确保语音对讲未携带SSRC时生成随机SSRC 2026-04-10 17:25:03 +08:00
田朝盛
8dd624ccd4
update src/main/java/com/genersoft/iot/vmp/gb28181/controller/PlayController.java.
Signed-off-by: 田朝盛 <1753182616@qq.com>
2025-07-14 08:04:09 +00:00
2 changed files with 11 additions and 2 deletions

View File

@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl;
import com.genersoft.iot.vmp.common.InviteSessionType;
import com.genersoft.iot.vmp.common.VideoManagerConstants;
import com.genersoft.iot.vmp.common.enums.ChannelDataType;
import com.genersoft.iot.vmp.conf.DynamicTask;
import com.genersoft.iot.vmp.conf.SipConfig;
import com.genersoft.iot.vmp.conf.UserSetting;
@ -40,6 +39,7 @@ import javax.sip.RequestEvent;
import javax.sip.SipException;
import javax.sip.header.CallIdHeader;
import javax.sip.message.Response;
import java.security.SecureRandom;
import java.text.ParseException;
import java.util.List;
import java.util.Vector;
@ -481,6 +481,13 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
try {
Gb28181Sdp gb28181Sdp = SipUtils.parseSDP(contentString);
SessionDescription sdp = gb28181Sdp.getBaseSdb();
if (ObjectUtils.isEmpty(gb28181Sdp.getSsrc()) ) {
String ssrc = Integer.toUnsignedString(new SecureRandom().nextInt());
log.warn("来自设备的Invite请求未携带SSRC生成随机ssrc: {}requesterId {}/{}", ssrc, inviteInfo.getRequesterId(), inviteInfo.getSourceChannelId());
gb28181Sdp.setSsrc(ssrc);
}
// 获取支持的格式
Vector mediaDescriptions = sdp.getMediaDescriptions(true);
@ -622,7 +629,9 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
content.append("a=setup:passive\r\n");
}
}
content.append("y=" + ssrc + "\r\n");
if (ssrc != null) {
content.append("y=" + ssrc + "\r\n");
}
content.append("f=v/////a/1/8/1\r\n");
Platform parentPlatform = new Platform();