648540858
2024-03-14 d4f6ec39b7e0421757a6b9d1a68b1c4610ea2e8c
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/BroadcastResponseMessageHandler.java
old mode 100644 new mode 100755
@@ -1,13 +1,11 @@
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;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager;
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
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.response.ResponseMessageHandler;
@@ -63,7 +61,12 @@
                return;
            }
            String result = getText(rootElement, "Result");
            logger.info("[语音广播]回复:{}, {}/{}", result, device.getDeviceId(), channelId );
            Element infoElement = rootElement.element("Info");
            String reason = null;
            if (infoElement != null) {
                reason = getText(infoElement, "Reason");
            }
            logger.info("[语音广播]回复:{}, {}/{}", reason == null? result : result + ": " + reason, device.getDeviceId(), channelId );
            // 回复200 OK
            responseAck(request, Response.OK);
@@ -71,12 +74,6 @@
                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);
            }