logger.debug("headerName=" + headerName + " headerVal=" + message.getHeader(headerName)); String headerVal = message.getHeader(headerName); StringBuilder sb = new StringBuilder(); try { String headerVal = message.getHeader(headerName); if (headerVal != null && !headerVal.isEmpty()) { if (entry.getValue() instanceof ArrayList) { logger.debug("headerName=" + headerName + " headerVal=" + message.getHeader(headerName));
/** * Check if a client is authenticated. If so, return true. Otherwise request authentication and return false; * @param request * @param storage * @param organizationSid * @return * @throws IOException */ public static boolean checkAuthentication(SipServletRequest request, DaoManager storage, Sid organizationSid) throws IOException { // Make sure we force clients to authenticate. final String authorization = request.getHeader("Proxy-Authorization"); final String method = request.getMethod(); if (authorization == null || !CallControlHelper.permitted(authorization, method, storage, organizationSid)) { if (logger.isDebugEnabled()) { String msg = String.format("Either authorization header is null [if(authorization==null) evaluates %s], or CallControlHelper.permitted() method failed, will send \"407 Proxy Authentication required\"", authorization==null); logger.debug(msg); } authenticate(request, storage.getOrganizationsDao().getOrganization(organizationSid).getDomainName()); return false; } else { return true; } }
final String initialIpBeforeLB = request.getHeader("X-Sip-Balancer-InitialRemoteAddr"); try { if (initialIpBeforeLB != null && !initialIpBeforeLB.isEmpty()) {