Package javax.sip

Examples of javax.sip.Dialog


            logger.info("shootist:  got a bye .");
            if (serverTransactionId == null) {
                logger.info("shootist:  null TID.");
                return;
            }
            Dialog dialog = serverTransactionId.getDialog();
            logger.info("Dialog State = " + dialog.getState());
            Response response = messageFactory.createResponse(200, request);
            serverTransactionId.sendResponse(response);
            logger.info("shootist:  Sending OK.");
            logger.info("Dialog State = " + dialog.getState());

        } catch (Exception ex) {
            TestHarness.fail(ex.getMessage());
            System.exit(0);
View Full Code Here


        }

        public void processDialogTerminated(
                DialogTerminatedEvent dialogTerminatedEvent) {
            Dialog d = dialogTerminatedEvent.getDialog();
            System.out.println("Local Party = " + d.getLocalParty());

        }
View Full Code Here

            inUse = true;
            if(q%100==0) System.out.println("Receive " + q);
            q++;
            if ( responseReceivedEvent.getResponse().getStatusCode() == Response.OK) {

              Dialog d = responseReceivedEvent.getDialog();
              try {
                Request ack = d.createAck(1);
                sipProvider.sendRequest(ack);
                sipProvider.sendRequest(ack);
                sipProvider.sendRequest(ack);
                sipProvider.sendRequest(ack);
                sipProvider.sendRequest(ack);
View Full Code Here

                        "<http://www.antd.nist.gov>");
                request.addHeader(callInfoHeader);

                // Create the client transaction.
                ClientTransaction inviteTid = sipProvider.getNewClientTransaction(request);
              Dialog d = null;
        try {
          d = sipProvider.getNewDialog(inviteTid);
        } catch (SipException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
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 ( sipStack.isLoggingEnabled())  sipStack.getStackLogger().logDebug("Dialog = " + dialog);
            } else if (sipEvent instanceof ResponseEvent) {
                Dialog dialog = ((ResponseEvent) sipEvent).getDialog();
                if (sipStack.isLoggingEnabled() ) sipStack.getStackLogger().logDebug("Dialog = " + dialog);
            }
            sipStack.getStackLogger().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 (sipStack.isLoggingEnabled())
                sipStack.getStackLogger().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

            } else if ( response.getStatusCode() == Shootme.PRACK_CODE) {
                prackTriggerReceived = true;
                RequireHeader requireHeader = (RequireHeader) response.getHeader(RequireHeader.NAME);
                if ( requireHeader.getOptionTag().equalsIgnoreCase("100rel")) {
                    Dialog dialog = tid.getDialog();
                    Request prackRequest = dialog.createPrack(response);
                    // create Request URI
                    SipURI requestURI = addressFactory.createSipURI(toUser,
                            "127.0.0.1:" + Shootme.myPort);
                    prackRequest.setRequestURI(requestURI);
                    ClientTransaction ct = provider.getNewClientTransaction(prackRequest);
                    Thread.sleep(2000);
                    dialog.sendRequest(ct);
                }
            }
        } catch (Exception ex) {
            ex.printStackTrace();
            TestHarness.fail("Unexpected exception " + ex.getMessage());
View Full Code Here

     *
     * @see gov.nist.javax.sip.stack.SIPTransaction#getDialog()
     */
    public  Dialog getDialog() {
        // This is for backwards compatibility.
        Dialog retval = null;
        // get it in a local variable because the last response can be nullified and the if condition
        // can throw NPE
        SIPResponse localLastResponse = this.lastResponse;
        if(localLastResponse != null && localLastResponse.getFromTag() != null
                && localLastResponse.getToTag() != null
View Full Code Here

        String did = dialogId.toString().toLowerCase();
        getStackLogger().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.values()) {
View Full Code Here

        logger.info("Response received : Status Code = "
                + response.getStatusCode() + " " + cseq);
        logger.info("Response = " + response + " class=" + response.getClass() );

        Dialog dialog = responseReceivedEvent.getDialog();
        TestCase.assertNotNull( dialog );

        if (tid != null)
            logger.info("transaction state is " + tid.getState());
        else
            logger.info("transaction = " + tid);

        logger.info("Dialog = " + dialog);

        logger.info("Dialog state is " + dialog.getState());

        try {
            if (response.getStatusCode() == Response.OK) {
                if (cseq.getMethod().equals(Request.INVITE)) {
                    TestCase.assertEquals( DialogState.CONFIRMED, dialog.getState() );
                    Request ackRequest = dialog.createAck(cseq
                            .getSeqNumber());

                    TestCase.assertNotNull( ackRequest.getHeader( MaxForwardsHeader.NAME ) );

                    if ( dialog == this.ackedDialog ) {
                        dialog.sendAck(ackRequest);
                        return;
                    }
                    // Proxy will fork. I will accept the first dialog.
                    this.forkedDialogs.add(dialog);
                    if ( responseReceivedEvent.getClientTransaction() != null ) {
                        logger.info("Sending ACK");
                        dialog.sendAck(ackRequest);
                        TestCase.assertTrue(
                                "Dialog state should be CONFIRMED", dialog
                                        .getState() == DialogState.CONFIRMED);

                        TestCase.assertTrue(this.ackedDialog == null ||
                                this.ackedDialog == dialog);
                        this.ackedDialog = dialog;

                        if ( callerSendsBye ) {
                            timer.schedule( new SendBye(ackedDialog), 4000  );
                        }


                    } else {
                        this.canceledDialog.add(dialog);
                        // Send ACK to quench re-transmission
                        sipProvider.sendRequest(ackRequest);
                        // Kill the second dialog by sending a bye.
                        SipProvider sipProvider = (SipProvider) responseReceivedEvent
                                .getSource();

                        Request byeRequest = dialog.createRequest(Request.BYE);
                        ClientTransaction ct = sipProvider
                                .getNewClientTransaction(byeRequest);
                        dialog.sendRequest(ct);
                    }


                } else if ( cseq.getMethod().equals(Request.BYE)) {
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.