code: protected void setAuthenticateHeader(MobicentsSipServletRequest request,
      									 MobicentsSipServletResponse response,
                                           MobicentsSipLoginConfig config,
                                           String nOnce) {
      	
          // Get the realm name
          String realmName = ((SipLoginConfig)config).getRealmName();
          if (realmName == null)
              realmName = request.getServerName() + ":"
                  + request.getServerPort();
  
          byte[] buffer = null;
          synchronized (md5Helper) {
              buffer = md5Helper.digest(nOnce.getBytes());
          }
  
          String authenticateHeader = "Digest realm=\"" + realmName + "\", "
              +  "qop=\"auth\", nonce=\"" + nOnce + "\", " + "opaque=\""
              + MD5_ENCODER.encode(buffer) + "\"";
          
          // There are different headers for different types of auth
          if(response.getStatus() == 
          	MobicentsSipServletResponse.SC_PROXY_AUTHENTICATION_REQUIRED) {
          	response.setHeader("Proxy-Authenticate", authenticateHeader);
          } else {
          	response.setHeader("WWW-Authenticate", authenticateHeader);
          }
      }
docs: Generates the WWW-Authenticate header.
  <p>
  The header MUST follow this template :
  <pre>
  WWW-Authenticate    = "WWW-Authenticate" ":" "Digest"
  digest-challenge
  
  digest-challenge    = 1#( realm | [ domain ] | nOnce |
  [ digest-opaque ] |[ stale ] | [ algorithm ] )
  
  realm               = "realm" "=" realm-value
  realm-value         = quoted-string
  domain              = "domain" "=" <"> 1#URI <">
  nonce               = "nonce" "=" nonce-value
  nonce-value         = quoted-string
  opaque              = "opaque" "=" quoted-string
  stale               = "stale" "=" ( "true" | "false" )
  algorithm           = "algorithm" "=" ( "MD5" | token )
  </pre>
  
  @param request HTTP Servlet request
  @param response HTTP Servlet response
  @param config    Login configuration describing how authentication
  should be performed
  @param nOnce nonce token