Package javax.sip

Examples of javax.sip.Dialog


      DialogsOfB.add(responseEvent.getDialog());
      callIDheadersDia.add((CallIdHeader) responseEvent.getResponse().getHeader(CallIdHeader.NAME));
     
      CSeqHeader cseq = (CSeqHeader) responseEvent.getResponse().getHeader(CSeqHeader.NAME);
      try{
        Dialog dialog = responseEvent.getClientTransaction().getDialog();
        Request ack = dialog.createAck(cseq.getSeqNumber());
        //System.out.println("Ack sent");
        dialog.sendAck(ack);
      }catch (SipException e) {
        e.printStackTrace();
        System.err.println(e.getMessage());
      }catch (InvalidArgumentException e) {
        e.printStackTrace();
View Full Code Here


      //System.out.println("confirmed OK bekommen");
      CallIdHeader callID = (CallIdHeader) responseEvent.getResponse().getHeader(CallIdHeader.NAME);
      CSeqHeader cseq = (CSeqHeader) responseEvent.getResponse().getHeader(CSeqHeader.NAME);
     
      try{
        Dialog dialog = responseEvent.getClientTransaction().getDialog();
        Request ack = dialog.createAck(cseq.getSeqNumber());

        //System.out.println("Ack sent");
        //System.out.println("ACK sent");
        dialog.sendAck(ack);
        //A sends a BYE
        Request byeRequest = dialog.createRequest(Request.BYE);
        dialog.sendRequest(sipProvider.getNewClientTransaction(byeRequest));
        //System.out.println("BYE sent");
        //System.out.println("Bye sent");
       
      }catch (SipException e) {
        e.printStackTrace();
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

     *
     * @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

        if (stackLogger.isLoggingEnabled(LogWriter.TRACE_DEBUG))
            stackLogger.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

     *
     * @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

            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 = protocolObjects.messageFactory.createResponse(200, request);
            serverTransactionId.sendResponse(response);
            logger.info("shootist:  Sending OK.");
            logger.info("Dialog State = " + dialog.getState());

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

        CSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);

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

        Dialog dialog = responseReceivedEvent.getDialog();
        TestHarness.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)) {
                    TestHarness.assertEquals(DialogState.CONFIRMED, dialog.getState());
                    Request ackRequest = dialog.createAck(cseq.getSeqNumber());

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

                    if (dialog == this.ackedDialog) {
                        dialog.sendAck(ackRequest);
                        return;
                    }
                    this.forkedDialogs.add(dialog);

                    logger.info("Sending ACK");
                    dialog.sendAck(ackRequest);
                    TestHarness.assertTrue("Dialog state should be CONFIRMED",
                            dialog.getState() == DialogState.CONFIRMED);
                    this.ackedDialog = dialog;

                } else {
                    logger.info("Response method = " + cseq.getMethod());
                }
View Full Code Here

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

            // Create the client transaction.
            inviteTid = sipProvider.getNewClientTransaction(request);
            Dialog dialog = inviteTid.getDialog();

            TestHarness.assertTrue("Initial dialog state should be null",
                    dialog.getState() == null);

            // send the request out.
            inviteTid.sendRequest();

            this.originalDialog = dialog;
View Full Code Here

          "handleEvent " + sipEvent + "currentTransaction = "
              + transaction + "this.sipListener = "
              + this.sipListener + "sipEvent.source = "
              + sipEvent.getSource());
      if (sipEvent instanceof RequestEvent) {
        Dialog dialog = ((RequestEvent) sipEvent).getDialog();
        if ( sipStack.isLoggingEnabled())  sipStack.getLogWriter().logDebug("Dialog = " + dialog);
      } else if (sipEvent instanceof ResponseEvent) {
        Dialog dialog = ((ResponseEvent) sipEvent).getDialog();
        if (sipStack.isLoggingEnabled() ) sipStack.getLogWriter().logDebug("Dialog = " + dialog);
      }
      sipStack.getLogWriter().logStackTrace();
    }
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.