Package javax.sip.header

Examples of javax.sip.header.SubscriptionStateHeader


                state = SubscriptionStateHeader.ACTIVE;
            } else if (code>=200) {
                state = SubscriptionStateHeader.TERMINATED;
            }

            SubscriptionStateHeader sstate = headerFactory.createSubscriptionStateHeader( state );
            if (state == SubscriptionStateHeader.TERMINATED) {
                sstate.setReasonCode("noresource");
            }
            notifyRequest.addHeader(sstate);
            notifyRequest.setHeader(referEvent);

            Address address = addressFactory.createAddress("Referee <sip:127.0.0.1>");
View Full Code Here


            // Mark the contact header, to check that the remote contact is updated
            ((SipURI)contactHeader.getAddress().getURI()).setParameter("id","not");

            // Initial state is pending, second time we assume terminated (Expires==0)
            SubscriptionStateHeader sstate = headerFactory.createSubscriptionStateHeader(
                    isInitial ? SubscriptionStateHeader.PENDING : SubscriptionStateHeader.TERMINATED );

            // Need a reason for terminated
            if ( sstate.getState().equalsIgnoreCase("terminated") ) {
                sstate.setReasonCode( "deactivated" );
            }

            notifyRequest.addHeader(sstate);
            notifyRequest.setHeader(eventHeader);
            notifyRequest.setHeader(contactHeader);
View Full Code Here

            try {
                for (int i = 0; i < 1; i++) {

                    Thread.sleep(1000);
                    Request request = this.notifier.dialog.createRequest(Request.NOTIFY);
                    SubscriptionStateHeader subscriptionState = headerFactory
                            .createSubscriptionStateHeader(SubscriptionStateHeader.ACTIVE);
                    request.addHeader(subscriptionState);
                    request.addHeader(eventHeader);

                    // Lets mark our Contact
View Full Code Here

            ((SipURI)contact.getAddress().getURI()).setParameter( "id", "sub" );
            response.addHeader( contact );
            logger.info("Transaction State = " + serverTransactionId.getState());
            serverTransactionId.sendResponse(response);
            logger.info("Dialog State = " + dialog.getState());
            SubscriptionStateHeader subscriptionState = (SubscriptionStateHeader) notify
                    .getHeader(SubscriptionStateHeader.NAME);

            // Subscription is terminated?
            String state = subscriptionState.getState();
            if (state.equalsIgnoreCase(SubscriptionStateHeader.TERMINATED)) {
                dialog.delete();
            } else {
                logger.info("Referer: state now " + state);
            }
View Full Code Here

     
      // Mark the contact header, to check that the remote contact is updated
      ((SipURI)contactHeader.getAddress().getURI()).setParameter("id","not");
     
      // Initial state is pending, second time we assume terminated (Expires==0)
      SubscriptionStateHeader sstate = headerFactory.createSubscriptionStateHeader(
          isInitial ? SubscriptionStateHeader.PENDING : SubscriptionStateHeader.TERMINATED );
     
      // Need a reason for terminated
      if ( sstate.getState().equalsIgnoreCase("terminated") ) {
        sstate.setReasonCode( "deactivated" );
      }
     
      notifyRequest.addHeader(sstate);
      notifyRequest.setHeader(eventHeader);
      notifyRequest.setHeader(contactHeader);
View Full Code Here

      try {
        for (int i = 0; i < 1; i++) {

          Thread.sleep(1000);
          Request request = this.notifier.dialog.createRequest(Request.NOTIFY);
          SubscriptionStateHeader subscriptionState = headerFactory
              .createSubscriptionStateHeader(SubscriptionStateHeader.ACTIVE);
          request.addHeader(subscriptionState);
          request.addHeader(eventHeader);
         
          // Lets mark our Contact
View Full Code Here

      // Create an event header for the subscription.
      EventHeader eventHeader = headerFactory.createEventHeader("foo");
      eventHeader.setEventId("foo");
      request.addHeader(eventHeader);

      SubscriptionStateHeader ssh = headerFactory
          .createSubscriptionStateHeader(SubscriptionStateHeader.ACTIVE);
      // Create the client transaction.
      request.addHeader(ssh);
      ClientTransaction ct = sipProvider.getNewClientTransaction(request);
View Full Code Here

        state = SubscriptionStateHeader.ACTIVE;
      } else if (code>=200) {
        state = SubscriptionStateHeader.TERMINATED;
      }
     
      SubscriptionStateHeader sstate = headerFactory.createSubscriptionStateHeader( state );
      if (state == SubscriptionStateHeader.TERMINATED) {
        sstate.setReasonCode("noresource");
      }
      notifyRequest.addHeader(sstate);     
      notifyRequest.setHeader(referEvent);
     
      Address address = addressFactory.createAddress("Referee <sip:127.0.0.1>");
View Full Code Here

      ((SipURI)contact.getAddress().getURI()).setParameter( "id", "sub" );
      response.addHeader( contact );
      logger.info("Transaction State = " + serverTransactionId.getState());
      serverTransactionId.sendResponse(response);
      logger.info("Dialog State = " + dialog.getState());
      SubscriptionStateHeader subscriptionState = (SubscriptionStateHeader) notify
          .getHeader(SubscriptionStateHeader.NAME);

      // Subscription is terminated?
      String state = subscriptionState.getState();
      if (state.equalsIgnoreCase(SubscriptionStateHeader.TERMINATED)) {
        dialog.delete();
      } else {
        logger.info("Referer: state now " + state);
      }
View Full Code Here

      ((SipURI)contact.getAddress().getURI()).setParameter( "id", "sub" );
      response.addHeader( contact );
      logger.info("Transaction State = " + serverTransactionId.getState());
      serverTransactionId.sendResponse(response);
      logger.info("Dialog State = " + dialog.getState());
      SubscriptionStateHeader subscriptionState = (SubscriptionStateHeader) notify
          .getHeader(SubscriptionStateHeader.NAME);

      // Subscription is terminated?
      String state = subscriptionState.getState();
      if (state.equalsIgnoreCase(SubscriptionStateHeader.TERMINATED)) {
        dialog.delete();
      } else {
        logger.info("Referer: state now " + state);
      }
View Full Code Here

TOP

Related Classes of javax.sip.header.SubscriptionStateHeader

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.