How to use livekit.SIPCallInfo to get call data
# ask-ai
f
How to use livekit.SIPCallInfo to get call data
t
Thanks for reaching out, Ayush. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd be happy to help you retrieve SIP call data using
livekit.SIPCallInfo
. To do this, you’ll want to set up a service that listens for the
UpdateSIPCallState
RPC. This RPC is triggered whenever there’s a change in the state of a SIP call, and it includes a
call_info
field that contains a fully populated
livekit.SIPCallInfo
object. Here’s a simple way to get started: 1. Set up a listener for the
UpdateSIPCallState
RPC in your application. 2. When the RPC is triggered, grab the
call_info
field from the
UpdateSIPCallStateRequest
. 3. Use the accessor methods of
livekit.SIPCallInfo
like
GetCallId()
,
GetCallStatus()
, and
GetStartedAtNs()
to get the details you need about the call. Also, if you want to capture the
SIPCallInfo
at a specific moment for logging or archiving, you can use the
RecordCallContext
RPC. If you run into any questions or need a hand with the implementation, just let me know—I’m here to help! Sources: Making outbound calls | LiveKit Docs | rpc/io.pb.go | SIP Integration | livekit/livekit_composite | DeepWiki | Video Conferencing Applications | livekit/livekit_composite | DeepWiki