What webhook events are triggered when an inbound ...
# ask-ai
b
What webhook events are triggered when an inbound call is successfully answered and audio starts flowing between participants? Specifically looking for the event that confirms a caller has connected to an AI agent and the conversation has actually begun.
t
Thanks for reaching out, Vishnu. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks for reaching out! I understand you're looking for a way to know exactly when bidirectional audio starts flowing between participants in LiveKit. While there isn't a specific webhook event that signals this moment directly, there are some key events that can really help you follow the call lifecycle: • participant_joined: This happens when a participant joins a room. • track_published: This is triggered when a participant's media track, like audio, is published to the room. It's the closest indicator that audio is available and flowing. • sip_call_started: This event shows when a SIP call has started. For inbound SIP calls, usually the flow goes like this: the SIP call is accepted, a participant joins the room (which triggers participant_joined), and then the audio track gets published (triggering track_published). So, the track_published event is probably your best sign that audio is actively flowing. If you'd like me to walk you through this further or if you have a specific scenario in mind, please don’t hesitate to ask. I’m here to help! Sources: Webhooks | LiveKit Docs | livekit-rtc/livekit/rtc/_proto/ffi_pb2.py | pkg/sip/inbound.go
b
how can we track if the agent said something, any event for that?
t
I'm happy to help you understand how LiveKit tracks when a participant or agent speaks! Here are a few ways you can keep an eye on speech activity: • Active Speaker Detection: The
RoomEvent.ActiveSpeakersChanged
event lets you know whenever the list of active speakers updates. Plus, the
ParticipantEvent.IsSpeakingChanged
event tells you when a specific participant starts or stops speaking, including details about their audio level. • VoicePipelineAgents: You'll find events like
agent_started_speaking
and
agent_stopped_speaking
to track when an agent begins or ends speaking. Similarly,
user_started_speaking
and
user_stopped_speaking
help you monitor user speech activity. • Speech Events: The
speech_created
event fires when new agent speech is generated. Also,
user_state_changed
and
agent_state_changed
events reflect changes in speaking status as part of overall state updates. These tools are great for keeping track of real-time audio activity and building features that respond smoothly. If you'd like, I’d be glad to guide you through implementing any of these—just let me know! Sources: Subscribing to tracks | LiveKit Docs | VoicePipelineAgent | LiveKit Docs | Events and error handling | LiveKit Docs