pipeTransport.consume() brings an error "Producer with id not found"

All workers/routers are currently kept on the same host. I have researched several examples (here) and the source code of the pipeToRouter method (here).
Based on these samples, I am doing the following:

  • I am producing audio from the client to RouterA (and it works perfectly, before I used pipeToRouter and everything worked fine).
  • I create a local pipeTransport from RouterB that does not have this producer.
const localTransportB = await localRouterA.createPipeTransport({
            listenInfo: {
                protocol: 'udp',
                ip: config.https.listenIp,
            },
            enableSrtp: true,
            enableSctp: true,
            numSctpStreams: { OS: 1024, MIS: 1024 },
            appData: {
                localRouterId: localRouter.id,
                remoteRouterId,
                remoteTransportServer: remoteServer,
            }
        });
  • Afterwards, I make an HTTP request (currently to the same server) and ask to create a pipeTransport from RouterA (the original router where this audio producer is hosted).
const localTransportA = await localRouterA.createPipeTransport({
            listenInfo: {
                protocol: 'udp',
                ip: config.https.listenIp,
            },
            enableSrtp: true,
            enableSctp: true,
            numSctpStreams: { OS: 1024, MIS: 1024 },
            appData: {
                localRouterId: localRouter.id,
                remoteRouterId,
                remoteTransportServer: remoteServer,
            }
        });
  • Then, I call connection methods in both transports
await localTransport.connect({
            ip: createdTransportIp // tuple data of another transport,
            port: createdTransportPort // tuple data of another transport,
            srtpParameters: createdTransportSrtpParameters // srtp parameters of another transport
        });
  • I am making sure that everything works perfectly by checking the sctpState for “connected”. However, as far as I know, this is not required. You can consume/produce without waiting for this state.

  • I have checked that both transports are connected and have remote ports/ips. The producer is not closed and it is created in RouterA.

  • And here, I attempt to consume the producer from the “remote” TransportB, which was created in the “remote” RouterB without producer.

const pipeConsumer = await localTransportB.consume({
                    producerId: data.producerId,
                });

And it throws an error

I have tried to wait for several seconds to ensure that the transports are connected, but unfortunately, it doesn’t seem to resolve the issue.

Maybe i forgot something?

But there is localRouterA in the code:

const localTransportB = await localRouterA.createPipeTransport({

???