docs: @SuppressWarnings("unchecked")
  	public Recording startRecording(String sessionId, RecordingProperties properties)
  			throws OpenViduJavaClientException, OpenViduHttpException {
  
  		HttpPost request = new HttpPost(OpenVidu.urlOpenViduServer + API_RECORDINGS + API_RECORDINGS_START);
  
  		JSONObject json = new JSONObject();
  		json.put("session", sessionId);
  		json.put("name", properties.name());
  		json.put("outputMode", properties.outputMode().name());
  		json.put("hasAudio", properties.hasAudio());
  		json.put("hasVideo", properties.hasVideo());
  
  		if (Recording.OutputMode.COMPOSED.equals(properties.outputMode()) && properties.hasVideo()) {
  			json.put("resolution", properties.resolution());
  			json.put("recordingLayout",
  					(properties.recordingLayout() != null) ? properties.recordingLayout().name() : "");
  			if (RecordingLayout.CUSTOM.equals(properties.recordingLayout())) {
  				json.put("customLayout", (properties.customLayout() != null) ? properties.customLayout() : "");
  			}
  		}
  
  		StringEntity params = null;
  		try {
  			params = new StringEntity(json.toString());
  		} catch (UnsupportedEncodingException e1) {
  			throw new OpenViduJavaClientException(e1.getMessage(), e1.getCause());
  		}
  
  		request.setHeader(HttpHeaders.CONTENT_TYPE, "application/json");
  		request.setEntity(params);
  
  		HttpResponse response;
  		try {
  			response = OpenVidu.httpClient.execute(request);
  		} catch (IOException e2) {
  			throw new OpenViduJavaClientException(e2.getMessage(), e2.getCause());
  		}
  
  		try {
  			int statusCode = response.getStatusLine().getStatusCode();
  			if ((statusCode == org.apache.http.HttpStatus.SC_OK)) {
  				Recording r = new Recording(httpResponseToJson(response));
  				Session activeSession = OpenVidu.activeSessions.get(r.getSessionId());
  				if (activeSession != null) {
  					activeSession.setIsBeingRecorded(true);
  				} else {
  					log.warn("No active session found for sessionId '" + r.getSessionId()
  							+ "'. This instance of OpenVidu Java Client didn't create this session");
  				}
  				return r;
  			} else {
  				throw new OpenViduHttpException(statusCode);
  			}
  		} finally {
  			EntityUtils.consumeQuietly(response.getEntity());
  		}
  	}