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();
      TlsTest.assertSame("dialog mismatch", dialog,this.dialog);
      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());
      TlsTest.assertEquals("Should be terminated", dialog.getState() , DialogState.TERMINATED);
     
    } catch (Exception ex) {
      logger.error("unexpected exception",ex);
      TlsTest.fail("unexpected exception");
     
View Full Code Here


          && cseq.getMethod().equals(Request.INVITE)) {
       
        // Request cancel = inviteTid.createCancel();
        // ClientTransaction ct =
        // sipProvider.getNewClientTransaction(cancel);
        Dialog dialog = tid.getDialog();
        Request ackRequest = dialog.createAck(cseq.getSeqNumber());
        TlsTest.assertTrue( "Secure URI",
            ((SipURI)ackRequest.getRequestURI()).isSecure() );
        logger.info("Ack request to send = " + ackRequest);
        logger.info("Sending ACK");
        dialog.sendAck(ackRequest);

        // Send a Re INVITE but this time force it
        // to use UDP as the transport. Else, it will
        // Use whatever transport was used to create
        // the dialog.
        if (reInviteCount == 0) {
          Request inviteRequest = dialog
              .createRequest(Request.INVITE);         
          Thread.sleep(100);
          ClientTransaction ct = provider
              .getNewClientTransaction(inviteRequest);
          dialog.sendRequest(ct);
          reInviteCount++;
        } else {
          this.okReceived = true;
        }
View Full Code Here

        logger.info("Dialog State = " + dialog.getState());
       
        // JvB: there should not be a transaction for ACKs; requestEvent
        // can be used to get it instead
        // Dialog dialog = serverTransaction.getDialog();
        Dialog dialog = requestEvent.getDialog();

        SipProvider provider = (SipProvider) requestEvent.getSource();
        Request byeRequest = dialog.createRequest(Request.BYE);
        ClientTransaction ct = provider.getNewClientTransaction(byeRequest);
        dialog.sendRequest(ct);
      } catch (Exception ex) {
        ex.printStackTrace();
        TestHarness.fail(ex.getMessage());
      }
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 = 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

      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());
          logger.info("Ack request to send = " + ackRequest);
          logger.info("Sending ACK");
          dialog.sendAck(ackRequest);
        }
      } catch (Exception ex) {
        logger.error(ex);
        AckReTransmissionTest.fail("unexpected exception");
      }
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 = 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

      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);
      this.gotBye = true;
      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 processInvite(Request request, ServerTransaction st) {
    try {
      Dialog dialog = st.getDialog();
      Response response = protocolObjects.messageFactory.createResponse(
          Response.OK, request);
      ((ToHeader) response.getHeader(ToHeader.NAME))
          .setTag(((ToHeader) request.getHeader(ToHeader.NAME))
              .getTag());
View Full Code Here

  public void processAck(Request request, ServerTransaction tid) {
    try {
      logger.info("Got an ACK! sending bye : " + tid);
      if (tid != null) {
        Dialog dialog = tid.getDialog();
        TlsTest.assertSame("dialog id mismatch", dialog,this.dialog);
        Request bye = dialog.createRequest(Request.BYE);
        MaxForwardsHeader mf = protocolObjects.headerFactory
            .createMaxForwardsHeader(10);
        bye.addHeader(mf);
        ClientTransaction ct = provider.getNewClientTransaction(bye);
        dialog.sendRequest(ct);
        this.byeSent = true;
      }
    } catch (Exception ex) {
      logger.error("unexpected exception",ex);
      TlsTest.fail("unexpected exception");
View Full Code Here

     *
     * @see gov.nist.javax.sip.stack.SIPTransaction#getDialog()
     */
    public synchronized 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

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.