648540858
2021-11-03 31e340e8e2eb5d7761a1ae8baa4a0a5e774dba59
src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java
@@ -9,6 +9,7 @@
import javax.sip.*;
import javax.sip.header.CallIdHeader;
import javax.sip.header.Header;
import javax.sip.message.Response;
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
@@ -168,7 +169,8 @@
            if (callIdHeader != null) {
               SipSubscribe.Event subscribe = sipSubscribe.getOkSubscribe(callIdHeader.getCallId());
               if (subscribe != null) {
                  subscribe.response(evt);
                  SipSubscribe.EventResult eventResult = new SipSubscribe.EventResult(evt);
                  subscribe.response(eventResult);
               }
            }
         }
@@ -181,7 +183,8 @@
            if (callIdHeader != null) {
               SipSubscribe.Event subscribe = sipSubscribe.getErrorSubscribe(callIdHeader.getCallId());
               if (subscribe != null) {
                  subscribe.response(evt);
                  SipSubscribe.EventResult eventResult = new SipSubscribe.EventResult(evt);
                  subscribe.response(eventResult);
               }
            }
         }
@@ -204,7 +207,11 @@
   @Override
   public void processTimeout(TimeoutEvent timeoutEvent) {
      // TODO Auto-generated method stub
      CallIdHeader callIdHeader = timeoutEvent.getClientTransaction().getDialog().getCallId();
      String callId = callIdHeader.getCallId();
      SipSubscribe.Event errorSubscribe = sipSubscribe.getErrorSubscribe(callId);
      SipSubscribe.EventResult<TimeoutEvent> timeoutEventEventResult = new SipSubscribe.EventResult<>(timeoutEvent);
      errorSubscribe.response(timeoutEventEventResult);
   }
   /**
@@ -220,6 +227,7 @@
   @Override
   public void processIOException(IOExceptionEvent exceptionEvent) {
      // TODO Auto-generated method stub
   }
   /**
@@ -235,6 +243,11 @@
   @Override
   public void processTransactionTerminated(TransactionTerminatedEvent transactionTerminatedEvent) {
      // TODO Auto-generated method stub
//      CallIdHeader callIdHeader = transactionTerminatedEvent.getClientTransaction().getDialog().getCallId();
//      String callId = callIdHeader.getCallId();
//      SipSubscribe.Event errorSubscribe = sipSubscribe.getErrorSubscribe(callId);
//      SipSubscribe.EventResult<TransactionTerminatedEvent> eventResult = new SipSubscribe.EventResult<>(transactionTerminatedEvent);
//      errorSubscribe.response(eventResult);
   }
   /**
@@ -250,6 +263,11 @@
   @Override
   public void processDialogTerminated(DialogTerminatedEvent dialogTerminatedEvent) {
      // TODO Auto-generated method stub
//      CallIdHeader callIdHeader = dialogTerminatedEvent.getDialog().getCallId();
//      String callId = callIdHeader.getCallId();
//      SipSubscribe.Event errorSubscribe = sipSubscribe.getErrorSubscribe(callId);
//      SipSubscribe.EventResult<DialogTerminatedEvent> eventResult = new SipSubscribe.EventResult<>(dialogTerminatedEvent);
//      errorSubscribe.response(eventResult);
   }