| | |
| | |
|
| | | 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;
|
| | |
| | | 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);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | 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);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | @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);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | @Override
|
| | | public void processIOException(IOExceptionEvent exceptionEvent) {
|
| | | // TODO Auto-generated method stub
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | @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);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | @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);
|
| | |
|
| | | }
|
| | |
|