Home | History | Annotate | Download | only in stack

Lines Matching defs:this

4  * This software was developed by employees of the National Institute of
11 * This software is provided by NIST as a service and is expressly
20 * Permission to use this software is contingent upon your acceptance
21 * of the terms of this agreement
110 * Bugs in this class were reported by Antonis Karydas, Brad Templeton, Jeff Adams, Alex Rootham ,
122 * dialog identifier that can be used to retrieve this structure from the SipStack.
197 // This is for debugging only.
220 // the amount of time to keep this dialog around before the stack GC's it
258 // List of event listeners for this dialog
279 * This task waits till a pending ACK has been recorded and then sends out a re-INVITE. This
281 * the out of order INVITE). This is primarily for B2BUA support. A B2BUA may send a delayed
283 * re-INVITE otherwise the othr end will respond with a REQUEST_PENDING. We want to avoid this
301 this.ctx = ctx;
309 if (!SIPDialog.this.takeAckSem()) {
323 Request byeRequest = SIPDialog.this.createRequest(Request.BYE);
331 ClientTransaction byeCtx = SIPDialog.this.getSipProvider().getNewClientTransaction(byeRequest);
332 SIPDialog.this.sendRequest(byeCtx);
344 * This is a hack in support of some UA that want re-INVITEs to be spaced out in
349 Thread.sleep(SIPDialog.this.reInviteWaitTime);
356 if (SIPDialog.this.getState() != DialogState.TERMINATED) {
357 SIPDialog.this.sendRequest(ctx, true);
364 this.ctx = null;
376 SIPDialog dialog = SIPDialog.this;
392 this.transaction = transaction;
393 this.nRetransmissions = 0;
399 SIPDialog dialog = SIPDialog.this;
403 SIPServerTransaction transaction = this.transaction;
442 // Note that this firing also
453 // Stop running this timer if the dialog is in the
456 this.transaction = null;
457 this.cancel();
466 * This timer task is used to garbage collect the dialog after some time.
479 * This timer task is used to garbage collect the dialog after some time.
487 this.seqno = seqno;
491 if (SIPDialog.this.highestSequenceNumberAcknowledged < seqno) {
494 * B2BUA NOTE: we may want to send BYE to the Dialog at this
495 * point. Do we want to make this behavior tailorable?
498 if ( !SIPDialog.this.isBackToBackUserAgent) {
515 * This will be removed for the next spec revision.
518 Request byeRequest = SIPDialog.this.createRequest(Request.BYE);
527 ClientTransaction byeCtx = SIPDialog.this.getSipProvider().getNewClientTransaction(byeRequest);
528 SIPDialog.this.sendRequest(byeCtx);
531 SIPDialog.this.delete();
547 this.terminateOnBye = true;
548 this.routeList = new RouteList();
549 this.dialogState = NULL_STATE; // not yet initialized.
552 this.sipProvider = provider;
560 this.stackTrace = stringWriter.getBuffer().toString();
569 this(transaction.getSipProvider());
572 this.callIdHeader = sipRequest.getCallId();
573 this.earlyDialogId = sipRequest.getDialogId(false);
576 this.sipStack = transaction.sipStack;
578 // this.defaultRouter = new DefaultRouter((SipStack) sipStack,
581 this.sipProvider = (SipProviderImpl) transaction.getSipProvider();
584 this.addTransaction(transaction);
586 sipStack.getStackLogger().logDebug("Creating a dialog : " + this);
588 "provider port = " + this.sipProvider.getListeningPoint().getPort());
591 this.isBackToBackUserAgent = sipStack.isBackToBackUserAgent;
602 this(transaction);
605 this.setLastResponse(transaction, sipResponse);
606 this.isBackToBackUserAgent = sipStack.isBackToBackUserAgent;
613 this(sipProvider);
614 this.sipStack = (SIPTransactionStack) sipProvider.getSipStack();
615 this.setLastResponse(null, sipResponse);
616 this.localSequenceNumber = sipResponse.getCSeq().getSeqNumber();
617 this.originalLocalSequenceNumber = localSequenceNumber;
618 this.myTag = sipResponse.getFrom().getTag();
619 this.hisTag = sipResponse.getTo().getTag();
620 this.localParty = sipResponse.getFrom().getAddress();
621 this.remoteParty = sipResponse.getTo().getAddress();
622 this.method = sipResponse.getCSeq().getMethod();
623 this.callIdHeader = sipResponse.getCallId();
624 this.serverTransactionFlag = false;
626 sipStack.getStackLogger().logDebug("Creating a dialog : " + this);
629 this.isBackToBackUserAgent = sipStack.isBackToBackUserAgent;
641 sipStack.getStackLogger().logDebug("this : " + this);
642 sipStack.getStackLogger().logDebug("printRouteList : " + this.routeList.encode());
647 * Return true if this is a client dialog.
649 * @return true if the transaction that created this dialog is a client transaction and false
653 SIPTransaction transaction = (SIPTransaction) this.getFirstTransaction();
669 IOExceptionEvent ioError = new IOExceptionEvent(this, host, port, protocol);
689 newErrorEvent = new SIPDialogErrorEvent(this, dialogTimeoutError);
691 // Loop through all listeners of this transaction
714 * Set the remote party for this Dialog.
722 this.remoteParty = sipMessage.getTo().getAddress();
724 this.remoteParty = sipMessage.getFrom().getAddress();
728 sipStack.getStackLogger().logDebug("settingRemoteParty " + this.remoteParty);
733 * Add a route list extracted from a record route list. If this is a server dialog then we
734 * assume that the record are added to the route list IN order. If this is a client dialog
743 if (this.isClientDialog()) {
744 // This is a client dialog so we extract the record
747 this.routeList = new RouteList();
763 this.routeList.add(route);
767 // This is a server dialog. The top most record route
771 this.routeList = new RouteList();
796 "NON LR route in Route set detected for dialog : " + this);
813 this.remoteTarget = contact.getAddress();
815 sipStack.getStackLogger().logDebug("Dialog.setRemoteTarget: " + this.remoteTarget);
822 * Extract the route information from this SIP Message and add the relevant information to the
832 "setContact: dialogState: " + this + "state = " + this.getState());
837 } else if (this.dialogState == TERMINATED_STATE) {
840 } else if (this
844 if (sipResponse.getStatusCode() / 100 == 2 && !this.isServer()) {
848 this.setRemoteTarget((ContactHeader) contactList.getFirst());
858 if (this.getState() != DialogState.CONFIRMED
859 && this.getState() != DialogState.TERMINATED) {
864 this.addRoute(rrlist);
867 this.routeList = new RouteList();
873 this.setRemoteTarget((ContactHeader) contactList.getFirst());
891 sipStack.getStackLogger().logDebug("getRouteList " + this);
897 if (this.routeList != null) {
907 sipStack.getStackLogger().logDebug("getRouteList for " + this);
918 this.routeList = routeList;
922 * Sends ACK Request to the remote party of this Dialogue.
936 sipStack.getStackLogger().logDebug("sendAck" + this);
940 if (this.getState() == null || this.getState().getValue() == EARLY_STATE) {
943 "Bad Dialog State for " + this + " dialogID = " + this.getDialogId());
945 throw new SipException("Bad dialog state " + this.getState());
948 if (!this.getCallId().getCallId().equals(((SIPRequest) request).getCallId().getCallId())) {
950 sipStack.getStackLogger().logError("CallID " + this.getCallId());
953 sipStack.getStackLogger().logError("dialog = " + this);
960 "setting from tag For outgoing ACK= " + this.getLocalTag());
962 "setting To tag for outgoing ACK = " + this.getRemoteTag());
965 if (this.getLocalTag() != null)
966 ackRequest.getFrom().setTag(this.getLocalTag());
967 if (this.getRemoteTag() != null)
968 ackRequest.getTo().setTag(this.getRemoteTag());
980 ListeningPointImpl lp = (ListeningPointImpl) this.sipProvider.getListeningPoint(hop
983 throw new SipException("No listening point for this provider registered at "
990 if (!this.isAckSent(cseqNo)) {
994 this.setLastAckSent(ackRequest);
997 this.isAcknowledged = true;
998 this.highestSequenceNumberAcknowledged = Math.max(this.highestSequenceNumberAcknowledged,
1000 if (releaseAckSem && this.isBackToBackUserAgent) {
1001 this.releaseAckSem();
1004 sipStack.getStackLogger().logDebug("Not releasing ack sem for " + this + " isAckSent " + releaseAckSem );
1010 this.raiseIOException(hop.getHost(), hop.getPort(), hop.getTransport());
1020 if (this.dialogDeleteTask != null) {
1021 this.dialogDeleteTask.cancel();
1022 this.dialogDeleteTask = null;
1024 this.ackSeen = true;
1039 this.sipStack = sipStack;
1054 * Return True if this dialog is terminated on BYE.
1059 return this.terminateOnBye;
1068 if (this.ackSeen)
1070 SIPServerTransaction tr = this.getInviteTransaction();
1075 if (this.timerTask != null) {
1076 this.timerTask.cancel();
1077 this.timerTask = null;
1082 this.ackSeen = true;
1083 if (this.dialogDeleteTask != null) {
1084 this.dialogDeleteTask.cancel();
1085 this.dialogDeleteTask = null;
1087 this.setLastAckReceived(sipRequest);
1091 this.ackLine = sipStack.getStackLogger().getLineCount();
1092 this.printDebugInfo();
1094 if (this.isBackToBackUserAgent) {
1095 this.releaseAckSem();
1097 this.setState(CONFIRMED_STATE);
1108 boolean retval = this.dialogTerminatedEventDelivered;
1109 this.dialogTerminatedEventDelivered = true;
1118 * Adds a new event listener to this dialog.
1128 * Removed an event listener from this dialog.
1141 this.applicationData = applicationData;
1150 return this.applicationData;
1158 this.nextSeqno = Long.valueOf(this.getRemoteSeqNumber() + 1);
1161 this.sipStack.getStackLogger().logDebug(
1162 "Request Consumed -- next consumable Request Seqno = " + this.nextSeqno);
1168 * Return true if this request can be consumed by the dialog.
1174 // have not yet set remote seqno - this is a fresh
1178 // For loose validation this function is delegated to the application
1179 if (!this.isSequnceNumberValidation()) {
1189 * This method is called when a forked dialog is created from the client side. It starts a
1196 this.setState(TERMINATED_STATE);
1198 this.dialogDeleteTask = new DialogDeleteTask();
1200 sipStack.getTimer().schedule(this.dialogDeleteTask,
1207 * Set the state for this dialog.
1215 "Setting dialog state for " + this + "newState = " + state);
1217 if (state != NULL_STATE && state != this.dialogState)
1220 this + " old dialog state is " + this.getState());
1222 this + " New dialog state is " + DialogState.getObject(state));
1226 this.dialogState = state;
1232 this.stopTimer();
1247 sipStack.getStackLogger().logDebug("ackLine:" + this.getRemoteTag() + " " + ackLine);
1257 return this.ackSeen;
1261 * Get the last ACK for this transaction.
1264 return this.lastAckSent;
1268 * Return true if ACK was sent ( for client tx ). For server tx, this is a NO-OP ( we dont
1272 if (this.getLastTransaction() == null)
1274 if (this.getLastTransaction() instanceof ClientTransaction) {
1275 if (this.getLastAckSent() == null) {
1278 this.getLastAckSent()).getCSeq().getSeqNumber();
1286 * Get the transaction that created this dialog.
1289 return this.firstTransaction;
1299 * present in the request or response, the route set MUST be set to the empty set. This route
1300 * set, even if empty, overrides any pre-existing route set for future requests in this
1313 if (this.routeList == null) {
1316 return this.getRouteList().listIterator();
1321 * Add a Route list extracted from a SIPRequest to this Dialog.
1328 "setContact: dialogState: " + this + "state = " + this.getState());
1331 if (this.dialogState == CONFIRMED_STATE
1333 this.doTargetRefresh(sipRequest);
1335 if (this.dialogState == CONFIRMED_STATE || this.dialogState == TERMINATED_STATE) {
1347 this.addRoute(rrlist);
1350 this.routeList = new RouteList();
1357 this.setRemoteTarget((ContactHeader) contactList.getFirst());
1365 this.dialogId = dialogId;
1372 * Made this a separate method to clearly distinguish what's happening here - this is a
1388 // they share this one
1416 * @return true if is server transaction created this dialog.
1419 if (this.firstTransactionSeen == false)
1420 return this.serverTransactionFlag;
1422 return this.firstTransactionIsServerTransaction;
1427 * Return true if this is a re-establishment of the dialog.
1432 return this.reInviteFlag;
1436 * Get the id for this dialog.
1438 * @return the string identifier for this dialog.
1443 if (this.dialogId == null && this.lastResponse != null)
1444 this.dialogId = this.lastResponse.getDialogId(isServer());
1446 return this.dialogId;
1483 this.reInviteFlag = true;
1489 // use on this dialog.
1490 storeFirstTransactionInfo(this, transaction);
1492 this.eventHeader = (EventHeader) sipRequest.getHeader(EventHeader.NAME);
1494 this.setLocalParty(sipRequest);
1495 this.setRemoteParty(sipRequest);
1496 this.setCallId(sipRequest);
1497 if (this.originalRequest == null) {
1498 this.originalRequest = sipRequest;
1500 if (this.method == null) {
1501 this.method = sipRequest.getMethod();
1505 this.hisTag = sipRequest.getFrom().getTag();
1509 this.originalLocalSequenceNumber = localSequenceNumber;
1510 this.myTag = sipRequest.getFrom().getTag();
1518 // This case occurs when you are processing a re-invite.
1522 storeFirstTransactionInfo(this, transaction);
1524 this.setLocalParty(sipRequest);
1525 this.setRemoteParty(sipRequest);
1526 this.setCallId(sipRequest);
1527 this.originalRequest = sipRequest;
1528 this.method = sipRequest.getMethod();
1534 // If this is a server transaction record the remote
1536 // with the same sequence number directed towards this
1539 this.lastTransaction = transaction;
1541 // CHECKME -- why is this here?
1542 // transaction.setDialog(this,sipRequest);
1545 .logDebug("Transaction Added " + this + myTag + "/" + hisTag);
1561 "setRemoteTag(): " + this + " remoteTag = " + this.hisTag + " new tag = "
1564 if (this.hisTag != null && hisTag != null && !hisTag.equals(this.hisTag)) {
1565 if (this.getState() != DialogState.EARLY) {
1573 "UNSAFE OPERATION ! tag re-assignment " + this.hisTag
1577 if (this.sipStack.getDialog(dialogId) == this) {
1578 this.sipStack.removeDialog(dialogId);
1583 this.dialogId = null;
1584 this.hisTag = hisTag;
1588 this.sipStack.putDialog(this);
1593 this.hisTag = hisTag;
1605 return this.lastTransaction;
1612 DialogTimerTask t = this.timerTask;
1628 "setLocalSequenceNumber: original " + this.localSequenceNumber + " new = "
1630 if (lCseq <= this.localSequenceNumber)
1632 this.localSequenceNumber = lCseq;
1643 sipStack.getStackLogger().logDebug("setRemoteSeqno " + this + "/" + rCseq);
1644 this.remoteSequenceNumber = rCseq;
1648 * Increment the local CSeq # for the dialog. This is useful for if you want to create a hole
1653 ++this.localSequenceNumber;
1657 * Get the remote sequence number (for cseq assignment of outgoing requests within this
1665 return (int) this.remoteSequenceNumber;
1669 * Get the local sequence number (for cseq assignment of outgoing requests within this
1677 return (int) this.localSequenceNumber;
1683 * @return -- the original starting sequence number for this dialog.
1686 return this.originalLocalSequenceNumber;
1695 return this.localSequenceNumber;
1704 return this.remoteSequenceNumber;
1713 return this.myTag;
1729 * @param mytag is the tag to use in From headers client transactions that belong to this
1731 * this dialog.
1735 sipStack.getStackLogger().logDebug("set Local tag " + mytag + " " + this.dialogId);
1739 this.myTag = mytag;
1751 this.setState(TERMINATED_STATE);
1760 return this.callIdHeader;
1764 * set the call id header for this dialog.
1767 this.callIdHeader = sipRequest.getCallId();
1777 return this.localParty;
1782 this.localParty = sipMessage.getFrom().getAddress();
1784 this.localParty = sipMessage.getTo().getAddress();
1789 * Returns the Address identifying the remote party. This is the value of the To header of
1790 * locally initiated requests in this dialogue when acting as an User Agent Client.
1792 * This is the value of the From header of recieved responses in this dialogue when acting as
1800 sipStack.getStackLogger().logDebug("gettingRemoteParty " + this.remoteParty);
1802 return this.remoteParty;
1813 return this.remoteTarget;
1822 if (this.dialogState == NULL_STATE)
1824 return DialogState.getObject(this.dialogState);
1828 * Returns true if this Dialog is secure i.e. if the request arrived over TLS, and the
1831 * @return <code>true</code> if this dialogue was established using a sips URI over TLS, and
1835 return this.firstTransactionSecure;
1844 this.sendAck(request, true);
1858 return this.createRequest(method, this.lastResponse);
1886 if (this.getState() == null
1887 || (this.getState().getValue() == TERMINATED_STATE && !method
1889 || (this.isServer() && this.getState().getValue() == EARLY_STATE && method
1892 + " not yet established or terminated " + this.getState());
1895 if (this.getRemoteTarget() != null)
1896 sipUri = (SipUri) this.getRemoteTarget().getURI().clone();
1898 sipUri = (SipUri) this.getRemoteParty().getURI().clone();
1905 cseq.setSeqNumber(this.getLocalSeqNumber());
1916 ListeningPointImpl lp = (ListeningPointImpl) this.sipProvider
1929 from.setAddress(this.localParty);
1931 to.setAddress(this.remoteParty);
1936 * this.
1938 * JvB: Should only do this for target refresh requests, ie not for BYE, PRACK, etc
1942 ContactHeader contactHeader = ((ListeningPointImpl) this.sipProvider
1945 ((SipURI) contactHeader.getAddress().getURI()).setSecure(this.isSecure());
1951 * Guess of local sequence number - this is being re-set when the request is actually
1955 cseq.setSeqNumber(this.localSequenceNumber + 1);
1980 if (this.getLocalTag() != null) {
1981 from.setTag(this.getLocalTag());
1985 if (this.getRemoteTag() != null) {
1986 to.setTag(this.getRemoteTag());
1995 this.updateRequest(sipRequest);
2009 this.sendRequest(clientTransactionId, !this.isBackToBackUserAgent);
2026 "dialog.sendRequest " + " dialog = " + this + "\ndialogRequest = \n"
2039 sipStack.getStackLogger().logError("BYE already sent for " + this);
2047 if (!this.getCallId().getCallId().equalsIgnoreCase(dialogRequest.getCallId().getCallId())) {
2050 sipStack.getStackLogger().logError("CallID " + this.getCallId());
2053 sipStack.getStackLogger().logError("dialog = " + this);
2059 ((SIPClientTransaction) clientTransactionId).setDialog(this, this.dialogId);
2061 this.addTransaction((SIPTransaction) clientTransactionId);
2071 if (this.getLocalTag() != null && from.getTag() != null
2072 && !from.getTag().equals(this.getLocalTag()))
2073 throw new SipException("From tag mismatch expecting " + this.getLocalTag());
2075 if (this.getRemoteTag() != null && to.getTag() != null
2076 && !to.getTag().equals(this.getRemoteTag())) {
2078 this.sipStack.getStackLogger().logWarning(
2079 "To header tag mismatch expecting " + this.getRemoteTag());
2084 if (this.getLocalTag() == null && dialogRequest.getMethod().equals(Request.NOTIFY)) {
2085 if (!this.getMethod().equals(Request.SUBSCRIBE))
2087 this.setLocalTag(from.getTag());
2092 if (this.getLocalTag() != null)
2093 from.setTag(this.getLocalTag());
2094 if (this.getRemoteTag() != null)
2095 to.setTag(this.getRemoteTag());
2110 MessageChannel messageChannel = sipStack.createRawMessageChannel(this
2112 this.firstTransactionPort, hop);
2117 // Remove this from the connection cache if it is in the
2133 * At this point the procedures of 8.1.2 and 12.2.1.1 of RFC3261 have been tried
2137 * failing, try the outbound proxy in accordance with 8.1.2, in particular: This
2151 messageChannel = sipStack.createRawMessageChannel(this.getSipProvider()
2153 this.firstTransactionPort, outboundProxy);
2195 this.byeSent = true;
2200 this.setState(DialogState._TERMINATED);
2215 this.retransmissionTicksLeft = 2 * prevRetransmissionTicks;
2217 this.retransmissionTicksLeft = prevRetransmissionTicks;
2218 this.prevRetransmissionTicks = retransmissionTicksLeft;
2226 this.retransmissionTicksLeft = 1;
2227 this.prevRetransmissionTicks = 1;
2236 if (this.getLastAckSent() != null) {
2247 this.sendAck(getLastAckSent(), false);
2258 // Method of the request or response used to create this dialog
2259 return this.method;
2269 if (this.timerTask != null && timerTask.transaction == transaction) {
2276 this.ackSeen = false;
2280 if (this.timerTask != null) {
2281 this.timerTask.transaction = transaction;
2283 this.timerTask = new DialogTimerTask(transaction);
2291 this.setRetransmissionTicks();
2295 * Stop the dialog timer. This is called when the dialog is terminated.
2302 if (this.timerTask != null) {
2303 this.timerTask.cancel();
2304 this.timerTask = null;
2327 if (this.getState() == null || this.getState().equals(DialogState.TERMINATED))
2336 SIPRequest sipRequest = (SIPRequest) this.createRequest(Request.PRACK,
2356 RouteList rl = this.getRouteList();
2397 if (this.remoteTarget == null) {
2401 if (this.sipStack.isLoggingEnabled()) {
2402 this.sipStack.getStackLogger().logDebug("createAck " + this + " cseqno " + cseqno);
2405 // MUST ack in the same order that the OKs were received. This traps
2409 this.sipStack.getStackLogger().logDebug(
2410 "WARNING : Attempt to crete ACK without OK " + this);
2411 this.sipStack.getStackLogger().logDebug("LAST RESPONSE = " + this.lastResponse);
2423 if (this.routeList != null && !this.routeList.isEmpty()) {
2424 Route r = (Route) this.routeList.getFirst();
2427 uri4transport = ((SipURI) this.remoteTarget.getURI());
2439 "remoteTargetURI " + this.remoteTarget.getURI());
2450 sipRequest.setCallId(this.callIdHeader);
2459 Via via = this.lastResponse.getTopmostVia();
2472 from.setAddress(this.localParty);
2473 from.setTag(this.myTag);
2476 to.setAddress(this.remoteParty);
2478 to.setTag(this.hisTag);
2482 if (this.originalRequest != null) {
2483 Authorization authorization = this.originalRequest.getAuthorization();
2491 this.updateRequest(sipRequest);
2502 * Get the provider for this Dialog.
2506 * @return -- the SIP Provider associated with this transaction.
2509 return this.sipProvider;
2516 this.sipProvider = sipProvider;
2521 * matches the tags of the dialog. We do this check wehn sending out a response.
2527 if (this.getLocalTag() != null || this.getRemoteTag() != null) {
2532 if (responseFromTag.equals(this.getLocalTag())) {
2533 sipResponse.setToTag(this.getRemoteTag());
2534 } else if (responseFromTag.equals(this.getRemoteTag())) {
2535 sipResponse.setToTag(this.getLocalTag());
2545 * Set the last response for this dialog. This method is called for updating the dialog state
2552 this.callIdHeader = sipResponse.getCallId();
2561 this.lastResponse = sipResponse;
2562 this.setAssigned();
2566 "sipDialog: setLastResponse:" + this + " lastResponse = "
2567 + this.lastResponse.getFirstLine());
2569 if (this.getState() == DialogState.TERMINATED) {
2575 // This is handy for late arriving OK's that we want to ACK.
2578 this.lastInviteOkReceived = Math.max(sipResponse.getCSeq().getSeqNumber(),
2579 this.lastInviteOkReceived);
2587 sipStack.getStackLogger().logDebug("dialogState = " + this.getState());
2588 sipStack.getStackLogger().logDebug("method = " + this.getMethod());
2593 // JvB: don't use "!this.isServer" here
2606 && this.getRemoteTag() == null) {
2608 this.setDialogId(sipResponse.getDialogId(false));
2609 sipStack.putDialog(this);
2610 this.addRoute(sipResponse);
2615 * This case occurs for forked dialog responses. The To tag can change as a
2622 this.setDialogId(sipResponse.getDialogId(false));
2623 sipStack.putDialog(this);
2624 this.addRoute(sipResponse);
2627 // This is a dialog creating method (such as INVITE).
2631 // Only do this if method equals initial request!
2635 && this.getState() != DialogState.CONFIRMED) {
2637 this.setDialogId(sipResponse.getDialogId(false));
2638 sipStack.putDialog(this);
2639 this.addRoute(sipResponse);
2646 this.lastInviteOkReceived = Math.max(sipResponse.getCSeq().getSeqNumber(),
2647 this.lastInviteOkReceived);
2655 * This case handles 3xx, 4xx, 5xx and 6xx responses. RFC 3261 Section 12.3 -
2664 * This code is in support of "proxy" servers that are constructed as back to back
2665 * user agents. This could be a dialog in the middle of the call setup path
2667 * response will have additional record route headers. However, for this dialog
2675 if ( this.getState() != DialogState.CONFIRMED && this.getState() != DialogState.TERMINATED ) {
2693 && (this.getMethod().equals(Request.SUBSCRIBE) || this.getMethod().equals(
2695 && this.getState() == null) {
2696 // This is a notify response.
2697 this.setDialogId(sipResponse.getDialogId(true));
2698 sipStack.putDialog(this);
2699 this.setState(SIPDialog.CONFIRMED_STATE);
2710 && this.isTerminatedOnBye()) {
2715 this.setState(SIPDialog.TERMINATED_STATE);
2731 this.setDialogId(sipResponse.getDialogId(true));
2732 sipStack.putDialog(this);
2753 // application is responsible for terminating in this case
2755 if (!this.isReInvite() && getState() != DialogState.CONFIRMED) {
2756 this.setState(SIPDialog.TERMINATED_STATE);
2767 if (this.dialogState <= SIPDialog.EARLY_STATE
2771 this.setState(SIPDialog.CONFIRMED_STATE);
2775 this.setDialogId(sipResponse.getDialogId(true));
2776 sipStack.putDialog(this);
2785 && this.isBackToBackUserAgent) {
2790 if (!this.takeAckSem()) {
2795 this.delete();
2816 this.startTimer(sipServerTx);
2847 * subscribe dialogs from the client side. This modifies the remote target URI potentially
2852 this.setRemoteTarget(contact);
2882 * either a Supported or Require header field indicating this feature, the UAS MUST NOT
2887 SIPRequest request = this.originalRequest;
2906 * uniformly in this range. The RSeq numbering space is within a single transaction. This
2919 * set an arbitrary sequence number. This is actually set when the response is sent out
2940 * @return true if this is the first time the tx has seen the prack ( and hence needs to be
2951 if (!this.isServer()) {
2956 SIPServerTransaction sipServerTransaction = (SIPServerTransaction) this
3008 if (!this.isServer()) {
3051 SIPServerTransaction serverTransaction = (SIPServerTransaction) this
3057 this.setLastResponse(serverTransaction, sipResponse);
3059 this.setDialogId(sipResponse.getDialogId(true));
3063 this.startRetransmitTimer(serverTransaction, relResponse);
3074 this.terminateOnBye = terminateFlag;
3078 * Set the "assigned" flag to true. We do this when inserting the dialog into the dialog table
3083 this.isAssigned = true;
3092 return this.isAssigned;
3096 * Get the contact header that the owner of this dialog assigned. Subsequent Requests are
3107 * Do the necessary processing to handle an ACK directed at this Dialog.
3109 * @param ackTransaction -- the ACK transaction that was directed at this dialog.
3124 if (this.timerTask != null) {
3125 this.timerTask.cancel();
3126 this.timerTask = null;
3132 } else if (this.getState() == DialogState.TERMINATED) {
3140 * This could be a re-invite processing. check to see if the ack matches with the last
3156 ackTransaction.setDialog(this, sipResponse.getDialogId(false));
3158 * record that we already saw an ACK for this dialog.
3168 * This happens when the ACK is re-transmitted and arrives too late to be
3181 this.earlyDialogId = earlyDialogId;
3192 if (this.isBackToBackUserAgent) {
3194 sipStack.getStackLogger().logDebug("releaseAckSem]" + this);
3196 this.ackSem.release();
3203 sipStack.getStackLogger().logDebug("[takeAckSem " + this);
3206 if (!this.ackSem.tryAcquire(2, TimeUnit.SECONDS)) {
3212 sipStack.getStackLogger().logDebug("Semaphore previously acquired at " + this.stackTrace);
3221 this.recordStackTrace();
3237 this.lastAckReceived = lastAckReceived;
3251 this.lastAckSent = lastAckSent;
3255 * @return true if an ack was ever sent for this Dialog
3258 return this.isAcknowledged;
3264 return this.isBackToBackUserAgent;
3269 this.setState(TERMINATED_STATE);
3285 this.isBackToBackUserAgent = true;
3299 this.eventHeader = eventHeader;
3306 this.serverTransactionFlag = serverTransactionFlag;
3313 this.reInviteFlag = reInviteFlag;
3318 return this.sequenceNumberValidation;
3322 this.sequenceNumberValidation = false;
3329 acquired = this.timerTaskLock.tryAcquire(10, TimeUnit.SECONDS);
3339 this.timerTaskLock.release();