| | |
| | | F: FnOnce() -> std::collections::HashMap<String, String>, |
| | | { |
| | | if !is_bound_user_participant(participant_identity, expected_participant) { |
| | | warn!( |
| | | "audioIngressOriginStatus" = "wrong_participant_or_track", |
| | | "runtime helper rejected audio participant before VAD/session" |
| | | ); |
| | | return (vad.in_speech, vad.in_speech, None); |
| | | } |
| | | observe_frame_and_start_session( |
| | |
| | | Ok(metadata) => metadata, |
| | | Err(reason) => { |
| | | warn!(call_id = %call_id, trace_id = %trace_id, turn_id = %turn_id, |
| | | reason, origin_status, "runtime helper asr_realtime_metadata_rejected"); |
| | | reason, audioIngressOriginStatus = %AudioIngressMetadata::rejection_status(reason), |
| | | "runtime helper asr_realtime_metadata_rejected"); |
| | | return; |
| | | } |
| | | }; |
| | |
| | | &metadata.client_fixture_sequence, |
| | | ) { |
| | | warn!(call_id = %call_id, trace_id = %trace_id, turn_id = %turn_id, |
| | | audioIngressOriginStatus = "sequence_replayed_or_regressed", |
| | | "runtime helper asr_realtime_metadata_sequence_rejected"); |
| | | return; |
| | | } |
| | |
| | | |
| | | #[cfg(test)] |
| | | mod tests { |
| | | use super::{ |
| | | ReplyChunkMarker, ReplyChunkMarkerState, RuntimeTurnDeviceOutput, RuntimeTurnStreamEvent, |
| | | RuntimeTurnStreamState, RuntimeTurnStreamTimingPhase, runtime_session_nonce_hash, |
| | | should_publish_device_output, |
| | | }; |
| | | use super::*; |
| | | use std::{ |
| | | collections::HashSet, |
| | | io::{Read, Write}, |
| | |
| | | let second_request = request_rx |
| | | .recv_timeout(Duration::from_secs(2)) |
| | | .expect("second session request"); |
| | | assert!(first_request.contains("\\\"clientFixtureSequence\\\":\\\"fixture-01\\\"")); |
| | | assert!(second_request.contains("\\\"clientFixtureSequence\\\":\\\"fixture-02\\\"")); |
| | | assert!(first_request.contains("\"clientFixtureSequence\":\"fixture-01\"")); |
| | | assert!(second_request.contains("\"clientFixtureSequence\":\"fixture-02\"")); |
| | | assert!( |
| | | first_request |
| | | .contains("\\\"audioIngressOriginStatus\\\":\\\"controlled_fixture_bound\\\"") |
| | | first_request.contains("\"audioIngressOriginStatus\":\"controlled_fixture_bound\"") |
| | | ); |
| | | assert!( |
| | | second_request |
| | | .contains("\\\"audioIngressOriginStatus\\\":\\\"controlled_fixture_bound\\\"") |
| | | second_request.contains("\"audioIngressOriginStatus\":\"controlled_fixture_bound\"") |
| | | ); |
| | | // The same production boundary rejects a wrong participant before VAD/session creation. |
| | | assert!(!is_bound_user_participant( |