/** * * @return -- the collection of dialogs matching the state that is being * managed by the stack. */ public Collection<Dialog> getDialogs(DialogState state) { HashSet<Dialog> matchingDialogs = new HashSet<Dialog>(); if (DialogState.EARLY.equals(state)) { matchingDialogs.addAll(this.earlyDialogTable.values()); } else { Collection<SIPDialog> dialogs = dialogTable.values(); for (SIPDialog dialog : dialogs) { if (dialog.getState() != null && dialog.getState().equals(state)) { matchingDialogs.add(dialog); } } } return matchingDialogs; }
public DialogState getState() { if (this.dialogState == NULL_STATE) return null; // not yet initialized return DialogState.getObject(this.dialogState); }
+ itDialog.getDialogId() + ", dialog state: " + (dialogState != null ? dialogState.toString() : "null"); auditReport += " " + dialogReport + "\n";
@Override public void setState(int state) { DialogState oldState = this.getState(); super.setState(state); final ReplicationStrategy replicationStrategy = ((ClusteredSipStack)getStack()).getReplicationStrategy(); if(replicationStrategy == ReplicationStrategy.EarlyDialog && (oldState == null || oldState.getValue() != state // commented as part of https://github.com/Mobicents/jain-sip.ha/pull/1 /*&& state != DialogState.TERMINATED.getValue()*/)) { dialogStateChanged = true; if (logger.isLoggingEnabled(StackLogger.TRACE_DEBUG)) { logger.logDebug("dialogStateChanged"); } } } }
&& getState().equals(DialogState.EARLY) && is100ClassResponse) { this.lastInviteOkReceived = Math.max(responseCSeqNumber, this.lastInviteOkReceived); if(getState() != null && getState().getValue() == SIPDialog.CONFIRMED_STATE && transaction != null) { && (getState() == null || (cseqMethod .equals(getMethod()) && getState() .getValue() == SIPDialog.EARLY_STATE))) {
dialogMetaData.put(DIALOG_STATE, Integer.valueOf(getState().getValue())); if (logger.isLoggingEnabled(StackLogger.TRACE_DEBUG)) { logger.logDebug(getDialogIdToReplicate() + " : dialogState " + getState());
/** * This timer task is used to garbage collect the dialog after some time. * */ class DialogDeleteIfNoAckSentTask extends SIPStackTimerTask implements Serializable { private long seqno; public DialogDeleteIfNoAckSentTask(long seqno) { this.seqno = seqno; } public void runTask() { if (SIPDialog.this.highestSequenceNumberAcknowledged < seqno) { /* * Did not send ACK so we need to delete the dialog. B2BUA NOTE: * we may want to send BYE to the Dialog at this point. Do we * want to make this behavior tailorable? */ dialogDeleteIfNoAckSentTask = null; if (!SIPDialog.this.isBackToBackUserAgent) { if (logger.isLoggingEnabled()) logger.logError( "ACK Was not sent. killing dialog " + dialogId); if (((SipProviderImpl) sipProvider).getSipListener() instanceof SipListenerExt) { raiseErrorEvent(SIPDialogErrorEvent.DIALOG_ACK_NOT_SENT_TIMEOUT); } else { delete(); }
logger.logDebug("SIPDialog::setState:" + this + " New dialog state is " + DialogState.getObject(state));
@Override public void runTask() { try { if (SIPDialog.this.getState().equals(DialogState.EARLY)) { SIPDialog.this .raiseErrorEvent(SIPDialogErrorEvent.EARLY_STATE_TIMEOUT); } else { if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) { logger.logDebug("EarlyStateTimerTask : Dialog state is " + SIPDialog.this.getState()); } } } catch (Exception ex) { logger.logError( "Unexpected exception delivering event", ex); } }
throw new SipException("Bad request method -- should be ACK"); if (this.getState() == null || this.getState().getValue() == EARLY_STATE) { if (logger.isLoggingEnabled(LogWriter.TRACE_ERROR)) { logger.logError(
if(!notifiedApplication && sipSession.getProxy() == null && dialog != null && dialog.getState() != null && !dialog.getState().equals(DialogState.TERMINATED)) {
.getValue()); sipStack.putDialog(subscriptionDialog); pendingSubscribeClientTx.setDialog(subscriptionDialog,
cleanDialogInformation(true); if(!DialogState.TERMINATED.equals(sessionCreatingDialog.getState())) { sessionCreatingDialog.delete();
} else if(joinReplacesDialog != null && DialogState.TERMINATED.equals(joinReplacesDialog.getState())) {
if(sessionCreatingDialog != null && DialogState.TERMINATED.equals(sessionCreatingDialog.getState()) && !method.equalsIgnoreCase(Request.BYE)) { (!DialogState.TERMINATED.equals(sessionCreatingDialog.getState()) || (DialogState.TERMINATED.equals(sessionCreatingDialog.getState()) && method.equalsIgnoreCase(Request.BYE)))) {
.getState().equals(DialogState.TERMINATED))) && (sipResponse.getStatusCode() == Response.CALL_OR_TRANSACTION_DOES_NOT_EXIST || sipResponse .getStatusCode() == Response.REQUEST_TIMEOUT)) {
public Request createPrack(Response relResponse) throws DialogDoesNotExistException, SipException { if (this.getState() == null || this.getState().equals(DialogState.TERMINATED)) throw new DialogDoesNotExistException( "Dialog not initialized or terminated"); if ((RSeq) relResponse.getHeader(RSeqHeader.NAME) == null) { throw new SipException("Missing RSeq Header"); } try { SIPResponse sipResponse = (SIPResponse) relResponse; SIPRequest sipRequest = this.createRequest(Request.PRACK, sipResponse.getTopmostVia().getTransport()); String toHeaderTag = sipResponse.getTo().getTag(); sipRequest.setToTag(toHeaderTag); RAck rack = new RAck(); RSeq rseq = (RSeq) relResponse.getHeader(RSeqHeader.NAME); rack.setMethod(sipResponse.getCSeq().getMethod()); rack.setCSequenceNumber((int) sipResponse.getCSeq().getSeqNumber()); rack.setRSequenceNumber(rseq.getSeqNumber()); sipRequest.setHeader(rack); if (this.proxyAuthorizationHeader != null) { sipRequest.addHeader(proxyAuthorizationHeader); } return (Request) sipRequest; } catch (Exception ex) { InternalErrorHandler.handleException(ex); return null; } }