Package javax.sip.header

Examples of javax.sip.header.CSeqHeader


      } catch (ParseException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
    CSeqHeader cseq2 = (CSeqHeader) responseEvent.getResponse().getHeader(CSeqHeader.NAME);
    //OK BEKOMMEN
    if(responseEvent.getResponse().getStatusCode() == 200 && cseq2.getMethod().equals("INVITE")){
      //System.out.println("confirmed OK bekommen");
      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());
View Full Code Here


      // Create a new CallId header
      CallIdHeader callIdHeader = sipProvider.getNewCallId();
      //callIdHeader.setCallId("1");
      // Create a new Cseq header
      CSeqHeader cSeqHeader = headerFactory.createCSeqHeader(id, Request.INVITE);

      // Create a new MaxForwardsHeader
      MaxForwardsHeader maxForwards = headerFactory.createMaxForwardsHeader(70);
      // Create the request.
      request = messageFactory.createRequest(requestURI,Request.INVITE,
View Full Code Here

    if(responseEvent.getResponse().getStatusCode() == 180){
      //System.out.println("Ringing bekommen");
      //System.out.println("RINGING bekommen");
      CallIdHeader callID = (CallIdHeader) responseEvent.getResponse().getHeader(CallIdHeader.NAME);
    }
    CSeqHeader cseq2 = (CSeqHeader) responseEvent.getResponse().getHeader(CSeqHeader.NAME);

    if(responseEvent.getResponse().getStatusCode() == 200 && cseq2.getMethod().equals("INVITE")){
      //System.out.println("confirmed OK bekommen");
      //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
View Full Code Here

    public synchronized 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);
        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());
                }
            } else if (response.getStatusCode() == Response.RINGING) {
                // TestHarness.assertEquals( DialogState.EARLY, dialog.getState() );
            }
        } catch (Throwable ex) {
View Full Code Here

    }

    public synchronized void processResponse(ResponseEvent responseEvent) {
        try {
            Response response = responseEvent.getResponse();
            CSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);
            logger.info("ClientTxID = " + responseEvent.getClientTransaction() + " client tx id "
                    + ((ViaHeader) response.getHeader(ViaHeader.NAME)).getBranch()
                    + " CSeq header = " + response.getHeader(CSeqHeader.NAME) + " status code = "
                    + response.getStatusCode());

            // JvB: stateful proxy MUST NOT forward 100 Trying
            if (response.getStatusCode() == 100)
                return;

            if (response.getStatusCode() == Response.LOOP_DETECTED) {
                this.loopDetectedSeen = true;
            }
            if (cseq.getMethod().equals(Request.INVITE)) {
                ClientTransaction ct = responseEvent.getClientTransaction();
                if (ct != null) {
                    ServerTransaction st = (ServerTransaction) ct.getApplicationData();

                    // Strip the topmost via header
View Full Code Here

                CallIdHeader callId = (CallIdHeader) response.getHeader(CallIdHeader.NAME);

                ContactHeader requestContact = (ContactHeader) request
                        .getHeader(ContactHeader.NAME);
                SipURI notifyRuri = (SipURI) requestContact.getAddress().getURI();
                CSeqHeader cSeq = headerFactory.createCSeqHeader(1L, Request.NOTIFY);
                String ipAddress = sipProvider.getListeningPoint("udp").getIPAddress();
                int port = sipProvider.getListeningPoint("udp").getPort();
                ViaHeader viaHeader = headerFactory.createViaHeader(ipAddress, port, "udp", null);
                LinkedList llist = new LinkedList<ViaHeader>();
                llist.add(viaHeader);
View Full Code Here

          && ((CSeqHeader) response.getHeader(CSeqHeader.NAME))
              .getMethod().equals(Request.INVITE)) {
        ChallengeTest.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());
View Full Code Here

  public synchronized 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);
    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("SHOOTIST: 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 ) );
   
          // Proxy will fork. I will accept the second dialog
          // but not the first.
          this.forkedDialogs.add(dialog);
          dialog.sendAck(ackRequest);
          if ( forkedDialogs.size() == 2 ) {
            logger.info("Sending ACK");
           
            TestHarness.assertTrue(
                "Dialog state should be CONFIRMED", dialog
                    .getState() == DialogState.CONFIRMED);
            this.ackedDialog = dialog;
           
            // TestHarness.assertNotNull( "JvB: Need CT to find original dialog", tid );

          } else {
           
            // Kill the first 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 {
          logger.info("Response method = " + cseq.getMethod());
        }
      } else if ( response.getStatusCode() == Response.RINGING ) {
        //TestHarness.assertEquals( DialogState.EARLY, dialog.getState() );
      }
    } catch (Throwable 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 responseEvent) {
    try {
      Response response = responseEvent.getResponse();
      CSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);
      logger.info("ClientTxID = "
          + responseEvent.getClientTransaction()
          + " client tx id "
          + ((ViaHeader) response.getHeader(ViaHeader.NAME))
              .getBranch() + " CSeq header = "
          + response.getHeader(CSeqHeader.NAME) + " status code = "
          + response.getStatusCode());

      // JvB: stateful proxy MUST NOT forward 100 Trying
      if (response.getStatusCode() == 100)
        return;

      if (cseq.getMethod().equals(Request.INVITE)) {
        ClientTransaction ct = responseEvent.getClientTransaction();
        if (ct != null) {
          ServerTransaction st = (ServerTransaction) ct
              .getApplicationData();
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.