| | |
| | | import com.genersoft.iot.vmp.conf.DynamicTask; |
| | | import com.genersoft.iot.vmp.conf.UserSetting; |
| | | import com.genersoft.iot.vmp.gb28181.bean.*; |
| | | import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager; |
| | | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| | | import com.genersoft.iot.vmp.gb28181.task.ISubscribeTask; |
| | | import com.genersoft.iot.vmp.gb28181.task.impl.CatalogSubscribeTask; |
| | | import com.genersoft.iot.vmp.gb28181.task.impl.MobilePositionSubscribeTask; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd.CatalogResponseMessageHandler; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.service.IDeviceChannelService; |
| | | import com.genersoft.iot.vmp.service.IDeviceService; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | |
| | | import javax.sip.SipException; |
| | | import java.text.ParseException; |
| | | import java.time.Instant; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private IMediaServerService mediaServerService; |
| | | |
| | | @Autowired |
| | | private AudioBroadcastManager audioBroadcastManager; |
| | | |
| | | @Autowired |
| | | private ZLMRESTfulUtils zlmresTfulUtils; |
| | | |
| | | @Override |
| | | public void online(Device device) { |
| | |
| | | // 移除订阅 |
| | | removeCatalogSubscribe(device); |
| | | removeMobilePositionSubscribe(device); |
| | | List<AudioBroadcastCatch> audioBroadcastCatches = audioBroadcastManager.get(deviceId); |
| | | if (audioBroadcastCatches.size() > 0) { |
| | | for (AudioBroadcastCatch audioBroadcastCatch : audioBroadcastCatches) { |
| | | |
| | | SendRtpItem sendRtpItem = redisCatchStorage.querySendRTPServer(deviceId, audioBroadcastCatch.getChannelId(), null, null); |
| | | if (sendRtpItem != null) { |
| | | redisCatchStorage.deleteSendRTPServer(deviceId, sendRtpItem.getChannelId(), null, null); |
| | | MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId()); |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("vhost", "__defaultVhost__"); |
| | | param.put("app", sendRtpItem.getApp()); |
| | | param.put("stream", sendRtpItem.getStream()); |
| | | zlmresTfulUtils.stopSendRtp(mediaInfo, param); |
| | | } |
| | | |
| | | audioBroadcastManager.del(deviceId, audioBroadcastCatch.getChannelId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (parentId.length() < 14 ) { |
| | | return null; |
| | | } |
| | | List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, parentId, null, null, null); |
| | | List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, parentId, null, null, null,null); |
| | | List<BaseTree<DeviceChannel>> trees = transportChannelsToTree(deviceChannels, parentId); |
| | | return trees; |
| | | } |
| | |
| | | if (parentId.length() < 14 ) { |
| | | return null; |
| | | } |
| | | List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, parentId, null, null, null); |
| | | List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, parentId, null, null, null,null); |
| | | return deviceChannels; |
| | | } |
| | | |
| | |
| | | } |
| | | }else { |
| | | if (haveChannel) { |
| | | List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, null, null, null, null); |
| | | List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, null, null, null, null,null); |
| | | if (deviceChannels != null && deviceChannels.size() > 0) { |
| | | result.addAll(deviceChannels); |
| | | } |
| | |
| | | public ResourceBaceInfo getOverview() { |
| | | return deviceMapper.getOverview(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Device> getAll() { |
| | | return deviceMapper.getAll(); |
| | | } |
| | | } |