| | |
| | | @Override |
| | | @Async |
| | | public void processRequest(RequestEvent requestEvent) { |
| | | logger.debug("\n收到请求:\n{}", requestEvent.getRequest()); |
| | | String method = requestEvent.getRequest().getMethod(); |
| | | ISIPRequestProcessor sipRequestProcessor = requestProcessorMap.get(method); |
| | | if (sipRequestProcessor == null) { |
| | |
| | | @Override |
| | | @Async |
| | | public void processResponse(ResponseEvent responseEvent) { |
| | | logger.debug(responseEvent.getResponse().toString()); |
| | | Response response = responseEvent.getResponse(); |
| | | logger.debug(responseEvent.getResponse().toString()); |
| | | logger.debug("\n收到响应:\n{}", responseEvent.getResponse()); |
| | | int status = response.getStatusCode(); |
| | | if (((status >= 200) && (status < 300)) || status == 401) { // Success! |
| | | CSeqHeader cseqHeader = (CSeqHeader) responseEvent.getResponse().getHeader(CSeqHeader.NAME); |
| | |
| | | SipSubscribe.Event subscribe = sipSubscribe.getOkSubscribe(callIdHeader.getCallId()); |
| | | if (subscribe != null) { |
| | | SipSubscribe.EventResult eventResult = new SipSubscribe.EventResult(responseEvent); |
| | | subscribe.response(eventResult); |
| | | sipSubscribe.removeOkSubscribe(callIdHeader.getCallId()); |
| | | subscribe.response(eventResult); |
| | | } |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public void processTimeout(TimeoutEvent timeoutEvent) { |
| | | System.out.println("processTimeout"); |
| | | if(timeoutProcessor != null) { |
| | | timeoutProcessor.process(timeoutEvent); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void processDialogTerminated(DialogTerminatedEvent dialogTerminatedEvent) { |
| | | System.out.println("processDialogTerminated"); |
| | | CallIdHeader callId = dialogTerminatedEvent.getDialog().getCallId(); |
| | | } |
| | | |