完善国标级联点播推流,拉流代理,国标
parent
20f93d52d7
commit
9247c7e805
|
@ -38,32 +38,33 @@ public class SipPlatformRunner implements CommandLineRunner {
|
||||||
@Override
|
@Override
|
||||||
public void run(String... args) throws Exception {
|
public void run(String... args) throws Exception {
|
||||||
// 获取所有启用的平台
|
// 获取所有启用的平台
|
||||||
List<Platform> parentPlatforms = storager.queryEnableParentPlatformList(true);
|
List<Platform> parentPlatforms = platformService.queryEnablePlatformList();
|
||||||
|
|
||||||
for (Platform parentPlatform : parentPlatforms) {
|
for (Platform platform : parentPlatforms) {
|
||||||
|
|
||||||
PlatformCatch parentPlatformCatchOld = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId());
|
PlatformCatch parentPlatformCatchOld = redisCatchStorage.queryPlatformCatchInfo(platform.getServerGBId());
|
||||||
|
|
||||||
// 更新缓存
|
// 更新缓存
|
||||||
PlatformCatch parentPlatformCatch = new PlatformCatch();
|
PlatformCatch parentPlatformCatch = new PlatformCatch();
|
||||||
parentPlatformCatch.setPlatform(parentPlatform);
|
parentPlatformCatch.setPlatform(platform);
|
||||||
parentPlatformCatch.setId(parentPlatform.getServerGBId());
|
parentPlatformCatch.setId(platform.getServerGBId());
|
||||||
redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
|
redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
|
||||||
if (parentPlatformCatchOld != null) {
|
if (parentPlatformCatchOld != null) {
|
||||||
// 取消订阅
|
// 取消订阅
|
||||||
try {
|
try {
|
||||||
sipCommanderForPlatform.unregister(parentPlatform, parentPlatformCatchOld.getSipTransactionInfo(), null, (eventResult)->{
|
log.info("[平台主动注销] {}({})", platform.getName(), platform.getServerGBId());
|
||||||
platformService.login(parentPlatform);
|
sipCommanderForPlatform.unregister(platform, parentPlatformCatchOld.getSipTransactionInfo(), null, (eventResult)->{
|
||||||
|
platformService.login(platform);
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("[命令发送失败] 国标级联 注销: {}", e.getMessage());
|
log.error("[命令发送失败] 国标级联 注销: {}", e.getMessage());
|
||||||
platformService.offline(parentPlatform, true);
|
platformService.offline(platform, true);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置所有平台离线
|
// 设置平台离线
|
||||||
platformService.offline(parentPlatform, false);
|
platformService.offline(platform, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ public interface PlatformChannelMapper {
|
||||||
"left join wvp_device_channel dc on " +
|
"left join wvp_device_channel dc on " +
|
||||||
"dc.id = pgc.device_channel_id " +
|
"dc.id = pgc.device_channel_id " +
|
||||||
"WHERE " +
|
"WHERE " +
|
||||||
"dc.channel_id = #{channelId} and pp.status = true " +
|
"dc.device_id = #{channelId} and pp.status = true " +
|
||||||
"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> ")
|
||||||
|
|
|
@ -83,4 +83,7 @@ public interface PlatformMapper {
|
||||||
@Update("UPDATE wvp_platform SET status=#{online} WHERE server_gb_id=#{platformGbID}" )
|
@Update("UPDATE wvp_platform SET status=#{online} WHERE server_gb_id=#{platformGbID}" )
|
||||||
int updateStatus(@Param("platformGbID") String platformGbID, @Param("online") boolean online);
|
int updateStatus(@Param("platformGbID") String platformGbID, @Param("online") boolean online);
|
||||||
|
|
||||||
|
@Select("SELECT * FROM wvp_platform WHERE enable=true")
|
||||||
|
List<Platform> queryEnablePlatformList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,11 +28,11 @@ public class RecordEndEventListener implements ApplicationListener<RecordEndEven
|
||||||
String channelId = event.getRecordInfo().getChannelId();
|
String channelId = event.getRecordInfo().getChannelId();
|
||||||
int count = event.getRecordInfo().getCount();
|
int count = event.getRecordInfo().getCount();
|
||||||
int sumNum = event.getRecordInfo().getSumNum();
|
int sumNum = event.getRecordInfo().getSumNum();
|
||||||
log.info("录像查询完成事件触发,deviceId:{}, channelId: {}, 录像数量{}/{}条", event.getRecordInfo().getDeviceId(),
|
log.info("录像查询事件触发,deviceId:{}, channelId: {}, 录像数量{}/{}条", event.getRecordInfo().getDeviceId(),
|
||||||
event.getRecordInfo().getChannelId(), count,sumNum);
|
event.getRecordInfo().getChannelId(), count,sumNum);
|
||||||
if (!handlerMap.isEmpty()) {
|
if (!handlerMap.isEmpty()) {
|
||||||
RecordEndEventHandler handler = handlerMap.get(deviceId + channelId);
|
RecordEndEventHandler handler = handlerMap.get(deviceId + channelId);
|
||||||
log.info("录像查询完成事件触发, 发送订阅,deviceId:{}, channelId: {}",
|
log.info("录像查询事件触发, 发送订阅,deviceId:{}, channelId: {}",
|
||||||
event.getRecordInfo().getDeviceId(), event.getRecordInfo().getChannelId());
|
event.getRecordInfo().getDeviceId(), event.getRecordInfo().getChannelId());
|
||||||
if (handler !=null){
|
if (handler !=null){
|
||||||
handler.handler(event.getRecordInfo());
|
handler.handler(event.getRecordInfo());
|
||||||
|
|
|
@ -12,6 +12,7 @@ import com.github.pagehelper.PageInfo;
|
||||||
import javax.sip.InvalidArgumentException;
|
import javax.sip.InvalidArgumentException;
|
||||||
import javax.sip.SipException;
|
import javax.sip.SipException;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国标平台的业务类
|
* 国标平台的业务类
|
||||||
|
@ -84,4 +85,8 @@ public interface IPlatformService {
|
||||||
void addSimulatedSubscribeInfo(Platform parentPlatform);
|
void addSimulatedSubscribeInfo(Platform parentPlatform);
|
||||||
|
|
||||||
Platform queryOne(Integer platformId);
|
Platform queryOne(Integer platformId);
|
||||||
|
|
||||||
|
List<Platform> queryEnablePlatformList();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.gb28181.bean.PlayException;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IGbChannelPlayService;
|
import com.genersoft.iot.vmp.gb28181.service.IGbChannelPlayService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IPlayService;
|
import com.genersoft.iot.vmp.gb28181.service.IPlayService;
|
||||||
import com.genersoft.iot.vmp.service.bean.ErrorCallback;
|
import com.genersoft.iot.vmp.service.bean.ErrorCallback;
|
||||||
|
import com.genersoft.iot.vmp.service.bean.InviteErrorCode;
|
||||||
import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyPlayService;
|
import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyPlayService;
|
||||||
import com.genersoft.iot.vmp.streamPush.service.IStreamPushPlayService;
|
import com.genersoft.iot.vmp.streamPush.service.IStreamPushPlayService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@ -38,13 +39,13 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
|
||||||
}
|
}
|
||||||
log.info("[点播通用通道] 类型:{}, 通道: {}({})", inviteInfo.getSessionName(), channel.getGbName(), channel.getGbDeviceId());
|
log.info("[点播通用通道] 类型:{}, 通道: {}({})", inviteInfo.getSessionName(), channel.getGbName(), channel.getGbDeviceId());
|
||||||
if ("Play".equalsIgnoreCase(inviteInfo.getSessionName())) {
|
if ("Play".equalsIgnoreCase(inviteInfo.getSessionName())) {
|
||||||
if (channel.getGbDeviceDbId() > 0) {
|
if (channel.getGbDeviceDbId() != null) {
|
||||||
// 国标通道
|
// 国标通道
|
||||||
playGbDeviceChannel(channel, callback);
|
playGbDeviceChannel(channel, callback);
|
||||||
} else if (channel.getStreamProxyId() > 0) {
|
} else if (channel.getStreamProxyId() != null) {
|
||||||
// 拉流代理
|
// 拉流代理
|
||||||
playProxy(channel, callback);
|
playProxy(channel, callback);
|
||||||
} else if (channel.getStreamPushId() > 0) {
|
} else if (channel.getStreamPushId() != null) {
|
||||||
// 推流
|
// 推流
|
||||||
playPush(channel, platform.getServerGBId(), platform.getName(), callback);
|
playPush(channel, platform.getServerGBId(), platform.getName(), callback);
|
||||||
} else {
|
} else {
|
||||||
|
@ -53,14 +54,14 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
|
||||||
throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error");
|
throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error");
|
||||||
}
|
}
|
||||||
}else if ("Playback".equals(inviteInfo.getSessionName())) {
|
}else if ("Playback".equals(inviteInfo.getSessionName())) {
|
||||||
if (channel.getGbDeviceDbId() > 0) {
|
if (channel.getGbDeviceDbId() != null) {
|
||||||
// 国标通道
|
// 国标通道
|
||||||
playbackGbDeviceChannel(channel, inviteInfo.getStartTime(), inviteInfo.getStopTime(), callback);
|
playbackGbDeviceChannel(channel, inviteInfo.getStartTime(), inviteInfo.getStopTime(), callback);
|
||||||
} else if (channel.getStreamProxyId() > 0) {
|
} else if (channel.getStreamProxyId() != null) {
|
||||||
// 拉流代理
|
// 拉流代理
|
||||||
log.warn("[回放通用通道] 不支持回放拉流代理的录像: {}({})", channel.getGbName(), channel.getGbDeviceId());
|
log.warn("[回放通用通道] 不支持回放拉流代理的录像: {}({})", channel.getGbName(), channel.getGbDeviceId());
|
||||||
throw new PlayException(Response.FORBIDDEN, "forbidden");
|
throw new PlayException(Response.FORBIDDEN, "forbidden");
|
||||||
} else if (channel.getStreamPushId() > 0) {
|
} else if (channel.getStreamPushId() != null) {
|
||||||
// 推流
|
// 推流
|
||||||
log.warn("[回放通用通道] 不支持回放推流的录像: {}({})", channel.getGbName(), channel.getGbDeviceId());
|
log.warn("[回放通用通道] 不支持回放推流的录像: {}({})", channel.getGbName(), channel.getGbDeviceId());
|
||||||
throw new PlayException(Response.FORBIDDEN, "forbidden");
|
throw new PlayException(Response.FORBIDDEN, "forbidden");
|
||||||
|
@ -70,7 +71,7 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
|
||||||
throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error");
|
throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error");
|
||||||
}
|
}
|
||||||
}else if ("Download".equals(inviteInfo.getSessionName())) {
|
}else if ("Download".equals(inviteInfo.getSessionName())) {
|
||||||
if (channel.getGbDeviceDbId() > 0) {
|
if (channel.getGbDeviceDbId() != null) {
|
||||||
int downloadSpeed = 4;
|
int downloadSpeed = 4;
|
||||||
try {
|
try {
|
||||||
if (inviteInfo.getDownloadSpeed() != null){
|
if (inviteInfo.getDownloadSpeed() != null){
|
||||||
|
@ -80,11 +81,11 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
|
||||||
|
|
||||||
// 国标通道
|
// 国标通道
|
||||||
downloadGbDeviceChannel(channel, inviteInfo.getStartTime(), inviteInfo.getStopTime(), downloadSpeed, callback);
|
downloadGbDeviceChannel(channel, inviteInfo.getStartTime(), inviteInfo.getStopTime(), downloadSpeed, callback);
|
||||||
} else if (channel.getStreamProxyId() > 0) {
|
} else if (channel.getStreamProxyId() != null) {
|
||||||
// 拉流代理
|
// 拉流代理
|
||||||
log.warn("[下载通用通道录像] 不支持下载拉流代理的录像: {}({})", channel.getGbName(), channel.getGbDeviceId());
|
log.warn("[下载通用通道录像] 不支持下载拉流代理的录像: {}({})", channel.getGbName(), channel.getGbDeviceId());
|
||||||
throw new PlayException(Response.FORBIDDEN, "forbidden");
|
throw new PlayException(Response.FORBIDDEN, "forbidden");
|
||||||
} else if (channel.getStreamPushId() > 0) {
|
} else if (channel.getStreamPushId() != null) {
|
||||||
// 推流
|
// 推流
|
||||||
log.warn("[下载通用通道录像] 不支持下载推流的录像: {}({})", channel.getGbName(), channel.getGbDeviceId());
|
log.warn("[下载通用通道录像] 不支持下载推流的录像: {}({})", channel.getGbName(), channel.getGbDeviceId());
|
||||||
throw new PlayException(Response.FORBIDDEN, "forbidden");
|
throw new PlayException(Response.FORBIDDEN, "forbidden");
|
||||||
|
@ -107,6 +108,7 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
|
||||||
} catch (PlayException e) {
|
} catch (PlayException e) {
|
||||||
callback.run(e.getCode(), e.getMsg(), null);
|
callback.run(e.getCode(), e.getMsg(), null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
log.error("[点播失败] {}({})", channel.getGbName(), channel.getGbDeviceId(), e);
|
||||||
callback.run(Response.BUSY_HERE, "busy here", null);
|
callback.run(Response.BUSY_HERE, "busy here", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,7 +120,7 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
|
||||||
if (streamInfo == null) {
|
if (streamInfo == null) {
|
||||||
callback.run(Response.BUSY_HERE, "busy here", null);
|
callback.run(Response.BUSY_HERE, "busy here", null);
|
||||||
}else {
|
}else {
|
||||||
callback.run(Response.OK, "success", streamInfo);
|
callback.run(InviteErrorCode.SUCCESS.getCode(), InviteErrorCode.SUCCESS.getMsg(), streamInfo);
|
||||||
}
|
}
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
callback.run(Response.BUSY_HERE, "busy here", null);
|
callback.run(Response.BUSY_HERE, "busy here", null);
|
||||||
|
|
|
@ -370,7 +370,6 @@ public class GbChannelServiceImpl implements IGbChannelService {
|
||||||
return channelList;
|
return channelList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Set<Group> getAllGroup(Set<Group> regionChannelList ) {
|
private Set<Group> getAllGroup(Set<Group> regionChannelList ) {
|
||||||
if (regionChannelList.isEmpty()) {
|
if (regionChannelList.isEmpty()) {
|
||||||
return new HashSet<>();
|
return new HashSet<>();
|
||||||
|
|
|
@ -43,6 +43,7 @@ import javax.sip.InvalidArgumentException;
|
||||||
import javax.sip.ResponseEvent;
|
import javax.sip.ResponseEvent;
|
||||||
import javax.sip.SipException;
|
import javax.sip.SipException;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
@ -365,7 +366,7 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void offline(Platform platform, boolean stopRegister) {
|
public void offline(Platform platform, boolean stopRegister) {
|
||||||
log.info("[平台离线]:{}", platform.getServerGBId());
|
log.info("[平台离线]:{}({})", platform.getName(), platform.getServerGBId());
|
||||||
PlatformCatch platformCatch = redisCatchStorage.queryPlatformCatchInfo(platform.getServerGBId());
|
PlatformCatch platformCatch = redisCatchStorage.queryPlatformCatchInfo(platform.getServerGBId());
|
||||||
platformCatch.setKeepAliveReply(0);
|
platformCatch.setKeepAliveReply(0);
|
||||||
platformCatch.setRegisterAliveReply(0);
|
platformCatch.setRegisterAliveReply(0);
|
||||||
|
@ -376,17 +377,17 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
platformMapper.updateStatus(platform.getServerGBId(), false);
|
platformMapper.updateStatus(platform.getServerGBId(), false);
|
||||||
|
|
||||||
// 停止所有推流
|
// 停止所有推流
|
||||||
log.info("[平台离线] {}, 停止所有推流", platform.getServerGBId());
|
log.info("[平台离线] {}({}), 停止所有推流", platform.getName(), platform.getServerGBId());
|
||||||
stopAllPush(platform.getServerGBId());
|
stopAllPush(platform.getServerGBId());
|
||||||
|
|
||||||
// 清除注册定时
|
// 清除注册定时
|
||||||
log.info("[平台离线] {}, 停止定时注册任务", platform.getServerGBId());
|
log.info("[平台离线] {}({}), 停止定时注册任务", platform.getName(), platform.getServerGBId());
|
||||||
final String registerTaskKey = REGISTER_KEY_PREFIX + platform.getServerGBId();
|
final String registerTaskKey = REGISTER_KEY_PREFIX + platform.getServerGBId();
|
||||||
if (dynamicTask.contains(registerTaskKey)) {
|
if (dynamicTask.contains(registerTaskKey)) {
|
||||||
dynamicTask.stop(registerTaskKey);
|
dynamicTask.stop(registerTaskKey);
|
||||||
}
|
}
|
||||||
// 清除心跳定时
|
// 清除心跳定时
|
||||||
log.info("[平台离线] {}, 停止定时发送心跳任务", platform.getServerGBId());
|
log.info("[平台离线] {}({}), 停止定时发送心跳任务", platform.getName(), platform.getServerGBId());
|
||||||
final String keepaliveTaskKey = KEEPALIVE_KEY_PREFIX + platform.getServerGBId();
|
final String keepaliveTaskKey = KEEPALIVE_KEY_PREFIX + platform.getServerGBId();
|
||||||
if (dynamicTask.contains(keepaliveTaskKey)) {
|
if (dynamicTask.contains(keepaliveTaskKey)) {
|
||||||
// 清除心跳任务
|
// 清除心跳任务
|
||||||
|
@ -396,11 +397,11 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
SubscribeInfo catalogSubscribe = subscribeHolder.getCatalogSubscribe(platform.getServerGBId());
|
SubscribeInfo catalogSubscribe = subscribeHolder.getCatalogSubscribe(platform.getServerGBId());
|
||||||
if (catalogSubscribe != null) {
|
if (catalogSubscribe != null) {
|
||||||
if (catalogSubscribe.getExpires() > 0) {
|
if (catalogSubscribe.getExpires() > 0) {
|
||||||
log.info("[平台离线] {}, 停止目录订阅回复", platform.getServerGBId());
|
log.info("[平台离线] {}({}), 停止目录订阅回复", platform.getName(), platform.getServerGBId());
|
||||||
subscribeHolder.removeCatalogSubscribe(platform.getServerGBId());
|
subscribeHolder.removeCatalogSubscribe(platform.getServerGBId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.info("[平台离线] {}, 停止移动位置订阅回复", platform.getServerGBId());
|
log.info("[平台离线] {}({}), 停止移动位置订阅回复", platform.getName(), platform.getServerGBId());
|
||||||
subscribeHolder.removeMobilePositionSubscribe(platform.getServerGBId());
|
subscribeHolder.removeMobilePositionSubscribe(platform.getServerGBId());
|
||||||
// 发起定时自动重新注册
|
// 发起定时自动重新注册
|
||||||
if (!stopRegister) {
|
if (!stopRegister) {
|
||||||
|
@ -436,7 +437,7 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
// 添加注册任务
|
// 添加注册任务
|
||||||
dynamicTask.startCron(registerTaskKey,
|
dynamicTask.startCron(registerTaskKey,
|
||||||
// 注册失败(注册成功时由程序直接调用了online方法)
|
// 注册失败(注册成功时由程序直接调用了online方法)
|
||||||
()-> log.info("[国标级联] {},平台离线后持续发起注册,失败", platform.getServerGBId()),
|
()-> log.info("[国标级联] {}({}),平台离线后持续发起注册,失败", platform.getName(), platform.getServerGBId()),
|
||||||
60*1000);
|
60*1000);
|
||||||
}, null);
|
}, null);
|
||||||
} catch (InvalidArgumentException | ParseException | SipException e) {
|
} catch (InvalidArgumentException | ParseException | SipException e) {
|
||||||
|
@ -809,4 +810,9 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
public Platform queryOne(Integer platformId) {
|
public Platform queryOne(Integer platformId) {
|
||||||
return platformMapper.query(platformId);
|
return platformMapper.query(platformId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Platform> queryEnablePlatformList() {
|
||||||
|
return platformMapper.queryEnablePlatformList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -585,7 +585,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
|
||||||
|
|
||||||
recordXml.append("</RecordList>\r\n")
|
recordXml.append("</RecordList>\r\n")
|
||||||
.append("</Response>\r\n");
|
.append("</Response>\r\n");
|
||||||
log.info("[国标级联] 发送录像数据通道:{}, 内容: {}", recordInfo.getChannelId(), recordXml);
|
log.debug("[国标级联] 发送录像数据通道:{}, 内容: {}", recordInfo.getChannelId(), recordXml);
|
||||||
// callid
|
// callid
|
||||||
CallIdHeader callIdHeader = sipSender.getNewCallIdHeader(parentPlatform.getDeviceIp(),parentPlatform.getTransport());
|
CallIdHeader callIdHeader = sipSender.getNewCallIdHeader(parentPlatform.getDeviceIp(),parentPlatform.getTransport());
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ import com.genersoft.iot.vmp.media.event.hook.HookSubscribe;
|
||||||
import com.genersoft.iot.vmp.media.event.hook.HookType;
|
import com.genersoft.iot.vmp.media.event.hook.HookType;
|
||||||
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
||||||
import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager;
|
import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager;
|
||||||
|
import com.genersoft.iot.vmp.service.bean.InviteErrorCode;
|
||||||
import com.genersoft.iot.vmp.service.bean.MessageForPushChannel;
|
import com.genersoft.iot.vmp.service.bean.MessageForPushChannel;
|
||||||
import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcService;
|
import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcService;
|
||||||
import com.genersoft.iot.vmp.service.redisMsg.RedisPushStreamResponseListener;
|
import com.genersoft.iot.vmp.service.redisMsg.RedisPushStreamResponseListener;
|
||||||
|
@ -180,7 +181,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
}
|
}
|
||||||
|
|
||||||
channelPlayService.start(channel, inviteInfo, platform, ((code, msg, streamInfo) -> {
|
channelPlayService.start(channel, inviteInfo, platform, ((code, msg, streamInfo) -> {
|
||||||
if (code != Response.OK) {
|
if (code != InviteErrorCode.SUCCESS.getCode()) {
|
||||||
try {
|
try {
|
||||||
responseAck(request, code, msg);
|
responseAck(request, code, msg);
|
||||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
} catch (SipException | InvalidArgumentException | ParseException e) {
|
||||||
|
|
|
@ -106,7 +106,7 @@ public class RecordInfoQueryMessageHandler extends SIPRequestProcessorParent imp
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (channel.getStreamProxyId() > 0 || channel.getStreamPushId() > 0) {
|
if (channel.getStreamProxyId() != null || channel.getStreamPushId() != null ) {
|
||||||
log.info("[平台查询录像记录] 不支持查询推流和拉流代理的录像数据 {}/{}", parentPlatform.getName(), channelId );
|
log.info("[平台查询录像记录] 不支持查询推流和拉流代理的录像数据 {}/{}", parentPlatform.getName(), channelId );
|
||||||
try {
|
try {
|
||||||
responseAck(request, Response.NOT_IMPLEMENTED); // 回复未实现
|
responseAck(request, Response.NOT_IMPLEMENTED); // 回复未实现
|
||||||
|
@ -126,7 +126,7 @@ public class RecordInfoQueryMessageHandler extends SIPRequestProcessorParent imp
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 接收录像数据
|
// 接收录像数据
|
||||||
recordEndEventListener.addEndEventHandler(channel.getGbDeviceId(), channelId, (recordInfo)->{
|
recordEndEventListener.addEndEventHandler(device.getDeviceId(), channelId, (recordInfo)->{
|
||||||
try {
|
try {
|
||||||
log.info("[国标级联] 录像查询收到数据, 通道: {},准备转发===", channelId);
|
log.info("[国标级联] 录像查询收到数据, 通道: {},准备转发===", channelId);
|
||||||
cmderFroPlatform.recordInfo(channel, parentPlatform, request.getFromTag(), recordInfo);
|
cmderFroPlatform.recordInfo(channel, parentPlatform, request.getFromTag(), recordInfo);
|
||||||
|
|
|
@ -847,7 +847,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
|
||||||
log.info("[startSendRtpStream] 失败, mediaServer的类型: {},未找到对应的实现类", mediaServer.getType());
|
log.info("[startSendRtpStream] 失败, mediaServer的类型: {},未找到对应的实现类", mediaServer.getType());
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到mediaServer对应的实现类");
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到mediaServer对应的实现类");
|
||||||
}
|
}
|
||||||
log.info("[开始推流] rtp/{}, 目标={}:{},SSRC={}, RTCP={}", sendRtpItem.getStream(),
|
log.info("[开始推流] {}/{}, 目标={}:{},SSRC={}, RTCP={}", sendRtpItem.getApp(), sendRtpItem.getStream(),
|
||||||
sendRtpItem.getIp(), sendRtpItem.getPort(), sendRtpItem.getSsrc(), sendRtpItem.isRtcp());
|
sendRtpItem.getIp(), sendRtpItem.getPort(), sendRtpItem.getSsrc(), sendRtpItem.isRtcp());
|
||||||
mediaNodeServerService.startSendRtpStream(mediaServer, sendRtpItem);
|
mediaNodeServerService.startSendRtpStream(mediaServer, sendRtpItem);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,10 +28,6 @@ public class StreamProxyPlayServiceImpl implements IStreamProxyPlayService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMediaServerService mediaServerService;
|
private IMediaServerService mediaServerService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StreamInfo start(int id) {
|
public StreamInfo start(int id) {
|
||||||
StreamProxy streamProxy = streamProxyMapper.select(id);
|
StreamProxy streamProxy = streamProxyMapper.select(id);
|
||||||
|
|
Loading…
Reference in New Issue