public synchronized void processResponse(ResponseEvent responseReceivedEvent) { Response response = responseReceivedEvent.getResponse(); Integer statusCode = response.getStatusCode(); if (SIP_MESSAGE_CODES.containsKey(statusCode)) { LOG.debug(SIP_MESSAGE_CODES.get(statusCode) + " received from Subscriber"); } }
public void processResponse(ResponseEvent responseReceivedEvent) { LOG.debug("Response received at Subscriber"); Response response = responseReceivedEvent.getResponse(); Transaction clientTransactionId = responseReceivedEvent.getClientTransaction(); LOG.debug("Response received with client transaction id {}:{}", clientTransactionId, response.getStatusCode()); if (clientTransactionId == null) { if (LOG.isWarnEnabled()) { LOG.warn("Stray response -- dropping"); } return; } }
public void onSuccessRespEvent(ResponseEvent event, ActivityContextInterface aci) { if (log.isDebugEnabled()) { log.debug("Received success response event " + event.getResponse().getStatusCode()); } executeResponseState(event); }
public void onClientErrorRespEvent(ResponseEvent event, ActivityContextInterface aci) { if (log.isDebugEnabled()) { log.debug("Received client error event : " + event.getResponse().getStatusCode()); } executeResponseState(event); }
public void onRedirRespEvent(ResponseEvent event, ActivityContextInterface ac) { if (tracer.isFineEnabled()) tracer.fine("Received 3xx (REDIRECT) response:\n" + event.getResponse()); // 3xx should not happen? since ECS/PA acts like proxy? handleFailure(event.getResponse().getStatusCode(), ac); }
public void onGlobalFailureRespEvent(ResponseEvent event, ActivityContextInterface ac) { if (tracer.isFineEnabled()) tracer.fine("Received 6xx (GLOBAL FAILURE) response:\n" + event.getResponse()); handleFailure(event.getResponse().getStatusCode(), ac); }
public void on1xxResponse(ResponseEvent event, ActivityContextInterface aci) { if (event.getResponse().getStatusCode() == Response.TRYING) { // those are not forwarded to the other dialog return; } processResponse(event, aci); }
public void onClientErrorRespEvent(ResponseEvent event, ActivityContextInterface ac) { if (tracer.isFineEnabled()) tracer.fine("Received 4xx (CLIENT ERROR) response:\n" + event.getResponse()); handleFailure(event.getResponse().getStatusCode(), ac); }
public void onServerErrorRespEvent(ResponseEvent event, ActivityContextInterface ac) { if (tracer.isFineEnabled()) tracer.fine("Received 5xx (SERVER ERROR) response:\n" + event.getResponse()); handleFailure(event.getResponse().getStatusCode(), ac); }
public void execute(ResponseEvent event) { Response response = event.getResponse(); // We expect a 200 OK but move to TerminationState no matter // what the response status is. // TODO Introduce a termination cause property on the // TerminationEvent to communicate this information final String callId = ((CallIdHeader) response .getHeader(CallIdHeader.NAME)).getCallId(); setState(new TerminationState(), callId); } }
public void execute(ResponseEvent event) { Response response = event.getResponse(); // We expect a 200 OK // However, we should send switch state to TerminationState whatever // the response is // so we simply ignore the response for now. final String callId = ((CallIdHeader) response .getHeader(CallIdHeader.NAME)).getCallId(); setState(new TerminationState(), callId); } }
public void on4xxResponse(javax.sip.ResponseEvent event, ActivityContextInterface aci) { Response response = event.getResponse(); if(tracer.isInfoEnabled()) { tracer.info("Received SIP 4xx >> " + response.getStatusCode()); } // Is it a 404? if(response.getStatusCode() == 404) { // Let's see from whom to whom String to = ((ToHeader) response.getHeader("To")).getAddress().toString(); String from = ((FromHeader) response.getHeader("From")).getAddress().toString(); if(tracer.isInfoEnabled()) { tracer.info("From[" + from + "], To [" + to + "]"); } String toAddress = to.substring(to.indexOf("sip:"), to.indexOf(">")); // Create the MissedCall object MissedCall mC = new MissedCall(from, new Date()); Collection<MissedCall> mCs = missedCalls.get(toAddress); if(mCs == null) { mCs = new ArrayList<MissedCall>(); missedCalls.put(toAddress, mCs); } if(!mCs.contains(mC)) { mCs.add(mC); } } aci.detach(this.getSbbContext().getSbbLocalObject()); }
public void execute(ResponseEvent event) { Response response = event.getResponse(); int status = response.getStatusCode(); final String callId = ((CallIdHeader) response .getHeader(CallIdHeader.NAME)).getCallId(); if (status == Response.OK) { // status == 200 setState(new TerminationState(), callId); } } }
public void execute(ResponseEvent event) { Response response = event.getResponse(); // We expect a 200 OK and send a bye to Caller // However, we should send BYE to the Caller whatever the response // is // so we simply ignore the response for now. final String callId = ((CallIdHeader) response .getHeader(CallIdHeader.NAME)).getCallId(); Dialog dialog = getPeerDialog(callId); // TODO Handle exception better (exception indicated in termination // state) try { sendRequest(dialog, Request.BYE); setState(new ExternalTerminationCallerState(), callId); } catch (SipException e) { log .error("Exception while sending BYE in execute for callId : " + dialog.getCallId().getCallId()); setState(new TerminationState(), callId); } } }
private void executeResponseState(ResponseEvent event) { String callId = ((CallIdHeader) event.getResponse().getHeader( CallIdHeader.NAME)).getCallId(); SessionAssociation sa = (SessionAssociation) cache.get(callId); SimpleCallFlowState simpleCallFlowState = getState(sa.getState()); simpleCallFlowState.execute(event); }
public void execute(ResponseEvent event) { Response response = event.getResponse(); int status = response.getStatusCode(); final String calleeCallId = ((CallIdHeader) response .getHeader(CallIdHeader.NAME)).getCallId(); if (status >= Response.OK && status <= Response.ACCEPTED) { handleOK(calleeCallId, event); } else if (status == Response.DECLINE) { handleDecline(calleeCallId, event); } else if (status == Response.UNAUTHORIZED || status == Response.PROXY_AUTHENTICATION_REQUIRED) { handleAuthentication(calleeCallId, event); } }
public void on2xxResponse(ResponseEvent event, ActivityContextInterface aci) { final CSeqHeader cseq = (CSeqHeader) event.getResponse().getHeader( CSeqHeader.NAME); if (cseq.getMethod().equals(Request.INVITE)) { // lets ack it ourselves to avoid UAS retransmissions due to // forwarding of this response and further UAC Ack // note that the app does not handles UAC ACKs try { final Request ack = event.getDialog().createAck( cseq.getSeqNumber()); event.getDialog().sendAck(ack); } catch (Exception e) { tracer.severe("Unable to ack INVITE's 200 ok from UAS", e); } } else if (cseq.getMethod().equals(Request.BYE) || cseq.getMethod().equals(Request.CANCEL)) { // not forwarded to the other dialog return; } processResponse(event, aci); }
private void processResponse(ResponseEvent event, ActivityContextInterface aci) { try { // Find the dialog to forward the response on ActivityContextInterface peerACI = getPeerDialog(aci); forwardResponse((DialogActivity) aci.getActivity(), (DialogActivity) peerACI.getActivity(), event .getClientTransaction(), event.getResponse()); } catch (SipException e) { tracer.severe(e.getMessage(), e); } }
public void execute(ResponseEvent event) { final Response response = event.getResponse(); final int status = response.getStatusCode(); final String callerCallId = ((CallIdHeader) response .getHeader(CallIdHeader.NAME)).getCallId(); if (status >= Response.OK && status <= Response.ACCEPTED) { // 200 <= status <= 202 handleOK(callerCallId, event); } else if (status == Response.UNAUTHORIZED || status == Response.PROXY_AUTHENTICATION_REQUIRED) { handleAuthentication(callerCallId, event); } else if (status >= Response.BAD_REQUEST && status < Response.SERVER_INTERNAL_ERROR) { // 400 <= status < 500 handleError(callerCallId); } else if (status == Response.DECLINE) { // Status = 603 handleDecline(callerCallId); } }
public void execute(ResponseEvent event) { final Response response = event.getResponse(); final int status = response.getStatusCode(); final String callerCallId = ((CallIdHeader) response .getHeader(CallIdHeader.NAME)).getCallId(); if (status == Response.TRYING) { // status == 100 handleTrying(callerCallId, event); } else if (status >= Response.RINGING && status < Response.OK) { // 180 <= status < 200 handleRinging(callerCallId, event); } else if (status >= Response.OK && status <= Response.ACCEPTED) { // 200 <= status <= 202 handleOK(callerCallId, event); } else if (status == Response.UNAUTHORIZED || status == Response.PROXY_AUTHENTICATION_REQUIRED) { handleAuthentication(callerCallId, event); } else if (status >= Response.BAD_REQUEST && status < Response.SERVER_INTERNAL_ERROR) { // 400 <= status < 500 handleError(callerCallId); } else if (status == Response.DECLINE) { // Status = 603 handleDecline(callerCallId); } }