Package javax.sip.header

Examples of javax.sip.header.CSeqHeader


                // Create a new CallId header
                CallIdHeader callIdHeader = udpProvider.getNewCallId();

                // Create a new Cseq header
                CSeqHeader cSeqHeader = headerFactory.createCSeqHeader(1L, Request.SUBSCRIBE);

                // Create a new MaxForwardsHeader
                MaxForwardsHeader maxForwards = headerFactory.createMaxForwardsHeader(70);

                // Create the request.
View Full Code Here


  public void processResponse(ResponseEvent responseReceivedEvent) {
    logger.info("Got a response");
    Response response = (Response) responseReceivedEvent.getResponse();
    ClientTransaction tid = responseReceivedEvent.getClientTransaction();
    CSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);

    logger.info("Response received : Status Code = "
        + response.getStatusCode() + " " + cseq);
   
   
    if (tid == null) {
      logger.info("Stray response -- dropping ");
      return;
    }
    logger.info("transaction state is " + tid.getState());
    logger.info("Dialog = " + tid.getDialog());
    logger.info("Dialog State is " + tid.getDialog().getState());
    SipProvider provider = (SipProvider) responseReceivedEvent.getSource();
    AbstractRouterTestCase.assertEquals("Provider is not equal to the original proivder",
        provider, sipProvider);

    try {
      if (response.getStatusCode() == Response.OK) {
        if (cseq.getMethod().equals(Request.INVITE)) {         
          Request ackRequest = dialog.createAck(cseq.getSeqNumber());
          logger.info("Sending ACK");
          dialog.sendAck(ackRequest);
          this.gotInviteOK = true;
        }
      }
View Full Code Here

      // JvB: Make sure that the implementation matches the messagefactory
      callIdHeader = headerFactory.createCallIdHeader( callIdHeader.getCallId() );


      // Create a new Cseq header
      CSeqHeader cSeqHeader = headerFactory.createCSeqHeader(1L,
          Request.INVITE);

      // Create a new MaxForwardsHeader
      MaxForwardsHeader maxForwards = headerFactory
          .createMaxForwardsHeader(70);
View Full Code Here

    logger.info("Dialog = " + tid.getDialog());
    logger.info("Dialog State is " + tid.getDialog().getState());
    SipProvider provider = (SipProvider) responseReceivedEvent.getSource();

    try {
      CSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);
      if (response.getStatusCode() == Response.OK
          && 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);
View Full Code Here

      callIdHeader = protocolObjects.headerFactory.createCallIdHeader(
          callIdHeader.getCallId() );


      // Create a new Cseq header
      CSeqHeader cSeqHeader = protocolObjects.headerFactory
          .createCSeqHeader(1L, Request.INVITE);

      // Create a new MaxForwardsHeader
      MaxForwardsHeader maxForwards = protocolObjects.headerFactory
          .createMaxForwardsHeader(70);
View Full Code Here

                // Create a new CallId header
                CallIdHeader callIdHeader = sipProvider.getNewCallId();

                // Create a new Cseq header
                CSeqHeader cSeqHeader = headerFactory.createCSeqHeader(1L,
                        Request.INVITE);

                // Create a new MaxForwardsHeader
                MaxForwardsHeader maxForwards = headerFactory
                        .createMaxForwardsHeader(70);
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());
            dialog.sendAck(ackRequest);
          }
          if ( tid != null ) {
              Dialog dialog = tid.getDialog();
              logger.info("Dialog State = " + dialog.getState());      }
View Full Code Here

        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) {
View Full Code Here

        // JvB: Make sure that the implementation matches the messagefactory
        callIdHeader = protocolObjects.headerFactory.createCallIdHeader( callIdHeader.getCallId() );


        // Create a new Cseq header
        CSeqHeader cSeqHeader = protocolObjects.headerFactory
            .createCSeqHeader(1L, Request.INVITE);

        // Create a new MaxForwardsHeader
        MaxForwardsHeader maxForwards = protocolObjects.headerFactory
            .createMaxForwardsHeader(70);
View Full Code Here

    public void processResponse(ResponseEvent responseReceivedEvent) {
      logger.info("Got a response");
      Response response = (Response) responseReceivedEvent.getResponse();
      lastResponse = response;
      ClientTransaction tid = responseReceivedEvent.getClientTransaction();
      CSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);

      logger.info("Response received : Status Code = "
          + response.getStatusCode() + " " + cseq);
     
      if (cseq.getMethod() == Request.PRACK) {
        prackConfirmed = true;
      }
     
      if (tid == null) {
        logger.info("Stray response -- dropping ");
        return;
      }
      logger.info("transaction state is " + tid.getState());
      logger.info("Dialog = " + tid.getDialog());
      logger.info("Dialog State is " + tid.getDialog().getState());
      SipProvider provider = (SipProvider) responseReceivedEvent.getSource();
      dialog = tid.getDialog();

      try {
        if (response.getStatusCode() == Response.OK) {
          if (cseq.getMethod().equals(Request.INVITE)) {
            Request ackRequest = dialog.createAck(((CSeqHeader) response.getHeader(CSeqHeader.NAME)).getSeqNumber());
            logger.info("Sending ACK");
            dialog.sendAck(ackRequest);
          }
View Full Code Here

TOP

Related Classes of javax.sip.header.CSeqHeader

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.