recording mediasoup stream by Kurento

hello
I tested stream filtering by Korento and everything works very well.

Project link:

What changes should be made in the code to record the stream instead of filtering ?

I applied the following changes for testing.

async function startKurentoFilter() {

  const kmsPipeline = global.kurento.pipeline;
  const recvEndpoint = global.kurento.rtp.recvEndpoint;
  const sendEndpoint = global.kurento.rtp.sendEndpoint;

  //const filter = await kmsPipeline.create("GStreamerFilter", {
    //command: "videobalance saturation=0.0",
  //});
  //global.kurento.filter = filter;

   const recorder = await kmsPipeline.create(
    "RecorderEndpoint", {
      uri : "file:///home/ubuntu/test.webm",
    }
  );

  //await recvEndpoint.connect(filter);
  // await filter.connect(sendEndpoint);

  await recvEndpoint.connect(recorder);
  recorder.record();
}

The file test.webm is created. But its size is zero.
@j1elo can you help me to solve this problem?

fixed problem.