feat: federation media forwarding working — audio crosses between relays
Added debug logging to federation signal path. Fixed the announce/recv flow: outbound link's announce_task sends FederationRoomJoin, peer's inbound signal_task receives it and creates virtual participant. Tested: two relays on localhost with mutual TOML config, client A sends tone via relay A, client B records via relay B — audio received through federation (0.1s/RMS 7291/PASS). Room announcement delay is ~1s (poll interval). The full pipeline: client join → room created → announce_task detects → sends signal → peer receives → creates virtual participant → SFU loop forwards media via room-hash-tagged datagrams → peer demuxes → local delivery. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -181,6 +181,7 @@ async fn run_federation_link(
|
|||||||
loop {
|
loop {
|
||||||
match signal_transport.recv_signal().await {
|
match signal_transport.recv_signal().await {
|
||||||
Ok(Some(msg)) => {
|
Ok(Some(msg)) => {
|
||||||
|
info!(peer = %peer_label, "federation: received signal {:?}", std::mem::discriminant(&msg));
|
||||||
match msg {
|
match msg {
|
||||||
SignalMessage::FederationRoomJoin { room, participants } => {
|
SignalMessage::FederationRoomJoin { room, participants } => {
|
||||||
info!(peer = %peer_label, room = %room, count = participants.len(), "federation: peer room join");
|
info!(peer = %peer_label, room = %room, count = participants.len(), "federation: peer room join");
|
||||||
@@ -307,13 +308,19 @@ async fn run_federation_link(
|
|||||||
if participants.is_empty() {
|
if participants.is_empty() {
|
||||||
continue; // only virtual participants, skip
|
continue; // only virtual participants, skip
|
||||||
}
|
}
|
||||||
|
info!(peer = %peer_label2, room = %room_name, local_count = participants.len(), "federation: announcing room to peer");
|
||||||
let msg = SignalMessage::FederationRoomJoin {
|
let msg = SignalMessage::FederationRoomJoin {
|
||||||
room: room_name.clone(),
|
room: room_name.clone(),
|
||||||
participants,
|
participants,
|
||||||
};
|
};
|
||||||
if announce_transport.send_signal(&msg).await.is_ok() {
|
match announce_transport.send_signal(&msg).await {
|
||||||
info!(peer = %peer_label2, room = %room_name, "federation: announced room to peer");
|
Ok(()) => {
|
||||||
announced.insert(room_name.clone());
|
info!(peer = %peer_label2, room = %room_name, "federation: room announced successfully");
|
||||||
|
announced.insert(room_name.clone());
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
warn!(peer = %peer_label2, room = %room_name, "federation: announce send failed: {e}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user