添加自动拉起未推流设备的控制开关

This commit is contained in:
648540858
2022-04-18 10:52:38 +08:00
parent 0dc1807f62
commit d36920c699
9 changed files with 264 additions and 220 deletions

View File

@@ -129,6 +129,11 @@ public class ParentPlatform {
*/
private boolean mobilePositionSubscribe;
/**
* 点播未推流的设备时是否使用redis通知拉起
*/
private boolean startOfflinePush;
public Integer getId() {
return id;
}
@@ -329,4 +334,12 @@ public class ParentPlatform {
public void setMobilePositionSubscribe(boolean mobilePositionSubscribe) {
this.mobilePositionSubscribe = mobilePositionSubscribe;
}
public boolean isStartOfflinePush() {
return startOfflinePush;
}
public void setStartOfflinePush(boolean startOfflinePush) {
this.startOfflinePush = startOfflinePush;
}
}

View File

@@ -397,6 +397,10 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
logger.info("[ app={}, stream={} ]通道离线,启用流后开始推流",gbStream.getApp(), gbStream.getStream());
responseAck(evt, Response.BAD_REQUEST, "channel [" + gbStream.getGbId() + "] offline");
}else if ("push".equals(gbStream.getStreamType())) {
if (!platform.isStartOfflinePush()) {
responseAck(evt, Response.TEMPORARILY_UNAVAILABLE, "channel unavailable");
return;
}
// 发送redis消息以使设备上线
logger.info("[ app={}, stream={} ]通道离线发送redis信息控制设备开始推流",gbStream.getApp(), gbStream.getStream());
MessageForPushChannel messageForPushChannel = new MessageForPushChannel();

View File

@@ -16,10 +16,10 @@ public interface ParentPlatformMapper {
@Insert("INSERT INTO parent_platform (enable, name, serverGBId, serverGBDomain, serverIP, serverPort, deviceGBId, deviceIp, " +
" devicePort, username, password, expires, keepTimeout, transport, characterSet, ptz, rtcp, " +
" status, shareAllLiveStream, catalogId) " +
" status, shareAllLiveStream, startOfflinePush, catalogId) " +
" VALUES (${enable}, '${name}', '${serverGBId}', '${serverGBDomain}', '${serverIP}', ${serverPort}, '${deviceGBId}', '${deviceIp}', " +
" '${devicePort}', '${username}', '${password}', '${expires}', '${keepTimeout}', '${transport}', '${characterSet}', ${ptz}, ${rtcp}, " +
" ${status}, ${shareAllLiveStream}, #{catalogId})")
" ${status}, ${shareAllLiveStream}, ${startOfflinePush}, #{catalogId})")
int addParentPlatform(ParentPlatform parentPlatform);
@Update("UPDATE parent_platform " +
@@ -42,6 +42,7 @@ public interface ParentPlatformMapper {
"rtcp=#{rtcp}, " +
"status=#{status}, " +
"shareAllLiveStream=#{shareAllLiveStream}, " +
"startOfflinePush=${startOfflinePush}, " +
"catalogId=#{catalogId} " +
"WHERE id=#{id}")
int updateParentPlatform(ParentPlatform parentPlatform);