添加对message MediaStatus 请求的处理

This commit is contained in:
shikong 2023-10-05 03:52:55 +08:00
parent de4726ffba
commit 9a1d2a53b5
2 changed files with 46 additions and 0 deletions

View File

@ -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) {
}
}

View File

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