Package javax.servlet.sip

Examples of javax.servlet.sip.SipServletResponse.addHeader()


        || WatcherInfoEventPackage.NAME.equals(event))
      getServletContext().getNamedDispatcher("presence").forward(subscribe, null);
    else
    {
      SipServletResponse response = subscribe.createResponse(SipServletResponse.SC_BAD_EVENT);
      response.addHeader(Constants.ALLOW_EVENTS, RegEventPackage.NAME);
      response.addHeader(Constants.ALLOW_EVENTS, PresenceEventPackage.NAME);
      response.addHeader(Constants.ALLOW_EVENTS, WatcherInfoEventPackage.NAME);
      response.send();
      response.getApplicationSession().invalidate();
    }
View Full Code Here


      getServletContext().getNamedDispatcher("presence").forward(subscribe, null);
    else
    {
      SipServletResponse response = subscribe.createResponse(SipServletResponse.SC_BAD_EVENT);
      response.addHeader(Constants.ALLOW_EVENTS, RegEventPackage.NAME);
      response.addHeader(Constants.ALLOW_EVENTS, PresenceEventPackage.NAME);
      response.addHeader(Constants.ALLOW_EVENTS, WatcherInfoEventPackage.NAME);
      response.send();
      response.getApplicationSession().invalidate();
    }
  }
View Full Code Here

    else
    {
      SipServletResponse response = subscribe.createResponse(SipServletResponse.SC_BAD_EVENT);
      response.addHeader(Constants.ALLOW_EVENTS, RegEventPackage.NAME);
      response.addHeader(Constants.ALLOW_EVENTS, PresenceEventPackage.NAME);
      response.addHeader(Constants.ALLOW_EVENTS, WatcherInfoEventPackage.NAME);
      response.send();
      response.getApplicationSession().invalidate();
    }
  }
 
View Full Code Here

      String event = publish.getHeader(Constants.EVENT);
 
      if (event == null || !event.equals(_presence.getName()))
      {
        SipServletResponse response = publish.createResponse(SipServletResponse.SC_BAD_EVENT);
        response.addHeader(Constants.ALLOW_EVENTS, _presence.getName());
        response.send();
        return;
      }
 
      String uri = URIUtil.toCanonical(publish.getRequestURI());
View Full Code Here

        if(expires != 0)
        {
          if (expires < _presence.getMinStateExpires())
          {
            SipServletResponse response = publish.createResponse(SipServletResponse.SC_INTERVAL_TOO_BRIEF);
            response.addHeader(Constants.MIN_EXPIRES, Integer.toString(_presence.getMinStateExpires()));
            response.send();
            return;
          }
          else if (expires > _presence.getMaxStateExpires())
            expires = _presence.getMaxStateExpires();
View Full Code Here

      List<String> supported = _presence.getSupportedContentTypes();
      if (contentType != null && !(supported.contains(contentType)))
      {
        SipServletResponse response = publish.createResponse(SipServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
        for (String s : supported)
          response.addHeader(Constants.ACCEPT, s);
        response.send();
        return;
      }
 
      byte[] raw = publish.getRawContent();
View Full Code Here

    ListIterator<String> it2 = register.getHeaders(Constants.REQUIRE);
    if (it2.hasNext())
    {
      SipServletResponse response = register.createResponse(SipServletResponse.SC_BAD_EXTENSION);
      while (it2.hasNext())
        response.addHeader(Constants.UNSUPPORTED, it2.next());
      response.send();
      return;
    }
   
    long now = System.currentTimeMillis();
View Full Code Here

      {
        if (contentType == null)
        {
          SipServletResponse response = publish.createResponse(SipServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
          for (String s : supported)
            response.addHeader(Constants.ACCEPT, s);
          response.send();
          return;
        }
        ContentHandler<?> handler = _presence.getContentHandler(contentType);   
        try
View Full Code Here

              if (expires > _maxExpires)
                expires = _maxExpires;
              if (expires < _minExpires)
              {
                SipServletResponse response = register.createResponse(SipServletResponse.SC_INTERVAL_TOO_BRIEF);
                response.addHeader(Constants.MIN_EXPIRES, Integer.toString(_minExpires));
                response.send();
                return;
              }
            }
            Binding binding = null;
View Full Code Here

    {
      _locationService.put(record);
    }
   
    SipServletResponse ok = register.createResponse(SipServletResponse.SC_OK);
    ok.addHeader(Constants.DATE, _dateFormat.format(new Date(now)));
    if (bindings != null)
    {
      for (Binding binding : bindings)
      {
        Address address = _sipFactory.createAddress(binding.getContact());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.