| | |
| | | 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; |
| | |
| | | @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); |