old mode 100644
new mode 100755
| | |
| | | package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd; |
| | | |
| | | import com.genersoft.iot.vmp.common.VideoManagerConstants; |
| | | import com.genersoft.iot.vmp.conf.DynamicTask; |
| | | import com.genersoft.iot.vmp.gb28181.bean.AudioBroadcastCatch; |
| | | import com.genersoft.iot.vmp.gb28181.bean.AudioBroadcastCatchStatus; |
| | |
| | | @Override |
| | | public void handForDevice(RequestEvent evt, Device device, Element rootElement) { |
| | | |
| | | String channelId = getText(rootElement, "DeviceID"); |
| | | SIPRequest request = (SIPRequest) evt.getRequest(); |
| | | try { |
| | | String channelId = getText(rootElement, "DeviceID"); |
| | | if (!audioBroadcastManager.exit(device.getDeviceId(), channelId)) { |
| | | // 回复410 |
| | | responseAck((SIPRequest) evt.getRequest(), Response.GONE); |
| | |
| | | AudioBroadcastCatch audioBroadcastCatch = audioBroadcastManager.get(device.getDeviceId(), channelId); |
| | | audioBroadcastCatch.setStatus(AudioBroadcastCatchStatus.WaiteInvite); |
| | | audioBroadcastManager.update(audioBroadcastCatch); |
| | | // 等待invite消息, 超时则结束 |
| | | String key = VideoManagerConstants.BROADCAST_WAITE_INVITE + device.getDeviceId() + channelId; |
| | | dynamicTask.startDelay(key, ()->{ |
| | | logger.info("[语音广播]等待invite消息超时:{}/{}", device.getDeviceId(), channelId); |
| | | playService.stopAudioBroadcast(device.getDeviceId(), channelId); |
| | | }, 2000); |
| | | }else { |
| | | playService.stopAudioBroadcast(device.getDeviceId(), channelId); |
| | | } |