Package javax.sip

Examples of javax.sip.Dialog


     *
     * @see gov.nist.javax.sip.stack.SIPTransaction#getDialog()
     */
    public  Dialog getDialog() {
        // This is for backwards compatibility.
        Dialog retval = null;
        if (this.lastResponse != null && this.lastResponse.getFromTag() != null
                && this.lastResponse.getToTag() != null
                && this.lastResponse.getStatusCode() != 100) {
            String dialogId = this.lastResponse.getDialogId(false);
            retval = (Dialog) getDialog(dialogId);
View Full Code Here


                    "handleEvent " + sipEvent + "currentTransaction = "
                            + transaction + "this.sipListener = "
                            + this.getSipListener() + "sipEvent.source = "
                            + sipEvent.getSource());
            if (sipEvent instanceof RequestEvent) {
                Dialog dialog = ((RequestEvent) sipEvent).getDialog();
                if ( logger.isLoggingEnabled(LogLevels.TRACE_DEBUG))  logger.logDebug("Dialog = " + dialog);
            } else if (sipEvent instanceof ResponseEvent) {
                Dialog dialog = ((ResponseEvent) sipEvent).getDialog();
                if (logger.isLoggingEnabled(LogLevels.TRACE_DEBUG) ) logger.logDebug("Dialog = " + dialog);
            }
            logger.logStackTrace();
        }
View Full Code Here

        // mranga: added check to ensure we are not sending empty (keepalive)
        // message.
        if (((SIPRequest) request).getRequestLine() != null
                && request.getMethod().equals(Request.ACK)) {
            Dialog dialog = sipStack.getDialog(((SIPRequest) request)
                    .getDialogId(false));
            if (dialog != null && dialog.getState() != null) {
              if (logger.isLoggingEnabled())
                logger.logWarning(
                        "Dialog exists -- you may want to use Dialog.sendAck() "
                                + dialog.getState());
            }
        }
        Hop hop = sipStack.getRouter((SIPRequest) request).getNextHop(request);
        if (hop == null)
            throw new SipException("could not determine next hop!");
View Full Code Here

                        && ((CSeqHeader) response.getHeader(CSeqHeader.NAME)).getMethod().equals(
                                Request.INVITE)) {
                    this.okRecieved = true;
                    ReInviteBusyTest.assertNotNull("INVITE 200 response should match a transaction",
                            tid);
                    Dialog dialog = tid.getDialog();
                    CSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);
                    Request request = dialog.createAck(cseq.getSeqNumber());
                    dialog.sendAck(request);
                }
                if (tid != null) {
                    Dialog dialog = tid.getDialog();
                    logger.info("Dalog State = " + dialog.getState());
                    String toTag = ((ResponseExt)response).getToHeader().getTag();
                    // Note that TRYING is an optional response.
                    if(DialogState.CONFIRMED.equals(dialog.getState()) && toTag == null && response.getStatusCode() == Response.TRYING) {
                        this.isToTagInTryingReInvitePresent  = false;
                        logger.info("to tag for trying in re INVITE is present " + toTag);
                    }
                }
            } catch (Exception ex) {
View Full Code Here

                    + tid + ":\n" + response);
            try {
                if (response.getStatusCode() == Response.OK
                        && ((CSeqHeader) response.getHeader(CSeqHeader.NAME))
                                .getMethod().equals(Request.INVITE)) {
                    Dialog dialog = tid.getDialog();
                    CSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);
                    Request ackRequest = dialog.createAck(cseq.getSeqNumber());
                    dialog.sendAck(ackRequest);
                }
                if ( tid != null ) {
                    Dialog dialog = tid.getDialog();
                    logger.info("Dialog State = " + dialog.getState());
                }
            } catch (Exception ex) {
                String s = "Unexpected exception";
                logger.error(s,ex);
                AckReTransmissionTest.fail(s);
View Full Code Here

        if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG))
            logger.logDebug("Looking for dialog " + did);
        /*
         * Check if we can find this dialog in our dialog table.
         */
        Dialog replacesDialog =  this.dialogTable.get(did);
        /*
         * This could be a forked dialog. Search for it.
         */
        if ( replacesDialog == null ) {
            for (SIPClientTransaction ctx : this.clientTransactionTable
View Full Code Here

            try {
                if (response.getStatusCode() == Response.OK
                        && ((CSeqHeader) response.getHeader(CSeqHeader.NAME))
                                .getMethod().equals(Request.INVITE)) {

                    Dialog dialog = responseReceivedEvent.getDialog();
                    CSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);
                    Request ackRequest = dialog.createAck(cseq.getSeqNumber());
                    logger.info("Ack request to send = " + ackRequest);
                    logger.info("Sending ACK");
                    dialog.sendAck(ackRequest);
                }
            } catch (Exception ex) {
                logger.error(ex);
                ex.printStackTrace();
                RFC5626KeepAliveTest.fail("unexpected exception");
View Full Code Here

        }

        public void processInvite(Request request, ServerTransaction st) {
            try {
                this.reInviteReceivedCount++;
                Dialog dialog = st.getDialog();
                logger.info("shootist received RE INVITE. Sending BUSY_HERE");
                assertEquals("Dialog state must in confirmed state ",DialogState.CONFIRMED,dialog.getState());
               
                Thread.sleep(300);
               
                Response response = protocolObjects.messageFactory.createResponse(Response.BUSY_HERE,
                        request);
                ((ToHeader) response.getHeader(ToHeader.NAME)).setTag(((ToHeader) request
                        .getHeader(ToHeader.NAME)).getTag());

                Address address = protocolObjects.addressFactory.createAddress("Shootme <sip:"
                        + myAddress + ":" + myPort + ">");
                ContactHeader contactHeader = protocolObjects.headerFactory
                        .createContactHeader(address);
                response.addHeader(contactHeader);
                st.sendResponse(response);
                assertEquals("Dialog state must be in confirmed state ",DialogState.CONFIRMED,dialog.getState());
                ReInviteBusyTest.assertEquals("Dialog for reinvite must match original dialog",
                        dialog, this.dialog);

            } catch (Exception ex) {
                logger.error("unexpected exception", ex);
View Full Code Here

                                Request.INVITE)) {

                    // Request cancel = inviteTid.createCancel();
                    // ClientTransaction ct =
                    // sipProvider.getNewClientTransaction(cancel);
                    Dialog dialog = tid.getDialog();
                    CSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);
                    Request ackRequest = dialog.createAck(cseq.getSeqNumber());
                    logger.info("Ack request to send = " + ackRequest);
                    logger.info("Sending ACK");
                    dialog.sendAck(ackRequest);

                    Thread.sleep(100);
                 
                    Request inviteRequest = dialog.createRequest(Request.INVITE);
                    ((SipURI) inviteRequest.getRequestURI()).removeParameter("transport");
                    ((ViaHeader) inviteRequest.getHeader(ViaHeader.NAME)).setTransport("udp");
                    inviteRequest.addHeader(contactHeader);
                    MaxForwardsHeader mf = protocolObjects.headerFactory
                            .createMaxForwardsHeader(10);
                    inviteRequest.addHeader(mf);
                     ClientTransaction ct = provider.getNewClientTransaction(inviteRequest);
                    dialog.sendRequest(ct);
                    reInviteCount++;
                    logger.info("RE-INVITE sent");

                } else if (response.getStatusCode() == Response.BUSY_HERE) {
                    this.busyHereReceived = true;
                    TestCase.assertEquals("Dialog State must be CONFIRMED", dialog.getState(), DialogState.CONFIRMED);
                }
            } catch (Exception ex) {
                ex.printStackTrace();

                logger.error(ex);
View Full Code Here

        // DIALOG CHECK

        // Note that the jiplet server is actually implemented as a back
        // to back User Agent.
        Dialog dialog = null;
        if (serverTransaction != null)
        {
            dialog = serverTransaction.getDialog();
        }

        DialogState dialogState = null;
        if (dialog != null)
            dialogState = dialog.getState();
        if ((dialogState == null) || (proxy.isReset() == true))
        {
            ClientTransaction clientTransaction = sipProvider
                    .getNewClientTransaction(clonedRequest);
            clientTransaction.sendRequest();
View Full Code Here

TOP

Related Classes of javax.sip.Dialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.