Source:
<code>private void addHeadersToMessage(SipServletRequest message, Map<String, ArrayList<String> > headers) { if(headers!=null) { for (Map.Entry<String, ArrayList<String>> entry : headers.entrySet()) { String headerName = entry.getKey(); String headerVal = message.getHeader(headerName); <START> StringBuilder sb = new StringBuilder(); <END> for(String pair : entry.getValue()){ logger.debug("pair="+pair); sb.append(";").append(pair); } if(logger.isDebugEnabled()) { logger.debug("headerName="+headerName+" headerVal="+headerVal+" concatValue="+sb.toString()); } if(!headerName.equalsIgnoreCase("Request-URI")){ if(headerVal!=null && !headerVal.isEmpty()) { message.setHeader(headerName , headerVal+sb.toString()); }else{ message.addHeader(headerName , sb.toString()); } }else{ javax.servlet.sip.URI reqURI = message.getRequestURI(); if(logger.isDebugEnabled()) { logger.debug("ReqURI="+reqURI.toString()+" msgReqURI="+message.getRequestURI()); } for(String keyValPair :entry.getValue()){ String parName = ""; String parVal = ""; int equalsPos = keyValPair.indexOf("="); parName = keyValPair.substring(0, equalsPos); parVal = keyValPair.substring(equalsPos+1); reqURI.setParameter(parName, parVal); if(logger.isDebugEnabled()) { logger.debug("ReqURI pars ="+parName+"="+parVal+" equalsPos="+equalsPos+" keyValPair="+keyValPair); } } message.setRequestURI(reqURI); if(logger.isDebugEnabled()) { logger.debug("ReqURI="+reqURI.toString()+" msgReqURI="+message.getRequestURI()); } } if(logger.isDebugEnabled()) { logger.debug("headerName="+headerName+" headerVal="+message.getHeader(headerName)); } } } }</code><technical_language>@abdulazizali77 put this line 1049 if(headerVal!=null && !headerVal.isEmpty()) {</technical_language>

Target:
private void addHeadersToMessage(SipServletRequest message, Map<String, ArrayList<String> > headers) { if(headers!=null) { for (Map.Entry<String, ArrayList<String>> entry : headers.entrySet()) { String headerName = entry.getKey(); StringBuilder sb = new StringBuilder(); if(entry.getValue() instanceof ArrayList){ for(String pair : entry.getValue()){ sb.append(";").append(pair); } } if(logger.isDebugEnabled()) { logger.debug("headerName="+headerName+" headerVal="+message.getHeader(headerName)+" concatValue="+sb.toString()); } if(!headerName.equalsIgnoreCase("Request-URI")){ try { String headerVal = message.getHeader(headerName); if(headerVal!=null && !headerVal.isEmpty()) { message.setHeader(headerName , headerVal+sb.toString()); }else{ message.addHeader(headerName , sb.toString()); } } catch (IllegalArgumentException iae) { if(logger.isErrorEnabled()) { logger.error("Exception while setting message header: "+iae.getMessage()); } } }else{ javax.servlet.sip.URI reqURI = message.getRequestURI(); if(logger.isDebugEnabled()) { logger.debug("ReqURI="+reqURI.toString()+" msgReqURI="+message.getRequestURI()); } for(String keyValPair :entry.getValue()){ String parName = ""; String parVal = ""; int equalsPos = keyValPair.indexOf("="); parName = keyValPair.substring(0, equalsPos); parVal = keyValPair.substring(equalsPos+1); reqURI.setParameter(parName, parVal); if(logger.isDebugEnabled()) { logger.debug("ReqURI pars ="+parName+"="+parVal+" equalsPos="+equalsPos+" keyValPair="+keyValPair); } } message.setRequestURI(reqURI); if(logger.isDebugEnabled()) { logger.debug("ReqURI="+reqURI.toString()+" msgReqURI="+message.getRequestURI()); } } if(logger.isDebugEnabled()) { logger.debug("headerName="+headerName+" headerVal="+message.getHeader(headerName)); } } } }