code: @SuppressWarnings("unchecked")
  	public ManagerResponse buildResponse(Class<? extends ManagerResponse> responseClass, Map<String, Object> attributes)
      {
          final ManagerResponse response;
          final String responseType = (String) attributes.get(RESPONSE_KEY);
  
          if (RESPONSE_TYPE_ERROR.equalsIgnoreCase(responseType))
          {
              response = new ManagerError();
          }
          else if (responseClass == null)
          {
              response = new ManagerResponse();
          }
          else
          {
              try
              {
                  response = responseClass.newInstance();
              }
              catch (Exception ex)
              {
                  logger.error("Unable to create new instance of " + responseClass.getName(), ex);
                  return null;
              }
          }
  
          setAttributes(response, attributes, ignoredAttributes);
  
          if (response instanceof CommandResponse)
          {
              final CommandResponse commandResponse = (CommandResponse) response;
              final List<String> result = new ArrayList<>();
              //For Asterisk 14
              if(attributes.get(OUTPUT_RESPONSE_KEY) != null){
              	if(attributes.get(OUTPUT_RESPONSE_KEY) instanceof List){
  	            	for(String tmp : (List<String>)attributes.get(OUTPUT_RESPONSE_KEY)){
  	            		if(tmp != null && tmp.length() != 0){
  	            			result.add(tmp.trim());
  	            		}
  	            	}
              	}else{
              		result.add((String)attributes.get(OUTPUT_RESPONSE_KEY));
              	}
              	
              }else{
  	            for (String resultLine : ((String) attributes.get(ManagerReader.COMMAND_RESULT_RESPONSE_KEY)).split("\n"))
  	            {
  	                // on error there is a leading space
  	                if (!resultLine.equals("--END COMMAND--") && !resultLine.equals(" --END COMMAND--"))
  	                {
  	                    result.add(resultLine);
  	                }
  	            }
              }
              commandResponse.setResult(result);
          }
  
          if (response.getResponse() != null && attributes.get(PROXY_RESPONSE_KEY) != null)
          {
              response.setResponse((String) attributes.get(PROXY_RESPONSE_KEY));
          }
  
          // make the map of all attributes available to the response
          // but clone it as it is reused by the ManagerReader
          response.setAttributes(new HashMap<>(attributes));
  
          return response;
      }
docs: Asterisk 14.3.0