临时提交

This commit is contained in:
panlinlin 2024-08-10 23:27:21 +08:00
parent d8d9f76d89
commit 76a0d248ef
65 changed files with 421 additions and 601 deletions

View File

@ -1,7 +1,7 @@
package com.genersoft.iot.vmp.conf; package com.genersoft.iot.vmp.conf;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; import com.genersoft.iot.vmp.gb28181.bean.PlatformCatch;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
import com.genersoft.iot.vmp.gb28181.service.IPlatformService; import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
@ -38,14 +38,14 @@ public class SipPlatformRunner implements CommandLineRunner {
@Override @Override
public void run(String... args) throws Exception { public void run(String... args) throws Exception {
// 获取所有启用的平台 // 获取所有启用的平台
List<ParentPlatform> parentPlatforms = storager.queryEnableParentPlatformList(true); List<Platform> parentPlatforms = storager.queryEnableParentPlatformList(true);
for (ParentPlatform parentPlatform : parentPlatforms) { for (Platform parentPlatform : parentPlatforms) {
ParentPlatformCatch parentPlatformCatchOld = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); PlatformCatch parentPlatformCatchOld = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId());
// 更新缓存 // 更新缓存
ParentPlatformCatch parentPlatformCatch = new ParentPlatformCatch(); PlatformCatch parentPlatformCatch = new PlatformCatch();
parentPlatformCatch.setParentPlatform(parentPlatform); parentPlatformCatch.setParentPlatform(parentPlatform);
parentPlatformCatch.setId(parentPlatform.getServerGBId()); parentPlatformCatch.setId(parentPlatform.getServerGBId());
redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch); redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);

View File

@ -342,4 +342,18 @@ public class CommonGBChannel {
return channel; return channel;
} }
public static CommonGBChannel build(Platform platform) {
CommonGBChannel commonGBChannel = new CommonGBChannel();
commonGBChannel.setGbDeviceId(platform.getDeviceGBId());
commonGBChannel.setGbName(platform.getName());
commonGBChannel.setGbManufacturer(platform.getManufacturer());
commonGBChannel.setGbModel(platform.getModel());
commonGBChannel.setGbCivilCode(platform.getCivilCode());
commonGBChannel.setGbAddress(platform.getAddress());
commonGBChannel.setGbRegisterWay(platform.getRegisterWay());
commonGBChannel.setGbSecrecy(platform.getSecrecy());
commonGBChannel.setGbStatus(platform.getStatus());
return commonGBChannel;
}
} }

View File

@ -1,68 +0,0 @@
package com.genersoft.iot.vmp.gb28181.bean;
public class ParentPlatformCatch {
private String id;
/**
* 心跳未回复次数
*/
private int keepAliveReply;
// 注册未回复次数
private int registerAliveReply;
private String callId;
private ParentPlatform parentPlatform;
private SipTransactionInfo sipTransactionInfo;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int getKeepAliveReply() {
return keepAliveReply;
}
public void setKeepAliveReply(int keepAliveReply) {
this.keepAliveReply = keepAliveReply;
}
public int getRegisterAliveReply() {
return registerAliveReply;
}
public void setRegisterAliveReply(int registerAliveReply) {
this.registerAliveReply = registerAliveReply;
}
public ParentPlatform getParentPlatform() {
return parentPlatform;
}
public void setParentPlatform(ParentPlatform parentPlatform) {
this.parentPlatform = parentPlatform;
}
public String getCallId() {
return callId;
}
public void setCallId(String callId) {
this.callId = callId;
}
public SipTransactionInfo getSipTransactionInfo() {
return sipTransactionInfo;
}
public void setSipTransactionInfo(SipTransactionInfo sipTransactionInfo) {
this.sipTransactionInfo = sipTransactionInfo;
}
}

View File

@ -8,7 +8,7 @@ import lombok.Data;
*/ */
@Data @Data
@Schema(description = "平台信息") @Schema(description = "平台信息")
public class ParentPlatform { public class Platform {
@Schema(description = "ID(数据库中)") @Schema(description = "ID(数据库中)")
private Integer id; private Integer id;
@ -70,9 +70,6 @@ public class ParentPlatform {
@Schema(description = "在线状态") @Schema(description = "在线状态")
private int channelCount; private int channelCount;
@Schema(description = "默认目录Id,自动添加的通道多放在这个目录下")
private String catalogId;
@Schema(description = "已被订阅目录信息") @Schema(description = "已被订阅目录信息")
private boolean catalogSubscribe; private boolean catalogSubscribe;
@ -82,9 +79,6 @@ public class ParentPlatform {
@Schema(description = "已被订阅移动位置信息") @Schema(description = "已被订阅移动位置信息")
private boolean mobilePositionSubscribe; private boolean mobilePositionSubscribe;
@Schema(description = "点播未推流的设备时是否使用redis通知拉起")
private boolean startOfflinePush;
@Schema(description = "目录分组-每次向上级发送通道信息时单个包携带的通道数量取值1,2,4,8") @Schema(description = "目录分组-每次向上级发送通道信息时单个包携带的通道数量取值1,2,4,8")
private int catalogGroup; private int catalogGroup;
@ -97,12 +91,46 @@ public class ParentPlatform {
@Schema(description = "是否作为消息通道") @Schema(description = "是否作为消息通道")
private boolean asMessageChannel; private boolean asMessageChannel;
@Schema(description = "点播回复200OK使用IP") @Schema(description = "点播回复200OK使用IP")
private String sendStreamIp; private String sendStreamIp;
@Schema(description = "是否使用自定义业务分组") @Schema(description = "是否使用自定义业务分组")
private Boolean customCatalog; private Boolean customGroup;
@Schema(description = "是否自动推送通道变化") @Schema(description = "是否自动推送通道变化")
private Boolean autoPushChannel; private Boolean autoPushChannel;
@Schema(description = "目录信息包含平台信息")
private Boolean catalogWithPlatform;
@Schema(description = "目录信息包含分组信息")
private Boolean catalogWithGroup;
@Schema(description = "目录信息包含行政区划")
private Boolean catalogWithRegion;
@Schema(description = "行政区划")
private String civilCode;
@Schema(description = "平台厂商")
private String manufacturer;
@Schema(description = "平台型号")
private String model;
@Schema(description = "平台安装地址")
private String address;
@Schema(description = "注册方式必选缺省为1 " +
"1-符合IETF RFC 3261标准的认证注册模式" +
"2-基于口令的双向认证注册模式;" +
"3-基于数字证书的双向认证注册模式(高安全级别要求)" +
"4-基于数字证书的单向认证注册模式(高安全级别要求)")
private int registerWay = 1;
@Schema(description = "保密属性必选缺省为00-不涉密1-涉密")
private int secrecy = 0;
@Schema(description = "在线状态")
private String Status = "ON";
} }

View File

@ -0,0 +1,24 @@
package com.genersoft.iot.vmp.gb28181.bean;
import lombok.Data;
@Data
public class PlatformCatch {
private String id;
/**
* 心跳未回复次数
*/
private int keepAliveReply;
// 注册未回复次数
private int registerAliveReply;
private String callId;
private Platform parentPlatform;
private SipTransactionInfo sipTransactionInfo;
}

View File

@ -7,7 +7,7 @@ import javax.sip.RequestEvent;
public class SipMsgInfo { public class SipMsgInfo {
private RequestEvent evt; private RequestEvent evt;
private Device device; private Device device;
private ParentPlatform platform; private Platform platform;
private Element rootElement; private Element rootElement;
public SipMsgInfo(RequestEvent evt, Device device, Element rootElement) { public SipMsgInfo(RequestEvent evt, Device device, Element rootElement) {
@ -16,7 +16,7 @@ public class SipMsgInfo {
this.rootElement = rootElement; this.rootElement = rootElement;
} }
public SipMsgInfo(RequestEvent evt, ParentPlatform platform, Element rootElement) { public SipMsgInfo(RequestEvent evt, Platform platform, Element rootElement) {
this.evt = evt; this.evt = evt;
this.platform = platform; this.platform = platform;
this.rootElement = rootElement; this.rootElement = rootElement;
@ -38,11 +38,11 @@ public class SipMsgInfo {
this.device = device; this.device = device;
} }
public ParentPlatform getPlatform() { public Platform getPlatform() {
return platform; return platform;
} }
public void setPlatform(ParentPlatform platform) { public void setPlatform(Platform platform) {
this.platform = platform; this.platform = platform;
} }

View File

@ -4,7 +4,7 @@ import com.genersoft.iot.vmp.conf.exception.ControllerException;
import com.genersoft.iot.vmp.conf.security.JwtUtils; import com.genersoft.iot.vmp.conf.security.JwtUtils;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm; import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
import com.genersoft.iot.vmp.gb28181.service.IDeviceAlarmService; import com.genersoft.iot.vmp.gb28181.service.IDeviceAlarmService;
@ -100,7 +100,7 @@ public class AlarmController {
@Parameter(name = "deviceId", description = "设备国标编号") @Parameter(name = "deviceId", description = "设备国标编号")
public void delete(@RequestParam String deviceId) { public void delete(@RequestParam String deviceId) {
Device device = deviceService.getDevice(deviceId); Device device = deviceService.getDevice(deviceId);
ParentPlatform platform = storage.queryParentPlatByServerGBId(deviceId); Platform platform = storage.queryParentPlatByServerGBId(deviceId);
DeviceAlarm deviceAlarm = new DeviceAlarm(); DeviceAlarm deviceAlarm = new DeviceAlarm();
deviceAlarm.setChannelId(deviceId); deviceAlarm.setChannelId(deviceId);
deviceAlarm.setAlarmDescription("test"); deviceAlarm.setAlarmDescription("test");

View File

@ -8,8 +8,8 @@ import com.genersoft.iot.vmp.conf.SipConfig;
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.conf.security.JwtUtils; import com.genersoft.iot.vmp.conf.security.JwtUtils;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; import com.genersoft.iot.vmp.gb28181.bean.PlatformCatch;
import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog; import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog;
import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder; import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder;
import com.genersoft.iot.vmp.gb28181.controller.bean.ChannelReduce; import com.genersoft.iot.vmp.gb28181.controller.bean.ChannelReduce;
@ -100,8 +100,8 @@ public class PlatformController {
@Operation(summary = "获取级联服务器信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Operation(summary = "获取级联服务器信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "id", description = "平台国标编号", required = true) @Parameter(name = "id", description = "平台国标编号", required = true)
@GetMapping("/info/{id}") @GetMapping("/info/{id}")
public ParentPlatform getPlatform(@PathVariable String id) { public Platform getPlatform(@PathVariable String id) {
ParentPlatform parentPlatform = platformService.queryPlatformByServerGBId(id); Platform parentPlatform = platformService.queryPlatformByServerGBId(id);
if (parentPlatform != null) { if (parentPlatform != null) {
return parentPlatform; return parentPlatform;
} else { } else {
@ -120,11 +120,11 @@ public class PlatformController {
@Operation(summary = "分页查询级联平台", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Operation(summary = "分页查询级联平台", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "page", description = "当前页", required = true) @Parameter(name = "page", description = "当前页", required = true)
@Parameter(name = "count", description = "每页条数", required = true) @Parameter(name = "count", description = "每页条数", required = true)
public PageInfo<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count) { public PageInfo<Platform> platforms(@PathVariable int page, @PathVariable int count) {
PageInfo<ParentPlatform> parentPlatformPageInfo = platformService.queryParentPlatformList(page, count); PageInfo<Platform> parentPlatformPageInfo = platformService.queryParentPlatformList(page, count);
if (parentPlatformPageInfo.getList().size() > 0) { if (parentPlatformPageInfo.getList().size() > 0) {
for (ParentPlatform platform : parentPlatformPageInfo.getList()) { for (Platform platform : parentPlatformPageInfo.getList()) {
platform.setMobilePositionSubscribe(subscribeHolder.getMobilePositionSubscribe(platform.getServerGBId()) != null); platform.setMobilePositionSubscribe(subscribeHolder.getMobilePositionSubscribe(platform.getServerGBId()) != null);
platform.setCatalogSubscribe(subscribeHolder.getCatalogSubscribe(platform.getServerGBId()) != null); platform.setCatalogSubscribe(subscribeHolder.getCatalogSubscribe(platform.getServerGBId()) != null);
} }
@ -141,7 +141,7 @@ public class PlatformController {
@Operation(summary = "添加上级平台信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Operation(summary = "添加上级平台信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
@PostMapping("/add") @PostMapping("/add")
@ResponseBody @ResponseBody
public void addPlatform(@RequestBody ParentPlatform parentPlatform) { public void addPlatform(@RequestBody Platform parentPlatform) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("保存上级平台信息API调用"); log.debug("保存上级平台信息API调用");
@ -164,7 +164,7 @@ public class PlatformController {
} }
ParentPlatform parentPlatformOld = storager.queryParentPlatByServerGBId(parentPlatform.getServerGBId()); Platform parentPlatformOld = storager.queryParentPlatByServerGBId(parentPlatform.getServerGBId());
if (parentPlatformOld != null) { if (parentPlatformOld != null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "平台 " + parentPlatform.getServerGBId() + " 已存在"); throw new ControllerException(ErrorCode.ERROR100.getCode(), "平台 " + parentPlatform.getServerGBId() + " 已存在");
} }
@ -186,7 +186,7 @@ public class PlatformController {
@Operation(summary = "保存上级平台信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Operation(summary = "保存上级平台信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
@PostMapping("/save") @PostMapping("/save")
@ResponseBody @ResponseBody
public void savePlatform(@RequestBody ParentPlatform parentPlatform) { public void savePlatform(@RequestBody Platform parentPlatform) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("保存上级平台信息API调用"); log.debug("保存上级平台信息API调用");
@ -227,8 +227,8 @@ public class PlatformController {
) { ) {
throw new ControllerException(ErrorCode.ERROR400); throw new ControllerException(ErrorCode.ERROR400);
} }
ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(serverGBId); Platform parentPlatform = storager.queryParentPlatByServerGBId(serverGBId);
ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(serverGBId); PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(serverGBId);
if (parentPlatform == null) { if (parentPlatform == null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "平台不存在"); throw new ControllerException(ErrorCode.ERROR100.getCode(), "平台不存在");
} }
@ -279,7 +279,7 @@ public class PlatformController {
@ResponseBody @ResponseBody
public Boolean exitPlatform(@PathVariable String serverGBId) { public Boolean exitPlatform(@PathVariable String serverGBId) {
ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(serverGBId); Platform parentPlatform = storager.queryParentPlatByServerGBId(serverGBId);
return parentPlatform != null; return parentPlatform != null;
} }

View File

@ -1,66 +0,0 @@
package com.genersoft.iot.vmp.gb28181.dao;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface PlatformCatalogMapper {
@Insert("INSERT INTO wvp_platform_catalog (id, name, platform_id, parent_id, civil_code, business_group_id) VALUES" +
"(#{id}, #{name}, #{platformId}, #{parentId}, #{civilCode}, #{businessGroupId})")
int add(PlatformCatalog platformCatalog);
@Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId} and id=#{id}")
int del(@Param("platformId") String platformId, @Param("id") String id);
@Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId}")
int delByPlatformId(@Param("platformId") String platformId);
@Select("SELECT pc.*, count(pc2.id) as children_count from wvp_platform_catalog pc " +
"left join wvp_platform_catalog pc2 on pc.id = pc2.parent_id " +
"WHERE pc.parent_id=#{parentId} AND pc.platform_id=#{platformId} " +
"group by pc.id, pc.name, pc.platform_id, pc.business_group_id, pc.civil_code, pc.parent_id")
List<PlatformCatalog> selectByParentId(@Param("platformId") String platformId, @Param("parentId") String parentId);
@Update(value = {" <script>" +
"UPDATE wvp_platform_catalog " +
"SET name=#{platformCatalog.name}" +
"WHERE id=#{platformCatalog.id} and platform_id=#{platformCatalog.platformId}"+
"</script>"})
int update(@Param("platformCatalog") PlatformCatalog platformCatalog);
@Select("SELECT *, (SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}")
List<PlatformCatalog> selectByPlatForm(@Param("platformId") String platformId);
@Select("SELECT pc.* FROM wvp_platform_catalog pc WHERE pc.id = (SELECT pp.catalog_id from wvp_platform pp WHERE pp.server_gb_id=#{platformId})")
PlatformCatalog selectDefaultByPlatFormId(@Param("platformId") String platformId);
@Select("SELECT pc.id as channel_id, pc.name, pc.civil_code, pc.business_group_id,'1' as parental, pc.parent_id " +
" from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}")
List<DeviceChannel> queryCatalogInPlatform(@Param("platformId") String platformId);
@Select("SELECT *, " +
"(SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count " +
" from wvp_platform_catalog pc " +
" WHERE pc.id=#{id} and pc.platform_id=#{platformId}")
PlatformCatalog selectByPlatFormAndCatalogId(@Param("platformId") String platformId, @Param("id") String id);
@Delete("<script> "+
"DELETE from wvp_platform_catalog where platform_id=#{platformId} and id in " +
"<foreach collection='ids' item='item' open='(' separator=',' close=')'>" +
"#{item} " +
"</foreach>" +
"</script>")
int deleteAll(String platformId, List<String> ids);
@Select("SELECT id from wvp_platform_catalog WHERE platform_id=#{platformId} and parent_id = #{id}")
List<String> queryCatalogFromParent(@Param("id") String id, @Param("platformId") String platformId);
}

View File

@ -97,7 +97,7 @@ public interface PlatformChannelMapper {
"AND pp.server_gb_id IN" + "AND pp.server_gb_id IN" +
"<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" + "<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
"</script> ") "</script> ")
List<ParentPlatform> queryPlatFormListForGBWithGBId(@Param("channelId") String channelId, @Param("platforms") List<String> platforms); List<Platform> queryPlatFormListForGBWithGBId(@Param("channelId") String channelId, @Param("platforms") List<String> platforms);
@Delete("<script> " + @Delete("<script> " +
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{serverGBId}" + "DELETE from wvp_platform_gb_channel WHERE platform_id=#{serverGBId}" +

View File

@ -1,114 +0,0 @@
package com.genersoft.iot.vmp.gb28181.dao;
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog;
import com.genersoft.iot.vmp.gb28181.bean.PlatformGbStream;
import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy;
import com.genersoft.iot.vmp.streamPush.bean.StreamPush;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface PlatformGbStreamMapper {
@Insert("INSERT INTO wvp_platform_gb_stream (gb_stream_id, platform_id, catalog_id) VALUES" +
"( #{gbStreamId}, #{platformId}, #{catalogId})")
int add(PlatformGbStream platformGbStream);
@Insert("<script> " +
"INSERT into wvp_platform_gb_stream " +
"(gb_stream_id, platform_id, catalog_id) " +
"values " +
"<foreach collection='streamPushItems' index='index' item='item' separator=','> " +
"(#{item.gbStreamId}, #{item.platform_id}, #{item.catalogId})" +
"</foreach> " +
"</script>")
int batchAdd(List<StreamPush> streamPushItems);
@Delete("DELETE from wvp_platform_gb_stream WHERE gb_stream_id = (select gb_stream_id from wvp_gb_stream where app=#{app} AND stream=#{stream})")
int delByAppAndStream(@Param("app") String app, @Param("stream") String stream);
@Delete("DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId}")
int delByPlatformId(String platformId);
@Select("SELECT " +
"pp.* " +
"FROM " +
"wvp_platform_gb_stream pgs " +
"LEFT JOIN wvp_platform pp ON pp.server_gb_id = pgs.platform_id " +
"LEFT join wvp_gb_stream gs ON gs.gb_stream_id = pgs.gb_stream_id " +
"WHERE " +
"gs.app =#{app} " +
"AND gs.stream =#{stream} ")
List<ParentPlatform> selectByAppAndStream(@Param("app") String app, @Param("stream") String stream);
@Select("SELECT pgs.*, gs.gb_id from wvp_platform_gb_stream pgs " +
"LEFT join wvp_gb_stream gs ON pgs.gb_stream_id = gs.gb_stream_id " +
"WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platform_id=#{platformId}")
StreamProxy selectOne(@Param("app") String app, @Param("stream") String stream, @Param("platformId") String platformId);
@Select("<script> " +
"select gs.* " +
" from wvp_gb_stream gs\n" +
" left join wvp_platform_gb_stream pgs\n" +
" on gs.gb_stream_id = pgs.gb_stream_id\n" +
" where pgs.platform_id=#{platformId} " +
" <if test='catalogId != null' > and pgs.catalog_id=#{catalogId}</if>" +
"</script>")
List<GbStream> queryChannelInParentPlatformAndCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
@Select("select gs.gb_id as id, gs.name as name, pgs.platform_id as platform_id, pgs.catalog_id as catalog_id , 0 as children_count, 2 as type\n" +
"from wvp_gb_stream gs\n" +
" left join wvp_platform_gb_stream pgs\n" +
" on gs.gb_stream_id = pgs.gb_stream_id\n" +
"where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}")
List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
@Select("<script> " +
"SELECT " +
"pp.* " +
"FROM " +
"wvp_platform pp " +
"left join wvp_platform_gb_stream pgs on " +
"pp.server_gb_id = pgs.platform_id " +
"left join wvp_gb_stream gs " +
"on gs.gb_stream_id = pgs.gb_stream_id " +
"WHERE " +
"gs.app = #{app} " +
"AND gs.stream = #{stream}" +
"AND pp.server_gb_id IN" +
"<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
"</script> ")
List<ParentPlatform> queryPlatFormListForGBWithGBId(@Param("app") String app, @Param("stream") String stream, @Param("platforms") List<String> platforms);
@Delete("DELETE from wvp_platform_gb_stream WHERE gb_stream_id = (select id from wvp_gb_stream where app=#{app} AND stream=#{stream}) AND platform_id=#{platformId}")
int delByAppAndStreamAndPlatform(String app, String stream, String platformId);
@Delete("<script> "+
"DELETE from wvp_platform_gb_stream where gb_stream_id in " +
"<foreach collection='gbStreams' item='item' open='(' separator=',' close=')' >" +
"#{item.gbStreamId}" +
"</foreach>" +
"</script>")
void delByGbStreams(List<GbStream> gbStreams);
@Delete("<script> "+
"DELETE from wvp_platform_gb_stream where platform_id=#{platformId} and gb_stream_id in " +
"<foreach collection='gbStreams' item='item' open='(' separator=',' close=')'>" +
"#{item.gbStreamId} " +
"</foreach>" +
"</script>")
void delByAppAndStreamsByPlatformId(@Param("gbStreams") List<GbStream> gbStreams, @Param("platformId") String platformId);
@Delete("<script> "+
"DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId}" +
" <if test='catalogId != null' > and catalog_id=#{catalogId}</if>" +
"</script>")
int delByPlatformAndCatalogId(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
}

View File

@ -1,6 +1,6 @@
package com.genersoft.iot.vmp.gb28181.dao; package com.genersoft.iot.vmp.gb28181.dao;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo; import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -13,15 +13,15 @@ import java.util.List;
*/ */
@Mapper @Mapper
@Repository @Repository
public interface ParentPlatformMapper { public interface PlatformMapper {
@Insert("INSERT INTO wvp_platform (enable, name, server_gb_id, server_gb_domain, server_ip, server_port,device_gb_id,device_ip,"+ @Insert("INSERT INTO wvp_platform (enable, name, server_gb_id, server_gb_domain, server_ip, server_port,device_gb_id,device_ip,"+
"device_port,username,password,expires,keep_timeout,transport,character_set,ptz,rtcp,as_message_channel,auto_push_channel,"+ "device_port,username,password,expires,keep_timeout,transport,character_set,ptz,rtcp,as_message_channel,auto_push_channel,"+
"status,start_offline_push,catalog_id,administrative_division,catalog_group,create_time,update_time,send_stream_ip) " + "status,catalog_id,administrative_division,catalog_group,create_time,update_time,send_stream_ip) " +
" VALUES (#{enable}, #{name}, #{serverGBId}, #{serverGBDomain}, #{serverIP}, #{serverPort}, #{deviceGBId}, #{deviceIp}, " + " VALUES (#{enable}, #{name}, #{serverGBId}, #{serverGBDomain}, #{serverIP}, #{serverPort}, #{deviceGBId}, #{deviceIp}, " +
" #{devicePort}, #{username}, #{password}, #{expires}, #{keepTimeout}, #{transport}, #{characterSet}, #{ptz}, #{rtcp}, #{asMessageChannel}, #{autoPushChannel}, " + " #{devicePort}, #{username}, #{password}, #{expires}, #{keepTimeout}, #{transport}, #{characterSet}, #{ptz}, #{rtcp}, #{asMessageChannel}, #{autoPushChannel}, " +
" #{status}, #{startOfflinePush}, #{catalogId}, #{administrativeDivision}, #{catalogGroup}, #{createTime}, #{updateTime}, #{sendStreamIp})") " #{status}, #{catalogId}, #{administrativeDivision}, #{catalogGroup}, #{createTime}, #{updateTime}, #{sendStreamIp})")
int addParentPlatform(ParentPlatform parentPlatform); int addParentPlatform(Platform parentPlatform);
@Update("UPDATE wvp_platform " + @Update("UPDATE wvp_platform " +
"SET enable=#{enable}, " + "SET enable=#{enable}, " +
@ -44,7 +44,6 @@ public interface ParentPlatformMapper {
"as_message_channel=#{asMessageChannel}, " + "as_message_channel=#{asMessageChannel}, " +
"auto_push_channel=#{autoPushChannel}, " + "auto_push_channel=#{autoPushChannel}, " +
"status=#{status}, " + "status=#{status}, " +
"start_offline_push=#{startOfflinePush}, " +
"catalog_group=#{catalogGroup}, " + "catalog_group=#{catalogGroup}, " +
"administrative_division=#{administrativeDivision}, " + "administrative_division=#{administrativeDivision}, " +
"create_time=#{createTime}, " + "create_time=#{createTime}, " +
@ -52,10 +51,10 @@ public interface ParentPlatformMapper {
"send_stream_ip=#{sendStreamIp}, " + "send_stream_ip=#{sendStreamIp}, " +
"catalog_id=#{catalogId} " + "catalog_id=#{catalogId} " +
"WHERE id=#{id}") "WHERE id=#{id}")
int updateParentPlatform(ParentPlatform parentPlatform); int updateParentPlatform(Platform parentPlatform);
@Delete("DELETE FROM wvp_platform WHERE server_gb_id=#{serverGBId}") @Delete("DELETE FROM wvp_platform WHERE server_gb_id=#{serverGBId}")
int delParentPlatform(ParentPlatform parentPlatform); int delParentPlatform(Platform parentPlatform);
@Select("SELECT *, ((SELECT count(0)\n" + @Select("SELECT *, ((SELECT count(0)\n" +
" FROM wvp_platform_gb_channel pc\n" + " FROM wvp_platform_gb_channel pc\n" +
@ -69,19 +68,19 @@ public interface ParentPlatformMapper {
" FROM wvp_platform_catalog pgc\n" + " FROM wvp_platform_catalog pgc\n" +
" WHERE pgc.platform_id = pp.server_gb_id)) as channel_count\n" + " WHERE pgc.platform_id = pp.server_gb_id)) as channel_count\n" +
"FROM wvp_platform pp ") "FROM wvp_platform pp ")
List<ParentPlatform> getParentPlatformList(); List<Platform> getParentPlatformList();
@Select("SELECT * FROM wvp_platform WHERE enable=#{enable} ") @Select("SELECT * FROM wvp_platform WHERE enable=#{enable} ")
List<ParentPlatform> getEnableParentPlatformList(boolean enable); List<Platform> getEnableParentPlatformList(boolean enable);
@Select("SELECT * FROM wvp_platform WHERE enable=true and as_message_channel=true") @Select("SELECT * FROM wvp_platform WHERE enable=true and as_message_channel=true")
List<ParentPlatform> queryEnablePlatformListWithAsMessageChannel(); List<Platform> queryEnablePlatformListWithAsMessageChannel();
@Select("SELECT * FROM wvp_platform WHERE server_gb_id=#{platformGbId}") @Select("SELECT * FROM wvp_platform WHERE server_gb_id=#{platformGbId}")
ParentPlatform getParentPlatByServerGBId(String platformGbId); Platform getParentPlatByServerGBId(String platformGbId);
@Select("SELECT * FROM wvp_platform WHERE id=#{id}") @Select("SELECT * FROM wvp_platform WHERE id=#{id}")
ParentPlatform getParentPlatById(int id); Platform getParentPlatById(int id);
@Update("UPDATE wvp_platform SET status=false" ) @Update("UPDATE wvp_platform SET status=false" )
int outlineForAllParentPlatform(); int outlineForAllParentPlatform();

View File

@ -1,7 +1,7 @@
package com.genersoft.iot.vmp.gb28181.event.subscribe.catalog; package com.genersoft.iot.vmp.gb28181.event.subscribe.catalog;
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel; import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder; import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder;
import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo; import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo;
import com.genersoft.iot.vmp.gb28181.service.IPlatformService; import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
@ -42,9 +42,9 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> {
@Override @Override
public void onApplicationEvent(CatalogEvent event) { public void onApplicationEvent(CatalogEvent event) {
SubscribeInfo subscribe = null; SubscribeInfo subscribe = null;
ParentPlatform parentPlatform = null; Platform parentPlatform = null;
Map<String, List<ParentPlatform>> parentPlatformMap = new HashMap<>(); Map<String, List<Platform>> parentPlatformMap = new HashMap<>();
Map<String, CommonGBChannel> channelMap = new HashMap<>(); Map<String, CommonGBChannel> channelMap = new HashMap<>();
if (event.getPlatformId() != null) { if (event.getPlatformId() != null) {
parentPlatform = platformService.queryOne(event.getPlatformId()); parentPlatform = platformService.queryOne(event.getPlatformId());
@ -62,7 +62,7 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> {
if (event.getChannels() != null) { if (event.getChannels() != null) {
if (!platforms.isEmpty()) { if (!platforms.isEmpty()) {
for (CommonGBChannel deviceChannel : event.getChannels()) { for (CommonGBChannel deviceChannel : event.getChannels()) {
List<ParentPlatform> parentPlatformsForGB = storager.queryPlatFormListForGBWithGBId(deviceChannel.getGbDeviceId(), platforms); List<Platform> parentPlatformsForGB = storager.queryPlatFormListForGBWithGBId(deviceChannel.getGbDeviceId(), platforms);
parentPlatformMap.put(deviceChannel.getGbDeviceId(), parentPlatformsForGB); parentPlatformMap.put(deviceChannel.getGbDeviceId(), parentPlatformsForGB);
channelMap.put(deviceChannel.getGbDeviceId(), deviceChannel); channelMap.put(deviceChannel.getGbDeviceId(), deviceChannel);
} }
@ -90,9 +90,9 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> {
} }
}else if (!parentPlatformMap.keySet().isEmpty()) { }else if (!parentPlatformMap.keySet().isEmpty()) {
for (String gbId : parentPlatformMap.keySet()) { for (String gbId : parentPlatformMap.keySet()) {
List<ParentPlatform> parentPlatforms = parentPlatformMap.get(gbId); List<Platform> parentPlatforms = parentPlatformMap.get(gbId);
if (parentPlatforms != null && !parentPlatforms.isEmpty()) { if (parentPlatforms != null && !parentPlatforms.isEmpty()) {
for (ParentPlatform platform : parentPlatforms) { for (Platform platform : parentPlatforms) {
SubscribeInfo subscribeInfo = subscribeHolder.getCatalogSubscribe(platform.getServerGBId()); SubscribeInfo subscribeInfo = subscribeHolder.getCatalogSubscribe(platform.getServerGBId());
if (subscribeInfo == null) { if (subscribeInfo == null) {
continue; continue;
@ -135,9 +135,9 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> {
} }
}else if (!parentPlatformMap.keySet().isEmpty()) { }else if (!parentPlatformMap.keySet().isEmpty()) {
for (String gbId : parentPlatformMap.keySet()) { for (String gbId : parentPlatformMap.keySet()) {
List<ParentPlatform> parentPlatforms = parentPlatformMap.get(gbId); List<Platform> parentPlatforms = parentPlatformMap.get(gbId);
if (parentPlatforms != null && !parentPlatforms.isEmpty()) { if (parentPlatforms != null && !parentPlatforms.isEmpty()) {
for (ParentPlatform platform : parentPlatforms) { for (Platform platform : parentPlatforms) {
SubscribeInfo subscribeInfo = subscribeHolder.getCatalogSubscribe(platform.getServerGBId()); SubscribeInfo subscribeInfo = subscribeHolder.getCatalogSubscribe(platform.getServerGBId());
if (subscribeInfo == null) { if (subscribeInfo == null) {
continue; continue;

View File

@ -1,6 +1,6 @@
package com.genersoft.iot.vmp.gb28181.event.subscribe.mobilePosition; package com.genersoft.iot.vmp.gb28181.event.subscribe.mobilePosition;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder; import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder;
import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo; import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform;
@ -39,9 +39,9 @@ public class MobilePositionEventLister implements ApplicationListener<MobilePosi
if (platforms.isEmpty()) { if (platforms.isEmpty()) {
return; return;
} }
List<ParentPlatform> parentPlatformsForGB = storager.queryPlatFormListForGBWithGBId(event.getMobilePosition().getChannelId(), platforms); List<Platform> parentPlatformsForGB = storager.queryPlatFormListForGBWithGBId(event.getMobilePosition().getChannelId(), platforms);
for (ParentPlatform platform : parentPlatformsForGB) { for (Platform platform : parentPlatformsForGB) {
log.info("[向上级发送MobilePosition] 通道:{},平台:{} 位置: {}:{}", event.getMobilePosition().getChannelId(), log.info("[向上级发送MobilePosition] 通道:{},平台:{} 位置: {}:{}", event.getMobilePosition().getChannelId(),
platform.getServerGBId(), event.getMobilePosition().getLongitude(), event.getMobilePosition().getLatitude()); platform.getServerGBId(), event.getMobilePosition().getLongitude(), event.getMobilePosition().getLatitude());
SubscribeInfo subscribe = subscribeHolder.getMobilePositionSubscribe(platform.getServerGBId()); SubscribeInfo subscribe = subscribeHolder.getMobilePositionSubscribe(platform.getServerGBId());

View File

@ -30,7 +30,7 @@ public interface IGbChannelService {
void updateStatus(List<CommonGBChannel> channelList); void updateStatus(List<CommonGBChannel> channelList);
List<CommonGBChannel> queryByPlatformId(Integer platformId); List<CommonGBChannel> queryByPlatform(Platform platform);
CommonGBChannel getOne(int id); CommonGBChannel getOne(int id);

View File

@ -1,7 +1,7 @@
package com.genersoft.iot.vmp.gb28181.service; package com.genersoft.iot.vmp.gb28181.service;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
import com.genersoft.iot.vmp.media.event.hook.HookSubscribe; import com.genersoft.iot.vmp.media.event.hook.HookSubscribe;
import com.genersoft.iot.vmp.media.bean.MediaServer; import com.genersoft.iot.vmp.media.bean.MediaServer;
@ -19,7 +19,7 @@ import java.text.ParseException;
*/ */
public interface IPlatformService { public interface IPlatformService {
ParentPlatform queryPlatformByServerGBId(String platformGbId); Platform queryPlatformByServerGBId(String platformGbId);
/** /**
* 分页获取上级平台 * 分页获取上级平台
@ -27,37 +27,37 @@ public interface IPlatformService {
* @param count * @param count
* @return * @return
*/ */
PageInfo<ParentPlatform> queryParentPlatformList(int page, int count); PageInfo<Platform> queryParentPlatformList(int page, int count);
/** /**
* 添加级联平台 * 添加级联平台
* @param parentPlatform 级联平台 * @param parentPlatform 级联平台
*/ */
boolean add(ParentPlatform parentPlatform); boolean add(Platform parentPlatform);
/** /**
* 添加级联平台 * 添加级联平台
* @param parentPlatform 级联平台 * @param parentPlatform 级联平台
*/ */
boolean update(ParentPlatform parentPlatform); boolean update(Platform parentPlatform);
/** /**
* 平台上线 * 平台上线
* @param parentPlatform 平台信息 * @param parentPlatform 平台信息
*/ */
void online(ParentPlatform parentPlatform, SipTransactionInfo sipTransactionInfo); void online(Platform parentPlatform, SipTransactionInfo sipTransactionInfo);
/** /**
* 平台离线 * 平台离线
* @param parentPlatform 平台信息 * @param parentPlatform 平台信息
*/ */
void offline(ParentPlatform parentPlatform, boolean stopRegisterTask); void offline(Platform parentPlatform, boolean stopRegisterTask);
/** /**
* 向上级平台发起注册 * 向上级平台发起注册
* @param parentPlatform * @param parentPlatform
*/ */
void login(ParentPlatform parentPlatform); void login(Platform parentPlatform);
/** /**
* 向上级平台发送位置订阅 * 向上级平台发送位置订阅
@ -73,15 +73,15 @@ public interface IPlatformService {
* @param errorEvent 信令错误事件 * @param errorEvent 信令错误事件
* @param timeoutCallback 超时事件 * @param timeoutCallback 超时事件
*/ */
void broadcastInvite(ParentPlatform platform, String channelId, MediaServer mediaServerItem, HookSubscribe.Event hookEvent, void broadcastInvite(Platform platform, String channelId, MediaServer mediaServerItem, HookSubscribe.Event hookEvent,
SipSubscribe.Event errorEvent, InviteTimeOutCallback timeoutCallback) throws InvalidArgumentException, ParseException, SipException; SipSubscribe.Event errorEvent, InviteTimeOutCallback timeoutCallback) throws InvalidArgumentException, ParseException, SipException;
/** /**
* 语音喊话回复BYE * 语音喊话回复BYE
*/ */
void stopBroadcast(ParentPlatform platform, DeviceChannel channel, String stream,boolean sendBye, MediaServer mediaServerItem); void stopBroadcast(Platform platform, DeviceChannel channel, String stream, boolean sendBye, MediaServer mediaServerItem);
void addSimulatedSubscribeInfo(ParentPlatform parentPlatform); void addSimulatedSubscribeInfo(Platform parentPlatform);
ParentPlatform queryOne(Integer platformId); Platform queryOne(Integer platformId);
} }

View File

@ -3,7 +3,7 @@ package com.genersoft.iot.vmp.gb28181.service;
import com.genersoft.iot.vmp.common.StreamInfo; import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.conf.exception.ServiceException; import com.genersoft.iot.vmp.conf.exception.ServiceException;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem; import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.media.bean.MediaInfo; import com.genersoft.iot.vmp.media.bean.MediaInfo;
@ -55,9 +55,9 @@ public interface IPlayService {
void resumeRtp(String streamId) throws ServiceException, InvalidArgumentException, ParseException, SipException; void resumeRtp(String streamId) throws ServiceException, InvalidArgumentException, ParseException, SipException;
void startPushStream(SendRtpItem sendRtpItem, SIPResponse sipResponse, ParentPlatform platform, CallIdHeader callIdHeader); void startPushStream(SendRtpItem sendRtpItem, SIPResponse sipResponse, Platform platform, CallIdHeader callIdHeader);
void startSendRtpStreamFailHand(SendRtpItem sendRtpItem,ParentPlatform platform, CallIdHeader callIdHeader); void startSendRtpStreamFailHand(SendRtpItem sendRtpItem, Platform platform, CallIdHeader callIdHeader);
void talkCmd(Device device, String channelId, MediaServer mediaServerItem, String stream, AudioBroadcastEvent event); void talkCmd(Device device, String channelId, MediaServer mediaServerItem, String stream, AudioBroadcastEvent event);

View File

@ -299,10 +299,35 @@ public class GbChannelServiceImpl implements IGbChannelService {
} }
@Override @Override
public List<CommonGBChannel> queryByPlatformId(Integer platformId) { public List<CommonGBChannel> queryByPlatform(Platform platform) {
return commonGBChannelMapper.queryByPlatformId(platformId); if (platform == null) {
return null;
}
List<CommonGBChannel> commonGBChannelList = commonGBChannelMapper.queryWithPlatform(platform.getId());
if (commonGBChannelList.isEmpty()) {
return new ArrayList<>();
}
List<CommonGBChannel> channelList = new ArrayList<>();
// 是否包含平台信息
if (platform.getCatalogWithPlatform()) {
CommonGBChannel channel = CommonGBChannel.build(platform);
channelList.add(channel);
}
// 是否包含行政区划信息
if (platform.getCatalogWithRegion()) {
}
// 是否包含分组信息
if (platform.getCatalogWithGroup()) {
}
return channelList;
} }
@Override @Override
public CommonGBChannel getOne(int id) { public CommonGBChannel getOne(int id) {
return commonGBChannelMapper.queryById(id); return commonGBChannelMapper.queryById(id);

View File

@ -6,7 +6,7 @@ import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent; import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
import com.genersoft.iot.vmp.gb28181.service.IPlatformChannelService; import com.genersoft.iot.vmp.gb28181.service.IPlatformChannelService;
import com.genersoft.iot.vmp.gb28181.dao.DeviceChannelMapper; import com.genersoft.iot.vmp.gb28181.dao.DeviceChannelMapper;
import com.genersoft.iot.vmp.gb28181.dao.ParentPlatformMapper; import com.genersoft.iot.vmp.gb28181.dao.PlatformMapper;
import com.genersoft.iot.vmp.gb28181.dao.PlatformCatalogMapper; import com.genersoft.iot.vmp.gb28181.dao.PlatformCatalogMapper;
import com.genersoft.iot.vmp.gb28181.dao.PlatformChannelMapper; import com.genersoft.iot.vmp.gb28181.dao.PlatformChannelMapper;
import com.genersoft.iot.vmp.gb28181.controller.bean.ChannelReduce; import com.genersoft.iot.vmp.gb28181.controller.bean.ChannelReduce;
@ -51,14 +51,14 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
private PlatformCatalogMapper catalogManager; private PlatformCatalogMapper catalogManager;
@Autowired @Autowired
private ParentPlatformMapper platformMapper; private PlatformMapper platformMapper;
@Autowired @Autowired
EventPublisher eventPublisher; EventPublisher eventPublisher;
@Override @Override
public int updateChannelForGB(String platformId, List<ChannelReduce> channelReduces, String catalogId) { public int updateChannelForGB(String platformId, List<ChannelReduce> channelReduces, String catalogId) {
ParentPlatform platform = platformMapper.getParentPlatByServerGBId(platformId); Platform platform = platformMapper.getParentPlatByServerGBId(platformId);
if (platform == null) { if (platform == null) {
log.warn("更新级联通道信息时未找到平台{}的信息", platformId); log.warn("更新级联通道信息时未找到平台{}的信息", platformId);
return 0; return 0;
@ -122,7 +122,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
return allCount; return allCount;
} }
private List<CommonGBChannel> getDeviceChannelListByChannelReduceList(List<ChannelReduce> channelReduces, String catalogId, ParentPlatform platform) { private List<CommonGBChannel> getDeviceChannelListByChannelReduceList(List<ChannelReduce> channelReduces, String catalogId, Platform platform) {
List<CommonGBChannel> deviceChannelList = new ArrayList<>(); List<CommonGBChannel> deviceChannelList = new ArrayList<>();
if (!channelReduces.isEmpty()){ if (!channelReduces.isEmpty()){
PlatformCatalog catalog = catalogManager.selectByPlatFormAndCatalogId(platform.getServerGBId(),catalogId); PlatformCatalog catalog = catalogManager.selectByPlatFormAndCatalogId(platform.getServerGBId(),catalogId);
@ -157,7 +157,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
if (platformId == null) { if (platformId == null) {
return 0; return 0;
} }
ParentPlatform platform = platformMapper.getParentPlatByServerGBId(platformId); Platform platform = platformMapper.getParentPlatByServerGBId(platformId);
if (platform == null) { if (platform == null) {
return 0; return 0;
} }

View File

@ -25,7 +25,7 @@ import com.genersoft.iot.vmp.gb28181.service.IPlayService;
import com.genersoft.iot.vmp.service.bean.*; import com.genersoft.iot.vmp.service.bean.*;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.dao.GbStreamMapper; import com.genersoft.iot.vmp.storager.dao.GbStreamMapper;
import com.genersoft.iot.vmp.gb28181.dao.ParentPlatformMapper; import com.genersoft.iot.vmp.gb28181.dao.PlatformMapper;
import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.utils.DateUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
@ -59,7 +59,7 @@ public class PlatformServiceImpl implements IPlatformService {
private final static String KEEPALIVE_KEY_PREFIX = "platform_keepalive_"; private final static String KEEPALIVE_KEY_PREFIX = "platform_keepalive_";
@Autowired @Autowired
private ParentPlatformMapper platformMapper; private PlatformMapper platformMapper;
@Autowired @Autowired
private IRedisCatchStorage redisCatchStorage; private IRedisCatchStorage redisCatchStorage;
@ -106,7 +106,7 @@ public class PlatformServiceImpl implements IPlatformService {
for (SendRtpItem sendRtpItem : sendRtpItems) { for (SendRtpItem sendRtpItem : sendRtpItems) {
if (sendRtpItem != null && sendRtpItem.getApp().equals(event.getApp())) { if (sendRtpItem != null && sendRtpItem.getApp().equals(event.getApp())) {
String platformId = sendRtpItem.getPlatformId(); String platformId = sendRtpItem.getPlatformId();
ParentPlatform platform = platformMapper.getParentPlatByServerGBId(platformId); Platform platform = platformMapper.getParentPlatByServerGBId(platformId);
try { try {
if (platform != null) { if (platform != null) {
@ -132,7 +132,7 @@ public class PlatformServiceImpl implements IPlatformService {
List<SendRtpItem> sendRtpItems = redisCatchStorage.querySendRTPServerByStream(event.getStream()); List<SendRtpItem> sendRtpItems = redisCatchStorage.querySendRTPServerByStream(event.getStream());
if (sendRtpItems != null && !sendRtpItems.isEmpty()) { if (sendRtpItems != null && !sendRtpItems.isEmpty()) {
for (SendRtpItem sendRtpItem : sendRtpItems) { for (SendRtpItem sendRtpItem : sendRtpItems) {
ParentPlatform parentPlatform = platformMapper.getParentPlatByServerGBId(sendRtpItem.getPlatformId()); Platform parentPlatform = platformMapper.getParentPlatByServerGBId(sendRtpItem.getPlatformId());
ssrcFactory.releaseSsrc(sendRtpItem.getMediaServerId(), sendRtpItem.getSsrc()); ssrcFactory.releaseSsrc(sendRtpItem.getMediaServerId(), sendRtpItem.getSsrc());
try { try {
commanderForPlatform.streamByeCmd(parentPlatform, sendRtpItem.getCallId()); commanderForPlatform.streamByeCmd(parentPlatform, sendRtpItem.getCallId());
@ -147,19 +147,19 @@ public class PlatformServiceImpl implements IPlatformService {
@Override @Override
public ParentPlatform queryPlatformByServerGBId(String platformGbId) { public Platform queryPlatformByServerGBId(String platformGbId) {
return platformMapper.getParentPlatByServerGBId(platformGbId); return platformMapper.getParentPlatByServerGBId(platformGbId);
} }
@Override @Override
public PageInfo<ParentPlatform> queryParentPlatformList(int page, int count) { public PageInfo<Platform> queryParentPlatformList(int page, int count) {
PageHelper.startPage(page, count); PageHelper.startPage(page, count);
List<ParentPlatform> all = platformMapper.getParentPlatformList(); List<Platform> all = platformMapper.getParentPlatformList();
return new PageInfo<>(all); return new PageInfo<>(all);
} }
@Override @Override
public boolean add(ParentPlatform parentPlatform) { public boolean add(Platform parentPlatform) {
if (parentPlatform.getCatalogGroup() == 0) { if (parentPlatform.getCatalogGroup() == 0) {
// 每次发送目录的数量默认为1 // 每次发送目录的数量默认为1
@ -168,7 +168,7 @@ public class PlatformServiceImpl implements IPlatformService {
parentPlatform.setCatalogId(parentPlatform.getDeviceGBId()); parentPlatform.setCatalogId(parentPlatform.getDeviceGBId());
int result = platformMapper.addParentPlatform(parentPlatform); int result = platformMapper.addParentPlatform(parentPlatform);
// 添加缓存 // 添加缓存
ParentPlatformCatch parentPlatformCatch = new ParentPlatformCatch(); PlatformCatch parentPlatformCatch = new PlatformCatch();
parentPlatformCatch.setParentPlatform(parentPlatform); parentPlatformCatch.setParentPlatform(parentPlatform);
parentPlatformCatch.setId(parentPlatform.getServerGBId()); parentPlatformCatch.setId(parentPlatform.getServerGBId());
parentPlatformCatch.setParentPlatform(parentPlatform); parentPlatformCatch.setParentPlatform(parentPlatform);
@ -188,11 +188,11 @@ public class PlatformServiceImpl implements IPlatformService {
} }
@Override @Override
public boolean update(ParentPlatform parentPlatform) { public boolean update(Platform parentPlatform) {
log.info("[国标级联]更新平台 {}", parentPlatform.getDeviceGBId()); log.info("[国标级联]更新平台 {}", parentPlatform.getDeviceGBId());
parentPlatform.setCharacterSet(parentPlatform.getCharacterSet().toUpperCase()); parentPlatform.setCharacterSet(parentPlatform.getCharacterSet().toUpperCase());
ParentPlatform parentPlatformOld = platformMapper.getParentPlatById(parentPlatform.getId()); Platform parentPlatformOld = platformMapper.getParentPlatById(parentPlatform.getId());
ParentPlatformCatch parentPlatformCatchOld = redisCatchStorage.queryPlatformCatchInfo(parentPlatformOld.getServerGBId()); PlatformCatch parentPlatformCatchOld = redisCatchStorage.queryPlatformCatchInfo(parentPlatformOld.getServerGBId());
parentPlatform.setUpdateTime(DateUtil.getNow()); parentPlatform.setUpdateTime(DateUtil.getNow());
// 停止心跳定时 // 停止心跳定时
@ -221,7 +221,7 @@ public class PlatformServiceImpl implements IPlatformService {
platformMapper.updateParentPlatform(parentPlatform); platformMapper.updateParentPlatform(parentPlatform);
// 更新redis // 更新redis
redisCatchStorage.delPlatformCatchInfo(parentPlatformOld.getServerGBId()); redisCatchStorage.delPlatformCatchInfo(parentPlatformOld.getServerGBId());
ParentPlatformCatch parentPlatformCatch = new ParentPlatformCatch(); PlatformCatch parentPlatformCatch = new PlatformCatch();
parentPlatformCatch.setParentPlatform(parentPlatform); parentPlatformCatch.setParentPlatform(parentPlatform);
parentPlatformCatch.setId(parentPlatform.getServerGBId()); parentPlatformCatch.setId(parentPlatform.getServerGBId());
redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch); redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
@ -245,15 +245,15 @@ public class PlatformServiceImpl implements IPlatformService {
@Override @Override
public void online(ParentPlatform parentPlatform, SipTransactionInfo sipTransactionInfo) { public void online(Platform parentPlatform, SipTransactionInfo sipTransactionInfo) {
log.info("[国标级联]{}, 平台上线", parentPlatform.getServerGBId()); log.info("[国标级联]{}, 平台上线", parentPlatform.getServerGBId());
final String registerFailAgainTaskKey = REGISTER_FAIL_AGAIN_KEY_PREFIX + parentPlatform.getServerGBId(); final String registerFailAgainTaskKey = REGISTER_FAIL_AGAIN_KEY_PREFIX + parentPlatform.getServerGBId();
dynamicTask.stop(registerFailAgainTaskKey); dynamicTask.stop(registerFailAgainTaskKey);
platformMapper.updateParentPlatformStatus(parentPlatform.getServerGBId(), true); platformMapper.updateParentPlatformStatus(parentPlatform.getServerGBId(), true);
ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId());
if (parentPlatformCatch == null) { if (parentPlatformCatch == null) {
parentPlatformCatch = new ParentPlatformCatch(); parentPlatformCatch = new PlatformCatch();
parentPlatformCatch.setParentPlatform(parentPlatform); parentPlatformCatch.setParentPlatform(parentPlatform);
parentPlatformCatch.setId(parentPlatform.getServerGBId()); parentPlatformCatch.setId(parentPlatform.getServerGBId());
parentPlatform.setStatus(true); parentPlatform.setStatus(true);
@ -288,7 +288,7 @@ public class PlatformServiceImpl implements IPlatformService {
log.warn("[国标级联]发送心跳收到错误code {}, msg: {}", eventResult.statusCode, eventResult.msg); log.warn("[国标级联]发送心跳收到错误code {}, msg: {}", eventResult.statusCode, eventResult.msg);
} }
// 心跳失败 // 心跳失败
ParentPlatformCatch platformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); PlatformCatch platformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId());
// 此时是第三次心跳超时 平台离线 // 此时是第三次心跳超时 平台离线
if (platformCatch.getKeepAliveReply() == 2) { if (platformCatch.getKeepAliveReply() == 2) {
// 设置平台离线并重新注册 // 设置平台离线并重新注册
@ -302,7 +302,7 @@ public class PlatformServiceImpl implements IPlatformService {
}, eventResult -> { }, eventResult -> {
// 心跳成功 // 心跳成功
// 清空之前的心跳超时计数 // 清空之前的心跳超时计数
ParentPlatformCatch platformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); PlatformCatch platformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId());
if (platformCatch != null && platformCatch.getKeepAliveReply() > 0) { if (platformCatch != null && platformCatch.getKeepAliveReply() > 0) {
platformCatch.setKeepAliveReply(0); platformCatch.setKeepAliveReply(0);
redisCatchStorage.updatePlatformCatchInfo(platformCatch); redisCatchStorage.updatePlatformCatchInfo(platformCatch);
@ -329,7 +329,7 @@ public class PlatformServiceImpl implements IPlatformService {
} }
@Override @Override
public void addSimulatedSubscribeInfo(ParentPlatform parentPlatform) { public void addSimulatedSubscribeInfo(Platform parentPlatform) {
// 自动添加一条模拟的订阅信息 // 自动添加一条模拟的订阅信息
SubscribeInfo subscribeInfo = new SubscribeInfo(); SubscribeInfo subscribeInfo = new SubscribeInfo();
subscribeInfo.setId(parentPlatform.getServerGBId()); subscribeInfo.setId(parentPlatform.getServerGBId());
@ -343,7 +343,7 @@ public class PlatformServiceImpl implements IPlatformService {
subscribeHolder.putCatalogSubscribe(parentPlatform.getServerGBId(), subscribeInfo); subscribeHolder.putCatalogSubscribe(parentPlatform.getServerGBId(), subscribeInfo);
} }
private void registerTask(ParentPlatform parentPlatform, SipTransactionInfo sipTransactionInfo){ private void registerTask(Platform parentPlatform, SipTransactionInfo sipTransactionInfo){
try { try {
// 不在同一个会话中续订则每次全新注册 // 不在同一个会话中续订则每次全新注册
if (!userSetting.isRegisterKeepIntDialog()) { if (!userSetting.isRegisterKeepIntDialog()) {
@ -367,12 +367,12 @@ public class PlatformServiceImpl implements IPlatformService {
} }
@Override @Override
public void offline(ParentPlatform parentPlatform, boolean stopRegister) { public void offline(Platform parentPlatform, boolean stopRegister) {
log.info("[平台离线]{}", parentPlatform.getServerGBId()); log.info("[平台离线]{}", parentPlatform.getServerGBId());
ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId());
parentPlatformCatch.setKeepAliveReply(0); parentPlatformCatch.setKeepAliveReply(0);
parentPlatformCatch.setRegisterAliveReply(0); parentPlatformCatch.setRegisterAliveReply(0);
ParentPlatform parentPlatformInCatch = parentPlatformCatch.getParentPlatform(); Platform parentPlatformInCatch = parentPlatformCatch.getParentPlatform();
parentPlatformInCatch.setStatus(false); parentPlatformInCatch.setStatus(false);
parentPlatformCatch.setParentPlatform(parentPlatformInCatch); parentPlatformCatch.setParentPlatform(parentPlatformInCatch);
redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch); redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
@ -409,7 +409,7 @@ public class PlatformServiceImpl implements IPlatformService {
if (!stopRegister) { if (!stopRegister) {
// 设置为60秒自动尝试重新注册 // 设置为60秒自动尝试重新注册
final String registerFailAgainTaskKey = REGISTER_FAIL_AGAIN_KEY_PREFIX + parentPlatform.getServerGBId(); final String registerFailAgainTaskKey = REGISTER_FAIL_AGAIN_KEY_PREFIX + parentPlatform.getServerGBId();
ParentPlatform platform = platformMapper.getParentPlatById(parentPlatform.getId()); Platform platform = platformMapper.getParentPlatById(parentPlatform.getId());
if (platform.isEnable()) { if (platform.isEnable()) {
dynamicTask.startCron(registerFailAgainTaskKey, dynamicTask.startCron(registerFailAgainTaskKey,
()-> registerTask(platform, null), ()-> registerTask(platform, null),
@ -431,7 +431,7 @@ public class PlatformServiceImpl implements IPlatformService {
} }
@Override @Override
public void login(ParentPlatform parentPlatform) { public void login(Platform parentPlatform) {
final String registerTaskKey = REGISTER_KEY_PREFIX + parentPlatform.getServerGBId(); final String registerTaskKey = REGISTER_KEY_PREFIX + parentPlatform.getServerGBId();
try { try {
commanderForPlatform.register(parentPlatform, eventResult1 -> { commanderForPlatform.register(parentPlatform, eventResult1 -> {
@ -449,7 +449,7 @@ public class PlatformServiceImpl implements IPlatformService {
@Override @Override
public void sendNotifyMobilePosition(String platformId) { public void sendNotifyMobilePosition(String platformId) {
ParentPlatform platform = platformMapper.getParentPlatByServerGBId(platformId); Platform platform = platformMapper.getParentPlatByServerGBId(platformId);
if (platform == null) { if (platform == null) {
return; return;
} }
@ -483,7 +483,7 @@ public class PlatformServiceImpl implements IPlatformService {
} }
@Override @Override
public void broadcastInvite(ParentPlatform platform, String channelId, MediaServer mediaServerItem, HookSubscribe.Event hookEvent, public void broadcastInvite(Platform platform, String channelId, MediaServer mediaServerItem, HookSubscribe.Event hookEvent,
SipSubscribe.Event errorEvent, InviteTimeOutCallback timeoutCallback) throws InvalidArgumentException, ParseException, SipException { SipSubscribe.Event errorEvent, InviteTimeOutCallback timeoutCallback) throws InvalidArgumentException, ParseException, SipException {
if (mediaServerItem == null) { if (mediaServerItem == null) {
@ -625,7 +625,7 @@ public class PlatformServiceImpl implements IPlatformService {
} }
private void inviteOKHandler(SipSubscribe.EventResult eventResult, SSRCInfo ssrcInfo, int tcpMode, boolean ssrcCheck, MediaServer mediaServerItem, private void inviteOKHandler(SipSubscribe.EventResult eventResult, SSRCInfo ssrcInfo, int tcpMode, boolean ssrcCheck, MediaServer mediaServerItem,
ParentPlatform platform, String channelId, String timeOutTaskKey, ErrorCallback<Object> callback, Platform platform, String channelId, String timeOutTaskKey, ErrorCallback<Object> callback,
InviteInfo inviteInfo, InviteSessionType inviteSessionType){ InviteInfo inviteInfo, InviteSessionType inviteSessionType){
inviteInfo.setStatus(InviteSessionStatus.ok); inviteInfo.setStatus(InviteSessionStatus.ok);
ResponseEvent responseEvent = (ResponseEvent) eventResult.event; ResponseEvent responseEvent = (ResponseEvent) eventResult.event;
@ -727,7 +727,7 @@ public class PlatformServiceImpl implements IPlatformService {
} }
private void tcpActiveHandler(ParentPlatform platform, String channelId, String contentString, private void tcpActiveHandler(Platform platform, String channelId, String contentString,
MediaServer mediaServerItem, int tcpMode, boolean ssrcCheck, MediaServer mediaServerItem, int tcpMode, boolean ssrcCheck,
String timeOutTaskKey, SSRCInfo ssrcInfo, ErrorCallback<Object> callback){ String timeOutTaskKey, SSRCInfo ssrcInfo, ErrorCallback<Object> callback){
if (tcpMode != 2) { if (tcpMode != 2) {
@ -776,7 +776,7 @@ public class PlatformServiceImpl implements IPlatformService {
} }
@Override @Override
public void stopBroadcast(ParentPlatform platform, DeviceChannel channel, String stream, boolean sendBye, MediaServer mediaServerItem) { public void stopBroadcast(Platform platform, DeviceChannel channel, String stream, boolean sendBye, MediaServer mediaServerItem) {
try { try {
if (sendBye) { if (sendBye) {
@ -797,7 +797,7 @@ public class PlatformServiceImpl implements IPlatformService {
} }
@Override @Override
public ParentPlatform queryOne(Integer platformId) { public Platform queryOne(Integer platformId) {
return platformMapper.getParentPlatById(platformId); return platformMapper.getParentPlatById(platformId);
} }
} }

View File

@ -1155,7 +1155,7 @@ public class PlayServiceImpl implements IPlayService {
if (sendRtpItems.size() > 0) { if (sendRtpItems.size() > 0) {
for (SendRtpItem sendRtpItem : sendRtpItems) { for (SendRtpItem sendRtpItem : sendRtpItems) {
if (sendRtpItem.getMediaServerId().equals(mediaServerId)) { if (sendRtpItem.getMediaServerId().equals(mediaServerId)) {
ParentPlatform platform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId()); Platform platform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId());
try { try {
sipCommanderFroPlatform.streamByeCmd(platform, sendRtpItem.getCallId()); sipCommanderFroPlatform.streamByeCmd(platform, sendRtpItem.getCallId());
} catch (SipException | InvalidArgumentException | ParseException e) { } catch (SipException | InvalidArgumentException | ParseException e) {
@ -1423,7 +1423,7 @@ public class PlayServiceImpl implements IPlayService {
} }
@Override @Override
public void startPushStream(SendRtpItem sendRtpItem, SIPResponse sipResponse, ParentPlatform platform, CallIdHeader callIdHeader) { public void startPushStream(SendRtpItem sendRtpItem, SIPResponse sipResponse, Platform platform, CallIdHeader callIdHeader) {
// 开始发流 // 开始发流
MediaServer mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId()); MediaServer mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId());
@ -1448,7 +1448,7 @@ public class PlayServiceImpl implements IPlayService {
} }
@Override @Override
public void startSendRtpStreamFailHand(SendRtpItem sendRtpItem, ParentPlatform platform, CallIdHeader callIdHeader) { public void startSendRtpStreamFailHand(SendRtpItem sendRtpItem, Platform platform, CallIdHeader callIdHeader) {
if (sendRtpItem.isOnlyAudio()) { if (sendRtpItem.isOnlyAudio()) {
Device device = deviceService.getDevice(sendRtpItem.getDeviceId()); Device device = deviceService.getDevice(sendRtpItem.getDeviceId());
AudioBroadcastCatch audioBroadcastCatch = audioBroadcastManager.get(sendRtpItem.getDeviceId(), sendRtpItem.getChannelId()); AudioBroadcastCatch audioBroadcastCatch = audioBroadcastManager.get(sendRtpItem.getDeviceId(), sendRtpItem.getChannelId());

View File

@ -1,7 +1,7 @@
package com.genersoft.iot.vmp.gb28181.task; package com.genersoft.iot.vmp.gb28181.task;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem; import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
import com.genersoft.iot.vmp.gb28181.session.SSRCFactory; import com.genersoft.iot.vmp.gb28181.session.SSRCFactory;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
@ -95,7 +95,7 @@ public class SipRunner implements CommandLineRunner {
ssrcFactory.releaseSsrc(sendRtpItem.getMediaServerId(), sendRtpItem.getSsrc()); ssrcFactory.releaseSsrc(sendRtpItem.getMediaServerId(), sendRtpItem.getSsrc());
boolean stopResult = mediaServerService.initStopSendRtp(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getSsrc()); boolean stopResult = mediaServerService.initStopSendRtp(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getSsrc());
if (stopResult) { if (stopResult) {
ParentPlatform platform = platformService.queryPlatformByServerGBId(sendRtpItem.getPlatformId()); Platform platform = platformService.queryPlatformByServerGBId(sendRtpItem.getPlatformId());
if (platform != null) { if (platform != null) {
try { try {
commanderForPlatform.streamByeCmd(platform, sendRtpItem.getCallId()); commanderForPlatform.streamByeCmd(platform, sendRtpItem.getCallId());

View File

@ -22,12 +22,12 @@ public interface ISIPCommanderForPlatform {
* @param parentPlatform * @param parentPlatform
* @return * @return
*/ */
void register(ParentPlatform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException; void register(Platform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException;
void register(ParentPlatform parentPlatform, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException; void register(Platform parentPlatform, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException;
void register(ParentPlatform parentPlatform, SipTransactionInfo sipTransactionInfo, WWWAuthenticateHeader www, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent, boolean isRegister) throws SipException, InvalidArgumentException, ParseException; void register(Platform parentPlatform, SipTransactionInfo sipTransactionInfo, WWWAuthenticateHeader www, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent, boolean isRegister) throws SipException, InvalidArgumentException, ParseException;
/** /**
* 向上级平台注销 * 向上级平台注销
@ -35,7 +35,7 @@ public interface ISIPCommanderForPlatform {
* @param parentPlatform * @param parentPlatform
* @return * @return
*/ */
void unregister(ParentPlatform parentPlatform, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException; void unregister(Platform parentPlatform, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException;
/** /**
@ -44,7 +44,7 @@ public interface ISIPCommanderForPlatform {
* @param parentPlatform * @param parentPlatform
* @return callId(作为接受回复的判定) * @return callId(作为接受回复的判定)
*/ */
String keepalive(ParentPlatform parentPlatform, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) String keepalive(Platform parentPlatform, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent)
throws SipException, InvalidArgumentException, ParseException; throws SipException, InvalidArgumentException, ParseException;
@ -58,10 +58,10 @@ public interface ISIPCommanderForPlatform {
* @param size * @param size
* @return * @return
*/ */
void catalogQuery(CommonGBChannel channel, ParentPlatform parentPlatform, String sn, String fromTag, int size) void catalogQuery(CommonGBChannel channel, Platform parentPlatform, String sn, String fromTag, int size)
throws SipException, InvalidArgumentException, ParseException; throws SipException, InvalidArgumentException, ParseException;
void catalogQuery(List<CommonGBChannel> channels, ParentPlatform parentPlatform, String sn, String fromTag) void catalogQuery(List<CommonGBChannel> channels, Platform parentPlatform, String sn, String fromTag)
throws InvalidArgumentException, ParseException, SipException; throws InvalidArgumentException, ParseException, SipException;
/** /**
@ -72,7 +72,7 @@ public interface ISIPCommanderForPlatform {
* @param fromTag FROM头的tag信息 * @param fromTag FROM头的tag信息
* @return * @return
*/ */
void deviceInfoResponse(ParentPlatform parentPlatform,Device device, String sn, String fromTag) throws SipException, InvalidArgumentException, ParseException; void deviceInfoResponse(Platform parentPlatform, Device device, String sn, String fromTag) throws SipException, InvalidArgumentException, ParseException;
/** /**
* 向上级回复DeviceStatus查询信息 * 向上级回复DeviceStatus查询信息
@ -82,7 +82,7 @@ public interface ISIPCommanderForPlatform {
* @param fromTag * @param fromTag
* @return * @return
*/ */
void deviceStatusResponse(ParentPlatform parentPlatform,String channelId, String sn, String fromTag,boolean status) throws SipException, InvalidArgumentException, ParseException; void deviceStatusResponse(Platform parentPlatform, String channelId, String sn, String fromTag, boolean status) throws SipException, InvalidArgumentException, ParseException;
/** /**
* 向上级回复移动位置订阅消息 * 向上级回复移动位置订阅消息
@ -92,7 +92,7 @@ public interface ISIPCommanderForPlatform {
* @param subscribeInfo 订阅相关的信息 * @param subscribeInfo 订阅相关的信息
* @return * @return
*/ */
void sendNotifyMobilePosition(ParentPlatform parentPlatform, GPSMsgInfo gpsMsgInfo, SubscribeInfo subscribeInfo) void sendNotifyMobilePosition(Platform parentPlatform, GPSMsgInfo gpsMsgInfo, SubscribeInfo subscribeInfo)
throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException; throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException;
/** /**
@ -102,7 +102,7 @@ public interface ISIPCommanderForPlatform {
* @param deviceAlarm 报警信息信息 * @param deviceAlarm 报警信息信息
* @return * @return
*/ */
void sendAlarmMessage(ParentPlatform parentPlatform, DeviceAlarm deviceAlarm) throws SipException, InvalidArgumentException, ParseException; void sendAlarmMessage(Platform parentPlatform, DeviceAlarm deviceAlarm) throws SipException, InvalidArgumentException, ParseException;
/** /**
* 回复catalog事件-增加/更新 * 回复catalog事件-增加/更新
@ -110,7 +110,7 @@ public interface ISIPCommanderForPlatform {
* @param parentPlatform * @param parentPlatform
* @param deviceChannels * @param deviceChannels
*/ */
void sendNotifyForCatalogAddOrUpdate(String type, ParentPlatform parentPlatform, List<CommonGBChannel> deviceChannels, SubscribeInfo subscribeInfo, Integer index) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException; void sendNotifyForCatalogAddOrUpdate(String type, Platform parentPlatform, List<CommonGBChannel> deviceChannels, SubscribeInfo subscribeInfo, Integer index) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException;
/** /**
* 回复catalog事件-删除 * 回复catalog事件-删除
@ -118,7 +118,7 @@ public interface ISIPCommanderForPlatform {
* @param parentPlatform * @param parentPlatform
* @param deviceChannels * @param deviceChannels
*/ */
void sendNotifyForCatalogOther(String type, ParentPlatform parentPlatform, List<CommonGBChannel> deviceChannels, void sendNotifyForCatalogOther(String type, Platform parentPlatform, List<CommonGBChannel> deviceChannels,
SubscribeInfo subscribeInfo, Integer index) throws InvalidArgumentException, SubscribeInfo subscribeInfo, Integer index) throws InvalidArgumentException,
ParseException, NoSuchFieldException, SipException, IllegalAccessException; ParseException, NoSuchFieldException, SipException, IllegalAccessException;
@ -130,7 +130,7 @@ public interface ISIPCommanderForPlatform {
* @param fromTag fromTag * @param fromTag fromTag
* @param recordInfo 录像信息 * @param recordInfo 录像信息
*/ */
void recordInfo(CommonGBChannel deviceChannel, ParentPlatform parentPlatform, String fromTag, RecordInfo recordInfo) void recordInfo(CommonGBChannel deviceChannel, Platform parentPlatform, String fromTag, RecordInfo recordInfo)
throws SipException, InvalidArgumentException, ParseException; throws SipException, InvalidArgumentException, ParseException;
/** /**
@ -140,7 +140,7 @@ public interface ISIPCommanderForPlatform {
* @param sendRtpItem * @param sendRtpItem
* @return * @return
*/ */
void sendMediaStatusNotify(ParentPlatform platform, SendRtpItem sendRtpItem) throws SipException, InvalidArgumentException, ParseException; void sendMediaStatusNotify(Platform platform, SendRtpItem sendRtpItem) throws SipException, InvalidArgumentException, ParseException;
/** /**
* 向发起点播的上级回复bye * 向发起点播的上级回复bye
@ -148,15 +148,15 @@ public interface ISIPCommanderForPlatform {
* @param platform 平台信息 * @param platform 平台信息
* @param callId callId * @param callId callId
*/ */
void streamByeCmd(ParentPlatform platform, String callId) throws SipException, InvalidArgumentException, ParseException; void streamByeCmd(Platform platform, String callId) throws SipException, InvalidArgumentException, ParseException;
void streamByeCmd(ParentPlatform platform, SendRtpItem sendRtpItem) throws SipException, InvalidArgumentException, ParseException; void streamByeCmd(Platform platform, SendRtpItem sendRtpItem) throws SipException, InvalidArgumentException, ParseException;
void streamByeCmd(ParentPlatform platform, String channelId, String stream, String callId, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException, SsrcTransactionNotFoundException; void streamByeCmd(Platform platform, String channelId, String stream, String callId, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException, SsrcTransactionNotFoundException;
void broadcastInviteCmd(ParentPlatform platform, String channelId, MediaServer mediaServerItem, void broadcastInviteCmd(Platform platform, String channelId, MediaServer mediaServerItem,
SSRCInfo ssrcInfo, HookSubscribe.Event event, SipSubscribe.Event okEvent, SSRCInfo ssrcInfo, HookSubscribe.Event event, SipSubscribe.Event okEvent,
SipSubscribe.Event errorEvent) throws ParseException, SipException, InvalidArgumentException; SipSubscribe.Event errorEvent) throws ParseException, SipException, InvalidArgumentException;
void broadcastResultCmd(ParentPlatform platform, CommonGBChannel deviceChannel, String sn, boolean result, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException; void broadcastResultCmd(Platform platform, CommonGBChannel deviceChannel, String sn, boolean result, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException;
} }

View File

@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.cmd;
import com.genersoft.iot.vmp.conf.SipConfig; import com.genersoft.iot.vmp.conf.SipConfig;
import com.genersoft.iot.vmp.gb28181.SipLayer; import com.genersoft.iot.vmp.gb28181.SipLayer;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem; import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
import com.genersoft.iot.vmp.gb28181.bean.SipTransactionInfo; import com.genersoft.iot.vmp.gb28181.bean.SipTransactionInfo;
import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo; import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo;
@ -47,7 +47,7 @@ public class SIPRequestHeaderPlarformProvider {
@Autowired @Autowired
private IRedisCatchStorage redisCatchStorage; private IRedisCatchStorage redisCatchStorage;
public Request createRegisterRequest(@NotNull ParentPlatform parentPlatform, long CSeq, String fromTag, String toTag, CallIdHeader callIdHeader, int expires) throws ParseException, InvalidArgumentException, PeerUnavailableException { public Request createRegisterRequest(@NotNull Platform parentPlatform, long CSeq, String fromTag, String toTag, CallIdHeader callIdHeader, int expires) throws ParseException, InvalidArgumentException, PeerUnavailableException {
Request request = null; Request request = null;
String sipAddress = parentPlatform.getDeviceIp() + ":" + parentPlatform.getDevicePort(); String sipAddress = parentPlatform.getDeviceIp() + ":" + parentPlatform.getDevicePort();
//请求行 //请求行
@ -88,8 +88,8 @@ public class SIPRequestHeaderPlarformProvider {
return request; return request;
} }
public Request createRegisterRequest(@NotNull ParentPlatform parentPlatform, String fromTag, String toTag, public Request createRegisterRequest(@NotNull Platform parentPlatform, String fromTag, String toTag,
WWWAuthenticateHeader www , CallIdHeader callIdHeader, int expires) throws ParseException, PeerUnavailableException, InvalidArgumentException { WWWAuthenticateHeader www , CallIdHeader callIdHeader, int expires) throws ParseException, PeerUnavailableException, InvalidArgumentException {
Request registerRequest = createRegisterRequest(parentPlatform, redisCatchStorage.getCSEQ(), fromTag, toTag, callIdHeader, expires); Request registerRequest = createRegisterRequest(parentPlatform, redisCatchStorage.getCSEQ(), fromTag, toTag, callIdHeader, expires);
@ -165,18 +165,18 @@ public class SIPRequestHeaderPlarformProvider {
return registerRequest; return registerRequest;
} }
public Request createMessageRequest(ParentPlatform parentPlatform, String content, SendRtpItem sendRtpItem) throws PeerUnavailableException, ParseException, InvalidArgumentException { public Request createMessageRequest(Platform parentPlatform, String content, SendRtpItem sendRtpItem) throws PeerUnavailableException, ParseException, InvalidArgumentException {
CallIdHeader callIdHeader = SipFactory.getInstance().createHeaderFactory().createCallIdHeader(sendRtpItem.getCallId()); CallIdHeader callIdHeader = SipFactory.getInstance().createHeaderFactory().createCallIdHeader(sendRtpItem.getCallId());
callIdHeader.setCallId(sendRtpItem.getCallId()); callIdHeader.setCallId(sendRtpItem.getCallId());
return createMessageRequest(parentPlatform, content, sendRtpItem.getToTag(), SipUtils.getNewViaTag(), sendRtpItem.getFromTag(), callIdHeader); return createMessageRequest(parentPlatform, content, sendRtpItem.getToTag(), SipUtils.getNewViaTag(), sendRtpItem.getFromTag(), callIdHeader);
} }
public Request createMessageRequest(ParentPlatform parentPlatform, String content, String fromTag, String viaTag, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException { public Request createMessageRequest(Platform parentPlatform, String content, String fromTag, String viaTag, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException {
return createMessageRequest(parentPlatform, content, fromTag, viaTag, null, callIdHeader); return createMessageRequest(parentPlatform, content, fromTag, viaTag, null, callIdHeader);
} }
public Request createMessageRequest(ParentPlatform parentPlatform, String content, String fromTag, String viaTag, String toTag, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException { public Request createMessageRequest(Platform parentPlatform, String content, String fromTag, String viaTag, String toTag, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException {
Request request = null; Request request = null;
String serverAddress = parentPlatform.getServerIP()+ ":" + parentPlatform.getServerPort(); String serverAddress = parentPlatform.getServerIP()+ ":" + parentPlatform.getServerPort();
// sipuri // sipuri
@ -214,7 +214,7 @@ public class SIPRequestHeaderPlarformProvider {
return request; return request;
} }
public SIPRequest createNotifyRequest(ParentPlatform parentPlatform, String content, SubscribeInfo subscribeInfo) throws PeerUnavailableException, ParseException, InvalidArgumentException { public SIPRequest createNotifyRequest(Platform parentPlatform, String content, SubscribeInfo subscribeInfo) throws PeerUnavailableException, ParseException, InvalidArgumentException {
SIPRequest request = null; SIPRequest request = null;
// sipuri // sipuri
SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIP()+ ":" + parentPlatform.getServerPort()); SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIP()+ ":" + parentPlatform.getServerPort());
@ -269,7 +269,7 @@ public class SIPRequestHeaderPlarformProvider {
return request; return request;
} }
public SIPRequest createByeRequest(ParentPlatform platform, SendRtpItem sendRtpItem) throws PeerUnavailableException, ParseException, InvalidArgumentException { public SIPRequest createByeRequest(Platform platform, SendRtpItem sendRtpItem) throws PeerUnavailableException, ParseException, InvalidArgumentException {
if (sendRtpItem == null ) { if (sendRtpItem == null ) {
return null; return null;
@ -315,7 +315,7 @@ public class SIPRequestHeaderPlarformProvider {
return request; return request;
} }
public Request createInviteRequest(ParentPlatform platform, String channelId, String content, String viaTag, String fromTag, String ssrc, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException { public Request createInviteRequest(Platform platform, String channelId, String content, String viaTag, String fromTag, String ssrc, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException {
Request request = null; Request request = null;
//请求行 //请求行
String platformHostAddress = platform.getServerIP() + ":" + platform.getServerPort(); String platformHostAddress = platform.getServerIP() + ":" + platform.getServerPort();
@ -355,7 +355,7 @@ public class SIPRequestHeaderPlarformProvider {
return request; return request;
} }
public Request createByteRequest(ParentPlatform platform, String channelId, SipTransactionInfo transactionInfo) throws PeerUnavailableException, ParseException, InvalidArgumentException { public Request createByteRequest(Platform platform, String channelId, SipTransactionInfo transactionInfo) throws PeerUnavailableException, ParseException, InvalidArgumentException {
String deviceHostAddress = platform.getDeviceIp() + ":" + platform.getDevicePort(); String deviceHostAddress = platform.getDeviceIp() + ":" + platform.getDevicePort();
Request request = null; Request request = null;
SipURI requestLine = SipFactory.getInstance().createAddressFactory().createSipURI(channelId, deviceHostAddress); SipURI requestLine = SipFactory.getInstance().createAddressFactory().createSipURI(channelId, deviceHostAddress);

View File

@ -85,24 +85,24 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
private GitUtil gitUtil; private GitUtil gitUtil;
@Override @Override
public void register(ParentPlatform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException { public void register(Platform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException {
register(parentPlatform, null, null, errorEvent, okEvent, true); register(parentPlatform, null, null, errorEvent, okEvent, true);
} }
@Override @Override
public void register(ParentPlatform parentPlatform, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException { public void register(Platform parentPlatform, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException {
register(parentPlatform, sipTransactionInfo, null, errorEvent, okEvent, true); register(parentPlatform, sipTransactionInfo, null, errorEvent, okEvent, true);
} }
@Override @Override
public void unregister(ParentPlatform parentPlatform, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException { public void unregister(Platform parentPlatform, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException {
register(parentPlatform, sipTransactionInfo, null, errorEvent, okEvent, false); register(parentPlatform, sipTransactionInfo, null, errorEvent, okEvent, false);
} }
@Override @Override
public void register(ParentPlatform parentPlatform, @Nullable SipTransactionInfo sipTransactionInfo, @Nullable WWWAuthenticateHeader www, public void register(Platform parentPlatform, @Nullable SipTransactionInfo sipTransactionInfo, @Nullable WWWAuthenticateHeader www,
SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent, boolean isRegister) throws SipException, InvalidArgumentException, ParseException { SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent, boolean isRegister) throws SipException, InvalidArgumentException, ParseException {
Request request; Request request;
CallIdHeader callIdHeader = sipSender.getNewCallIdHeader(parentPlatform.getDeviceIp(),parentPlatform.getTransport()); CallIdHeader callIdHeader = sipSender.getNewCallIdHeader(parentPlatform.getDeviceIp(),parentPlatform.getTransport());
@ -148,7 +148,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
} }
@Override @Override
public String keepalive(ParentPlatform parentPlatform,SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws SipException, InvalidArgumentException, ParseException { public String keepalive(Platform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws SipException, InvalidArgumentException, ParseException {
String characterSet = parentPlatform.getCharacterSet(); String characterSet = parentPlatform.getCharacterSet();
StringBuffer keepaliveXml = new StringBuffer(200); StringBuffer keepaliveXml = new StringBuffer(200);
keepaliveXml.append("<?xml version=\"1.0\" encoding=\"") keepaliveXml.append("<?xml version=\"1.0\" encoding=\"")
@ -178,7 +178,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
* @param parentPlatform 平台信息 * @param parentPlatform 平台信息
*/ */
@Override @Override
public void catalogQuery(CommonGBChannel channel, ParentPlatform parentPlatform, String sn, String fromTag, int size) throws SipException, InvalidArgumentException, ParseException { public void catalogQuery(CommonGBChannel channel, Platform parentPlatform, String sn, String fromTag, int size) throws SipException, InvalidArgumentException, ParseException {
if ( parentPlatform ==null) { if ( parentPlatform ==null) {
return ; return ;
@ -198,13 +198,13 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
} }
@Override @Override
public void catalogQuery(List<CommonGBChannel> channels, ParentPlatform parentPlatform, String sn, String fromTag) throws InvalidArgumentException, ParseException, SipException { public void catalogQuery(List<CommonGBChannel> channels, Platform parentPlatform, String sn, String fromTag) throws InvalidArgumentException, ParseException, SipException {
if ( parentPlatform ==null) { if ( parentPlatform ==null) {
return ; return ;
} }
sendCatalogResponse(channels, parentPlatform, sn, fromTag, 0, true); sendCatalogResponse(channels, parentPlatform, sn, fromTag, 0, true);
} }
private String getCatalogXml(List<CommonGBChannel> channels, String sn, ParentPlatform parentPlatform, int size) { private String getCatalogXml(List<CommonGBChannel> channels, String sn, Platform parentPlatform, int size) {
String characterSet = parentPlatform.getCharacterSet(); String characterSet = parentPlatform.getCharacterSet();
StringBuffer catalogXml = new StringBuffer(600); StringBuffer catalogXml = new StringBuffer(600);
catalogXml.append("<?xml version=\"1.0\" encoding=\"" + characterSet +"\"?>\r\n") catalogXml.append("<?xml version=\"1.0\" encoding=\"" + characterSet +"\"?>\r\n")
@ -225,7 +225,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
return catalogXml.toString(); return catalogXml.toString();
} }
private void sendCatalogResponse(List<CommonGBChannel> channels, ParentPlatform parentPlatform, String sn, String fromTag, int index, boolean sendAfterResponse) throws SipException, InvalidArgumentException, ParseException { private void sendCatalogResponse(List<CommonGBChannel> channels, Platform parentPlatform, String sn, String fromTag, int index, boolean sendAfterResponse) throws SipException, InvalidArgumentException, ParseException {
if (index >= channels.size()) { if (index >= channels.size()) {
return; return;
} }
@ -295,7 +295,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
* @return * @return
*/ */
@Override @Override
public void deviceInfoResponse(ParentPlatform parentPlatform,Device device, String sn, String fromTag) throws SipException, InvalidArgumentException, ParseException { public void deviceInfoResponse(Platform parentPlatform, Device device, String sn, String fromTag) throws SipException, InvalidArgumentException, ParseException {
if (parentPlatform == null) { if (parentPlatform == null) {
return; return;
} }
@ -333,7 +333,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
* @return * @return
*/ */
@Override @Override
public void deviceStatusResponse(ParentPlatform parentPlatform,String channelId, String sn, String fromTag,boolean status) throws SipException, InvalidArgumentException, ParseException { public void deviceStatusResponse(Platform parentPlatform, String channelId, String sn, String fromTag, boolean status) throws SipException, InvalidArgumentException, ParseException {
if (parentPlatform == null) { if (parentPlatform == null) {
return ; return ;
} }
@ -357,7 +357,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
} }
@Override @Override
public void sendNotifyMobilePosition(ParentPlatform parentPlatform, GPSMsgInfo gpsMsgInfo, SubscribeInfo subscribeInfo) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException { public void sendNotifyMobilePosition(Platform parentPlatform, GPSMsgInfo gpsMsgInfo, SubscribeInfo subscribeInfo) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException {
if (parentPlatform == null) { if (parentPlatform == null) {
return; return;
} }
@ -385,7 +385,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
} }
@Override @Override
public void sendAlarmMessage(ParentPlatform parentPlatform, DeviceAlarm deviceAlarm) throws SipException, InvalidArgumentException, ParseException { public void sendAlarmMessage(Platform parentPlatform, DeviceAlarm deviceAlarm) throws SipException, InvalidArgumentException, ParseException {
if (parentPlatform == null) { if (parentPlatform == null) {
return; return;
} }
@ -417,7 +417,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
} }
@Override @Override
public void sendNotifyForCatalogAddOrUpdate(String type, ParentPlatform parentPlatform, List<CommonGBChannel> deviceChannels, SubscribeInfo subscribeInfo, Integer index) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException { public void sendNotifyForCatalogAddOrUpdate(String type, Platform parentPlatform, List<CommonGBChannel> deviceChannels, SubscribeInfo subscribeInfo, Integer index) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException {
if (parentPlatform == null || deviceChannels == null || deviceChannels.isEmpty() || subscribeInfo == null) { if (parentPlatform == null || deviceChannels == null || deviceChannels.isEmpty() || subscribeInfo == null) {
return; return;
} }
@ -451,8 +451,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
})); }));
} }
private void sendNotify(ParentPlatform parentPlatform, String catalogXmlContent, private void sendNotify(Platform parentPlatform, String catalogXmlContent,
SubscribeInfo subscribeInfo, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent ) SubscribeInfo subscribeInfo, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent )
throws SipException, ParseException, InvalidArgumentException { throws SipException, ParseException, InvalidArgumentException {
MessageFactoryImpl messageFactory = (MessageFactoryImpl) SipFactory.getInstance().createMessageFactory(); MessageFactoryImpl messageFactory = (MessageFactoryImpl) SipFactory.getInstance().createMessageFactory();
String characterSet = parentPlatform.getCharacterSet(); String characterSet = parentPlatform.getCharacterSet();
@ -464,7 +464,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
sipSender.transmitRequest(parentPlatform.getDeviceIp(), notifyRequest, errorEvent, okEvent); sipSender.transmitRequest(parentPlatform.getDeviceIp(), notifyRequest, errorEvent, okEvent);
} }
private String getCatalogXmlContentForCatalogAddOrUpdate(ParentPlatform parentPlatform, List<CommonGBChannel> channels, int sumNum, String type, SubscribeInfo subscribeInfo) { private String getCatalogXmlContentForCatalogAddOrUpdate(Platform parentPlatform, List<CommonGBChannel> channels, int sumNum, String type, SubscribeInfo subscribeInfo) {
StringBuffer catalogXml = new StringBuffer(600); StringBuffer catalogXml = new StringBuffer(600);
String characterSet = parentPlatform.getCharacterSet(); String characterSet = parentPlatform.getCharacterSet();
catalogXml.append("<?xml version=\"1.0\" encoding=\"" + characterSet + "\"?>\r\n") catalogXml.append("<?xml version=\"1.0\" encoding=\"" + characterSet + "\"?>\r\n")
@ -485,8 +485,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
} }
@Override @Override
public void sendNotifyForCatalogOther(String type, ParentPlatform parentPlatform, List<CommonGBChannel> deviceChannels, public void sendNotifyForCatalogOther(String type, Platform parentPlatform, List<CommonGBChannel> deviceChannels,
SubscribeInfo subscribeInfo, Integer index) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException { SubscribeInfo subscribeInfo, Integer index) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException {
if (parentPlatform == null if (parentPlatform == null
|| deviceChannels == null || deviceChannels == null
|| deviceChannels.size() == 0 || deviceChannels.size() == 0
@ -523,7 +523,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
}); });
} }
private String getCatalogXmlContentForCatalogOther(ParentPlatform parentPlatform, List<CommonGBChannel> channels, String type) { private String getCatalogXmlContentForCatalogOther(Platform parentPlatform, List<CommonGBChannel> channels, String type) {
String characterSet = parentPlatform.getCharacterSet(); String characterSet = parentPlatform.getCharacterSet();
StringBuffer catalogXml = new StringBuffer(600); StringBuffer catalogXml = new StringBuffer(600);
@ -544,7 +544,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
return catalogXml.toString(); return catalogXml.toString();
} }
@Override @Override
public void recordInfo(CommonGBChannel deviceChannel, ParentPlatform parentPlatform, String fromTag, RecordInfo recordInfo) throws SipException, InvalidArgumentException, ParseException { public void recordInfo(CommonGBChannel deviceChannel, Platform parentPlatform, String fromTag, RecordInfo recordInfo) throws SipException, InvalidArgumentException, ParseException {
if ( parentPlatform ==null) { if ( parentPlatform ==null) {
return ; return ;
} }
@ -597,7 +597,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
} }
@Override @Override
public void sendMediaStatusNotify(ParentPlatform parentPlatform, SendRtpItem sendRtpItem) throws SipException, InvalidArgumentException, ParseException { public void sendMediaStatusNotify(Platform parentPlatform, SendRtpItem sendRtpItem) throws SipException, InvalidArgumentException, ParseException {
if (sendRtpItem == null || parentPlatform == null) { if (sendRtpItem == null || parentPlatform == null) {
return; return;
} }
@ -621,7 +621,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
} }
@Override @Override
public void streamByeCmd(ParentPlatform platform, String callId) throws SipException, InvalidArgumentException, ParseException { public void streamByeCmd(Platform platform, String callId) throws SipException, InvalidArgumentException, ParseException {
if (platform == null) { if (platform == null) {
return; return;
} }
@ -632,7 +632,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
} }
@Override @Override
public synchronized void streamByeCmd(ParentPlatform platform, SendRtpItem sendRtpItem) throws SipException, InvalidArgumentException, ParseException { public synchronized void streamByeCmd(Platform platform, SendRtpItem sendRtpItem) throws SipException, InvalidArgumentException, ParseException {
if (sendRtpItem == null ) { if (sendRtpItem == null ) {
log.info("[向上级发送BYE] sendRtpItem 为NULL"); log.info("[向上级发送BYE] sendRtpItem 为NULL");
return; return;
@ -656,7 +656,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
} }
@Override @Override
public void streamByeCmd(ParentPlatform platform, String channelId, String stream, String callId, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException, SsrcTransactionNotFoundException { public void streamByeCmd(Platform platform, String channelId, String stream, String callId, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException, SsrcTransactionNotFoundException {
SsrcTransaction ssrcTransaction = streamSession.getSsrcTransaction(platform.getServerGBId(), channelId, callId, stream); SsrcTransaction ssrcTransaction = streamSession.getSsrcTransaction(platform.getServerGBId(), channelId, callId, stream);
if (ssrcTransaction == null) { if (ssrcTransaction == null) {
throw new SsrcTransactionNotFoundException(platform.getServerGBId(), channelId, callId, stream); throw new SsrcTransactionNotFoundException(platform.getServerGBId(), channelId, callId, stream);
@ -671,7 +671,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
} }
@Override @Override
public void broadcastResultCmd(ParentPlatform platform, CommonGBChannel deviceChannel, String sn, boolean result, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException { public void broadcastResultCmd(Platform platform, CommonGBChannel deviceChannel, String sn, boolean result, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException {
if (platform == null || deviceChannel == null) { if (platform == null || deviceChannel == null) {
return; return;
} }
@ -694,7 +694,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
} }
@Override @Override
public void broadcastInviteCmd(ParentPlatform platform, String channelId, MediaServer mediaServerItem, public void broadcastInviteCmd(Platform platform, String channelId, MediaServer mediaServerItem,
SSRCInfo ssrcInfo, HookSubscribe.Event event, SipSubscribe.Event okEvent, SSRCInfo ssrcInfo, HookSubscribe.Event event, SipSubscribe.Event okEvent,
SipSubscribe.Event errorEvent) throws ParseException, SipException, InvalidArgumentException { SipSubscribe.Event errorEvent) throws ParseException, SipException, InvalidArgumentException {
String stream = ssrcInfo.getStream(); String stream = ssrcInfo.getStream();

View File

@ -1,6 +1,6 @@
package com.genersoft.iot.vmp.gb28181.transmit.event.request; package com.genersoft.iot.vmp.gb28181.transmit.event.request;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.transmit.SIPSender; import com.genersoft.iot.vmp.gb28181.transmit.SIPSender;
import com.genersoft.iot.vmp.gb28181.utils.SipUtils; import com.genersoft.iot.vmp.gb28181.utils.SipUtils;
import com.google.common.primitives.Bytes; import com.google.common.primitives.Bytes;
@ -127,7 +127,7 @@ public abstract class SIPRequestProcessorParent {
/** /**
* 回复带sdp的200 * 回复带sdp的200
*/ */
public SIPResponse responseSdpAck(SIPRequest request, String sdp, ParentPlatform platform) throws SipException, InvalidArgumentException, ParseException { public SIPResponse responseSdpAck(SIPRequest request, String sdp, Platform platform) throws SipException, InvalidArgumentException, ParseException {
ContentTypeHeader contentTypeHeader = SipFactory.getInstance().createHeaderFactory().createContentTypeHeader("APPLICATION", "SDP"); ContentTypeHeader contentTypeHeader = SipFactory.getInstance().createHeaderFactory().createContentTypeHeader("APPLICATION", "SDP");
@ -150,7 +150,7 @@ public abstract class SIPRequestProcessorParent {
/** /**
* 回复带xml的200 * 回复带xml的200
*/ */
public SIPResponse responseXmlAck(SIPRequest request, String xml, ParentPlatform platform, Integer expires) throws SipException, InvalidArgumentException, ParseException { public SIPResponse responseXmlAck(SIPRequest request, String xml, Platform platform, Integer expires) throws SipException, InvalidArgumentException, ParseException {
ContentTypeHeader contentTypeHeader = SipFactory.getInstance().createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); ContentTypeHeader contentTypeHeader = SipFactory.getInstance().createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml");
SipURI sipURI = (SipURI)request.getRequestURI(); SipURI sipURI = (SipURI)request.getRequestURI();

View File

@ -4,7 +4,7 @@ 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.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem; import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor; import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
@ -100,7 +100,7 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In
sendRtpItem.getSsrc(), sendRtpItem.getSsrc(),
sendRtpItem.isTcp()?(sendRtpItem.isTcpActive()?"TCP主动":"TCP被动"):"UDP" sendRtpItem.isTcp()?(sendRtpItem.isTcpActive()?"TCP主动":"TCP被动"):"UDP"
); );
ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(fromUserId); Platform parentPlatform = storager.queryParentPlatByServerGBId(fromUserId);
if (parentPlatform != null) { if (parentPlatform != null) {
if (!userSetting.getServerId().equals(sendRtpItem.getServerId())) { if (!userSetting.getServerId().equals(sendRtpItem.getServerId())) {

View File

@ -123,7 +123,7 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In
if (sendRtpItem.getPlayType().equals(InviteStreamType.PUSH)) { if (sendRtpItem.getPlayType().equals(InviteStreamType.PUSH)) {
// 不是本平台的就发送redis消息让其他wvp停止发流 // 不是本平台的就发送redis消息让其他wvp停止发流
ParentPlatform platform = platformService.queryPlatformByServerGBId(sendRtpItem.getPlatformId()); Platform platform = platformService.queryPlatformByServerGBId(sendRtpItem.getPlatformId());
if (platform != null) { if (platform != null) {
redisCatchStorage.sendPlatformStopPlayMsg(sendRtpItem, platform); redisCatchStorage.sendPlatformStopPlayMsg(sendRtpItem, platform);
if (!userSetting.getServerId().equals(sendRtpItem.getServerId())) { if (!userSetting.getServerId().equals(sendRtpItem.getServerId())) {
@ -185,7 +185,7 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In
} }
log.info("[收到bye] 来自设备:{}, 通道: {}, 类型: {}", ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId(), ssrcTransaction.getType()); log.info("[收到bye] 来自设备:{}, 通道: {}, 类型: {}", ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId(), ssrcTransaction.getType());
ParentPlatform platform = platformService.queryPlatformByServerGBId(ssrcTransaction.getDeviceId()); Platform platform = platformService.queryPlatformByServerGBId(ssrcTransaction.getDeviceId());
if (platform != null ) { if (platform != null ) {
if (ssrcTransaction.getType().equals(InviteSessionType.BROADCAST)) { if (ssrcTransaction.getType().equals(InviteSessionType.BROADCAST)) {
log.info("[收到bye] 上级停止语音对讲,来自:{}, 通道已停止推流: {}", ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId()); log.info("[收到bye] 上级停止语音对讲,来自:{}, 通道已停止推流: {}", ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId());

View File

@ -184,7 +184,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
requesterId, callIdHeader.getCallId(), request.getRemoteAddress(), request.getRemotePort()); requesterId, callIdHeader.getCallId(), request.getRemoteAddress(), request.getRemotePort());
// 查询请求是否来自上级平台\设备 // 查询请求是否来自上级平台\设备
ParentPlatform platform = storager.queryParentPlatByServerGBId(requesterId); Platform platform = storager.queryParentPlatByServerGBId(requesterId);
if (platform == null) { if (platform == null) {
inviteFromDeviceHandle(request, requesterId, channelId); inviteFromDeviceHandle(request, requesterId, channelId);
@ -644,7 +644,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
} }
} }
private void startSendRtpStreamHand(RequestEvent evt, SendRtpItem sendRtpItem, ParentPlatform parentPlatform, private void startSendRtpStreamHand(RequestEvent evt, SendRtpItem sendRtpItem, Platform parentPlatform,
JSONObject jsonObject, Map<String, Object> param, CallIdHeader callIdHeader) { JSONObject jsonObject, Map<String, Object> param, CallIdHeader callIdHeader) {
if (jsonObject == null) { if (jsonObject == null) {
log.error("下级TCP被动启动监听失败: 请检查ZLM服务"); log.error("下级TCP被动启动监听失败: 请检查ZLM服务");
@ -659,7 +659,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
/** /**
* 安排推流 * 安排推流
*/ */
private void sendProxyStream(SendRtpItem sendRtpItem, MediaServer mediaServerItem, ParentPlatform platform, SIPRequest request) { private void sendProxyStream(SendRtpItem sendRtpItem, MediaServer mediaServerItem, Platform platform, SIPRequest request) {
MediaInfo mediaInfo = mediaServerService.getMediaInfo(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStream()); MediaInfo mediaInfo = mediaServerService.getMediaInfo(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStream());
if (mediaInfo != null) { if (mediaInfo != null) {
@ -688,7 +688,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
} }
} }
private void sendPushStream(SendRtpItem sendRtpItem, MediaServer mediaServerItem, ParentPlatform platform, SIPRequest request) { private void sendPushStream(SendRtpItem sendRtpItem, MediaServer mediaServerItem, Platform platform, SIPRequest request) {
// 推流 // 推流
if (sendRtpItem.getServerId().equals(userSetting.getServerId())) { if (sendRtpItem.getServerId().equals(userSetting.getServerId())) {
MediaInfo mediaInfo = mediaServerService.getMediaInfo(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStream()); MediaInfo mediaInfo = mediaServerService.getMediaInfo(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStream());
@ -729,7 +729,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
/** /**
* 通知流上线 * 通知流上线
*/ */
private void notifyProxyStreamOnline(SendRtpItem sendRtpItem, MediaServer mediaServerItem, ParentPlatform platform, SIPRequest request) { private void notifyProxyStreamOnline(SendRtpItem sendRtpItem, MediaServer mediaServerItem, Platform platform, SIPRequest request) {
// TODO 控制启用以使设备上线 // TODO 控制启用以使设备上线
log.info("[ app={}, stream={} ]通道未推流,启用流后开始推流", sendRtpItem.getApp(), sendRtpItem.getStream()); log.info("[ app={}, stream={} ]通道未推流,启用流后开始推流", sendRtpItem.getApp(), sendRtpItem.getStream());
// 监听流上线 // 监听流上线
@ -758,7 +758,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
/** /**
* 通知流上线 * 通知流上线
*/ */
private void notifyPushStreamOnline(SendRtpItem sendRtpItem, MediaServer mediaServerItem, ParentPlatform platform, SIPRequest request) { private void notifyPushStreamOnline(SendRtpItem sendRtpItem, MediaServer mediaServerItem, Platform platform, SIPRequest request) {
// 发送redis消息以使设备上线流上线后被 // 发送redis消息以使设备上线流上线后被
log.info("[ app={}, stream={} ]通道未推流发送redis信息控制设备开始推流", sendRtpItem.getApp(), sendRtpItem.getStream()); log.info("[ app={}, stream={} ]通道未推流发送redis信息控制设备开始推流", sendRtpItem.getApp(), sendRtpItem.getStream());
MessageForPushChannel messageForPushChannel = MessageForPushChannel.getInstance(1, MessageForPushChannel messageForPushChannel = MessageForPushChannel.getInstance(1,
@ -847,7 +847,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
/** /**
* 来自其他wvp的推流 * 来自其他wvp的推流
*/ */
private void otherWvpPushStream(SendRtpItem sendRtpItem, SIPRequest request, ParentPlatform platform) { private void otherWvpPushStream(SendRtpItem sendRtpItem, SIPRequest request, Platform platform) {
log.info("[级联点播] 来自其他wvp的推流 {}/{}", sendRtpItem.getApp(), sendRtpItem.getStream()); log.info("[级联点播] 来自其他wvp的推流 {}/{}", sendRtpItem.getApp(), sendRtpItem.getStream());
sendRtpItem = redisRpcService.getSendRtpItem(sendRtpItem.getRedisKey()); sendRtpItem = redisRpcService.getSendRtpItem(sendRtpItem.getRedisKey());
if (sendRtpItem == null) { if (sendRtpItem == null) {
@ -862,7 +862,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
redisCatchStorage.updateSendRTPSever(sendRtpItem); redisCatchStorage.updateSendRTPSever(sendRtpItem);
} }
public SIPResponse sendStreamAck(SIPRequest request, SendRtpItem sendRtpItem, ParentPlatform platform) { public SIPResponse sendStreamAck(SIPRequest request, SendRtpItem sendRtpItem, Platform platform) {
String sdpIp = sendRtpItem.getLocalIp(); String sdpIp = sendRtpItem.getLocalIp();
if (!ObjectUtils.isEmpty(platform.getSendStreamIp())) { if (!ObjectUtils.isEmpty(platform.getSendStreamIp())) {
@ -1117,7 +1117,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
content.append("y=" + ssrc + "\r\n"); content.append("y=" + ssrc + "\r\n");
content.append("f=v/////a/1/8/1\r\n"); content.append("f=v/////a/1/8/1\r\n");
ParentPlatform parentPlatform = new ParentPlatform(); Platform parentPlatform = new Platform();
parentPlatform.setServerIP(device.getIp()); parentPlatform.setServerIP(device.getIp());
parentPlatform.setServerPort(device.getPort()); parentPlatform.setServerPort(device.getPort());
parentPlatform.setServerGBId(device.getDeviceId()); parentPlatform.setServerGBId(device.getDeviceId());

View File

@ -1,7 +1,7 @@
package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl; package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl;
import com.genersoft.iot.vmp.gb28181.bean.CmdType; import com.genersoft.iot.vmp.gb28181.bean.CmdType;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder; import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder;
import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo; import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo;
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
@ -108,7 +108,7 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme
} }
String platformId = SipUtils.getUserIdFromFromHeader(request); String platformId = SipUtils.getUserIdFromFromHeader(request);
String deviceId = XmlUtil.getText(rootElement, "DeviceID"); String deviceId = XmlUtil.getText(rootElement, "DeviceID");
ParentPlatform platform = storager.queryParentPlatByServerGBId(platformId); Platform platform = storager.queryParentPlatByServerGBId(platformId);
SubscribeInfo subscribeInfo = new SubscribeInfo(request, platformId); SubscribeInfo subscribeInfo = new SubscribeInfo(request, platformId);
if (platform == null) { if (platform == null) {
return; return;
@ -137,7 +137,7 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme
} }
try { try {
ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(platformId); Platform parentPlatform = storager.queryParentPlatByServerGBId(platformId);
SIPResponse response = responseXmlAck(request, resultXml.toString(), parentPlatform, subscribeInfo.getExpires()); SIPResponse response = responseXmlAck(request, resultXml.toString(), parentPlatform, subscribeInfo.getExpires());
if (subscribeInfo.getExpires() == 0) { if (subscribeInfo.getExpires() == 0) {
subscribeHolder.removeMobilePositionSubscribe(platformId); subscribeHolder.removeMobilePositionSubscribe(platformId);
@ -163,7 +163,7 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme
} }
String platformId = SipUtils.getUserIdFromFromHeader(request); String platformId = SipUtils.getUserIdFromFromHeader(request);
String deviceId = XmlUtil.getText(rootElement, "DeviceID"); String deviceId = XmlUtil.getText(rootElement, "DeviceID");
ParentPlatform platform = storager.queryParentPlatByServerGBId(platformId); Platform platform = storager.queryParentPlatByServerGBId(platformId);
if (platform == null){ if (platform == null){
return; return;
} }
@ -186,7 +186,7 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme
subscribeHolder.removeCatalogSubscribe(platformId); subscribeHolder.removeCatalogSubscribe(platformId);
} }
try { try {
ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(platformId); Platform parentPlatform = storager.queryParentPlatByServerGBId(platformId);
SIPResponse response = responseXmlAck(request, resultXml.toString(), parentPlatform, subscribeInfo.getExpires()); SIPResponse response = responseXmlAck(request, resultXml.toString(), parentPlatform, subscribeInfo.getExpires());
if (subscribeInfo.getExpires() == 0) { if (subscribeInfo.getExpires() == 0) {
subscribeHolder.removeCatalogSubscribe(platformId); subscribeHolder.removeCatalogSubscribe(platformId);

View File

@ -80,7 +80,7 @@ public class InfoRequestProcessor extends SIPRequestProcessorParent implements I
// 查询设备是否存在 // 查询设备是否存在
Device device = redisCatchStorage.getDevice(deviceId); Device device = redisCatchStorage.getDevice(deviceId);
// 查询上级平台是否存在 // 查询上级平台是否存在
ParentPlatform parentPlatform = storage.queryParentPlatByServerGBId(deviceId); Platform parentPlatform = storage.queryParentPlatByServerGBId(deviceId);
try { try {
if (device != null && parentPlatform != null) { if (device != null && parentPlatform != null) {
log.warn("[重复]平台与设备编号重复:{}", deviceId); log.warn("[重复]平台与设备编号重复:{}", deviceId);

View File

@ -1,7 +1,7 @@
package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message; package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import org.dom4j.Element; import org.dom4j.Element;
import javax.sip.RequestEvent; import javax.sip.RequestEvent;
@ -19,5 +19,5 @@ public interface IMessageHandler {
* @param evt * @param evt
* @param parentPlatform * @param parentPlatform
*/ */
void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element); void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element);
} }

View File

@ -1,7 +1,7 @@
package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message; package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.cmd.CatalogQueryMessageHandler; import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.cmd.CatalogQueryMessageHandler;
import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
@ -49,7 +49,7 @@ public abstract class MessageHandlerAbstract extends SIPRequestProcessorParent i
//两个国标平台互相级联时由于上一步判断导致本该在平台处理的消息 放到了设备的处理逻辑 //两个国标平台互相级联时由于上一步判断导致本该在平台处理的消息 放到了设备的处理逻辑
//所以对目录查询单独做了校验 //所以对目录查询单独做了校验
if(messageHandler instanceof CatalogQueryMessageHandler){ if(messageHandler instanceof CatalogQueryMessageHandler){
ParentPlatform parentPlatform = storage.queryParentPlatByServerGBId(device.getDeviceId()); Platform parentPlatform = storage.queryParentPlatByServerGBId(device.getDeviceId());
messageHandler.handForPlatform(evt, parentPlatform, element); messageHandler.handForPlatform(evt, parentPlatform, element);
return; return;
} }
@ -58,7 +58,7 @@ public abstract class MessageHandlerAbstract extends SIPRequestProcessorParent i
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) {
String cmd = getText(element, "CmdType"); String cmd = getText(element, "CmdType");
IMessageHandler messageHandler = messageHandlerMap.get(cmd); IMessageHandler messageHandler = messageHandlerMap.get(cmd);
if (messageHandler != null) { if (messageHandler != null) {

View File

@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceNotFoundEvent; import com.genersoft.iot.vmp.gb28181.bean.DeviceNotFoundEvent;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction; import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction;
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
@ -78,7 +78,7 @@ public class MessageRequestProcessor extends SIPRequestProcessorParent implement
// 查询设备是否存在 // 查询设备是否存在
Device device = redisCatchStorage.getDevice(deviceId); Device device = redisCatchStorage.getDevice(deviceId);
// 查询上级平台是否存在 // 查询上级平台是否存在
ParentPlatform parentPlatform = storage.queryParentPlatByServerGBId(deviceId); Platform parentPlatform = storage.queryParentPlatByServerGBId(deviceId);
try { try {
if (device != null && parentPlatform != null) { if (device != null && parentPlatform != null) {
String hostAddress = request.getRemoteAddress().getHostAddress(); String hostAddress = request.getRemoteAddress().getHostAddress();

View File

@ -4,7 +4,7 @@ import com.genersoft.iot.vmp.common.enums.DeviceControlType;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DragZoomRequest; import com.genersoft.iot.vmp.gb28181.bean.DragZoomRequest;
import com.genersoft.iot.vmp.gb28181.bean.HomePositionRequest; import com.genersoft.iot.vmp.gb28181.bean.HomePositionRequest;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
@ -56,7 +56,7 @@ public class DeviceControlQueryMessageHandler extends SIPRequestProcessorParent
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) {
SIPRequest request = (SIPRequest) evt.getRequest(); SIPRequest request = (SIPRequest) evt.getRequest();

View File

@ -198,7 +198,7 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) {
log.info("收到来自平台[{}]的报警通知", parentPlatform.getServerGBId()); log.info("收到来自平台[{}]的报警通知", parentPlatform.getServerGBId());
// 回复200 OK // 回复200 OK
try { try {

View File

@ -74,7 +74,7 @@ public class BroadcastNotifyMessageHandler extends SIPRequestProcessorParent imp
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform platform, Element rootElement) { public void handForPlatform(RequestEvent evt, Platform platform, Element rootElement) {
// 来自上级平台的语音喊话请求 // 来自上级平台的语音喊话请求
SIPRequest request = (SIPRequest) evt.getRequest(); SIPRequest request = (SIPRequest) evt.getRequest();
try { try {

View File

@ -4,7 +4,7 @@ import com.genersoft.iot.vmp.common.VideoManagerConstants;
import com.genersoft.iot.vmp.conf.DynamicTask; 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.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.RemoteAddressInfo; import com.genersoft.iot.vmp.gb28181.bean.RemoteAddressInfo;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler; import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler;
@ -119,7 +119,7 @@ public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent imp
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) {
// 个别平台保活不回复200OK会判定离线 // 个别平台保活不回复200OK会判定离线
try { try {
responseAck((SIPRequest) evt.getRequest(), Response.OK); responseAck((SIPRequest) evt.getRequest(), Response.OK);

View File

@ -4,7 +4,7 @@ import com.genersoft.iot.vmp.common.InviteInfo;
import com.genersoft.iot.vmp.common.InviteSessionType; import com.genersoft.iot.vmp.common.InviteSessionType;
import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem; import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction; import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction;
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
@ -110,7 +110,7 @@ public class MediaStatusNotifyMessageHandler extends SIPRequestProcessorParent i
// 如果级联播放需要给上级发送此通知 TODO 多个上级同时观看一个下级 可能存在停错的问题需要将点播CallId进行上下级绑定 // 如果级联播放需要给上级发送此通知 TODO 多个上级同时观看一个下级 可能存在停错的问题需要将点播CallId进行上下级绑定
SendRtpItem sendRtpItem = redisCatchStorage.querySendRTPServer(null, ssrcTransaction.getChannelId(), null, null); SendRtpItem sendRtpItem = redisCatchStorage.querySendRTPServer(null, ssrcTransaction.getChannelId(), null, null);
if (sendRtpItem != null) { if (sendRtpItem != null) {
ParentPlatform parentPlatform = storage.queryParentPlatByServerGBId(sendRtpItem.getPlatformId()); Platform parentPlatform = storage.queryParentPlatByServerGBId(sendRtpItem.getPlatformId());
if (parentPlatform == null) { if (parentPlatform == null) {
log.warn("[级联消息发送]发送MediaStatus发现上级平台{}不存在", sendRtpItem.getPlatformId()); log.warn("[级联消息发送]发送MediaStatus发现上级平台{}不存在", sendRtpItem.getPlatformId());
return; return;
@ -128,7 +128,7 @@ public class MediaStatusNotifyMessageHandler extends SIPRequestProcessorParent i
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) {
} }
} }

View File

@ -146,7 +146,7 @@ public class MobilePositionNotifyMessageHandler extends SIPRequestProcessorParen
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) {
} }
} }

View File

@ -1,7 +1,7 @@
package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.cmd; package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.cmd;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler; import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.QueryMessageHandler; import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.QueryMessageHandler;
@ -38,7 +38,7 @@ public class AlarmQueryMessageHandler extends SIPRequestProcessorParent implemen
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) {
log.info("不支持alarm查询"); log.info("不支持alarm查询");
try { try {

View File

@ -3,7 +3,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.
import com.genersoft.iot.vmp.conf.SipConfig; import com.genersoft.iot.vmp.conf.SipConfig;
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel; import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
import com.genersoft.iot.vmp.gb28181.service.IGbChannelService; import com.genersoft.iot.vmp.gb28181.service.IGbChannelService;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform;
@ -61,7 +61,7 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { public void handForPlatform(RequestEvent evt, Platform platform, Element rootElement) {
FromHeader fromHeader = (FromHeader) evt.getRequest().getHeader(FromHeader.NAME); FromHeader fromHeader = (FromHeader) evt.getRequest().getHeader(FromHeader.NAME);
try { try {
@ -72,16 +72,14 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem
} }
Element snElement = rootElement.element("SN"); Element snElement = rootElement.element("SN");
String sn = snElement.getText(); String sn = snElement.getText();
List<CommonGBChannel> channelList = channelService.queryByPlatformId(parentPlatform.getId()); List<CommonGBChannel> channelList = channelService.queryByPlatform(platform);
// TODO 是否包含平台信息做成一个策略
try { try {
if (!channelList.isEmpty()) { if (!channelList.isEmpty()) {
cmderFroPlatform.catalogQuery(channelList, parentPlatform, sn, fromHeader.getTag()); cmderFroPlatform.catalogQuery(channelList, platform, sn, fromHeader.getTag());
}else { }else {
// 回复无通道 // 回复无通道
cmderFroPlatform.catalogQuery(null, parentPlatform, sn, fromHeader.getTag(), 0); cmderFroPlatform.catalogQuery(null, platform, sn, fromHeader.getTag(), 0);
} }
} catch (SipException | InvalidArgumentException | ParseException e) { } catch (SipException | InvalidArgumentException | ParseException e) {
log.error("[命令发送失败] 国标级联 目录查询回复: {}", e.getMessage()); log.error("[命令发送失败] 国标级联 目录查询回复: {}", e.getMessage());

View File

@ -1,7 +1,7 @@
package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.cmd; package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.cmd;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler; import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler;
@ -48,7 +48,7 @@ public class DeviceInfoQueryMessageHandler extends SIPRequestProcessorParent imp
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) {
log.info("[DeviceInfo查询]消息"); log.info("[DeviceInfo查询]消息");
FromHeader fromHeader = (FromHeader) evt.getRequest().getHeader(FromHeader.NAME); FromHeader fromHeader = (FromHeader) evt.getRequest().getHeader(FromHeader.NAME);
try { try {

View File

@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.
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.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler; import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler;
@ -50,7 +50,7 @@ public class DeviceStatusQueryMessageHandler extends SIPRequestProcessorParent i
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) {
log.info("接收到DeviceStatus查询消息"); log.info("接收到DeviceStatus查询消息");
FromHeader fromHeader = (FromHeader) evt.getRequest().getHeader(FromHeader.NAME); FromHeader fromHeader = (FromHeader) evt.getRequest().getHeader(FromHeader.NAME);

View File

@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.
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.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.event.record.RecordEndEventListener; import com.genersoft.iot.vmp.gb28181.event.record.RecordEndEventListener;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform;
@ -58,7 +58,7 @@ public class RecordInfoQueryMessageHandler extends SIPRequestProcessorParent imp
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) {
SIPRequest request = (SIPRequest) evt.getRequest(); SIPRequest request = (SIPRequest) evt.getRequest();
Element snElement = rootElement.element("SN"); Element snElement = rootElement.element("SN");

View File

@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.respon
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
@ -51,7 +51,7 @@ public class AlarmResponseMessageHandler extends SIPRequestProcessorParent imple
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) {
} }
} }

View File

@ -4,7 +4,7 @@ import com.genersoft.iot.vmp.conf.DynamicTask;
import com.genersoft.iot.vmp.gb28181.bean.AudioBroadcastCatch; import com.genersoft.iot.vmp.gb28181.bean.AudioBroadcastCatch;
import com.genersoft.iot.vmp.gb28181.bean.AudioBroadcastCatchStatus; import com.genersoft.iot.vmp.gb28181.bean.AudioBroadcastCatchStatus;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager; import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler; import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler;
@ -82,7 +82,7 @@ public class BroadcastResponseMessageHandler extends SIPRequestProcessorParent i
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) {
} }
} }

View File

@ -196,7 +196,7 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) {
} }

View File

@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.respon
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
@ -67,7 +67,7 @@ public class ConfigDownloadResponseMessageHandler extends SIPRequestProcessorPar
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) {
// 不会收到上级平台的心跳信息 // 不会收到上级平台的心跳信息
} }

View File

@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.respon
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
@ -52,6 +52,6 @@ public class DeviceConfigResponseMessageHandler extends SIPRequestProcessorParen
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) {
} }
} }

View File

@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.respon
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
@ -64,6 +64,6 @@ public class DeviceControlResponseMessageHandler extends SIPRequestProcessorPare
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) {
} }
} }

View File

@ -1,7 +1,7 @@
package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd; package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
@ -100,7 +100,7 @@ public class DeviceInfoResponseMessageHandler extends SIPRequestProcessorParent
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) {
} }
} }

View File

@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.respon
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
@ -81,7 +81,7 @@ public class DeviceStatusResponseMessageHandler extends SIPRequestProcessorParen
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) {
} }

View File

@ -3,7 +3,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.respon
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.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.bean.MobilePosition; import com.genersoft.iot.vmp.gb28181.bean.MobilePosition;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
@ -131,7 +131,7 @@ public class MobilePositionResponseMessageHandler extends SIPRequestProcessorPar
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) {
} }
} }

View File

@ -1,7 +1,7 @@
package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd; package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.PresetQuerySipReq; import com.genersoft.iot.vmp.gb28181.bean.PresetQuerySipReq;
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
@ -113,7 +113,7 @@ public class PresetQueryResponseMessageHandler extends SIPRequestProcessorParent
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) {
} }

View File

@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.respon
import com.genersoft.iot.vmp.common.VideoManagerConstants; import com.genersoft.iot.vmp.common.VideoManagerConstants;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.RecordInfo; import com.genersoft.iot.vmp.gb28181.bean.RecordInfo;
import com.genersoft.iot.vmp.gb28181.bean.RecordItem; import com.genersoft.iot.vmp.gb28181.bean.RecordItem;
import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
@ -160,7 +160,7 @@ public class RecordInfoResponseMessageHandler extends SIPRequestProcessorParent
} }
@Override @Override
public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) {
} }

View File

@ -1,7 +1,7 @@
package com.genersoft.iot.vmp.gb28181.transmit.event.response.impl; package com.genersoft.iot.vmp.gb28181.transmit.event.response.impl;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; import com.genersoft.iot.vmp.gb28181.bean.PlatformCatch;
import com.genersoft.iot.vmp.gb28181.bean.SipTransactionInfo; import com.genersoft.iot.vmp.gb28181.bean.SipTransactionInfo;
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
@ -65,7 +65,7 @@ public class RegisterResponseProcessor extends SIPResponseProcessorAbstract {
return; return;
} }
ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(platformRegisterInfo.getPlatformId()); PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(platformRegisterInfo.getPlatformId());
if (parentPlatformCatch == null) { if (parentPlatformCatch == null) {
log.warn(String.format("[国标级联]收到注册/注销%S请求平台%s但是平台缓存信息未查询到!!!", response.getStatusCode(),platformRegisterInfo.getPlatformId())); log.warn(String.format("[国标级联]收到注册/注销%S请求平台%s但是平台缓存信息未查询到!!!", response.getStatusCode(),platformRegisterInfo.getPlatformId()));
return; return;
@ -73,7 +73,7 @@ public class RegisterResponseProcessor extends SIPResponseProcessorAbstract {
String action = platformRegisterInfo.isRegister() ? "注册" : "注销"; String action = platformRegisterInfo.isRegister() ? "注册" : "注销";
log.info(String.format("[国标级联]%s %S响应,%s ", action, response.getStatusCode(), platformRegisterInfo.getPlatformId() )); log.info(String.format("[国标级联]%s %S响应,%s ", action, response.getStatusCode(), platformRegisterInfo.getPlatformId() ));
ParentPlatform parentPlatform = parentPlatformCatch.getParentPlatform(); Platform parentPlatform = parentPlatformCatch.getParentPlatform();
if (parentPlatform == null) { if (parentPlatform == null) {
log.warn(String.format("[国标级联]收到 %s %s的%S请求, 但是平台信息未查询到!!!", platformRegisterInfo.getPlatformId(), action, response.getStatusCode())); log.warn(String.format("[国标级联]收到 %s %s的%S请求, 但是平台信息未查询到!!!", platformRegisterInfo.getPlatformId(), action, response.getStatusCode()));
return; return;

View File

@ -234,7 +234,7 @@ public class MediaServiceImpl implements IMediaService {
inviteInfo.getChannelId()); inviteInfo.getChannelId());
if (!sendRtpItems.isEmpty()) { if (!sendRtpItems.isEmpty()) {
for (SendRtpItem sendRtpItem : sendRtpItems) { for (SendRtpItem sendRtpItem : sendRtpItems) {
ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId()); Platform parentPlatform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId());
try { try {
commanderForPlatform.streamByeCmd(parentPlatform, sendRtpItem.getCallId()); commanderForPlatform.streamByeCmd(parentPlatform, sendRtpItem.getCallId());
} catch (SipException | InvalidArgumentException | ParseException e) { } catch (SipException | InvalidArgumentException | ParseException e) {

View File

@ -5,7 +5,7 @@ import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.gb28181.bean.AlarmChannelMessage; import com.genersoft.iot.vmp.gb28181.bean.AlarmChannelMessage;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm; import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService; import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService;
@ -89,9 +89,9 @@ public class RedisAlarmMsgListener implements MessageListener {
if (ObjectUtils.isEmpty(gbId)) { if (ObjectUtils.isEmpty(gbId)) {
if (userSetting.getSendToPlatformsWhenIdLost()) { if (userSetting.getSendToPlatformsWhenIdLost()) {
// 发送给所有的上级 // 发送给所有的上级
List<ParentPlatform> parentPlatforms = storage.queryEnableParentPlatformList(true); List<Platform> parentPlatforms = storage.queryEnableParentPlatformList(true);
if (parentPlatforms.size() > 0) { if (parentPlatforms.size() > 0) {
for (ParentPlatform parentPlatform : parentPlatforms) { for (Platform parentPlatform : parentPlatforms) {
try { try {
deviceAlarm.setChannelId(parentPlatform.getDeviceGBId()); deviceAlarm.setChannelId(parentPlatform.getDeviceGBId());
commanderForPlatform.sendAlarmMessage(parentPlatform, deviceAlarm); commanderForPlatform.sendAlarmMessage(parentPlatform, deviceAlarm);
@ -102,9 +102,9 @@ public class RedisAlarmMsgListener implements MessageListener {
} }
}else { }else {
// 获取开启了消息推送的设备和平台 // 获取开启了消息推送的设备和平台
List<ParentPlatform> parentPlatforms = storage.queryEnablePlatformListWithAsMessageChannel(); List<Platform> parentPlatforms = storage.queryEnablePlatformListWithAsMessageChannel();
if (parentPlatforms.size() > 0) { if (parentPlatforms.size() > 0) {
for (ParentPlatform parentPlatform : parentPlatforms) { for (Platform parentPlatform : parentPlatforms) {
try { try {
deviceAlarm.setChannelId(parentPlatform.getDeviceGBId()); deviceAlarm.setChannelId(parentPlatform.getDeviceGBId());
commanderForPlatform.sendAlarmMessage(parentPlatform, deviceAlarm); commanderForPlatform.sendAlarmMessage(parentPlatform, deviceAlarm);
@ -130,7 +130,7 @@ public class RedisAlarmMsgListener implements MessageListener {
}else { }else {
Device device = deviceService.getDevice(gbId); Device device = deviceService.getDevice(gbId);
ParentPlatform platform = storage.queryParentPlatByServerGBId(gbId); Platform platform = storage.queryParentPlatByServerGBId(gbId);
if (device != null && platform == null) { if (device != null && platform == null) {
try { try {
commander.sendAlarmMessage(device, deviceAlarm); commander.sendAlarmMessage(device, deviceAlarm);

View File

@ -8,7 +8,7 @@ import com.genersoft.iot.vmp.conf.redis.RedisRpcConfig;
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcMessage; import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcMessage;
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcRequest; import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcRequest;
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcResponse; import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcResponse;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem; import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
import com.genersoft.iot.vmp.gb28181.session.SSRCFactory; import com.genersoft.iot.vmp.gb28181.session.SSRCFactory;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
@ -318,7 +318,7 @@ public class RedisRpcController {
} }
log.info("[redis-rpc] 推流已经停止: {}/{}, 目标地址: {}{}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort() ); log.info("[redis-rpc] 推流已经停止: {}/{}, 目标地址: {}{}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort() );
String platformId = sendRtpItem.getPlatformId(); String platformId = sendRtpItem.getPlatformId();
ParentPlatform platform = storager.queryParentPlatByServerGBId(platformId); Platform platform = storager.queryParentPlatByServerGBId(platformId);
if (platform == null) { if (platform == null) {
return response; return response;
} }

View File

@ -22,9 +22,9 @@ public interface IRedisCatchStorage {
*/ */
Long getCSEQ(); Long getCSEQ();
void updatePlatformCatchInfo(ParentPlatformCatch parentPlatformCatch); void updatePlatformCatchInfo(PlatformCatch parentPlatformCatch);
ParentPlatformCatch queryPlatformCatchInfo(String platformGbId); PlatformCatch queryPlatformCatchInfo(String platformGbId);
void delPlatformCatchInfo(String platformGbId); void delPlatformCatchInfo(String platformGbId);
@ -208,9 +208,9 @@ public interface IRedisCatchStorage {
void sendChannelAddOrDelete(String deviceId, String channelId, boolean add); void sendChannelAddOrDelete(String deviceId, String channelId, boolean add);
void sendPlatformStartPlayMsg(SendRtpItem sendRtpItem, ParentPlatform platform); void sendPlatformStartPlayMsg(SendRtpItem sendRtpItem, Platform platform);
void sendPlatformStopPlayMsg(SendRtpItem sendRtpItem, ParentPlatform platform); void sendPlatformStopPlayMsg(SendRtpItem sendRtpItem, Platform platform);
void addPushListItem(String app, String stream, MediaInfo param); void addPushListItem(String app, String stream, MediaInfo param);

View File

@ -20,26 +20,26 @@ public interface IVideoManagerStorage {
* 更新上级平台 * 更新上级平台
* @param parentPlatform * @param parentPlatform
*/ */
boolean updateParentPlatform(ParentPlatform parentPlatform); boolean updateParentPlatform(Platform parentPlatform);
/** /**
* 删除上级平台 * 删除上级平台
* @param parentPlatform * @param parentPlatform
*/ */
boolean deleteParentPlatform(ParentPlatform parentPlatform); boolean deleteParentPlatform(Platform parentPlatform);
/** /**
* 获取所有已启用的平台 * 获取所有已启用的平台
* @return * @return
*/ */
List<ParentPlatform> queryEnableParentPlatformList(boolean enable); List<Platform> queryEnableParentPlatformList(boolean enable);
/** /**
* 获取上级平台 * 获取上级平台
* @param platformGbId * @param platformGbId
* @return * @return
*/ */
ParentPlatform queryParentPlatByServerGBId(String platformGbId); Platform queryParentPlatByServerGBId(String platformGbId);
/** /**
* 移除上级平台的通道信息 * 移除上级平台的通道信息
@ -95,12 +95,12 @@ public interface IVideoManagerStorage {
int updateStreamGPS(List<GPSMsgInfo> gpsMsgInfo); int updateStreamGPS(List<GPSMsgInfo> gpsMsgInfo);
List<ParentPlatform> queryPlatFormListForGBWithGBId(String channelId, List<String> platforms); List<Platform> queryPlatFormListForGBWithGBId(String channelId, List<String> platforms);
void delRelationByPlatformId(String serverGBId); void delRelationByPlatformId(String serverGBId);
List<ChannelSourceInfo> getChannelSource(String platformId, String gbId); List<ChannelSourceInfo> getChannelSource(String platformId, String gbId);
List<ParentPlatform> queryEnablePlatformListWithAsMessageChannel(); List<Platform> queryEnablePlatformListWithAsMessageChannel();
} }

View File

@ -89,14 +89,14 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
} }
@Override @Override
public void updatePlatformCatchInfo(ParentPlatformCatch parentPlatformCatch) { public void updatePlatformCatchInfo(PlatformCatch parentPlatformCatch) {
String key = VideoManagerConstants.PLATFORM_CATCH_PREFIX + userSetting.getServerId() + "_" + parentPlatformCatch.getId(); String key = VideoManagerConstants.PLATFORM_CATCH_PREFIX + userSetting.getServerId() + "_" + parentPlatformCatch.getId();
redisTemplate.opsForValue().set(key, parentPlatformCatch); redisTemplate.opsForValue().set(key, parentPlatformCatch);
} }
@Override @Override
public ParentPlatformCatch queryPlatformCatchInfo(String platformGbId) { public PlatformCatch queryPlatformCatchInfo(String platformGbId) {
return (ParentPlatformCatch)redisTemplate.opsForValue().get(VideoManagerConstants.PLATFORM_CATCH_PREFIX + userSetting.getServerId() + "_" + platformGbId); return (PlatformCatch)redisTemplate.opsForValue().get(VideoManagerConstants.PLATFORM_CATCH_PREFIX + userSetting.getServerId() + "_" + platformGbId);
} }
@Override @Override
@ -662,7 +662,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
} }
@Override @Override
public void sendPlatformStartPlayMsg(SendRtpItem sendRtpItem, ParentPlatform platform) { public void sendPlatformStartPlayMsg(SendRtpItem sendRtpItem, 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(), sendRtpItem.getChannelId(), platform.getServerGBId(), platform.getName(), userSetting.getServerId(),
@ -675,7 +675,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
} }
@Override @Override
public void sendPlatformStopPlayMsg(SendRtpItem sendRtpItem, ParentPlatform platform) { public void sendPlatformStopPlayMsg(SendRtpItem sendRtpItem, Platform platform) {
MessageForPushChannel msg = MessageForPushChannel.getInstance(0, MessageForPushChannel msg = MessageForPushChannel.getInstance(0,
sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getChannelId(), sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getChannelId(),

View File

@ -56,7 +56,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
private DeviceMobilePositionMapper deviceMobilePositionMapper; private DeviceMobilePositionMapper deviceMobilePositionMapper;
@Autowired @Autowired
private ParentPlatformMapper platformMapper; private PlatformMapper platformMapper;
@Autowired @Autowired
private IRedisCatchStorage redisCatchStorage; private IRedisCatchStorage redisCatchStorage;
@ -91,27 +91,27 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
} }
@Override @Override
public boolean updateParentPlatform(ParentPlatform parentPlatform) { public boolean updateParentPlatform(Platform parentPlatform) {
int result = 0; int result = 0;
if (parentPlatform.getCatalogGroup() == 0) { if (parentPlatform.getCatalogGroup() == 0) {
parentPlatform.setCatalogGroup(1); parentPlatform.setCatalogGroup(1);
} }
ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId()); PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId());
if (parentPlatform.getId() == null ) { if (parentPlatform.getId() == null ) {
if (parentPlatform.getCatalogId() == null) { if (parentPlatform.getCatalogId() == null) {
parentPlatform.setCatalogId(parentPlatform.getServerGBId()); parentPlatform.setCatalogId(parentPlatform.getServerGBId());
} }
result = platformMapper.addParentPlatform(parentPlatform); result = platformMapper.addParentPlatform(parentPlatform);
if (parentPlatformCatch == null) { if (parentPlatformCatch == null) {
parentPlatformCatch = new ParentPlatformCatch(); parentPlatformCatch = new PlatformCatch();
parentPlatformCatch.setParentPlatform(parentPlatform); parentPlatformCatch.setParentPlatform(parentPlatform);
parentPlatformCatch.setId(parentPlatform.getServerGBId()); parentPlatformCatch.setId(parentPlatform.getServerGBId());
} }
}else { }else {
if (parentPlatformCatch == null) { // serverGBId 已变化 if (parentPlatformCatch == null) { // serverGBId 已变化
ParentPlatform parentPlatById = platformMapper.getParentPlatById(parentPlatform.getId()); Platform parentPlatById = platformMapper.getParentPlatById(parentPlatform.getId());
// 使用旧的查出缓存ID // 使用旧的查出缓存ID
parentPlatformCatch = new ParentPlatformCatch(); parentPlatformCatch = new PlatformCatch();
parentPlatformCatch.setId(parentPlatform.getServerGBId()); parentPlatformCatch.setId(parentPlatform.getServerGBId());
redisCatchStorage.delPlatformCatchInfo(parentPlatById.getServerGBId()); redisCatchStorage.delPlatformCatchInfo(parentPlatById.getServerGBId());
} }
@ -127,7 +127,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
@Transactional @Transactional
@Override @Override
public boolean deleteParentPlatform(ParentPlatform parentPlatform) { public boolean deleteParentPlatform(Platform parentPlatform) {
int result = platformMapper.delParentPlatform(parentPlatform); int result = platformMapper.delParentPlatform(parentPlatform);
// 删除关联的通道 // 删除关联的通道
platformChannelMapper.cleanChannelForGB(parentPlatform.getServerGBId()); platformChannelMapper.cleanChannelForGB(parentPlatform.getServerGBId());
@ -135,17 +135,17 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
} }
@Override @Override
public ParentPlatform queryParentPlatByServerGBId(String platformGbId) { public Platform queryParentPlatByServerGBId(String platformGbId) {
return platformMapper.getParentPlatByServerGBId(platformGbId); return platformMapper.getParentPlatByServerGBId(platformGbId);
} }
@Override @Override
public List<ParentPlatform> queryEnableParentPlatformList(boolean enable) { public List<Platform> queryEnableParentPlatformList(boolean enable) {
return platformMapper.getEnableParentPlatformList(enable); return platformMapper.getEnableParentPlatformList(enable);
} }
@Override @Override
public List<ParentPlatform> queryEnablePlatformListWithAsMessageChannel() { public List<Platform> queryEnablePlatformListWithAsMessageChannel() {
return platformMapper.queryEnablePlatformListWithAsMessageChannel(); return platformMapper.queryEnablePlatformListWithAsMessageChannel();
} }
@ -266,29 +266,8 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
return gbStreamMapper.updateStreamGPS(gpsMsgInfos); return gbStreamMapper.updateStreamGPS(gpsMsgInfos);
} }
private DeviceChannel getDeviceChannelByCatalog(PlatformCatalog catalog) {
ParentPlatform platform = platformMapper.getParentPlatByServerGBId(catalog.getPlatformId());
DeviceChannel deviceChannel = new DeviceChannel();
deviceChannel.setDeviceId(catalog.getId());
deviceChannel.setName(catalog.getName());
deviceChannel.setDeviceId(platform.getDeviceGBId());
deviceChannel.setManufacturer("wvp-pro");
deviceChannel.setStatus("ON");
deviceChannel.setParental(1);
deviceChannel.setRegisterWay(1);
deviceChannel.setParentId(catalog.getParentId());
deviceChannel.setBusinessGroupId(catalog.getBusinessGroupId());
deviceChannel.setModel("live");
deviceChannel.setOwner("wvp-pro");
deviceChannel.setSecrecy(0);
return deviceChannel;
}
@Override @Override
public List<ParentPlatform> queryPlatFormListForGBWithGBId(String channelId, List<String> platforms) { public List<Platform> queryPlatFormListForGBWithGBId(String channelId, List<String> platforms) {
return platformChannelMapper.queryPlatFormListForGBWithGBId(channelId, platforms); return platformChannelMapper.queryPlatFormListForGBWithGBId(channelId, platforms);
} }

View File

@ -244,33 +244,35 @@ create table wvp_media_server
create table wvp_platform create table wvp_platform
( (
id serial primary key, id serial primary key,
enable bool default false, enable bool default false,
name character varying(255), name character varying(255),
server_gb_id character varying(50), server_gb_id character varying(50),
server_gb_domain character varying(50), server_gb_domain character varying(50),
server_ip character varying(50), server_ip character varying(50),
server_port integer, server_port integer,
device_gb_id character varying(50), device_gb_id character varying(50),
device_ip character varying(50), device_ip character varying(50),
device_port character varying(50), device_port character varying(50),
username character varying(255), username character varying(255),
password character varying(50), password character varying(50),
expires character varying(50), expires character varying(50),
keep_timeout character varying(50), keep_timeout character varying(50),
transport character varying(50), transport character varying(50),
character_set character varying(50), character_set character varying(50),
catalog_id character varying(50), ptz bool default false,
ptz bool default false, rtcp bool default false,
rtcp bool default false, status bool default false,
status bool default false, catalog_group integer,
start_offline_push bool default false, create_time character varying(50),
catalog_group integer, update_time character varying(50),
create_time character varying(50), as_message_channel bool default false,
update_time character varying(50), custom_group bool default false,
as_message_channel bool default false, catalog_with_platform bool default true,
custom_catalog bool default false, catalog_with_group bool default true,
send_stream_ip character varying(50), catalog_with_region bool default true,
send_stream_ip character varying(50),
device_civil_code character varying(50),
constraint uk_platform_unique_server_gb_id unique (server_gb_id) constraint uk_platform_unique_server_gb_id unique (server_gb_id)
); );
@ -283,9 +285,8 @@ create table wvp_platform_gb_channel
device_id character varying(50), device_id character varying(50),
name character varying(255), name character varying(255),
civil_code character varying(50), civil_code character varying(50),
group_id integer, parent_id character varying(50),
parental integer, business_group_id character varying(50),
parent_id character varying(255),
constraint uk_platform_gb_channel_platform_id_catalog_id_device_channel_id unique (platform_id, device_channel_id), constraint uk_platform_gb_channel_platform_id_catalog_id_device_channel_id unique (platform_id, device_channel_id),
constraint uk_platform_gb_channel_device_id unique (device_id) constraint uk_platform_gb_channel_device_id unique (device_id)
); );
@ -316,17 +317,17 @@ create table wvp_stream_proxy
create table wvp_stream_push create table wvp_stream_push
( (
id serial primary key, id serial primary key,
app character varying(255), app character varying(255),
stream character varying(255), stream character varying(255),
create_time character varying(50), create_time character varying(50),
media_server_id character varying(50), media_server_id character varying(50),
server_id character varying(50), server_id character varying(50),
push_time character varying(50), push_time character varying(50),
status bool default false, status bool default false,
update_time character varying(50), update_time character varying(50),
pushing bool default false, pushing bool default false,
self bool default false, self bool default false,
start_offline_push bool default true, start_offline_push bool default true,
constraint uk_stream_push_app_stream unique (app, stream) constraint uk_stream_push_app_stream unique (app, stream)
); );