From 9a1d2a53b5823cc0ea3d82a48fd869c250f0c534 Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Thu, 5 Oct 2023 03:52:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9message=20MediaStatu?= =?UTF-8?q?s=20=E8=AF=B7=E6=B1=82=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bye/response/ByeResponseProcessor.java | 44 +++++++++++++++++++ .../request/MessageRequestProcessor.java | 2 + 2 files changed, 46 insertions(+) create mode 100644 gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/processor/bye/response/ByeResponseProcessor.java diff --git a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/processor/bye/response/ByeResponseProcessor.java b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/processor/bye/response/ByeResponseProcessor.java new file mode 100644 index 0000000..3959651 --- /dev/null +++ b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/processor/bye/response/ByeResponseProcessor.java @@ -0,0 +1,44 @@ +package cn.skcks.docking.gb28181.core.sip.message.processor.bye.response; + +import cn.skcks.docking.gb28181.core.sip.listener.SipListener; +import cn.skcks.docking.gb28181.core.sip.message.processor.MessageProcessor; +import cn.skcks.docking.gb28181.core.sip.message.subscribe.GenericSubscribe; +import cn.skcks.docking.gb28181.core.sip.message.subscribe.SipSubscribe; +import cn.skcks.docking.gb28181.core.sip.service.SipService; +import cn.skcks.docking.gb28181.sip.generic.SipResponseBuilder; +import cn.skcks.docking.gb28181.sip.method.invite.response.InviteResponseBuilder; +import gov.nist.javax.sip.message.SIPRequest; +import gov.nist.javax.sip.message.SIPResponse; +import jakarta.annotation.PostConstruct; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import javax.sip.RequestEvent; +import javax.sip.SipException; +import javax.sip.SipProvider; +import javax.sip.message.Request; +import javax.sip.message.Response; +import java.util.EventObject; +import java.util.Optional; + +@Slf4j +@RequiredArgsConstructor +@Component +public class ByeResponseProcessor implements MessageProcessor { + private final SipListener sipListener; + + private final SipSubscribe subscribe; + + private final SipService sipService; + + @PostConstruct + @Override + public void init() { + sipListener.addResponseProcessor(Request.BYE, this); + } + + @Override + public void process(EventObject eventObject) { + } +} diff --git a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/processor/message/request/MessageRequestProcessor.java b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/processor/message/request/MessageRequestProcessor.java index a0b4d47..1a6fd90 100644 --- a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/processor/message/request/MessageRequestProcessor.java +++ b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/processor/message/request/MessageRequestProcessor.java @@ -85,6 +85,8 @@ public class MessageRequestProcessor implements MessageProcessor { publisher.submit(request); }); response = ok; + } else if(messageDto.getCmdType().equalsIgnoreCase(CmdType.MEDIA_STATUS)){ + response = ok; } else { response = response(request, Response.NOT_IMPLEMENTED, ResponseStatus.NOT_IMPLEMENTED.getMessage()); }