| | |
| | | turn_bridge_config.clone(), |
| | | http.clone(), |
| | | sink.clone(), |
| | | user_participant_identity.clone(), |
| | | participant, |
| | | ); |
| | | } |
| | |
| | | turn_bridge_config: TurnBridgeConfig, |
| | | http: Client, |
| | | sink: Arc<BotAudioOutputSink>, |
| | | expected_participant_identity: Option<String>, |
| | | participant: RemoteParticipant, |
| | | ) -> JoinHandle<()> { |
| | | tokio::spawn(async move { |
| | |
| | | let participant_identity = participant.identity().to_string(); |
| | | let (was_in_speech, is_in_speech, turn) = observe_bound_participant_frame( |
| | | &participant_identity, |
| | | Some(&participant_identity), |
| | | expected_participant_identity.as_deref(), |
| | | vad, |
| | | &call_id, |
| | | &trace_id, |
| | |
| | | realtime_enabled: bool, |
| | | ) { |
| | | let turn_id = format!("turn-{:04}", vad.turn_index); |
| | | let metadata = match AudioIngressMetadata::from_participant(&read_attributes()) { |
| | | let attributes = read_attributes(); |
| | | let origin_status = AudioIngressMetadata::origin_status(&attributes); |
| | | let metadata = match AudioIngressMetadata::from_participant(&attributes) { |
| | | Ok(metadata) => metadata, |
| | | Err(reason) => { |
| | | warn!(call_id = %call_id, trace_id = %trace_id, turn_id = %turn_id, |
| | | reason, "runtime helper asr_realtime_metadata_rejected"); |
| | | reason, origin_status, "runtime helper asr_realtime_metadata_rejected"); |
| | | return; |
| | | } |
| | | }; |
| | |
| | | *last_fixture_sequence = Some(metadata.client_fixture_sequence); |
| | | } |
| | | info!(call_id = %call_id, trace_id = %trace_id, turn_id = %turn_id, |
| | | "runtime helper asr_realtime_session_started"); |
| | | origin_status, "runtime helper asr_realtime_session_started"); |
| | | *upload_slot = Some(upload); |
| | | } |
| | | Err(error) if realtime_enabled => { |
| | |
| | | .expect("second session request"); |
| | | assert!(first_request.contains("\\\"clientFixtureSequence\\\":\\\"fixture-01\\\"")); |
| | | assert!(second_request.contains("\\\"clientFixtureSequence\\\":\\\"fixture-02\\\"")); |
| | | assert!( |
| | | first_request |
| | | .contains("\\\"audioIngressOriginStatus\\\":\\\"controlled_fixture_bound\\\"") |
| | | ); |
| | | assert!( |
| | | second_request |
| | | .contains("\\\"audioIngressOriginStatus\\\":\\\"controlled_fixture_bound\\\"") |
| | | ); |
| | | // The same production boundary rejects a wrong participant before VAD/session creation. |
| | | assert!(!is_bound_user_participant( |
| | | "participant-other", |