faint-arm-51818
09/10/2025, 3:45 PMtall-airline-16756
09/10/2025, 3:45 PMtall-airline-16756
09/10/2025, 3:46 PMcreate_sip_participant()
method to place the call. Keep an eye on the sip.callStatus
attribute to see if the call connects successfully.
2. Detect Voicemail: To know when the call reaches voicemail, you can use voicemail detection with LLM-based tools. This usually works by recognizing the voicemail greeting.
3. Deliver the Voicemail Message: Next, use generate_reply()
to create and play a verbal message. Feel free to customize the message so it fits your needs perfectly.
4. End the Call: Once the message is delivered, simply disconnect the call and tidy up by deleting the room or disconnecting the participant.
If you'd like, I’d be happy to provide more detailed guidance, including code examples and best practices. Just let me know, and I’ll gladly assist you with a complete working template!
Sources: examples/warm-transfer/warm_transfer.py | SIP Integration | livekit/livekit_composite | DeepWiki | Agent Testing & Evaluation | livekit/livekit_composite | DeepWiki | Making calls using SIP | LiveKit Docs | agent.pyfaint-arm-51818
09/10/2025, 3:46 PMsip.callStatus
attribute to see if the call connects successfully?tall-airline-16756
09/10/2025, 3:47 PMsip.callStatus
attribute of the SIP participant. When the sip.callStatus
changes to "active", it means the call is connected — pretty straightforward!
Here’s a simple way to do it:
1. Retrieve the Attribute: Start by accessing the participant’s attributes to get the current sip.callStatus
. For example:
const sipParticipant = remoteParticipants.find((p) => p.identity.startsWith('sip_'));
const sipCallStatus = sipParticipant?.attributes?.['sip.callStatus'];
2. Monitor for Changes: You can use a loop or an event listener to watch for when the status updates to "active". Here’s a Python example:
while perf_counter() - start_time < 30:
call_status = participant.attributes.get("sip.callStatus")
if call_status == "active":
print("Call connected successfully")
break
elif call_status == "hangup":
print("Call failed or was rejected")
break
await asyncio.sleep(0.1)
3. React to Events: Another helpful approach is to listen for the participant_attributes_changed
event to handle updates as they happen:
def on_participant_attributes_changed(changed_attributes, participant):
if 'sip.callStatus' in changed_attributes:
if changed_attributes['sip.callStatus'] == 'active':
print("Call is now active and connected")
If you’d like, I’m here to help with more examples or to walk you through this step-by-step. Just let me know!
Sources: SIP participant | LiveKit Docs | SIP Integration | livekit/livekit_composite | DeepWiki | Making calls using SIP | LiveKit Docs | telephony/sip_lifecycle.py | Make outbound calls | LiveKit Docs