public boolean equals( Object other ) { if (this==other) return true; if (other instanceof CallIdHeader) { final CallIdHeader o = (CallIdHeader) other; return this.getCallId().equalsIgnoreCase( o.getCallId() ); } return false; }
@Override public int hashCode() { if ( (callIdHeader == null) && // https://java.net/jira/browse/JSIP-493 (callIdHeaderString == null)) { return 0; } else { return getCallId().getCallId().hashCode(); } }
public String getForkId() { if ( this.forkId != null ) { return forkId; } else { String callId = this.getCallId().getCallId(); String fromTag = this.getFromTag(); if ( fromTag == null ) { throw new IllegalStateException("From tag is not yet set. Cannot compute forkId"); } this.forkId = (callId + ":" + fromTag).toLowerCase(); return this.forkId; } }
@Override public CallIdHeader getCallId( MobicentsExtendedListeningPoint extendedListeningPoint, String callId) throws ParseException { String callIdString = callId; if(callIdString == null) { callIdString = extendedListeningPoint.getSipProvider().getNewCallId().getCallId(); } if(callIdMaxLength > 0 && callIdString.length() > callIdMaxLength) { callIdString = callIdString.substring(0, callIdMaxLength); } return SipFactoryImpl.headerFactory.createCallIdHeader(callIdString); }
public String getCallId() { CallIdHeader id = (CallIdHeader) this.message .getHeader(getCorrectHeaderName(CallIdHeader.NAME)); if (id != null) return id.getCallId(); else return null; }
public String getCallId() { if(this.sessionCreatingDialog != null) return this.sessionCreatingDialog.getCallId().getCallId(); else if(sessionCreatingTransactionRequest != null) return ((CallIdHeader)this.sessionCreatingTransactionRequest.getMessage().getHeader(CallIdHeader.NAME)).getCallId(); else if(key != null) return key.getCallId(); else return null; }
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 execute(RequestEvent event) { Request request = event.getRequest(); final String calleeCallId = ((CallIdHeader) request .getHeader(CallIdHeader.NAME)).getCallId(); String method = request.getMethod(); if (Request.BYE.equals(method)) { handleBye(calleeCallId, request); } } }
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); } } }
public void execute(RequestEvent event) { Request request = event.getRequest(); final String calleeCallId = ((CallIdHeader) request .getHeader(CallIdHeader.NAME)).getCallId(); String method = request.getMethod(); if (Request.BYE.equals(method)) { handleBye(calleeCallId, request); } }
public void execute(RequestEvent event) { Request request = event.getRequest(); final String calleeCallId = ((CallIdHeader) request .getHeader(CallIdHeader.NAME)).getCallId(); String method = request.getMethod(); if (Request.BYE.equals(method)) { handleBye(calleeCallId, request); } } }
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); } }
/** * * @param callId * @return */ private Session getSession(Dialog dialog) { final String callId = dialog.getCallId().getCallId(); SessionAssociation sa = (SessionAssociation) cache.get(callId); Session session = sa.getSession(callId); return session; }
public void handleOK(String callerCallId, ResponseEvent event) { // Check that the dialog of the event is the same as in the session // If not this is the result of a fork, we don't handle this try { Dialog eventDialog = sipUtils.getDialog(event); Dialog currentDialog = getDialog(eventDialog.getCallId() .getCallId()); if (!eventDialog.equals(currentDialog)) { log.warn("Received 200 response from forked dialog"); return; // We don't currently handle this. Should send ACK // and BYE } } catch (SipException e) { // TODO Handle this } sendCalleeAck(event); sendCallerAck(event); setState(new SessionEstablishedState(), callerCallId); }
public InitialEventSelector callIDSelect(InitialEventSelector ies) { Object event = ies.getEvent(); String callID = null; if (event instanceof RequestEvent) { // If request event, the convergence name to callId Request request = ((RequestEvent) event).getRequest(); callID = ((CallIdHeader) request.getHeader(CallIdHeader.NAME)).getCallId(); } ies.setCustomName(callID); return ies; }
if ( dialog.getCallId().getCallId().equals(cid) && fromTag.equalsIgnoreCase(dialog.lastResponseFromTag) && toTag.equalsIgnoreCase(dialog.lastResponseToTag)) {
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(RequestEvent event) { Request request = event.getRequest(); final String method = request.getMethod(); if (method.equals(Request.BYE)) { final String callId = ((CallIdHeader) request .getHeader(CallIdHeader.NAME)).getCallId(); Dialog dialog = getPeerDialog(callId); try { sipUtils.sendOk(request); sendRequest(dialog, Request.BYE); } catch (ParseException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (SipException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } setState(new UATerminationState(), callId); } } }
if(sipServletMessage != null && sipServletMessage instanceof SipServletRequestImpl && ((MessageExt)request.getMessage()).getCSeqHeader().getSeqNumber() == ((MessageExt)sipServletMessage.getMessage()).getCSeqHeader().getSeqNumber() && ((MessageExt)request.getMessage()).getCallIdHeader().getCallId().equals(((MessageExt)sipServletMessage.getMessage()).getCallIdHeader().getCallId())) { return (SipServletRequestImpl)sipServletMessage;