diff --git a/crates/lxst-telephony/src/lib.rs b/crates/lxst-telephony/src/lib.rs index 004b0b7..acbc8f8 100644 --- a/crates/lxst-telephony/src/lib.rs +++ b/crates/lxst-telephony/src/lib.rs @@ -1298,6 +1298,8 @@ impl TelephonyService { period = wanted; interval = tokio::time::interval(period); } + // Announces keep their own deadline; the idle tick would quantize them to a second. + let next_announce_at = self.next_announce_at; tokio::select! { progressed = self.endpoint.manager.step(), if manager_open => { manager_open = progressed; @@ -1305,6 +1307,16 @@ impl TelephonyService { break; } } + _ = async { + match next_announce_at { + Some(at) => tokio::time::sleep_until(at).await, + None => std::future::pending().await, + } + } => { + if !self.handle_due_announce().await { + break; + } + } control = self.control_rx.recv() => { let Some(control) = control else { break;