Package javax.servlet.sip

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


    String event = subscribe.getHeader(Constants.EVENT);
   
    if (event == null || !(event.equals(_regEventPackage.getName())))
    {
      SipServletResponse response = subscribe.createResponse(SipServletResponse.SC_BAD_EVENT);
      response.addHeader(Constants.ALLOW_EVENTS, _regEventPackage.getName());
      response.send();
      response.getApplicationSession().invalidate();
      return;
    }
   
View Full Code Here


    else if (_watcherInfo.getName().equals(event))
      doWatcherInfoSubscribe(subscribe);
    else
    {
      SipServletResponse response = subscribe.createResponse(SipServletResponse.SC_BAD_EVENT);
      response.addHeader(Constants.ALLOW_EVENTS, _presence.getName());
      response.send();
      response.getApplicationSession().invalidate();
      return;
    }   
  }
View Full Code Here

      if (expires != 0)
      {
        if (expires < _regEventPackage.getMinExpires())
        {
          SipServletResponse response = subscribe.createResponse(SipServletResponse.SC_INTERVAL_TOO_BRIEF);
          response.addHeader(Constants.MIN_EXPIRES, Integer.toString(_regEventPackage.getMinExpires()));
          response.send();
          response.getApplicationSession().invalidate();
          return;
        }
        else if (expires > _regEventPackage.getMaxExpires())
View Full Code Here

      if (expires != 0)
      {
        if (expires < _presence.getMinExpires())
        {
          SipServletResponse response = subscribe.createResponse(SipServletResponse.SC_INTERVAL_TOO_BRIEF);
          response.addHeader(Constants.MIN_EXPIRES, Integer.toString(_presence.getMinExpires()));
          response.send();
          response.getApplicationSession().invalidate();
          return;
        }
        else if (expires > _presence.getMaxExpires())
View Full Code Here

      if (contentType.equals("") ||  supported.contains(contentType))
        return true;
    }
    SipServletResponse response = subscribe.createResponse(SipServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
    for (String s : supported)
      response.addHeader(Constants.ACCEPT, s);

    response.send();
    response.getApplicationSession().invalidate();
    return false;
  }
View Full Code Here

      if (expires != 0)
      {
        if (expires < _watcherInfo.getMinExpires())
        {
          SipServletResponse response = subscribe.createResponse(SipServletResponse.SC_INTERVAL_TOO_BRIEF);
          response.addHeader(Constants.MIN_EXPIRES, Integer.toString(_presence.getMinExpires()));
          response.send();
          response.getApplicationSession().invalidate();
          return;
        }
        else if (expires > _watcherInfo.getMaxExpires())
View Full Code Here

      if (contentType.equals("") ||  supported.contains(contentType))
        return true;
    }
    SipServletResponse response = subscribe.createResponse(SipServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
    for (String s : supported)
      response.addHeader(Constants.ACCEPT, s);

    response.send();
    response.getApplicationSession().invalidate();
    return false;
  }
View Full Code Here

                  expires = _maxExpires;
                }
                else if (expires < _minExpires)
                {
                  SipServletResponse response = register.createResponse(423);
                  response.addHeader("Min-Expires", Integer.toString(_minExpires));
                  response.send();
                  return;
                }
              }
              boolean exist = false;
View Full Code Here

            address.setExpires(binding.getExpires());
            address.setQ(binding.getQ());
            ok.addAddressHeader("contact", address, false);
          }
        }
        ok.addHeader("Date", _dateFormat.format(new Date()));
        ok.send();
     
    }
    catch (Throwable e) {
      log("Caught unexpected exception on REGISTER processing", e);
View Full Code Here

    private void sendErrorResponse(SipServletRequestImpl request, int statusCode, String msg) throws IOException {
        SipServletResponse resp = request.createResponse(statusCode);
        if (msg != null) {
            resp.setStatus(statusCode, msg);
            resp.addHeader("Error-Info", msg);
        }
        resp.send();
    }

    public boolean hasResourcePermissions(SipServletRequest request,
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.