648540858
2023-03-21 82adc0cb23f3ee47322e78889cdaba57e9309000
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/BroadcastResponseMessageHandler.java
@@ -7,6 +7,7 @@
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;
@@ -53,16 +54,21 @@
    @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);
                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,7 +77,7 @@
                audioBroadcastCatch.setStatus(AudioBroadcastCatchStatus.WaiteInvite);
                audioBroadcastManager.update(audioBroadcastCatch);
                // 等待invite消息, 超时则结束
                String key = VideoManagerConstants.BROADCAST_WAITE_INVITE +  request.getCallIdHeader().getCallId();
                String key = VideoManagerConstants.BROADCAST_WAITE_INVITE +  device.getDeviceId() + channelId;
                dynamicTask.startDelay(key, ()->{
                    logger.info("[语音广播]等待invite消息超时:{}/{}", device.getDeviceId(), channelId);
                    playService.stopAudioBroadcast(device.getDeviceId(), channelId);