I’m integrating an outbound SIP calling system usi...
# ask-ai
i
I’m integrating an outbound SIP calling system using Twilio. I only want to record the actual conversation (after the callee answers) and not capture the ringing or early media. What is the correct way or the right event to start the egress recording so that it begins only once the call is answered? I tried it when the the sip-callStatus changes to active, still I am missing first few words.
t
Thanks for reaching out, Abdul. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I completely understand the importance of starting egress recording only after the call is answered. You can achieve this by using the
wait_until_answered
parameter when creating a SIP participant. This handy parameter makes sure the API call waits until the callee actually picks up the call. Then, once the call is answered, you can start egress recording programmatically with the
StartRoomCompositeEgress
API. Here’s a simple overview of the steps: 1. Set
wait_until_answered: true
in your SIP participant creation request. 2. Once the call is confirmed as answered, kick off the egress recording using the
StartRoomCompositeEgress
API. This way, you’ll make sure the recording starts right when the conversation begins, avoiding any early media or ringing sounds. If you’d like, I’m here to help with more details or even some code examples—just let me know! Sources: Community & Support | livekit/livekit_composite | DeepWiki | SIP Integration & Telephony | livekit/livekit_composite | DeepWiki | template-default/src/Room.tsx | Recording agent sessions | LiveKit Docs | Session recording and transcripts | LiveKit Docs
i
what happens if i enabled wait_until_answered. will the agent wait or the recording wait?
t
When you enable
wait_until_answered
, the SIP participant creation process will patiently wait until the call is answered before moving forward. This means the API call to create the SIP participant will pause until the callee picks up. Because of this, any actions you take after the participant is created—like starting egress recording—will naturally happen only once the call is answered. This helps make sure the recording starts at just the right moment, capturing the real conversation without including ringing or early media. If you have any questions or need a bit more help, please feel free to reach out—I’m here for you!